1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968"><title>struct net_device</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"><link rel="home" href="index.html" title="Linux Networking and Network Devices APIs"><link rel="up" href="netdev.html#idp1097739572" title="Driver Support"><link rel="prev" href="API-enum-netdev-priv-flags.html" title="enum netdev_priv_flags"><link rel="next" href="API-netdev-priv.html" title="netdev_priv"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span class="phrase">struct net_device</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="API-enum-netdev-priv-flags.html">Prev</a> </td><th width="60%" align="center">Driver Support</th><td width="20%" align="right"> <a accesskey="n" href="API-netdev-priv.html">Next</a></td></tr></table><hr></div><div class="refentry"><a name="API-struct-net-device"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>struct net_device — 2 The DEVICE structure. Actually, this whole structure is a big mistake. It mixes I/O data with strictly <span class="quote">“<span class="quote">high-level</span>”</span> data, and it has to know about almost every data structure used in the INET module. 3 </p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="programlisting"> 4struct net_device { 5 char name[IFNAMSIZ]; 6 struct hlist_node name_hlist; 7 char * ifalias; 8 unsigned long mem_end; 9 unsigned long mem_start; 10 unsigned long base_addr; 11 int irq; 12 atomic_t carrier_changes; 13 unsigned long state; 14 struct list_head dev_list; 15 struct list_head napi_list; 16 struct list_head unreg_list; 17 struct list_head close_list; 18 struct {unnamed_struct}; 19 struct garp_port __rcu * garp_port; 20 struct mrp_port __rcu * mrp_port; 21 struct device dev; 22 const struct attribute_group * sysfs_groups[4]; 23 const struct attribute_group * sysfs_rx_queue_group; 24 const struct rtnl_link_ops * rtnl_link_ops; 25#define GSO_MAX_SIZE 65536 26 unsigned int gso_max_size; 27#define GSO_MAX_SEGS 65535 28 u16 gso_max_segs; 29 u16 gso_min_segs; 30#ifdef CONFIG_DCB 31 const struct dcbnl_rtnl_ops * dcbnl_ops; 32#endif 33 u8 num_tc; 34 struct netdev_tc_txq tc_to_txq[TC_MAX_QUEUE]; 35 u8 prio_tc_map[TC_BITMASK + 1]; 36#if IS_ENABLED(CONFIG_FCOE) 37 unsigned int fcoe_ddp_xid; 38#endif 39#if IS_ENABLED(CONFIG_CGROUP_NET_PRIO) 40 struct netprio_map __rcu * priomap; 41#endif 42 struct phy_device * phydev; 43 struct lock_class_key * qdisc_tx_busylock; 44}; </pre></div><div class="refsect1"><a name="idp1098763460"></a><h2>Members</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term">name[IFNAMSIZ]</span></dt><dd><p> 45 This is the first field of the <span class="quote">“<span class="quote">visible</span>”</span> part of this structure 46 (i.e. as seen by users in the <span class="quote">“<span class="quote">Space.c</span>”</span> file). It is the name 47 of the interface. 48 </p></dd><dt><span class="term">name_hlist</span></dt><dd><p> 49 Device name hash chain, please keep it close to name[] 50 </p></dd><dt><span class="term">ifalias</span></dt><dd><p> 51 SNMP alias 52 </p></dd><dt><span class="term">mem_end</span></dt><dd><p> 53 Shared memory end 54 </p></dd><dt><span class="term">mem_start</span></dt><dd><p> 55 Shared memory start 56 </p></dd><dt><span class="term">base_addr</span></dt><dd><p> 57 Device I/O address 58 </p></dd><dt><span class="term">irq</span></dt><dd><p> 59 Device IRQ number 60 </p></dd><dt><span class="term">carrier_changes</span></dt><dd><p> 61 Stats to monitor carrier on<->off transitions 62 </p></dd><dt><span class="term">state</span></dt><dd><p> 63 Generic network queuing layer state, see netdev_state_t 64 </p></dd><dt><span class="term">dev_list</span></dt><dd><p> 65 The global list of network devices 66 </p></dd><dt><span class="term">napi_list</span></dt><dd><p> 67 List entry, that is used for polling napi devices 68 </p></dd><dt><span class="term">unreg_list</span></dt><dd><p> 69 List entry, that is used, when we are unregistering the 70 device, see the function unregister_netdev 71 </p></dd><dt><span class="term">close_list</span></dt><dd><p> 72 List entry, that is used, when we are closing the device 73 </p></dd><dt><span class="term">{unnamed_struct}</span></dt><dd><p> 74 anonymous 75 </p></dd><dt><span class="term">garp_port</span></dt><dd><p> 76 GARP 77 </p></dd><dt><span class="term">mrp_port</span></dt><dd><p> 78 MRP 79 </p></dd><dt><span class="term">dev</span></dt><dd><p> 80 Class/net/name entry 81 </p></dd><dt><span class="term">sysfs_groups[4]</span></dt><dd><p> 82 Space for optional device, statistics and wireless 83 sysfs groups 84 </p></dd><dt><span class="term">sysfs_rx_queue_group</span></dt><dd><p> 85 Space for optional per-rx queue attributes 86 </p></dd><dt><span class="term">rtnl_link_ops</span></dt><dd><p> 87 Rtnl_link_ops 88 </p></dd><dt><span class="term">gso_max_size</span></dt><dd><p> 89 Maximum size of generic segmentation offload 90 </p></dd><dt><span class="term">gso_max_segs</span></dt><dd><p> 91 Maximum number of segments that can be passed to the 92 NIC for GSO 93 </p></dd><dt><span class="term">gso_min_segs</span></dt><dd><p> 94 Minimum number of segments that can be passed to the 95 NIC for GSO 96 </p></dd><dt><span class="term">dcbnl_ops</span></dt><dd><p> 97 Data Center Bridging netlink ops 98 </p></dd><dt><span class="term">num_tc</span></dt><dd><p> 99 Number of traffic classes in the net device 100 </p></dd><dt><span class="term">tc_to_txq[TC_MAX_QUEUE]</span></dt><dd><p> 101 XXX: need comments on this one 102 </p></dd><dt><span class="term">prio_tc_map[TC_BITMASK + 1]</span></dt><dd><p> 103 need comments on this one 104 </p></dd><dt><span class="term">fcoe_ddp_xid</span></dt><dd><p> 105 Max exchange id for FCoE LRO by ddp 106 </p></dd><dt><span class="term">priomap</span></dt><dd><p> 107 XXX: need comments on this one 108 </p></dd><dt><span class="term">phydev</span></dt><dd><p> 109 Physical device may attach itself 110 for hardware timestamping 111 </p></dd><dt><span class="term">qdisc_tx_busylock</span></dt><dd><p> 112 XXX: need comments on this one 113 </p></dd></dl></div></div><div class="refsect1"><a name="idp1098786796"></a><h2>FIXME</h2><p> 114 cleanup struct net_device such that network protocol info 115 moves out. 116</p></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="API-enum-netdev-priv-flags.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="netdev.html#idp1097739572">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="API-netdev-priv.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span class="phrase">enum netdev_priv_flags</span> </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> <span class="phrase">netdev_priv</span></td></tr></table></div></body></html> 117