From: Daode Huang <huangdaode@hisilicon.com>
To: <davem@davemloft.net>
Cc: <liguozhu@hisilicon.com>, <Yisen.Zhuang@huawei.com>,
<linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>, <netdev@vger.kernel.org>,
<linuxarm@huawei.com>, <salil.mehta@huawei.com>,
<huangdaode@hisilicon.com>, <kenneth-lee-2012@foxmail.com>,
<xuwei5@hisilicon.com>, <lisheng011@huawei.com>,
<yankejian@huawei.com>
Subject: [PATCH V2 net 5/6] net: hns: fixed service-ges setting MAC-addr bug
Date: Fri, 11 Mar 2016 17:10:45 +0800 [thread overview]
Message-ID: <1457687446-109867-6-git-send-email-huangdaode@hisilicon.com> (raw)
In-Reply-To: <1457687446-109867-1-git-send-email-huangdaode@hisilicon.com>
from: Sheng Li <lisheng011@huawei.com>
Service gmacs can not set mac add, this patch will fix the bug.
Signed-off-by: Daode Huang <huangdaode@hisilicon.com>
Signed-off-by: Sheng Li <lisheng011@huawei.com>
---
drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c
index 2591a51..eb86178 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_gmac.c
@@ -414,18 +414,17 @@ static void hns_gmac_set_mac_addr(void *mac_drv, char *mac_addr)
{
struct mac_driver *drv = (struct mac_driver *)mac_drv;
- if (drv->mac_id >= DSAF_SERVICE_NW_NUM) {
- u32 high_val = mac_addr[1] | (mac_addr[0] << 8);
+ u32 high_val = mac_addr[1] | (mac_addr[0] << 8);
- u32 low_val = mac_addr[5] | (mac_addr[4] << 8)
- | (mac_addr[3] << 16) | (mac_addr[2] << 24);
+ u32 low_val = mac_addr[5] | (mac_addr[4] << 8)
+ | (mac_addr[3] << 16) | (mac_addr[2] << 24);
- u32 val = dsaf_read_dev(drv, GMAC_STATION_ADDR_HIGH_2_REG);
- u32 sta_addr_en = dsaf_get_bit(val, GMAC_ADDR_EN_B);
- dsaf_write_dev(drv, GMAC_STATION_ADDR_LOW_2_REG, low_val);
- dsaf_write_dev(drv, GMAC_STATION_ADDR_HIGH_2_REG,
- high_val | (sta_addr_en << GMAC_ADDR_EN_B));
- }
+ u32 val = dsaf_read_dev(drv, GMAC_STATION_ADDR_HIGH_2_REG);
+ u32 sta_addr_en = dsaf_get_bit(val, GMAC_ADDR_EN_B);
+
+ dsaf_write_dev(drv, GMAC_STATION_ADDR_LOW_2_REG, low_val);
+ dsaf_write_dev(drv, GMAC_STATION_ADDR_HIGH_2_REG,
+ high_val | (sta_addr_en << GMAC_ADDR_EN_B));
}
static int hns_gmac_config_loopback(void *mac_drv, enum hnae_loop loop_mode,
--
1.9.1
next prev parent reply other threads:[~2016-03-11 9:10 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-11 9:10 [PATCH V2 net 0/6] net: hns: hns driver updates Daode Huang
2016-03-11 9:10 ` [PATCH V2 net 1/6] net: hns: bug fix about the overflow of mss Daode Huang
2016-03-11 9:10 ` [PATCH V2 net 2/6] net: hns: fixes the hw interrupt bug in using napi Daode Huang
2016-03-11 9:10 ` [PATCH V2 net 3/6] net: hns: fixed portid bug in sending manage pkt Daode Huang
2016-03-11 9:10 ` [PATCH V2 net 4/6] net: hns: adds uc match for debug port Daode Huang
2016-03-11 9:10 ` Daode Huang [this message]
2016-03-11 9:10 ` [PATCH V2 net 6/6] net: hns: bug fix of getting hilink status Daode Huang
2016-03-15 1:56 ` [PATCH V2 net 0/6] net: hns: hns driver updates Daode Huang
2016-03-15 2:45 ` David Miller
2016-03-15 6:43 ` Daode Huang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1457687446-109867-6-git-send-email-huangdaode@hisilicon.com \
--to=huangdaode@hisilicon.com \
--cc=Yisen.Zhuang@huawei.com \
--cc=davem@davemloft.net \
--cc=kenneth-lee-2012@foxmail.com \
--cc=liguozhu@hisilicon.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=lisheng011@huawei.com \
--cc=netdev@vger.kernel.org \
--cc=salil.mehta@huawei.com \
--cc=xuwei5@hisilicon.com \
--cc=yankejian@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).