diff options
Diffstat (limited to 'include/linux')
71 files changed, 1156 insertions, 347 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/blk_types.h b/include/linux/blk_types.h index d8e4cea23a25..66c2167f04a9 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h | |||
@@ -5,8 +5,6 @@ | |||
5 | #ifndef __LINUX_BLK_TYPES_H | 5 | #ifndef __LINUX_BLK_TYPES_H |
6 | #define __LINUX_BLK_TYPES_H | 6 | #define __LINUX_BLK_TYPES_H |
7 | 7 | ||
8 | #ifdef CONFIG_BLOCK | ||
9 | |||
10 | #include <linux/types.h> | 8 | #include <linux/types.h> |
11 | 9 | ||
12 | struct bio_set; | 10 | struct bio_set; |
@@ -28,6 +26,8 @@ struct bio_vec { | |||
28 | unsigned int bv_offset; | 26 | unsigned int bv_offset; |
29 | }; | 27 | }; |
30 | 28 | ||
29 | #ifdef CONFIG_BLOCK | ||
30 | |||
31 | struct bvec_iter { | 31 | struct bvec_iter { |
32 | sector_t bi_sector; /* device address in 512 byte | 32 | sector_t bi_sector; /* device address in 512 byte |
33 | sectors */ | 33 | sectors */ |
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/ceph/ceph_fs.h b/include/linux/ceph/ceph_fs.h index 5f6db18d72e8..3c97d5e9b951 100644 --- a/include/linux/ceph/ceph_fs.h +++ b/include/linux/ceph/ceph_fs.h | |||
@@ -625,6 +625,8 @@ int ceph_flags_to_mode(int flags); | |||
625 | CEPH_CAP_LINK_EXCL | \ | 625 | CEPH_CAP_LINK_EXCL | \ |
626 | CEPH_CAP_XATTR_EXCL | \ | 626 | CEPH_CAP_XATTR_EXCL | \ |
627 | CEPH_CAP_FILE_EXCL) | 627 | CEPH_CAP_FILE_EXCL) |
628 | #define CEPH_CAP_ANY_FILE_RD (CEPH_CAP_FILE_RD | CEPH_CAP_FILE_CACHE | \ | ||
629 | CEPH_CAP_FILE_SHARED) | ||
628 | #define CEPH_CAP_ANY_FILE_WR (CEPH_CAP_FILE_WR | CEPH_CAP_FILE_BUFFER | \ | 630 | #define CEPH_CAP_ANY_FILE_WR (CEPH_CAP_FILE_WR | CEPH_CAP_FILE_BUFFER | \ |
629 | CEPH_CAP_FILE_EXCL) | 631 | CEPH_CAP_FILE_EXCL) |
630 | #define CEPH_CAP_ANY_WR (CEPH_CAP_ANY_EXCL | CEPH_CAP_ANY_FILE_WR) | 632 | #define CEPH_CAP_ANY_WR (CEPH_CAP_ANY_EXCL | CEPH_CAP_ANY_FILE_WR) |
diff --git a/include/linux/ceph/libceph.h b/include/linux/ceph/libceph.h index 2f49aa4c4f7f..279b0afac1c1 100644 --- a/include/linux/ceph/libceph.h +++ b/include/linux/ceph/libceph.h | |||
@@ -222,8 +222,6 @@ extern void ceph_copy_to_page_vector(struct page **pages, | |||
222 | extern void ceph_copy_from_page_vector(struct page **pages, | 222 | extern void ceph_copy_from_page_vector(struct page **pages, |
223 | void *data, | 223 | void *data, |
224 | loff_t off, size_t len); | 224 | loff_t off, size_t len); |
225 | extern int ceph_copy_page_vector_to_user(struct page **pages, void __user *data, | ||
226 | loff_t off, size_t len); | ||
227 | extern void ceph_zero_page_vector_range(int off, int len, struct page **pages); | 225 | extern void ceph_zero_page_vector_range(int off, int len, struct page **pages); |
228 | 226 | ||
229 | 227 | ||
diff --git a/include/linux/ceph/mon_client.h b/include/linux/ceph/mon_client.h index a486f390dfbe..deb47e45ac7c 100644 --- a/include/linux/ceph/mon_client.h +++ b/include/linux/ceph/mon_client.h | |||
@@ -40,9 +40,9 @@ struct ceph_mon_request { | |||
40 | }; | 40 | }; |
41 | 41 | ||
42 | /* | 42 | /* |
43 | * ceph_mon_generic_request is being used for the statfs and poolop requests | 43 | * ceph_mon_generic_request is being used for the statfs, poolop and |
44 | * which are bening done a bit differently because we need to get data back | 44 | * mon_get_version requests which are being done a bit differently |
45 | * to the caller | 45 | * because we need to get data back to the caller |
46 | */ | 46 | */ |
47 | struct ceph_mon_generic_request { | 47 | struct ceph_mon_generic_request { |
48 | struct kref kref; | 48 | struct kref kref; |
@@ -104,10 +104,15 @@ extern int ceph_monc_got_mdsmap(struct ceph_mon_client *monc, u32 have); | |||
104 | extern int ceph_monc_got_osdmap(struct ceph_mon_client *monc, u32 have); | 104 | extern int ceph_monc_got_osdmap(struct ceph_mon_client *monc, u32 have); |
105 | 105 | ||
106 | extern void ceph_monc_request_next_osdmap(struct ceph_mon_client *monc); | 106 | extern void ceph_monc_request_next_osdmap(struct ceph_mon_client *monc); |
107 | extern int ceph_monc_wait_osdmap(struct ceph_mon_client *monc, u32 epoch, | ||
108 | unsigned long timeout); | ||
107 | 109 | ||
108 | extern int ceph_monc_do_statfs(struct ceph_mon_client *monc, | 110 | extern int ceph_monc_do_statfs(struct ceph_mon_client *monc, |
109 | struct ceph_statfs *buf); | 111 | struct ceph_statfs *buf); |
110 | 112 | ||
113 | extern int ceph_monc_do_get_version(struct ceph_mon_client *monc, | ||
114 | const char *what, u64 *newest); | ||
115 | |||
111 | extern int ceph_monc_open_session(struct ceph_mon_client *monc); | 116 | extern int ceph_monc_open_session(struct ceph_mon_client *monc); |
112 | 117 | ||
113 | extern int ceph_monc_validate_auth(struct ceph_mon_client *monc); | 118 | extern int ceph_monc_validate_auth(struct ceph_mon_client *monc); |
diff --git a/include/linux/clk/ti.h b/include/linux/clk/ti.h index 4a21a872dbbd..e8d8a35034a5 100644 --- a/include/linux/clk/ti.h +++ b/include/linux/clk/ti.h | |||
@@ -41,6 +41,8 @@ | |||
41 | * @idlest_reg: register containing the DPLL idle status bitfield | 41 | * @idlest_reg: register containing the DPLL idle status bitfield |
42 | * @autoidle_mask: mask of the DPLL autoidle mode bitfield in @autoidle_reg | 42 | * @autoidle_mask: mask of the DPLL autoidle mode bitfield in @autoidle_reg |
43 | * @freqsel_mask: mask of the DPLL jitter correction bitfield in @control_reg | 43 | * @freqsel_mask: mask of the DPLL jitter correction bitfield in @control_reg |
44 | * @dcc_mask: mask of the DPLL DCC correction bitfield @mult_div1_reg | ||
45 | * @dcc_rate: rate atleast which DCC @dcc_mask must be set | ||
44 | * @idlest_mask: mask of the DPLL idle status bitfield in @idlest_reg | 46 | * @idlest_mask: mask of the DPLL idle status bitfield in @idlest_reg |
45 | * @lpmode_mask: mask of the DPLL low-power mode bitfield in @control_reg | 47 | * @lpmode_mask: mask of the DPLL low-power mode bitfield in @control_reg |
46 | * @m4xen_mask: mask of the DPLL M4X multiplier bitfield in @control_reg | 48 | * @m4xen_mask: mask of the DPLL M4X multiplier bitfield in @control_reg |
@@ -86,6 +88,8 @@ struct dpll_data { | |||
86 | u32 idlest_mask; | 88 | u32 idlest_mask; |
87 | u32 dco_mask; | 89 | u32 dco_mask; |
88 | u32 sddiv_mask; | 90 | u32 sddiv_mask; |
91 | u32 dcc_mask; | ||
92 | unsigned long dcc_rate; | ||
89 | u32 lpmode_mask; | 93 | u32 lpmode_mask; |
90 | u32 m4xen_mask; | 94 | u32 m4xen_mask; |
91 | u8 auto_recal_bit; | 95 | u8 auto_recal_bit; |
@@ -94,7 +98,26 @@ struct dpll_data { | |||
94 | u8 flags; | 98 | u8 flags; |
95 | }; | 99 | }; |
96 | 100 | ||
97 | struct clk_hw_omap_ops; | 101 | struct clk_hw_omap; |
102 | |||
103 | /** | ||
104 | * struct clk_hw_omap_ops - OMAP clk ops | ||
105 | * @find_idlest: find idlest register information for a clock | ||
106 | * @find_companion: find companion clock register information for a clock, | ||
107 | * basically converts CM_ICLKEN* <-> CM_FCLKEN* | ||
108 | * @allow_idle: enables autoidle hardware functionality for a clock | ||
109 | * @deny_idle: prevent autoidle hardware functionality for a clock | ||
110 | */ | ||
111 | struct clk_hw_omap_ops { | ||
112 | void (*find_idlest)(struct clk_hw_omap *oclk, | ||
113 | void __iomem **idlest_reg, | ||
114 | u8 *idlest_bit, u8 *idlest_val); | ||
115 | void (*find_companion)(struct clk_hw_omap *oclk, | ||
116 | void __iomem **other_reg, | ||
117 | u8 *other_bit); | ||
118 | void (*allow_idle)(struct clk_hw_omap *oclk); | ||
119 | void (*deny_idle)(struct clk_hw_omap *oclk); | ||
120 | }; | ||
98 | 121 | ||
99 | /** | 122 | /** |
100 | * struct clk_hw_omap - OMAP struct clk | 123 | * struct clk_hw_omap - OMAP struct clk |
@@ -259,6 +282,12 @@ int omap2_dflt_clk_enable(struct clk_hw *hw); | |||
259 | void omap2_dflt_clk_disable(struct clk_hw *hw); | 282 | void omap2_dflt_clk_disable(struct clk_hw *hw); |
260 | int omap2_dflt_clk_is_enabled(struct clk_hw *hw); | 283 | int omap2_dflt_clk_is_enabled(struct clk_hw *hw); |
261 | void omap3_clk_lock_dpll5(void); | 284 | void omap3_clk_lock_dpll5(void); |
285 | unsigned long omap2_dpllcore_recalc(struct clk_hw *hw, | ||
286 | unsigned long parent_rate); | ||
287 | int omap2_reprogram_dpllcore(struct clk_hw *clk, unsigned long rate, | ||
288 | unsigned long parent_rate); | ||
289 | void omap2xxx_clkt_dpllcore_init(struct clk_hw *hw); | ||
290 | void omap2xxx_clkt_vps_init(void); | ||
262 | 291 | ||
263 | void __iomem *ti_clk_get_reg_addr(struct device_node *node, int index); | 292 | void __iomem *ti_clk_get_reg_addr(struct device_node *node, int index); |
264 | void ti_dt_clocks_register(struct ti_dt_clk *oclks); | 293 | void ti_dt_clocks_register(struct ti_dt_clk *oclks); |
@@ -278,6 +307,8 @@ int omap5xxx_dt_clk_init(void); | |||
278 | int dra7xx_dt_clk_init(void); | 307 | int dra7xx_dt_clk_init(void); |
279 | int am33xx_dt_clk_init(void); | 308 | int am33xx_dt_clk_init(void); |
280 | int am43xx_dt_clk_init(void); | 309 | int am43xx_dt_clk_init(void); |
310 | int omap2420_dt_clk_init(void); | ||
311 | int omap2430_dt_clk_init(void); | ||
281 | 312 | ||
282 | #ifdef CONFIG_OF | 313 | #ifdef CONFIG_OF |
283 | void of_ti_clk_allow_autoidle_all(void); | 314 | void of_ti_clk_allow_autoidle_all(void); |
@@ -287,6 +318,8 @@ static inline void of_ti_clk_allow_autoidle_all(void) { } | |||
287 | static inline void of_ti_clk_deny_autoidle_all(void) { } | 318 | static inline void of_ti_clk_deny_autoidle_all(void) { } |
288 | #endif | 319 | #endif |
289 | 320 | ||
321 | extern const struct clk_hw_omap_ops clkhwops_omap2xxx_dpll; | ||
322 | extern const struct clk_hw_omap_ops clkhwops_omap2430_i2chs_wait; | ||
290 | extern const struct clk_hw_omap_ops clkhwops_omap3_dpll; | 323 | extern const struct clk_hw_omap_ops clkhwops_omap3_dpll; |
291 | extern const struct clk_hw_omap_ops clkhwops_omap4_dpllmx; | 324 | extern const struct clk_hw_omap_ops clkhwops_omap4_dpllmx; |
292 | extern const struct clk_hw_omap_ops clkhwops_wait; | 325 | extern const struct clk_hw_omap_ops clkhwops_wait; |
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 64fdfe1cfcf0..d5ad7b1118fc 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
@@ -383,7 +383,9 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); | |||
383 | /* Ignore/forbid kprobes attach on very low level functions marked by this attribute: */ | 383 | /* Ignore/forbid kprobes attach on very low level functions marked by this attribute: */ |
384 | #ifdef CONFIG_KPROBES | 384 | #ifdef CONFIG_KPROBES |
385 | # define __kprobes __attribute__((__section__(".kprobes.text"))) | 385 | # define __kprobes __attribute__((__section__(".kprobes.text"))) |
386 | # define nokprobe_inline __always_inline | ||
386 | #else | 387 | #else |
387 | # define __kprobes | 388 | # define __kprobes |
389 | # define nokprobe_inline inline | ||
388 | #endif | 390 | #endif |
389 | #endif /* __LINUX_COMPILER_H */ | 391 | #endif /* __LINUX_COMPILER_H */ |
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 3f458896d45c..ec4112d257bc 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
@@ -75,6 +75,7 @@ struct cpufreq_policy { | |||
75 | unsigned int max; /* in kHz */ | 75 | unsigned int max; /* in kHz */ |
76 | unsigned int cur; /* in kHz, only needed if cpufreq | 76 | unsigned int cur; /* in kHz, only needed if cpufreq |
77 | * governors are used */ | 77 | * governors are used */ |
78 | unsigned int restore_freq; /* = policy->cur before transition */ | ||
78 | unsigned int suspend_freq; /* freq to set during suspend */ | 79 | unsigned int suspend_freq; /* freq to set during suspend */ |
79 | 80 | ||
80 | unsigned int policy; /* see above */ | 81 | unsigned int policy; /* see above */ |
@@ -221,11 +222,35 @@ struct cpufreq_driver { | |||
221 | 222 | ||
222 | /* define one out of two */ | 223 | /* define one out of two */ |
223 | int (*setpolicy) (struct cpufreq_policy *policy); | 224 | int (*setpolicy) (struct cpufreq_policy *policy); |
225 | |||
226 | /* | ||
227 | * On failure, should always restore frequency to policy->restore_freq | ||
228 | * (i.e. old freq). | ||
229 | */ | ||
224 | int (*target) (struct cpufreq_policy *policy, /* Deprecated */ | 230 | int (*target) (struct cpufreq_policy *policy, /* Deprecated */ |
225 | unsigned int target_freq, | 231 | unsigned int target_freq, |
226 | unsigned int relation); | 232 | unsigned int relation); |
227 | int (*target_index) (struct cpufreq_policy *policy, | 233 | int (*target_index) (struct cpufreq_policy *policy, |
228 | unsigned int index); | 234 | unsigned int index); |
235 | /* | ||
236 | * Only for drivers with target_index() and CPUFREQ_ASYNC_NOTIFICATION | ||
237 | * unset. | ||
238 | * | ||
239 | * get_intermediate should return a stable intermediate frequency | ||
240 | * platform wants to switch to and target_intermediate() should set CPU | ||
241 | * to to that frequency, before jumping to the frequency corresponding | ||
242 | * to 'index'. Core will take care of sending notifications and driver | ||
243 | * doesn't have to handle them in target_intermediate() or | ||
244 | * target_index(). | ||
245 | * | ||
246 | * Drivers can return '0' from get_intermediate() in case they don't | ||
247 | * wish to switch to intermediate frequency for some target frequency. | ||
248 | * In that case core will directly call ->target_index(). | ||
249 | */ | ||
250 | unsigned int (*get_intermediate)(struct cpufreq_policy *policy, | ||
251 | unsigned int index); | ||
252 | int (*target_intermediate)(struct cpufreq_policy *policy, | ||
253 | unsigned int index); | ||
229 | 254 | ||
230 | /* should be defined, if possible */ | 255 | /* should be defined, if possible */ |
231 | unsigned int (*get) (unsigned int cpu); | 256 | unsigned int (*get) (unsigned int cpu); |
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index d08e4d2a9b92..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 |
@@ -600,7 +608,7 @@ static inline int cpulist_scnprintf(char *buf, int len, | |||
600 | static inline int cpumask_parse(const char *buf, struct cpumask *dstp) | 608 | static inline int cpumask_parse(const char *buf, struct cpumask *dstp) |
601 | { | 609 | { |
602 | char *nl = strchr(buf, '\n'); | 610 | char *nl = strchr(buf, '\n'); |
603 | int len = nl ? nl - buf : strlen(buf); | 611 | unsigned int len = nl ? (unsigned int)(nl - buf) : strlen(buf); |
604 | 612 | ||
605 | return bitmap_parse(buf, len, cpumask_bits(dstp), nr_cpumask_bits); | 613 | return bitmap_parse(buf, len, cpumask_bits(dstp), nr_cpumask_bits); |
606 | } | 614 | } |
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/dell-led.h b/include/linux/dell-led.h new file mode 100644 index 000000000000..7009b8bec77b --- /dev/null +++ b/include/linux/dell-led.h | |||
@@ -0,0 +1,10 @@ | |||
1 | #ifndef __DELL_LED_H__ | ||
2 | #define __DELL_LED_H__ | ||
3 | |||
4 | enum { | ||
5 | DELL_LED_MICMUTE, | ||
6 | }; | ||
7 | |||
8 | int dell_app_wmi_led_set(int whichled, int on); | ||
9 | |||
10 | #endif | ||
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index 63da56ed9796..e1707de043ae 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h | |||
@@ -115,12 +115,6 @@ typedef int (*dm_busy_fn) (struct dm_target *ti); | |||
115 | 115 | ||
116 | void dm_error(const char *message); | 116 | void dm_error(const char *message); |
117 | 117 | ||
118 | /* | ||
119 | * Combine device limits. | ||
120 | */ | ||
121 | int dm_set_device_limits(struct dm_target *ti, struct dm_dev *dev, | ||
122 | sector_t start, sector_t len, void *data); | ||
123 | |||
124 | struct dm_dev { | 118 | struct dm_dev { |
125 | struct block_device *bdev; | 119 | struct block_device *bdev; |
126 | fmode_t mode; | 120 | fmode_t mode; |
@@ -132,7 +126,7 @@ struct dm_dev { | |||
132 | * are opened/closed correctly. | 126 | * are opened/closed correctly. |
133 | */ | 127 | */ |
134 | int dm_get_device(struct dm_target *ti, const char *path, fmode_t mode, | 128 | int dm_get_device(struct dm_target *ti, const char *path, fmode_t mode, |
135 | struct dm_dev **result); | 129 | struct dm_dev **result); |
136 | void dm_put_device(struct dm_target *ti, struct dm_dev *d); | 130 | void dm_put_device(struct dm_target *ti, struct dm_dev *d); |
137 | 131 | ||
138 | /* | 132 | /* |
@@ -291,6 +285,7 @@ struct dm_target_io { | |||
291 | struct dm_io *io; | 285 | struct dm_io *io; |
292 | struct dm_target *ti; | 286 | struct dm_target *ti; |
293 | unsigned target_bio_nr; | 287 | unsigned target_bio_nr; |
288 | unsigned *len_ptr; | ||
294 | struct bio clone; | 289 | struct bio clone; |
295 | }; | 290 | }; |
296 | 291 | ||
@@ -401,6 +396,7 @@ int dm_copy_name_and_uuid(struct mapped_device *md, char *name, char *uuid); | |||
401 | struct gendisk *dm_disk(struct mapped_device *md); | 396 | struct gendisk *dm_disk(struct mapped_device *md); |
402 | int dm_suspended(struct dm_target *ti); | 397 | int dm_suspended(struct dm_target *ti); |
403 | int dm_noflush_suspending(struct dm_target *ti); | 398 | int dm_noflush_suspending(struct dm_target *ti); |
399 | void dm_accept_partial_bio(struct bio *bio, unsigned n_sectors); | ||
404 | union map_info *dm_get_rq_mapinfo(struct request *rq); | 400 | union map_info *dm_get_rq_mapinfo(struct request *rq); |
405 | 401 | ||
406 | struct queue_limits *dm_get_queue_limits(struct mapped_device *md); | 402 | struct queue_limits *dm_get_queue_limits(struct mapped_device *md); |
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/fs.h b/include/linux/fs.h index c3f46e499dd0..338e6f758c6d 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -128,6 +128,10 @@ typedef void (dio_iodone_t)(struct kiocb *iocb, loff_t offset, | |||
128 | #define FMODE_ATOMIC_POS ((__force fmode_t)0x8000) | 128 | #define FMODE_ATOMIC_POS ((__force fmode_t)0x8000) |
129 | /* Write access to underlying fs */ | 129 | /* Write access to underlying fs */ |
130 | #define FMODE_WRITER ((__force fmode_t)0x10000) | 130 | #define FMODE_WRITER ((__force fmode_t)0x10000) |
131 | /* Has read method(s) */ | ||
132 | #define FMODE_CAN_READ ((__force fmode_t)0x20000) | ||
133 | /* Has write method(s) */ | ||
134 | #define FMODE_CAN_WRITE ((__force fmode_t)0x40000) | ||
131 | 135 | ||
132 | /* File was opened by fanotify and shouldn't generate fanotify events */ | 136 | /* File was opened by fanotify and shouldn't generate fanotify events */ |
133 | #define FMODE_NONOTIFY ((__force fmode_t)0x1000000) | 137 | #define FMODE_NONOTIFY ((__force fmode_t)0x1000000) |
@@ -343,8 +347,7 @@ struct address_space_operations { | |||
343 | void (*invalidatepage) (struct page *, unsigned int, unsigned int); | 347 | void (*invalidatepage) (struct page *, unsigned int, unsigned int); |
344 | int (*releasepage) (struct page *, gfp_t); | 348 | int (*releasepage) (struct page *, gfp_t); |
345 | void (*freepage)(struct page *); | 349 | void (*freepage)(struct page *); |
346 | ssize_t (*direct_IO)(int, struct kiocb *, const struct iovec *iov, | 350 | ssize_t (*direct_IO)(int, struct kiocb *, struct iov_iter *iter, loff_t offset); |
347 | loff_t offset, unsigned long nr_segs); | ||
348 | int (*get_xip_mem)(struct address_space *, pgoff_t, int, | 351 | int (*get_xip_mem)(struct address_space *, pgoff_t, int, |
349 | void **, unsigned long *); | 352 | void **, unsigned long *); |
350 | /* | 353 | /* |
@@ -1448,6 +1451,8 @@ struct block_device_operations; | |||
1448 | #define HAVE_COMPAT_IOCTL 1 | 1451 | #define HAVE_COMPAT_IOCTL 1 |
1449 | #define HAVE_UNLOCKED_IOCTL 1 | 1452 | #define HAVE_UNLOCKED_IOCTL 1 |
1450 | 1453 | ||
1454 | struct iov_iter; | ||
1455 | |||
1451 | struct file_operations { | 1456 | struct file_operations { |
1452 | struct module *owner; | 1457 | struct module *owner; |
1453 | loff_t (*llseek) (struct file *, loff_t, int); | 1458 | loff_t (*llseek) (struct file *, loff_t, int); |
@@ -1455,6 +1460,8 @@ struct file_operations { | |||
1455 | ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *); | 1460 | ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *); |
1456 | ssize_t (*aio_read) (struct kiocb *, const struct iovec *, unsigned long, loff_t); | 1461 | ssize_t (*aio_read) (struct kiocb *, const struct iovec *, unsigned long, loff_t); |
1457 | ssize_t (*aio_write) (struct kiocb *, const struct iovec *, unsigned long, loff_t); | 1462 | ssize_t (*aio_write) (struct kiocb *, const struct iovec *, unsigned long, loff_t); |
1463 | ssize_t (*read_iter) (struct kiocb *, struct iov_iter *); | ||
1464 | ssize_t (*write_iter) (struct kiocb *, struct iov_iter *); | ||
1458 | int (*iterate) (struct file *, struct dir_context *); | 1465 | int (*iterate) (struct file *, struct dir_context *); |
1459 | unsigned int (*poll) (struct file *, struct poll_table_struct *); | 1466 | unsigned int (*poll) (struct file *, struct poll_table_struct *); |
1460 | long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); | 1467 | long (*unlocked_ioctl) (struct file *, unsigned int, unsigned long); |
@@ -2404,20 +2411,18 @@ extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *); | |||
2404 | extern int generic_file_remap_pages(struct vm_area_struct *, unsigned long addr, | 2411 | extern int generic_file_remap_pages(struct vm_area_struct *, unsigned long addr, |
2405 | unsigned long size, pgoff_t pgoff); | 2412 | unsigned long size, pgoff_t pgoff); |
2406 | int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk); | 2413 | int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk); |
2407 | extern ssize_t generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t); | 2414 | extern ssize_t generic_file_read_iter(struct kiocb *, struct iov_iter *); |
2408 | extern ssize_t __generic_file_aio_write(struct kiocb *, const struct iovec *, unsigned long); | 2415 | extern ssize_t __generic_file_write_iter(struct kiocb *, struct iov_iter *); |
2409 | extern ssize_t generic_file_aio_write(struct kiocb *, const struct iovec *, unsigned long, loff_t); | 2416 | extern ssize_t generic_file_write_iter(struct kiocb *, struct iov_iter *); |
2410 | extern ssize_t generic_file_direct_write(struct kiocb *, const struct iovec *, | 2417 | extern ssize_t generic_file_direct_write(struct kiocb *, struct iov_iter *, loff_t); |
2411 | unsigned long *, loff_t, size_t, size_t); | ||
2412 | extern ssize_t generic_perform_write(struct file *, struct iov_iter *, loff_t); | 2418 | extern ssize_t generic_perform_write(struct file *, struct iov_iter *, loff_t); |
2413 | extern ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos); | 2419 | extern ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos); |
2414 | extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos); | 2420 | extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos); |
2415 | extern int generic_segment_checks(const struct iovec *iov, | 2421 | extern ssize_t new_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos); |
2416 | unsigned long *nr_segs, size_t *count, int access_flags); | 2422 | extern ssize_t new_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos); |
2417 | 2423 | ||
2418 | /* fs/block_dev.c */ | 2424 | /* fs/block_dev.c */ |
2419 | extern ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov, | 2425 | extern ssize_t blkdev_write_iter(struct kiocb *iocb, struct iov_iter *from); |
2420 | unsigned long nr_segs, loff_t pos); | ||
2421 | extern int blkdev_fsync(struct file *filp, loff_t start, loff_t end, | 2426 | extern int blkdev_fsync(struct file *filp, loff_t start, loff_t end, |
2422 | int datasync); | 2427 | int datasync); |
2423 | extern void block_sync_page(struct page *page); | 2428 | extern void block_sync_page(struct page *page); |
@@ -2427,7 +2432,7 @@ extern ssize_t generic_file_splice_read(struct file *, loff_t *, | |||
2427 | struct pipe_inode_info *, size_t, unsigned int); | 2432 | struct pipe_inode_info *, size_t, unsigned int); |
2428 | extern ssize_t default_file_splice_read(struct file *, loff_t *, | 2433 | extern ssize_t default_file_splice_read(struct file *, loff_t *, |
2429 | struct pipe_inode_info *, size_t, unsigned int); | 2434 | struct pipe_inode_info *, size_t, unsigned int); |
2430 | extern ssize_t generic_file_splice_write(struct pipe_inode_info *, | 2435 | extern ssize_t iter_file_splice_write(struct pipe_inode_info *, |
2431 | struct file *, loff_t *, size_t, unsigned int); | 2436 | struct file *, loff_t *, size_t, unsigned int); |
2432 | extern ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe, | 2437 | extern ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe, |
2433 | struct file *out, loff_t *, size_t len, unsigned int flags); | 2438 | struct file *out, loff_t *, size_t len, unsigned int flags); |
@@ -2477,16 +2482,16 @@ enum { | |||
2477 | void dio_end_io(struct bio *bio, int error); | 2482 | void dio_end_io(struct bio *bio, int error); |
2478 | 2483 | ||
2479 | ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, | 2484 | ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, |
2480 | struct block_device *bdev, const struct iovec *iov, loff_t offset, | 2485 | struct block_device *bdev, struct iov_iter *iter, loff_t offset, |
2481 | unsigned long nr_segs, get_block_t get_block, dio_iodone_t end_io, | 2486 | get_block_t get_block, dio_iodone_t end_io, |
2482 | dio_submit_t submit_io, int flags); | 2487 | dio_submit_t submit_io, int flags); |
2483 | 2488 | ||
2484 | static inline ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb, | 2489 | static inline ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb, |
2485 | struct inode *inode, const struct iovec *iov, loff_t offset, | 2490 | struct inode *inode, struct iov_iter *iter, loff_t offset, |
2486 | unsigned long nr_segs, get_block_t get_block) | 2491 | get_block_t get_block) |
2487 | { | 2492 | { |
2488 | return __blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, iov, | 2493 | return __blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, iter, |
2489 | offset, nr_segs, get_block, NULL, NULL, | 2494 | offset, get_block, NULL, NULL, |
2490 | DIO_LOCKING | DIO_SKIP_HOLES); | 2495 | DIO_LOCKING | DIO_SKIP_HOLES); |
2491 | } | 2496 | } |
2492 | #endif | 2497 | #endif |
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h index d2b16704624c..8cfb50f38529 100644 --- a/include/linux/i2c/twl.h +++ b/include/linux/i2c/twl.h | |||
@@ -498,7 +498,10 @@ static inline int twl6030_mmc_card_detect(struct device *dev, int slot) | |||
498 | #define RES_GRP_ALL 0x7 /* All resource groups */ | 498 | #define RES_GRP_ALL 0x7 /* All resource groups */ |
499 | 499 | ||
500 | #define RES_TYPE2_R0 0x0 | 500 | #define RES_TYPE2_R0 0x0 |
501 | #define RES_TYPE2_R1 0x1 | ||
502 | #define RES_TYPE2_R2 0x2 | ||
501 | 503 | ||
504 | #define RES_TYPE_R0 0x0 | ||
502 | #define RES_TYPE_ALL 0x7 | 505 | #define RES_TYPE_ALL 0x7 |
503 | 506 | ||
504 | /* Resource states */ | 507 | /* Resource states */ |
@@ -671,6 +674,7 @@ struct twl4030_power_data { | |||
671 | struct twl4030_script **scripts; | 674 | struct twl4030_script **scripts; |
672 | unsigned num; | 675 | unsigned num; |
673 | struct twl4030_resconfig *resource_config; | 676 | struct twl4030_resconfig *resource_config; |
677 | struct twl4030_resconfig *board_config; | ||
674 | #define TWL4030_RESCONFIG_UNDEF ((u8)-1) | 678 | #define TWL4030_RESCONFIG_UNDEF ((u8)-1) |
675 | bool use_poweroff; /* Board is wired for TWL poweroff */ | 679 | bool use_poweroff; /* Board is wired for TWL poweroff */ |
676 | }; | 680 | }; |
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/kprobes.h b/include/linux/kprobes.h index 7bd2ad01e39c..f7296e57d614 100644 --- a/include/linux/kprobes.h +++ b/include/linux/kprobes.h | |||
@@ -205,10 +205,10 @@ struct kretprobe_blackpoint { | |||
205 | void *addr; | 205 | void *addr; |
206 | }; | 206 | }; |
207 | 207 | ||
208 | struct kprobe_blackpoint { | 208 | struct kprobe_blacklist_entry { |
209 | const char *name; | 209 | struct list_head list; |
210 | unsigned long start_addr; | 210 | unsigned long start_addr; |
211 | unsigned long range; | 211 | unsigned long end_addr; |
212 | }; | 212 | }; |
213 | 213 | ||
214 | #ifdef CONFIG_KPROBES | 214 | #ifdef CONFIG_KPROBES |
@@ -265,6 +265,7 @@ extern void arch_disarm_kprobe(struct kprobe *p); | |||
265 | extern int arch_init_kprobes(void); | 265 | extern int arch_init_kprobes(void); |
266 | extern void show_registers(struct pt_regs *regs); | 266 | extern void show_registers(struct pt_regs *regs); |
267 | extern void kprobes_inc_nmissed_count(struct kprobe *p); | 267 | extern void kprobes_inc_nmissed_count(struct kprobe *p); |
268 | extern bool arch_within_kprobe_blacklist(unsigned long addr); | ||
268 | 269 | ||
269 | struct kprobe_insn_cache { | 270 | struct kprobe_insn_cache { |
270 | struct mutex mutex; | 271 | struct mutex mutex; |
@@ -476,4 +477,18 @@ static inline int enable_jprobe(struct jprobe *jp) | |||
476 | return enable_kprobe(&jp->kp); | 477 | return enable_kprobe(&jp->kp); |
477 | } | 478 | } |
478 | 479 | ||
480 | #ifdef CONFIG_KPROBES | ||
481 | /* | ||
482 | * Blacklist ganerating macro. Specify functions which is not probed | ||
483 | * by using this macro. | ||
484 | */ | ||
485 | #define __NOKPROBE_SYMBOL(fname) \ | ||
486 | static unsigned long __used \ | ||
487 | __attribute__((section("_kprobe_blacklist"))) \ | ||
488 | _kbl_addr_##fname = (unsigned long)fname; | ||
489 | #define NOKPROBE_SYMBOL(fname) __NOKPROBE_SYMBOL(fname) | ||
490 | #else | ||
491 | #define NOKPROBE_SYMBOL(fname) | ||
492 | #endif | ||
493 | |||
479 | #endif /* _LINUX_KPROBES_H */ | 494 | #endif /* _LINUX_KPROBES_H */ |
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/kvm_host.h b/include/linux/kvm_host.h index 970c68197c69..ec4e3bd83d47 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -586,7 +586,7 @@ void mark_page_dirty(struct kvm *kvm, gfn_t gfn); | |||
586 | 586 | ||
587 | void kvm_vcpu_block(struct kvm_vcpu *vcpu); | 587 | void kvm_vcpu_block(struct kvm_vcpu *vcpu); |
588 | void kvm_vcpu_kick(struct kvm_vcpu *vcpu); | 588 | void kvm_vcpu_kick(struct kvm_vcpu *vcpu); |
589 | bool kvm_vcpu_yield_to(struct kvm_vcpu *target); | 589 | int kvm_vcpu_yield_to(struct kvm_vcpu *target); |
590 | void kvm_vcpu_on_spin(struct kvm_vcpu *vcpu); | 590 | void kvm_vcpu_on_spin(struct kvm_vcpu *vcpu); |
591 | void kvm_load_guest_fpu(struct kvm_vcpu *vcpu); | 591 | void kvm_load_guest_fpu(struct kvm_vcpu *vcpu); |
592 | void kvm_put_guest_fpu(struct kvm_vcpu *vcpu); | 592 | void kvm_put_guest_fpu(struct kvm_vcpu *vcpu); |
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/moduleparam.h b/include/linux/moduleparam.h index 204a67743804..b1990c5524e1 100644 --- a/include/linux/moduleparam.h +++ b/include/linux/moduleparam.h | |||
@@ -321,7 +321,7 @@ extern bool parameq(const char *name1, const char *name2); | |||
321 | extern bool parameqn(const char *name1, const char *name2, size_t n); | 321 | extern bool parameqn(const char *name1, const char *name2, size_t n); |
322 | 322 | ||
323 | /* Called on module insert or kernel boot */ | 323 | /* Called on module insert or kernel boot */ |
324 | extern int parse_args(const char *name, | 324 | extern char *parse_args(const char *name, |
325 | char *args, | 325 | char *args, |
326 | const struct kernel_param *params, | 326 | const struct kernel_param *params, |
327 | unsigned num, | 327 | unsigned num, |
diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h index c26d0ec2ef3a..d99800cbdcf3 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,9 +113,11 @@ 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) |
120 | #define NETIF_F_GSO_UDP_TUNNEL_CSUM __NETIF_F(GSO_UDP_TUNNEL_CSUM) | ||
117 | #define NETIF_F_GSO_MPLS __NETIF_F(GSO_MPLS) | 121 | #define NETIF_F_GSO_MPLS __NETIF_F(GSO_MPLS) |
118 | #define NETIF_F_HW_VLAN_STAG_FILTER __NETIF_F(HW_VLAN_STAG_FILTER) | 122 | #define NETIF_F_HW_VLAN_STAG_FILTER __NETIF_F(HW_VLAN_STAG_FILTER) |
119 | #define NETIF_F_HW_VLAN_STAG_RX __NETIF_F(HW_VLAN_STAG_RX) | 123 | #define NETIF_F_HW_VLAN_STAG_RX __NETIF_F(HW_VLAN_STAG_RX) |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 6c1ae9fd9505..66f9a04ec270 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 | { |
@@ -3218,6 +3305,13 @@ static inline bool net_gso_ok(netdev_features_t features, int gso_type) | |||
3218 | BUILD_BUG_ON(SKB_GSO_TCP_ECN != (NETIF_F_TSO_ECN >> NETIF_F_GSO_SHIFT)); | 3305 | BUILD_BUG_ON(SKB_GSO_TCP_ECN != (NETIF_F_TSO_ECN >> NETIF_F_GSO_SHIFT)); |
3219 | BUILD_BUG_ON(SKB_GSO_TCPV6 != (NETIF_F_TSO6 >> NETIF_F_GSO_SHIFT)); | 3306 | BUILD_BUG_ON(SKB_GSO_TCPV6 != (NETIF_F_TSO6 >> NETIF_F_GSO_SHIFT)); |
3220 | BUILD_BUG_ON(SKB_GSO_FCOE != (NETIF_F_FSO >> NETIF_F_GSO_SHIFT)); | 3307 | BUILD_BUG_ON(SKB_GSO_FCOE != (NETIF_F_FSO >> NETIF_F_GSO_SHIFT)); |
3308 | BUILD_BUG_ON(SKB_GSO_GRE != (NETIF_F_GSO_GRE >> NETIF_F_GSO_SHIFT)); | ||
3309 | BUILD_BUG_ON(SKB_GSO_GRE_CSUM != (NETIF_F_GSO_GRE_CSUM >> NETIF_F_GSO_SHIFT)); | ||
3310 | BUILD_BUG_ON(SKB_GSO_IPIP != (NETIF_F_GSO_IPIP >> NETIF_F_GSO_SHIFT)); | ||
3311 | BUILD_BUG_ON(SKB_GSO_SIT != (NETIF_F_GSO_SIT >> NETIF_F_GSO_SHIFT)); | ||
3312 | BUILD_BUG_ON(SKB_GSO_UDP_TUNNEL != (NETIF_F_GSO_UDP_TUNNEL >> NETIF_F_GSO_SHIFT)); | ||
3313 | BUILD_BUG_ON(SKB_GSO_UDP_TUNNEL_CSUM != (NETIF_F_GSO_UDP_TUNNEL_CSUM >> NETIF_F_GSO_SHIFT)); | ||
3314 | BUILD_BUG_ON(SKB_GSO_MPLS != (NETIF_F_GSO_MPLS >> NETIF_F_GSO_SHIFT)); | ||
3221 | 3315 | ||
3222 | return (features & feature) == feature; | 3316 | return (features & feature) == feature; |
3223 | } | 3317 | } |
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/nfs_fs.h b/include/linux/nfs_fs.h index 919576b8e2cf..e30f6059ecd6 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -459,13 +459,12 @@ extern int nfs3_removexattr (struct dentry *, const char *name); | |||
459 | /* | 459 | /* |
460 | * linux/fs/nfs/direct.c | 460 | * linux/fs/nfs/direct.c |
461 | */ | 461 | */ |
462 | extern ssize_t nfs_direct_IO(int, struct kiocb *, const struct iovec *, loff_t, | 462 | extern ssize_t nfs_direct_IO(int, struct kiocb *, struct iov_iter *, loff_t); |
463 | unsigned long); | ||
464 | extern ssize_t nfs_file_direct_read(struct kiocb *iocb, | 463 | extern ssize_t nfs_file_direct_read(struct kiocb *iocb, |
465 | const struct iovec *iov, unsigned long nr_segs, | 464 | struct iov_iter *iter, |
466 | loff_t pos, bool uio); | 465 | loff_t pos, bool uio); |
467 | extern ssize_t nfs_file_direct_write(struct kiocb *iocb, | 466 | extern ssize_t nfs_file_direct_write(struct kiocb *iocb, |
468 | const struct iovec *iov, unsigned long nr_segs, | 467 | struct iov_iter *iter, |
469 | loff_t pos, bool uio); | 468 | loff_t pos, bool uio); |
470 | 469 | ||
471 | /* | 470 | /* |
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/nvme.h b/include/linux/nvme.h index a50173ca1d72..2bf403195c09 100644 --- a/include/linux/nvme.h +++ b/include/linux/nvme.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * Definitions for the NVM Express interface | 2 | * Definitions for the NVM Express interface |
3 | * Copyright (c) 2011-2013, Intel Corporation. | 3 | * Copyright (c) 2011-2014, Intel Corporation. |
4 | * | 4 | * |
5 | * This program is free software; you can redistribute it and/or modify it | 5 | * This program is free software; you can redistribute it and/or modify it |
6 | * under the terms and conditions of the GNU General Public License, | 6 | * under the terms and conditions of the GNU General Public License, |
@@ -10,10 +10,6 @@ | |||
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | 10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | 11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
12 | * more details. | 12 | * more details. |
13 | * | ||
14 | * You should have received a copy of the GNU General Public License along with | ||
15 | * this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
17 | */ | 13 | */ |
18 | 14 | ||
19 | #ifndef _LINUX_NVME_H | 15 | #ifndef _LINUX_NVME_H |
@@ -66,8 +62,8 @@ enum { | |||
66 | 62 | ||
67 | #define NVME_VS(major, minor) (major << 16 | minor) | 63 | #define NVME_VS(major, minor) (major << 16 | minor) |
68 | 64 | ||
69 | extern unsigned char io_timeout; | 65 | extern unsigned char nvme_io_timeout; |
70 | #define NVME_IO_TIMEOUT (io_timeout * HZ) | 66 | #define NVME_IO_TIMEOUT (nvme_io_timeout * HZ) |
71 | 67 | ||
72 | /* | 68 | /* |
73 | * Represents an NVM Express device. Each nvme_dev is a PCI function. | 69 | * Represents an NVM Express device. Each nvme_dev is a PCI function. |
@@ -94,7 +90,7 @@ struct nvme_dev { | |||
94 | struct miscdevice miscdev; | 90 | struct miscdevice miscdev; |
95 | work_func_t reset_workfn; | 91 | work_func_t reset_workfn; |
96 | struct work_struct reset_work; | 92 | struct work_struct reset_work; |
97 | struct notifier_block nb; | 93 | struct work_struct cpu_work; |
98 | char name[12]; | 94 | char name[12]; |
99 | char serial[20]; | 95 | char serial[20]; |
100 | char model[40]; | 96 | char model[40]; |
@@ -103,6 +99,7 @@ struct nvme_dev { | |||
103 | u32 stripe_size; | 99 | u32 stripe_size; |
104 | u16 oncs; | 100 | u16 oncs; |
105 | u16 abort_limit; | 101 | u16 abort_limit; |
102 | u8 vwc; | ||
106 | u8 initialized; | 103 | u8 initialized; |
107 | }; | 104 | }; |
108 | 105 | ||
@@ -159,7 +156,6 @@ struct nvme_iod *nvme_map_user_pages(struct nvme_dev *dev, int write, | |||
159 | void nvme_unmap_user_pages(struct nvme_dev *dev, int write, | 156 | void nvme_unmap_user_pages(struct nvme_dev *dev, int write, |
160 | struct nvme_iod *iod); | 157 | struct nvme_iod *iod); |
161 | int nvme_submit_io_cmd(struct nvme_dev *, struct nvme_command *, u32 *); | 158 | int nvme_submit_io_cmd(struct nvme_dev *, struct nvme_command *, u32 *); |
162 | int nvme_submit_flush_data(struct nvme_queue *nvmeq, struct nvme_ns *ns); | ||
163 | int nvme_submit_admin_cmd(struct nvme_dev *, struct nvme_command *, | 159 | int nvme_submit_admin_cmd(struct nvme_dev *, struct nvme_command *, |
164 | u32 *result); | 160 | u32 *result); |
165 | int nvme_identify(struct nvme_dev *, unsigned nsid, unsigned cns, | 161 | int nvme_identify(struct nvme_dev *, unsigned nsid, unsigned cns, |
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/pci.h b/include/linux/pci.h index 71d9673c1b2c..466bcd111d85 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -164,13 +164,17 @@ enum pci_dev_flags { | |||
164 | /* INTX_DISABLE in PCI_COMMAND register disables MSI | 164 | /* INTX_DISABLE in PCI_COMMAND register disables MSI |
165 | * generation too. | 165 | * generation too. |
166 | */ | 166 | */ |
167 | PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG = (__force pci_dev_flags_t) 1, | 167 | PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG = (__force pci_dev_flags_t) (1 << 0), |
168 | /* Device configuration is irrevocably lost if disabled into D3 */ | 168 | /* Device configuration is irrevocably lost if disabled into D3 */ |
169 | PCI_DEV_FLAGS_NO_D3 = (__force pci_dev_flags_t) 2, | 169 | PCI_DEV_FLAGS_NO_D3 = (__force pci_dev_flags_t) (1 << 1), |
170 | /* Provide indication device is assigned by a Virtual Machine Manager */ | 170 | /* Provide indication device is assigned by a Virtual Machine Manager */ |
171 | PCI_DEV_FLAGS_ASSIGNED = (__force pci_dev_flags_t) 4, | 171 | PCI_DEV_FLAGS_ASSIGNED = (__force pci_dev_flags_t) (1 << 2), |
172 | /* Flag for quirk use to store if quirk-specific ACS is enabled */ | 172 | /* Flag for quirk use to store if quirk-specific ACS is enabled */ |
173 | PCI_DEV_FLAGS_ACS_ENABLED_QUIRK = (__force pci_dev_flags_t) 8, | 173 | PCI_DEV_FLAGS_ACS_ENABLED_QUIRK = (__force pci_dev_flags_t) (1 << 3), |
174 | /* Flag to indicate the device uses dma_alias_devfn */ | ||
175 | PCI_DEV_FLAGS_DMA_ALIAS_DEVFN = (__force pci_dev_flags_t) (1 << 4), | ||
176 | /* Use a PCIe-to-PCI bridge alias even if !pci_is_pcie */ | ||
177 | PCI_DEV_FLAG_PCIE_BRIDGE_ALIAS = (__force pci_dev_flags_t) (1 << 5), | ||
174 | }; | 178 | }; |
175 | 179 | ||
176 | enum pci_irq_reroute_variant { | 180 | enum pci_irq_reroute_variant { |
@@ -268,6 +272,7 @@ struct pci_dev { | |||
268 | u8 rom_base_reg; /* which config register controls the ROM */ | 272 | u8 rom_base_reg; /* which config register controls the ROM */ |
269 | u8 pin; /* which interrupt pin this device uses */ | 273 | u8 pin; /* which interrupt pin this device uses */ |
270 | u16 pcie_flags_reg; /* cached PCIe Capabilities Register */ | 274 | u16 pcie_flags_reg; /* cached PCIe Capabilities Register */ |
275 | u8 dma_alias_devfn;/* devfn of DMA alias, if any */ | ||
271 | 276 | ||
272 | struct pci_driver *driver; /* which driver has allocated this device */ | 277 | struct pci_driver *driver; /* which driver has allocated this device */ |
273 | u64 dma_mask; /* Mask of the bits of bus address this | 278 | u64 dma_mask; /* Mask of the bits of bus address this |
@@ -1809,6 +1814,10 @@ static inline struct eeh_dev *pci_dev_to_eeh_dev(struct pci_dev *pdev) | |||
1809 | } | 1814 | } |
1810 | #endif | 1815 | #endif |
1811 | 1816 | ||
1817 | int pci_for_each_dma_alias(struct pci_dev *pdev, | ||
1818 | int (*fn)(struct pci_dev *pdev, | ||
1819 | u16 alias, void *data), void *data); | ||
1820 | |||
1812 | /** | 1821 | /** |
1813 | * pci_find_upstream_pcie_bridge - find upstream PCIe-to-PCI bridge of a device | 1822 | * pci_find_upstream_pcie_bridge - find upstream PCIe-to-PCI bridge of a device |
1814 | * @pdev: the PCI device | 1823 | * @pdev: the PCI device |
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index a9209118d80f..707617a8c0f6 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -167,6 +167,11 @@ struct perf_event; | |||
167 | #define PERF_EVENT_TXN 0x1 | 167 | #define PERF_EVENT_TXN 0x1 |
168 | 168 | ||
169 | /** | 169 | /** |
170 | * pmu::capabilities flags | ||
171 | */ | ||
172 | #define PERF_PMU_CAP_NO_INTERRUPT 0x01 | ||
173 | |||
174 | /** | ||
170 | * struct pmu - generic performance monitoring unit | 175 | * struct pmu - generic performance monitoring unit |
171 | */ | 176 | */ |
172 | struct pmu { | 177 | struct pmu { |
@@ -178,6 +183,11 @@ struct pmu { | |||
178 | const char *name; | 183 | const char *name; |
179 | int type; | 184 | int type; |
180 | 185 | ||
186 | /* | ||
187 | * various common per-pmu feature flags | ||
188 | */ | ||
189 | int capabilities; | ||
190 | |||
181 | int * __percpu pmu_disable_count; | 191 | int * __percpu pmu_disable_count; |
182 | struct perf_cpu_context * __percpu pmu_cpu_context; | 192 | struct perf_cpu_context * __percpu pmu_cpu_context; |
183 | int task_ctx_nr; | 193 | int task_ctx_nr; |
@@ -696,7 +706,8 @@ extern struct perf_guest_info_callbacks *perf_guest_cbs; | |||
696 | extern int perf_register_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks); | 706 | extern int perf_register_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks); |
697 | extern int perf_unregister_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks); | 707 | extern int perf_unregister_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks); |
698 | 708 | ||
699 | extern void perf_event_comm(struct task_struct *tsk); | 709 | extern void perf_event_exec(void); |
710 | extern void perf_event_comm(struct task_struct *tsk, bool exec); | ||
700 | extern void perf_event_fork(struct task_struct *tsk); | 711 | extern void perf_event_fork(struct task_struct *tsk); |
701 | 712 | ||
702 | /* Callchains */ | 713 | /* Callchains */ |
@@ -773,7 +784,7 @@ extern void perf_event_enable(struct perf_event *event); | |||
773 | extern void perf_event_disable(struct perf_event *event); | 784 | extern void perf_event_disable(struct perf_event *event); |
774 | extern int __perf_event_disable(void *info); | 785 | extern int __perf_event_disable(void *info); |
775 | extern void perf_event_task_tick(void); | 786 | extern void perf_event_task_tick(void); |
776 | #else | 787 | #else /* !CONFIG_PERF_EVENTS: */ |
777 | static inline void | 788 | static inline void |
778 | perf_event_task_sched_in(struct task_struct *prev, | 789 | perf_event_task_sched_in(struct task_struct *prev, |
779 | struct task_struct *task) { } | 790 | struct task_struct *task) { } |
@@ -803,7 +814,8 @@ static inline int perf_unregister_guest_info_callbacks | |||
803 | (struct perf_guest_info_callbacks *callbacks) { return 0; } | 814 | (struct perf_guest_info_callbacks *callbacks) { return 0; } |
804 | 815 | ||
805 | static inline void perf_event_mmap(struct vm_area_struct *vma) { } | 816 | static inline void perf_event_mmap(struct vm_area_struct *vma) { } |
806 | static inline void perf_event_comm(struct task_struct *tsk) { } | 817 | static inline void perf_event_exec(void) { } |
818 | static inline void perf_event_comm(struct task_struct *tsk, bool exec) { } | ||
807 | static inline void perf_event_fork(struct task_struct *tsk) { } | 819 | static inline void perf_event_fork(struct task_struct *tsk) { } |
808 | static inline void perf_event_init(void) { } | 820 | static inline void perf_event_init(void) { } |
809 | static inline int perf_swevent_get_recursion_context(void) { return -1; } | 821 | static inline int perf_swevent_get_recursion_context(void) { return -1; } |
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/leds-pca9685.h b/include/linux/platform_data/leds-pca9685.h deleted file mode 100644 index 778e9e4249cc..000000000000 --- a/include/linux/platform_data/leds-pca9685.h +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright 2013 Maximilian Güntner <maximilian.guentner@gmail.com> | ||
3 | * | ||
4 | * This file is subject to the terms and conditions of version 2 of | ||
5 | * the GNU General Public License. See the file COPYING in the main | ||
6 | * directory of this archive for more details. | ||
7 | * | ||
8 | * Based on leds-pca963x.h by Peter Meerwald <p.meerwald@bct-electronic.com> | ||
9 | * | ||
10 | * LED driver for the NXP PCA9685 PWM chip | ||
11 | * | ||
12 | */ | ||
13 | |||
14 | #ifndef __LINUX_PCA9685_H | ||
15 | #define __LINUX_PCA9685_H | ||
16 | |||
17 | #include <linux/leds.h> | ||
18 | |||
19 | enum pca9685_outdrv { | ||
20 | PCA9685_OPEN_DRAIN, | ||
21 | PCA9685_TOTEM_POLE, | ||
22 | }; | ||
23 | |||
24 | enum pca9685_inverted { | ||
25 | PCA9685_NOT_INVERTED, | ||
26 | PCA9685_INVERTED, | ||
27 | }; | ||
28 | |||
29 | struct pca9685_platform_data { | ||
30 | struct led_platform_data leds; | ||
31 | enum pca9685_outdrv outdrv; | ||
32 | enum pca9685_inverted inverted; | ||
33 | }; | ||
34 | |||
35 | #endif /* __LINUX_PCA9685_H */ | ||
diff --git a/include/linux/platform_data/pwm-renesas-tpu.h b/include/linux/platform_data/pwm-renesas-tpu.h deleted file mode 100644 index a7220b10ddab..000000000000 --- a/include/linux/platform_data/pwm-renesas-tpu.h +++ /dev/null | |||
@@ -1,16 +0,0 @@ | |||
1 | #ifndef __PWM_RENESAS_TPU_H__ | ||
2 | #define __PWM_RENESAS_TPU_H__ | ||
3 | |||
4 | #include <linux/pwm.h> | ||
5 | |||
6 | #define TPU_CHANNEL_MAX 4 | ||
7 | |||
8 | struct tpu_pwm_channel_data { | ||
9 | enum pwm_polarity polarity; | ||
10 | }; | ||
11 | |||
12 | struct tpu_pwm_platform_data { | ||
13 | struct tpu_pwm_channel_data channels[TPU_CHANNEL_MAX]; | ||
14 | }; | ||
15 | |||
16 | #endif /* __PWM_RENESAS_TPU_H__ */ | ||
diff --git a/include/linux/platform_data/shtc1.h b/include/linux/platform_data/shtc1.h new file mode 100644 index 000000000000..7b8c353f7dc8 --- /dev/null +++ b/include/linux/platform_data/shtc1.h | |||
@@ -0,0 +1,23 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2014 Sensirion AG, Switzerland | ||
3 | * Author: Johannes Winkelmann <johannes.winkelmann@sensirion.com> | ||
4 | * | ||
5 | * This software is licensed under the terms of the GNU General Public | ||
6 | * License version 2, as published by the Free Software Foundation, and | ||
7 | * may be copied, distributed, and modified under those terms. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | */ | ||
15 | |||
16 | #ifndef __SHTC1_H_ | ||
17 | #define __SHTC1_H_ | ||
18 | |||
19 | struct shtc1_platform_data { | ||
20 | bool blocking_io; | ||
21 | bool high_precision; | ||
22 | }; | ||
23 | #endif /* __SHTC1_H_ */ | ||
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/profile.h b/include/linux/profile.h index aaad3861beb8..b537a25ffa17 100644 --- a/include/linux/profile.h +++ b/include/linux/profile.h | |||
@@ -44,6 +44,7 @@ extern int prof_on __read_mostly; | |||
44 | int profile_init(void); | 44 | int profile_init(void); |
45 | int profile_setup(char *str); | 45 | int profile_setup(char *str); |
46 | void profile_tick(int type); | 46 | void profile_tick(int type); |
47 | int setup_profiling_timer(unsigned int multiplier); | ||
47 | 48 | ||
48 | /* | 49 | /* |
49 | * Add multiple profiler hits to a given address: | 50 | * Add multiple profiler hits to a given address: |
diff --git a/include/linux/pwm.h b/include/linux/pwm.h index 4717f54051cb..e90628cac8fa 100644 --- a/include/linux/pwm.h +++ b/include/linux/pwm.h | |||
@@ -274,14 +274,18 @@ struct pwm_lookup { | |||
274 | unsigned int index; | 274 | unsigned int index; |
275 | const char *dev_id; | 275 | const char *dev_id; |
276 | const char *con_id; | 276 | const char *con_id; |
277 | unsigned int period; | ||
278 | enum pwm_polarity polarity; | ||
277 | }; | 279 | }; |
278 | 280 | ||
279 | #define PWM_LOOKUP(_provider, _index, _dev_id, _con_id) \ | 281 | #define PWM_LOOKUP(_provider, _index, _dev_id, _con_id, _period, _polarity) \ |
280 | { \ | 282 | { \ |
281 | .provider = _provider, \ | 283 | .provider = _provider, \ |
282 | .index = _index, \ | 284 | .index = _index, \ |
283 | .dev_id = _dev_id, \ | 285 | .dev_id = _dev_id, \ |
284 | .con_id = _con_id, \ | 286 | .con_id = _con_id, \ |
287 | .period = _period, \ | ||
288 | .polarity = _polarity \ | ||
285 | } | 289 | } |
286 | 290 | ||
287 | #if IS_ENABLED(CONFIG_PWM) | 291 | #if IS_ENABLED(CONFIG_PWM) |
diff --git a/include/linux/pwm_backlight.h b/include/linux/pwm_backlight.h index 2de2e275b2cb..efdd9227a49c 100644 --- a/include/linux/pwm_backlight.h +++ b/include/linux/pwm_backlight.h | |||
@@ -6,9 +6,6 @@ | |||
6 | 6 | ||
7 | #include <linux/backlight.h> | 7 | #include <linux/backlight.h> |
8 | 8 | ||
9 | /* TODO: convert to gpiod_*() API once it has been merged */ | ||
10 | #define PWM_BACKLIGHT_GPIO_ACTIVE_LOW (1 << 0) | ||
11 | |||
12 | struct platform_pwm_backlight_data { | 9 | struct platform_pwm_backlight_data { |
13 | int pwm_id; | 10 | int pwm_id; |
14 | unsigned int max_brightness; | 11 | unsigned int max_brightness; |
@@ -16,8 +13,8 @@ struct platform_pwm_backlight_data { | |||
16 | unsigned int lth_brightness; | 13 | unsigned int lth_brightness; |
17 | unsigned int pwm_period_ns; | 14 | unsigned int pwm_period_ns; |
18 | unsigned int *levels; | 15 | unsigned int *levels; |
16 | /* TODO remove once all users are switched to gpiod_* API */ | ||
19 | int enable_gpio; | 17 | int enable_gpio; |
20 | unsigned long enable_gpio_flags; | ||
21 | int (*init)(struct device *dev); | 18 | int (*init)(struct device *dev); |
22 | int (*notify)(struct device *dev, int brightness); | 19 | int (*notify)(struct device *dev, int brightness); |
23 | void (*notify_after)(struct device *dev, int brightness); | 20 | void (*notify_after)(struct device *dev, int brightness); |
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h index a2d9d81038d1..14ec18d5e18b 100644 --- a/include/linux/regulator/consumer.h +++ b/include/linux/regulator/consumer.h | |||
@@ -395,6 +395,11 @@ static inline void regulator_bulk_free(int num_consumers, | |||
395 | { | 395 | { |
396 | } | 396 | } |
397 | 397 | ||
398 | static inline int regulator_can_change_voltage(struct regulator *regulator) | ||
399 | { | ||
400 | return 0; | ||
401 | } | ||
402 | |||
398 | static inline int regulator_set_voltage(struct regulator *regulator, | 403 | static inline int regulator_set_voltage(struct regulator *regulator, |
399 | int min_uV, int max_uV) | 404 | int min_uV, int max_uV) |
400 | { | 405 | { |
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/ring_buffer.h b/include/linux/ring_buffer.h index d69cf637a15a..49a4d6f59108 100644 --- a/include/linux/ring_buffer.h +++ b/include/linux/ring_buffer.h | |||
@@ -97,7 +97,7 @@ __ring_buffer_alloc(unsigned long size, unsigned flags, struct lock_class_key *k | |||
97 | __ring_buffer_alloc((size), (flags), &__key); \ | 97 | __ring_buffer_alloc((size), (flags), &__key); \ |
98 | }) | 98 | }) |
99 | 99 | ||
100 | void ring_buffer_wait(struct ring_buffer *buffer, int cpu); | 100 | int ring_buffer_wait(struct ring_buffer *buffer, int cpu); |
101 | int ring_buffer_poll_wait(struct ring_buffer *buffer, int cpu, | 101 | int ring_buffer_poll_wait(struct ring_buffer *buffer, int cpu, |
102 | struct file *filp, poll_table *poll_table); | 102 | struct file *filp, poll_table *poll_table); |
103 | 103 | ||
diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h index 03f3b05e8ec1..8d79708146aa 100644 --- a/include/linux/rwsem.h +++ b/include/linux/rwsem.h | |||
@@ -16,6 +16,7 @@ | |||
16 | 16 | ||
17 | #include <linux/atomic.h> | 17 | #include <linux/atomic.h> |
18 | 18 | ||
19 | struct optimistic_spin_queue; | ||
19 | struct rw_semaphore; | 20 | struct rw_semaphore; |
20 | 21 | ||
21 | #ifdef CONFIG_RWSEM_GENERIC_SPINLOCK | 22 | #ifdef CONFIG_RWSEM_GENERIC_SPINLOCK |
@@ -23,9 +24,17 @@ struct rw_semaphore; | |||
23 | #else | 24 | #else |
24 | /* All arch specific implementations share the same struct */ | 25 | /* All arch specific implementations share the same struct */ |
25 | struct rw_semaphore { | 26 | struct rw_semaphore { |
26 | long count; | 27 | long count; |
27 | raw_spinlock_t wait_lock; | 28 | raw_spinlock_t wait_lock; |
28 | struct list_head wait_list; | 29 | struct list_head wait_list; |
30 | #ifdef CONFIG_SMP | ||
31 | /* | ||
32 | * Write owner. Used as a speculative check to see | ||
33 | * if the owner is running on the cpu. | ||
34 | */ | ||
35 | struct task_struct *owner; | ||
36 | struct optimistic_spin_queue *osq; /* spinner MCS lock */ | ||
37 | #endif | ||
29 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 38 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
30 | struct lockdep_map dep_map; | 39 | struct lockdep_map dep_map; |
31 | #endif | 40 | #endif |
@@ -55,11 +64,21 @@ static inline int rwsem_is_locked(struct rw_semaphore *sem) | |||
55 | # define __RWSEM_DEP_MAP_INIT(lockname) | 64 | # define __RWSEM_DEP_MAP_INIT(lockname) |
56 | #endif | 65 | #endif |
57 | 66 | ||
67 | #if defined(CONFIG_SMP) && !defined(CONFIG_RWSEM_GENERIC_SPINLOCK) | ||
68 | #define __RWSEM_INITIALIZER(name) \ | ||
69 | { RWSEM_UNLOCKED_VALUE, \ | ||
70 | __RAW_SPIN_LOCK_UNLOCKED(name.wait_lock), \ | ||
71 | LIST_HEAD_INIT((name).wait_list), \ | ||
72 | NULL, /* owner */ \ | ||
73 | NULL /* mcs lock */ \ | ||
74 | __RWSEM_DEP_MAP_INIT(name) } | ||
75 | #else | ||
58 | #define __RWSEM_INITIALIZER(name) \ | 76 | #define __RWSEM_INITIALIZER(name) \ |
59 | { RWSEM_UNLOCKED_VALUE, \ | 77 | { RWSEM_UNLOCKED_VALUE, \ |
60 | __RAW_SPIN_LOCK_UNLOCKED(name.wait_lock), \ | 78 | __RAW_SPIN_LOCK_UNLOCKED(name.wait_lock), \ |
61 | LIST_HEAD_INIT((name).wait_list) \ | 79 | LIST_HEAD_INIT((name).wait_list) \ |
62 | __RWSEM_DEP_MAP_INIT(name) } | 80 | __RWSEM_DEP_MAP_INIT(name) } |
81 | #endif | ||
63 | 82 | ||
64 | #define DECLARE_RWSEM(name) \ | 83 | #define DECLARE_RWSEM(name) \ |
65 | struct rw_semaphore name = __RWSEM_INITIALIZER(name) | 84 | struct rw_semaphore name = __RWSEM_INITIALIZER(name) |
diff --git a/include/linux/sched.h b/include/linux/sched.h index ea74596014a2..306f4f0c987a 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -847,10 +847,10 @@ enum cpu_idle_type { | |||
847 | }; | 847 | }; |
848 | 848 | ||
849 | /* | 849 | /* |
850 | * Increase resolution of cpu_power calculations | 850 | * Increase resolution of cpu_capacity calculations |
851 | */ | 851 | */ |
852 | #define SCHED_POWER_SHIFT 10 | 852 | #define SCHED_CAPACITY_SHIFT 10 |
853 | #define SCHED_POWER_SCALE (1L << SCHED_POWER_SHIFT) | 853 | #define SCHED_CAPACITY_SCALE (1L << SCHED_CAPACITY_SHIFT) |
854 | 854 | ||
855 | /* | 855 | /* |
856 | * sched-domains (multiprocessor balancing) declarations: | 856 | * sched-domains (multiprocessor balancing) declarations: |
@@ -862,7 +862,7 @@ enum cpu_idle_type { | |||
862 | #define SD_BALANCE_FORK 0x0008 /* Balance on fork, clone */ | 862 | #define SD_BALANCE_FORK 0x0008 /* Balance on fork, clone */ |
863 | #define SD_BALANCE_WAKE 0x0010 /* Balance on wakeup */ | 863 | #define SD_BALANCE_WAKE 0x0010 /* Balance on wakeup */ |
864 | #define SD_WAKE_AFFINE 0x0020 /* Wake task to waking CPU */ | 864 | #define SD_WAKE_AFFINE 0x0020 /* Wake task to waking CPU */ |
865 | #define SD_SHARE_CPUPOWER 0x0080 /* Domain members share cpu power */ | 865 | #define SD_SHARE_CPUCAPACITY 0x0080 /* Domain members share cpu power */ |
866 | #define SD_SHARE_POWERDOMAIN 0x0100 /* Domain members share power domain */ | 866 | #define SD_SHARE_POWERDOMAIN 0x0100 /* Domain members share power domain */ |
867 | #define SD_SHARE_PKG_RESOURCES 0x0200 /* Domain members share cpu pkg resources */ | 867 | #define SD_SHARE_PKG_RESOURCES 0x0200 /* Domain members share cpu pkg resources */ |
868 | #define SD_SERIALIZE 0x0400 /* Only a single load balancing instance */ | 868 | #define SD_SERIALIZE 0x0400 /* Only a single load balancing instance */ |
@@ -874,7 +874,7 @@ enum cpu_idle_type { | |||
874 | #ifdef CONFIG_SCHED_SMT | 874 | #ifdef CONFIG_SCHED_SMT |
875 | static inline const int cpu_smt_flags(void) | 875 | static inline const int cpu_smt_flags(void) |
876 | { | 876 | { |
877 | return SD_SHARE_CPUPOWER | SD_SHARE_PKG_RESOURCES; | 877 | return SD_SHARE_CPUCAPACITY | SD_SHARE_PKG_RESOURCES; |
878 | } | 878 | } |
879 | #endif | 879 | #endif |
880 | 880 | ||
@@ -1006,7 +1006,7 @@ typedef const int (*sched_domain_flags_f)(void); | |||
1006 | struct sd_data { | 1006 | struct sd_data { |
1007 | struct sched_domain **__percpu sd; | 1007 | struct sched_domain **__percpu sd; |
1008 | struct sched_group **__percpu sg; | 1008 | struct sched_group **__percpu sg; |
1009 | struct sched_group_power **__percpu sgp; | 1009 | struct sched_group_capacity **__percpu sgc; |
1010 | }; | 1010 | }; |
1011 | 1011 | ||
1012 | struct sched_domain_topology_level { | 1012 | struct sched_domain_topology_level { |
@@ -2173,7 +2173,7 @@ static inline void sched_autogroup_fork(struct signal_struct *sig) { } | |||
2173 | static inline void sched_autogroup_exit(struct signal_struct *sig) { } | 2173 | static inline void sched_autogroup_exit(struct signal_struct *sig) { } |
2174 | #endif | 2174 | #endif |
2175 | 2175 | ||
2176 | extern bool yield_to(struct task_struct *p, bool preempt); | 2176 | extern int yield_to(struct task_struct *p, bool preempt); |
2177 | extern void set_user_nice(struct task_struct *p, long nice); | 2177 | extern void set_user_nice(struct task_struct *p, long nice); |
2178 | extern int task_prio(const struct task_struct *p); | 2178 | extern int task_prio(const struct task_struct *p); |
2179 | /** | 2179 | /** |
@@ -2421,7 +2421,11 @@ extern long do_fork(unsigned long, unsigned long, unsigned long, int __user *, i | |||
2421 | struct task_struct *fork_idle(int); | 2421 | struct task_struct *fork_idle(int); |
2422 | extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); | 2422 | extern pid_t kernel_thread(int (*fn)(void *), void *arg, unsigned long flags); |
2423 | 2423 | ||
2424 | extern void set_task_comm(struct task_struct *tsk, const char *from); | 2424 | extern void __set_task_comm(struct task_struct *tsk, const char *from, bool exec); |
2425 | static inline void set_task_comm(struct task_struct *tsk, const char *from) | ||
2426 | { | ||
2427 | __set_task_comm(tsk, from, false); | ||
2428 | } | ||
2425 | extern char *get_task_comm(char *to, struct task_struct *tsk); | 2429 | extern char *get_task_comm(char *to, struct task_struct *tsk); |
2426 | 2430 | ||
2427 | #ifdef CONFIG_SMP | 2431 | #ifdef CONFIG_SMP |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 08074a810164..ec89301ada41 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -338,13 +338,18 @@ enum { | |||
338 | 338 | ||
339 | SKB_GSO_GRE = 1 << 6, | 339 | SKB_GSO_GRE = 1 << 6, |
340 | 340 | ||
341 | SKB_GSO_IPIP = 1 << 7, | 341 | SKB_GSO_GRE_CSUM = 1 << 7, |
342 | 342 | ||
343 | SKB_GSO_SIT = 1 << 8, | 343 | SKB_GSO_IPIP = 1 << 8, |
344 | 344 | ||
345 | SKB_GSO_UDP_TUNNEL = 1 << 9, | 345 | SKB_GSO_SIT = 1 << 9, |
346 | |||
347 | SKB_GSO_UDP_TUNNEL = 1 << 10, | ||
348 | |||
349 | SKB_GSO_UDP_TUNNEL_CSUM = 1 << 11, | ||
350 | |||
351 | SKB_GSO_MPLS = 1 << 12, | ||
346 | 352 | ||
347 | SKB_GSO_MPLS = 1 << 10, | ||
348 | }; | 353 | }; |
349 | 354 | ||
350 | #if BITS_PER_LONG > 32 | 355 | #if BITS_PER_LONG > 32 |
@@ -426,7 +431,7 @@ static inline u32 skb_mstamp_us_delta(const struct skb_mstamp *t1, | |||
426 | * @csum_start: Offset from skb->head where checksumming should start | 431 | * @csum_start: Offset from skb->head where checksumming should start |
427 | * @csum_offset: Offset from csum_start where checksum should be stored | 432 | * @csum_offset: Offset from csum_start where checksum should be stored |
428 | * @priority: Packet queueing priority | 433 | * @priority: Packet queueing priority |
429 | * @local_df: allow local fragmentation | 434 | * @ignore_df: allow local fragmentation |
430 | * @cloned: Head may be cloned (check refcnt to be sure) | 435 | * @cloned: Head may be cloned (check refcnt to be sure) |
431 | * @ip_summed: Driver fed us an IP checksum | 436 | * @ip_summed: Driver fed us an IP checksum |
432 | * @nohdr: Payload reference only, must not modify header | 437 | * @nohdr: Payload reference only, must not modify header |
@@ -514,7 +519,7 @@ struct sk_buff { | |||
514 | }; | 519 | }; |
515 | __u32 priority; | 520 | __u32 priority; |
516 | kmemcheck_bitfield_begin(flags1); | 521 | kmemcheck_bitfield_begin(flags1); |
517 | __u8 local_df:1, | 522 | __u8 ignore_df:1, |
518 | cloned:1, | 523 | cloned:1, |
519 | ip_summed:2, | 524 | ip_summed:2, |
520 | nohdr:1, | 525 | nohdr:1, |
@@ -567,7 +572,10 @@ struct sk_buff { | |||
567 | * headers if needed | 572 | * headers if needed |
568 | */ | 573 | */ |
569 | __u8 encapsulation:1; | 574 | __u8 encapsulation:1; |
570 | /* 6/8 bit hole (depending on ndisc_nodetype presence) */ | 575 | __u8 encap_hdr_csum:1; |
576 | __u8 csum_valid:1; | ||
577 | __u8 csum_complete_sw:1; | ||
578 | /* 3/5 bit hole (depending on ndisc_nodetype presence) */ | ||
571 | kmemcheck_bitfield_end(flags2); | 579 | kmemcheck_bitfield_end(flags2); |
572 | 580 | ||
573 | #if defined CONFIG_NET_DMA || defined CONFIG_NET_RX_BUSY_POLL | 581 | #if defined CONFIG_NET_DMA || defined CONFIG_NET_RX_BUSY_POLL |
@@ -739,7 +747,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); | 747 | 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); | 748 | 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); | 749 | 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); | 750 | struct sk_buff *__pskb_copy_fclone(struct sk_buff *skb, int headroom, |
751 | gfp_t gfp_mask, bool fclone); | ||
752 | static inline struct sk_buff *__pskb_copy(struct sk_buff *skb, int headroom, | ||
753 | gfp_t gfp_mask) | ||
754 | { | ||
755 | return __pskb_copy_fclone(skb, headroom, gfp_mask, false); | ||
756 | } | ||
743 | 757 | ||
744 | int pskb_expand_head(struct sk_buff *skb, int nhead, int ntail, gfp_t gfp_mask); | 758 | 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, | 759 | struct sk_buff *skb_realloc_headroom(struct sk_buff *skb, |
@@ -1840,6 +1854,18 @@ static inline int pskb_network_may_pull(struct sk_buff *skb, unsigned int len) | |||
1840 | return pskb_may_pull(skb, skb_network_offset(skb) + len); | 1854 | return pskb_may_pull(skb, skb_network_offset(skb) + len); |
1841 | } | 1855 | } |
1842 | 1856 | ||
1857 | static inline void skb_pop_rcv_encapsulation(struct sk_buff *skb) | ||
1858 | { | ||
1859 | /* Only continue with checksum unnecessary if device indicated | ||
1860 | * it is valid across encapsulation (skb->encapsulation was set). | ||
1861 | */ | ||
1862 | if (skb->ip_summed == CHECKSUM_UNNECESSARY && !skb->encapsulation) | ||
1863 | skb->ip_summed = CHECKSUM_NONE; | ||
1864 | |||
1865 | skb->encapsulation = 0; | ||
1866 | skb->csum_valid = 0; | ||
1867 | } | ||
1868 | |||
1843 | /* | 1869 | /* |
1844 | * CPUs often take a performance hit when accessing unaligned memory | 1870 | * CPUs often take a performance hit when accessing unaligned memory |
1845 | * locations. The actual performance hit varies, it can be small if the | 1871 | * locations. The actual performance hit varies, it can be small if the |
@@ -2233,6 +2259,14 @@ static inline struct sk_buff *pskb_copy(struct sk_buff *skb, | |||
2233 | return __pskb_copy(skb, skb_headroom(skb), gfp_mask); | 2259 | return __pskb_copy(skb, skb_headroom(skb), gfp_mask); |
2234 | } | 2260 | } |
2235 | 2261 | ||
2262 | |||
2263 | static inline struct sk_buff *pskb_copy_for_clone(struct sk_buff *skb, | ||
2264 | gfp_t gfp_mask) | ||
2265 | { | ||
2266 | return __pskb_copy_fclone(skb, skb_headroom(skb), gfp_mask, true); | ||
2267 | } | ||
2268 | |||
2269 | |||
2236 | /** | 2270 | /** |
2237 | * skb_clone_writable - is the header of a clone writable | 2271 | * skb_clone_writable - is the header of a clone writable |
2238 | * @skb: buffer to check | 2272 | * @skb: buffer to check |
@@ -2716,7 +2750,7 @@ __sum16 __skb_checksum_complete(struct sk_buff *skb); | |||
2716 | 2750 | ||
2717 | static inline int skb_csum_unnecessary(const struct sk_buff *skb) | 2751 | static inline int skb_csum_unnecessary(const struct sk_buff *skb) |
2718 | { | 2752 | { |
2719 | return skb->ip_summed & CHECKSUM_UNNECESSARY; | 2753 | return ((skb->ip_summed & CHECKSUM_UNNECESSARY) || skb->csum_valid); |
2720 | } | 2754 | } |
2721 | 2755 | ||
2722 | /** | 2756 | /** |
@@ -2741,6 +2775,103 @@ static inline __sum16 skb_checksum_complete(struct sk_buff *skb) | |||
2741 | 0 : __skb_checksum_complete(skb); | 2775 | 0 : __skb_checksum_complete(skb); |
2742 | } | 2776 | } |
2743 | 2777 | ||
2778 | /* Check if we need to perform checksum complete validation. | ||
2779 | * | ||
2780 | * Returns true if checksum complete is needed, false otherwise | ||
2781 | * (either checksum is unnecessary or zero checksum is allowed). | ||
2782 | */ | ||
2783 | static inline bool __skb_checksum_validate_needed(struct sk_buff *skb, | ||
2784 | bool zero_okay, | ||
2785 | __sum16 check) | ||
2786 | { | ||
2787 | if (skb_csum_unnecessary(skb) || (zero_okay && !check)) { | ||
2788 | skb->csum_valid = 1; | ||
2789 | return false; | ||
2790 | } | ||
2791 | |||
2792 | return true; | ||
2793 | } | ||
2794 | |||
2795 | /* For small packets <= CHECKSUM_BREAK peform checksum complete directly | ||
2796 | * in checksum_init. | ||
2797 | */ | ||
2798 | #define CHECKSUM_BREAK 76 | ||
2799 | |||
2800 | /* Validate (init) checksum based on checksum complete. | ||
2801 | * | ||
2802 | * Return values: | ||
2803 | * 0: checksum is validated or try to in skb_checksum_complete. In the latter | ||
2804 | * case the ip_summed will not be CHECKSUM_UNNECESSARY and the pseudo | ||
2805 | * checksum is stored in skb->csum for use in __skb_checksum_complete | ||
2806 | * non-zero: value of invalid checksum | ||
2807 | * | ||
2808 | */ | ||
2809 | static inline __sum16 __skb_checksum_validate_complete(struct sk_buff *skb, | ||
2810 | bool complete, | ||
2811 | __wsum psum) | ||
2812 | { | ||
2813 | if (skb->ip_summed == CHECKSUM_COMPLETE) { | ||
2814 | if (!csum_fold(csum_add(psum, skb->csum))) { | ||
2815 | skb->csum_valid = 1; | ||
2816 | return 0; | ||
2817 | } | ||
2818 | } | ||
2819 | |||
2820 | skb->csum = psum; | ||
2821 | |||
2822 | if (complete || skb->len <= CHECKSUM_BREAK) { | ||
2823 | __sum16 csum; | ||
2824 | |||
2825 | csum = __skb_checksum_complete(skb); | ||
2826 | skb->csum_valid = !csum; | ||
2827 | return csum; | ||
2828 | } | ||
2829 | |||
2830 | return 0; | ||
2831 | } | ||
2832 | |||
2833 | static inline __wsum null_compute_pseudo(struct sk_buff *skb, int proto) | ||
2834 | { | ||
2835 | return 0; | ||
2836 | } | ||
2837 | |||
2838 | /* Perform checksum validate (init). Note that this is a macro since we only | ||
2839 | * want to calculate the pseudo header which is an input function if necessary. | ||
2840 | * First we try to validate without any computation (checksum unnecessary) and | ||
2841 | * then calculate based on checksum complete calling the function to compute | ||
2842 | * pseudo header. | ||
2843 | * | ||
2844 | * Return values: | ||
2845 | * 0: checksum is validated or try to in skb_checksum_complete | ||
2846 | * non-zero: value of invalid checksum | ||
2847 | */ | ||
2848 | #define __skb_checksum_validate(skb, proto, complete, \ | ||
2849 | zero_okay, check, compute_pseudo) \ | ||
2850 | ({ \ | ||
2851 | __sum16 __ret = 0; \ | ||
2852 | skb->csum_valid = 0; \ | ||
2853 | if (__skb_checksum_validate_needed(skb, zero_okay, check)) \ | ||
2854 | __ret = __skb_checksum_validate_complete(skb, \ | ||
2855 | complete, compute_pseudo(skb, proto)); \ | ||
2856 | __ret; \ | ||
2857 | }) | ||
2858 | |||
2859 | #define skb_checksum_init(skb, proto, compute_pseudo) \ | ||
2860 | __skb_checksum_validate(skb, proto, false, false, 0, compute_pseudo) | ||
2861 | |||
2862 | #define skb_checksum_init_zero_check(skb, proto, check, compute_pseudo) \ | ||
2863 | __skb_checksum_validate(skb, proto, false, true, check, compute_pseudo) | ||
2864 | |||
2865 | #define skb_checksum_validate(skb, proto, compute_pseudo) \ | ||
2866 | __skb_checksum_validate(skb, proto, true, false, 0, compute_pseudo) | ||
2867 | |||
2868 | #define skb_checksum_validate_zero_check(skb, proto, check, \ | ||
2869 | compute_pseudo) \ | ||
2870 | __skb_checksum_validate_(skb, proto, true, true, check, compute_pseudo) | ||
2871 | |||
2872 | #define skb_checksum_simple_validate(skb) \ | ||
2873 | __skb_checksum_validate(skb, 0, true, false, 0, null_compute_pseudo) | ||
2874 | |||
2744 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | 2875 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) |
2745 | void nf_conntrack_destroy(struct nf_conntrack *nfct); | 2876 | void nf_conntrack_destroy(struct nf_conntrack *nfct); |
2746 | static inline void nf_conntrack_put(struct nf_conntrack *nfct) | 2877 | static inline void nf_conntrack_put(struct nf_conntrack *nfct) |
@@ -2895,6 +3026,7 @@ static inline struct sec_path *skb_sec_path(struct sk_buff *skb) | |||
2895 | struct skb_gso_cb { | 3026 | struct skb_gso_cb { |
2896 | int mac_offset; | 3027 | int mac_offset; |
2897 | int encap_level; | 3028 | int encap_level; |
3029 | __u16 csum_start; | ||
2898 | }; | 3030 | }; |
2899 | #define SKB_GSO_CB(skb) ((struct skb_gso_cb *)(skb)->cb) | 3031 | #define SKB_GSO_CB(skb) ((struct skb_gso_cb *)(skb)->cb) |
2900 | 3032 | ||
@@ -2919,6 +3051,28 @@ static inline int gso_pskb_expand_head(struct sk_buff *skb, int extra) | |||
2919 | return 0; | 3051 | return 0; |
2920 | } | 3052 | } |
2921 | 3053 | ||
3054 | /* Compute the checksum for a gso segment. First compute the checksum value | ||
3055 | * from the start of transport header to SKB_GSO_CB(skb)->csum_start, and | ||
3056 | * then add in skb->csum (checksum from csum_start to end of packet). | ||
3057 | * skb->csum and csum_start are then updated to reflect the checksum of the | ||
3058 | * resultant packet starting from the transport header-- the resultant checksum | ||
3059 | * is in the res argument (i.e. normally zero or ~ of checksum of a pseudo | ||
3060 | * header. | ||
3061 | */ | ||
3062 | static inline __sum16 gso_make_checksum(struct sk_buff *skb, __wsum res) | ||
3063 | { | ||
3064 | int plen = SKB_GSO_CB(skb)->csum_start - skb_headroom(skb) - | ||
3065 | skb_transport_offset(skb); | ||
3066 | __u16 csum; | ||
3067 | |||
3068 | csum = csum_fold(csum_partial(skb_transport_header(skb), | ||
3069 | plen, skb->csum)); | ||
3070 | skb->csum = res; | ||
3071 | SKB_GSO_CB(skb)->csum_start -= plen; | ||
3072 | |||
3073 | return csum; | ||
3074 | } | ||
3075 | |||
2922 | static inline bool skb_is_gso(const struct sk_buff *skb) | 3076 | static inline bool skb_is_gso(const struct sk_buff *skb) |
2923 | { | 3077 | { |
2924 | return skb_shinfo(skb)->gso_size; | 3078 | 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/splice.h b/include/linux/splice.h index 0e43906d2fda..da2751d3b93d 100644 --- a/include/linux/splice.h +++ b/include/linux/splice.h | |||
@@ -70,16 +70,6 @@ extern ssize_t splice_from_pipe(struct pipe_inode_info *, struct file *, | |||
70 | splice_actor *); | 70 | splice_actor *); |
71 | extern ssize_t __splice_from_pipe(struct pipe_inode_info *, | 71 | extern ssize_t __splice_from_pipe(struct pipe_inode_info *, |
72 | struct splice_desc *, splice_actor *); | 72 | struct splice_desc *, splice_actor *); |
73 | extern int splice_from_pipe_feed(struct pipe_inode_info *, struct splice_desc *, | ||
74 | splice_actor *); | ||
75 | extern int splice_from_pipe_next(struct pipe_inode_info *, | ||
76 | struct splice_desc *); | ||
77 | extern void splice_from_pipe_begin(struct splice_desc *); | ||
78 | extern void splice_from_pipe_end(struct pipe_inode_info *, | ||
79 | struct splice_desc *); | ||
80 | extern int pipe_to_file(struct pipe_inode_info *, struct pipe_buffer *, | ||
81 | struct splice_desc *); | ||
82 | |||
83 | extern ssize_t splice_to_pipe(struct pipe_inode_info *, | 73 | extern ssize_t splice_to_pipe(struct pipe_inode_info *, |
84 | struct splice_pipe_desc *); | 74 | struct splice_pipe_desc *); |
85 | extern ssize_t splice_direct_to_actor(struct file *, struct splice_desc *, | 75 | extern ssize_t splice_direct_to_actor(struct file *, struct splice_desc *, |
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/uio.h b/include/linux/uio.h index 199bcc34241b..e2231e47cec1 100644 --- a/include/linux/uio.h +++ b/include/linux/uio.h | |||
@@ -19,11 +19,21 @@ struct kvec { | |||
19 | size_t iov_len; | 19 | size_t iov_len; |
20 | }; | 20 | }; |
21 | 21 | ||
22 | enum { | ||
23 | ITER_IOVEC = 0, | ||
24 | ITER_KVEC = 2, | ||
25 | ITER_BVEC = 4, | ||
26 | }; | ||
27 | |||
22 | struct iov_iter { | 28 | struct iov_iter { |
23 | const struct iovec *iov; | 29 | int type; |
24 | unsigned long nr_segs; | ||
25 | size_t iov_offset; | 30 | size_t iov_offset; |
26 | size_t count; | 31 | size_t count; |
32 | union { | ||
33 | const struct iovec *iov; | ||
34 | const struct bio_vec *bvec; | ||
35 | }; | ||
36 | unsigned long nr_segs; | ||
27 | }; | 37 | }; |
28 | 38 | ||
29 | /* | 39 | /* |
@@ -53,6 +63,7 @@ static inline struct iovec iov_iter_iovec(const struct iov_iter *iter) | |||
53 | } | 63 | } |
54 | 64 | ||
55 | #define iov_for_each(iov, iter, start) \ | 65 | #define iov_for_each(iov, iter, start) \ |
66 | if (!((start).type & ITER_BVEC)) \ | ||
56 | for (iter = (start); \ | 67 | for (iter = (start); \ |
57 | (iter).count && \ | 68 | (iter).count && \ |
58 | ((iov = iov_iter_iovec(&(iter))), 1); \ | 69 | ((iov = iov_iter_iovec(&(iter))), 1); \ |
@@ -62,32 +73,44 @@ unsigned long iov_shorten(struct iovec *iov, unsigned long nr_segs, size_t to); | |||
62 | 73 | ||
63 | size_t iov_iter_copy_from_user_atomic(struct page *page, | 74 | size_t iov_iter_copy_from_user_atomic(struct page *page, |
64 | struct iov_iter *i, unsigned long offset, size_t bytes); | 75 | struct iov_iter *i, unsigned long offset, size_t bytes); |
65 | size_t iov_iter_copy_from_user(struct page *page, | ||
66 | struct iov_iter *i, unsigned long offset, size_t bytes); | ||
67 | void iov_iter_advance(struct iov_iter *i, size_t bytes); | 76 | void iov_iter_advance(struct iov_iter *i, size_t bytes); |
68 | int iov_iter_fault_in_readable(struct iov_iter *i, size_t bytes); | 77 | int iov_iter_fault_in_readable(struct iov_iter *i, size_t bytes); |
69 | size_t iov_iter_single_seg_count(const struct iov_iter *i); | 78 | size_t iov_iter_single_seg_count(const struct iov_iter *i); |
70 | size_t copy_page_to_iter(struct page *page, size_t offset, size_t bytes, | 79 | size_t copy_page_to_iter(struct page *page, size_t offset, size_t bytes, |
71 | struct iov_iter *i); | 80 | struct iov_iter *i); |
81 | size_t copy_page_from_iter(struct page *page, size_t offset, size_t bytes, | ||
82 | struct iov_iter *i); | ||
83 | unsigned long iov_iter_alignment(const struct iov_iter *i); | ||
84 | void iov_iter_init(struct iov_iter *i, int direction, const struct iovec *iov, | ||
85 | unsigned long nr_segs, size_t count); | ||
86 | ssize_t iov_iter_get_pages(struct iov_iter *i, struct page **pages, | ||
87 | size_t maxsize, size_t *start); | ||
88 | ssize_t iov_iter_get_pages_alloc(struct iov_iter *i, struct page ***pages, | ||
89 | size_t maxsize, size_t *start); | ||
90 | int iov_iter_npages(const struct iov_iter *i, int maxpages); | ||
72 | 91 | ||
73 | static inline void iov_iter_init(struct iov_iter *i, | 92 | static inline size_t iov_iter_count(struct iov_iter *i) |
74 | const struct iovec *iov, unsigned long nr_segs, | ||
75 | size_t count, size_t written) | ||
76 | { | 93 | { |
77 | i->iov = iov; | 94 | return i->count; |
78 | i->nr_segs = nr_segs; | 95 | } |
79 | i->iov_offset = 0; | ||
80 | i->count = count + written; | ||
81 | 96 | ||
82 | iov_iter_advance(i, written); | 97 | static inline void iov_iter_truncate(struct iov_iter *i, size_t count) |
98 | { | ||
99 | if (i->count > count) | ||
100 | i->count = count; | ||
83 | } | 101 | } |
84 | 102 | ||
85 | static inline size_t iov_iter_count(struct iov_iter *i) | 103 | /* |
104 | * reexpand a previously truncated iterator; count must be no more than how much | ||
105 | * we had shrunk it. | ||
106 | */ | ||
107 | static inline void iov_iter_reexpand(struct iov_iter *i, size_t count) | ||
86 | { | 108 | { |
87 | return i->count; | 109 | i->count = count; |
88 | } | 110 | } |
89 | 111 | ||
90 | int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len); | 112 | int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len); |
91 | int memcpy_toiovec(struct iovec *iov, unsigned char *kdata, int len); | 113 | int memcpy_toiovec(struct iovec *iov, unsigned char *kdata, int len); |
92 | 114 | ||
115 | |||
93 | #endif | 116 | #endif |
diff --git a/include/linux/uprobes.h b/include/linux/uprobes.h index c52f827ba6ce..4f844c6b03ee 100644 --- a/include/linux/uprobes.h +++ b/include/linux/uprobes.h | |||
@@ -103,6 +103,7 @@ extern int __weak set_orig_insn(struct arch_uprobe *aup, struct mm_struct *mm, u | |||
103 | extern bool __weak is_swbp_insn(uprobe_opcode_t *insn); | 103 | extern bool __weak is_swbp_insn(uprobe_opcode_t *insn); |
104 | extern bool __weak is_trap_insn(uprobe_opcode_t *insn); | 104 | extern bool __weak is_trap_insn(uprobe_opcode_t *insn); |
105 | extern unsigned long __weak uprobe_get_swbp_addr(struct pt_regs *regs); | 105 | extern unsigned long __weak uprobe_get_swbp_addr(struct pt_regs *regs); |
106 | extern unsigned long uprobe_get_trap_addr(struct pt_regs *regs); | ||
106 | extern int uprobe_write_opcode(struct mm_struct *mm, unsigned long vaddr, uprobe_opcode_t); | 107 | extern int uprobe_write_opcode(struct mm_struct *mm, unsigned long vaddr, uprobe_opcode_t); |
107 | extern int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *uc); | 108 | extern int uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *uc); |
108 | extern int uprobe_apply(struct inode *inode, loff_t offset, struct uprobe_consumer *uc, bool); | 109 | extern int uprobe_apply(struct inode *inode, loff_t offset, struct uprobe_consumer *uc, bool); |
@@ -133,6 +134,9 @@ extern void __weak arch_uprobe_copy_ixol(struct page *page, unsigned long vaddr, | |||
133 | #else /* !CONFIG_UPROBES */ | 134 | #else /* !CONFIG_UPROBES */ |
134 | struct uprobes_state { | 135 | struct uprobes_state { |
135 | }; | 136 | }; |
137 | |||
138 | #define uprobe_get_trap_addr(regs) instruction_pointer(regs) | ||
139 | |||
136 | static inline int | 140 | static inline int |
137 | uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *uc) | 141 | uprobe_register(struct inode *inode, loff_t offset, struct uprobe_consumer *uc) |
138 | { | 142 | { |
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); |
diff --git a/include/linux/virtio.h b/include/linux/virtio.h index e4abb84199be..b46671e28de2 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h | |||
@@ -106,6 +106,8 @@ static inline struct virtio_device *dev_to_virtio(struct device *_dev) | |||
106 | int register_virtio_device(struct virtio_device *dev); | 106 | int register_virtio_device(struct virtio_device *dev); |
107 | void unregister_virtio_device(struct virtio_device *dev); | 107 | void unregister_virtio_device(struct virtio_device *dev); |
108 | 108 | ||
109 | void virtio_break_device(struct virtio_device *dev); | ||
110 | |||
109 | /** | 111 | /** |
110 | * virtio_driver - operations for a virtio I/O driver | 112 | * virtio_driver - operations for a virtio I/O driver |
111 | * @driver: underlying device driver (populate name and owner). | 113 | * @driver: underlying device driver (populate name and owner). |
diff --git a/include/linux/virtio_scsi.h b/include/linux/virtio_scsi.h index 4195b97a3def..de429d1f4357 100644 --- a/include/linux/virtio_scsi.h +++ b/include/linux/virtio_scsi.h | |||
@@ -35,11 +35,23 @@ struct virtio_scsi_cmd_req { | |||
35 | u8 lun[8]; /* Logical Unit Number */ | 35 | u8 lun[8]; /* Logical Unit Number */ |
36 | u64 tag; /* Command identifier */ | 36 | u64 tag; /* Command identifier */ |
37 | u8 task_attr; /* Task attribute */ | 37 | u8 task_attr; /* Task attribute */ |
38 | u8 prio; | 38 | u8 prio; /* SAM command priority field */ |
39 | u8 crn; | 39 | u8 crn; |
40 | u8 cdb[VIRTIO_SCSI_CDB_SIZE]; | 40 | u8 cdb[VIRTIO_SCSI_CDB_SIZE]; |
41 | } __packed; | 41 | } __packed; |
42 | 42 | ||
43 | /* SCSI command request, followed by protection information */ | ||
44 | struct virtio_scsi_cmd_req_pi { | ||
45 | u8 lun[8]; /* Logical Unit Number */ | ||
46 | u64 tag; /* Command identifier */ | ||
47 | u8 task_attr; /* Task attribute */ | ||
48 | u8 prio; /* SAM command priority field */ | ||
49 | u8 crn; | ||
50 | u32 pi_bytesout; /* DataOUT PI Number of bytes */ | ||
51 | u32 pi_bytesin; /* DataIN PI Number of bytes */ | ||
52 | u8 cdb[VIRTIO_SCSI_CDB_SIZE]; | ||
53 | } __packed; | ||
54 | |||
43 | /* Response, followed by sense data and data-in */ | 55 | /* Response, followed by sense data and data-in */ |
44 | struct virtio_scsi_cmd_resp { | 56 | struct virtio_scsi_cmd_resp { |
45 | u32 sense_len; /* Sense data length */ | 57 | u32 sense_len; /* Sense data length */ |
@@ -97,6 +109,7 @@ struct virtio_scsi_config { | |||
97 | #define VIRTIO_SCSI_F_INOUT 0 | 109 | #define VIRTIO_SCSI_F_INOUT 0 |
98 | #define VIRTIO_SCSI_F_HOTPLUG 1 | 110 | #define VIRTIO_SCSI_F_HOTPLUG 1 |
99 | #define VIRTIO_SCSI_F_CHANGE 2 | 111 | #define VIRTIO_SCSI_F_CHANGE 2 |
112 | #define VIRTIO_SCSI_F_T10_PI 3 | ||
100 | 113 | ||
101 | /* Response codes */ | 114 | /* Response codes */ |
102 | #define VIRTIO_SCSI_S_OK 0 | 115 | #define VIRTIO_SCSI_S_OK 0 |