Skip to content

Commit

Permalink
usbnet: cdc_ncm: apply usbnet_link_change
Browse files Browse the repository at this point in the history
Use the introduced usbnet_link_change to handle link change.

Signed-off-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ming Lei authored and davem330 committed Apr 11, 2013
1 parent 4be74c1 commit 8a34b0a
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions drivers/net/usb/cdc_ncm.c
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ static int cdc_ncm_bind(struct usbnet *dev, struct usb_interface *intf)
* (carrier is OFF) during attach, so the IP network stack does not
* start IPv6 negotiation and more.
*/
netif_carrier_off(dev->net);
usbnet_link_change(dev, 0, 0);
return ret;
}

Expand Down Expand Up @@ -1106,12 +1106,9 @@ static void cdc_ncm_status(struct usbnet *dev, struct urb *urb)
" %sconnected\n",
ctx->netdev->name, ctx->connected ? "" : "dis");

if (ctx->connected)
netif_carrier_on(dev->net);
else {
netif_carrier_off(dev->net);
usbnet_link_change(dev, ctx->connected, 0);
if (!ctx->connected)
ctx->tx_speed = ctx->rx_speed = 0;
}
break;

case USB_CDC_NOTIFY_SPEED_CHANGE:
Expand Down

0 comments on commit 8a34b0a

Please sign in to comment.