include/linux/netdevice.h
Source file repositories/reference/linux-study-clean/include/linux/netdevice.h
File Facts
- System
- Linux kernel
- Corpus path
include/linux/netdevice.h- Extension
.h- Size
- 183003 bytes
- Lines
- 5738
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Touches user memory; correctness depends on fault-safe copying and privilege boundary handling.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/timer.hlinux/bug.hlinux/delay.hlinux/atomic.hlinux/prefetch.hasm/cache.hasm/byteorder.hasm/local.hlinux/percpu.hlinux/rculist.hlinux/workqueue.hlinux/dynamic_queue_limits.hnet/net_namespace.hnet/dcbnl.hnet/netprio_cgroup.hlinux/netdev_features.hlinux/neighbour.hlinux/netdevice_xmit.huapi/linux/netdevice.huapi/linux/if_bonding.huapi/linux/pkt_cls.huapi/linux/netdev.hlinux/hashtable.hlinux/rbtree.hnet/net_trackers.hnet/net_debug.hnet/dropreason-core.hnet/neighbour_tables.hlinux/cache.hlinux/skbuff.hlinux/notifier.h
Detected Declarations
struct netpoll_infostruct devicestruct ethtool_opsstruct kernel_hwtstamp_configstruct phy_devicestruct dsa_portstruct ip_tunnel_parm_kernstruct macsec_contextstruct macsec_opsstruct netdev_configstruct netdev_name_nodestruct sd_flow_limitstruct sfp_busstruct wireless_devstruct wpan_devstruct mpls_devstruct udp_tunnel_infostruct udp_tunnel_nic_infostruct udp_tunnel_nicstruct bpf_progstruct xdp_buffstruct xdp_framestruct xdp_metadata_opsstruct xdp_mdstruct ethtool_netdev_statestruct phy_link_topologystruct hwtstamp_providerstruct net_device_statsstruct net_device_core_statsstruct neighbourstruct neigh_parmsstruct sk_buffstruct netdev_hw_addrstruct netdev_hw_addr_liststruct hh_cachestruct header_opsstruct gro_liststruct gro_nodestruct napi_configstruct napi_structstruct netdev_queuestruct xps_mapstruct xps_dev_mapsstruct netdev_tc_txqstruct netdev_fcoe_hbainfostruct netdev_phys_item_idstruct net_device_pathstruct net_device_path_stack
Annotated Snippet
struct net_device_ops {
int (*ndo_init)(struct net_device *dev);
void (*ndo_uninit)(struct net_device *dev);
int (*ndo_open)(struct net_device *dev);
int (*ndo_stop)(struct net_device *dev);
netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb,
struct net_device *dev);
netdev_features_t (*ndo_features_check)(struct sk_buff *skb,
struct net_device *dev,
netdev_features_t features);
u16 (*ndo_select_queue)(struct net_device *dev,
struct sk_buff *skb,
struct net_device *sb_dev);
void (*ndo_change_rx_flags)(struct net_device *dev,
int flags);
void (*ndo_set_rx_mode)(struct net_device *dev);
int (*ndo_set_rx_mode_async)(
struct net_device *dev,
struct netdev_hw_addr_list *uc,
struct netdev_hw_addr_list *mc);
int (*ndo_set_mac_address)(struct net_device *dev,
void *addr);
int (*ndo_validate_addr)(struct net_device *dev);
int (*ndo_do_ioctl)(struct net_device *dev,
struct ifreq *ifr, int cmd);
int (*ndo_eth_ioctl)(struct net_device *dev,
struct ifreq *ifr, int cmd);
int (*ndo_siocbond)(struct net_device *dev,
struct ifreq *ifr, int cmd);
int (*ndo_siocwandev)(struct net_device *dev,
struct if_settings *ifs);
int (*ndo_siocdevprivate)(struct net_device *dev,
struct ifreq *ifr,
void __user *data, int cmd);
int (*ndo_set_config)(struct net_device *dev,
struct ifmap *map);
int (*ndo_change_mtu)(struct net_device *dev,
int new_mtu);
int (*ndo_neigh_setup)(struct net_device *dev,
struct neigh_parms *);
void (*ndo_tx_timeout) (struct net_device *dev,
unsigned int txqueue);
void (*ndo_get_stats64)(struct net_device *dev,
struct rtnl_link_stats64 *storage);
bool (*ndo_has_offload_stats)(const struct net_device *dev, int attr_id);
int (*ndo_get_offload_stats)(int attr_id,
const struct net_device *dev,
void *attr_data);
struct net_device_stats* (*ndo_get_stats)(struct net_device *dev);
int (*ndo_vlan_rx_add_vid)(struct net_device *dev,
__be16 proto, u16 vid);
int (*ndo_vlan_rx_kill_vid)(struct net_device *dev,
__be16 proto, u16 vid);
#ifdef CONFIG_NET_POLL_CONTROLLER
void (*ndo_poll_controller)(struct net_device *dev);
int (*ndo_netpoll_setup)(struct net_device *dev);
void (*ndo_netpoll_cleanup)(struct net_device *dev);
#endif
int (*ndo_set_vf_mac)(struct net_device *dev,
int queue, u8 *mac);
int (*ndo_set_vf_vlan)(struct net_device *dev,
int queue, u16 vlan,
u8 qos, __be16 proto);
int (*ndo_set_vf_rate)(struct net_device *dev,
int vf, int min_tx_rate,
int max_tx_rate);
int (*ndo_set_vf_spoofchk)(struct net_device *dev,
int vf, bool setting);
int (*ndo_set_vf_trust)(struct net_device *dev,
int vf, bool setting);
int (*ndo_get_vf_config)(struct net_device *dev,
int vf,
struct ifla_vf_info *ivf);
int (*ndo_set_vf_link_state)(struct net_device *dev,
int vf, int link_state);
int (*ndo_get_vf_stats)(struct net_device *dev,
int vf,
struct ifla_vf_stats
*vf_stats);
int (*ndo_set_vf_port)(struct net_device *dev,
int vf,
struct nlattr *port[]);
int (*ndo_get_vf_port)(struct net_device *dev,
int vf, struct sk_buff *skb);
int (*ndo_get_vf_guid)(struct net_device *dev,
int vf,
struct ifla_vf_guid *node_guid,
struct ifla_vf_guid *port_guid);
Annotation
- Immediate include surface: `linux/timer.h`, `linux/bug.h`, `linux/delay.h`, `linux/atomic.h`, `linux/prefetch.h`, `asm/cache.h`, `asm/byteorder.h`, `asm/local.h`.
- Detected declarations: `struct netpoll_info`, `struct device`, `struct ethtool_ops`, `struct kernel_hwtstamp_config`, `struct phy_device`, `struct dsa_port`, `struct ip_tunnel_parm_kern`, `struct macsec_context`, `struct macsec_ops`, `struct netdev_config`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: pattern implementation candidate.
- This snippet crosses the user/kernel memory boundary; validate fault handling and access checks before translating the pattern.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.