diff options
Diffstat (limited to 'include/linux/ethtool.h')
-rw-r--r-- | include/linux/ethtool.h | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index ef4a2d84d922..cca1c3de140d 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
@@ -242,6 +242,7 @@ enum ethtool_stringset { | |||
242 | ETH_SS_TEST = 0, | 242 | ETH_SS_TEST = 0, |
243 | ETH_SS_STATS, | 243 | ETH_SS_STATS, |
244 | ETH_SS_PRIV_FLAGS, | 244 | ETH_SS_PRIV_FLAGS, |
245 | ETH_SS_NTUPLE_FILTERS, | ||
245 | }; | 246 | }; |
246 | 247 | ||
247 | /* for passing string sets for data tagging */ | 248 | /* for passing string sets for data tagging */ |
@@ -290,6 +291,7 @@ struct ethtool_perm_addr { | |||
290 | */ | 291 | */ |
291 | enum ethtool_flags { | 292 | enum ethtool_flags { |
292 | ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */ | 293 | ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */ |
294 | ETH_FLAG_NTUPLE = (1 << 27), /* N-tuple filters enabled */ | ||
293 | }; | 295 | }; |
294 | 296 | ||
295 | /* The following structures are for supporting RX network flow | 297 | /* The following structures are for supporting RX network flow |
@@ -363,6 +365,35 @@ struct ethtool_rxnfc { | |||
363 | __u32 rule_locs[0]; | 365 | __u32 rule_locs[0]; |
364 | }; | 366 | }; |
365 | 367 | ||
368 | struct ethtool_rx_ntuple_flow_spec { | ||
369 | __u32 flow_type; | ||
370 | union { | ||
371 | struct ethtool_tcpip4_spec tcp_ip4_spec; | ||
372 | struct ethtool_tcpip4_spec udp_ip4_spec; | ||
373 | struct ethtool_tcpip4_spec sctp_ip4_spec; | ||
374 | struct ethtool_ah_espip4_spec ah_ip4_spec; | ||
375 | struct ethtool_ah_espip4_spec esp_ip4_spec; | ||
376 | struct ethtool_rawip4_spec raw_ip4_spec; | ||
377 | struct ethtool_ether_spec ether_spec; | ||
378 | struct ethtool_usrip4_spec usr_ip4_spec; | ||
379 | __u8 hdata[64]; | ||
380 | } h_u, m_u; /* entry, mask */ | ||
381 | |||
382 | __u16 vlan_tag; | ||
383 | __u16 vlan_tag_mask; | ||
384 | __u64 data; /* user-defined flow spec data */ | ||
385 | __u64 data_mask; /* user-defined flow spec mask */ | ||
386 | |||
387 | /* signed to distinguish between queue and actions (DROP) */ | ||
388 | __s32 action; | ||
389 | #define ETHTOOL_RXNTUPLE_ACTION_DROP -1 | ||
390 | }; | ||
391 | |||
392 | struct ethtool_rx_ntuple { | ||
393 | __u32 cmd; | ||
394 | struct ethtool_rx_ntuple_flow_spec fs; | ||
395 | }; | ||
396 | |||
366 | #define ETHTOOL_FLASH_MAX_FILENAME 128 | 397 | #define ETHTOOL_FLASH_MAX_FILENAME 128 |
367 | enum ethtool_flash_op_type { | 398 | enum ethtool_flash_op_type { |
368 | ETHTOOL_FLASH_ALL_REGIONS = 0, | 399 | ETHTOOL_FLASH_ALL_REGIONS = 0, |
@@ -377,6 +408,20 @@ struct ethtool_flash { | |||
377 | 408 | ||
378 | #ifdef __KERNEL__ | 409 | #ifdef __KERNEL__ |
379 | 410 | ||
411 | #include <linux/rculist.h> | ||
412 | |||
413 | struct ethtool_rx_ntuple_flow_spec_container { | ||
414 | struct ethtool_rx_ntuple_flow_spec fs; | ||
415 | struct list_head list; | ||
416 | }; | ||
417 | |||
418 | struct ethtool_rx_ntuple_list { | ||
419 | #define ETHTOOL_MAX_NTUPLE_LIST_ENTRY 1024 | ||
420 | #define ETHTOOL_MAX_NTUPLE_STRING_PER_ENTRY 14 | ||
421 | struct list_head list; | ||
422 | unsigned int count; | ||
423 | }; | ||
424 | |||
380 | struct net_device; | 425 | struct net_device; |
381 | 426 | ||
382 | /* Some generic methods drivers may use in their ethtool_ops */ | 427 | /* Some generic methods drivers may use in their ethtool_ops */ |
@@ -394,6 +439,7 @@ u32 ethtool_op_get_ufo(struct net_device *dev); | |||
394 | int ethtool_op_set_ufo(struct net_device *dev, u32 data); | 439 | int ethtool_op_set_ufo(struct net_device *dev, u32 data); |
395 | u32 ethtool_op_get_flags(struct net_device *dev); | 440 | u32 ethtool_op_get_flags(struct net_device *dev); |
396 | int ethtool_op_set_flags(struct net_device *dev, u32 data); | 441 | int ethtool_op_set_flags(struct net_device *dev, u32 data); |
442 | void ethtool_ntuple_flush(struct net_device *dev); | ||
397 | 443 | ||
398 | /** | 444 | /** |
399 | * ðtool_ops - Alter and report network device settings | 445 | * ðtool_ops - Alter and report network device settings |
@@ -500,6 +546,8 @@ struct ethtool_ops { | |||
500 | int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); | 546 | int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); |
501 | int (*flash_device)(struct net_device *, struct ethtool_flash *); | 547 | int (*flash_device)(struct net_device *, struct ethtool_flash *); |
502 | int (*reset)(struct net_device *, u32 *); | 548 | int (*reset)(struct net_device *, u32 *); |
549 | int (*set_rx_ntuple)(struct net_device *, struct ethtool_rx_ntuple *); | ||
550 | int (*get_rx_ntuple)(struct net_device *, u32 stringset, void *); | ||
503 | }; | 551 | }; |
504 | #endif /* __KERNEL__ */ | 552 | #endif /* __KERNEL__ */ |
505 | 553 | ||
@@ -559,6 +607,9 @@ struct ethtool_ops { | |||
559 | #define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */ | 607 | #define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */ |
560 | #define ETHTOOL_RESET 0x00000034 /* Reset hardware */ | 608 | #define ETHTOOL_RESET 0x00000034 /* Reset hardware */ |
561 | 609 | ||
610 | #define ETHTOOL_SRXNTUPLE 0x00000035 /* Add an n-tuple filter to device */ | ||
611 | #define ETHTOOL_GRXNTUPLE 0x00000036 /* Get n-tuple filters from device */ | ||
612 | |||
562 | /* compatibility with older code */ | 613 | /* compatibility with older code */ |
563 | #define SPARC_ETH_GSET ETHTOOL_GSET | 614 | #define SPARC_ETH_GSET ETHTOOL_GSET |
564 | #define SPARC_ETH_SSET ETHTOOL_SSET | 615 | #define SPARC_ETH_SSET ETHTOOL_SSET |