aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/usb/r8152.c')
-rw-r--r--drivers/net/usb/r8152.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
index 32b7ec976dcc..1c27e6fb99f9 100644
--- a/drivers/net/usb/r8152.c
+++ b/drivers/net/usb/r8152.c
@@ -1645,7 +1645,7 @@ static u8 r8152_rx_csum(struct r8152 *tp, struct rx_desc *rx_desc)
1645 u8 checksum = CHECKSUM_NONE; 1645 u8 checksum = CHECKSUM_NONE;
1646 u32 opts2, opts3; 1646 u32 opts2, opts3;
1647 1647
1648 if (tp->version == RTL_VER_01) 1648 if (!(tp->netdev->features & NETIF_F_RXCSUM))
1649 goto return_result; 1649 goto return_result;
1650 1650
1651 opts2 = le32_to_cpu(rx_desc->opts2); 1651 opts2 = le32_to_cpu(rx_desc->opts2);
@@ -1851,6 +1851,9 @@ static int r8152_poll(struct napi_struct *napi, int budget)
1851 napi_complete(napi); 1851 napi_complete(napi);
1852 if (!list_empty(&tp->rx_done)) 1852 if (!list_empty(&tp->rx_done))
1853 napi_schedule(napi); 1853 napi_schedule(napi);
1854 else if (!skb_queue_empty(&tp->tx_queue) &&
1855 !list_empty(&tp->tx_free))
1856 napi_schedule(napi);
1854 } 1857 }
1855 1858
1856 return work_done; 1859 return work_done;
@@ -2990,10 +2993,13 @@ static void set_carrier(struct r8152 *tp)
2990 if (!netif_carrier_ok(netdev)) { 2993 if (!netif_carrier_ok(netdev)) {
2991 tp->rtl_ops.enable(tp); 2994 tp->rtl_ops.enable(tp);
2992 set_bit(RTL8152_SET_RX_MODE, &tp->flags); 2995 set_bit(RTL8152_SET_RX_MODE, &tp->flags);
2996 netif_stop_queue(netdev);
2993 napi_disable(&tp->napi); 2997 napi_disable(&tp->napi);
2994 netif_carrier_on(netdev); 2998 netif_carrier_on(netdev);
2995 rtl_start_rx(tp); 2999 rtl_start_rx(tp);
2996 napi_enable(&tp->napi); 3000 napi_enable(&tp->napi);
3001 netif_wake_queue(netdev);
3002 netif_info(tp, link, netdev, "carrier on\n");
2997 } 3003 }
2998 } else { 3004 } else {
2999 if (netif_carrier_ok(netdev)) { 3005 if (netif_carrier_ok(netdev)) {
@@ -3001,6 +3007,7 @@ static void set_carrier(struct r8152 *tp)
3001 napi_disable(&tp->napi); 3007 napi_disable(&tp->napi);
3002 tp->rtl_ops.disable(tp); 3008 tp->rtl_ops.disable(tp);
3003 napi_enable(&tp->napi); 3009 napi_enable(&tp->napi);
3010 netif_info(tp, link, netdev, "carrier off\n");
3004 } 3011 }
3005 } 3012 }
3006} 3013}
@@ -3385,12 +3392,12 @@ static int rtl8152_pre_reset(struct usb_interface *intf)
3385 if (!netif_running(netdev)) 3392 if (!netif_running(netdev))
3386 return 0; 3393 return 0;
3387 3394
3395 netif_stop_queue(netdev);
3388 napi_disable(&tp->napi); 3396 napi_disable(&tp->napi);
3389 clear_bit(WORK_ENABLE, &tp->flags); 3397 clear_bit(WORK_ENABLE, &tp->flags);
3390 usb_kill_urb(tp->intr_urb); 3398 usb_kill_urb(tp->intr_urb);
3391 cancel_delayed_work_sync(&tp->schedule); 3399 cancel_delayed_work_sync(&tp->schedule);
3392 if (netif_carrier_ok(netdev)) { 3400 if (netif_carrier_ok(netdev)) {
3393 netif_stop_queue(netdev);
3394 mutex_lock(&tp->control); 3401 mutex_lock(&tp->control);
3395 tp->rtl_ops.disable(tp); 3402 tp->rtl_ops.disable(tp);
3396 mutex_unlock(&tp->control); 3403 mutex_unlock(&tp->control);
@@ -3415,12 +3422,14 @@ static int rtl8152_post_reset(struct usb_interface *intf)
3415 if (netif_carrier_ok(netdev)) { 3422 if (netif_carrier_ok(netdev)) {
3416 mutex_lock(&tp->control); 3423 mutex_lock(&tp->control);
3417 tp->rtl_ops.enable(tp); 3424 tp->rtl_ops.enable(tp);
3425 rtl_start_rx(tp);
3418 rtl8152_set_rx_mode(netdev); 3426 rtl8152_set_rx_mode(netdev);
3419 mutex_unlock(&tp->control); 3427 mutex_unlock(&tp->control);
3420 netif_wake_queue(netdev);
3421 } 3428 }
3422 3429
3423 napi_enable(&tp->napi); 3430 napi_enable(&tp->napi);
3431 netif_wake_queue(netdev);
3432 usb_submit_urb(tp->intr_urb, GFP_KERNEL);
3424 3433
3425 return 0; 3434 return 0;
3426} 3435}
@@ -3442,6 +3451,8 @@ static bool delay_autosuspend(struct r8152 *tp)
3442 */ 3451 */
3443 if (!sw_linking && tp->rtl_ops.in_nway(tp)) 3452 if (!sw_linking && tp->rtl_ops.in_nway(tp))
3444 return true; 3453 return true;
3454 else if (!skb_queue_empty(&tp->tx_queue))
3455 return true;
3445 else 3456 else
3446 return false; 3457 return false;
3447} 3458}
@@ -4221,6 +4232,11 @@ static int rtl8152_probe(struct usb_interface *intf,
4221 NETIF_F_HIGHDMA | NETIF_F_FRAGLIST | 4232 NETIF_F_HIGHDMA | NETIF_F_FRAGLIST |
4222 NETIF_F_IPV6_CSUM | NETIF_F_TSO6; 4233 NETIF_F_IPV6_CSUM | NETIF_F_TSO6;
4223 4234
4235 if (tp->version == RTL_VER_01) {
4236 netdev->features &= ~NETIF_F_RXCSUM;
4237 netdev->hw_features &= ~NETIF_F_RXCSUM;
4238 }
4239
4224 netdev->ethtool_ops = &ops; 4240 netdev->ethtool_ops = &ops;
4225 netif_set_gso_max_size(netdev, RTL_LIMITED_TSO_SIZE); 4241 netif_set_gso_max_size(netdev, RTL_LIMITED_TSO_SIZE);
4226 4242