include/linux/usb/usbnet.h
Source file repositories/reference/linux-study-clean/include/linux/usb/usbnet.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/usb/usbnet.h- Extension
.h- Size
- 10516 bytes
- Lines
- 306
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/mii.hlinux/netdevice.hlinux/skbuff.hlinux/types.hlinux/usb.hlinux/spinlock.h
Detected Declarations
struct usbnetstruct driver_infostruct cdc_statestruct skb_dataenum skb_statefunction usbnet_going_awayfunction usbnet_mark_going_awayfunction usbnet_set_skb_tx_stats
Annotated Snippet
struct usbnet {
/* housekeeping */
struct usb_device *udev;
struct usb_interface *intf;
const struct driver_info *driver_info;
const char *driver_name;
void *driver_priv;
wait_queue_head_t wait;
struct mutex phy_mutex;
unsigned char suspend_count;
unsigned char pkt_cnt, pkt_err;
unsigned short rx_qlen, tx_qlen;
unsigned can_dma_sg:1;
/* i/o info: pipes etc */
unsigned in, out;
struct usb_host_endpoint *status;
unsigned maxpacket;
struct timer_list delay;
const char *padding_pkt;
/* protocol/interface state */
struct net_device *net;
int msg_enable;
unsigned long 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
/* various kinds of pending driver work */
struct sk_buff_head rxq;
struct sk_buff_head txq;
struct sk_buff_head done;
struct sk_buff_head rxq_pause;
struct urb *interrupt;
unsigned interrupt_count;
struct mutex interrupt_mutex;
struct usb_anchor deferred;
struct work_struct bh_work;
spinlock_t bql_spinlock;
struct work_struct kevent;
unsigned long flags;
# define EVENT_TX_HALT 0
# define EVENT_RX_HALT 1
# define EVENT_RX_MEMORY 2
# define EVENT_STS_SPLIT 3
# define EVENT_LINK_RESET 4
# define EVENT_RX_PAUSED 5
# define EVENT_DEV_ASLEEP 6
# define EVENT_DEV_OPEN 7
# define EVENT_DEVICE_REPORT_IDLE 8
# define EVENT_NO_RUNTIME_PM 9
# define EVENT_RX_KILL 10
# define EVENT_LINK_CHANGE 11
# define EVENT_SET_RX_MODE 12
# define EVENT_NO_IP_ALIGN 13
# define EVENT_LINK_CARRIER_ON 14
/* This one is special, as it indicates that the device is going away
* there are cyclic dependencies between tasklet, timer and bh
* that must be broken
*/
# define EVENT_UNPLUG 31
};
static inline bool usbnet_going_away(struct usbnet *ubn)
{
return test_bit(EVENT_UNPLUG, &ubn->flags);
}
static inline void usbnet_mark_going_away(struct usbnet *ubn)
{
set_bit(EVENT_UNPLUG, &ubn->flags);
}
static inline struct usb_driver *driver_of(struct usb_interface *intf)
{
return to_usb_driver(intf->dev.driver);
}
/* interface from the device/framing level "minidriver" to core */
struct driver_info {
char *description;
int flags;
/* framing is CDC Ethernet, not writing ZLPs (hw issues), or optionally: */
Annotation
- Immediate include surface: `linux/mii.h`, `linux/netdevice.h`, `linux/skbuff.h`, `linux/types.h`, `linux/usb.h`, `linux/spinlock.h`.
- Detected declarations: `struct usbnet`, `struct driver_info`, `struct cdc_state`, `struct skb_data`, `enum skb_state`, `function usbnet_going_away`, `function usbnet_mark_going_away`, `function usbnet_set_skb_tx_stats`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.