Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions | Variables
net1080.c File Reference
#include <linux/module.h>
#include <linux/init.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 <asm/unaligned.h>

Go to the source code of this file.

Data Structures

struct  nc_header
 
struct  nc_trailer
 

Macros

#define frame_errors   data[1]
 
#define MIN_HEADER   6
 
#define PAD_BYTE   ((unsigned char)0xAC)
 
#define FRAMED_SIZE(mtu)
 
#define MIN_FRAMED   FRAMED_SIZE(0)
 
#define NC_MAX_PACKET   32767
 
#define NC_READ_TTL_MS   ((u8)255)
 
#define REG_USBCTL   ((u8)0x04)
 
#define REG_TTL   ((u8)0x10)
 
#define REG_STATUS   ((u8)0x11)
 
#define REQUEST_REGISTER   ((u8)0x10)
 
#define REQUEST_EEPROM   ((u8)0x11)
 
#define USBCTL_WRITABLE_MASK   0x1f0f
 
#define USBCTL_ENABLE_LANG   (1 << 12)
 
#define USBCTL_ENABLE_MFGR   (1 << 11)
 
#define USBCTL_ENABLE_PROD   (1 << 10)
 
#define USBCTL_ENABLE_SERIAL   (1 << 9)
 
#define USBCTL_ENABLE_DEFAULTS   (1 << 8)
 
#define USBCTL_FLUSH_OTHER   (1 << 3)
 
#define USBCTL_FLUSH_THIS   (1 << 2)
 
#define USBCTL_DISCONN_OTHER   (1 << 1)
 
#define USBCTL_DISCONN_THIS   (1 << 0)
 
#define STATUS_PORT_A   (1 << 15)
 
#define STATUS_CONN_OTHER   (1 << 14)
 
#define STATUS_SUSPEND_OTHER   (1 << 13)
 
#define STATUS_MAILBOX_OTHER   (1 << 12)
 
#define STATUS_PACKETS_OTHER(n)   (((n) >> 8) & 0x03)
 
#define STATUS_CONN_THIS   (1 << 6)
 
#define STATUS_SUSPEND_THIS   (1 << 5)
 
#define STATUS_MAILBOX_THIS   (1 << 4)
 
#define STATUS_PACKETS_THIS(n)   (((n) >> 0) & 0x03)
 
#define STATUS_UNSPEC_MASK   0x0c8c
 
#define STATUS_NOISE_MASK   ((u16)~(0x0303|STATUS_UNSPEC_MASK))
 
#define TTL_THIS(ttl)   (0x00ff & ttl)
 
#define TTL_OTHER(ttl)   (0x00ff & (ttl >> 8))
 
#define MK_TTL(this, other)   ((u16)(((other)<<8)|(0x00ff&(this))))
 

Functions

 MODULE_DEVICE_TABLE (usb, products)
 
 module_usb_driver (net1080_driver)
 
 MODULE_AUTHOR ("David Brownell")
 
 MODULE_DESCRIPTION ("NetChip 1080 based USB Host-to-Host Links")
 
 MODULE_LICENSE ("GPL")
 

Variables

struct nc_header __packed
 

Macro Definition Documentation

#define frame_errors   data[1]

Definition at line 43 of file net1080.c.

#define FRAMED_SIZE (   mtu)
Value:
(sizeof (struct nc_header) \
+ (mtu) \
+ 1 \

Definition at line 76 of file net1080.c.

#define MIN_FRAMED   FRAMED_SIZE(0)

Definition at line 82 of file net1080.c.

#define MIN_HEADER   6

Definition at line 62 of file net1080.c.

#define MK_TTL (   this,
  other 
)    ((u16)(((other)<<8)|(0x00ff&(this))))

Definition at line 277 of file net1080.c.

#define NC_MAX_PACKET   32767

Definition at line 85 of file net1080.c.

#define NC_READ_TTL_MS   ((u8)255)

Definition at line 94 of file net1080.c.

#define PAD_BYTE   ((unsigned char)0xAC)

Definition at line 69 of file net1080.c.

#define REG_STATUS   ((u8)0x11)

Definition at line 101 of file net1080.c.

#define REG_TTL   ((u8)0x10)

Definition at line 100 of file net1080.c.

#define REG_USBCTL   ((u8)0x04)

Definition at line 99 of file net1080.c.

#define REQUEST_EEPROM   ((u8)0x11)

Definition at line 107 of file net1080.c.

#define REQUEST_REGISTER   ((u8)0x10)

Definition at line 106 of file net1080.c.

#define STATUS_CONN_OTHER   (1 << 14)

Definition at line 231 of file net1080.c.

#define STATUS_CONN_THIS   (1 << 6)

Definition at line 236 of file net1080.c.

#define STATUS_MAILBOX_OTHER   (1 << 12)

Definition at line 233 of file net1080.c.

#define STATUS_MAILBOX_THIS   (1 << 4)

Definition at line 238 of file net1080.c.

#define STATUS_NOISE_MASK   ((u16)~(0x0303|STATUS_UNSPEC_MASK))

Definition at line 242 of file net1080.c.

#define STATUS_PACKETS_OTHER (   n)    (((n) >> 8) & 0x03)

Definition at line 234 of file net1080.c.

#define STATUS_PACKETS_THIS (   n)    (((n) >> 0) & 0x03)

Definition at line 239 of file net1080.c.

#define STATUS_PORT_A   (1 << 15)

Definition at line 229 of file net1080.c.

#define STATUS_SUSPEND_OTHER   (1 << 13)

Definition at line 232 of file net1080.c.

#define STATUS_SUSPEND_THIS   (1 << 5)

Definition at line 237 of file net1080.c.

#define STATUS_UNSPEC_MASK   0x0c8c

Definition at line 241 of file net1080.c.

#define TTL_OTHER (   ttl)    (0x00ff & (ttl >> 8))

Definition at line 276 of file net1080.c.

#define TTL_THIS (   ttl)    (0x00ff & ttl)

Definition at line 275 of file net1080.c.

#define USBCTL_DISCONN_OTHER   (1 << 1)

Definition at line 199 of file net1080.c.

#define USBCTL_DISCONN_THIS   (1 << 0)

Definition at line 200 of file net1080.c.

#define USBCTL_ENABLE_DEFAULTS   (1 << 8)

Definition at line 195 of file net1080.c.

#define USBCTL_ENABLE_LANG   (1 << 12)

Definition at line 191 of file net1080.c.

#define USBCTL_ENABLE_MFGR   (1 << 11)

Definition at line 192 of file net1080.c.

#define USBCTL_ENABLE_PROD   (1 << 10)

Definition at line 193 of file net1080.c.

#define USBCTL_ENABLE_SERIAL   (1 << 9)

Definition at line 194 of file net1080.c.

#define USBCTL_FLUSH_OTHER   (1 << 3)

Definition at line 197 of file net1080.c.

#define USBCTL_FLUSH_THIS   (1 << 2)

Definition at line 198 of file net1080.c.

#define USBCTL_WRITABLE_MASK   0x1f0f

Definition at line 189 of file net1080.c.

Function Documentation

MODULE_AUTHOR ( "David Brownell"  )
MODULE_DESCRIPTION ( "NetChip 1080 based USB Host-to-Host Links"  )
MODULE_DEVICE_TABLE ( usb  ,
products   
)
MODULE_LICENSE ( "GPL"  )
module_usb_driver ( net1080_driver  )

Variable Documentation