'\" t .\" Title: struct net_device .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.79.1 .\" Date: July 2017 .\" Manual: Network device support .\" Source: Kernel Hackers Manual 4.12.2 .\" Language: English .\" .TH "STRUCT NET_DEVICE" "9" "July 2017" "Kernel Hackers Manual 4\&.12\&" "Network device support" .\" ----------------------------------------------------------------- .\" * Define some portability stuff .\" ----------------------------------------------------------------- .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .\" http://bugs.debian.org/507673 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" struct_net_device \- The DEVICE structure\&. Actually, this whole structure is a big mistake\&. It mixes I/O data with strictly \(lqhigh\-level\(rq data, and it has to know about almost every data structure used in the INET module\&. .SH "SYNOPSIS" .sp .nf struct net_device { char name; struct hlist_node name_hlist; char * ifalias; unsigned long mem_end; unsigned long mem_start; unsigned long base_addr; int irq; atomic_t carrier_changes; unsigned long state; struct list_head dev_list; struct list_head napi_list; struct list_head unreg_list; struct list_head close_list; struct list_head ptype_all; struct list_head ptype_specific; struct {unnamed_struct}; #if IS_ENABLED(CONFIG_GARP struct garp_port __rcu * garp_port; #endif #if IS_ENABLED(CONFIG_MRP struct mrp_port __rcu * mrp_port; #endif struct device dev; const struct attribute_group * sysfs_groups; const struct attribute_group * sysfs_rx_queue_group; const struct rtnl_link_ops * rtnl_link_ops; #define GSO_MAX_SIZE 65536 unsigned int gso_max_size; #define GSO_MAX_SEGS 65535 u16 gso_max_segs; #ifdef CONFIG_DCB const struct dcbnl_rtnl_ops * dcbnl_ops; #endif u8 num_tc; struct netdev_tc_txq tc_to_txq; u8 prio_tc_map; #if IS_ENABLED(CONFIG_FCOE unsigned int fcoe_ddp_xid; #endif #if IS_ENABLED(CONFIG_CGROUP_NET_PRIO struct netprio_map __rcu * priomap; #endif struct phy_device * phydev; struct lock_class_key * qdisc_tx_busylock; struct lock_class_key * qdisc_running_key; bool proto_down; }; .fi .SH "MEMBERS" .PP char name .RS 4 This is the first field of the \(lqvisible\(rq part of this structure (i\&.e\&. as seen by users in the \(lqSpace\&.c\(rq file)\&. It is the name of the interface\&. .RE .PP struct hlist_node name_hlist .RS 4 Device name hash chain, please keep it close to name[] .RE .PP char * ifalias .RS 4 SNMP alias .RE .PP unsigned long mem_end .RS 4 Shared memory end .RE .PP unsigned long mem_start .RS 4 Shared memory start .RE .PP unsigned long base_addr .RS 4 Device I/O address .RE .PP int irq .RS 4 Device IRQ number .RE .PP atomic_t carrier_changes .RS 4 Stats to monitor carrier on<\->off transitions .RE .PP unsigned long state .RS 4 Generic network queuing layer state, see netdev_state_t .RE .PP struct list_head dev_list .RS 4 The global list of network devices .RE .PP struct list_head napi_list .RS 4 List entry used for polling NAPI devices .RE .PP struct list_head unreg_list .RS 4 List entry when we are unregistering the device; see the function unregister_netdev .RE .PP struct list_head close_list .RS 4 List entry used when we are closing the device .RE .PP struct list_head ptype_all .RS 4 Device\-specific packet handlers for all protocols .RE .PP struct list_head ptype_specific .RS 4 Device\-specific, protocol\-specific packet handlers .RE .PP struct {unnamed_struct} .RS 4 anonymous .RE .PP struct garp_port __rcu * garp_port .RS 4 GARP .RE .PP struct mrp_port __rcu * mrp_port .RS 4 MRP .RE .PP struct device dev .RS 4 Class/net/name entry .RE .PP const struct attribute_group * sysfs_groups .RS 4 Space for optional device, statistics and wireless sysfs groups .RE .PP const struct attribute_group * sysfs_rx_queue_group .RS 4 Space for optional per\-rx queue attributes .RE .PP const struct rtnl_link_ops * rtnl_link_ops .RS 4 Rtnl_link_ops .RE .PP unsigned int gso_max_size .RS 4 Maximum size of generic segmentation offload .RE .PP u16 gso_max_segs .RS 4 Maximum number of segments that can be passed to the NIC for GSO .RE .PP const struct dcbnl_rtnl_ops * dcbnl_ops .RS 4 Data Center Bridging netlink ops .RE .PP u8 num_tc .RS 4 Number of traffic classes in the net device .RE .PP struct netdev_tc_txq tc_to_txq .RS 4 XXX: need comments on this one .RE .PP u8 prio_tc_map .RS 4 XXX: need comments on this one .RE .PP unsigned int fcoe_ddp_xid .RS 4 Max exchange id for FCoE LRO by ddp .RE .PP struct netprio_map __rcu * priomap .RS 4 XXX: need comments on this one .RE .PP struct phy_device * phydev .RS 4 Physical device may attach itself for hardware timestamping .RE .PP struct lock_class_key * qdisc_tx_busylock .RS 4 lockdep class annotating Qdisc\->busylock spinlock .RE .PP struct lock_class_key * qdisc_running_key .RS 4 lockdep class annotating Qdisc\->running seqcount .RE .PP bool proto_down .RS 4 protocol port state information can be sent to the switch driver and used to set the phys state of the switch port\&. .RE .SH "DESCRIPTION" .PP interface address info: .PP FIXME: cleanup struct net_device such that network protocol info moves out\&. .SH "COPYRIGHT" .br