Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
u_ether.h File Reference
#include <linux/err.h>
#include <linux/if_ether.h>
#include <linux/usb/composite.h>
#include <linux/usb/cdc.h>
#include "gadget_chips.h"

Go to the source code of this file.

Data Structures

struct  gether
 

Macros

#define DEFAULT_FILTER
 

Functions

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 *)
 
void gether_disconnect (struct gether *)
 
int geth_bind_config (struct usb_configuration *c, u8 ethaddr[ETH_ALEN])
 
int ecm_bind_config (struct usb_configuration *c, u8 ethaddr[ETH_ALEN])
 
int ncm_bind_config (struct usb_configuration *c, u8 ethaddr[ETH_ALEN])
 
int eem_bind_config (struct usb_configuration *c)
 

Macro Definition Documentation

#define DEFAULT_FILTER

Function Documentation

int ecm_bind_config ( struct usb_configuration c,
u8  ethaddr[ETH_ALEN] 
)

ecm_bind_config - add CDC Ethernet network link to a configuration : the configuration to support the network link : a buffer in which the ethernet address of the host side side of the link was recorded Context: single threaded during gadget setup

Returns zero on success, else negative errno.

Caller must have called (). Caller is also responsible for calling () before module unload.

Definition at line 854 of file f_ecm.c.

int eem_bind_config ( struct usb_configuration c)

eem_bind_config - add CDC Ethernet (EEM) network link to a configuration : the configuration to support the network link Context: single threaded during gadget setup

Returns zero on success, else negative errno.

Caller must have called (). Caller is also responsible for calling () before module unload.

Definition at line 558 of file f_eem.c.

int geth_bind_config ( struct usb_configuration c,
u8  ethaddr[ETH_ALEN] 
)

geth_bind_config - add CDC Subset network link to a configuration : the configuration to support the network link : a buffer in which the ethernet address of the host side side of the link was recorded Context: single threaded during gadget setup

Returns zero on success, else negative errno.

Caller must have called (). Caller is also responsible for calling () before module unload.

Definition at line 407 of file f_subset.c.

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.

int ncm_bind_config ( struct usb_configuration c,
u8  ethaddr[ETH_ALEN] 
)

ncm_bind_config - add CDC Network link to a configuration : the configuration to support the network link : a buffer in which the ethernet address of the host side side of the link was recorded Context: single threaded during gadget setup

Returns zero on success, else negative errno.

Caller must have called (). Caller is also responsible for calling () before module unload.

Definition at line 1302 of file f_ncm.c.