usbnet: cdc_ncm: apply usbnet_link_change
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>
This commit is contained in:
parent
4be74c130d
commit
8a34b0ae87
|
@ -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
|
* (carrier is OFF) during attach, so the IP network stack does not
|
||||||
* start IPv6 negotiation and more.
|
* start IPv6 negotiation and more.
|
||||||
*/
|
*/
|
||||||
netif_carrier_off(dev->net);
|
usbnet_link_change(dev, 0, 0);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1106,12 +1106,9 @@ static void cdc_ncm_status(struct usbnet *dev, struct urb *urb)
|
||||||
" %sconnected\n",
|
" %sconnected\n",
|
||||||
ctx->netdev->name, ctx->connected ? "" : "dis");
|
ctx->netdev->name, ctx->connected ? "" : "dis");
|
||||||
|
|
||||||
if (ctx->connected)
|
usbnet_link_change(dev, ctx->connected, 0);
|
||||||
netif_carrier_on(dev->net);
|
if (!ctx->connected)
|
||||||
else {
|
|
||||||
netif_carrier_off(dev->net);
|
|
||||||
ctx->tx_speed = ctx->rx_speed = 0;
|
ctx->tx_speed = ctx->rx_speed = 0;
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case USB_CDC_NOTIFY_SPEED_CHANGE:
|
case USB_CDC_NOTIFY_SPEED_CHANGE:
|
||||||
|
|
Loading…
Reference in New Issue