Linux Kernel
3.7.1
|
#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_device * | gether_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) |
#define DEFAULT_FILTER |
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.
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.
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.
|
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.
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.
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
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.