Commit aece4770 authored by Hayes Wang's avatar Hayes Wang Committed by David S. Miller

r8152: set rx mode early when linking on

Set rx mode before calling netif_wake_queue() when linking on to avoid
the device missing the receiving packets.

The transmission may start after calling netif_wake_queue(), and the
packets of resopnse may reach before calling rtl8152_set_rx_mode()
which let the device could receive packets. Then, the packets of
response would be missed.
Signed-off-by: default avatarHayes Wang <hayeswang@realtek.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ea6499e1
...@@ -3795,11 +3795,12 @@ static void set_carrier(struct r8152 *tp) ...@@ -3795,11 +3795,12 @@ static void set_carrier(struct r8152 *tp)
if (speed & LINK_STATUS) { if (speed & LINK_STATUS) {
if (!netif_carrier_ok(netdev)) { if (!netif_carrier_ok(netdev)) {
tp->rtl_ops.enable(tp); tp->rtl_ops.enable(tp);
set_bit(RTL8152_SET_RX_MODE, &tp->flags);
netif_stop_queue(netdev); netif_stop_queue(netdev);
napi_disable(napi); napi_disable(napi);
netif_carrier_on(netdev); netif_carrier_on(netdev);
rtl_start_rx(tp); rtl_start_rx(tp);
clear_bit(RTL8152_SET_RX_MODE, &tp->flags);
_rtl8152_set_rx_mode(netdev);
napi_enable(&tp->napi); napi_enable(&tp->napi);
netif_wake_queue(netdev); netif_wake_queue(netdev);
netif_info(tp, link, netdev, "carrier on\n"); netif_info(tp, link, netdev, "carrier on\n");
...@@ -4259,7 +4260,7 @@ static int rtl8152_post_reset(struct usb_interface *intf) ...@@ -4259,7 +4260,7 @@ static int rtl8152_post_reset(struct usb_interface *intf)
mutex_lock(&tp->control); mutex_lock(&tp->control);
tp->rtl_ops.enable(tp); tp->rtl_ops.enable(tp);
rtl_start_rx(tp); rtl_start_rx(tp);
rtl8152_set_rx_mode(netdev); _rtl8152_set_rx_mode(netdev);
mutex_unlock(&tp->control); mutex_unlock(&tp->control);
} }
......
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