提交 8a34b0ae 编写于 作者: M Ming Lei 提交者: David S. Miller

usbnet: cdc_ncm: apply usbnet_link_change

Use the introduced usbnet_link_change to handle link change.
Signed-off-by: NMing Lei <ming.lei@canonical.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 4be74c13
......@@ -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;
}
......@@ -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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册