summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorDmitry Bezrukov <dmitry.bezrukov@aquantia.com>2018-11-26 09:33:02 +0000
committerDavid S. Miller <davem@davemloft.net>2018-11-27 15:46:06 -0800
commit7cea2d40afd05375d521a0f8e17dec1c1b5806b2 (patch)
tree23f4144a4af804d1f2253d71518f90af0787bbfc /drivers/net
parent17364b805f5b9016bb528241ba91481e3497e5e1 (diff)
downloadlinux-7cea2d40afd05375d521a0f8e17dec1c1b5806b2.tar.gz
linux-7cea2d40afd05375d521a0f8e17dec1c1b5806b2.tar.bz2
linux-7cea2d40afd05375d521a0f8e17dec1c1b5806b2.zip
net: usb: aqc111: Add bind and empty unbind callbacks
Initialize net_device_ops structure Signed-off-by: Dmitry Bezrukov <dmitry.bezrukov@aquantia.com> Signed-off-by: Igor Russkikh <igor.russkikh@aquantia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/usb/aqc111.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/net/usb/aqc111.c b/drivers/net/usb/aqc111.c
index 96aca929b570..a2628856c580 100644
--- a/drivers/net/usb/aqc111.c
+++ b/drivers/net/usb/aqc111.c
@@ -14,8 +14,43 @@
#include <linux/usb/cdc.h>
#include <linux/usb/usbnet.h>
+static const struct net_device_ops aqc111_netdev_ops = {
+ .ndo_open = usbnet_open,
+ .ndo_stop = usbnet_stop,
+};
+
+static int aqc111_bind(struct usbnet *dev, struct usb_interface *intf)
+{
+ struct usb_device *udev = interface_to_usbdev(intf);
+ int ret;
+
+ /* Check if vendor configuration */
+ if (udev->actconfig->desc.bConfigurationValue != 1) {
+ usb_driver_set_configuration(udev, 1);
+ return -ENODEV;
+ }
+
+ usb_reset_configuration(dev->udev);
+
+ ret = usbnet_get_endpoints(dev, intf);
+ if (ret < 0) {
+ netdev_dbg(dev->net, "usbnet_get_endpoints failed");
+ return ret;
+ }
+
+ dev->net->netdev_ops = &aqc111_netdev_ops;
+
+ return 0;
+}
+
+static void aqc111_unbind(struct usbnet *dev, struct usb_interface *intf)
+{
+}
+
static const struct driver_info aqc111_info = {
.description = "Aquantia AQtion USB to 5GbE Controller",
+ .bind = aqc111_bind,
+ .unbind = aqc111_unbind,
};
#define AQC111_USB_ETH_DEV(vid, pid, table) \