diff options
Diffstat (limited to 'include/linux/ethtool.h')
-rw-r--r-- | include/linux/ethtool.h | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index ef4a2d84d922..b33f316bb92e 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
@@ -61,6 +61,13 @@ struct ethtool_drvinfo { | |||
61 | /* For PCI devices, use pci_name(pci_dev). */ | 61 | /* For PCI devices, use pci_name(pci_dev). */ |
62 | char reserved1[32]; | 62 | char reserved1[32]; |
63 | char reserved2[12]; | 63 | char reserved2[12]; |
64 | /* | ||
65 | * Some struct members below are filled in | ||
66 | * using ops->get_sset_count(). Obtaining | ||
67 | * this info from ethtool_drvinfo is now | ||
68 | * deprecated; Use ETHTOOL_GSSET_INFO | ||
69 | * instead. | ||
70 | */ | ||
64 | __u32 n_priv_flags; /* number of flags valid in ETHTOOL_GPFLAGS */ | 71 | __u32 n_priv_flags; /* number of flags valid in ETHTOOL_GPFLAGS */ |
65 | __u32 n_stats; /* number of u64's from ETHTOOL_GSTATS */ | 72 | __u32 n_stats; /* number of u64's from ETHTOOL_GSTATS */ |
66 | __u32 testinfo_len; | 73 | __u32 testinfo_len; |
@@ -242,6 +249,7 @@ enum ethtool_stringset { | |||
242 | ETH_SS_TEST = 0, | 249 | ETH_SS_TEST = 0, |
243 | ETH_SS_STATS, | 250 | ETH_SS_STATS, |
244 | ETH_SS_PRIV_FLAGS, | 251 | ETH_SS_PRIV_FLAGS, |
252 | ETH_SS_NTUPLE_FILTERS, | ||
245 | }; | 253 | }; |
246 | 254 | ||
247 | /* for passing string sets for data tagging */ | 255 | /* for passing string sets for data tagging */ |
@@ -252,6 +260,17 @@ struct ethtool_gstrings { | |||
252 | __u8 data[0]; | 260 | __u8 data[0]; |
253 | }; | 261 | }; |
254 | 262 | ||
263 | struct ethtool_sset_info { | ||
264 | __u32 cmd; /* ETHTOOL_GSSET_INFO */ | ||
265 | __u32 reserved; | ||
266 | __u64 sset_mask; /* input: each bit selects an sset to query */ | ||
267 | /* output: each bit a returned sset */ | ||
268 | __u32 data[0]; /* ETH_SS_xxx count, in order, based on bits | ||
269 | in sset_mask. One bit implies one | ||
270 | __u32, two bits implies two | ||
271 | __u32's, etc. */ | ||
272 | }; | ||
273 | |||
255 | enum ethtool_test_flags { | 274 | enum ethtool_test_flags { |
256 | ETH_TEST_FL_OFFLINE = (1 << 0), /* online / offline */ | 275 | ETH_TEST_FL_OFFLINE = (1 << 0), /* online / offline */ |
257 | ETH_TEST_FL_FAILED = (1 << 1), /* test passed / failed */ | 276 | ETH_TEST_FL_FAILED = (1 << 1), /* test passed / failed */ |
@@ -290,6 +309,7 @@ struct ethtool_perm_addr { | |||
290 | */ | 309 | */ |
291 | enum ethtool_flags { | 310 | enum ethtool_flags { |
292 | ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */ | 311 | ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */ |
312 | ETH_FLAG_NTUPLE = (1 << 27), /* N-tuple filters enabled */ | ||
293 | }; | 313 | }; |
294 | 314 | ||
295 | /* The following structures are for supporting RX network flow | 315 | /* The following structures are for supporting RX network flow |
@@ -363,6 +383,35 @@ struct ethtool_rxnfc { | |||
363 | __u32 rule_locs[0]; | 383 | __u32 rule_locs[0]; |
364 | }; | 384 | }; |
365 | 385 | ||
386 | struct ethtool_rx_ntuple_flow_spec { | ||
387 | __u32 flow_type; | ||
388 | union { | ||
389 | struct ethtool_tcpip4_spec tcp_ip4_spec; | ||
390 | struct ethtool_tcpip4_spec udp_ip4_spec; | ||
391 | struct ethtool_tcpip4_spec sctp_ip4_spec; | ||
392 | struct ethtool_ah_espip4_spec ah_ip4_spec; | ||
393 | struct ethtool_ah_espip4_spec esp_ip4_spec; | ||
394 | struct ethtool_rawip4_spec raw_ip4_spec; | ||
395 | struct ethtool_ether_spec ether_spec; | ||
396 | struct ethtool_usrip4_spec usr_ip4_spec; | ||
397 | __u8 hdata[64]; | ||
398 | } h_u, m_u; /* entry, mask */ | ||
399 | |||
400 | __u16 vlan_tag; | ||
401 | __u16 vlan_tag_mask; | ||
402 | __u64 data; /* user-defined flow spec data */ | ||
403 | __u64 data_mask; /* user-defined flow spec mask */ | ||
404 | |||
405 | /* signed to distinguish between queue and actions (DROP) */ | ||
406 | __s32 action; | ||
407 | #define ETHTOOL_RXNTUPLE_ACTION_DROP -1 | ||
408 | }; | ||
409 | |||
410 | struct ethtool_rx_ntuple { | ||
411 | __u32 cmd; | ||
412 | struct ethtool_rx_ntuple_flow_spec fs; | ||
413 | }; | ||
414 | |||
366 | #define ETHTOOL_FLASH_MAX_FILENAME 128 | 415 | #define ETHTOOL_FLASH_MAX_FILENAME 128 |
367 | enum ethtool_flash_op_type { | 416 | enum ethtool_flash_op_type { |
368 | ETHTOOL_FLASH_ALL_REGIONS = 0, | 417 | ETHTOOL_FLASH_ALL_REGIONS = 0, |
@@ -377,6 +426,20 @@ struct ethtool_flash { | |||
377 | 426 | ||
378 | #ifdef __KERNEL__ | 427 | #ifdef __KERNEL__ |
379 | 428 | ||
429 | #include <linux/rculist.h> | ||
430 | |||
431 | struct ethtool_rx_ntuple_flow_spec_container { | ||
432 | struct ethtool_rx_ntuple_flow_spec fs; | ||
433 | struct list_head list; | ||
434 | }; | ||
435 | |||
436 | struct ethtool_rx_ntuple_list { | ||
437 | #define ETHTOOL_MAX_NTUPLE_LIST_ENTRY 1024 | ||
438 | #define ETHTOOL_MAX_NTUPLE_STRING_PER_ENTRY 14 | ||
439 | struct list_head list; | ||
440 | unsigned int count; | ||
441 | }; | ||
442 | |||
380 | struct net_device; | 443 | struct net_device; |
381 | 444 | ||
382 | /* Some generic methods drivers may use in their ethtool_ops */ | 445 | /* Some generic methods drivers may use in their ethtool_ops */ |
@@ -394,6 +457,7 @@ u32 ethtool_op_get_ufo(struct net_device *dev); | |||
394 | int ethtool_op_set_ufo(struct net_device *dev, u32 data); | 457 | int ethtool_op_set_ufo(struct net_device *dev, u32 data); |
395 | u32 ethtool_op_get_flags(struct net_device *dev); | 458 | u32 ethtool_op_get_flags(struct net_device *dev); |
396 | int ethtool_op_set_flags(struct net_device *dev, u32 data); | 459 | int ethtool_op_set_flags(struct net_device *dev, u32 data); |
460 | void ethtool_ntuple_flush(struct net_device *dev); | ||
397 | 461 | ||
398 | /** | 462 | /** |
399 | * ðtool_ops - Alter and report network device settings | 463 | * ðtool_ops - Alter and report network device settings |
@@ -500,6 +564,8 @@ struct ethtool_ops { | |||
500 | int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); | 564 | int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); |
501 | int (*flash_device)(struct net_device *, struct ethtool_flash *); | 565 | int (*flash_device)(struct net_device *, struct ethtool_flash *); |
502 | int (*reset)(struct net_device *, u32 *); | 566 | int (*reset)(struct net_device *, u32 *); |
567 | int (*set_rx_ntuple)(struct net_device *, struct ethtool_rx_ntuple *); | ||
568 | int (*get_rx_ntuple)(struct net_device *, u32 stringset, void *); | ||
503 | }; | 569 | }; |
504 | #endif /* __KERNEL__ */ | 570 | #endif /* __KERNEL__ */ |
505 | 571 | ||
@@ -558,6 +624,9 @@ struct ethtool_ops { | |||
558 | #define ETHTOOL_SRXCLSRLINS 0x00000032 /* Insert RX classification rule */ | 624 | #define ETHTOOL_SRXCLSRLINS 0x00000032 /* Insert RX classification rule */ |
559 | #define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */ | 625 | #define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */ |
560 | #define ETHTOOL_RESET 0x00000034 /* Reset hardware */ | 626 | #define ETHTOOL_RESET 0x00000034 /* Reset hardware */ |
627 | #define ETHTOOL_SRXNTUPLE 0x00000035 /* Add an n-tuple filter to device */ | ||
628 | #define ETHTOOL_GRXNTUPLE 0x00000036 /* Get n-tuple filters from device */ | ||
629 | #define ETHTOOL_GSSET_INFO 0x00000037 /* Get string set info */ | ||
561 | 630 | ||
562 | /* compatibility with older code */ | 631 | /* compatibility with older code */ |
563 | #define SPARC_ETH_GSET ETHTOOL_GSET | 632 | #define SPARC_ETH_GSET ETHTOOL_GSET |