aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorKaroly Kemeny <karoly.kemeny@gmail.com>2014-07-30 14:27:36 -0400
committerDavid S. Miller <davem@davemloft.net>2014-08-01 00:34:20 -0400
commit536721b1cb3fb50034bf6f6c7a7ea16166970e69 (patch)
tree41d6f234af900be609c41f1e6a28dc349b953fe7 /include/linux
parent8e97b85a8f1b6f203a75234b550d3eec5752c269 (diff)
net: kernel-doc compliant documentation for net_device
Net_device is a vast and important structure, but it has no kernel-doc compliant documentation. This patch extracts the comments from the structure to clean it up, and let the scripts extract documentation from it. I know that the patch is big, but it's just reordering of comments into the appropriate form, and adding a few more, for the missing members. Signed-off-by: Karoly Kemeny <karoly.kemeny@gmail.com> Acked-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/netdevice.h381
1 files changed, 250 insertions, 131 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 8e8fb3ed574b..38377392d082 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1231,42 +1231,228 @@ enum netdev_priv_flags {
1231#define IFF_LIVE_ADDR_CHANGE IFF_LIVE_ADDR_CHANGE 1231#define IFF_LIVE_ADDR_CHANGE IFF_LIVE_ADDR_CHANGE
1232#define IFF_MACVLAN IFF_MACVLAN 1232#define IFF_MACVLAN IFF_MACVLAN
1233 1233
1234/* 1234/**
1235 * The DEVICE structure. 1235 * struct net_device - The DEVICE structure.
1236 * Actually, this whole structure is a big mistake. It mixes I/O 1236 * Actually, this whole structure is a big mistake. It mixes I/O
1237 * data with strictly "high-level" data, and it has to know about 1237 * data with strictly "high-level" data, and it has to know about
1238 * almost every data structure used in the INET module. 1238 * almost every data structure used in the INET module.
1239 *
1240 * @name: This is the first field of the "visible" part of this structure
1241 * (i.e. as seen by users in the "Space.c" file). It is the name
1242 * of the interface.
1243 *
1244 * @name_hlist: Device name hash chain, please keep it close to name[]
1245 * @ifalias: SNMP alias
1246 * @mem_end: Shared memory end
1247 * @mem_start: Shared memory start
1248 * @base_addr: Device I/O address
1249 * @irq: Device IRQ number
1250 *
1251 * @state: Generic network queuing layer state, see netdev_state_t
1252 * @dev_list: The global list of network devices
1253 * @napi_list: List entry, that is used for polling napi devices
1254 * @unreg_list: List entry, that is used, when we are unregistering the
1255 * device, see the function unregister_netdev
1256 * @close_list: List entry, that is used, when we are closing the device
1257 *
1258 * @adj_list: Directly linked devices, like slaves for bonding
1259 * @all_adj_list: All linked devices, *including* neighbours
1260 * @features: Currently active device features
1261 * @hw_features: User-changeable features
1262 *
1263 * @wanted_features: User-requested features
1264 * @vlan_features: Mask of features inheritable by VLAN devices
1265 *
1266 * @hw_enc_features: Mask of features inherited by encapsulating devices
1267 * This field indicates what encapsulation
1268 * offloads the hardware is capable of doing,
1269 * and drivers will need to set them appropriately.
1270 *
1271 * @mpls_features: Mask of features inheritable by MPLS
1272 *
1273 * @ifindex: interface index
1274 * @iflink: unique device identifier
1275 *
1276 * @stats: Statistics struct, which was left as a legacy, use
1277 * rtnl_link_stats64 instead
1278 *
1279 * @rx_dropped: Dropped packets by core network,
1280 * do not use this in drivers
1281 * @tx_dropped: Dropped packets by core network,
1282 * do not use this in drivers
1283 *
1284 * @carrier_changes: Stats to monitor carrier on<->off transitions
1285 *
1286 * @wireless_handlers: List of functions to handle Wireless Extensions,
1287 * instead of ioctl,
1288 * see <net/iw_handler.h> for details.
1289 * @wireless_data: Instance data managed by the core of wireless extensions
1290 *
1291 * @netdev_ops: Includes several pointers to callbacks,
1292 * if one wants to override the ndo_*() functions
1293 * @ethtool_ops: Management operations
1294 * @fwd_ops: Management operations
1295 * @header_ops: Includes callbacks for creating,parsing,rebuilding,etc
1296 * of Layer 2 headers.
1297 *
1298 * @flags: Interface flags (a la BSD)
1299 * @priv_flags: Like 'flags' but invisible to userspace,
1300 * see if.h for the definitions
1301 * @gflags: Global flags ( kept as legacy )
1302 * @padded: How much padding added by alloc_netdev()
1303 * @operstate: RFC2863 operstate
1304 * @link_mode: Mapping policy to operstate
1305 * @if_port: Selectable AUI, TP, ...
1306 * @dma: DMA channel
1307 * @mtu: Interface MTU value
1308 * @type: Interface hardware type
1309 * @hard_header_len: Hardware header length
1310 *
1311 * @needed_headroom: Extra headroom the hardware may need, but not in all
1312 * cases can this be guaranteed
1313 * @needed_tailroom: Extra tailroom the hardware may need, but not in all
1314 * cases can this be guaranteed. Some cases also use
1315 * LL_MAX_HEADER instead to allocate the skb
1316 *
1317 * interface address info:
1318 *
1319 * @perm_addr: Permanent hw address
1320 * @addr_assign_type: Hw address assignment type
1321 * @addr_len: Hardware address length
1322 * @neigh_priv_len; Used in neigh_alloc(),
1323 * initialized only in atm/clip.c
1324 * @dev_id: Used to differentiate devices that share
1325 * the same link layer address
1326 * @dev_port: Used to differentiate devices that share
1327 * the same function
1328 * @addr_list_lock: XXX: need comments on this one
1329 * @uc: unicast mac addresses
1330 * @mc: multicast mac addresses
1331 * @dev_addrs: list of device hw addresses
1332 * @queues_kset: Group of all Kobjects in the Tx and RX queues
1333 * @uc_promisc: Counter, that indicates, that promiscuous mode
1334 * has been enabled due to the need to listen to
1335 * additional unicast addresses in a device that
1336 * does not implement ndo_set_rx_mode()
1337 * @promiscuity: Number of times, the NIC is told to work in
1338 * Promiscuous mode, if it becomes 0 the NIC will
1339 * exit from working in Promiscuous mode
1340 * @allmulti: Counter, enables or disables allmulticast mode
1341 *
1342 * @vlan_info: VLAN info
1343 * @dsa_ptr: dsa specific data
1344 * @tipc_ptr: TIPC specific data
1345 * @atalk_ptr: AppleTalk link
1346 * @ip_ptr: IPv4 specific data
1347 * @dn_ptr: DECnet specific data
1348 * @ip6_ptr: IPv6 specific data
1349 * @ax25_ptr: AX.25 specific data
1350 * @ieee80211_ptr: IEEE 802.11 specific data, assign before registering
1351 *
1352 * @last_rx: Time of last Rx
1353 * @dev_addr: Hw address (before bcast,
1354 * because most packets are unicast)
1355 *
1356 * @_rx: Array of RX queues
1357 * @num_rx_queues: Number of RX queues
1358 * allocated at register_netdev() time
1359 * @real_num_rx_queues: Number of RX queues currently active in device
1360 *
1361 * @rx_handler: handler for received packets
1362 * @rx_handler_data: XXX: need comments on this one
1363 * @ingress_queue: XXX: need comments on this one
1364 * @broadcast: hw bcast address
1365 *
1366 * @_tx: Array of TX queues
1367 * @num_tx_queues: Number of TX queues allocated at alloc_netdev_mq() time
1368 * @real_num_tx_queues: Number of TX queues currently active in device
1369 * @qdisc: Root qdisc from userspace point of view
1370 * @tx_queue_len: Max frames per queue allowed
1371 * @tx_global_lock: XXX: need comments on this one
1372 *
1373 * @xps_maps: XXX: need comments on this one
1374 *
1375 * @rx_cpu_rmap: CPU reverse-mapping for RX completion interrupts,
1376 * indexed by RX queue number. Assigned by driver.
1377 * This must only be set if the ndo_rx_flow_steer
1378 * operation is defined
1379 *
1380 * @trans_start: Time (in jiffies) of last Tx
1381 * @watchdog_timeo: Represents the timeout that is used by
1382 * the watchdog ( see dev_watchdog() )
1383 * @watchdog_timer: List of timers
1384 *
1385 * @pcpu_refcnt: Number of references to this device
1386 * @todo_list: Delayed register/unregister
1387 * @index_hlist: Device index hash chain
1388 * @link_watch_list: XXX: need comments on this one
1389 *
1390 * @reg_state: Register/unregister state machine
1391 * @dismantle: Device is going to be freed
1392 * @rtnl_link_state: This enum represents the phases of creating
1393 * a new link
1394 *
1395 * @destructor: Called from unregister,
1396 * can be used to call free_netdev
1397 * @npinfo: XXX: need comments on this one
1398 * @nd_net: Network namespace this network device is inside
1399 *
1400 * @ml_priv: Mid-layer private
1401 * @lstats: Loopback statistics
1402 * @tstats: Tunnel statistics
1403 * @dstats: Dummy statistics
1404 * @vstats: Virtual ethernet statistics
1405 *
1406 * @garp_port: GARP
1407 * @mrp_port: MRP
1408 *
1409 * @dev: Class/net/name entry
1410 * @sysfs_groups: Space for optional device, statistics and wireless
1411 * sysfs groups
1412 *
1413 * @sysfs_rx_queue_group: Space for optional per-rx queue attributes
1414 * @rtnl_link_ops: Rtnl_link_ops
1415 *
1416 * @gso_max_size: Maximum size of generic segmentation offload
1417 * @gso_max_segs: Maximum number of segments that can be passed to the
1418 * NIC for GSO
1419 *
1420 * @dcbnl_ops: Data Center Bridging netlink ops
1421 * @num_tc: Number of traffic classes in the net device
1422 * @tc_to_txq: XXX: need comments on this one
1423 * @prio_tc_map XXX: need comments on this one
1424 *
1425 * @fcoe_ddp_xid: Max exchange id for FCoE LRO by ddp
1426 *
1427 * @priomap: XXX: need comments on this one
1428 * @phydev: Physical device may attach itself
1429 * for hardware timestamping
1430 *
1431 * @qdisc_tx_busylock: XXX: need comments on this one
1432 *
1433 * @group: The group, that the device belongs to
1434 * @pm_qos_req: Power Management QoS object
1239 * 1435 *
1240 * FIXME: cleanup struct net_device such that network protocol info 1436 * FIXME: cleanup struct net_device such that network protocol info
1241 * moves out. 1437 * moves out.
1242 */ 1438 */
1243 1439
1244struct net_device { 1440struct net_device {
1245
1246 /*
1247 * This is the first field of the "visible" part of this structure
1248 * (i.e. as seen by users in the "Space.c" file). It is the name
1249 * of the interface.
1250 */
1251 char name[IFNAMSIZ]; 1441 char name[IFNAMSIZ];
1252
1253 /* device name hash chain, please keep it close to name[] */
1254 struct hlist_node name_hlist; 1442 struct hlist_node name_hlist;
1255
1256 /* snmp alias */
1257 char *ifalias; 1443 char *ifalias;
1258
1259 /* 1444 /*
1260 * I/O specific fields 1445 * I/O specific fields
1261 * FIXME: Merge these and struct ifmap into one 1446 * FIXME: Merge these and struct ifmap into one
1262 */ 1447 */
1263 unsigned long mem_end; /* shared mem end */ 1448 unsigned long mem_end;
1264 unsigned long mem_start; /* shared mem start */ 1449 unsigned long mem_start;
1265 unsigned long base_addr; /* device I/O address */ 1450 unsigned long base_addr;
1266 int irq; /* device IRQ number */ 1451 int irq;
1267 1452
1268 /* 1453 /*
1269 * Some hardware also needs these fields, but they are not 1454 * Some hardware also needs these fields (state,dev_list,
1455 * napi_list,unreg_list,close_list) but they are not
1270 * part of the usual set specified in Space.c. 1456 * part of the usual set specified in Space.c.
1271 */ 1457 */
1272 1458
@@ -1277,106 +1463,74 @@ struct net_device {
1277 struct list_head unreg_list; 1463 struct list_head unreg_list;
1278 struct list_head close_list; 1464 struct list_head close_list;
1279 1465
1280 /* directly linked devices, like slaves for bonding */
1281 struct { 1466 struct {
1282 struct list_head upper; 1467 struct list_head upper;
1283 struct list_head lower; 1468 struct list_head lower;
1284 } adj_list; 1469 } adj_list;
1285 1470
1286 /* all linked devices, *including* neighbours */
1287 struct { 1471 struct {
1288 struct list_head upper; 1472 struct list_head upper;
1289 struct list_head lower; 1473 struct list_head lower;
1290 } all_adj_list; 1474 } all_adj_list;
1291 1475
1292
1293 /* currently active device features */
1294 netdev_features_t features; 1476 netdev_features_t features;
1295 /* user-changeable features */
1296 netdev_features_t hw_features; 1477 netdev_features_t hw_features;
1297 /* user-requested features */
1298 netdev_features_t wanted_features; 1478 netdev_features_t wanted_features;
1299 /* mask of features inheritable by VLAN devices */
1300 netdev_features_t vlan_features; 1479 netdev_features_t vlan_features;
1301 /* mask of features inherited by encapsulating devices
1302 * This field indicates what encapsulation offloads
1303 * the hardware is capable of doing, and drivers will
1304 * need to set them appropriately.
1305 */
1306 netdev_features_t hw_enc_features; 1480 netdev_features_t hw_enc_features;
1307 /* mask of fetures inheritable by MPLS */
1308 netdev_features_t mpls_features; 1481 netdev_features_t mpls_features;
1309 1482
1310 /* Interface index. Unique device identifier */
1311 int ifindex; 1483 int ifindex;
1312 int iflink; 1484 int iflink;
1313 1485
1314 struct net_device_stats stats; 1486 struct net_device_stats stats;
1315 1487
1316 /* dropped packets by core network, Do not use this in drivers */
1317 atomic_long_t rx_dropped; 1488 atomic_long_t rx_dropped;
1318 atomic_long_t tx_dropped; 1489 atomic_long_t tx_dropped;
1319 1490
1320 /* Stats to monitor carrier on<->off transitions */
1321 atomic_t carrier_changes; 1491 atomic_t carrier_changes;
1322 1492
1323#ifdef CONFIG_WIRELESS_EXT 1493#ifdef CONFIG_WIRELESS_EXT
1324 /* List of functions to handle Wireless Extensions (instead of ioctl).
1325 * See <net/iw_handler.h> for details. Jean II */
1326 const struct iw_handler_def * wireless_handlers; 1494 const struct iw_handler_def * wireless_handlers;
1327 /* Instance data managed by the core of Wireless Extensions. */
1328 struct iw_public_data * wireless_data; 1495 struct iw_public_data * wireless_data;
1329#endif 1496#endif
1330 /* Management operations */
1331 const struct net_device_ops *netdev_ops; 1497 const struct net_device_ops *netdev_ops;
1332 const struct ethtool_ops *ethtool_ops; 1498 const struct ethtool_ops *ethtool_ops;
1333 const struct forwarding_accel_ops *fwd_ops; 1499 const struct forwarding_accel_ops *fwd_ops;
1334 1500
1335 /* Hardware header description */
1336 const struct header_ops *header_ops; 1501 const struct header_ops *header_ops;
1337 1502
1338 unsigned int flags; /* interface flags (a la BSD) */ 1503 unsigned int flags;
1339 unsigned int priv_flags; /* Like 'flags' but invisible to userspace. 1504 unsigned int priv_flags;
1340 * See if.h for definitions. */ 1505
1341 unsigned short gflags; 1506 unsigned short gflags;
1342 unsigned short padded; /* How much padding added by alloc_netdev() */ 1507 unsigned short padded;
1343 1508
1344 unsigned char operstate; /* RFC2863 operstate */ 1509 unsigned char operstate;
1345 unsigned char link_mode; /* mapping policy to operstate */ 1510 unsigned char link_mode;
1346 1511
1347 unsigned char if_port; /* Selectable AUI, TP,..*/ 1512 unsigned char if_port;
1348 unsigned char dma; /* DMA channel */ 1513 unsigned char dma;
1349 1514
1350 unsigned int mtu; /* interface MTU value */ 1515 unsigned int mtu;
1351 unsigned short type; /* interface hardware type */ 1516 unsigned short type;
1352 unsigned short hard_header_len; /* hardware hdr length */ 1517 unsigned short hard_header_len;
1353 1518
1354 /* extra head- and tailroom the hardware may need, but not in all cases
1355 * can this be guaranteed, especially tailroom. Some cases also use
1356 * LL_MAX_HEADER instead to allocate the skb.
1357 */
1358 unsigned short needed_headroom; 1519 unsigned short needed_headroom;
1359 unsigned short needed_tailroom; 1520 unsigned short needed_tailroom;
1360 1521
1361 /* Interface address info. */ 1522 /* Interface address info. */
1362 unsigned char perm_addr[MAX_ADDR_LEN]; /* permanent hw address */ 1523 unsigned char perm_addr[MAX_ADDR_LEN];
1363 unsigned char addr_assign_type; /* hw address assignment type */ 1524 unsigned char addr_assign_type;
1364 unsigned char addr_len; /* hardware address length */ 1525 unsigned char addr_len;
1365 unsigned short neigh_priv_len; 1526 unsigned short neigh_priv_len;
1366 unsigned short dev_id; /* Used to differentiate devices 1527 unsigned short dev_id;
1367 * that share the same link 1528 unsigned short dev_port;
1368 * layer address
1369 */
1370 unsigned short dev_port; /* Used to differentiate
1371 * devices that share the same
1372 * function
1373 */
1374 spinlock_t addr_list_lock; 1529 spinlock_t addr_list_lock;
1375 struct netdev_hw_addr_list uc; /* Unicast mac addresses */ 1530 struct netdev_hw_addr_list uc;
1376 struct netdev_hw_addr_list mc; /* Multicast mac addresses */ 1531 struct netdev_hw_addr_list mc;
1377 struct netdev_hw_addr_list dev_addrs; /* list of device 1532 struct netdev_hw_addr_list dev_addrs;
1378 * hw addresses 1533
1379 */
1380#ifdef CONFIG_SYSFS 1534#ifdef CONFIG_SYSFS
1381 struct kset *queues_kset; 1535 struct kset *queues_kset;
1382#endif 1536#endif
@@ -1391,40 +1545,34 @@ struct net_device {
1391 /* Protocol specific pointers */ 1545 /* Protocol specific pointers */
1392 1546
1393#if IS_ENABLED(CONFIG_VLAN_8021Q) 1547#if IS_ENABLED(CONFIG_VLAN_8021Q)
1394 struct vlan_info __rcu *vlan_info; /* VLAN info */ 1548 struct vlan_info __rcu *vlan_info;
1395#endif 1549#endif
1396#if IS_ENABLED(CONFIG_NET_DSA) 1550#if IS_ENABLED(CONFIG_NET_DSA)
1397 struct dsa_switch_tree *dsa_ptr; /* dsa specific data */ 1551 struct dsa_switch_tree *dsa_ptr;
1398#endif 1552#endif
1399#if IS_ENABLED(CONFIG_TIPC) 1553#if IS_ENABLED(CONFIG_TIPC)
1400 struct tipc_bearer __rcu *tipc_ptr; /* TIPC specific data */ 1554 struct tipc_bearer __rcu *tipc_ptr;
1401#endif 1555#endif
1402 void *atalk_ptr; /* AppleTalk link */ 1556 void *atalk_ptr;
1403 struct in_device __rcu *ip_ptr; /* IPv4 specific data */ 1557 struct in_device __rcu *ip_ptr;
1404 struct dn_dev __rcu *dn_ptr; /* DECnet specific data */ 1558 struct dn_dev __rcu *dn_ptr;
1405 struct inet6_dev __rcu *ip6_ptr; /* IPv6 specific data */ 1559 struct inet6_dev __rcu *ip6_ptr;
1406 void *ax25_ptr; /* AX.25 specific data */ 1560 void *ax25_ptr;
1407 struct wireless_dev *ieee80211_ptr; /* IEEE 802.11 specific data, 1561 struct wireless_dev *ieee80211_ptr;
1408 assign before registering */
1409 1562
1410/* 1563/*
1411 * Cache lines mostly used on receive path (including eth_type_trans()) 1564 * Cache lines mostly used on receive path (including eth_type_trans())
1412 */ 1565 */
1413 unsigned long last_rx; /* Time of last Rx */ 1566 unsigned long last_rx;
1414 1567
1415 /* Interface address info used in eth_type_trans() */ 1568 /* Interface address info used in eth_type_trans() */
1416 unsigned char *dev_addr; /* hw address, (before bcast 1569 unsigned char *dev_addr;
1417 because most packets are
1418 unicast) */
1419 1570
1420 1571
1421#ifdef CONFIG_SYSFS 1572#ifdef CONFIG_SYSFS
1422 struct netdev_rx_queue *_rx; 1573 struct netdev_rx_queue *_rx;
1423 1574
1424 /* Number of RX queues allocated at register_netdev() time */
1425 unsigned int num_rx_queues; 1575 unsigned int num_rx_queues;
1426
1427 /* Number of RX queues currently active in device */
1428 unsigned int real_num_rx_queues; 1576 unsigned int real_num_rx_queues;
1429 1577
1430#endif 1578#endif
@@ -1433,33 +1581,23 @@ struct net_device {
1433 void __rcu *rx_handler_data; 1581 void __rcu *rx_handler_data;
1434 1582
1435 struct netdev_queue __rcu *ingress_queue; 1583 struct netdev_queue __rcu *ingress_queue;
1436 unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */ 1584 unsigned char broadcast[MAX_ADDR_LEN];
1437 1585
1438 1586
1439/* 1587/*
1440 * Cache lines mostly used on transmit path 1588 * Cache lines mostly used on transmit path
1441 */ 1589 */
1442 struct netdev_queue *_tx ____cacheline_aligned_in_smp; 1590 struct netdev_queue *_tx ____cacheline_aligned_in_smp;
1443
1444 /* Number of TX queues allocated at alloc_netdev_mq() time */
1445 unsigned int num_tx_queues; 1591 unsigned int num_tx_queues;
1446
1447 /* Number of TX queues currently active in device */
1448 unsigned int real_num_tx_queues; 1592 unsigned int real_num_tx_queues;
1449
1450 /* root qdisc from userspace point of view */
1451 struct Qdisc *qdisc; 1593 struct Qdisc *qdisc;
1452 1594 unsigned long tx_queue_len;
1453 unsigned long tx_queue_len; /* Max frames per queue allowed */
1454 spinlock_t tx_global_lock; 1595 spinlock_t tx_global_lock;
1455 1596
1456#ifdef CONFIG_XPS 1597#ifdef CONFIG_XPS
1457 struct xps_dev_maps __rcu *xps_maps; 1598 struct xps_dev_maps __rcu *xps_maps;
1458#endif 1599#endif
1459#ifdef CONFIG_RFS_ACCEL 1600#ifdef CONFIG_RFS_ACCEL
1460 /* CPU reverse-mapping for RX completion interrupts, indexed
1461 * by RX queue number. Assigned by driver. This must only be
1462 * set if the ndo_rx_flow_steer operation is defined. */
1463 struct cpu_rmap *rx_cpu_rmap; 1601 struct cpu_rmap *rx_cpu_rmap;
1464#endif 1602#endif
1465 1603
@@ -1469,22 +1607,17 @@ struct net_device {
1469 * trans_start here is expensive for high speed devices on SMP, 1607 * trans_start here is expensive for high speed devices on SMP,
1470 * please use netdev_queue->trans_start instead. 1608 * please use netdev_queue->trans_start instead.
1471 */ 1609 */
1472 unsigned long trans_start; /* Time (in jiffies) of last Tx */ 1610 unsigned long trans_start;
1473 1611
1474 int watchdog_timeo; /* used by dev_watchdog() */ 1612 int watchdog_timeo;
1475 struct timer_list watchdog_timer; 1613 struct timer_list watchdog_timer;
1476 1614
1477 /* Number of references to this device */
1478 int __percpu *pcpu_refcnt; 1615 int __percpu *pcpu_refcnt;
1479
1480 /* delayed register/unregister */
1481 struct list_head todo_list; 1616 struct list_head todo_list;
1482 /* device index hash chain */
1483 struct hlist_node index_hlist;
1484 1617
1618 struct hlist_node index_hlist;
1485 struct list_head link_watch_list; 1619 struct list_head link_watch_list;
1486 1620
1487 /* register/unregister state machine */
1488 enum { NETREG_UNINITIALIZED=0, 1621 enum { NETREG_UNINITIALIZED=0,
1489 NETREG_REGISTERED, /* completed register_netdevice */ 1622 NETREG_REGISTERED, /* completed register_netdevice */
1490 NETREG_UNREGISTERING, /* called unregister_netdevice */ 1623 NETREG_UNREGISTERING, /* called unregister_netdevice */
@@ -1493,14 +1626,13 @@ struct net_device {
1493 NETREG_DUMMY, /* dummy device for NAPI poll */ 1626 NETREG_DUMMY, /* dummy device for NAPI poll */
1494 } reg_state:8; 1627 } reg_state:8;
1495 1628
1496 bool dismantle; /* device is going do be freed */ 1629 bool dismantle;
1497 1630
1498 enum { 1631 enum {
1499 RTNL_LINK_INITIALIZED, 1632 RTNL_LINK_INITIALIZED,
1500 RTNL_LINK_INITIALIZING, 1633 RTNL_LINK_INITIALIZING,
1501 } rtnl_link_state:16; 1634 } rtnl_link_state:16;
1502 1635
1503 /* Called from unregister, can be used to call free_netdev */
1504 void (*destructor)(struct net_device *dev); 1636 void (*destructor)(struct net_device *dev);
1505 1637
1506#ifdef CONFIG_NETPOLL 1638#ifdef CONFIG_NETPOLL
@@ -1508,31 +1640,25 @@ struct net_device {
1508#endif 1640#endif
1509 1641
1510#ifdef CONFIG_NET_NS 1642#ifdef CONFIG_NET_NS
1511 /* Network namespace this network device is inside */
1512 struct net *nd_net; 1643 struct net *nd_net;
1513#endif 1644#endif
1514 1645
1515 /* mid-layer private */ 1646 /* mid-layer private */
1516 union { 1647 union {
1517 void *ml_priv; 1648 void *ml_priv;
1518 struct pcpu_lstats __percpu *lstats; /* loopback stats */ 1649 struct pcpu_lstats __percpu *lstats;
1519 struct pcpu_sw_netstats __percpu *tstats; 1650 struct pcpu_sw_netstats __percpu *tstats;
1520 struct pcpu_dstats __percpu *dstats; /* dummy stats */ 1651 struct pcpu_dstats __percpu *dstats;
1521 struct pcpu_vstats __percpu *vstats; /* veth stats */ 1652 struct pcpu_vstats __percpu *vstats;
1522 }; 1653 };
1523 /* GARP */ 1654
1524 struct garp_port __rcu *garp_port; 1655 struct garp_port __rcu *garp_port;
1525 /* MRP */
1526 struct mrp_port __rcu *mrp_port; 1656 struct mrp_port __rcu *mrp_port;
1527 1657
1528 /* class/net/name entry */ 1658 struct device dev;
1529 struct device dev;
1530 /* space for optional device, statistics, and wireless sysfs groups */
1531 const struct attribute_group *sysfs_groups[4]; 1659 const struct attribute_group *sysfs_groups[4];
1532 /* space for optional per-rx queue attributes */
1533 const struct attribute_group *sysfs_rx_queue_group; 1660 const struct attribute_group *sysfs_rx_queue_group;
1534 1661
1535 /* rtnetlink link ops */
1536 const struct rtnl_link_ops *rtnl_link_ops; 1662 const struct rtnl_link_ops *rtnl_link_ops;
1537 1663
1538 /* for setting kernel sock attribute on TCP connection setup */ 1664 /* for setting kernel sock attribute on TCP connection setup */
@@ -1542,7 +1668,6 @@ struct net_device {
1542 u16 gso_max_segs; 1668 u16 gso_max_segs;
1543 1669
1544#ifdef CONFIG_DCB 1670#ifdef CONFIG_DCB
1545 /* Data Center Bridging netlink ops */
1546 const struct dcbnl_rtnl_ops *dcbnl_ops; 1671 const struct dcbnl_rtnl_ops *dcbnl_ops;
1547#endif 1672#endif
1548 u8 num_tc; 1673 u8 num_tc;
@@ -1550,20 +1675,14 @@ struct net_device {
1550 u8 prio_tc_map[TC_BITMASK + 1]; 1675 u8 prio_tc_map[TC_BITMASK + 1];
1551 1676
1552#if IS_ENABLED(CONFIG_FCOE) 1677#if IS_ENABLED(CONFIG_FCOE)
1553 /* max exchange id for FCoE LRO by ddp */
1554 unsigned int fcoe_ddp_xid; 1678 unsigned int fcoe_ddp_xid;
1555#endif 1679#endif
1556#if IS_ENABLED(CONFIG_CGROUP_NET_PRIO) 1680#if IS_ENABLED(CONFIG_CGROUP_NET_PRIO)
1557 struct netprio_map __rcu *priomap; 1681 struct netprio_map __rcu *priomap;
1558#endif 1682#endif
1559 /* phy device may attach itself for hardware timestamping */
1560 struct phy_device *phydev; 1683 struct phy_device *phydev;
1561
1562 struct lock_class_key *qdisc_tx_busylock; 1684 struct lock_class_key *qdisc_tx_busylock;
1563
1564 /* group the device belongs to */
1565 int group; 1685 int group;
1566
1567 struct pm_qos_request pm_qos_req; 1686 struct pm_qos_request pm_qos_req;
1568}; 1687};
1569#define to_net_dev(d) container_of(d, struct net_device, dev) 1688#define to_net_dev(d) container_of(d, struct net_device, dev)