[PATCH 17/24] net: usb: add hook for link changes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx>
---
 drivers/net/usb/usbnet.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index 83e2c7a9e2..9ddbc50c0a 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -158,13 +158,22 @@ static int usbnet_init(struct eth_device *edev)
 	return 0;
 }
 
+static void usbnet_adjust_link(struct eth_device *edev)
+{
+	struct usbnet		*dev = (struct usbnet*)edev->priv;
+	struct driver_info      *info = dev->driver_info;
+
+	if (info->link_reset)
+		info->link_reset(dev);
+}
+
 static int usbnet_open(struct eth_device *edev)
 {
 	struct usbnet		*dev = (struct usbnet*)edev->priv;
 
 	dev_dbg(&edev->dev, "%s\n",__func__);
 
-	return phy_device_connect(edev, &dev->miibus, dev->phy_addr, NULL,
+	return phy_device_connect(edev, &dev->miibus, dev->phy_addr, usbnet_adjust_link,
 				0, PHY_INTERFACE_MODE_NA);
 }
 
-- 
2.26.0.rc2


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux