summaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/realtek
diff options
context:
space:
mode:
authorJason Wang <jasowang@redhat.com>2011-12-30 23:44:42 +0000
committerDavid S. Miller <davem@davemloft.net>2012-01-03 12:47:50 -0500
commitf872b237c1750221932e715da2552225afe4a95c (patch)
tree02cea369e33f73f09cb4c77f208b4de33d79617b /drivers/net/ethernet/realtek
parent7d03f5a48e4d90854275b06433626243b3b3db17 (diff)
8139cp: properly config rx mode after resuming
Rx mode should be reset after resming, so unconditionally updating rx mode rather than conditionally updating based on the value we remembered, otherwise unexpected value may be used by the nic after resuming. btw. I find and test this when debugging guest hibernation in qemu, as I did not have a 8139cp card in hand, this patch is untested in a physical 8139cp card, plase review it carefully. Signed-off-by: Jason Wang <jasowang@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/realtek')
-rw-r--r--drivers/net/ethernet/realtek/8139cp.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/net/ethernet/realtek/8139cp.c b/drivers/net/ethernet/realtek/8139cp.c
index 886e6bec971..cc6b391479c 100644
--- a/drivers/net/ethernet/realtek/8139cp.c
+++ b/drivers/net/ethernet/realtek/8139cp.c
@@ -859,7 +859,6 @@ static void __cp_set_rx_mode (struct net_device *dev)
struct cp_private *cp = netdev_priv(dev);
u32 mc_filter[2]; /* Multicast hash filter */
int rx_mode;
- u32 tmp;
/* Note: do not reorder, GCC is clever about common statements. */
if (dev->flags & IFF_PROMISC) {
@@ -886,11 +885,9 @@ static void __cp_set_rx_mode (struct net_device *dev)
}
/* We can safely update without stopping the chip. */
- tmp = cp_rx_config | rx_mode;
- if (cp->rx_config != tmp) {
- cpw32_f (RxConfig, tmp);
- cp->rx_config = tmp;
- }
+ cp->rx_config = cp_rx_config | rx_mode;
+ cpw32_f(RxConfig, cp->rx_config);
+
cpw32_f (MAR0 + 0, mc_filter[0]);
cpw32_f (MAR0 + 4, mc_filter[1]);
}