Commit 8b53abae authored by Guo-Fu Tseng's avatar Guo-Fu Tseng Committed by David S. Miller

jme: Refill receive unicase MAC addr after resume

The value of the register which holds receive Unicast MAC Address
sometimes get messed-up after resume.
This patch refill it before enabling the hardware filter.
Signed-off-by: default avatarGuo-Fu Tseng <cooldavid@cooldavid.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 854a2e7c
...@@ -898,6 +898,7 @@ jme_enable_rx_engine(struct jme_adapter *jme) ...@@ -898,6 +898,7 @@ jme_enable_rx_engine(struct jme_adapter *jme)
/* /*
* Setup Unicast Filter * Setup Unicast Filter
*/ */
jme_set_unicastaddr(jme->dev);
jme_set_multi(jme->dev); jme_set_multi(jme->dev);
/* /*
...@@ -2114,27 +2115,34 @@ jme_start_xmit(struct sk_buff *skb, struct net_device *netdev) ...@@ -2114,27 +2115,34 @@ jme_start_xmit(struct sk_buff *skb, struct net_device *netdev)
return NETDEV_TX_OK; return NETDEV_TX_OK;
} }
static void
jme_set_unicastaddr(struct net_device *netdev)
{
struct jme_adapter *jme = netdev_priv(netdev);
u32 val;
val = (netdev->dev_addr[3] & 0xff) << 24 |
(netdev->dev_addr[2] & 0xff) << 16 |
(netdev->dev_addr[1] & 0xff) << 8 |
(netdev->dev_addr[0] & 0xff);
jwrite32(jme, JME_RXUMA_LO, val);
val = (netdev->dev_addr[5] & 0xff) << 8 |
(netdev->dev_addr[4] & 0xff);
jwrite32(jme, JME_RXUMA_HI, val);
}
static int static int
jme_set_macaddr(struct net_device *netdev, void *p) jme_set_macaddr(struct net_device *netdev, void *p)
{ {
struct jme_adapter *jme = netdev_priv(netdev); struct jme_adapter *jme = netdev_priv(netdev);
struct sockaddr *addr = p; struct sockaddr *addr = p;
u32 val;
if (netif_running(netdev)) if (netif_running(netdev))
return -EBUSY; return -EBUSY;
spin_lock_bh(&jme->macaddr_lock); spin_lock_bh(&jme->macaddr_lock);
memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
jme_set_unicastaddr(netdev);
val = (addr->sa_data[3] & 0xff) << 24 |
(addr->sa_data[2] & 0xff) << 16 |
(addr->sa_data[1] & 0xff) << 8 |
(addr->sa_data[0] & 0xff);
jwrite32(jme, JME_RXUMA_LO, val);
val = (addr->sa_data[5] & 0xff) << 8 |
(addr->sa_data[4] & 0xff);
jwrite32(jme, JME_RXUMA_HI, val);
spin_unlock_bh(&jme->macaddr_lock); spin_unlock_bh(&jme->macaddr_lock);
return 0; return 0;
......
...@@ -1258,6 +1258,7 @@ static inline int new_phy_power_ctrl(u8 chip_main_rev) ...@@ -1258,6 +1258,7 @@ static inline int new_phy_power_ctrl(u8 chip_main_rev)
*/ */
static int jme_set_settings(struct net_device *netdev, static int jme_set_settings(struct net_device *netdev,
struct ethtool_cmd *ecmd); struct ethtool_cmd *ecmd);
static void jme_set_unicastaddr(struct net_device *netdev);
static void jme_set_multi(struct net_device *netdev); static void jme_set_multi(struct net_device *netdev);
#endif #endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment