#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/slab.h>
#include <linux/unaligned.h>
#define frame_errors …
struct nc_header { … } __packed;
#define PAD_BYTE …
struct nc_trailer { … } __packed;
#define FRAMED_SIZE(mtu) …
#define MIN_FRAMED …
#define NC_MAX_PACKET …
#define NC_READ_TTL_MS …
#define REG_USBCTL …
#define REG_TTL …
#define REG_STATUS …
#define REQUEST_REGISTER …
#define REQUEST_EEPROM …
static int
nc_vendor_read(struct usbnet *dev, u8 req, u8 regnum, u16 *retval_ptr)
{ … }
static inline int
nc_register_read(struct usbnet *dev, u8 regnum, u16 *retval_ptr)
{ … }
static void
nc_vendor_write(struct usbnet *dev, u8 req, u8 regnum, u16 value)
{ … }
static inline void
nc_register_write(struct usbnet *dev, u8 regnum, u16 value)
{ … }
#if 0
static void nc_dump_registers(struct usbnet *dev)
{
u8 reg;
u16 *vp = kmalloc(sizeof (u16));
if (!vp)
return;
netdev_dbg(dev->net, "registers:\n");
for (reg = 0; reg < 0x20; reg++) {
int retval;
if (reg >= 0x08 && reg <= 0xf)
continue;
if (reg >= 0x12 && reg <= 0x1e)
continue;
retval = nc_register_read(dev, reg, vp);
if (retval < 0)
netdev_dbg(dev->net, "reg [0x%x] ==> error %d\n",
reg, retval);
else
netdev_dbg(dev->net, "reg [0x%x] = 0x%x\n", reg, *vp);
}
kfree(vp);
}
#endif
#define USBCTL_WRITABLE_MASK …
#define USBCTL_ENABLE_LANG …
#define USBCTL_ENABLE_MFGR …
#define USBCTL_ENABLE_PROD …
#define USBCTL_ENABLE_SERIAL …
#define USBCTL_ENABLE_DEFAULTS …
#define USBCTL_FLUSH_OTHER …
#define USBCTL_FLUSH_THIS …
#define USBCTL_DISCONN_OTHER …
#define USBCTL_DISCONN_THIS …
static inline void nc_dump_usbctl(struct usbnet *dev, u16 usbctl)
{ … }
#define STATUS_PORT_A …
#define STATUS_CONN_OTHER …
#define STATUS_SUSPEND_OTHER …
#define STATUS_MAILBOX_OTHER …
#define STATUS_PACKETS_OTHER(n) …
#define STATUS_CONN_THIS …
#define STATUS_SUSPEND_THIS …
#define STATUS_MAILBOX_THIS …
#define STATUS_PACKETS_THIS(n) …
#define STATUS_UNSPEC_MASK …
#define STATUS_NOISE_MASK …
static inline void nc_dump_status(struct usbnet *dev, u16 status)
{ … }
#define TTL_OTHER(ttl) …
#define MK_TTL(this,other) …
static int net1080_reset(struct usbnet *dev)
{ … }
static int net1080_check_connect(struct usbnet *dev)
{ … }
static void nc_ensure_sync(struct usbnet *dev)
{ … }
static int net1080_rx_fixup(struct usbnet *dev, struct sk_buff *skb)
{ … }
static struct sk_buff *
net1080_tx_fixup(struct usbnet *dev, struct sk_buff *skb, gfp_t flags)
{ … }
static int net1080_bind(struct usbnet *dev, struct usb_interface *intf)
{ … }
static const struct driver_info net1080_info = …;
static const struct usb_device_id products [] = …;
MODULE_DEVICE_TABLE(usb, products);
static struct usb_driver net1080_driver = …;
module_usb_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;