Linux Kernel
3.7.1
|
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/gfp.h>
#include <linux/device.h>
#include <linux/ctype.h>
#include <linux/etherdevice.h>
#include <linux/ethtool.h>
#include <linux/if_vlan.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_device * | gether_connect (struct gether *link) |
void | gether_disconnect (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.
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
module_param | ( | host_addr | , |
charp | , | ||
S_IRUGO | |||
) |
MODULE_PARM_DESC | ( | host_addr | , |
"Host Ethernet Address" | |||
) |