aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/benet
diff options
context:
space:
mode:
authorSathya Perla <sathyap@serverengines.com>2009-08-16 20:58:04 -0400
committerDavid S. Miller <davem@davemloft.net>2009-08-17 20:48:27 -0400
commita65027e4d80ece5a5a3bd4fc4808a83208430929 (patch)
treef054b4cb0afbc6a3ba235969db353b277b58b9ce /drivers/net/benet
parentae6e2aef6c03ccb06c6baaa1b77cc0e0ae226faf (diff)
be2net: Set mac addr in hw regardless of netif_running()
be_mac_addr_set() currently is broken when netif_running() is false. Signed-off-by: Sathya Perla <sathyap@serverengines.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/benet')
-rw-r--r--drivers/net/benet/be_main.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c
index 45507d88e6a1..362346045ed3 100644
--- a/drivers/net/benet/be_main.c
+++ b/drivers/net/benet/be_main.c
@@ -117,23 +117,18 @@ void be_cq_notify(struct be_adapter *adapter, u16 qid, bool arm, u16 num_popped)
117 iowrite32(val, adapter->db + DB_CQ_OFFSET); 117 iowrite32(val, adapter->db + DB_CQ_OFFSET);
118} 118}
119 119
120
121static int be_mac_addr_set(struct net_device *netdev, void *p) 120static int be_mac_addr_set(struct net_device *netdev, void *p)
122{ 121{
123 struct be_adapter *adapter = netdev_priv(netdev); 122 struct be_adapter *adapter = netdev_priv(netdev);
124 struct sockaddr *addr = p; 123 struct sockaddr *addr = p;
125 int status = 0; 124 int status = 0;
126 125
127 if (netif_running(netdev)) { 126 status = be_cmd_pmac_del(adapter, adapter->if_handle, adapter->pmac_id);
128 status = be_cmd_pmac_del(adapter, adapter->if_handle, 127 if (status)
129 adapter->pmac_id); 128 return status;
130 if (status)
131 return status;
132
133 status = be_cmd_pmac_add(adapter, (u8 *)addr->sa_data,
134 adapter->if_handle, &adapter->pmac_id);
135 }
136 129
130 status = be_cmd_pmac_add(adapter, (u8 *)addr->sa_data,
131 adapter->if_handle, &adapter->pmac_id);
137 if (!status) 132 if (!status)
138 memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); 133 memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
139 134