diff options
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r-- | include/linux/netdevice.h | 46 |
1 files changed, 26 insertions, 20 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 0249fe7e3872..9e19477991ad 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -1020,9 +1020,6 @@ struct net_device { | |||
1020 | * part of the usual set specified in Space.c. | 1020 | * part of the usual set specified in Space.c. |
1021 | */ | 1021 | */ |
1022 | 1022 | ||
1023 | unsigned char if_port; /* Selectable AUI, TP,..*/ | ||
1024 | unsigned char dma; /* DMA channel */ | ||
1025 | |||
1026 | unsigned long state; | 1023 | unsigned long state; |
1027 | 1024 | ||
1028 | struct list_head dev_list; | 1025 | struct list_head dev_list; |
@@ -1035,7 +1032,7 @@ struct net_device { | |||
1035 | u32 hw_features; | 1032 | u32 hw_features; |
1036 | /* user-requested features */ | 1033 | /* user-requested features */ |
1037 | u32 wanted_features; | 1034 | u32 wanted_features; |
1038 | /* VLAN feature mask */ | 1035 | /* mask of features inheritable by VLAN devices */ |
1039 | u32 vlan_features; | 1036 | u32 vlan_features; |
1040 | 1037 | ||
1041 | /* Net device feature bits; if you change something, | 1038 | /* Net device feature bits; if you change something, |
@@ -1066,6 +1063,8 @@ struct net_device { | |||
1066 | #define NETIF_F_NTUPLE (1 << 27) /* N-tuple filters supported */ | 1063 | #define NETIF_F_NTUPLE (1 << 27) /* N-tuple filters supported */ |
1067 | #define NETIF_F_RXHASH (1 << 28) /* Receive hashing offload */ | 1064 | #define NETIF_F_RXHASH (1 << 28) /* Receive hashing offload */ |
1068 | #define NETIF_F_RXCSUM (1 << 29) /* Receive checksumming offload */ | 1065 | #define NETIF_F_RXCSUM (1 << 29) /* Receive checksumming offload */ |
1066 | #define NETIF_F_NOCACHE_COPY (1 << 30) /* Use no-cache copyfromuser */ | ||
1067 | #define NETIF_F_LOOPBACK (1 << 31) /* Enable loopback */ | ||
1069 | 1068 | ||
1070 | /* Segmentation offload features */ | 1069 | /* Segmentation offload features */ |
1071 | #define NETIF_F_GSO_SHIFT 16 | 1070 | #define NETIF_F_GSO_SHIFT 16 |
@@ -1079,9 +1078,9 @@ struct net_device { | |||
1079 | 1078 | ||
1080 | /* Features valid for ethtool to change */ | 1079 | /* Features valid for ethtool to change */ |
1081 | /* = all defined minus driver/device-class-related */ | 1080 | /* = all defined minus driver/device-class-related */ |
1082 | #define NETIF_F_NEVER_CHANGE (NETIF_F_HIGHDMA | NETIF_F_VLAN_CHALLENGED | \ | 1081 | #define NETIF_F_NEVER_CHANGE (NETIF_F_VLAN_CHALLENGED | \ |
1083 | NETIF_F_LLTX | NETIF_F_NETNS_LOCAL) | 1082 | NETIF_F_LLTX | NETIF_F_NETNS_LOCAL) |
1084 | #define NETIF_F_ETHTOOL_BITS (0x3f3fffff & ~NETIF_F_NEVER_CHANGE) | 1083 | #define NETIF_F_ETHTOOL_BITS (0xff3fffff & ~NETIF_F_NEVER_CHANGE) |
1085 | 1084 | ||
1086 | /* List of features with software fallbacks. */ | 1085 | /* List of features with software fallbacks. */ |
1087 | #define NETIF_F_GSO_SOFTWARE (NETIF_F_TSO | NETIF_F_TSO_ECN | \ | 1086 | #define NETIF_F_GSO_SOFTWARE (NETIF_F_TSO | NETIF_F_TSO_ECN | \ |
@@ -1095,9 +1094,8 @@ struct net_device { | |||
1095 | 1094 | ||
1096 | #define NETIF_F_ALL_TSO (NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_TSO_ECN) | 1095 | #define NETIF_F_ALL_TSO (NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_TSO_ECN) |
1097 | 1096 | ||
1098 | #define NETIF_F_ALL_TX_OFFLOADS (NETIF_F_ALL_CSUM | NETIF_F_SG | \ | 1097 | #define NETIF_F_ALL_FCOE (NETIF_F_FCOE_CRC | NETIF_F_FCOE_MTU | \ |
1099 | NETIF_F_FRAGLIST | NETIF_F_ALL_TSO | \ | 1098 | NETIF_F_FSO) |
1100 | NETIF_F_SCTP_CSUM | NETIF_F_FCOE_CRC) | ||
1101 | 1099 | ||
1102 | /* | 1100 | /* |
1103 | * If one device supports one of these features, then enable them | 1101 | * If one device supports one of these features, then enable them |
@@ -1105,7 +1103,12 @@ struct net_device { | |||
1105 | */ | 1103 | */ |
1106 | #define NETIF_F_ONE_FOR_ALL (NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ROBUST | \ | 1104 | #define NETIF_F_ONE_FOR_ALL (NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ROBUST | \ |
1107 | NETIF_F_SG | NETIF_F_HIGHDMA | \ | 1105 | NETIF_F_SG | NETIF_F_HIGHDMA | \ |
1108 | NETIF_F_FRAGLIST) | 1106 | NETIF_F_FRAGLIST | NETIF_F_VLAN_CHALLENGED) |
1107 | /* | ||
1108 | * If one device doesn't support one of these features, then disable it | ||
1109 | * for all in netdev_increment_features. | ||
1110 | */ | ||
1111 | #define NETIF_F_ALL_FOR_ALL (NETIF_F_NOCACHE_COPY | NETIF_F_FSO) | ||
1109 | 1112 | ||
1110 | /* changeable features with no special hardware requirements */ | 1113 | /* changeable features with no special hardware requirements */ |
1111 | #define NETIF_F_SOFT_FEATURES (NETIF_F_GSO | NETIF_F_GRO) | 1114 | #define NETIF_F_SOFT_FEATURES (NETIF_F_GSO | NETIF_F_GRO) |
@@ -1134,13 +1137,16 @@ struct net_device { | |||
1134 | const struct header_ops *header_ops; | 1137 | const struct header_ops *header_ops; |
1135 | 1138 | ||
1136 | unsigned int flags; /* interface flags (a la BSD) */ | 1139 | unsigned int flags; /* interface flags (a la BSD) */ |
1140 | unsigned int priv_flags; /* Like 'flags' but invisible to userspace. */ | ||
1137 | unsigned short gflags; | 1141 | unsigned short gflags; |
1138 | unsigned int priv_flags; /* Like 'flags' but invisible to userspace. */ | ||
1139 | unsigned short padded; /* How much padding added by alloc_netdev() */ | 1142 | unsigned short padded; /* How much padding added by alloc_netdev() */ |
1140 | 1143 | ||
1141 | unsigned char operstate; /* RFC2863 operstate */ | 1144 | unsigned char operstate; /* RFC2863 operstate */ |
1142 | unsigned char link_mode; /* mapping policy to operstate */ | 1145 | unsigned char link_mode; /* mapping policy to operstate */ |
1143 | 1146 | ||
1147 | unsigned char if_port; /* Selectable AUI, TP,..*/ | ||
1148 | unsigned char dma; /* DMA channel */ | ||
1149 | |||
1144 | unsigned int mtu; /* interface MTU value */ | 1150 | unsigned int mtu; /* interface MTU value */ |
1145 | unsigned short type; /* interface hardware type */ | 1151 | unsigned short type; /* interface hardware type */ |
1146 | unsigned short hard_header_len; /* hardware hdr length */ | 1152 | unsigned short hard_header_len; /* hardware hdr length */ |
@@ -1281,7 +1287,9 @@ struct net_device { | |||
1281 | NETREG_UNREGISTERED, /* completed unregister todo */ | 1287 | NETREG_UNREGISTERED, /* completed unregister todo */ |
1282 | NETREG_RELEASED, /* called free_netdev */ | 1288 | NETREG_RELEASED, /* called free_netdev */ |
1283 | NETREG_DUMMY, /* dummy device for NAPI poll */ | 1289 | NETREG_DUMMY, /* dummy device for NAPI poll */ |
1284 | } reg_state:16; | 1290 | } reg_state:8; |
1291 | |||
1292 | bool dismantle; /* device is going do be freed */ | ||
1285 | 1293 | ||
1286 | enum { | 1294 | enum { |
1287 | RTNL_LINK_INITIALIZED, | 1295 | RTNL_LINK_INITIALIZED, |
@@ -2513,6 +2521,7 @@ extern struct rtnl_link_stats64 *dev_get_stats(struct net_device *dev, | |||
2513 | extern int netdev_max_backlog; | 2521 | extern int netdev_max_backlog; |
2514 | extern int netdev_tstamp_prequeue; | 2522 | extern int netdev_tstamp_prequeue; |
2515 | extern int weight_p; | 2523 | extern int weight_p; |
2524 | extern int bpf_jit_enable; | ||
2516 | extern int netdev_set_master(struct net_device *dev, struct net_device *master); | 2525 | extern int netdev_set_master(struct net_device *dev, struct net_device *master); |
2517 | extern int netdev_set_bond_master(struct net_device *dev, | 2526 | extern int netdev_set_bond_master(struct net_device *dev, |
2518 | struct net_device *master); | 2527 | struct net_device *master); |
@@ -2540,7 +2549,7 @@ extern void netdev_class_remove_file(struct class_attribute *class_attr); | |||
2540 | 2549 | ||
2541 | extern struct kobj_ns_type_operations net_ns_type_operations; | 2550 | extern struct kobj_ns_type_operations net_ns_type_operations; |
2542 | 2551 | ||
2543 | extern char *netdev_drivername(const struct net_device *dev, char *buffer, int len); | 2552 | extern const char *netdev_drivername(const struct net_device *dev); |
2544 | 2553 | ||
2545 | extern void linkwatch_run_queue(void); | 2554 | extern void linkwatch_run_queue(void); |
2546 | 2555 | ||
@@ -2550,7 +2559,9 @@ static inline u32 netdev_get_wanted_features(struct net_device *dev) | |||
2550 | } | 2559 | } |
2551 | u32 netdev_increment_features(u32 all, u32 one, u32 mask); | 2560 | u32 netdev_increment_features(u32 all, u32 one, u32 mask); |
2552 | u32 netdev_fix_features(struct net_device *dev, u32 features); | 2561 | u32 netdev_fix_features(struct net_device *dev, u32 features); |
2562 | int __netdev_update_features(struct net_device *dev); | ||
2553 | void netdev_update_features(struct net_device *dev); | 2563 | void netdev_update_features(struct net_device *dev); |
2564 | void netdev_change_features(struct net_device *dev); | ||
2554 | 2565 | ||
2555 | void netif_stacked_transfer_operstate(const struct net_device *rootdev, | 2566 | void netif_stacked_transfer_operstate(const struct net_device *rootdev, |
2556 | struct net_device *dev); | 2567 | struct net_device *dev); |
@@ -2588,13 +2599,8 @@ static inline int netif_is_bond_slave(struct net_device *dev) | |||
2588 | 2599 | ||
2589 | extern struct pernet_operations __net_initdata loopback_net_ops; | 2600 | extern struct pernet_operations __net_initdata loopback_net_ops; |
2590 | 2601 | ||
2591 | static inline int dev_ethtool_get_settings(struct net_device *dev, | 2602 | int dev_ethtool_get_settings(struct net_device *dev, |
2592 | struct ethtool_cmd *cmd) | 2603 | struct ethtool_cmd *cmd); |
2593 | { | ||
2594 | if (!dev->ethtool_ops || !dev->ethtool_ops->get_settings) | ||
2595 | return -EOPNOTSUPP; | ||
2596 | return dev->ethtool_ops->get_settings(dev, cmd); | ||
2597 | } | ||
2598 | 2604 | ||
2599 | static inline u32 dev_ethtool_get_rx_csum(struct net_device *dev) | 2605 | static inline u32 dev_ethtool_get_rx_csum(struct net_device *dev) |
2600 | { | 2606 | { |