diff options
author | Guo-Fu Tseng <cooldavid@cooldavid.org> | 2011-02-13 13:27:40 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-02-13 23:43:23 -0500 |
commit | 8b53abae582cee9a17320460e0f05474097192b6 (patch) | |
tree | cf8f25a7853ddcde2ca67c35db7e5e9e6b1a9218 /drivers/net/jme.c | |
parent | 854a2e7c331a36244169626ba8e11e15d134cb5f (diff) |
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: Guo-Fu Tseng <cooldavid@cooldavid.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/jme.c')
-rw-r--r-- | drivers/net/jme.c | 28 |
1 files changed, 18 insertions, 10 deletions
diff --git a/drivers/net/jme.c b/drivers/net/jme.c index dd4132443b7b..ed35e17f43dc 100644 --- a/drivers/net/jme.c +++ b/drivers/net/jme.c | |||
@@ -898,6 +898,7 @@ jme_enable_rx_engine(struct jme_adapter *jme) | |||
898 | /* | 898 | /* |
899 | * Setup Unicast Filter | 899 | * Setup Unicast Filter |
900 | */ | 900 | */ |
901 | jme_set_unicastaddr(jme->dev); | ||
901 | jme_set_multi(jme->dev); | 902 | jme_set_multi(jme->dev); |
902 | 903 | ||
903 | /* | 904 | /* |
@@ -2114,27 +2115,34 @@ jme_start_xmit(struct sk_buff *skb, struct net_device *netdev) | |||
2114 | return NETDEV_TX_OK; | 2115 | return NETDEV_TX_OK; |
2115 | } | 2116 | } |
2116 | 2117 | ||
2118 | static void | ||
2119 | jme_set_unicastaddr(struct net_device *netdev) | ||
2120 | { | ||
2121 | struct jme_adapter *jme = netdev_priv(netdev); | ||
2122 | u32 val; | ||
2123 | |||
2124 | val = (netdev->dev_addr[3] & 0xff) << 24 | | ||
2125 | (netdev->dev_addr[2] & 0xff) << 16 | | ||
2126 | (netdev->dev_addr[1] & 0xff) << 8 | | ||
2127 | (netdev->dev_addr[0] & 0xff); | ||
2128 | jwrite32(jme, JME_RXUMA_LO, val); | ||
2129 | val = (netdev->dev_addr[5] & 0xff) << 8 | | ||
2130 | (netdev->dev_addr[4] & 0xff); | ||
2131 | jwrite32(jme, JME_RXUMA_HI, val); | ||
2132 | } | ||
2133 | |||
2117 | static int | 2134 | static int |
2118 | jme_set_macaddr(struct net_device *netdev, void *p) | 2135 | jme_set_macaddr(struct net_device *netdev, void *p) |
2119 | { | 2136 | { |
2120 | struct jme_adapter *jme = netdev_priv(netdev); | 2137 | struct jme_adapter *jme = netdev_priv(netdev); |
2121 | struct sockaddr *addr = p; | 2138 | struct sockaddr *addr = p; |
2122 | u32 val; | ||
2123 | 2139 | ||
2124 | if (netif_running(netdev)) | 2140 | if (netif_running(netdev)) |
2125 | return -EBUSY; | 2141 | return -EBUSY; |
2126 | 2142 | ||
2127 | spin_lock_bh(&jme->macaddr_lock); | 2143 | spin_lock_bh(&jme->macaddr_lock); |
2128 | memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); | 2144 | memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); |
2129 | 2145 | jme_set_unicastaddr(netdev); | |
2130 | val = (addr->sa_data[3] & 0xff) << 24 | | ||
2131 | (addr->sa_data[2] & 0xff) << 16 | | ||
2132 | (addr->sa_data[1] & 0xff) << 8 | | ||
2133 | (addr->sa_data[0] & 0xff); | ||
2134 | jwrite32(jme, JME_RXUMA_LO, val); | ||
2135 | val = (addr->sa_data[5] & 0xff) << 8 | | ||
2136 | (addr->sa_data[4] & 0xff); | ||
2137 | jwrite32(jme, JME_RXUMA_HI, val); | ||
2138 | spin_unlock_bh(&jme->macaddr_lock); | 2146 | spin_unlock_bh(&jme->macaddr_lock); |
2139 | 2147 | ||
2140 | return 0; | 2148 | return 0; |