#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/skbuff.h>
#include <linux/spinlock.h>
#include <linux/ethtool.h>
#include <linux/crc32.h>
#include <linux/bitops.h>
#include <linux/gfp.h>
#include <linux/uaccess.h>
#undef DEBUG
#include <linux/usb.h>
#define DRIVER_VERSION …
#define DRIVER_AUTHOR …
#define DRIVER_DESC …
#define SHORT_DRIVER_DESC …
MODULE_AUTHOR(…);
MODULE_DESCRIPTION(…);
MODULE_LICENSE(…) …;
static const char driver_name[] = …;
#define STATS_UPDATE …
#define TX_TIMEOUT …
#define PKT_SZ …
#define RX_MAX_BURST …
#define TX_MAX_BURST …
#define CTRL_QUEUE …
#define RX_PKT_SZ …
enum control_requests { … };
enum register_offsets { … };
enum eth_stats { … };
enum op_mode_bits { … };
enum rx_filter_bits { … };
enum led_values { … };
enum link_status { … };
#define CTRL_RUNNING …
#define RX_RUNNING …
#define TX_RUNNING …
struct catc { … };
#define catc_get_mac(catc, mac) …
#define catc_reset(catc) …
#define catc_set_reg(catc, reg, val) …
#define catc_get_reg(catc, reg, buf) …
#define catc_write_mem(catc, addr, buf, size) …
#define catc_read_mem(catc, addr, buf, size) …
#define f5u011_rxmode(catc, rxmode) …
#define f5u011_rxmode_async(catc, rxmode) …
#define f5u011_mchash_async(catc, hash) …
#define catc_set_reg_async(catc, reg, val) …
#define catc_get_reg_async(catc, reg, cb) …
#define catc_write_mem_async(catc, addr, buf, size) …
static void catc_rx_done(struct urb *urb)
{ … }
static void catc_irq_done(struct urb *urb)
{ … }
static int catc_tx_run(struct catc *catc)
{ … }
static void catc_tx_done(struct urb *urb)
{ … }
static netdev_tx_t catc_start_xmit(struct sk_buff *skb,
struct net_device *netdev)
{ … }
static void catc_tx_timeout(struct net_device *netdev, unsigned int txqueue)
{ … }
static int catc_ctrl_msg(struct catc *catc, u8 dir, u8 request, u16 value, u16 index, void *buf, int len)
{ … }
static void catc_ctrl_run(struct catc *catc)
{ … }
static void catc_ctrl_done(struct urb *urb)
{ … }
static int catc_ctrl_async(struct catc *catc, u8 dir, u8 request, u16 value,
u16 index, void *buf, int len, void (*callback)(struct catc *catc, struct ctrl_queue *q))
{ … }
static void catc_stats_done(struct catc *catc, struct ctrl_queue *q)
{ … }
static void catc_stats_timer(struct timer_list *t)
{ … }
static void catc_multicast(const unsigned char *addr, u8 *multicast)
{ … }
static void catc_set_multicast_list(struct net_device *netdev)
{ … }
static void catc_get_drvinfo(struct net_device *dev,
struct ethtool_drvinfo *info)
{ … }
static int catc_get_link_ksettings(struct net_device *dev,
struct ethtool_link_ksettings *cmd)
{ … }
static const struct ethtool_ops ops = …;
static int catc_open(struct net_device *netdev)
{ … }
static int catc_stop(struct net_device *netdev)
{ … }
static const struct net_device_ops catc_netdev_ops = …;
static int catc_probe(struct usb_interface *intf, const struct usb_device_id *id)
{ … }
static void catc_disconnect(struct usb_interface *intf)
{ … }
static const struct usb_device_id catc_id_table[] = …;
MODULE_DEVICE_TABLE(usb, catc_id_table);
static struct usb_driver catc_driver = …;
module_usb_driver(…) …;