/* protocol/interface state */ struct net_device *net; int msg_enable; unsignedlong data[5];
u32 xid;
u32 hard_mtu; /* count any extra framing */
size_t rx_urb_size; /* size for rx urbs */ struct mii_if_info mii; long rx_speed; /* If MII not used */ long tx_speed; /* If MII not used */ # define SPEED_UNSET -1
#define FLAG_FRAMING_AX 0x0040 /* AX88772/178 packets */ #define FLAG_WLAN 0x0080 /* use "wlan%d" names */ #define FLAG_AVOID_UNLINK_URBS 0x0100 /* don't unlink urbs at usbnet_stop() */ #define FLAG_SEND_ZLP 0x0200 /* hw requires ZLPs are sent */ #define FLAG_WWAN 0x0400 /* use "wwan%d" names */
#define FLAG_LINK_INTR 0x0800 /* updates link (carrier) status */
#define FLAG_POINTTOPOINT 0x1000 /* possibly use "usb%d" names */
/* * Indicates to usbnet, that USB driver accumulates multiple IP packets. * Affects statistic (counters) and short packet handling.
*/ #define FLAG_MULTI_PACKET 0x2000 #define FLAG_RX_ASSEMBLE 0x4000 /* rx packets may span >1 frames */ #define FLAG_NOARP 0x8000 /* device can't do ARP */
/* init device ... can sleep, or cause probe() failure */ int (*bind)(struct usbnet *, struct usb_interface *);
/* cleanup device ... can sleep, but can't fail */ void (*unbind)(struct usbnet *, struct usb_interface *);
/* reset device ... can sleep */ int (*reset)(struct usbnet *);
/* stop device ... can sleep */ int (*stop)(struct usbnet *);
/* see if peer is connected ... can sleep */ int (*check_connect)(struct usbnet *);
/* (dis)activate runtime power management */ int (*manage_power)(struct usbnet *, int);
/* for status polling */ void (*status)(struct usbnet *, struct urb *);
/* link reset handling, called from defer_kevent */ int (*link_reset)(struct usbnet *);
/* recover from timeout */ void (*recover)(struct usbnet *dev);
/* early initialization code, can sleep. This is for minidrivers * having 'subminidrivers' that need to do extra initialization
* right after minidriver have initialized hardware. */ int (*early_init)(struct usbnet *dev);
/* called by minidriver when receiving indication */ void (*indication)(struct usbnet *dev, void *ind, int indlen);
/* Drivers that reuse some of the standard USB CDC infrastructure * (notably, using multiple interfaces according to the CDC * union descriptor) get some helper code.
*/ struct cdc_state { struct usb_cdc_header_desc *header; struct usb_cdc_union_desc *u; struct usb_cdc_ether_desc *ether; struct usb_interface *control; struct usb_interface *data;
};
/* CDC and RNDIS support the same host-chosen packet filters for IN transfers */ #define DEFAULT_FILTER (USB_CDC_PACKET_TYPE_BROADCAST \
|USB_CDC_PACKET_TYPE_ALL_MULTICAST \
|USB_CDC_PACKET_TYPE_PROMISCUOUS \
|USB_CDC_PACKET_TYPE_DIRECTED)
/* we record the state for each of our queued skbs */ enum skb_state {
illegal = 0,
tx_start, tx_done,
rx_start, rx_done, rx_cleanup,
unlink_start
};
struct skb_data { /* skb->cb is one of these */ struct urb *urb; struct usbnet *dev; enum skb_state state; long length; unsignedlong packets;
};
/* Drivers that set FLAG_MULTI_PACKET must call this in their * tx_fixup method before returning an skb.
*/ staticinlinevoid
usbnet_set_skb_tx_stats(struct sk_buff *skb, unsignedlong packets, long bytes_delta)
{ struct skb_data *entry = (struct skb_data *) skb->cb;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.