diff options
Diffstat (limited to 'include/linux')
38 files changed, 834 insertions, 191 deletions
diff --git a/include/linux/ath9k_platform.h b/include/linux/ath9k_platform.h index 8598f8eacb20..a495a959e8a7 100644 --- a/include/linux/ath9k_platform.h +++ b/include/linux/ath9k_platform.h | |||
@@ -36,6 +36,8 @@ struct ath9k_platform_data { | |||
36 | 36 | ||
37 | int (*get_mac_revision)(void); | 37 | int (*get_mac_revision)(void); |
38 | int (*external_reset)(void); | 38 | int (*external_reset)(void); |
39 | |||
40 | bool use_eeprom; | ||
39 | }; | 41 | }; |
40 | 42 | ||
41 | #endif /* _LINUX_ATH9K_PLATFORM_H */ | 43 | #endif /* _LINUX_ATH9K_PLATFORM_H */ |
diff --git a/include/linux/can/core.h b/include/linux/can/core.h index 78c6c52073ad..a0875001b13c 100644 --- a/include/linux/can/core.h +++ b/include/linux/can/core.h | |||
@@ -10,8 +10,8 @@ | |||
10 | * | 10 | * |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #ifndef CAN_CORE_H | 13 | #ifndef _CAN_CORE_H |
14 | #define CAN_CORE_H | 14 | #define _CAN_CORE_H |
15 | 15 | ||
16 | #include <linux/can.h> | 16 | #include <linux/can.h> |
17 | #include <linux/skbuff.h> | 17 | #include <linux/skbuff.h> |
@@ -58,4 +58,4 @@ extern void can_rx_unregister(struct net_device *dev, canid_t can_id, | |||
58 | extern int can_send(struct sk_buff *skb, int loop); | 58 | extern int can_send(struct sk_buff *skb, int loop); |
59 | extern int can_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); | 59 | extern int can_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg); |
60 | 60 | ||
61 | #endif /* CAN_CORE_H */ | 61 | #endif /* !_CAN_CORE_H */ |
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h index 3ce5e526525f..6992afc6ba7f 100644 --- a/include/linux/can/dev.h +++ b/include/linux/can/dev.h | |||
@@ -10,8 +10,8 @@ | |||
10 | * | 10 | * |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #ifndef CAN_DEV_H | 13 | #ifndef _CAN_DEV_H |
14 | #define CAN_DEV_H | 14 | #define _CAN_DEV_H |
15 | 15 | ||
16 | #include <linux/can.h> | 16 | #include <linux/can.h> |
17 | #include <linux/can/netlink.h> | 17 | #include <linux/can/netlink.h> |
@@ -132,4 +132,4 @@ struct sk_buff *alloc_canfd_skb(struct net_device *dev, | |||
132 | struct sk_buff *alloc_can_err_skb(struct net_device *dev, | 132 | struct sk_buff *alloc_can_err_skb(struct net_device *dev, |
133 | struct can_frame **cf); | 133 | struct can_frame **cf); |
134 | 134 | ||
135 | #endif /* CAN_DEV_H */ | 135 | #endif /* !_CAN_DEV_H */ |
diff --git a/include/linux/can/led.h b/include/linux/can/led.h index 9c1167baf273..e0475c5cbb92 100644 --- a/include/linux/can/led.h +++ b/include/linux/can/led.h | |||
@@ -6,8 +6,8 @@ | |||
6 | * published by the Free Software Foundation. | 6 | * published by the Free Software Foundation. |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #ifndef CAN_LED_H | 9 | #ifndef _CAN_LED_H |
10 | #define CAN_LED_H | 10 | #define _CAN_LED_H |
11 | 11 | ||
12 | #include <linux/if.h> | 12 | #include <linux/if.h> |
13 | #include <linux/leds.h> | 13 | #include <linux/leds.h> |
@@ -48,4 +48,4 @@ static inline void can_led_notifier_exit(void) | |||
48 | 48 | ||
49 | #endif | 49 | #endif |
50 | 50 | ||
51 | #endif | 51 | #endif /* !_CAN_LED_H */ |
diff --git a/include/linux/can/platform/cc770.h b/include/linux/can/platform/cc770.h index 7702641f87ee..78b2d44f04cf 100644 --- a/include/linux/can/platform/cc770.h +++ b/include/linux/can/platform/cc770.h | |||
@@ -1,5 +1,5 @@ | |||
1 | #ifndef _CAN_PLATFORM_CC770_H_ | 1 | #ifndef _CAN_PLATFORM_CC770_H |
2 | #define _CAN_PLATFORM_CC770_H_ | 2 | #define _CAN_PLATFORM_CC770_H |
3 | 3 | ||
4 | /* CPU Interface Register (0x02) */ | 4 | /* CPU Interface Register (0x02) */ |
5 | #define CPUIF_CEN 0x01 /* Clock Out Enable */ | 5 | #define CPUIF_CEN 0x01 /* Clock Out Enable */ |
@@ -30,4 +30,4 @@ struct cc770_platform_data { | |||
30 | u8 bcr; /* Bus Configuration Register */ | 30 | u8 bcr; /* Bus Configuration Register */ |
31 | }; | 31 | }; |
32 | 32 | ||
33 | #endif /* !_CAN_PLATFORM_CC770_H_ */ | 33 | #endif /* !_CAN_PLATFORM_CC770_H */ |
diff --git a/include/linux/can/platform/mcp251x.h b/include/linux/can/platform/mcp251x.h index dc029dba7a03..d44fcae274ff 100644 --- a/include/linux/can/platform/mcp251x.h +++ b/include/linux/can/platform/mcp251x.h | |||
@@ -1,5 +1,5 @@ | |||
1 | #ifndef __CAN_PLATFORM_MCP251X_H__ | 1 | #ifndef _CAN_PLATFORM_MCP251X_H |
2 | #define __CAN_PLATFORM_MCP251X_H__ | 2 | #define _CAN_PLATFORM_MCP251X_H |
3 | 3 | ||
4 | /* | 4 | /* |
5 | * | 5 | * |
@@ -18,4 +18,4 @@ struct mcp251x_platform_data { | |||
18 | unsigned long oscillator_frequency; | 18 | unsigned long oscillator_frequency; |
19 | }; | 19 | }; |
20 | 20 | ||
21 | #endif /* __CAN_PLATFORM_MCP251X_H__ */ | 21 | #endif /* !_CAN_PLATFORM_MCP251X_H */ |
diff --git a/include/linux/can/platform/rcar_can.h b/include/linux/can/platform/rcar_can.h new file mode 100644 index 000000000000..0f4a2f3df504 --- /dev/null +++ b/include/linux/can/platform/rcar_can.h | |||
@@ -0,0 +1,17 @@ | |||
1 | #ifndef _CAN_PLATFORM_RCAR_CAN_H_ | ||
2 | #define _CAN_PLATFORM_RCAR_CAN_H_ | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | /* Clock Select Register settings */ | ||
7 | enum CLKR { | ||
8 | CLKR_CLKP1 = 0, /* Peripheral clock (clkp1) */ | ||
9 | CLKR_CLKP2 = 1, /* Peripheral clock (clkp2) */ | ||
10 | CLKR_CLKEXT = 3 /* Externally input clock */ | ||
11 | }; | ||
12 | |||
13 | struct rcar_can_platform_data { | ||
14 | enum CLKR clock_select; /* Clock source select */ | ||
15 | }; | ||
16 | |||
17 | #endif /* !_CAN_PLATFORM_RCAR_CAN_H_ */ | ||
diff --git a/include/linux/can/platform/sja1000.h b/include/linux/can/platform/sja1000.h index 96f8fcc78d78..93570b61ec6c 100644 --- a/include/linux/can/platform/sja1000.h +++ b/include/linux/can/platform/sja1000.h | |||
@@ -1,5 +1,5 @@ | |||
1 | #ifndef _CAN_PLATFORM_SJA1000_H_ | 1 | #ifndef _CAN_PLATFORM_SJA1000_H |
2 | #define _CAN_PLATFORM_SJA1000_H_ | 2 | #define _CAN_PLATFORM_SJA1000_H |
3 | 3 | ||
4 | /* clock divider register */ | 4 | /* clock divider register */ |
5 | #define CDR_CLKOUT_MASK 0x07 | 5 | #define CDR_CLKOUT_MASK 0x07 |
@@ -32,4 +32,4 @@ struct sja1000_platform_data { | |||
32 | u8 cdr; /* clock divider register */ | 32 | u8 cdr; /* clock divider register */ |
33 | }; | 33 | }; |
34 | 34 | ||
35 | #endif /* !_CAN_PLATFORM_SJA1000_H_ */ | 35 | #endif /* !_CAN_PLATFORM_SJA1000_H */ |
diff --git a/include/linux/can/platform/ti_hecc.h b/include/linux/can/platform/ti_hecc.h index af17cb3f7a84..a52f47ca6c8a 100644 --- a/include/linux/can/platform/ti_hecc.h +++ b/include/linux/can/platform/ti_hecc.h | |||
@@ -1,5 +1,5 @@ | |||
1 | #ifndef __CAN_PLATFORM_TI_HECC_H__ | 1 | #ifndef _CAN_PLATFORM_TI_HECC_H |
2 | #define __CAN_PLATFORM_TI_HECC_H__ | 2 | #define _CAN_PLATFORM_TI_HECC_H |
3 | 3 | ||
4 | /* | 4 | /* |
5 | * TI HECC (High End CAN Controller) driver platform header | 5 | * TI HECC (High End CAN Controller) driver platform header |
@@ -41,4 +41,4 @@ struct ti_hecc_platform_data { | |||
41 | u32 version; | 41 | u32 version; |
42 | void (*transceiver_switch) (int); | 42 | void (*transceiver_switch) (int); |
43 | }; | 43 | }; |
44 | #endif | 44 | #endif /* !_CAN_PLATFORM_TI_HECC_H */ |
diff --git a/include/linux/can/skb.h b/include/linux/can/skb.h index f9bbbb472663..cc00d15c6107 100644 --- a/include/linux/can/skb.h +++ b/include/linux/can/skb.h | |||
@@ -7,8 +7,8 @@ | |||
7 | * | 7 | * |
8 | */ | 8 | */ |
9 | 9 | ||
10 | #ifndef CAN_SKB_H | 10 | #ifndef _CAN_SKB_H |
11 | #define CAN_SKB_H | 11 | #define _CAN_SKB_H |
12 | 12 | ||
13 | #include <linux/types.h> | 13 | #include <linux/types.h> |
14 | #include <linux/skbuff.h> | 14 | #include <linux/skbuff.h> |
@@ -80,4 +80,4 @@ static inline struct sk_buff *can_create_echo_skb(struct sk_buff *skb) | |||
80 | return skb; | 80 | return skb; |
81 | } | 81 | } |
82 | 82 | ||
83 | #endif /* CAN_SKB_H */ | 83 | #endif /* !_CAN_SKB_H */ |
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index 3557ea7b2049..2997af6d2ccd 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
@@ -142,6 +142,13 @@ static inline unsigned int cpumask_any_but(const struct cpumask *mask, | |||
142 | return 1; | 142 | return 1; |
143 | } | 143 | } |
144 | 144 | ||
145 | static inline int cpumask_set_cpu_local_first(int i, int numa_node, cpumask_t *dstp) | ||
146 | { | ||
147 | set_bit(0, cpumask_bits(dstp)); | ||
148 | |||
149 | return 0; | ||
150 | } | ||
151 | |||
145 | #define for_each_cpu(cpu, mask) \ | 152 | #define for_each_cpu(cpu, mask) \ |
146 | for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask) | 153 | for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask) |
147 | #define for_each_cpu_not(cpu, mask) \ | 154 | #define for_each_cpu_not(cpu, mask) \ |
@@ -192,6 +199,7 @@ static inline unsigned int cpumask_next_zero(int n, const struct cpumask *srcp) | |||
192 | 199 | ||
193 | int cpumask_next_and(int n, const struct cpumask *, const struct cpumask *); | 200 | int cpumask_next_and(int n, const struct cpumask *, const struct cpumask *); |
194 | int cpumask_any_but(const struct cpumask *mask, unsigned int cpu); | 201 | int cpumask_any_but(const struct cpumask *mask, unsigned int cpu); |
202 | int cpumask_set_cpu_local_first(int i, int numa_node, cpumask_t *dstp); | ||
195 | 203 | ||
196 | /** | 204 | /** |
197 | * for_each_cpu - iterate over every cpu in a mask | 205 | * for_each_cpu - iterate over every cpu in a mask |
diff --git a/include/linux/crc7.h b/include/linux/crc7.h index 1786e772d5c6..d590765106f3 100644 --- a/include/linux/crc7.h +++ b/include/linux/crc7.h | |||
@@ -2,13 +2,13 @@ | |||
2 | #define _LINUX_CRC7_H | 2 | #define _LINUX_CRC7_H |
3 | #include <linux/types.h> | 3 | #include <linux/types.h> |
4 | 4 | ||
5 | extern const u8 crc7_syndrome_table[256]; | 5 | extern const u8 crc7_be_syndrome_table[256]; |
6 | 6 | ||
7 | static inline u8 crc7_byte(u8 crc, u8 data) | 7 | static inline u8 crc7_be_byte(u8 crc, u8 data) |
8 | { | 8 | { |
9 | return crc7_syndrome_table[(crc << 1) ^ data]; | 9 | return crc7_be_syndrome_table[crc ^ data]; |
10 | } | 10 | } |
11 | 11 | ||
12 | extern u8 crc7(u8 crc, const u8 *buffer, size_t len); | 12 | extern u8 crc7_be(u8 crc, const u8 *buffer, size_t len); |
13 | 13 | ||
14 | #endif | 14 | #endif |
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index 0a114d05f68d..e658229fee39 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
@@ -154,13 +154,20 @@ static inline u32 ethtool_rxfh_indir_default(u32 index, u32 n_rx_rings) | |||
154 | * @reset: Reset (part of) the device, as specified by a bitmask of | 154 | * @reset: Reset (part of) the device, as specified by a bitmask of |
155 | * flags from &enum ethtool_reset_flags. Returns a negative | 155 | * flags from &enum ethtool_reset_flags. Returns a negative |
156 | * error code or zero. | 156 | * error code or zero. |
157 | * @get_rxfh_key_size: Get the size of the RX flow hash key. | ||
158 | * Returns zero if not supported for this specific device. | ||
157 | * @get_rxfh_indir_size: Get the size of the RX flow hash indirection table. | 159 | * @get_rxfh_indir_size: Get the size of the RX flow hash indirection table. |
158 | * Returns zero if not supported for this specific device. | 160 | * Returns zero if not supported for this specific device. |
159 | * @get_rxfh_indir: Get the contents of the RX flow hash indirection table. | 161 | * @get_rxfh: Get the contents of the RX flow hash indirection table and hash |
160 | * Will not be called if @get_rxfh_indir_size returns zero. | 162 | * key. |
163 | * Will only be called if one or both of @get_rxfh_indir_size and | ||
164 | * @get_rxfh_key_size are implemented and return non-zero. | ||
161 | * Returns a negative error code or zero. | 165 | * Returns a negative error code or zero. |
162 | * @set_rxfh_indir: Set the contents of the RX flow hash indirection table. | 166 | * @set_rxfh: Set the contents of the RX flow hash indirection table and/or |
163 | * Will not be called if @get_rxfh_indir_size returns zero. | 167 | * hash key. In case only the indirection table or hash key is to be |
168 | * changed, the other argument will be %NULL. | ||
169 | * Will only be called if one or both of @get_rxfh_indir_size and | ||
170 | * @get_rxfh_key_size are implemented and return non-zero. | ||
164 | * Returns a negative error code or zero. | 171 | * Returns a negative error code or zero. |
165 | * @get_channels: Get number of channels. | 172 | * @get_channels: Get number of channels. |
166 | * @set_channels: Set number of channels. Returns a negative error code or | 173 | * @set_channels: Set number of channels. Returns a negative error code or |
@@ -232,9 +239,11 @@ struct ethtool_ops { | |||
232 | int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); | 239 | int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); |
233 | int (*flash_device)(struct net_device *, struct ethtool_flash *); | 240 | int (*flash_device)(struct net_device *, struct ethtool_flash *); |
234 | int (*reset)(struct net_device *, u32 *); | 241 | int (*reset)(struct net_device *, u32 *); |
242 | u32 (*get_rxfh_key_size)(struct net_device *); | ||
235 | u32 (*get_rxfh_indir_size)(struct net_device *); | 243 | u32 (*get_rxfh_indir_size)(struct net_device *); |
236 | int (*get_rxfh_indir)(struct net_device *, u32 *); | 244 | int (*get_rxfh)(struct net_device *, u32 *indir, u8 *key); |
237 | int (*set_rxfh_indir)(struct net_device *, const u32 *); | 245 | int (*set_rxfh)(struct net_device *, const u32 *indir, |
246 | const u8 *key); | ||
238 | void (*get_channels)(struct net_device *, struct ethtool_channels *); | 247 | void (*get_channels)(struct net_device *, struct ethtool_channels *); |
239 | int (*set_channels)(struct net_device *, struct ethtool_channels *); | 248 | int (*set_channels)(struct net_device *, struct ethtool_channels *); |
240 | int (*get_dump_flag)(struct net_device *, struct ethtool_dump *); | 249 | int (*get_dump_flag)(struct net_device *, struct ethtool_dump *); |
diff --git a/include/linux/filter.h b/include/linux/filter.h index 024fd03e5d18..a7e3c48d73a7 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h | |||
@@ -37,21 +37,270 @@ | |||
37 | #define BPF_CALL 0x80 /* function call */ | 37 | #define BPF_CALL 0x80 /* function call */ |
38 | #define BPF_EXIT 0x90 /* function return */ | 38 | #define BPF_EXIT 0x90 /* function return */ |
39 | 39 | ||
40 | /* Register numbers */ | ||
41 | enum { | ||
42 | BPF_REG_0 = 0, | ||
43 | BPF_REG_1, | ||
44 | BPF_REG_2, | ||
45 | BPF_REG_3, | ||
46 | BPF_REG_4, | ||
47 | BPF_REG_5, | ||
48 | BPF_REG_6, | ||
49 | BPF_REG_7, | ||
50 | BPF_REG_8, | ||
51 | BPF_REG_9, | ||
52 | BPF_REG_10, | ||
53 | __MAX_BPF_REG, | ||
54 | }; | ||
55 | |||
40 | /* BPF has 10 general purpose 64-bit registers and stack frame. */ | 56 | /* BPF has 10 general purpose 64-bit registers and stack frame. */ |
41 | #define MAX_BPF_REG 11 | 57 | #define MAX_BPF_REG __MAX_BPF_REG |
58 | |||
59 | /* ArgX, context and stack frame pointer register positions. Note, | ||
60 | * Arg1, Arg2, Arg3, etc are used as argument mappings of function | ||
61 | * calls in BPF_CALL instruction. | ||
62 | */ | ||
63 | #define BPF_REG_ARG1 BPF_REG_1 | ||
64 | #define BPF_REG_ARG2 BPF_REG_2 | ||
65 | #define BPF_REG_ARG3 BPF_REG_3 | ||
66 | #define BPF_REG_ARG4 BPF_REG_4 | ||
67 | #define BPF_REG_ARG5 BPF_REG_5 | ||
68 | #define BPF_REG_CTX BPF_REG_6 | ||
69 | #define BPF_REG_FP BPF_REG_10 | ||
70 | |||
71 | /* Additional register mappings for converted user programs. */ | ||
72 | #define BPF_REG_A BPF_REG_0 | ||
73 | #define BPF_REG_X BPF_REG_7 | ||
74 | #define BPF_REG_TMP BPF_REG_8 | ||
42 | 75 | ||
43 | /* BPF program can access up to 512 bytes of stack space. */ | 76 | /* BPF program can access up to 512 bytes of stack space. */ |
44 | #define MAX_BPF_STACK 512 | 77 | #define MAX_BPF_STACK 512 |
45 | 78 | ||
46 | /* Arg1, context and stack frame pointer register positions. */ | 79 | /* Helper macros for filter block array initializers. */ |
47 | #define ARG1_REG 1 | 80 | |
48 | #define CTX_REG 6 | 81 | /* ALU ops on registers, bpf_add|sub|...: dst_reg += src_reg */ |
49 | #define FP_REG 10 | 82 | |
83 | #define BPF_ALU64_REG(OP, DST, SRC) \ | ||
84 | ((struct sock_filter_int) { \ | ||
85 | .code = BPF_ALU64 | BPF_OP(OP) | BPF_X, \ | ||
86 | .dst_reg = DST, \ | ||
87 | .src_reg = SRC, \ | ||
88 | .off = 0, \ | ||
89 | .imm = 0 }) | ||
90 | |||
91 | #define BPF_ALU32_REG(OP, DST, SRC) \ | ||
92 | ((struct sock_filter_int) { \ | ||
93 | .code = BPF_ALU | BPF_OP(OP) | BPF_X, \ | ||
94 | .dst_reg = DST, \ | ||
95 | .src_reg = SRC, \ | ||
96 | .off = 0, \ | ||
97 | .imm = 0 }) | ||
98 | |||
99 | /* ALU ops on immediates, bpf_add|sub|...: dst_reg += imm32 */ | ||
100 | |||
101 | #define BPF_ALU64_IMM(OP, DST, IMM) \ | ||
102 | ((struct sock_filter_int) { \ | ||
103 | .code = BPF_ALU64 | BPF_OP(OP) | BPF_K, \ | ||
104 | .dst_reg = DST, \ | ||
105 | .src_reg = 0, \ | ||
106 | .off = 0, \ | ||
107 | .imm = IMM }) | ||
108 | |||
109 | #define BPF_ALU32_IMM(OP, DST, IMM) \ | ||
110 | ((struct sock_filter_int) { \ | ||
111 | .code = BPF_ALU | BPF_OP(OP) | BPF_K, \ | ||
112 | .dst_reg = DST, \ | ||
113 | .src_reg = 0, \ | ||
114 | .off = 0, \ | ||
115 | .imm = IMM }) | ||
116 | |||
117 | /* Endianess conversion, cpu_to_{l,b}e(), {l,b}e_to_cpu() */ | ||
118 | |||
119 | #define BPF_ENDIAN(TYPE, DST, LEN) \ | ||
120 | ((struct sock_filter_int) { \ | ||
121 | .code = BPF_ALU | BPF_END | BPF_SRC(TYPE), \ | ||
122 | .dst_reg = DST, \ | ||
123 | .src_reg = 0, \ | ||
124 | .off = 0, \ | ||
125 | .imm = LEN }) | ||
126 | |||
127 | /* Short form of mov, dst_reg = src_reg */ | ||
128 | |||
129 | #define BPF_MOV64_REG(DST, SRC) \ | ||
130 | ((struct sock_filter_int) { \ | ||
131 | .code = BPF_ALU64 | BPF_MOV | BPF_X, \ | ||
132 | .dst_reg = DST, \ | ||
133 | .src_reg = SRC, \ | ||
134 | .off = 0, \ | ||
135 | .imm = 0 }) | ||
136 | |||
137 | #define BPF_MOV32_REG(DST, SRC) \ | ||
138 | ((struct sock_filter_int) { \ | ||
139 | .code = BPF_ALU | BPF_MOV | BPF_X, \ | ||
140 | .dst_reg = DST, \ | ||
141 | .src_reg = SRC, \ | ||
142 | .off = 0, \ | ||
143 | .imm = 0 }) | ||
144 | |||
145 | /* Short form of mov, dst_reg = imm32 */ | ||
146 | |||
147 | #define BPF_MOV64_IMM(DST, IMM) \ | ||
148 | ((struct sock_filter_int) { \ | ||
149 | .code = BPF_ALU64 | BPF_MOV | BPF_K, \ | ||
150 | .dst_reg = DST, \ | ||
151 | .src_reg = 0, \ | ||
152 | .off = 0, \ | ||
153 | .imm = IMM }) | ||
154 | |||
155 | #define BPF_MOV32_IMM(DST, IMM) \ | ||
156 | ((struct sock_filter_int) { \ | ||
157 | .code = BPF_ALU | BPF_MOV | BPF_K, \ | ||
158 | .dst_reg = DST, \ | ||
159 | .src_reg = 0, \ | ||
160 | .off = 0, \ | ||
161 | .imm = IMM }) | ||
162 | |||
163 | /* Short form of mov based on type, BPF_X: dst_reg = src_reg, BPF_K: dst_reg = imm32 */ | ||
164 | |||
165 | #define BPF_MOV64_RAW(TYPE, DST, SRC, IMM) \ | ||
166 | ((struct sock_filter_int) { \ | ||
167 | .code = BPF_ALU64 | BPF_MOV | BPF_SRC(TYPE), \ | ||
168 | .dst_reg = DST, \ | ||
169 | .src_reg = SRC, \ | ||
170 | .off = 0, \ | ||
171 | .imm = IMM }) | ||
172 | |||
173 | #define BPF_MOV32_RAW(TYPE, DST, SRC, IMM) \ | ||
174 | ((struct sock_filter_int) { \ | ||
175 | .code = BPF_ALU | BPF_MOV | BPF_SRC(TYPE), \ | ||
176 | .dst_reg = DST, \ | ||
177 | .src_reg = SRC, \ | ||
178 | .off = 0, \ | ||
179 | .imm = IMM }) | ||
180 | |||
181 | /* Direct packet access, R0 = *(uint *) (skb->data + imm32) */ | ||
182 | |||
183 | #define BPF_LD_ABS(SIZE, IMM) \ | ||
184 | ((struct sock_filter_int) { \ | ||
185 | .code = BPF_LD | BPF_SIZE(SIZE) | BPF_ABS, \ | ||
186 | .dst_reg = 0, \ | ||
187 | .src_reg = 0, \ | ||
188 | .off = 0, \ | ||
189 | .imm = IMM }) | ||
190 | |||
191 | /* Indirect packet access, R0 = *(uint *) (skb->data + src_reg + imm32) */ | ||
192 | |||
193 | #define BPF_LD_IND(SIZE, SRC, IMM) \ | ||
194 | ((struct sock_filter_int) { \ | ||
195 | .code = BPF_LD | BPF_SIZE(SIZE) | BPF_IND, \ | ||
196 | .dst_reg = 0, \ | ||
197 | .src_reg = SRC, \ | ||
198 | .off = 0, \ | ||
199 | .imm = IMM }) | ||
200 | |||
201 | /* Memory load, dst_reg = *(uint *) (src_reg + off16) */ | ||
202 | |||
203 | #define BPF_LDX_MEM(SIZE, DST, SRC, OFF) \ | ||
204 | ((struct sock_filter_int) { \ | ||
205 | .code = BPF_LDX | BPF_SIZE(SIZE) | BPF_MEM, \ | ||
206 | .dst_reg = DST, \ | ||
207 | .src_reg = SRC, \ | ||
208 | .off = OFF, \ | ||
209 | .imm = 0 }) | ||
210 | |||
211 | /* Memory store, *(uint *) (dst_reg + off16) = src_reg */ | ||
212 | |||
213 | #define BPF_STX_MEM(SIZE, DST, SRC, OFF) \ | ||
214 | ((struct sock_filter_int) { \ | ||
215 | .code = BPF_STX | BPF_SIZE(SIZE) | BPF_MEM, \ | ||
216 | .dst_reg = DST, \ | ||
217 | .src_reg = SRC, \ | ||
218 | .off = OFF, \ | ||
219 | .imm = 0 }) | ||
220 | |||
221 | /* Memory store, *(uint *) (dst_reg + off16) = imm32 */ | ||
222 | |||
223 | #define BPF_ST_MEM(SIZE, DST, OFF, IMM) \ | ||
224 | ((struct sock_filter_int) { \ | ||
225 | .code = BPF_ST | BPF_SIZE(SIZE) | BPF_MEM, \ | ||
226 | .dst_reg = DST, \ | ||
227 | .src_reg = 0, \ | ||
228 | .off = OFF, \ | ||
229 | .imm = IMM }) | ||
230 | |||
231 | /* Conditional jumps against registers, if (dst_reg 'op' src_reg) goto pc + off16 */ | ||
232 | |||
233 | #define BPF_JMP_REG(OP, DST, SRC, OFF) \ | ||
234 | ((struct sock_filter_int) { \ | ||
235 | .code = BPF_JMP | BPF_OP(OP) | BPF_X, \ | ||
236 | .dst_reg = DST, \ | ||
237 | .src_reg = SRC, \ | ||
238 | .off = OFF, \ | ||
239 | .imm = 0 }) | ||
240 | |||
241 | /* Conditional jumps against immediates, if (dst_reg 'op' imm32) goto pc + off16 */ | ||
242 | |||
243 | #define BPF_JMP_IMM(OP, DST, IMM, OFF) \ | ||
244 | ((struct sock_filter_int) { \ | ||
245 | .code = BPF_JMP | BPF_OP(OP) | BPF_K, \ | ||
246 | .dst_reg = DST, \ | ||
247 | .src_reg = 0, \ | ||
248 | .off = OFF, \ | ||
249 | .imm = IMM }) | ||
250 | |||
251 | /* Function call */ | ||
252 | |||
253 | #define BPF_EMIT_CALL(FUNC) \ | ||
254 | ((struct sock_filter_int) { \ | ||
255 | .code = BPF_JMP | BPF_CALL, \ | ||
256 | .dst_reg = 0, \ | ||
257 | .src_reg = 0, \ | ||
258 | .off = 0, \ | ||
259 | .imm = ((FUNC) - __bpf_call_base) }) | ||
260 | |||
261 | /* Raw code statement block */ | ||
262 | |||
263 | #define BPF_RAW_INSN(CODE, DST, SRC, OFF, IMM) \ | ||
264 | ((struct sock_filter_int) { \ | ||
265 | .code = CODE, \ | ||
266 | .dst_reg = DST, \ | ||
267 | .src_reg = SRC, \ | ||
268 | .off = OFF, \ | ||
269 | .imm = IMM }) | ||
270 | |||
271 | /* Program exit */ | ||
272 | |||
273 | #define BPF_EXIT_INSN() \ | ||
274 | ((struct sock_filter_int) { \ | ||
275 | .code = BPF_JMP | BPF_EXIT, \ | ||
276 | .dst_reg = 0, \ | ||
277 | .src_reg = 0, \ | ||
278 | .off = 0, \ | ||
279 | .imm = 0 }) | ||
280 | |||
281 | #define bytes_to_bpf_size(bytes) \ | ||
282 | ({ \ | ||
283 | int bpf_size = -EINVAL; \ | ||
284 | \ | ||
285 | if (bytes == sizeof(u8)) \ | ||
286 | bpf_size = BPF_B; \ | ||
287 | else if (bytes == sizeof(u16)) \ | ||
288 | bpf_size = BPF_H; \ | ||
289 | else if (bytes == sizeof(u32)) \ | ||
290 | bpf_size = BPF_W; \ | ||
291 | else if (bytes == sizeof(u64)) \ | ||
292 | bpf_size = BPF_DW; \ | ||
293 | \ | ||
294 | bpf_size; \ | ||
295 | }) | ||
296 | |||
297 | /* Macro to invoke filter function. */ | ||
298 | #define SK_RUN_FILTER(filter, ctx) (*filter->bpf_func)(ctx, filter->insnsi) | ||
50 | 299 | ||
51 | struct sock_filter_int { | 300 | struct sock_filter_int { |
52 | __u8 code; /* opcode */ | 301 | __u8 code; /* opcode */ |
53 | __u8 a_reg:4; /* dest register */ | 302 | __u8 dst_reg:4; /* dest register */ |
54 | __u8 x_reg:4; /* source register */ | 303 | __u8 src_reg:4; /* source register */ |
55 | __s16 off; /* signed offset */ | 304 | __s16 off; /* signed offset */ |
56 | __s32 imm; /* signed immediate constant */ | 305 | __s32 imm; /* signed immediate constant */ |
57 | }; | 306 | }; |
@@ -97,21 +346,16 @@ static inline unsigned int sk_filter_size(unsigned int proglen) | |||
97 | #define sk_filter_proglen(fprog) \ | 346 | #define sk_filter_proglen(fprog) \ |
98 | (fprog->len * sizeof(fprog->filter[0])) | 347 | (fprog->len * sizeof(fprog->filter[0])) |
99 | 348 | ||
100 | #define SK_RUN_FILTER(filter, ctx) \ | ||
101 | (*filter->bpf_func)(ctx, filter->insnsi) | ||
102 | |||
103 | int sk_filter(struct sock *sk, struct sk_buff *skb); | 349 | int sk_filter(struct sock *sk, struct sk_buff *skb); |
104 | 350 | ||
105 | u32 sk_run_filter_int_seccomp(const struct seccomp_data *ctx, | 351 | void sk_filter_select_runtime(struct sk_filter *fp); |
106 | const struct sock_filter_int *insni); | 352 | void sk_filter_free(struct sk_filter *fp); |
107 | u32 sk_run_filter_int_skb(const struct sk_buff *ctx, | ||
108 | const struct sock_filter_int *insni); | ||
109 | 353 | ||
110 | int sk_convert_filter(struct sock_filter *prog, int len, | 354 | int sk_convert_filter(struct sock_filter *prog, int len, |
111 | struct sock_filter_int *new_prog, int *new_len); | 355 | struct sock_filter_int *new_prog, int *new_len); |
112 | 356 | ||
113 | int sk_unattached_filter_create(struct sk_filter **pfp, | 357 | int sk_unattached_filter_create(struct sk_filter **pfp, |
114 | struct sock_fprog *fprog); | 358 | struct sock_fprog_kern *fprog); |
115 | void sk_unattached_filter_destroy(struct sk_filter *fp); | 359 | void sk_unattached_filter_destroy(struct sk_filter *fp); |
116 | 360 | ||
117 | int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); | 361 | int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); |
@@ -120,11 +364,48 @@ int sk_detach_filter(struct sock *sk); | |||
120 | int sk_chk_filter(struct sock_filter *filter, unsigned int flen); | 364 | int sk_chk_filter(struct sock_filter *filter, unsigned int flen); |
121 | int sk_get_filter(struct sock *sk, struct sock_filter __user *filter, | 365 | int sk_get_filter(struct sock *sk, struct sock_filter __user *filter, |
122 | unsigned int len); | 366 | unsigned int len); |
123 | void sk_decode_filter(struct sock_filter *filt, struct sock_filter *to); | ||
124 | 367 | ||
125 | void sk_filter_charge(struct sock *sk, struct sk_filter *fp); | 368 | void sk_filter_charge(struct sock *sk, struct sk_filter *fp); |
126 | void sk_filter_uncharge(struct sock *sk, struct sk_filter *fp); | 369 | void sk_filter_uncharge(struct sock *sk, struct sk_filter *fp); |
127 | 370 | ||
371 | u64 __bpf_call_base(u64 r1, u64 r2, u64 r3, u64 r4, u64 r5); | ||
372 | void bpf_int_jit_compile(struct sk_filter *fp); | ||
373 | |||
374 | #define BPF_ANC BIT(15) | ||
375 | |||
376 | static inline u16 bpf_anc_helper(const struct sock_filter *ftest) | ||
377 | { | ||
378 | BUG_ON(ftest->code & BPF_ANC); | ||
379 | |||
380 | switch (ftest->code) { | ||
381 | case BPF_LD | BPF_W | BPF_ABS: | ||
382 | case BPF_LD | BPF_H | BPF_ABS: | ||
383 | case BPF_LD | BPF_B | BPF_ABS: | ||
384 | #define BPF_ANCILLARY(CODE) case SKF_AD_OFF + SKF_AD_##CODE: \ | ||
385 | return BPF_ANC | SKF_AD_##CODE | ||
386 | switch (ftest->k) { | ||
387 | BPF_ANCILLARY(PROTOCOL); | ||
388 | BPF_ANCILLARY(PKTTYPE); | ||
389 | BPF_ANCILLARY(IFINDEX); | ||
390 | BPF_ANCILLARY(NLATTR); | ||
391 | BPF_ANCILLARY(NLATTR_NEST); | ||
392 | BPF_ANCILLARY(MARK); | ||
393 | BPF_ANCILLARY(QUEUE); | ||
394 | BPF_ANCILLARY(HATYPE); | ||
395 | BPF_ANCILLARY(RXHASH); | ||
396 | BPF_ANCILLARY(CPU); | ||
397 | BPF_ANCILLARY(ALU_XOR_X); | ||
398 | BPF_ANCILLARY(VLAN_TAG); | ||
399 | BPF_ANCILLARY(VLAN_TAG_PRESENT); | ||
400 | BPF_ANCILLARY(PAY_OFFSET); | ||
401 | BPF_ANCILLARY(RANDOM); | ||
402 | } | ||
403 | /* Fallthrough. */ | ||
404 | default: | ||
405 | return ftest->code; | ||
406 | } | ||
407 | } | ||
408 | |||
128 | #ifdef CONFIG_BPF_JIT | 409 | #ifdef CONFIG_BPF_JIT |
129 | #include <stdarg.h> | 410 | #include <stdarg.h> |
130 | #include <linux/linkage.h> | 411 | #include <linux/linkage.h> |
@@ -144,85 +425,20 @@ static inline void bpf_jit_dump(unsigned int flen, unsigned int proglen, | |||
144 | } | 425 | } |
145 | #else | 426 | #else |
146 | #include <linux/slab.h> | 427 | #include <linux/slab.h> |
428 | |||
147 | static inline void bpf_jit_compile(struct sk_filter *fp) | 429 | static inline void bpf_jit_compile(struct sk_filter *fp) |
148 | { | 430 | { |
149 | } | 431 | } |
432 | |||
150 | static inline void bpf_jit_free(struct sk_filter *fp) | 433 | static inline void bpf_jit_free(struct sk_filter *fp) |
151 | { | 434 | { |
152 | kfree(fp); | 435 | kfree(fp); |
153 | } | 436 | } |
154 | #endif | 437 | #endif /* CONFIG_BPF_JIT */ |
155 | 438 | ||
156 | static inline int bpf_tell_extensions(void) | 439 | static inline int bpf_tell_extensions(void) |
157 | { | 440 | { |
158 | return SKF_AD_MAX; | 441 | return SKF_AD_MAX; |
159 | } | 442 | } |
160 | 443 | ||
161 | enum { | ||
162 | BPF_S_RET_K = 1, | ||
163 | BPF_S_RET_A, | ||
164 | BPF_S_ALU_ADD_K, | ||
165 | BPF_S_ALU_ADD_X, | ||
166 | BPF_S_ALU_SUB_K, | ||
167 | BPF_S_ALU_SUB_X, | ||
168 | BPF_S_ALU_MUL_K, | ||
169 | BPF_S_ALU_MUL_X, | ||
170 | BPF_S_ALU_DIV_X, | ||
171 | BPF_S_ALU_MOD_K, | ||
172 | BPF_S_ALU_MOD_X, | ||
173 | BPF_S_ALU_AND_K, | ||
174 | BPF_S_ALU_AND_X, | ||
175 | BPF_S_ALU_OR_K, | ||
176 | BPF_S_ALU_OR_X, | ||
177 | BPF_S_ALU_XOR_K, | ||
178 | BPF_S_ALU_XOR_X, | ||
179 | BPF_S_ALU_LSH_K, | ||
180 | BPF_S_ALU_LSH_X, | ||
181 | BPF_S_ALU_RSH_K, | ||
182 | BPF_S_ALU_RSH_X, | ||
183 | BPF_S_ALU_NEG, | ||
184 | BPF_S_LD_W_ABS, | ||
185 | BPF_S_LD_H_ABS, | ||
186 | BPF_S_LD_B_ABS, | ||
187 | BPF_S_LD_W_LEN, | ||
188 | BPF_S_LD_W_IND, | ||
189 | BPF_S_LD_H_IND, | ||
190 | BPF_S_LD_B_IND, | ||
191 | BPF_S_LD_IMM, | ||
192 | BPF_S_LDX_W_LEN, | ||
193 | BPF_S_LDX_B_MSH, | ||
194 | BPF_S_LDX_IMM, | ||
195 | BPF_S_MISC_TAX, | ||
196 | BPF_S_MISC_TXA, | ||
197 | BPF_S_ALU_DIV_K, | ||
198 | BPF_S_LD_MEM, | ||
199 | BPF_S_LDX_MEM, | ||
200 | BPF_S_ST, | ||
201 | BPF_S_STX, | ||
202 | BPF_S_JMP_JA, | ||
203 | BPF_S_JMP_JEQ_K, | ||
204 | BPF_S_JMP_JEQ_X, | ||
205 | BPF_S_JMP_JGE_K, | ||
206 | BPF_S_JMP_JGE_X, | ||
207 | BPF_S_JMP_JGT_K, | ||
208 | BPF_S_JMP_JGT_X, | ||
209 | BPF_S_JMP_JSET_K, | ||
210 | BPF_S_JMP_JSET_X, | ||
211 | /* Ancillary data */ | ||
212 | BPF_S_ANC_PROTOCOL, | ||
213 | BPF_S_ANC_PKTTYPE, | ||
214 | BPF_S_ANC_IFINDEX, | ||
215 | BPF_S_ANC_NLATTR, | ||
216 | BPF_S_ANC_NLATTR_NEST, | ||
217 | BPF_S_ANC_MARK, | ||
218 | BPF_S_ANC_QUEUE, | ||
219 | BPF_S_ANC_HATYPE, | ||
220 | BPF_S_ANC_RXHASH, | ||
221 | BPF_S_ANC_CPU, | ||
222 | BPF_S_ANC_ALU_XOR_X, | ||
223 | BPF_S_ANC_VLAN_TAG, | ||
224 | BPF_S_ANC_VLAN_TAG_PRESENT, | ||
225 | BPF_S_ANC_PAY_OFFSET, | ||
226 | }; | ||
227 | |||
228 | #endif /* __LINUX_FILTER_H__ */ | 444 | #endif /* __LINUX_FILTER_H__ */ |
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index f194ccb8539c..6bff13f74050 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
@@ -1711,6 +1711,7 @@ enum ieee80211_eid { | |||
1711 | WLAN_EID_RRM_ENABLED_CAPABILITIES = 70, | 1711 | WLAN_EID_RRM_ENABLED_CAPABILITIES = 70, |
1712 | WLAN_EID_MULTIPLE_BSSID = 71, | 1712 | WLAN_EID_MULTIPLE_BSSID = 71, |
1713 | WLAN_EID_BSS_COEX_2040 = 72, | 1713 | WLAN_EID_BSS_COEX_2040 = 72, |
1714 | WLAN_EID_BSS_INTOLERANT_CHL_REPORT = 73, | ||
1714 | WLAN_EID_OVERLAP_BSS_SCAN_PARAM = 74, | 1715 | WLAN_EID_OVERLAP_BSS_SCAN_PARAM = 74, |
1715 | WLAN_EID_RIC_DESCRIPTOR = 75, | 1716 | WLAN_EID_RIC_DESCRIPTOR = 75, |
1716 | WLAN_EID_MMIE = 76, | 1717 | WLAN_EID_MMIE = 76, |
diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h index 1085ffeef956..fd22789d7b2e 100644 --- a/include/linux/if_bridge.h +++ b/include/linux/if_bridge.h | |||
@@ -16,9 +16,28 @@ | |||
16 | #include <linux/netdevice.h> | 16 | #include <linux/netdevice.h> |
17 | #include <uapi/linux/if_bridge.h> | 17 | #include <uapi/linux/if_bridge.h> |
18 | 18 | ||
19 | struct br_ip { | ||
20 | union { | ||
21 | __be32 ip4; | ||
22 | #if IS_ENABLED(CONFIG_IPV6) | ||
23 | struct in6_addr ip6; | ||
24 | #endif | ||
25 | } u; | ||
26 | __be16 proto; | ||
27 | __u16 vid; | ||
28 | }; | ||
29 | |||
30 | struct br_ip_list { | ||
31 | struct list_head list; | ||
32 | struct br_ip addr; | ||
33 | }; | ||
34 | |||
19 | extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __user *)); | 35 | extern void brioctl_set(int (*ioctl_hook)(struct net *, unsigned int, void __user *)); |
20 | 36 | ||
21 | typedef int br_should_route_hook_t(struct sk_buff *skb); | 37 | typedef int br_should_route_hook_t(struct sk_buff *skb); |
22 | extern br_should_route_hook_t __rcu *br_should_route_hook; | 38 | extern br_should_route_hook_t __rcu *br_should_route_hook; |
39 | int br_multicast_list_adjacent(struct net_device *dev, | ||
40 | struct list_head *br_ip_list); | ||
41 | bool br_multicast_has_querier_adjacent(struct net_device *dev, int proto); | ||
23 | 42 | ||
24 | #endif | 43 | #endif |
diff --git a/include/linux/if_link.h b/include/linux/if_link.h index a86784dec3d3..119130e9298b 100644 --- a/include/linux/if_link.h +++ b/include/linux/if_link.h | |||
@@ -10,8 +10,9 @@ struct ifla_vf_info { | |||
10 | __u8 mac[32]; | 10 | __u8 mac[32]; |
11 | __u32 vlan; | 11 | __u32 vlan; |
12 | __u32 qos; | 12 | __u32 qos; |
13 | __u32 tx_rate; | ||
14 | __u32 spoofchk; | 13 | __u32 spoofchk; |
15 | __u32 linkstate; | 14 | __u32 linkstate; |
15 | __u32 min_tx_rate; | ||
16 | __u32 max_tx_rate; | ||
16 | }; | 17 | }; |
17 | #endif /* _LINUX_IF_LINK_H */ | 18 | #endif /* _LINUX_IF_LINK_H */ |
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h index a9a53b12397b..6b2c7cf352a5 100644 --- a/include/linux/if_macvlan.h +++ b/include/linux/if_macvlan.h | |||
@@ -57,6 +57,9 @@ struct macvlan_dev { | |||
57 | netdev_features_t tap_features; | 57 | netdev_features_t tap_features; |
58 | int minor; | 58 | int minor; |
59 | int nest_level; | 59 | int nest_level; |
60 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
61 | struct netpoll *netpoll; | ||
62 | #endif | ||
60 | }; | 63 | }; |
61 | 64 | ||
62 | static inline void macvlan_count_rx(const struct macvlan_dev *vlan, | 65 | static inline void macvlan_count_rx(const struct macvlan_dev *vlan, |
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index b2acc4a1b13c..4967916fe4ac 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h | |||
@@ -106,7 +106,7 @@ struct vlan_pcpu_stats { | |||
106 | 106 | ||
107 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) | 107 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) |
108 | 108 | ||
109 | extern struct net_device *__vlan_find_dev_deep(struct net_device *real_dev, | 109 | extern struct net_device *__vlan_find_dev_deep_rcu(struct net_device *real_dev, |
110 | __be16 vlan_proto, u16 vlan_id); | 110 | __be16 vlan_proto, u16 vlan_id); |
111 | extern struct net_device *vlan_dev_real_dev(const struct net_device *dev); | 111 | extern struct net_device *vlan_dev_real_dev(const struct net_device *dev); |
112 | extern u16 vlan_dev_vlan_id(const struct net_device *dev); | 112 | extern u16 vlan_dev_vlan_id(const struct net_device *dev); |
@@ -206,7 +206,7 @@ static inline int vlan_get_encap_level(struct net_device *dev) | |||
206 | } | 206 | } |
207 | #else | 207 | #else |
208 | static inline struct net_device * | 208 | static inline struct net_device * |
209 | __vlan_find_dev_deep(struct net_device *real_dev, | 209 | __vlan_find_dev_deep_rcu(struct net_device *real_dev, |
210 | __be16 vlan_proto, u16 vlan_id) | 210 | __be16 vlan_proto, u16 vlan_id) |
211 | { | 211 | { |
212 | return NULL; | 212 | return NULL; |
diff --git a/include/linux/isdn/capiutil.h b/include/linux/isdn/capiutil.h index 5a52f2c94f3f..44bd6046e6e2 100644 --- a/include/linux/isdn/capiutil.h +++ b/include/linux/isdn/capiutil.h | |||
@@ -164,11 +164,6 @@ unsigned capi_cmsg_header(_cmsg * cmsg, __u16 _ApplId, | |||
164 | __u8 _Command, __u8 _Subcommand, | 164 | __u8 _Command, __u8 _Subcommand, |
165 | __u16 _Messagenumber, __u32 _Controller); | 165 | __u16 _Messagenumber, __u32 _Controller); |
166 | 166 | ||
167 | /* | ||
168 | * capi_info2str generated a readable string for Capi2.0 reasons. | ||
169 | */ | ||
170 | char *capi_info2str(__u16 reason); | ||
171 | |||
172 | /*-----------------------------------------------------------------------*/ | 167 | /*-----------------------------------------------------------------------*/ |
173 | 168 | ||
174 | /* | 169 | /* |
diff --git a/include/linux/ktime.h b/include/linux/ktime.h index 31c0cd1c941a..de9e46e6bcc9 100644 --- a/include/linux/ktime.h +++ b/include/linux/ktime.h | |||
@@ -304,6 +304,30 @@ static inline int ktime_compare(const ktime_t cmp1, const ktime_t cmp2) | |||
304 | return 0; | 304 | return 0; |
305 | } | 305 | } |
306 | 306 | ||
307 | /** | ||
308 | * ktime_after - Compare if a ktime_t value is bigger than another one. | ||
309 | * @cmp1: comparable1 | ||
310 | * @cmp2: comparable2 | ||
311 | * | ||
312 | * Return: true if cmp1 happened after cmp2. | ||
313 | */ | ||
314 | static inline bool ktime_after(const ktime_t cmp1, const ktime_t cmp2) | ||
315 | { | ||
316 | return ktime_compare(cmp1, cmp2) > 0; | ||
317 | } | ||
318 | |||
319 | /** | ||
320 | * ktime_before - Compare if a ktime_t value is smaller than another one. | ||
321 | * @cmp1: comparable1 | ||
322 | * @cmp2: comparable2 | ||
323 | * | ||
324 | * Return: true if cmp1 happened before cmp2. | ||
325 | */ | ||
326 | static inline bool ktime_before(const ktime_t cmp1, const ktime_t cmp2) | ||
327 | { | ||
328 | return ktime_compare(cmp1, cmp2) < 0; | ||
329 | } | ||
330 | |||
307 | static inline s64 ktime_to_us(const ktime_t kt) | 331 | static inline s64 ktime_to_us(const ktime_t kt) |
308 | { | 332 | { |
309 | struct timeval tv = ktime_to_timeval(kt); | 333 | struct timeval tv = ktime_to_timeval(kt); |
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index 3447bead9620..b12f4bbd064c 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
@@ -450,7 +450,6 @@ struct mlx4_caps { | |||
450 | int reserved_qps_base[MLX4_NUM_QP_REGION]; | 450 | int reserved_qps_base[MLX4_NUM_QP_REGION]; |
451 | int log_num_macs; | 451 | int log_num_macs; |
452 | int log_num_vlans; | 452 | int log_num_vlans; |
453 | int log_num_prios; | ||
454 | enum mlx4_port_type port_type[MLX4_MAX_PORTS + 1]; | 453 | enum mlx4_port_type port_type[MLX4_MAX_PORTS + 1]; |
455 | u8 supported_type[MLX4_MAX_PORTS + 1]; | 454 | u8 supported_type[MLX4_MAX_PORTS + 1]; |
456 | u8 suggested_type[MLX4_MAX_PORTS + 1]; | 455 | u8 suggested_type[MLX4_MAX_PORTS + 1]; |
@@ -578,6 +577,9 @@ struct mlx4_cq { | |||
578 | 577 | ||
579 | u32 cons_index; | 578 | u32 cons_index; |
580 | 579 | ||
580 | u16 irq; | ||
581 | bool irq_affinity_change; | ||
582 | |||
581 | __be32 *set_ci_db; | 583 | __be32 *set_ci_db; |
582 | __be32 *arm_db; | 584 | __be32 *arm_db; |
583 | int arm_sn; | 585 | int arm_sn; |
diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h index c26d0ec2ef3a..e5a589435e2b 100644 --- a/include/linux/netdev_features.h +++ b/include/linux/netdev_features.h | |||
@@ -42,9 +42,11 @@ enum { | |||
42 | NETIF_F_TSO6_BIT, /* ... TCPv6 segmentation */ | 42 | NETIF_F_TSO6_BIT, /* ... TCPv6 segmentation */ |
43 | NETIF_F_FSO_BIT, /* ... FCoE segmentation */ | 43 | NETIF_F_FSO_BIT, /* ... FCoE segmentation */ |
44 | NETIF_F_GSO_GRE_BIT, /* ... GRE with TSO */ | 44 | NETIF_F_GSO_GRE_BIT, /* ... GRE with TSO */ |
45 | NETIF_F_GSO_GRE_CSUM_BIT, /* ... GRE with csum with TSO */ | ||
45 | NETIF_F_GSO_IPIP_BIT, /* ... IPIP tunnel with TSO */ | 46 | NETIF_F_GSO_IPIP_BIT, /* ... IPIP tunnel with TSO */ |
46 | NETIF_F_GSO_SIT_BIT, /* ... SIT tunnel with TSO */ | 47 | NETIF_F_GSO_SIT_BIT, /* ... SIT tunnel with TSO */ |
47 | NETIF_F_GSO_UDP_TUNNEL_BIT, /* ... UDP TUNNEL with TSO */ | 48 | NETIF_F_GSO_UDP_TUNNEL_BIT, /* ... UDP TUNNEL with TSO */ |
49 | NETIF_F_GSO_UDP_TUNNEL_CSUM_BIT,/* ... UDP TUNNEL with TSO & CSUM */ | ||
48 | NETIF_F_GSO_MPLS_BIT, /* ... MPLS segmentation */ | 50 | NETIF_F_GSO_MPLS_BIT, /* ... MPLS segmentation */ |
49 | /**/NETIF_F_GSO_LAST = /* last bit, see GSO_MASK */ | 51 | /**/NETIF_F_GSO_LAST = /* last bit, see GSO_MASK */ |
50 | NETIF_F_GSO_MPLS_BIT, | 52 | NETIF_F_GSO_MPLS_BIT, |
@@ -111,6 +113,7 @@ enum { | |||
111 | #define NETIF_F_RXFCS __NETIF_F(RXFCS) | 113 | #define NETIF_F_RXFCS __NETIF_F(RXFCS) |
112 | #define NETIF_F_RXALL __NETIF_F(RXALL) | 114 | #define NETIF_F_RXALL __NETIF_F(RXALL) |
113 | #define NETIF_F_GSO_GRE __NETIF_F(GSO_GRE) | 115 | #define NETIF_F_GSO_GRE __NETIF_F(GSO_GRE) |
116 | #define NETIF_F_GSO_GRE_CSUM __NETIF_F(GSO_GRE_CSUM) | ||
114 | #define NETIF_F_GSO_IPIP __NETIF_F(GSO_IPIP) | 117 | #define NETIF_F_GSO_IPIP __NETIF_F(GSO_IPIP) |
115 | #define NETIF_F_GSO_SIT __NETIF_F(GSO_SIT) | 118 | #define NETIF_F_GSO_SIT __NETIF_F(GSO_SIT) |
116 | #define NETIF_F_GSO_UDP_TUNNEL __NETIF_F(GSO_UDP_TUNNEL) | 119 | #define NETIF_F_GSO_UDP_TUNNEL __NETIF_F(GSO_UDP_TUNNEL) |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 6c1ae9fd9505..abe3de1db932 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -56,9 +56,6 @@ struct device; | |||
56 | struct phy_device; | 56 | struct phy_device; |
57 | /* 802.11 specific */ | 57 | /* 802.11 specific */ |
58 | struct wireless_dev; | 58 | struct wireless_dev; |
59 | /* source back-compat hooks */ | ||
60 | #define SET_ETHTOOL_OPS(netdev,ops) \ | ||
61 | ( (netdev)->ethtool_ops = (ops) ) | ||
62 | 59 | ||
63 | void netdev_set_default_ethtool_ops(struct net_device *dev, | 60 | void netdev_set_default_ethtool_ops(struct net_device *dev, |
64 | const struct ethtool_ops *ops); | 61 | const struct ethtool_ops *ops); |
@@ -853,7 +850,8 @@ typedef u16 (*select_queue_fallback_t)(struct net_device *dev, | |||
853 | * SR-IOV management functions. | 850 | * SR-IOV management functions. |
854 | * int (*ndo_set_vf_mac)(struct net_device *dev, int vf, u8* mac); | 851 | * int (*ndo_set_vf_mac)(struct net_device *dev, int vf, u8* mac); |
855 | * int (*ndo_set_vf_vlan)(struct net_device *dev, int vf, u16 vlan, u8 qos); | 852 | * int (*ndo_set_vf_vlan)(struct net_device *dev, int vf, u16 vlan, u8 qos); |
856 | * int (*ndo_set_vf_tx_rate)(struct net_device *dev, int vf, int rate); | 853 | * int (*ndo_set_vf_rate)(struct net_device *dev, int vf, int min_tx_rate, |
854 | * int max_tx_rate); | ||
857 | * int (*ndo_set_vf_spoofchk)(struct net_device *dev, int vf, bool setting); | 855 | * int (*ndo_set_vf_spoofchk)(struct net_device *dev, int vf, bool setting); |
858 | * int (*ndo_get_vf_config)(struct net_device *dev, | 856 | * int (*ndo_get_vf_config)(struct net_device *dev, |
859 | * int vf, struct ifla_vf_info *ivf); | 857 | * int vf, struct ifla_vf_info *ivf); |
@@ -1047,8 +1045,9 @@ struct net_device_ops { | |||
1047 | int queue, u8 *mac); | 1045 | int queue, u8 *mac); |
1048 | int (*ndo_set_vf_vlan)(struct net_device *dev, | 1046 | int (*ndo_set_vf_vlan)(struct net_device *dev, |
1049 | int queue, u16 vlan, u8 qos); | 1047 | int queue, u16 vlan, u8 qos); |
1050 | int (*ndo_set_vf_tx_rate)(struct net_device *dev, | 1048 | int (*ndo_set_vf_rate)(struct net_device *dev, |
1051 | int vf, int rate); | 1049 | int vf, int min_tx_rate, |
1050 | int max_tx_rate); | ||
1052 | int (*ndo_set_vf_spoofchk)(struct net_device *dev, | 1051 | int (*ndo_set_vf_spoofchk)(struct net_device *dev, |
1053 | int vf, bool setting); | 1052 | int vf, bool setting); |
1054 | int (*ndo_get_vf_config)(struct net_device *dev, | 1053 | int (*ndo_get_vf_config)(struct net_device *dev, |
@@ -2634,6 +2633,7 @@ int dev_get_phys_port_id(struct net_device *dev, | |||
2634 | struct netdev_phys_port_id *ppid); | 2633 | struct netdev_phys_port_id *ppid); |
2635 | int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev, | 2634 | int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev, |
2636 | struct netdev_queue *txq); | 2635 | struct netdev_queue *txq); |
2636 | int __dev_forward_skb(struct net_device *dev, struct sk_buff *skb); | ||
2637 | int dev_forward_skb(struct net_device *dev, struct sk_buff *skb); | 2637 | int dev_forward_skb(struct net_device *dev, struct sk_buff *skb); |
2638 | bool is_skb_forwardable(struct net_device *dev, struct sk_buff *skb); | 2638 | bool is_skb_forwardable(struct net_device *dev, struct sk_buff *skb); |
2639 | 2639 | ||
@@ -3003,6 +3003,15 @@ int __hw_addr_sync(struct netdev_hw_addr_list *to_list, | |||
3003 | struct netdev_hw_addr_list *from_list, int addr_len); | 3003 | struct netdev_hw_addr_list *from_list, int addr_len); |
3004 | void __hw_addr_unsync(struct netdev_hw_addr_list *to_list, | 3004 | void __hw_addr_unsync(struct netdev_hw_addr_list *to_list, |
3005 | struct netdev_hw_addr_list *from_list, int addr_len); | 3005 | struct netdev_hw_addr_list *from_list, int addr_len); |
3006 | int __hw_addr_sync_dev(struct netdev_hw_addr_list *list, | ||
3007 | struct net_device *dev, | ||
3008 | int (*sync)(struct net_device *, const unsigned char *), | ||
3009 | int (*unsync)(struct net_device *, | ||
3010 | const unsigned char *)); | ||
3011 | void __hw_addr_unsync_dev(struct netdev_hw_addr_list *list, | ||
3012 | struct net_device *dev, | ||
3013 | int (*unsync)(struct net_device *, | ||
3014 | const unsigned char *)); | ||
3006 | void __hw_addr_init(struct netdev_hw_addr_list *list); | 3015 | void __hw_addr_init(struct netdev_hw_addr_list *list); |
3007 | 3016 | ||
3008 | /* Functions used for device addresses handling */ | 3017 | /* Functions used for device addresses handling */ |
@@ -3023,6 +3032,38 @@ void dev_uc_unsync(struct net_device *to, struct net_device *from); | |||
3023 | void dev_uc_flush(struct net_device *dev); | 3032 | void dev_uc_flush(struct net_device *dev); |
3024 | void dev_uc_init(struct net_device *dev); | 3033 | void dev_uc_init(struct net_device *dev); |
3025 | 3034 | ||
3035 | /** | ||
3036 | * __dev_uc_sync - Synchonize device's unicast list | ||
3037 | * @dev: device to sync | ||
3038 | * @sync: function to call if address should be added | ||
3039 | * @unsync: function to call if address should be removed | ||
3040 | * | ||
3041 | * Add newly added addresses to the interface, and release | ||
3042 | * addresses that have been deleted. | ||
3043 | **/ | ||
3044 | static inline int __dev_uc_sync(struct net_device *dev, | ||
3045 | int (*sync)(struct net_device *, | ||
3046 | const unsigned char *), | ||
3047 | int (*unsync)(struct net_device *, | ||
3048 | const unsigned char *)) | ||
3049 | { | ||
3050 | return __hw_addr_sync_dev(&dev->uc, dev, sync, unsync); | ||
3051 | } | ||
3052 | |||
3053 | /** | ||
3054 | * __dev_uc_unsync - Remove synchonized addresses from device | ||
3055 | * @dev: device to sync | ||
3056 | * @unsync: function to call if address should be removed | ||
3057 | * | ||
3058 | * Remove all addresses that were added to the device by dev_uc_sync(). | ||
3059 | **/ | ||
3060 | static inline void __dev_uc_unsync(struct net_device *dev, | ||
3061 | int (*unsync)(struct net_device *, | ||
3062 | const unsigned char *)) | ||
3063 | { | ||
3064 | __hw_addr_unsync_dev(&dev->uc, dev, unsync); | ||
3065 | } | ||
3066 | |||
3026 | /* Functions used for multicast addresses handling */ | 3067 | /* Functions used for multicast addresses handling */ |
3027 | int dev_mc_add(struct net_device *dev, const unsigned char *addr); | 3068 | int dev_mc_add(struct net_device *dev, const unsigned char *addr); |
3028 | int dev_mc_add_global(struct net_device *dev, const unsigned char *addr); | 3069 | int dev_mc_add_global(struct net_device *dev, const unsigned char *addr); |
@@ -3035,6 +3076,38 @@ void dev_mc_unsync(struct net_device *to, struct net_device *from); | |||
3035 | void dev_mc_flush(struct net_device *dev); | 3076 | void dev_mc_flush(struct net_device *dev); |
3036 | void dev_mc_init(struct net_device *dev); | 3077 | void dev_mc_init(struct net_device *dev); |
3037 | 3078 | ||
3079 | /** | ||
3080 | * __dev_mc_sync - Synchonize device's multicast list | ||
3081 | * @dev: device to sync | ||
3082 | * @sync: function to call if address should be added | ||
3083 | * @unsync: function to call if address should be removed | ||
3084 | * | ||
3085 | * Add newly added addresses to the interface, and release | ||
3086 | * addresses that have been deleted. | ||
3087 | **/ | ||
3088 | static inline int __dev_mc_sync(struct net_device *dev, | ||
3089 | int (*sync)(struct net_device *, | ||
3090 | const unsigned char *), | ||
3091 | int (*unsync)(struct net_device *, | ||
3092 | const unsigned char *)) | ||
3093 | { | ||
3094 | return __hw_addr_sync_dev(&dev->mc, dev, sync, unsync); | ||
3095 | } | ||
3096 | |||
3097 | /** | ||
3098 | * __dev_mc_unsync - Remove synchonized addresses from device | ||
3099 | * @dev: device to sync | ||
3100 | * @unsync: function to call if address should be removed | ||
3101 | * | ||
3102 | * Remove all addresses that were added to the device by dev_mc_sync(). | ||
3103 | **/ | ||
3104 | static inline void __dev_mc_unsync(struct net_device *dev, | ||
3105 | int (*unsync)(struct net_device *, | ||
3106 | const unsigned char *)) | ||
3107 | { | ||
3108 | __hw_addr_unsync_dev(&dev->mc, dev, unsync); | ||
3109 | } | ||
3110 | |||
3038 | /* Functions used for secondary unicast and multicast support */ | 3111 | /* Functions used for secondary unicast and multicast support */ |
3039 | void dev_set_rx_mode(struct net_device *dev); | 3112 | void dev_set_rx_mode(struct net_device *dev); |
3040 | void __dev_set_rx_mode(struct net_device *dev); | 3113 | void __dev_set_rx_mode(struct net_device *dev); |
@@ -3180,6 +3253,20 @@ const char *netdev_drivername(const struct net_device *dev); | |||
3180 | 3253 | ||
3181 | void linkwatch_run_queue(void); | 3254 | void linkwatch_run_queue(void); |
3182 | 3255 | ||
3256 | static inline netdev_features_t netdev_intersect_features(netdev_features_t f1, | ||
3257 | netdev_features_t f2) | ||
3258 | { | ||
3259 | if (f1 & NETIF_F_GEN_CSUM) | ||
3260 | f1 |= (NETIF_F_ALL_CSUM & ~NETIF_F_GEN_CSUM); | ||
3261 | if (f2 & NETIF_F_GEN_CSUM) | ||
3262 | f2 |= (NETIF_F_ALL_CSUM & ~NETIF_F_GEN_CSUM); | ||
3263 | f1 &= f2; | ||
3264 | if (f1 & NETIF_F_GEN_CSUM) | ||
3265 | f1 &= ~(NETIF_F_ALL_CSUM & ~NETIF_F_GEN_CSUM); | ||
3266 | |||
3267 | return f1; | ||
3268 | } | ||
3269 | |||
3183 | static inline netdev_features_t netdev_get_wanted_features( | 3270 | static inline netdev_features_t netdev_get_wanted_features( |
3184 | struct net_device *dev) | 3271 | struct net_device *dev) |
3185 | { | 3272 | { |
diff --git a/include/linux/netfilter/nfnetlink_acct.h b/include/linux/netfilter/nfnetlink_acct.h index b2e85e59f760..6ec975748742 100644 --- a/include/linux/netfilter/nfnetlink_acct.h +++ b/include/linux/netfilter/nfnetlink_acct.h | |||
@@ -3,11 +3,17 @@ | |||
3 | 3 | ||
4 | #include <uapi/linux/netfilter/nfnetlink_acct.h> | 4 | #include <uapi/linux/netfilter/nfnetlink_acct.h> |
5 | 5 | ||
6 | enum { | ||
7 | NFACCT_NO_QUOTA = -1, | ||
8 | NFACCT_UNDERQUOTA, | ||
9 | NFACCT_OVERQUOTA, | ||
10 | }; | ||
6 | 11 | ||
7 | struct nf_acct; | 12 | struct nf_acct; |
8 | 13 | ||
9 | struct nf_acct *nfnl_acct_find_get(const char *filter_name); | 14 | struct nf_acct *nfnl_acct_find_get(const char *filter_name); |
10 | void nfnl_acct_put(struct nf_acct *acct); | 15 | void nfnl_acct_put(struct nf_acct *acct); |
11 | void nfnl_acct_update(const struct sk_buff *skb, struct nf_acct *nfacct); | 16 | void nfnl_acct_update(const struct sk_buff *skb, struct nf_acct *nfacct); |
12 | 17 | extern int nfnl_acct_overquota(const struct sk_buff *skb, | |
18 | struct nf_acct *nfacct); | ||
13 | #endif /* _NFNL_ACCT_H */ | 19 | #endif /* _NFNL_ACCT_H */ |
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 034cda789a15..9e572daa15d5 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
@@ -46,7 +46,8 @@ struct netlink_kernel_cfg { | |||
46 | unsigned int flags; | 46 | unsigned int flags; |
47 | void (*input)(struct sk_buff *skb); | 47 | void (*input)(struct sk_buff *skb); |
48 | struct mutex *cb_mutex; | 48 | struct mutex *cb_mutex; |
49 | void (*bind)(int group); | 49 | int (*bind)(int group); |
50 | void (*unbind)(int group); | ||
50 | bool (*compare)(struct net *net, struct sock *sk); | 51 | bool (*compare)(struct net *net, struct sock *sk); |
51 | }; | 52 | }; |
52 | 53 | ||
diff --git a/include/linux/nl802154.h b/include/linux/nl802154.h index c8d7f3965fff..20163b9a0eae 100644 --- a/include/linux/nl802154.h +++ b/include/linux/nl802154.h | |||
@@ -80,6 +80,22 @@ enum { | |||
80 | 80 | ||
81 | IEEE802154_ATTR_FRAME_RETRIES, | 81 | IEEE802154_ATTR_FRAME_RETRIES, |
82 | 82 | ||
83 | IEEE802154_ATTR_LLSEC_ENABLED, | ||
84 | IEEE802154_ATTR_LLSEC_SECLEVEL, | ||
85 | IEEE802154_ATTR_LLSEC_KEY_MODE, | ||
86 | IEEE802154_ATTR_LLSEC_KEY_SOURCE_SHORT, | ||
87 | IEEE802154_ATTR_LLSEC_KEY_SOURCE_EXTENDED, | ||
88 | IEEE802154_ATTR_LLSEC_KEY_ID, | ||
89 | IEEE802154_ATTR_LLSEC_FRAME_COUNTER, | ||
90 | IEEE802154_ATTR_LLSEC_KEY_BYTES, | ||
91 | IEEE802154_ATTR_LLSEC_KEY_USAGE_FRAME_TYPES, | ||
92 | IEEE802154_ATTR_LLSEC_KEY_USAGE_COMMANDS, | ||
93 | IEEE802154_ATTR_LLSEC_FRAME_TYPE, | ||
94 | IEEE802154_ATTR_LLSEC_CMD_FRAME_ID, | ||
95 | IEEE802154_ATTR_LLSEC_SECLEVELS, | ||
96 | IEEE802154_ATTR_LLSEC_DEV_OVERRIDE, | ||
97 | IEEE802154_ATTR_LLSEC_DEV_KEY_MODE, | ||
98 | |||
83 | __IEEE802154_ATTR_MAX, | 99 | __IEEE802154_ATTR_MAX, |
84 | }; | 100 | }; |
85 | 101 | ||
@@ -134,6 +150,21 @@ enum { | |||
134 | 150 | ||
135 | IEEE802154_SET_MACPARAMS, | 151 | IEEE802154_SET_MACPARAMS, |
136 | 152 | ||
153 | IEEE802154_LLSEC_GETPARAMS, | ||
154 | IEEE802154_LLSEC_SETPARAMS, | ||
155 | IEEE802154_LLSEC_LIST_KEY, | ||
156 | IEEE802154_LLSEC_ADD_KEY, | ||
157 | IEEE802154_LLSEC_DEL_KEY, | ||
158 | IEEE802154_LLSEC_LIST_DEV, | ||
159 | IEEE802154_LLSEC_ADD_DEV, | ||
160 | IEEE802154_LLSEC_DEL_DEV, | ||
161 | IEEE802154_LLSEC_LIST_DEVKEY, | ||
162 | IEEE802154_LLSEC_ADD_DEVKEY, | ||
163 | IEEE802154_LLSEC_DEL_DEVKEY, | ||
164 | IEEE802154_LLSEC_LIST_SECLEVEL, | ||
165 | IEEE802154_LLSEC_ADD_SECLEVEL, | ||
166 | IEEE802154_LLSEC_DEL_SECLEVEL, | ||
167 | |||
137 | __IEEE802154_CMD_MAX, | 168 | __IEEE802154_CMD_MAX, |
138 | }; | 169 | }; |
139 | 170 | ||
diff --git a/include/linux/of_mdio.h b/include/linux/of_mdio.h index 881a7c3571f4..a70c9493d55a 100644 --- a/include/linux/of_mdio.h +++ b/include/linux/of_mdio.h | |||
@@ -22,12 +22,12 @@ extern struct phy_device *of_phy_connect(struct net_device *dev, | |||
22 | struct phy_device *of_phy_attach(struct net_device *dev, | 22 | struct phy_device *of_phy_attach(struct net_device *dev, |
23 | struct device_node *phy_np, u32 flags, | 23 | struct device_node *phy_np, u32 flags, |
24 | phy_interface_t iface); | 24 | phy_interface_t iface); |
25 | extern struct phy_device *of_phy_connect_fixed_link(struct net_device *dev, | ||
26 | void (*hndlr)(struct net_device *), | ||
27 | phy_interface_t iface); | ||
28 | 25 | ||
29 | extern struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np); | 26 | extern struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np); |
30 | 27 | ||
28 | extern void of_mdiobus_link_phydev(struct mii_bus *mdio, | ||
29 | struct phy_device *phydev); | ||
30 | |||
31 | #else /* CONFIG_OF */ | 31 | #else /* CONFIG_OF */ |
32 | static inline int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np) | 32 | static inline int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np) |
33 | { | 33 | { |
@@ -59,17 +59,30 @@ static inline struct phy_device *of_phy_attach(struct net_device *dev, | |||
59 | return NULL; | 59 | return NULL; |
60 | } | 60 | } |
61 | 61 | ||
62 | static inline struct phy_device *of_phy_connect_fixed_link(struct net_device *dev, | 62 | static inline struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np) |
63 | void (*hndlr)(struct net_device *), | ||
64 | phy_interface_t iface) | ||
65 | { | 63 | { |
66 | return NULL; | 64 | return NULL; |
67 | } | 65 | } |
68 | 66 | ||
69 | static inline struct mii_bus *of_mdio_find_bus(struct device_node *mdio_np) | 67 | static inline void of_mdiobus_link_phydev(struct mii_bus *mdio, |
68 | struct phy_device *phydev) | ||
70 | { | 69 | { |
71 | return NULL; | ||
72 | } | 70 | } |
73 | #endif /* CONFIG_OF */ | 71 | #endif /* CONFIG_OF */ |
74 | 72 | ||
73 | #if defined(CONFIG_OF) && defined(CONFIG_FIXED_PHY) | ||
74 | extern int of_phy_register_fixed_link(struct device_node *np); | ||
75 | extern bool of_phy_is_fixed_link(struct device_node *np); | ||
76 | #else | ||
77 | static inline int of_phy_register_fixed_link(struct device_node *np) | ||
78 | { | ||
79 | return -ENOSYS; | ||
80 | } | ||
81 | static inline bool of_phy_is_fixed_link(struct device_node *np) | ||
82 | { | ||
83 | return false; | ||
84 | } | ||
85 | #endif | ||
86 | |||
87 | |||
75 | #endif /* __LINUX_OF_MDIO_H */ | 88 | #endif /* __LINUX_OF_MDIO_H */ |
diff --git a/include/linux/phy.h b/include/linux/phy.h index 4d0221fd0688..864ddafad8cc 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h | |||
@@ -198,6 +198,13 @@ static inline struct mii_bus *mdiobus_alloc(void) | |||
198 | int mdiobus_register(struct mii_bus *bus); | 198 | int mdiobus_register(struct mii_bus *bus); |
199 | void mdiobus_unregister(struct mii_bus *bus); | 199 | void mdiobus_unregister(struct mii_bus *bus); |
200 | void mdiobus_free(struct mii_bus *bus); | 200 | void mdiobus_free(struct mii_bus *bus); |
201 | struct mii_bus *devm_mdiobus_alloc_size(struct device *dev, int sizeof_priv); | ||
202 | static inline struct mii_bus *devm_mdiobus_alloc(struct device *dev) | ||
203 | { | ||
204 | return devm_mdiobus_alloc_size(dev, 0); | ||
205 | } | ||
206 | |||
207 | void devm_mdiobus_free(struct device *dev, struct mii_bus *bus); | ||
201 | struct phy_device *mdiobus_scan(struct mii_bus *bus, int addr); | 208 | struct phy_device *mdiobus_scan(struct mii_bus *bus, int addr); |
202 | int mdiobus_read(struct mii_bus *bus, int addr, u32 regnum); | 209 | int mdiobus_read(struct mii_bus *bus, int addr, u32 regnum); |
203 | int mdiobus_write(struct mii_bus *bus, int addr, u32 regnum, u16 val); | 210 | int mdiobus_write(struct mii_bus *bus, int addr, u32 regnum, u16 val); |
@@ -666,6 +673,7 @@ static inline int phy_read_status(struct phy_device *phydev) | |||
666 | return phydev->drv->read_status(phydev); | 673 | return phydev->drv->read_status(phydev); |
667 | } | 674 | } |
668 | 675 | ||
676 | int genphy_config_init(struct phy_device *phydev); | ||
669 | int genphy_setup_forced(struct phy_device *phydev); | 677 | int genphy_setup_forced(struct phy_device *phydev); |
670 | int genphy_restart_aneg(struct phy_device *phydev); | 678 | int genphy_restart_aneg(struct phy_device *phydev); |
671 | int genphy_config_aneg(struct phy_device *phydev); | 679 | int genphy_config_aneg(struct phy_device *phydev); |
diff --git a/include/linux/phy_fixed.h b/include/linux/phy_fixed.h index 509d8f5f984e..ae612acebb53 100644 --- a/include/linux/phy_fixed.h +++ b/include/linux/phy_fixed.h | |||
@@ -9,15 +9,31 @@ struct fixed_phy_status { | |||
9 | int asym_pause; | 9 | int asym_pause; |
10 | }; | 10 | }; |
11 | 11 | ||
12 | struct device_node; | ||
13 | |||
12 | #ifdef CONFIG_FIXED_PHY | 14 | #ifdef CONFIG_FIXED_PHY |
13 | extern int fixed_phy_add(unsigned int irq, int phy_id, | 15 | extern int fixed_phy_add(unsigned int irq, int phy_id, |
14 | struct fixed_phy_status *status); | 16 | struct fixed_phy_status *status); |
17 | extern int fixed_phy_register(unsigned int irq, | ||
18 | struct fixed_phy_status *status, | ||
19 | struct device_node *np); | ||
20 | extern void fixed_phy_del(int phy_addr); | ||
15 | #else | 21 | #else |
16 | static inline int fixed_phy_add(unsigned int irq, int phy_id, | 22 | static inline int fixed_phy_add(unsigned int irq, int phy_id, |
17 | struct fixed_phy_status *status) | 23 | struct fixed_phy_status *status) |
18 | { | 24 | { |
19 | return -ENODEV; | 25 | return -ENODEV; |
20 | } | 26 | } |
27 | static inline int fixed_phy_register(unsigned int irq, | ||
28 | struct fixed_phy_status *status, | ||
29 | struct device_node *np) | ||
30 | { | ||
31 | return -ENODEV; | ||
32 | } | ||
33 | static inline int fixed_phy_del(int phy_addr) | ||
34 | { | ||
35 | return -ENODEV; | ||
36 | } | ||
21 | #endif /* CONFIG_FIXED_PHY */ | 37 | #endif /* CONFIG_FIXED_PHY */ |
22 | 38 | ||
23 | /* | 39 | /* |
diff --git a/include/linux/platform_data/st21nfca.h b/include/linux/platform_data/st21nfca.h new file mode 100644 index 000000000000..1730312398ff --- /dev/null +++ b/include/linux/platform_data/st21nfca.h | |||
@@ -0,0 +1,32 @@ | |||
1 | /* | ||
2 | * Driver include for the ST21NFCA NFC chip. | ||
3 | * | ||
4 | * Copyright (C) 2014 STMicroelectronics SAS. All rights reserved. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms and conditions of the GNU General Public License, | ||
8 | * version 2, as published by the Free Software Foundation. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, see <http://www.gnu.org/licenses/>. | ||
17 | */ | ||
18 | |||
19 | #ifndef _ST21NFCA_HCI_H_ | ||
20 | #define _ST21NFCA_HCI_H_ | ||
21 | |||
22 | #include <linux/i2c.h> | ||
23 | |||
24 | #define ST21NFCA_HCI_DRIVER_NAME "st21nfca_hci" | ||
25 | |||
26 | struct st21nfca_nfc_platform_data { | ||
27 | unsigned int gpio_irq; | ||
28 | unsigned int gpio_ena; | ||
29 | unsigned int irq_polarity; | ||
30 | }; | ||
31 | |||
32 | #endif /* _ST21NFCA_HCI_H_ */ | ||
diff --git a/include/linux/rfkill-gpio.h b/include/linux/rfkill-gpio.h index 4d09f6eab359..20bcb55498cd 100644 --- a/include/linux/rfkill-gpio.h +++ b/include/linux/rfkill-gpio.h | |||
@@ -27,21 +27,11 @@ | |||
27 | * struct rfkill_gpio_platform_data - platform data for rfkill gpio device. | 27 | * struct rfkill_gpio_platform_data - platform data for rfkill gpio device. |
28 | * for unused gpio's, the expected value is -1. | 28 | * for unused gpio's, the expected value is -1. |
29 | * @name: name for the gpio rf kill instance | 29 | * @name: name for the gpio rf kill instance |
30 | * @reset_gpio: GPIO which is used for reseting rfkill switch | ||
31 | * @shutdown_gpio: GPIO which is used for shutdown of rfkill switch | ||
32 | * @power_clk_name: [optional] name of clk to turn off while blocked | ||
33 | * @gpio_runtime_close: clean up platform specific gpio configuration | ||
34 | * @gpio_runtime_setup: set up platform specific gpio configuration | ||
35 | */ | 30 | */ |
36 | 31 | ||
37 | struct rfkill_gpio_platform_data { | 32 | struct rfkill_gpio_platform_data { |
38 | char *name; | 33 | char *name; |
39 | int reset_gpio; | ||
40 | int shutdown_gpio; | ||
41 | const char *power_clk_name; | ||
42 | enum rfkill_type type; | 34 | enum rfkill_type type; |
43 | void (*gpio_runtime_close)(struct platform_device *); | ||
44 | int (*gpio_runtime_setup)(struct platform_device *); | ||
45 | }; | 35 | }; |
46 | 36 | ||
47 | #endif /* __RFKILL_GPIO_H */ | 37 | #endif /* __RFKILL_GPIO_H */ |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 08074a810164..5b5cd3189c98 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -345,6 +345,10 @@ enum { | |||
345 | SKB_GSO_UDP_TUNNEL = 1 << 9, | 345 | SKB_GSO_UDP_TUNNEL = 1 << 9, |
346 | 346 | ||
347 | SKB_GSO_MPLS = 1 << 10, | 347 | SKB_GSO_MPLS = 1 << 10, |
348 | |||
349 | SKB_GSO_UDP_TUNNEL_CSUM = 1 << 11, | ||
350 | |||
351 | SKB_GSO_GRE_CSUM = 1 << 12, | ||
348 | }; | 352 | }; |
349 | 353 | ||
350 | #if BITS_PER_LONG > 32 | 354 | #if BITS_PER_LONG > 32 |
@@ -426,7 +430,7 @@ static inline u32 skb_mstamp_us_delta(const struct skb_mstamp *t1, | |||
426 | * @csum_start: Offset from skb->head where checksumming should start | 430 | * @csum_start: Offset from skb->head where checksumming should start |
427 | * @csum_offset: Offset from csum_start where checksum should be stored | 431 | * @csum_offset: Offset from csum_start where checksum should be stored |
428 | * @priority: Packet queueing priority | 432 | * @priority: Packet queueing priority |
429 | * @local_df: allow local fragmentation | 433 | * @ignore_df: allow local fragmentation |
430 | * @cloned: Head may be cloned (check refcnt to be sure) | 434 | * @cloned: Head may be cloned (check refcnt to be sure) |
431 | * @ip_summed: Driver fed us an IP checksum | 435 | * @ip_summed: Driver fed us an IP checksum |
432 | * @nohdr: Payload reference only, must not modify header | 436 | * @nohdr: Payload reference only, must not modify header |
@@ -514,7 +518,7 @@ struct sk_buff { | |||
514 | }; | 518 | }; |
515 | __u32 priority; | 519 | __u32 priority; |
516 | kmemcheck_bitfield_begin(flags1); | 520 | kmemcheck_bitfield_begin(flags1); |
517 | __u8 local_df:1, | 521 | __u8 ignore_df:1, |
518 | cloned:1, | 522 | cloned:1, |
519 | ip_summed:2, | 523 | ip_summed:2, |
520 | nohdr:1, | 524 | nohdr:1, |
@@ -567,7 +571,10 @@ struct sk_buff { | |||
567 | * headers if needed | 571 | * headers if needed |
568 | */ | 572 | */ |
569 | __u8 encapsulation:1; | 573 | __u8 encapsulation:1; |
570 | /* 6/8 bit hole (depending on ndisc_nodetype presence) */ | 574 | __u8 encap_hdr_csum:1; |
575 | __u8 csum_valid:1; | ||
576 | __u8 csum_complete_sw:1; | ||
577 | /* 3/5 bit hole (depending on ndisc_nodetype presence) */ | ||
571 | kmemcheck_bitfield_end(flags2); | 578 | kmemcheck_bitfield_end(flags2); |
572 | 579 | ||
573 | #if defined CONFIG_NET_DMA || defined CONFIG_NET_RX_BUSY_POLL | 580 | #if defined CONFIG_NET_DMA || defined CONFIG_NET_RX_BUSY_POLL |
@@ -739,7 +746,13 @@ struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src); | |||
739 | int skb_copy_ubufs(struct sk_buff *skb, gfp_t gfp_mask); | 746 | int skb_copy_ubufs(struct sk_buff *skb, gfp_t gfp_mask); |
740 | struct sk_buff *skb_clone(struct sk_buff *skb, gfp_t priority); | 747 | struct sk_buff *skb_clone(struct sk_buff *skb, gfp_t priority); |
741 | struct sk_buff *skb_copy(const struct sk_buff *skb, gfp_t priority); | 748 | struct sk_buff *skb_copy(const struct sk_buff *skb, gfp_t priority); |
742 | struct sk_buff *__pskb_copy(struct sk_buff *skb, int headroom, gfp_t gfp_mask); | 749 | struct sk_buff *__pskb_copy_fclone(struct sk_buff *skb, int headroom, |
750 | gfp_t gfp_mask, bool fclone); | ||
751 | static inline struct sk_buff *__pskb_copy(struct sk_buff *skb, int headroom, | ||
752 | gfp_t gfp_mask) | ||
753 | { | ||
754 | return __pskb_copy_fclone(skb, headroom, gfp_mask, false); | ||
755 | } | ||
743 | 756 | ||
744 | int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail, gfp_t gfp_mask); | 757 | int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail, gfp_t gfp_mask); |
745 | struct sk_buff *skb_realloc_headroom(struct sk_buff *skb, | 758 | struct sk_buff *skb_realloc_headroom(struct sk_buff *skb, |
@@ -2233,6 +2246,14 @@ static inline struct sk_buff *pskb_copy(struct sk_buff *skb, | |||
2233 | return __pskb_copy(skb, skb_headroom(skb), gfp_mask); | 2246 | return __pskb_copy(skb, skb_headroom(skb), gfp_mask); |
2234 | } | 2247 | } |
2235 | 2248 | ||
2249 | |||
2250 | static inline struct sk_buff *pskb_copy_for_clone(struct sk_buff *skb, | ||
2251 | gfp_t gfp_mask) | ||
2252 | { | ||
2253 | return __pskb_copy_fclone(skb, skb_headroom(skb), gfp_mask, true); | ||
2254 | } | ||
2255 | |||
2256 | |||
2236 | /** | 2257 | /** |
2237 | * skb_clone_writable - is the header of a clone writable | 2258 | * skb_clone_writable - is the header of a clone writable |
2238 | * @skb: buffer to check | 2259 | * @skb: buffer to check |
@@ -2716,7 +2737,7 @@ __sum16 __skb_checksum_complete(struct sk_buff *skb); | |||
2716 | 2737 | ||
2717 | static inline int skb_csum_unnecessary(const struct sk_buff *skb) | 2738 | static inline int skb_csum_unnecessary(const struct sk_buff *skb) |
2718 | { | 2739 | { |
2719 | return skb->ip_summed & CHECKSUM_UNNECESSARY; | 2740 | return ((skb->ip_summed & CHECKSUM_UNNECESSARY) || skb->csum_valid); |
2720 | } | 2741 | } |
2721 | 2742 | ||
2722 | /** | 2743 | /** |
@@ -2741,6 +2762,103 @@ static inline __sum16 skb_checksum_complete(struct sk_buff *skb) | |||
2741 | 0 : __skb_checksum_complete(skb); | 2762 | 0 : __skb_checksum_complete(skb); |
2742 | } | 2763 | } |
2743 | 2764 | ||
2765 | /* Check if we need to perform checksum complete validation. | ||
2766 | * | ||
2767 | * Returns true if checksum complete is needed, false otherwise | ||
2768 | * (either checksum is unnecessary or zero checksum is allowed). | ||
2769 | */ | ||
2770 | static inline bool __skb_checksum_validate_needed(struct sk_buff *skb, | ||
2771 | bool zero_okay, | ||
2772 | __sum16 check) | ||
2773 | { | ||
2774 | if (skb_csum_unnecessary(skb) || (zero_okay && !check)) { | ||
2775 | skb->csum_valid = 1; | ||
2776 | return false; | ||
2777 | } | ||
2778 | |||
2779 | return true; | ||
2780 | } | ||
2781 | |||
2782 | /* For small packets <= CHECKSUM_BREAK peform checksum complete directly | ||
2783 | * in checksum_init. | ||
2784 | */ | ||
2785 | #define CHECKSUM_BREAK 76 | ||
2786 | |||
2787 | /* Validate (init) checksum based on checksum complete. | ||
2788 | * | ||
2789 | * Return values: | ||
2790 | * 0: checksum is validated or try to in skb_checksum_complete. In the latter | ||
2791 | * case the ip_summed will not be CHECKSUM_UNNECESSARY and the pseudo | ||
2792 | * checksum is stored in skb->csum for use in __skb_checksum_complete | ||
2793 | * non-zero: value of invalid checksum | ||
2794 | * | ||
2795 | */ | ||
2796 | static inline __sum16 __skb_checksum_validate_complete(struct sk_buff *skb, | ||
2797 | bool complete, | ||
2798 | __wsum psum) | ||
2799 | { | ||
2800 | if (skb->ip_summed == CHECKSUM_COMPLETE) { | ||
2801 | if (!csum_fold(csum_add(psum, skb->csum))) { | ||
2802 | skb->csum_valid = 1; | ||
2803 | return 0; | ||
2804 | } | ||
2805 | } | ||
2806 | |||
2807 | skb->csum = psum; | ||
2808 | |||
2809 | if (complete || skb->len <= CHECKSUM_BREAK) { | ||
2810 | __sum16 csum; | ||
2811 | |||
2812 | csum = __skb_checksum_complete(skb); | ||
2813 | skb->csum_valid = !csum; | ||
2814 | return csum; | ||
2815 | } | ||
2816 | |||
2817 | return 0; | ||
2818 | } | ||
2819 | |||
2820 | static inline __wsum null_compute_pseudo(struct sk_buff *skb, int proto) | ||
2821 | { | ||
2822 | return 0; | ||
2823 | } | ||
2824 | |||
2825 | /* Perform checksum validate (init). Note that this is a macro since we only | ||
2826 | * want to calculate the pseudo header which is an input function if necessary. | ||
2827 | * First we try to validate without any computation (checksum unnecessary) and | ||
2828 | * then calculate based on checksum complete calling the function to compute | ||
2829 | * pseudo header. | ||
2830 | * | ||
2831 | * Return values: | ||
2832 | * 0: checksum is validated or try to in skb_checksum_complete | ||
2833 | * non-zero: value of invalid checksum | ||
2834 | */ | ||
2835 | #define __skb_checksum_validate(skb, proto, complete, \ | ||
2836 | zero_okay, check, compute_pseudo) \ | ||
2837 | ({ \ | ||
2838 | __sum16 __ret = 0; \ | ||
2839 | skb->csum_valid = 0; \ | ||
2840 | if (__skb_checksum_validate_needed(skb, zero_okay, check)) \ | ||
2841 | __ret = __skb_checksum_validate_complete(skb, \ | ||
2842 | complete, compute_pseudo(skb, proto)); \ | ||
2843 | __ret; \ | ||
2844 | }) | ||
2845 | |||
2846 | #define skb_checksum_init(skb, proto, compute_pseudo) \ | ||
2847 | __skb_checksum_validate(skb, proto, false, false, 0, compute_pseudo) | ||
2848 | |||
2849 | #define skb_checksum_init_zero_check(skb, proto, check, compute_pseudo) \ | ||
2850 | __skb_checksum_validate(skb, proto, false, true, check, compute_pseudo) | ||
2851 | |||
2852 | #define skb_checksum_validate(skb, proto, compute_pseudo) \ | ||
2853 | __skb_checksum_validate(skb, proto, true, false, 0, compute_pseudo) | ||
2854 | |||
2855 | #define skb_checksum_validate_zero_check(skb, proto, check, \ | ||
2856 | compute_pseudo) \ | ||
2857 | __skb_checksum_validate_(skb, proto, true, true, check, compute_pseudo) | ||
2858 | |||
2859 | #define skb_checksum_simple_validate(skb) \ | ||
2860 | __skb_checksum_validate(skb, 0, true, false, 0, null_compute_pseudo) | ||
2861 | |||
2744 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | 2862 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) |
2745 | void nf_conntrack_destroy(struct nf_conntrack *nfct); | 2863 | void nf_conntrack_destroy(struct nf_conntrack *nfct); |
2746 | static inline void nf_conntrack_put(struct nf_conntrack *nfct) | 2864 | static inline void nf_conntrack_put(struct nf_conntrack *nfct) |
@@ -2895,6 +3013,7 @@ static inline struct sec_path *skb_sec_path(struct sk_buff *skb) | |||
2895 | struct skb_gso_cb { | 3013 | struct skb_gso_cb { |
2896 | int mac_offset; | 3014 | int mac_offset; |
2897 | int encap_level; | 3015 | int encap_level; |
3016 | __u16 csum_start; | ||
2898 | }; | 3017 | }; |
2899 | #define SKB_GSO_CB(skb) ((struct skb_gso_cb *)(skb)->cb) | 3018 | #define SKB_GSO_CB(skb) ((struct skb_gso_cb *)(skb)->cb) |
2900 | 3019 | ||
@@ -2919,6 +3038,28 @@ static inline int gso_pskb_expand_head(struct sk_buff *skb, int extra) | |||
2919 | return 0; | 3038 | return 0; |
2920 | } | 3039 | } |
2921 | 3040 | ||
3041 | /* Compute the checksum for a gso segment. First compute the checksum value | ||
3042 | * from the start of transport header to SKB_GSO_CB(skb)->csum_start, and | ||
3043 | * then add in skb->csum (checksum from csum_start to end of packet). | ||
3044 | * skb->csum and csum_start are then updated to reflect the checksum of the | ||
3045 | * resultant packet starting from the transport header-- the resultant checksum | ||
3046 | * is in the res argument (i.e. normally zero or ~ of checksum of a pseudo | ||
3047 | * header. | ||
3048 | */ | ||
3049 | static inline __sum16 gso_make_checksum(struct sk_buff *skb, __wsum res) | ||
3050 | { | ||
3051 | int plen = SKB_GSO_CB(skb)->csum_start - skb_headroom(skb) - | ||
3052 | skb_transport_offset(skb); | ||
3053 | __u16 csum; | ||
3054 | |||
3055 | csum = csum_fold(csum_partial(skb_transport_header(skb), | ||
3056 | plen, skb->csum)); | ||
3057 | skb->csum = res; | ||
3058 | SKB_GSO_CB(skb)->csum_start -= plen; | ||
3059 | |||
3060 | return csum; | ||
3061 | } | ||
3062 | |||
2922 | static inline bool skb_is_gso(const struct sk_buff *skb) | 3063 | static inline bool skb_is_gso(const struct sk_buff *skb) |
2923 | { | 3064 | { |
2924 | return skb_shinfo(skb)->gso_size; | 3065 | return skb_shinfo(skb)->gso_size; |
diff --git a/include/linux/spi/at86rf230.h b/include/linux/spi/at86rf230.h index aa327a8105ad..b2b1afbb3202 100644 --- a/include/linux/spi/at86rf230.h +++ b/include/linux/spi/at86rf230.h | |||
@@ -26,20 +26,6 @@ struct at86rf230_platform_data { | |||
26 | int rstn; | 26 | int rstn; |
27 | int slp_tr; | 27 | int slp_tr; |
28 | int dig2; | 28 | int dig2; |
29 | |||
30 | /* Setting the irq_type will configure the driver to request | ||
31 | * the platform irq trigger type according to the given value | ||
32 | * and configure the interrupt polarity of the device to the | ||
33 | * corresponding polarity. | ||
34 | * | ||
35 | * Allowed values are: IRQF_TRIGGER_RISING, IRQF_TRIGGER_FALLING, | ||
36 | * IRQF_TRIGGER_HIGH and IRQF_TRIGGER_LOW | ||
37 | * | ||
38 | * Setting it to 0, the driver does not touch the trigger type | ||
39 | * configuration of the interrupt and sets the interrupt polarity | ||
40 | * of the device to high active (the default value). | ||
41 | */ | ||
42 | int irq_type; | ||
43 | }; | 29 | }; |
44 | 30 | ||
45 | #endif | 31 | #endif |
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h index 07ef9b82b66d..4568a5cc9ab8 100644 --- a/include/linux/ssb/ssb.h +++ b/include/linux/ssb/ssb.h | |||
@@ -33,6 +33,7 @@ struct ssb_sprom { | |||
33 | u8 et1phyaddr; /* MII address for enet1 */ | 33 | u8 et1phyaddr; /* MII address for enet1 */ |
34 | u8 et0mdcport; /* MDIO for enet0 */ | 34 | u8 et0mdcport; /* MDIO for enet0 */ |
35 | u8 et1mdcport; /* MDIO for enet1 */ | 35 | u8 et1mdcport; /* MDIO for enet1 */ |
36 | u16 dev_id; /* Device ID overriding e.g. PCI ID */ | ||
36 | u16 board_rev; /* Board revision number from SPROM. */ | 37 | u16 board_rev; /* Board revision number from SPROM. */ |
37 | u16 board_num; /* Board number from SPROM. */ | 38 | u16 board_num; /* Board number from SPROM. */ |
38 | u16 board_type; /* Board type from SPROM. */ | 39 | u16 board_type; /* Board type from SPROM. */ |
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 239946868142..a0513210798f 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
@@ -197,7 +197,8 @@ struct tcp_sock { | |||
197 | u8 do_early_retrans:1,/* Enable RFC5827 early-retransmit */ | 197 | u8 do_early_retrans:1,/* Enable RFC5827 early-retransmit */ |
198 | syn_data:1, /* SYN includes data */ | 198 | syn_data:1, /* SYN includes data */ |
199 | syn_fastopen:1, /* SYN includes Fast Open option */ | 199 | syn_fastopen:1, /* SYN includes Fast Open option */ |
200 | syn_data_acked:1;/* data in SYN is acked by SYN-ACK */ | 200 | syn_data_acked:1,/* data in SYN is acked by SYN-ACK */ |
201 | is_cwnd_limited:1;/* forward progress limited by snd_cwnd? */ | ||
201 | u32 tlp_high_seq; /* snd_nxt at the time of TLP retransmit. */ | 202 | u32 tlp_high_seq; /* snd_nxt at the time of TLP retransmit. */ |
202 | 203 | ||
203 | /* RTT measurement */ | 204 | /* RTT measurement */ |
@@ -209,6 +210,8 @@ struct tcp_sock { | |||
209 | 210 | ||
210 | u32 packets_out; /* Packets which are "in flight" */ | 211 | u32 packets_out; /* Packets which are "in flight" */ |
211 | u32 retrans_out; /* Retransmitted packets out */ | 212 | u32 retrans_out; /* Retransmitted packets out */ |
213 | u32 max_packets_out; /* max packets_out in last window */ | ||
214 | u32 max_packets_seq; /* right edge of max_packets_out flight */ | ||
212 | 215 | ||
213 | u16 urg_data; /* Saved octet of OOB data and control flags */ | 216 | u16 urg_data; /* Saved octet of OOB data and control flags */ |
214 | u8 ecn_flags; /* ECN status bits. */ | 217 | u8 ecn_flags; /* ECN status bits. */ |
@@ -365,11 +368,6 @@ static inline bool tcp_passive_fastopen(const struct sock *sk) | |||
365 | tcp_sk(sk)->fastopen_rsk != NULL); | 368 | tcp_sk(sk)->fastopen_rsk != NULL); |
366 | } | 369 | } |
367 | 370 | ||
368 | static inline bool fastopen_cookie_present(struct tcp_fastopen_cookie *foc) | ||
369 | { | ||
370 | return foc->len != -1; | ||
371 | } | ||
372 | |||
373 | extern void tcp_sock_destruct(struct sock *sk); | 371 | extern void tcp_sock_destruct(struct sock *sk); |
374 | 372 | ||
375 | static inline int fastopen_init_queue(struct sock *sk, int backlog) | 373 | static inline int fastopen_init_queue(struct sock *sk, int backlog) |
diff --git a/include/linux/udp.h b/include/linux/udp.h index 42278bbf7a88..247cfdcc4b08 100644 --- a/include/linux/udp.h +++ b/include/linux/udp.h | |||
@@ -47,7 +47,9 @@ struct udp_sock { | |||
47 | #define udp_portaddr_node inet.sk.__sk_common.skc_portaddr_node | 47 | #define udp_portaddr_node inet.sk.__sk_common.skc_portaddr_node |
48 | int pending; /* Any pending frames ? */ | 48 | int pending; /* Any pending frames ? */ |
49 | unsigned int corkflag; /* Cork is required */ | 49 | unsigned int corkflag; /* Cork is required */ |
50 | __u16 encap_type; /* Is this an Encapsulation socket? */ | 50 | __u8 encap_type; /* Is this an Encapsulation socket? */ |
51 | unsigned char no_check6_tx:1,/* Send zero UDP6 checksums on TX? */ | ||
52 | no_check6_rx:1;/* Allow zero UDP6 checksums on RX? */ | ||
51 | /* | 53 | /* |
52 | * Following member retains the information to create a UDP header | 54 | * Following member retains the information to create a UDP header |
53 | * when the socket is uncorked. | 55 | * when the socket is uncorked. |
@@ -76,6 +78,26 @@ static inline struct udp_sock *udp_sk(const struct sock *sk) | |||
76 | return (struct udp_sock *)sk; | 78 | return (struct udp_sock *)sk; |
77 | } | 79 | } |
78 | 80 | ||
81 | static inline void udp_set_no_check6_tx(struct sock *sk, bool val) | ||
82 | { | ||
83 | udp_sk(sk)->no_check6_tx = val; | ||
84 | } | ||
85 | |||
86 | static inline void udp_set_no_check6_rx(struct sock *sk, bool val) | ||
87 | { | ||
88 | udp_sk(sk)->no_check6_rx = val; | ||
89 | } | ||
90 | |||
91 | static inline bool udp_get_no_check6_tx(struct sock *sk) | ||
92 | { | ||
93 | return udp_sk(sk)->no_check6_tx; | ||
94 | } | ||
95 | |||
96 | static inline bool udp_get_no_check6_rx(struct sock *sk) | ||
97 | { | ||
98 | return udp_sk(sk)->no_check6_rx; | ||
99 | } | ||
100 | |||
79 | #define udp_portaddr_for_each_entry(__sk, node, list) \ | 101 | #define udp_portaddr_for_each_entry(__sk, node, list) \ |
80 | hlist_nulls_for_each_entry(__sk, node, list, __sk_common.skc_portaddr_node) | 102 | hlist_nulls_for_each_entry(__sk, node, list, __sk_common.skc_portaddr_node) |
81 | 103 | ||
diff --git a/include/linux/usb/cdc_ncm.h b/include/linux/usb/cdc_ncm.h index 44b38b92236a..7c9b484735c5 100644 --- a/include/linux/usb/cdc_ncm.h +++ b/include/linux/usb/cdc_ncm.h | |||
@@ -52,6 +52,10 @@ | |||
52 | #define CDC_NCM_NTB_MAX_SIZE_TX 32768 /* bytes */ | 52 | #define CDC_NCM_NTB_MAX_SIZE_TX 32768 /* bytes */ |
53 | #define CDC_NCM_NTB_MAX_SIZE_RX 32768 /* bytes */ | 53 | #define CDC_NCM_NTB_MAX_SIZE_RX 32768 /* bytes */ |
54 | 54 | ||
55 | /* Initial NTB length */ | ||
56 | #define CDC_NCM_NTB_DEF_SIZE_TX 16384 /* bytes */ | ||
57 | #define CDC_NCM_NTB_DEF_SIZE_RX 16384 /* bytes */ | ||
58 | |||
55 | /* Minimum value for MaxDatagramSize, ch. 6.2.9 */ | 59 | /* Minimum value for MaxDatagramSize, ch. 6.2.9 */ |
56 | #define CDC_NCM_MIN_DATAGRAM_SIZE 1514 /* bytes */ | 60 | #define CDC_NCM_MIN_DATAGRAM_SIZE 1514 /* bytes */ |
57 | 61 | ||
@@ -72,16 +76,9 @@ | |||
72 | /* Restart the timer, if amount of datagrams is less than given value */ | 76 | /* Restart the timer, if amount of datagrams is less than given value */ |
73 | #define CDC_NCM_RESTART_TIMER_DATAGRAM_CNT 3 | 77 | #define CDC_NCM_RESTART_TIMER_DATAGRAM_CNT 3 |
74 | #define CDC_NCM_TIMER_PENDING_CNT 2 | 78 | #define CDC_NCM_TIMER_PENDING_CNT 2 |
75 | #define CDC_NCM_TIMER_INTERVAL (400UL * NSEC_PER_USEC) | 79 | #define CDC_NCM_TIMER_INTERVAL_USEC 400UL |
76 | 80 | #define CDC_NCM_TIMER_INTERVAL_MIN 5UL | |
77 | /* The following macro defines the minimum header space */ | 81 | #define CDC_NCM_TIMER_INTERVAL_MAX (U32_MAX / NSEC_PER_USEC) |
78 | #define CDC_NCM_MIN_HDR_SIZE \ | ||
79 | (sizeof(struct usb_cdc_ncm_nth16) + sizeof(struct usb_cdc_ncm_ndp16) + \ | ||
80 | (CDC_NCM_DPT_DATAGRAMS_MAX + 1) * sizeof(struct usb_cdc_ncm_dpe16)) | ||
81 | |||
82 | #define CDC_NCM_NDP_SIZE \ | ||
83 | (sizeof(struct usb_cdc_ncm_ndp16) + \ | ||
84 | (CDC_NCM_DPT_DATAGRAMS_MAX + 1) * sizeof(struct usb_cdc_ncm_dpe16)) | ||
85 | 82 | ||
86 | #define cdc_ncm_comm_intf_is_mbim(x) ((x)->desc.bInterfaceSubClass == USB_CDC_SUBCLASS_MBIM && \ | 83 | #define cdc_ncm_comm_intf_is_mbim(x) ((x)->desc.bInterfaceSubClass == USB_CDC_SUBCLASS_MBIM && \ |
87 | (x)->desc.bInterfaceProtocol == USB_CDC_PROTO_NONE) | 84 | (x)->desc.bInterfaceProtocol == USB_CDC_PROTO_NONE) |
@@ -107,6 +104,9 @@ struct cdc_ncm_ctx { | |||
107 | spinlock_t mtx; | 104 | spinlock_t mtx; |
108 | atomic_t stop; | 105 | atomic_t stop; |
109 | 106 | ||
107 | u32 timer_interval; | ||
108 | u32 max_ndp_size; | ||
109 | |||
110 | u32 tx_timer_pending; | 110 | u32 tx_timer_pending; |
111 | u32 tx_curr_frame_num; | 111 | u32 tx_curr_frame_num; |
112 | u32 rx_max; | 112 | u32 rx_max; |
@@ -118,10 +118,21 @@ struct cdc_ncm_ctx { | |||
118 | u16 tx_ndp_modulus; | 118 | u16 tx_ndp_modulus; |
119 | u16 tx_seq; | 119 | u16 tx_seq; |
120 | u16 rx_seq; | 120 | u16 rx_seq; |
121 | u16 connected; | 121 | u16 min_tx_pkt; |
122 | |||
123 | /* statistics */ | ||
124 | u32 tx_curr_frame_payload; | ||
125 | u32 tx_reason_ntb_full; | ||
126 | u32 tx_reason_ndp_full; | ||
127 | u32 tx_reason_timeout; | ||
128 | u32 tx_reason_max_datagram; | ||
129 | u64 tx_overhead; | ||
130 | u64 tx_ntbs; | ||
131 | u64 rx_overhead; | ||
132 | u64 rx_ntbs; | ||
122 | }; | 133 | }; |
123 | 134 | ||
124 | u8 cdc_ncm_select_altsetting(struct usbnet *dev, struct usb_interface *intf); | 135 | u8 cdc_ncm_select_altsetting(struct usb_interface *intf); |
125 | int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_altsetting); | 136 | int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_altsetting); |
126 | void cdc_ncm_unbind(struct usbnet *dev, struct usb_interface *intf); | 137 | void cdc_ncm_unbind(struct usbnet *dev, struct usb_interface *intf); |
127 | struct sk_buff *cdc_ncm_fill_tx_frame(struct usbnet *dev, struct sk_buff *skb, __le32 sign); | 138 | struct sk_buff *cdc_ncm_fill_tx_frame(struct usbnet *dev, struct sk_buff *skb, __le32 sign); |