// SPDX-License-Identifier: GPL-2.0-or-later /* * GeneSys GL620USB-A based links * Copyright (C) 2001 by Jiun-Jie Huang <[email protected]> * Copyright (C) 2001 by Stanislav Brabec <[email protected]> */ // #define DEBUG // error path messages, extra info // #define VERBOSE // more; success messages #include <linux/module.h> #include <linux/netdevice.h> #include <linux/etherdevice.h> #include <linux/ethtool.h> #include <linux/workqueue.h> #include <linux/mii.h> #include <linux/usb.h> #include <linux/usb/usbnet.h> #include <linux/gfp.h> /* * GeneSys GL620USB-A (www.genesyslogic.com.tw) * * ... should partially interop with the Win32 driver for this hardware. * The GeneSys docs imply there's some NDIS issue motivating this framing. * * Some info from GeneSys: * - GL620USB-A is full duplex; GL620USB is only half duplex for bulk. * (Some cables, like the BAFO-100c, use the half duplex version.) * - For the full duplex model, the low bit of the version code says * which side is which ("left/right"). * - For the half duplex type, a control/interrupt handshake settles * the transfer direction. (That's disabled here, partially coded.) * A control URB would block until other side writes an interrupt. * * Original code from Jiun-Jie Huang <[email protected]> * and merged into "usbnet" by Stanislav Brabec <[email protected]>. */ // control msg write command #define GENELINK_CONNECT_WRITE … // interrupt pipe index #define GENELINK_INTERRUPT_PIPE … // interrupt read buffer size #define INTERRUPT_BUFSIZE … // interrupt pipe interval value #define GENELINK_INTERRUPT_INTERVAL … // max transmit packet number per transmit #define GL_MAX_TRANSMIT_PACKETS … // max packet length #define GL_MAX_PACKET_LEN … // max receive buffer size #define GL_RCV_BUF_SIZE … struct gl_packet { … }; struct gl_header { … }; static int genelink_rx_fixup(struct usbnet *dev, struct sk_buff *skb) { … } static struct sk_buff * genelink_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags) { … } static int genelink_bind(struct usbnet *dev, struct usb_interface *intf) { … } static const struct driver_info genelink_info = …; static const struct usb_device_id products [] = …; MODULE_DEVICE_TABLE(usb, products); static struct usb_driver gl620a_driver = …; module_usb_driver(…) …; MODULE_AUTHOR(…) …; MODULE_DESCRIPTION(…) …; MODULE_LICENSE(…) …;