Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
u_ether.c File Reference
#include <linux/kernel.h>
#include <linux/gfp.h>
#include <linux/device.h>
#include <linux/ctype.h>
#include <linux/etherdevice.h>
#include <linux/ethtool.h>
#include "u_ether.h"

Go to the source code of this file.

Data Structures

struct  eth_dev
 

Macros

#define UETH__VERSION   "29-May-2008"
 
#define WORK_RX_MEMORY   0
 
#define RX_EXTRA   20 /* bytes guarding against rx overflows */
 
#define DEFAULT_QLEN   2 /* double buffering by default */
 
#define xprintk(d, level, fmt, args...)   printk(level "%s: " fmt , (d)->net->name , ## args)
 
#define DBG(dev, fmt, args...)   do { } while (0)
 
#define VDBG(dev, fmt, args...)   do { } while (0)
 
#define ERROR(dev, fmt, args...)   xprintk(dev , KERN_ERR , fmt , ## args)
 
#define INFO(dev, fmt, args...)   xprintk(dev , KERN_INFO , fmt , ## args)
 

Functions

 module_param (qmult, uint, S_IRUGO|S_IWUSR)
 
 MODULE_PARM_DESC (qmult,"queue length multiplier at high/super speed")
 
 module_param (dev_addr, charp, S_IRUGO)
 
 MODULE_PARM_DESC (dev_addr,"Device Ethernet Address")
 
 module_param (host_addr, charp, S_IRUGO)
 
 MODULE_PARM_DESC (host_addr,"Host Ethernet Address")
 
int gether_setup_name (struct usb_gadget *g, u8 ethaddr[ETH_ALEN], const char *netname)
 
void gether_cleanup (void)
 
struct net_devicegether_connect (struct gether *link)
 
void gether_disconnect (struct gether *link)
 

Macro Definition Documentation

#define DBG (   dev,
  fmt,
  args... 
)    do { } while (0)

Definition at line 119 of file u_ether.c.

#define DEFAULT_QLEN   2 /* double buffering by default */

Definition at line 84 of file u_ether.c.

#define ERROR (   dev,
  fmt,
  args... 
)    xprintk(dev , KERN_ERR , fmt , ## args)

Definition at line 130 of file u_ether.c.

#define INFO (   dev,
  fmt,
  args... 
)    xprintk(dev , KERN_INFO , fmt , ## args)

Definition at line 132 of file u_ether.c.

#define RX_EXTRA   20 /* bytes guarding against rx overflows */

Definition at line 82 of file u_ether.c.

#define UETH__VERSION   "29-May-2008"

Definition at line 47 of file u_ether.c.

#define VDBG (   dev,
  fmt,
  args... 
)    do { } while (0)

Definition at line 126 of file u_ether.c.

#define WORK_RX_MEMORY   0

Definition at line 74 of file u_ether.c.

#define xprintk (   d,
  level,
  fmt,
  args... 
)    printk(level "%s: " fmt , (d)->net->name , ## args)

Definition at line 111 of file u_ether.c.

Function Documentation

void gether_cleanup ( void  )

gether_cleanup - remove Ethernet-over-USB device Context: may sleep

This is called to free all resources allocated by ().

Definition at line 824 of file u_ether.c.

struct net_device* gether_connect ( struct gether link)
read

gether_connect - notify network layer that USB link is active the USB link, set up with endpoints, descriptors matching current device speed, and any framing wrapper(s) set up. Context: irqs blocked

This is called to activate endpoints and let the network layer know the connection is active ("carrier detect"). It may cause the I/O queues to open and start letting network packets flow, but will in any case activate the endpoints so that they respond properly to the USB host.

Verify net_device pointer returned using IS_ERR(). If it doesn't indicate some error code (negative errno), ep->driver_data values have been overwritten.

Definition at line 853 of file u_ether.c.

void gether_disconnect ( struct gether link)

gether_disconnect - notify network layer that USB link is inactive the USB link, on which gether_connect() was called Context: irqs blocked

This is called to deactivate endpoints and let the network layer know the connection went inactive ("no carrier").

On return, the state is as if gether_connect() had never been called. The endpoints are inactive, and accordingly without active USB I/O. Pointers to endpoint descriptors and endpoint private data are nulled.

Definition at line 929 of file u_ether.c.

int gether_setup_name ( struct usb_gadget g,
u8  ethaddr[ETH_ALEN],
const char netname 
)

gether_setup_name - initialize one ethernet-over-usb link : gadget to associated with these links : NULL, or a buffer in which the ethernet address of the host side of the link is recorded : name for network device (for example, "usb") Context: may sleep

This sets up the single network link that may be exported by a gadget driver using this framework. The link layer addresses are set up using module parameters.

Returns negative errno, or zero on success

Definition at line 753 of file u_ether.c.

module_param ( qmult  ,
uint  ,
S_IRUGO S_IWUSR 
)
module_param ( dev_addr  ,
charp  ,
S_IRUGO   
)
module_param ( host_addr  ,
charp  ,
S_IRUGO   
)
MODULE_PARM_DESC ( qmult  ,
"queue length multiplier at high/super speed  
)
MODULE_PARM_DESC ( dev_addr  ,
"Device Ethernet Address  
)
MODULE_PARM_DESC ( host_addr  ,
"Host Ethernet Address  
)