[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1457687446-109867-6-git-send-email-huangdaode@hisilicon.com>
Date: Fri, 11 Mar 2016 17:10:45 +0800
From: Daode Huang <huangdaode@...ilicon.com>
To: <davem@...emloft.net>
CC: <liguozhu@...ilicon.com>, <Yisen.Zhuang@...wei.com>,
<linux-kernel@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>, <netdev@...r.kernel.org>,
<linuxarm@...wei.com>, <salil.mehta@...wei.com>,
<huangdaode@...ilicon.com>, <kenneth-lee-2012@...mail.com>,
<xuwei5@...ilicon.com>, <lisheng011@...wei.com>,
<yankejian@...wei.com>
Subject: [PATCH V2 net 5/6] net: hns: fixed service-ges setting MAC-addr bug
from: Sheng Li <lisheng011@...wei.com>
Service gmacs can not set mac add, this patch will fix the bug.
Signed-off-by: Daode Huang <huangdaode@...ilicon.com>
Signed-off-by: Sheng Li <lisheng011@...wei.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
Powered by blists - more mailing lists