diff options
Diffstat (limited to 'include')
77 files changed, 1759 insertions, 534 deletions
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h index 4180eb78d575..93b1e091b1e9 100644 --- a/include/linux/bcma/bcma.h +++ b/include/linux/bcma/bcma.h | |||
@@ -157,6 +157,7 @@ struct bcma_host_ops { | |||
157 | 157 | ||
158 | /* Chip IDs of SoCs */ | 158 | /* Chip IDs of SoCs */ |
159 | #define BCMA_CHIP_ID_BCM4706 0x5300 | 159 | #define BCMA_CHIP_ID_BCM4706 0x5300 |
160 | #define BCMA_PKG_ID_BCM4706L 1 | ||
160 | #define BCMA_CHIP_ID_BCM4716 0x4716 | 161 | #define BCMA_CHIP_ID_BCM4716 0x4716 |
161 | #define BCMA_PKG_ID_BCM4716 8 | 162 | #define BCMA_PKG_ID_BCM4716 8 |
162 | #define BCMA_PKG_ID_BCM4717 9 | 163 | #define BCMA_PKG_ID_BCM4717 9 |
@@ -166,7 +167,11 @@ struct bcma_host_ops { | |||
166 | #define BCMA_CHIP_ID_BCM4749 0x4749 | 167 | #define BCMA_CHIP_ID_BCM4749 0x4749 |
167 | #define BCMA_CHIP_ID_BCM5356 0x5356 | 168 | #define BCMA_CHIP_ID_BCM5356 0x5356 |
168 | #define BCMA_CHIP_ID_BCM5357 0x5357 | 169 | #define BCMA_CHIP_ID_BCM5357 0x5357 |
170 | #define BCMA_PKG_ID_BCM5358 9 | ||
171 | #define BCMA_PKG_ID_BCM47186 10 | ||
172 | #define BCMA_PKG_ID_BCM5357 11 | ||
169 | #define BCMA_CHIP_ID_BCM53572 53572 | 173 | #define BCMA_CHIP_ID_BCM53572 53572 |
174 | #define BCMA_PKG_ID_BCM47188 9 | ||
170 | 175 | ||
171 | struct bcma_device { | 176 | struct bcma_device { |
172 | struct bcma_bus *bus; | 177 | struct bcma_bus *bus; |
@@ -251,7 +256,7 @@ struct bcma_bus { | |||
251 | u8 num; | 256 | u8 num; |
252 | 257 | ||
253 | struct bcma_drv_cc drv_cc; | 258 | struct bcma_drv_cc drv_cc; |
254 | struct bcma_drv_pci drv_pci; | 259 | struct bcma_drv_pci drv_pci[2]; |
255 | struct bcma_drv_mips drv_mips; | 260 | struct bcma_drv_mips drv_mips; |
256 | struct bcma_drv_gmac_cmn drv_gmac_cmn; | 261 | struct bcma_drv_gmac_cmn drv_gmac_cmn; |
257 | 262 | ||
diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h index 1cf1749440ac..145f3c56227f 100644 --- a/include/linux/bcma/bcma_driver_chipcommon.h +++ b/include/linux/bcma/bcma_driver_chipcommon.h | |||
@@ -510,6 +510,7 @@ struct bcma_chipcommon_pmu { | |||
510 | 510 | ||
511 | #ifdef CONFIG_BCMA_DRIVER_MIPS | 511 | #ifdef CONFIG_BCMA_DRIVER_MIPS |
512 | struct bcma_pflash { | 512 | struct bcma_pflash { |
513 | bool present; | ||
513 | u8 buswidth; | 514 | u8 buswidth; |
514 | u32 window; | 515 | u32 window; |
515 | u32 window_size; | 516 | u32 window_size; |
@@ -532,6 +533,7 @@ struct mtd_info; | |||
532 | 533 | ||
533 | struct bcma_nflash { | 534 | struct bcma_nflash { |
534 | bool present; | 535 | bool present; |
536 | bool boot; /* This is the flash the SoC boots from */ | ||
535 | 537 | ||
536 | struct mtd_info *mtd; | 538 | struct mtd_info *mtd; |
537 | }; | 539 | }; |
@@ -552,6 +554,7 @@ struct bcma_drv_cc { | |||
552 | u32 capabilities; | 554 | u32 capabilities; |
553 | u32 capabilities_ext; | 555 | u32 capabilities_ext; |
554 | u8 setup_done:1; | 556 | u8 setup_done:1; |
557 | u8 early_setup_done:1; | ||
555 | /* Fast Powerup Delay constant */ | 558 | /* Fast Powerup Delay constant */ |
556 | u16 fast_pwrup_delay; | 559 | u16 fast_pwrup_delay; |
557 | struct bcma_chipcommon_pmu pmu; | 560 | struct bcma_chipcommon_pmu pmu; |
@@ -583,6 +586,7 @@ struct bcma_drv_cc { | |||
583 | bcma_cc_write32(cc, offset, (bcma_cc_read32(cc, offset) & (mask)) | (set)) | 586 | bcma_cc_write32(cc, offset, (bcma_cc_read32(cc, offset) & (mask)) | (set)) |
584 | 587 | ||
585 | extern void bcma_core_chipcommon_init(struct bcma_drv_cc *cc); | 588 | extern void bcma_core_chipcommon_init(struct bcma_drv_cc *cc); |
589 | extern void bcma_core_chipcommon_early_init(struct bcma_drv_cc *cc); | ||
586 | 590 | ||
587 | extern void bcma_chipco_suspend(struct bcma_drv_cc *cc); | 591 | extern void bcma_chipco_suspend(struct bcma_drv_cc *cc); |
588 | extern void bcma_chipco_resume(struct bcma_drv_cc *cc); | 592 | extern void bcma_chipco_resume(struct bcma_drv_cc *cc); |
@@ -606,6 +610,7 @@ u32 bcma_chipco_gpio_polarity(struct bcma_drv_cc *cc, u32 mask, u32 value); | |||
606 | 610 | ||
607 | /* PMU support */ | 611 | /* PMU support */ |
608 | extern void bcma_pmu_init(struct bcma_drv_cc *cc); | 612 | extern void bcma_pmu_init(struct bcma_drv_cc *cc); |
613 | extern void bcma_pmu_early_init(struct bcma_drv_cc *cc); | ||
609 | 614 | ||
610 | extern void bcma_chipco_pll_write(struct bcma_drv_cc *cc, u32 offset, | 615 | extern void bcma_chipco_pll_write(struct bcma_drv_cc *cc, u32 offset, |
611 | u32 value); | 616 | u32 value); |
diff --git a/include/linux/bcma/bcma_driver_mips.h b/include/linux/bcma/bcma_driver_mips.h index c0043645cdcb..0baf8a56b794 100644 --- a/include/linux/bcma/bcma_driver_mips.h +++ b/include/linux/bcma/bcma_driver_mips.h | |||
@@ -35,13 +35,16 @@ struct bcma_device; | |||
35 | struct bcma_drv_mips { | 35 | struct bcma_drv_mips { |
36 | struct bcma_device *core; | 36 | struct bcma_device *core; |
37 | u8 setup_done:1; | 37 | u8 setup_done:1; |
38 | u8 early_setup_done:1; | ||
38 | unsigned int assigned_irqs; | 39 | unsigned int assigned_irqs; |
39 | }; | 40 | }; |
40 | 41 | ||
41 | #ifdef CONFIG_BCMA_DRIVER_MIPS | 42 | #ifdef CONFIG_BCMA_DRIVER_MIPS |
42 | extern void bcma_core_mips_init(struct bcma_drv_mips *mcore); | 43 | extern void bcma_core_mips_init(struct bcma_drv_mips *mcore); |
44 | extern void bcma_core_mips_early_init(struct bcma_drv_mips *mcore); | ||
43 | #else | 45 | #else |
44 | static inline void bcma_core_mips_init(struct bcma_drv_mips *mcore) { } | 46 | static inline void bcma_core_mips_init(struct bcma_drv_mips *mcore) { } |
47 | static inline void bcma_core_mips_early_init(struct bcma_drv_mips *mcore) { } | ||
45 | #endif | 48 | #endif |
46 | 49 | ||
47 | extern u32 bcma_cpu_clock(struct bcma_drv_mips *mcore); | 50 | extern u32 bcma_cpu_clock(struct bcma_drv_mips *mcore); |
diff --git a/include/linux/bcma/bcma_regs.h b/include/linux/bcma/bcma_regs.h index 6c9cb93ae3de..7e8104bb7a7e 100644 --- a/include/linux/bcma/bcma_regs.h +++ b/include/linux/bcma/bcma_regs.h | |||
@@ -85,6 +85,9 @@ | |||
85 | * (2 ZettaBytes), high 32 bits | 85 | * (2 ZettaBytes), high 32 bits |
86 | */ | 86 | */ |
87 | 87 | ||
88 | #define BCMA_SFLASH 0x1c000000 | 88 | #define BCMA_SOC_FLASH1 0x1fc00000 /* MIPS Flash Region 1 */ |
89 | #define BCMA_SOC_FLASH1_SZ 0x00400000 /* MIPS Size of Flash Region 1 */ | ||
90 | #define BCMA_SOC_FLASH2 0x1c000000 /* Flash Region 2 (region 1 shadowed here) */ | ||
91 | #define BCMA_SOC_FLASH2_SZ 0x02000000 /* Size of Flash Region 2 */ | ||
89 | 92 | ||
90 | #endif /* LINUX_BCMA_REGS_H_ */ | 93 | #endif /* LINUX_BCMA_REGS_H_ */ |
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index b006ba0a9f42..243eea1e33d8 100644 --- a/include/linux/etherdevice.h +++ b/include/linux/etherdevice.h | |||
@@ -51,6 +51,26 @@ extern struct net_device *alloc_etherdev_mqs(int sizeof_priv, unsigned int txqs, | |||
51 | #define alloc_etherdev(sizeof_priv) alloc_etherdev_mq(sizeof_priv, 1) | 51 | #define alloc_etherdev(sizeof_priv) alloc_etherdev_mq(sizeof_priv, 1) |
52 | #define alloc_etherdev_mq(sizeof_priv, count) alloc_etherdev_mqs(sizeof_priv, count, count) | 52 | #define alloc_etherdev_mq(sizeof_priv, count) alloc_etherdev_mqs(sizeof_priv, count, count) |
53 | 53 | ||
54 | /* Reserved Ethernet Addresses per IEEE 802.1Q */ | ||
55 | static const u8 eth_reserved_addr_base[ETH_ALEN] __aligned(2) = | ||
56 | { 0x01, 0x80, 0xc2, 0x00, 0x00, 0x00 }; | ||
57 | |||
58 | /** | ||
59 | * is_link_local_ether_addr - Determine if given Ethernet address is link-local | ||
60 | * @addr: Pointer to a six-byte array containing the Ethernet address | ||
61 | * | ||
62 | * Return true if address is link local reserved addr (01:80:c2:00:00:0X) per | ||
63 | * IEEE 802.1Q 8.6.3 Frame filtering. | ||
64 | */ | ||
65 | static inline bool is_link_local_ether_addr(const u8 *addr) | ||
66 | { | ||
67 | __be16 *a = (__be16 *)addr; | ||
68 | static const __be16 *b = (const __be16 *)eth_reserved_addr_base; | ||
69 | static const __be16 m = cpu_to_be16(0xfff0); | ||
70 | |||
71 | return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | ((a[2] ^ b[2]) & m)) == 0; | ||
72 | } | ||
73 | |||
54 | /** | 74 | /** |
55 | * is_zero_ether_addr - Determine if give Ethernet address is all zeros. | 75 | * is_zero_ether_addr - Determine if give Ethernet address is all zeros. |
56 | * @addr: Pointer to a six-byte array containing the Ethernet address | 76 | * @addr: Pointer to a six-byte array containing the Ethernet address |
diff --git a/include/linux/filter.h b/include/linux/filter.h index 24d251f3bab0..c45eabc135e1 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h | |||
@@ -45,6 +45,7 @@ extern void sk_unattached_filter_destroy(struct sk_filter *fp); | |||
45 | extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); | 45 | extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); |
46 | extern int sk_detach_filter(struct sock *sk); | 46 | extern int sk_detach_filter(struct sock *sk); |
47 | extern int sk_chk_filter(struct sock_filter *filter, unsigned int flen); | 47 | extern int sk_chk_filter(struct sock_filter *filter, unsigned int flen); |
48 | extern int sk_get_filter(struct sock *sk, struct sock_filter __user *filter, unsigned len); | ||
48 | 49 | ||
49 | #ifdef CONFIG_BPF_JIT | 50 | #ifdef CONFIG_BPF_JIT |
50 | extern void bpf_jit_compile(struct sk_filter *fp); | 51 | extern void bpf_jit_compile(struct sk_filter *fp); |
@@ -123,6 +124,8 @@ enum { | |||
123 | BPF_S_ANC_CPU, | 124 | BPF_S_ANC_CPU, |
124 | BPF_S_ANC_ALU_XOR_X, | 125 | BPF_S_ANC_ALU_XOR_X, |
125 | BPF_S_ANC_SECCOMP_LD_W, | 126 | BPF_S_ANC_SECCOMP_LD_W, |
127 | BPF_S_ANC_VLAN_TAG, | ||
128 | BPF_S_ANC_VLAN_TAG_PRESENT, | ||
126 | }; | 129 | }; |
127 | 130 | ||
128 | #endif /* __LINUX_FILTER_H__ */ | 131 | #endif /* __LINUX_FILTER_H__ */ |
diff --git a/include/linux/hdlc/Kbuild b/include/linux/hdlc/Kbuild index 1fb26448faa9..e69de29bb2d1 100644 --- a/include/linux/hdlc/Kbuild +++ b/include/linux/hdlc/Kbuild | |||
@@ -1 +0,0 @@ | |||
1 | header-y += ioctl.h | ||
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index 2385119f8bb0..f9c5a787d350 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
@@ -131,6 +131,8 @@ | |||
131 | 131 | ||
132 | #define IEEE80211_MAX_MESH_ID_LEN 32 | 132 | #define IEEE80211_MAX_MESH_ID_LEN 32 |
133 | 133 | ||
134 | #define IEEE80211_NUM_TIDS 16 | ||
135 | |||
134 | #define IEEE80211_QOS_CTL_LEN 2 | 136 | #define IEEE80211_QOS_CTL_LEN 2 |
135 | /* 1d tag mask */ | 137 | /* 1d tag mask */ |
136 | #define IEEE80211_QOS_CTL_TAG1D_MASK 0x0007 | 138 | #define IEEE80211_QOS_CTL_TAG1D_MASK 0x0007 |
@@ -666,6 +668,21 @@ struct ieee80211_meshconf_ie { | |||
666 | } __attribute__ ((packed)); | 668 | } __attribute__ ((packed)); |
667 | 669 | ||
668 | /** | 670 | /** |
671 | * enum mesh_config_capab_flags - Mesh Configuration IE capability field flags | ||
672 | * | ||
673 | * @IEEE80211_MESHCONF_CAPAB_ACCEPT_PLINKS: STA is willing to establish | ||
674 | * additional mesh peerings with other mesh STAs | ||
675 | * @IEEE80211_MESHCONF_CAPAB_FORWARDING: the STA forwards MSDUs | ||
676 | * @IEEE80211_MESHCONF_CAPAB_TBTT_ADJUSTING: TBTT adjustment procedure | ||
677 | * is ongoing | ||
678 | */ | ||
679 | enum mesh_config_capab_flags { | ||
680 | IEEE80211_MESHCONF_CAPAB_ACCEPT_PLINKS = 0x01, | ||
681 | IEEE80211_MESHCONF_CAPAB_FORWARDING = 0x08, | ||
682 | IEEE80211_MESHCONF_CAPAB_TBTT_ADJUSTING = 0x20, | ||
683 | }; | ||
684 | |||
685 | /** | ||
669 | * struct ieee80211_rann_ie | 686 | * struct ieee80211_rann_ie |
670 | * | 687 | * |
671 | * This structure refers to "Root Announcement information element" | 688 | * This structure refers to "Root Announcement information element" |
@@ -905,6 +922,38 @@ struct ieee80211_tdls_data { | |||
905 | } u; | 922 | } u; |
906 | } __packed; | 923 | } __packed; |
907 | 924 | ||
925 | /* | ||
926 | * Peer-to-Peer IE attribute related definitions. | ||
927 | */ | ||
928 | /** | ||
929 | * enum ieee80211_p2p_attr_id - identifies type of peer-to-peer attribute. | ||
930 | */ | ||
931 | enum ieee80211_p2p_attr_id { | ||
932 | IEEE80211_P2P_ATTR_STATUS = 0, | ||
933 | IEEE80211_P2P_ATTR_MINOR_REASON, | ||
934 | IEEE80211_P2P_ATTR_CAPABILITY, | ||
935 | IEEE80211_P2P_ATTR_DEVICE_ID, | ||
936 | IEEE80211_P2P_ATTR_GO_INTENT, | ||
937 | IEEE80211_P2P_ATTR_GO_CONFIG_TIMEOUT, | ||
938 | IEEE80211_P2P_ATTR_LISTEN_CHANNEL, | ||
939 | IEEE80211_P2P_ATTR_GROUP_BSSID, | ||
940 | IEEE80211_P2P_ATTR_EXT_LISTEN_TIMING, | ||
941 | IEEE80211_P2P_ATTR_INTENDED_IFACE_ADDR, | ||
942 | IEEE80211_P2P_ATTR_MANAGABILITY, | ||
943 | IEEE80211_P2P_ATTR_CHANNEL_LIST, | ||
944 | IEEE80211_P2P_ATTR_ABSENCE_NOTICE, | ||
945 | IEEE80211_P2P_ATTR_DEVICE_INFO, | ||
946 | IEEE80211_P2P_ATTR_GROUP_INFO, | ||
947 | IEEE80211_P2P_ATTR_GROUP_ID, | ||
948 | IEEE80211_P2P_ATTR_INTERFACE, | ||
949 | IEEE80211_P2P_ATTR_OPER_CHANNEL, | ||
950 | IEEE80211_P2P_ATTR_INVITE_FLAGS, | ||
951 | /* 19 - 220: Reserved */ | ||
952 | IEEE80211_P2P_ATTR_VENDOR_SPECIFIC = 221, | ||
953 | |||
954 | IEEE80211_P2P_ATTR_MAX | ||
955 | }; | ||
956 | |||
908 | /** | 957 | /** |
909 | * struct ieee80211_bar - HT Block Ack Request | 958 | * struct ieee80211_bar - HT Block Ack Request |
910 | * | 959 | * |
@@ -1107,20 +1156,6 @@ struct ieee80211_ht_operation { | |||
1107 | #define WLAN_HT_SMPS_CONTROL_STATIC 1 | 1156 | #define WLAN_HT_SMPS_CONTROL_STATIC 1 |
1108 | #define WLAN_HT_SMPS_CONTROL_DYNAMIC 3 | 1157 | #define WLAN_HT_SMPS_CONTROL_DYNAMIC 3 |
1109 | 1158 | ||
1110 | #define VHT_MCS_SUPPORTED_SET_SIZE 8 | ||
1111 | |||
1112 | struct ieee80211_vht_capabilities { | ||
1113 | __le32 vht_capabilities_info; | ||
1114 | u8 vht_supported_mcs_set[VHT_MCS_SUPPORTED_SET_SIZE]; | ||
1115 | } __packed; | ||
1116 | |||
1117 | struct ieee80211_vht_operation { | ||
1118 | u8 vht_op_info_chwidth; | ||
1119 | u8 vht_op_info_chan_center_freq_seg1_idx; | ||
1120 | u8 vht_op_info_chan_center_freq_seg2_idx; | ||
1121 | __le16 vht_basic_mcs_set; | ||
1122 | } __packed; | ||
1123 | |||
1124 | /** | 1159 | /** |
1125 | * struct ieee80211_vht_mcs_info - VHT MCS information | 1160 | * struct ieee80211_vht_mcs_info - VHT MCS information |
1126 | * @rx_mcs_map: RX MCS map 2 bits for each stream, total 8 streams | 1161 | * @rx_mcs_map: RX MCS map 2 bits for each stream, total 8 streams |
@@ -1128,11 +1163,13 @@ struct ieee80211_vht_operation { | |||
1128 | * STA can receive. Rate expressed in units of 1 Mbps. | 1163 | * STA can receive. Rate expressed in units of 1 Mbps. |
1129 | * If this field is 0 this value should not be used to | 1164 | * If this field is 0 this value should not be used to |
1130 | * consider the highest RX data rate supported. | 1165 | * consider the highest RX data rate supported. |
1166 | * The top 3 bits of this field are reserved. | ||
1131 | * @tx_mcs_map: TX MCS map 2 bits for each stream, total 8 streams | 1167 | * @tx_mcs_map: TX MCS map 2 bits for each stream, total 8 streams |
1132 | * @tx_highest: Indicates highest long GI VHT PPDU data rate | 1168 | * @tx_highest: Indicates highest long GI VHT PPDU data rate |
1133 | * STA can transmit. Rate expressed in units of 1 Mbps. | 1169 | * STA can transmit. Rate expressed in units of 1 Mbps. |
1134 | * If this field is 0 this value should not be used to | 1170 | * If this field is 0 this value should not be used to |
1135 | * consider the highest TX data rate supported. | 1171 | * consider the highest TX data rate supported. |
1172 | * The top 3 bits of this field are reserved. | ||
1136 | */ | 1173 | */ |
1137 | struct ieee80211_vht_mcs_info { | 1174 | struct ieee80211_vht_mcs_info { |
1138 | __le16 rx_mcs_map; | 1175 | __le16 rx_mcs_map; |
@@ -1141,6 +1178,58 @@ struct ieee80211_vht_mcs_info { | |||
1141 | __le16 tx_highest; | 1178 | __le16 tx_highest; |
1142 | } __packed; | 1179 | } __packed; |
1143 | 1180 | ||
1181 | /** | ||
1182 | * enum ieee80211_vht_mcs_support - VHT MCS support definitions | ||
1183 | * @IEEE80211_VHT_MCS_SUPPORT_0_7: MCSes 0-7 are supported for the | ||
1184 | * number of streams | ||
1185 | * @IEEE80211_VHT_MCS_SUPPORT_0_8: MCSes 0-8 are supported | ||
1186 | * @IEEE80211_VHT_MCS_SUPPORT_0_9: MCSes 0-9 are supported | ||
1187 | * @IEEE80211_VHT_MCS_NOT_SUPPORTED: This number of streams isn't supported | ||
1188 | * | ||
1189 | * These definitions are used in each 2-bit subfield of the @rx_mcs_map | ||
1190 | * and @tx_mcs_map fields of &struct ieee80211_vht_mcs_info, which are | ||
1191 | * both split into 8 subfields by number of streams. These values indicate | ||
1192 | * which MCSes are supported for the number of streams the value appears | ||
1193 | * for. | ||
1194 | */ | ||
1195 | enum ieee80211_vht_mcs_support { | ||
1196 | IEEE80211_VHT_MCS_SUPPORT_0_7 = 0, | ||
1197 | IEEE80211_VHT_MCS_SUPPORT_0_8 = 1, | ||
1198 | IEEE80211_VHT_MCS_SUPPORT_0_9 = 2, | ||
1199 | IEEE80211_VHT_MCS_NOT_SUPPORTED = 3, | ||
1200 | }; | ||
1201 | |||
1202 | /** | ||
1203 | * struct ieee80211_vht_cap - VHT capabilities | ||
1204 | * | ||
1205 | * This structure is the "VHT capabilities element" as | ||
1206 | * described in 802.11ac D3.0 8.4.2.160 | ||
1207 | * @vht_cap_info: VHT capability info | ||
1208 | * @supp_mcs: VHT MCS supported rates | ||
1209 | */ | ||
1210 | struct ieee80211_vht_cap { | ||
1211 | __le32 vht_cap_info; | ||
1212 | struct ieee80211_vht_mcs_info supp_mcs; | ||
1213 | } __packed; | ||
1214 | |||
1215 | /** | ||
1216 | * struct ieee80211_vht_operation - VHT operation IE | ||
1217 | * | ||
1218 | * This structure is the "VHT operation element" as | ||
1219 | * described in 802.11ac D3.0 8.4.2.161 | ||
1220 | * @chan_width: Operating channel width | ||
1221 | * @center_freq_seg1_idx: center freq segment 1 index | ||
1222 | * @center_freq_seg2_idx: center freq segment 2 index | ||
1223 | * @basic_mcs_set: VHT Basic MCS rate set | ||
1224 | */ | ||
1225 | struct ieee80211_vht_operation { | ||
1226 | u8 chan_width; | ||
1227 | u8 center_freq_seg1_idx; | ||
1228 | u8 center_freq_seg2_idx; | ||
1229 | __le16 basic_mcs_set; | ||
1230 | } __packed; | ||
1231 | |||
1232 | |||
1144 | #define IEEE80211_VHT_MCS_ZERO_TO_SEVEN_SUPPORT 0 | 1233 | #define IEEE80211_VHT_MCS_ZERO_TO_SEVEN_SUPPORT 0 |
1145 | #define IEEE80211_VHT_MCS_ZERO_TO_EIGHT_SUPPORT 1 | 1234 | #define IEEE80211_VHT_MCS_ZERO_TO_EIGHT_SUPPORT 1 |
1146 | #define IEEE80211_VHT_MCS_ZERO_TO_NINE_SUPPORT 2 | 1235 | #define IEEE80211_VHT_MCS_ZERO_TO_NINE_SUPPORT 2 |
@@ -1440,8 +1529,6 @@ enum ieee80211_eid { | |||
1440 | 1529 | ||
1441 | WLAN_EID_RSN = 48, | 1530 | WLAN_EID_RSN = 48, |
1442 | WLAN_EID_MMIE = 76, | 1531 | WLAN_EID_MMIE = 76, |
1443 | WLAN_EID_WPA = 221, | ||
1444 | WLAN_EID_GENERIC = 221, | ||
1445 | WLAN_EID_VENDOR_SPECIFIC = 221, | 1532 | WLAN_EID_VENDOR_SPECIFIC = 221, |
1446 | WLAN_EID_QOS_PARAMETER = 222, | 1533 | WLAN_EID_QOS_PARAMETER = 222, |
1447 | 1534 | ||
diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h index 1cc595a67cc9..f4e56ecd0b1a 100644 --- a/include/linux/if_tunnel.h +++ b/include/linux/if_tunnel.h | |||
@@ -4,5 +4,22 @@ | |||
4 | #include <linux/ip.h> | 4 | #include <linux/ip.h> |
5 | #include <linux/in6.h> | 5 | #include <linux/in6.h> |
6 | #include <uapi/linux/if_tunnel.h> | 6 | #include <uapi/linux/if_tunnel.h> |
7 | #include <linux/u64_stats_sync.h> | ||
8 | |||
9 | /* | ||
10 | * Locking : hash tables are protected by RCU and RTNL | ||
11 | */ | ||
12 | |||
13 | #define for_each_ip_tunnel_rcu(pos, start) \ | ||
14 | for (pos = rcu_dereference(start); pos; pos = rcu_dereference(pos->next)) | ||
15 | |||
16 | /* often modified stats are per cpu, other are shared (netdev->stats) */ | ||
17 | struct pcpu_tstats { | ||
18 | u64 rx_packets; | ||
19 | u64 rx_bytes; | ||
20 | u64 tx_packets; | ||
21 | u64 tx_bytes; | ||
22 | struct u64_stats_sync syncp; | ||
23 | }; | ||
7 | 24 | ||
8 | #endif /* _IF_TUNNEL_H_ */ | 25 | #endif /* _IF_TUNNEL_H_ */ |
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index bcba48a97868..5e11905a4f01 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
@@ -47,6 +47,7 @@ struct ipv6_devconf { | |||
47 | __s32 disable_ipv6; | 47 | __s32 disable_ipv6; |
48 | __s32 accept_dad; | 48 | __s32 accept_dad; |
49 | __s32 force_tllao; | 49 | __s32 force_tllao; |
50 | __s32 ndisc_notify; | ||
50 | void *sysctl; | 51 | void *sysctl; |
51 | }; | 52 | }; |
52 | 53 | ||
diff --git a/include/linux/ktime.h b/include/linux/ktime.h index 06177ba10a16..e83512f63df5 100644 --- a/include/linux/ktime.h +++ b/include/linux/ktime.h | |||
@@ -282,6 +282,25 @@ static inline int ktime_equal(const ktime_t cmp1, const ktime_t cmp2) | |||
282 | return cmp1.tv64 == cmp2.tv64; | 282 | return cmp1.tv64 == cmp2.tv64; |
283 | } | 283 | } |
284 | 284 | ||
285 | /** | ||
286 | * ktime_compare - Compares two ktime_t variables for less, greater or equal | ||
287 | * @cmp1: comparable1 | ||
288 | * @cmp2: comparable2 | ||
289 | * | ||
290 | * Returns ... | ||
291 | * cmp1 < cmp2: return <0 | ||
292 | * cmp1 == cmp2: return 0 | ||
293 | * cmp1 > cmp2: return >0 | ||
294 | */ | ||
295 | static inline int ktime_compare(const ktime_t cmp1, const ktime_t cmp2) | ||
296 | { | ||
297 | if (cmp1.tv64 < cmp2.tv64) | ||
298 | return -1; | ||
299 | if (cmp1.tv64 > cmp2.tv64) | ||
300 | return 1; | ||
301 | return 0; | ||
302 | } | ||
303 | |||
285 | static inline s64 ktime_to_us(const ktime_t kt) | 304 | static inline s64 ktime_to_us(const ktime_t kt) |
286 | { | 305 | { |
287 | struct timeval tv = ktime_to_timeval(kt); | 306 | struct timeval tv = ktime_to_timeval(kt); |
diff --git a/include/linux/micrel_phy.h b/include/linux/micrel_phy.h index de201203bc7c..adfe8c058f29 100644 --- a/include/linux/micrel_phy.h +++ b/include/linux/micrel_phy.h | |||
@@ -15,6 +15,7 @@ | |||
15 | 15 | ||
16 | #define MICREL_PHY_ID_MASK 0x00fffff0 | 16 | #define MICREL_PHY_ID_MASK 0x00fffff0 |
17 | 17 | ||
18 | #define PHY_ID_KSZ8873MLL 0x000e7237 | ||
18 | #define PHY_ID_KSZ9021 0x00221610 | 19 | #define PHY_ID_KSZ9021 0x00221610 |
19 | #define PHY_ID_KS8737 0x00221720 | 20 | #define PHY_ID_KS8737 0x00221720 |
20 | #define PHY_ID_KSZ8021 0x00221555 | 21 | #define PHY_ID_KSZ8021 0x00221555 |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index f8eda0276f03..e9929abeb932 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -887,6 +887,10 @@ struct netdev_fcoe_hbainfo { | |||
887 | * struct net_device *dev, int idx) | 887 | * struct net_device *dev, int idx) |
888 | * Used to add FDB entries to dump requests. Implementers should add | 888 | * Used to add FDB entries to dump requests. Implementers should add |
889 | * entries to skb and update idx with the number of entries. | 889 | * entries to skb and update idx with the number of entries. |
890 | * | ||
891 | * int (*ndo_bridge_setlink)(struct net_device *dev, struct nlmsghdr *nlh) | ||
892 | * int (*ndo_bridge_getlink)(struct sk_buff *skb, u32 pid, u32 seq, | ||
893 | * struct net_device *dev) | ||
890 | */ | 894 | */ |
891 | struct net_device_ops { | 895 | struct net_device_ops { |
892 | int (*ndo_init)(struct net_device *dev); | 896 | int (*ndo_init)(struct net_device *dev); |
@@ -998,6 +1002,12 @@ struct net_device_ops { | |||
998 | struct netlink_callback *cb, | 1002 | struct netlink_callback *cb, |
999 | struct net_device *dev, | 1003 | struct net_device *dev, |
1000 | int idx); | 1004 | int idx); |
1005 | |||
1006 | int (*ndo_bridge_setlink)(struct net_device *dev, | ||
1007 | struct nlmsghdr *nlh); | ||
1008 | int (*ndo_bridge_getlink)(struct sk_buff *skb, | ||
1009 | u32 pid, u32 seq, | ||
1010 | struct net_device *dev); | ||
1001 | }; | 1011 | }; |
1002 | 1012 | ||
1003 | /* | 1013 | /* |
@@ -1499,16 +1509,25 @@ struct packet_type { | |||
1499 | struct net_device *, | 1509 | struct net_device *, |
1500 | struct packet_type *, | 1510 | struct packet_type *, |
1501 | struct net_device *); | 1511 | struct net_device *); |
1512 | bool (*id_match)(struct packet_type *ptype, | ||
1513 | struct sock *sk); | ||
1514 | void *af_packet_priv; | ||
1515 | struct list_head list; | ||
1516 | }; | ||
1517 | |||
1518 | struct offload_callbacks { | ||
1502 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, | 1519 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, |
1503 | netdev_features_t features); | 1520 | netdev_features_t features); |
1504 | int (*gso_send_check)(struct sk_buff *skb); | 1521 | int (*gso_send_check)(struct sk_buff *skb); |
1505 | struct sk_buff **(*gro_receive)(struct sk_buff **head, | 1522 | struct sk_buff **(*gro_receive)(struct sk_buff **head, |
1506 | struct sk_buff *skb); | 1523 | struct sk_buff *skb); |
1507 | int (*gro_complete)(struct sk_buff *skb); | 1524 | int (*gro_complete)(struct sk_buff *skb); |
1508 | bool (*id_match)(struct packet_type *ptype, | 1525 | }; |
1509 | struct sock *sk); | 1526 | |
1510 | void *af_packet_priv; | 1527 | struct packet_offload { |
1511 | struct list_head list; | 1528 | __be16 type; /* This is really htons(ether_type). */ |
1529 | struct offload_callbacks callbacks; | ||
1530 | struct list_head list; | ||
1512 | }; | 1531 | }; |
1513 | 1532 | ||
1514 | #include <linux/notifier.h> | 1533 | #include <linux/notifier.h> |
@@ -1548,6 +1567,8 @@ extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev); | |||
1548 | 1567 | ||
1549 | extern rwlock_t dev_base_lock; /* Device list lock */ | 1568 | extern rwlock_t dev_base_lock; /* Device list lock */ |
1550 | 1569 | ||
1570 | extern seqlock_t devnet_rename_seq; /* Device rename lock */ | ||
1571 | |||
1551 | 1572 | ||
1552 | #define for_each_netdev(net, d) \ | 1573 | #define for_each_netdev(net, d) \ |
1553 | list_for_each_entry(d, &(net)->dev_base_head, dev_list) | 1574 | list_for_each_entry(d, &(net)->dev_base_head, dev_list) |
@@ -1605,6 +1626,9 @@ extern struct net_device *__dev_getfirstbyhwtype(struct net *net, unsigned short | |||
1605 | extern void dev_add_pack(struct packet_type *pt); | 1626 | extern void dev_add_pack(struct packet_type *pt); |
1606 | extern void dev_remove_pack(struct packet_type *pt); | 1627 | extern void dev_remove_pack(struct packet_type *pt); |
1607 | extern void __dev_remove_pack(struct packet_type *pt); | 1628 | extern void __dev_remove_pack(struct packet_type *pt); |
1629 | extern void dev_add_offload(struct packet_offload *po); | ||
1630 | extern void dev_remove_offload(struct packet_offload *po); | ||
1631 | extern void __dev_remove_offload(struct packet_offload *po); | ||
1608 | 1632 | ||
1609 | extern struct net_device *dev_get_by_flags_rcu(struct net *net, unsigned short flags, | 1633 | extern struct net_device *dev_get_by_flags_rcu(struct net *net, unsigned short flags, |
1610 | unsigned short mask); | 1634 | unsigned short mask); |
diff --git a/include/linux/nfc/pn544.h b/include/linux/nfc/pn544.h deleted file mode 100644 index 9890bbaf4328..000000000000 --- a/include/linux/nfc/pn544.h +++ /dev/null | |||
@@ -1,104 +0,0 @@ | |||
1 | /* | ||
2 | * Driver include for the PN544 NFC chip. | ||
3 | * | ||
4 | * Copyright (C) Nokia Corporation | ||
5 | * | ||
6 | * Author: Jari Vanhala <ext-jari.vanhala@nokia.com> | ||
7 | * Contact: Matti Aaltoenn <matti.j.aaltonen@nokia.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or | ||
10 | * modify it under the terms of the GNU General Public License | ||
11 | * version 2 as published by the Free Software Foundation. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | */ | ||
22 | |||
23 | #ifndef _PN544_H_ | ||
24 | #define _PN544_H_ | ||
25 | |||
26 | #include <linux/i2c.h> | ||
27 | |||
28 | #define PN544_DRIVER_NAME "pn544" | ||
29 | #define PN544_MAXWINDOW_SIZE 7 | ||
30 | #define PN544_WINDOW_SIZE 4 | ||
31 | #define PN544_RETRIES 10 | ||
32 | #define PN544_MAX_I2C_TRANSFER 0x0400 | ||
33 | #define PN544_MSG_MAX_SIZE 0x21 /* at normal HCI mode */ | ||
34 | |||
35 | /* ioctl */ | ||
36 | #define PN544_CHAR_BASE 'P' | ||
37 | #define PN544_IOR(num, dtype) _IOR(PN544_CHAR_BASE, num, dtype) | ||
38 | #define PN544_IOW(num, dtype) _IOW(PN544_CHAR_BASE, num, dtype) | ||
39 | #define PN544_GET_FW_MODE PN544_IOW(1, unsigned int) | ||
40 | #define PN544_SET_FW_MODE PN544_IOW(2, unsigned int) | ||
41 | #define PN544_GET_DEBUG PN544_IOW(3, unsigned int) | ||
42 | #define PN544_SET_DEBUG PN544_IOW(4, unsigned int) | ||
43 | |||
44 | /* Timing restrictions (ms) */ | ||
45 | #define PN544_RESETVEN_TIME 30 /* 7 */ | ||
46 | #define PN544_PVDDVEN_TIME 0 | ||
47 | #define PN544_VBATVEN_TIME 0 | ||
48 | #define PN544_GPIO4VEN_TIME 0 | ||
49 | #define PN544_WAKEUP_ACK 5 | ||
50 | #define PN544_WAKEUP_GUARD (PN544_WAKEUP_ACK + 1) | ||
51 | #define PN544_INACTIVITY_TIME 1000 | ||
52 | #define PN544_INTERFRAME_DELAY 200 /* us */ | ||
53 | #define PN544_BAUDRATE_CHANGE 150 /* us */ | ||
54 | |||
55 | /* Debug bits */ | ||
56 | #define PN544_DEBUG_BUF 0x01 | ||
57 | #define PN544_DEBUG_READ 0x02 | ||
58 | #define PN544_DEBUG_WRITE 0x04 | ||
59 | #define PN544_DEBUG_IRQ 0x08 | ||
60 | #define PN544_DEBUG_CALLS 0x10 | ||
61 | #define PN544_DEBUG_MODE 0x20 | ||
62 | |||
63 | /* Normal (HCI) mode */ | ||
64 | #define PN544_LLC_HCI_OVERHEAD 3 /* header + crc (to length) */ | ||
65 | #define PN544_LLC_MIN_SIZE (1 + PN544_LLC_HCI_OVERHEAD) /* length + */ | ||
66 | #define PN544_LLC_MAX_DATA (PN544_MSG_MAX_SIZE - 2) | ||
67 | #define PN544_LLC_MAX_HCI_SIZE (PN544_LLC_MAX_DATA - 2) | ||
68 | |||
69 | struct pn544_llc_packet { | ||
70 | unsigned char length; /* of rest of packet */ | ||
71 | unsigned char header; | ||
72 | unsigned char data[PN544_LLC_MAX_DATA]; /* includes crc-ccitt */ | ||
73 | }; | ||
74 | |||
75 | /* Firmware upgrade mode */ | ||
76 | #define PN544_FW_HEADER_SIZE 3 | ||
77 | /* max fw transfer is 1024bytes, but I2C limits it to 0xC0 */ | ||
78 | #define PN544_MAX_FW_DATA (PN544_MAX_I2C_TRANSFER - PN544_FW_HEADER_SIZE) | ||
79 | |||
80 | struct pn544_fw_packet { | ||
81 | unsigned char command; /* status in answer */ | ||
82 | unsigned char length[2]; /* big-endian order (msf) */ | ||
83 | unsigned char data[PN544_MAX_FW_DATA]; | ||
84 | }; | ||
85 | |||
86 | #ifdef __KERNEL__ | ||
87 | enum { | ||
88 | NFC_GPIO_ENABLE, | ||
89 | NFC_GPIO_FW_RESET, | ||
90 | NFC_GPIO_IRQ | ||
91 | }; | ||
92 | |||
93 | /* board config */ | ||
94 | struct pn544_nfc_platform_data { | ||
95 | int (*request_resources) (struct i2c_client *client); | ||
96 | void (*free_resources) (void); | ||
97 | void (*enable) (int fw); | ||
98 | int (*test) (void); | ||
99 | void (*disable) (void); | ||
100 | int (*get_gpio)(int type); | ||
101 | }; | ||
102 | #endif /* __KERNEL__ */ | ||
103 | |||
104 | #endif /* _PN544_H_ */ | ||
diff --git a/include/linux/pci.h b/include/linux/pci.h index ee2179546c63..9cbd6705d033 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -604,6 +604,20 @@ struct pci_driver { | |||
604 | .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID | 604 | .subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID |
605 | 605 | ||
606 | /** | 606 | /** |
607 | * PCI_DEVICE_SUB - macro used to describe a specific pci device with subsystem | ||
608 | * @vend: the 16 bit PCI Vendor ID | ||
609 | * @dev: the 16 bit PCI Device ID | ||
610 | * @subvend: the 16 bit PCI Subvendor ID | ||
611 | * @subdev: the 16 bit PCI Subdevice ID | ||
612 | * | ||
613 | * This macro is used to create a struct pci_device_id that matches a | ||
614 | * specific device with subsystem information. | ||
615 | */ | ||
616 | #define PCI_DEVICE_SUB(vend, dev, subvend, subdev) \ | ||
617 | .vendor = (vend), .device = (dev), \ | ||
618 | .subvendor = (subvend), .subdevice = (subdev) | ||
619 | |||
620 | /** | ||
607 | * PCI_DEVICE_CLASS - macro used to describe a specific pci device class | 621 | * PCI_DEVICE_CLASS - macro used to describe a specific pci device class |
608 | * @dev_class: the class, subclass, prog-if triple for this device | 622 | * @dev_class: the class, subclass, prog-if triple for this device |
609 | * @dev_class_mask: the class mask for this device | 623 | * @dev_class_mask: the class mask for this device |
diff --git a/include/linux/platform_data/cpsw.h b/include/linux/platform_data/cpsw.h index c4e23d029498..24368a2e8b87 100644 --- a/include/linux/platform_data/cpsw.h +++ b/include/linux/platform_data/cpsw.h | |||
@@ -18,9 +18,7 @@ | |||
18 | #include <linux/if_ether.h> | 18 | #include <linux/if_ether.h> |
19 | 19 | ||
20 | struct cpsw_slave_data { | 20 | struct cpsw_slave_data { |
21 | u32 slave_reg_ofs; | 21 | char phy_id[MII_BUS_ID_SIZE]; |
22 | u32 sliver_reg_ofs; | ||
23 | const char *phy_id; | ||
24 | int phy_if; | 22 | int phy_if; |
25 | u8 mac_addr[ETH_ALEN]; | 23 | u8 mac_addr[ETH_ALEN]; |
26 | }; | 24 | }; |
@@ -28,27 +26,14 @@ struct cpsw_slave_data { | |||
28 | struct cpsw_platform_data { | 26 | struct cpsw_platform_data { |
29 | u32 ss_reg_ofs; /* Subsystem control register offset */ | 27 | u32 ss_reg_ofs; /* Subsystem control register offset */ |
30 | u32 channels; /* number of cpdma channels (symmetric) */ | 28 | u32 channels; /* number of cpdma channels (symmetric) */ |
31 | u32 cpdma_reg_ofs; /* cpdma register offset */ | ||
32 | u32 cpdma_sram_ofs; /* cpdma sram offset */ | ||
33 | |||
34 | u32 slaves; /* number of slave cpgmac ports */ | 29 | u32 slaves; /* number of slave cpgmac ports */ |
35 | struct cpsw_slave_data *slave_data; | 30 | struct cpsw_slave_data *slave_data; |
36 | 31 | u32 cpts_active_slave; /* time stamping slave */ | |
37 | u32 ale_reg_ofs; /* address lookup engine reg offset */ | 32 | u32 cpts_clock_mult; /* convert input clock ticks to nanoseconds */ |
33 | u32 cpts_clock_shift; /* convert input clock ticks to nanoseconds */ | ||
38 | u32 ale_entries; /* ale table size */ | 34 | u32 ale_entries; /* ale table size */ |
39 | |||
40 | u32 host_port_reg_ofs; /* cpsw cpdma host port registers */ | ||
41 | u32 host_port_num; /* The port number for the host port */ | ||
42 | |||
43 | u32 hw_stats_reg_ofs; /* cpsw hardware statistics counters */ | ||
44 | |||
45 | u32 bd_ram_ofs; /* embedded buffer descriptor RAM offset*/ | ||
46 | u32 bd_ram_size; /*buffer descriptor ram size */ | 35 | u32 bd_ram_size; /*buffer descriptor ram size */ |
47 | u32 hw_ram_addr; /*if the HW address for BD RAM is different */ | ||
48 | bool no_bd_ram; /* no embedded BD ram*/ | ||
49 | |||
50 | u32 rx_descs; /* Number of Rx Descriptios */ | 36 | u32 rx_descs; /* Number of Rx Descriptios */ |
51 | |||
52 | u32 mac_control; /* Mac control register */ | 37 | u32 mac_control; /* Mac control register */ |
53 | }; | 38 | }; |
54 | 39 | ||
diff --git a/include/linux/platform_data/macb.h b/include/linux/platform_data/macb.h index b081c7245ec8..044a124bfbbc 100644 --- a/include/linux/platform_data/macb.h +++ b/include/linux/platform_data/macb.h | |||
@@ -12,6 +12,7 @@ struct macb_platform_data { | |||
12 | u32 phy_mask; | 12 | u32 phy_mask; |
13 | int phy_irq_pin; /* PHY IRQ */ | 13 | int phy_irq_pin; /* PHY IRQ */ |
14 | u8 is_rmii; /* using RMII interface? */ | 14 | u8 is_rmii; /* using RMII interface? */ |
15 | u8 rev_eth_addr; /* reverse Ethernet address byte order */ | ||
15 | }; | 16 | }; |
16 | 17 | ||
17 | #endif /* __MACB_PDATA_H__ */ | 18 | #endif /* __MACB_PDATA_H__ */ |
diff --git a/include/linux/platform_data/pn544.h b/include/linux/platform_data/pn544.h new file mode 100644 index 000000000000..713bfd703342 --- /dev/null +++ b/include/linux/platform_data/pn544.h | |||
@@ -0,0 +1,44 @@ | |||
1 | /* | ||
2 | * Driver include for the PN544 NFC chip. | ||
3 | * | ||
4 | * Copyright (C) Nokia Corporation | ||
5 | * | ||
6 | * Author: Jari Vanhala <ext-jari.vanhala@nokia.com> | ||
7 | * Contact: Matti Aaltoenn <matti.j.aaltonen@nokia.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or | ||
10 | * modify it under the terms of the GNU General Public License | ||
11 | * version 2 as published by the Free Software Foundation. | ||
12 | * | ||
13 | * This program is distributed in the hope that it will be useful, | ||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program; if not, write to the Free Software | ||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
21 | */ | ||
22 | |||
23 | #ifndef _PN544_H_ | ||
24 | #define _PN544_H_ | ||
25 | |||
26 | #include <linux/i2c.h> | ||
27 | |||
28 | enum { | ||
29 | NFC_GPIO_ENABLE, | ||
30 | NFC_GPIO_FW_RESET, | ||
31 | NFC_GPIO_IRQ | ||
32 | }; | ||
33 | |||
34 | /* board config */ | ||
35 | struct pn544_nfc_platform_data { | ||
36 | int (*request_resources) (struct i2c_client *client); | ||
37 | void (*free_resources) (void); | ||
38 | void (*enable) (int fw); | ||
39 | int (*test) (void); | ||
40 | void (*disable) (void); | ||
41 | int (*get_gpio)(int type); | ||
42 | }; | ||
43 | |||
44 | #endif /* _PN544_H_ */ | ||
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 7002bbfd5d4a..489dd7bb28ec 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
@@ -69,4 +69,7 @@ extern int ndo_dflt_fdb_dump(struct sk_buff *skb, | |||
69 | struct netlink_callback *cb, | 69 | struct netlink_callback *cb, |
70 | struct net_device *dev, | 70 | struct net_device *dev, |
71 | int idx); | 71 | int idx); |
72 | |||
73 | extern int ndo_dflt_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, | ||
74 | struct net_device *dev, u16 mode); | ||
72 | #endif /* __LINUX_RTNETLINK_H */ | 75 | #endif /* __LINUX_RTNETLINK_H */ |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 6a2c34e6d962..f2af494330ab 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -235,11 +235,13 @@ enum { | |||
235 | /* | 235 | /* |
236 | * The callback notifies userspace to release buffers when skb DMA is done in | 236 | * The callback notifies userspace to release buffers when skb DMA is done in |
237 | * lower device, the skb last reference should be 0 when calling this. | 237 | * lower device, the skb last reference should be 0 when calling this. |
238 | * The zerocopy_success argument is true if zero copy transmit occurred, | ||
239 | * false on data copy or out of memory error caused by data copy attempt. | ||
238 | * The ctx field is used to track device context. | 240 | * The ctx field is used to track device context. |
239 | * The desc field is used to track userspace buffer index. | 241 | * The desc field is used to track userspace buffer index. |
240 | */ | 242 | */ |
241 | struct ubuf_info { | 243 | struct ubuf_info { |
242 | void (*callback)(struct ubuf_info *); | 244 | void (*callback)(struct ubuf_info *, bool zerocopy_success); |
243 | void *ctx; | 245 | void *ctx; |
244 | unsigned long desc; | 246 | unsigned long desc; |
245 | }; | 247 | }; |
@@ -566,6 +568,7 @@ static inline struct rtable *skb_rtable(const struct sk_buff *skb) | |||
566 | } | 568 | } |
567 | 569 | ||
568 | extern void kfree_skb(struct sk_buff *skb); | 570 | extern void kfree_skb(struct sk_buff *skb); |
571 | extern void skb_tx_error(struct sk_buff *skb); | ||
569 | extern void consume_skb(struct sk_buff *skb); | 572 | extern void consume_skb(struct sk_buff *skb); |
570 | extern void __kfree_skb(struct sk_buff *skb); | 573 | extern void __kfree_skb(struct sk_buff *skb); |
571 | extern struct kmem_cache *skbuff_head_cache; | 574 | extern struct kmem_cache *skbuff_head_cache; |
@@ -643,7 +646,7 @@ extern unsigned int skb_find_text(struct sk_buff *skb, unsigned int from, | |||
643 | extern void __skb_get_rxhash(struct sk_buff *skb); | 646 | extern void __skb_get_rxhash(struct sk_buff *skb); |
644 | static inline __u32 skb_get_rxhash(struct sk_buff *skb) | 647 | static inline __u32 skb_get_rxhash(struct sk_buff *skb) |
645 | { | 648 | { |
646 | if (!skb->rxhash) | 649 | if (!skb->l4_rxhash) |
647 | __skb_get_rxhash(skb); | 650 | __skb_get_rxhash(skb); |
648 | 651 | ||
649 | return skb->rxhash; | 652 | return skb->rxhash; |
diff --git a/include/linux/ssb/ssb_driver_mips.h b/include/linux/ssb/ssb_driver_mips.h index 5f44e9740cd2..07a9c7a2e088 100644 --- a/include/linux/ssb/ssb_driver_mips.h +++ b/include/linux/ssb/ssb_driver_mips.h | |||
@@ -13,6 +13,12 @@ struct ssb_serial_port { | |||
13 | unsigned int reg_shift; | 13 | unsigned int reg_shift; |
14 | }; | 14 | }; |
15 | 15 | ||
16 | struct ssb_pflash { | ||
17 | bool present; | ||
18 | u8 buswidth; | ||
19 | u32 window; | ||
20 | u32 window_size; | ||
21 | }; | ||
16 | 22 | ||
17 | struct ssb_mipscore { | 23 | struct ssb_mipscore { |
18 | struct ssb_device *dev; | 24 | struct ssb_device *dev; |
@@ -20,9 +26,7 @@ struct ssb_mipscore { | |||
20 | int nr_serial_ports; | 26 | int nr_serial_ports; |
21 | struct ssb_serial_port serial_ports[4]; | 27 | struct ssb_serial_port serial_ports[4]; |
22 | 28 | ||
23 | u8 flash_buswidth; | 29 | struct ssb_pflash pflash; |
24 | u32 flash_window; | ||
25 | u32 flash_window_size; | ||
26 | }; | 30 | }; |
27 | 31 | ||
28 | extern void ssb_mipscore_init(struct ssb_mipscore *mcore); | 32 | extern void ssb_mipscore_init(struct ssb_mipscore *mcore); |
diff --git a/include/linux/ssb/ssb_regs.h b/include/linux/ssb/ssb_regs.h index a0525019e1d1..6ecfa02ddbac 100644 --- a/include/linux/ssb/ssb_regs.h +++ b/include/linux/ssb/ssb_regs.h | |||
@@ -485,7 +485,7 @@ | |||
485 | #define SSB_SPROM8_HWIQ_IQSWP_IQCAL_SWP_SHIFT 4 | 485 | #define SSB_SPROM8_HWIQ_IQSWP_IQCAL_SWP_SHIFT 4 |
486 | #define SSB_SPROM8_HWIQ_IQSWP_HW_IQCAL 0x0020 | 486 | #define SSB_SPROM8_HWIQ_IQSWP_HW_IQCAL 0x0020 |
487 | #define SSB_SPROM8_HWIQ_IQSWP_HW_IQCAL_SHIFT 5 | 487 | #define SSB_SPROM8_HWIQ_IQSWP_HW_IQCAL_SHIFT 5 |
488 | #define SSB_SPROM8_TEMPDELTA 0x00BA | 488 | #define SSB_SPROM8_TEMPDELTA 0x00BC |
489 | #define SSB_SPROM8_TEMPDELTA_PHYCAL 0x00ff | 489 | #define SSB_SPROM8_TEMPDELTA_PHYCAL 0x00ff |
490 | #define SSB_SPROM8_TEMPDELTA_PHYCAL_SHIFT 0 | 490 | #define SSB_SPROM8_TEMPDELTA_PHYCAL_SHIFT 0 |
491 | #define SSB_SPROM8_TEMPDELTA_PERIOD 0x0f00 | 491 | #define SSB_SPROM8_TEMPDELTA_PERIOD 0x0f00 |
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h index a1547ea3920d..de5b2f8176ce 100644 --- a/include/linux/stmmac.h +++ b/include/linux/stmmac.h | |||
@@ -104,6 +104,7 @@ struct plat_stmmacenet_data { | |||
104 | int bugged_jumbo; | 104 | int bugged_jumbo; |
105 | int pmt; | 105 | int pmt; |
106 | int force_sf_dma_mode; | 106 | int force_sf_dma_mode; |
107 | int riwt_off; | ||
107 | void (*fix_mac_speed)(void *priv, unsigned int speed); | 108 | void (*fix_mac_speed)(void *priv, unsigned int speed); |
108 | void (*bus_setup)(void __iomem *ioaddr); | 109 | void (*bus_setup)(void __iomem *ioaddr); |
109 | int (*init)(struct platform_device *pdev); | 110 | int (*init)(struct platform_device *pdev); |
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index cd844a6a8d5f..14a8ff2de11e 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
@@ -158,8 +158,7 @@ struct ctl_table_root { | |||
158 | struct ctl_table_set default_set; | 158 | struct ctl_table_set default_set; |
159 | struct ctl_table_set *(*lookup)(struct ctl_table_root *root, | 159 | struct ctl_table_set *(*lookup)(struct ctl_table_root *root, |
160 | struct nsproxy *namespaces); | 160 | struct nsproxy *namespaces); |
161 | int (*permissions)(struct ctl_table_root *root, | 161 | int (*permissions)(struct ctl_table_header *head, struct ctl_table *table); |
162 | struct nsproxy *namespaces, struct ctl_table *table); | ||
163 | }; | 162 | }; |
164 | 163 | ||
165 | /* struct ctl_path describes where in the hierarchy a table is added */ | 164 | /* struct ctl_path describes where in the hierarchy a table is added */ |
diff --git a/include/linux/timecompare.h b/include/linux/timecompare.h deleted file mode 100644 index 546e2234e4b3..000000000000 --- a/include/linux/timecompare.h +++ /dev/null | |||
@@ -1,125 +0,0 @@ | |||
1 | /* | ||
2 | * Utility code which helps transforming between two different time | ||
3 | * bases, called "source" and "target" time in this code. | ||
4 | * | ||
5 | * Source time has to be provided via the timecounter API while target | ||
6 | * time is accessed via a function callback whose prototype | ||
7 | * intentionally matches ktime_get() and ktime_get_real(). These | ||
8 | * interfaces where chosen like this so that the code serves its | ||
9 | * initial purpose without additional glue code. | ||
10 | * | ||
11 | * This purpose is synchronizing a hardware clock in a NIC with system | ||
12 | * time, in order to implement the Precision Time Protocol (PTP, | ||
13 | * IEEE1588) with more accurate hardware assisted time stamping. In | ||
14 | * that context only synchronization against system time (= | ||
15 | * ktime_get_real()) is currently needed. But this utility code might | ||
16 | * become useful in other situations, which is why it was written as | ||
17 | * general purpose utility code. | ||
18 | * | ||
19 | * The source timecounter is assumed to return monotonically | ||
20 | * increasing time (but this code does its best to compensate if that | ||
21 | * is not the case) whereas target time may jump. | ||
22 | * | ||
23 | * The target time corresponding to a source time is determined by | ||
24 | * reading target time, reading source time, reading target time | ||
25 | * again, then assuming that average target time corresponds to source | ||
26 | * time. In other words, the assumption is that reading the source | ||
27 | * time is slow and involves equal time for sending the request and | ||
28 | * receiving the reply, whereas reading target time is assumed to be | ||
29 | * fast. | ||
30 | * | ||
31 | * Copyright (C) 2009 Intel Corporation. | ||
32 | * Author: Patrick Ohly <patrick.ohly@intel.com> | ||
33 | * | ||
34 | * This program is free software; you can redistribute it and/or modify it | ||
35 | * under the terms and conditions of the GNU General Public License, | ||
36 | * version 2, as published by the Free Software Foundation. | ||
37 | * | ||
38 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
39 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
40 | * FITNESS FOR A PARTICULAR PURPOSE. * See the GNU General Public License for | ||
41 | * more details. | ||
42 | * | ||
43 | * You should have received a copy of the GNU General Public License along with | ||
44 | * this program; if not, write to the Free Software Foundation, Inc., | ||
45 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
46 | */ | ||
47 | #ifndef _LINUX_TIMECOMPARE_H | ||
48 | #define _LINUX_TIMECOMPARE_H | ||
49 | |||
50 | #include <linux/clocksource.h> | ||
51 | #include <linux/ktime.h> | ||
52 | |||
53 | /** | ||
54 | * struct timecompare - stores state and configuration for the two clocks | ||
55 | * | ||
56 | * Initialize to zero, then set source/target/num_samples. | ||
57 | * | ||
58 | * Transformation between source time and target time is done with: | ||
59 | * target_time = source_time + offset + | ||
60 | * (source_time - last_update) * skew / | ||
61 | * TIMECOMPARE_SKEW_RESOLUTION | ||
62 | * | ||
63 | * @source: used to get source time stamps via timecounter_read() | ||
64 | * @target: function returning target time (for example, ktime_get | ||
65 | * for monotonic time, or ktime_get_real for wall clock) | ||
66 | * @num_samples: number of times that source time and target time are to | ||
67 | * be compared when determining their offset | ||
68 | * @offset: (target time - source time) at the time of the last update | ||
69 | * @skew: average (target time - source time) / delta source time * | ||
70 | * TIMECOMPARE_SKEW_RESOLUTION | ||
71 | * @last_update: last source time stamp when time offset was measured | ||
72 | */ | ||
73 | struct timecompare { | ||
74 | struct timecounter *source; | ||
75 | ktime_t (*target)(void); | ||
76 | int num_samples; | ||
77 | |||
78 | s64 offset; | ||
79 | s64 skew; | ||
80 | u64 last_update; | ||
81 | }; | ||
82 | |||
83 | /** | ||
84 | * timecompare_transform - transform source time stamp into target time base | ||
85 | * @sync: context for time sync | ||
86 | * @source_tstamp: the result of timecounter_read() or | ||
87 | * timecounter_cyc2time() | ||
88 | */ | ||
89 | extern ktime_t timecompare_transform(struct timecompare *sync, | ||
90 | u64 source_tstamp); | ||
91 | |||
92 | /** | ||
93 | * timecompare_offset - measure current (target time - source time) offset | ||
94 | * @sync: context for time sync | ||
95 | * @offset: average offset during sample period returned here | ||
96 | * @source_tstamp: average source time during sample period returned here | ||
97 | * | ||
98 | * Returns number of samples used. Might be zero (= no result) in the | ||
99 | * unlikely case that target time was monotonically decreasing for all | ||
100 | * samples (= broken). | ||
101 | */ | ||
102 | extern int timecompare_offset(struct timecompare *sync, | ||
103 | s64 *offset, | ||
104 | u64 *source_tstamp); | ||
105 | |||
106 | extern void __timecompare_update(struct timecompare *sync, | ||
107 | u64 source_tstamp); | ||
108 | |||
109 | /** | ||
110 | * timecompare_update - update offset and skew by measuring current offset | ||
111 | * @sync: context for time sync | ||
112 | * @source_tstamp: the result of timecounter_read() or | ||
113 | * timecounter_cyc2time(), pass zero to force update | ||
114 | * | ||
115 | * Updates are only done at most once per second. | ||
116 | */ | ||
117 | static inline void timecompare_update(struct timecompare *sync, | ||
118 | u64 source_tstamp) | ||
119 | { | ||
120 | if (!source_tstamp || | ||
121 | (s64)(source_tstamp - sync->last_update) >= NSEC_PER_SEC) | ||
122 | __timecompare_update(sync, source_tstamp); | ||
123 | } | ||
124 | |||
125 | #endif /* _LINUX_TIMECOMPARE_H */ | ||
diff --git a/include/linux/usb/cdc_ncm.h b/include/linux/usb/cdc_ncm.h new file mode 100644 index 000000000000..3b8f9d4fc3fe --- /dev/null +++ b/include/linux/usb/cdc_ncm.h | |||
@@ -0,0 +1,134 @@ | |||
1 | /* | ||
2 | * Copyright (C) ST-Ericsson 2010-2012 | ||
3 | * Contact: Alexey Orishko <alexey.orishko@stericsson.com> | ||
4 | * Original author: Hans Petter Selasky <hans.petter.selasky@stericsson.com> | ||
5 | * | ||
6 | * USB Host Driver for Network Control Model (NCM) | ||
7 | * http://www.usb.org/developers/devclass_docs/NCM10.zip | ||
8 | * | ||
9 | * The NCM encoding, decoding and initialization logic | ||
10 | * derives from FreeBSD 8.x. if_cdce.c and if_cdcereg.h | ||
11 | * | ||
12 | * This software is available to you under a choice of one of two | ||
13 | * licenses. You may choose this file to be licensed under the terms | ||
14 | * of the GNU General Public License (GPL) Version 2 or the 2-clause | ||
15 | * BSD license listed below: | ||
16 | * | ||
17 | * Redistribution and use in source and binary forms, with or without | ||
18 | * modification, are permitted provided that the following conditions | ||
19 | * are met: | ||
20 | * 1. Redistributions of source code must retain the above copyright | ||
21 | * notice, this list of conditions and the following disclaimer. | ||
22 | * 2. Redistributions in binary form must reproduce the above copyright | ||
23 | * notice, this list of conditions and the following disclaimer in the | ||
24 | * documentation and/or other materials provided with the distribution. | ||
25 | * | ||
26 | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND | ||
27 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
28 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
29 | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
30 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
31 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
32 | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
33 | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
34 | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
35 | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
36 | * SUCH DAMAGE. | ||
37 | */ | ||
38 | |||
39 | #define CDC_NCM_COMM_ALTSETTING_NCM 0 | ||
40 | #define CDC_NCM_COMM_ALTSETTING_MBIM 1 | ||
41 | |||
42 | #define CDC_NCM_DATA_ALTSETTING_NCM 1 | ||
43 | #define CDC_NCM_DATA_ALTSETTING_MBIM 2 | ||
44 | |||
45 | /* CDC NCM subclass 3.2.1 */ | ||
46 | #define USB_CDC_NCM_NDP16_LENGTH_MIN 0x10 | ||
47 | |||
48 | /* Maximum NTB length */ | ||
49 | #define CDC_NCM_NTB_MAX_SIZE_TX 32768 /* bytes */ | ||
50 | #define CDC_NCM_NTB_MAX_SIZE_RX 32768 /* bytes */ | ||
51 | |||
52 | /* Minimum value for MaxDatagramSize, ch. 6.2.9 */ | ||
53 | #define CDC_NCM_MIN_DATAGRAM_SIZE 1514 /* bytes */ | ||
54 | |||
55 | /* Minimum value for MaxDatagramSize, ch. 8.1.3 */ | ||
56 | #define CDC_MBIM_MIN_DATAGRAM_SIZE 2048 /* bytes */ | ||
57 | |||
58 | #define CDC_NCM_MIN_TX_PKT 512 /* bytes */ | ||
59 | |||
60 | /* Default value for MaxDatagramSize */ | ||
61 | #define CDC_NCM_MAX_DATAGRAM_SIZE 8192 /* bytes */ | ||
62 | |||
63 | /* | ||
64 | * Maximum amount of datagrams in NCM Datagram Pointer Table, not counting | ||
65 | * the last NULL entry. | ||
66 | */ | ||
67 | #define CDC_NCM_DPT_DATAGRAMS_MAX 40 | ||
68 | |||
69 | /* Restart the timer, if amount of datagrams is less than given value */ | ||
70 | #define CDC_NCM_RESTART_TIMER_DATAGRAM_CNT 3 | ||
71 | #define CDC_NCM_TIMER_PENDING_CNT 2 | ||
72 | #define CDC_NCM_TIMER_INTERVAL (400UL * NSEC_PER_USEC) | ||
73 | |||
74 | /* The following macro defines the minimum header space */ | ||
75 | #define CDC_NCM_MIN_HDR_SIZE \ | ||
76 | (sizeof(struct usb_cdc_ncm_nth16) + sizeof(struct usb_cdc_ncm_ndp16) + \ | ||
77 | (CDC_NCM_DPT_DATAGRAMS_MAX + 1) * sizeof(struct usb_cdc_ncm_dpe16)) | ||
78 | |||
79 | #define CDC_NCM_NDP_SIZE \ | ||
80 | (sizeof(struct usb_cdc_ncm_ndp16) + \ | ||
81 | (CDC_NCM_DPT_DATAGRAMS_MAX + 1) * sizeof(struct usb_cdc_ncm_dpe16)) | ||
82 | |||
83 | #define cdc_ncm_comm_intf_is_mbim(x) ((x)->desc.bInterfaceSubClass == USB_CDC_SUBCLASS_MBIM && \ | ||
84 | (x)->desc.bInterfaceProtocol == USB_CDC_PROTO_NONE) | ||
85 | #define cdc_ncm_data_intf_is_mbim(x) ((x)->desc.bInterfaceProtocol == USB_CDC_MBIM_PROTO_NTB) | ||
86 | |||
87 | struct cdc_ncm_ctx { | ||
88 | struct usb_cdc_ncm_ntb_parameters ncm_parm; | ||
89 | struct hrtimer tx_timer; | ||
90 | struct tasklet_struct bh; | ||
91 | |||
92 | const struct usb_cdc_ncm_desc *func_desc; | ||
93 | const struct usb_cdc_mbim_desc *mbim_desc; | ||
94 | const struct usb_cdc_header_desc *header_desc; | ||
95 | const struct usb_cdc_union_desc *union_desc; | ||
96 | const struct usb_cdc_ether_desc *ether_desc; | ||
97 | |||
98 | struct net_device *netdev; | ||
99 | struct usb_device *udev; | ||
100 | struct usb_host_endpoint *in_ep; | ||
101 | struct usb_host_endpoint *out_ep; | ||
102 | struct usb_host_endpoint *status_ep; | ||
103 | struct usb_interface *intf; | ||
104 | struct usb_interface *control; | ||
105 | struct usb_interface *data; | ||
106 | |||
107 | struct sk_buff *tx_curr_skb; | ||
108 | struct sk_buff *tx_rem_skb; | ||
109 | __le32 tx_rem_sign; | ||
110 | |||
111 | spinlock_t mtx; | ||
112 | atomic_t stop; | ||
113 | |||
114 | u32 tx_timer_pending; | ||
115 | u32 tx_curr_frame_num; | ||
116 | u32 rx_speed; | ||
117 | u32 tx_speed; | ||
118 | u32 rx_max; | ||
119 | u32 tx_max; | ||
120 | u32 max_datagram_size; | ||
121 | u16 tx_max_datagrams; | ||
122 | u16 tx_remainder; | ||
123 | u16 tx_modulus; | ||
124 | u16 tx_ndp_modulus; | ||
125 | u16 tx_seq; | ||
126 | u16 rx_seq; | ||
127 | u16 connected; | ||
128 | }; | ||
129 | |||
130 | extern int cdc_ncm_bind_common(struct usbnet *dev, struct usb_interface *intf, u8 data_altsetting); | ||
131 | extern void cdc_ncm_unbind(struct usbnet *dev, struct usb_interface *intf); | ||
132 | extern struct sk_buff *cdc_ncm_fill_tx_frame(struct cdc_ncm_ctx *ctx, struct sk_buff *skb, __le32 sign); | ||
133 | extern int cdc_ncm_rx_verify_nth16(struct cdc_ncm_ctx *ctx, struct sk_buff *skb_in); | ||
134 | extern int cdc_ncm_rx_verify_ndp16(struct sk_buff *skb_in, int ndpoffset); | ||
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h index ddbbb7de894b..9bbeabf66c54 100644 --- a/include/linux/usb/usbnet.h +++ b/include/linux/usb/usbnet.h | |||
@@ -163,6 +163,16 @@ extern int usbnet_resume(struct usb_interface *); | |||
163 | extern void usbnet_disconnect(struct usb_interface *); | 163 | extern void usbnet_disconnect(struct usb_interface *); |
164 | extern void usbnet_device_suggests_idle(struct usbnet *dev); | 164 | extern void usbnet_device_suggests_idle(struct usbnet *dev); |
165 | 165 | ||
166 | extern int usbnet_read_cmd(struct usbnet *dev, u8 cmd, u8 reqtype, | ||
167 | u16 value, u16 index, void *data, u16 size); | ||
168 | extern int usbnet_write_cmd(struct usbnet *dev, u8 cmd, u8 reqtype, | ||
169 | u16 value, u16 index, const void *data, u16 size); | ||
170 | extern int usbnet_read_cmd_nopm(struct usbnet *dev, u8 cmd, u8 reqtype, | ||
171 | u16 value, u16 index, void *data, u16 size); | ||
172 | extern int usbnet_write_cmd_nopm(struct usbnet *dev, u8 cmd, u8 reqtype, | ||
173 | u16 value, u16 index, const void *data, u16 size); | ||
174 | extern int usbnet_write_cmd_async(struct usbnet *dev, u8 cmd, u8 reqtype, | ||
175 | u16 value, u16 index, const void *data, u16 size); | ||
166 | 176 | ||
167 | /* Drivers that reuse some of the standard USB CDC infrastructure | 177 | /* Drivers that reuse some of the standard USB CDC infrastructure |
168 | * (notably, using multiple interfaces according to the CDC | 178 | * (notably, using multiple interfaces according to the CDC |
diff --git a/include/net/af_unix.h b/include/net/af_unix.h index b5f8988e4283..0a996a3517ed 100644 --- a/include/net/af_unix.h +++ b/include/net/af_unix.h | |||
@@ -53,7 +53,6 @@ struct unix_sock { | |||
53 | struct path path; | 53 | struct path path; |
54 | struct mutex readlock; | 54 | struct mutex readlock; |
55 | struct sock *peer; | 55 | struct sock *peer; |
56 | struct sock *other; | ||
57 | struct list_head link; | 56 | struct list_head link; |
58 | atomic_long_t inflight; | 57 | atomic_long_t inflight; |
59 | spinlock_t lock; | 58 | spinlock_t lock; |
diff --git a/include/net/bluetooth/a2mp.h b/include/net/bluetooth/a2mp.h index 6a76e0a0705e..42f21766c538 100644 --- a/include/net/bluetooth/a2mp.h +++ b/include/net/bluetooth/a2mp.h | |||
@@ -19,13 +19,25 @@ | |||
19 | 19 | ||
20 | #define A2MP_FEAT_EXT 0x8000 | 20 | #define A2MP_FEAT_EXT 0x8000 |
21 | 21 | ||
22 | enum amp_mgr_state { | ||
23 | READ_LOC_AMP_INFO, | ||
24 | READ_LOC_AMP_ASSOC, | ||
25 | READ_LOC_AMP_ASSOC_FINAL, | ||
26 | }; | ||
27 | |||
22 | struct amp_mgr { | 28 | struct amp_mgr { |
29 | struct list_head list; | ||
23 | struct l2cap_conn *l2cap_conn; | 30 | struct l2cap_conn *l2cap_conn; |
24 | struct l2cap_chan *a2mp_chan; | 31 | struct l2cap_chan *a2mp_chan; |
32 | struct l2cap_chan *bredr_chan; | ||
25 | struct kref kref; | 33 | struct kref kref; |
26 | __u8 ident; | 34 | __u8 ident; |
27 | __u8 handle; | 35 | __u8 handle; |
36 | enum amp_mgr_state state; | ||
28 | unsigned long flags; | 37 | unsigned long flags; |
38 | |||
39 | struct list_head amp_ctrls; | ||
40 | struct mutex amp_ctrls_lock; | ||
29 | }; | 41 | }; |
30 | 42 | ||
31 | struct a2mp_cmd { | 43 | struct a2mp_cmd { |
@@ -118,9 +130,19 @@ struct a2mp_physlink_rsp { | |||
118 | #define A2MP_STATUS_PHYS_LINK_EXISTS 0x05 | 130 | #define A2MP_STATUS_PHYS_LINK_EXISTS 0x05 |
119 | #define A2MP_STATUS_SECURITY_VIOLATION 0x06 | 131 | #define A2MP_STATUS_SECURITY_VIOLATION 0x06 |
120 | 132 | ||
121 | void amp_mgr_get(struct amp_mgr *mgr); | 133 | extern struct list_head amp_mgr_list; |
134 | extern struct mutex amp_mgr_list_lock; | ||
135 | |||
136 | struct amp_mgr *amp_mgr_get(struct amp_mgr *mgr); | ||
122 | int amp_mgr_put(struct amp_mgr *mgr); | 137 | int amp_mgr_put(struct amp_mgr *mgr); |
138 | u8 __next_ident(struct amp_mgr *mgr); | ||
123 | struct l2cap_chan *a2mp_channel_create(struct l2cap_conn *conn, | 139 | struct l2cap_chan *a2mp_channel_create(struct l2cap_conn *conn, |
124 | struct sk_buff *skb); | 140 | struct sk_buff *skb); |
141 | struct amp_mgr *amp_mgr_lookup_by_state(u8 state); | ||
142 | void a2mp_send(struct amp_mgr *mgr, u8 code, u8 ident, u16 len, void *data); | ||
143 | void a2mp_discover_amp(struct l2cap_chan *chan); | ||
144 | void a2mp_send_getinfo_rsp(struct hci_dev *hdev); | ||
145 | void a2mp_send_getampassoc_rsp(struct hci_dev *hdev, u8 status); | ||
146 | void a2mp_send_create_phy_link_req(struct hci_dev *hdev, u8 status); | ||
125 | 147 | ||
126 | #endif /* __A2MP_H */ | 148 | #endif /* __A2MP_H */ |
diff --git a/include/net/bluetooth/amp.h b/include/net/bluetooth/amp.h new file mode 100644 index 000000000000..7ea3db77ba89 --- /dev/null +++ b/include/net/bluetooth/amp.h | |||
@@ -0,0 +1,54 @@ | |||
1 | /* | ||
2 | Copyright (c) 2011,2012 Intel Corp. | ||
3 | |||
4 | This program is free software; you can redistribute it and/or modify | ||
5 | it under the terms of the GNU General Public License version 2 and | ||
6 | only version 2 as published by the Free Software Foundation. | ||
7 | |||
8 | This program is distributed in the hope that it will be useful, | ||
9 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | GNU General Public License for more details. | ||
12 | */ | ||
13 | |||
14 | #ifndef __AMP_H | ||
15 | #define __AMP_H | ||
16 | |||
17 | struct amp_ctrl { | ||
18 | struct list_head list; | ||
19 | struct kref kref; | ||
20 | __u8 id; | ||
21 | __u16 assoc_len_so_far; | ||
22 | __u16 assoc_rem_len; | ||
23 | __u16 assoc_len; | ||
24 | __u8 *assoc; | ||
25 | }; | ||
26 | |||
27 | int amp_ctrl_put(struct amp_ctrl *ctrl); | ||
28 | void amp_ctrl_get(struct amp_ctrl *ctrl); | ||
29 | struct amp_ctrl *amp_ctrl_add(struct amp_mgr *mgr, u8 id); | ||
30 | struct amp_ctrl *amp_ctrl_lookup(struct amp_mgr *mgr, u8 id); | ||
31 | void amp_ctrl_list_flush(struct amp_mgr *mgr); | ||
32 | |||
33 | struct hci_conn *phylink_add(struct hci_dev *hdev, struct amp_mgr *mgr, | ||
34 | u8 remote_id, bool out); | ||
35 | |||
36 | int phylink_gen_key(struct hci_conn *hcon, u8 *data, u8 *len, u8 *type); | ||
37 | |||
38 | void amp_read_loc_info(struct hci_dev *hdev, struct amp_mgr *mgr); | ||
39 | void amp_read_loc_assoc_frag(struct hci_dev *hdev, u8 phy_handle); | ||
40 | void amp_read_loc_assoc(struct hci_dev *hdev, struct amp_mgr *mgr); | ||
41 | void amp_read_loc_assoc_final_data(struct hci_dev *hdev, | ||
42 | struct hci_conn *hcon); | ||
43 | void amp_create_phylink(struct hci_dev *hdev, struct amp_mgr *mgr, | ||
44 | struct hci_conn *hcon); | ||
45 | void amp_accept_phylink(struct hci_dev *hdev, struct amp_mgr *mgr, | ||
46 | struct hci_conn *hcon); | ||
47 | void amp_write_remote_assoc(struct hci_dev *hdev, u8 handle); | ||
48 | void amp_write_rem_assoc_continue(struct hci_dev *hdev, u8 handle); | ||
49 | void amp_physical_cfm(struct hci_conn *bredr_hcon, struct hci_conn *hs_hcon); | ||
50 | void amp_create_logical_link(struct l2cap_chan *chan); | ||
51 | void amp_disconnect_logical_link(struct hci_chan *hchan); | ||
52 | void amp_destroy_logical_link(struct hci_chan *hchan, u8 reason); | ||
53 | |||
54 | #endif /* __AMP_H */ | ||
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index ede036977ae8..2554b3f5222a 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
@@ -180,7 +180,6 @@ static inline void bacpy(bdaddr_t *dst, bdaddr_t *src) | |||
180 | } | 180 | } |
181 | 181 | ||
182 | void baswap(bdaddr_t *dst, bdaddr_t *src); | 182 | void baswap(bdaddr_t *dst, bdaddr_t *src); |
183 | char *batostr(bdaddr_t *ba); | ||
184 | 183 | ||
185 | /* Common socket structures and functions */ | 184 | /* Common socket structures and functions */ |
186 | 185 | ||
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 76b2b6bdcf36..45eee08157bb 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
@@ -33,6 +33,8 @@ | |||
33 | #define HCI_LINK_KEY_SIZE 16 | 33 | #define HCI_LINK_KEY_SIZE 16 |
34 | #define HCI_AMP_LINK_KEY_SIZE (2 * HCI_LINK_KEY_SIZE) | 34 | #define HCI_AMP_LINK_KEY_SIZE (2 * HCI_LINK_KEY_SIZE) |
35 | 35 | ||
36 | #define HCI_MAX_AMP_ASSOC_SIZE 672 | ||
37 | |||
36 | /* HCI dev events */ | 38 | /* HCI dev events */ |
37 | #define HCI_DEV_REG 1 | 39 | #define HCI_DEV_REG 1 |
38 | #define HCI_DEV_UNREG 2 | 40 | #define HCI_DEV_UNREG 2 |
@@ -113,6 +115,7 @@ enum { | |||
113 | HCI_SSP_ENABLED, | 115 | HCI_SSP_ENABLED, |
114 | HCI_HS_ENABLED, | 116 | HCI_HS_ENABLED, |
115 | HCI_LE_ENABLED, | 117 | HCI_LE_ENABLED, |
118 | HCI_LE_PERIPHERAL, | ||
116 | HCI_CONNECTABLE, | 119 | HCI_CONNECTABLE, |
117 | HCI_DISCOVERABLE, | 120 | HCI_DISCOVERABLE, |
118 | HCI_LINK_SECURITY, | 121 | HCI_LINK_SECURITY, |
@@ -151,7 +154,7 @@ enum { | |||
151 | #define HCI_DISCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ | 154 | #define HCI_DISCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ |
152 | #define HCI_PAIRING_TIMEOUT msecs_to_jiffies(60000) /* 60 seconds */ | 155 | #define HCI_PAIRING_TIMEOUT msecs_to_jiffies(60000) /* 60 seconds */ |
153 | #define HCI_INIT_TIMEOUT msecs_to_jiffies(10000) /* 10 seconds */ | 156 | #define HCI_INIT_TIMEOUT msecs_to_jiffies(10000) /* 10 seconds */ |
154 | #define HCI_CMD_TIMEOUT msecs_to_jiffies(1000) /* 1 second */ | 157 | #define HCI_CMD_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ |
155 | #define HCI_ACL_TX_TIMEOUT msecs_to_jiffies(45000) /* 45 seconds */ | 158 | #define HCI_ACL_TX_TIMEOUT msecs_to_jiffies(45000) /* 45 seconds */ |
156 | #define HCI_AUTO_OFF_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ | 159 | #define HCI_AUTO_OFF_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ |
157 | 160 | ||
@@ -196,6 +199,7 @@ enum { | |||
196 | #define ACL_START_NO_FLUSH 0x00 | 199 | #define ACL_START_NO_FLUSH 0x00 |
197 | #define ACL_CONT 0x01 | 200 | #define ACL_CONT 0x01 |
198 | #define ACL_START 0x02 | 201 | #define ACL_START 0x02 |
202 | #define ACL_COMPLETE 0x03 | ||
199 | #define ACL_ACTIVE_BCAST 0x04 | 203 | #define ACL_ACTIVE_BCAST 0x04 |
200 | #define ACL_PICO_BCAST 0x08 | 204 | #define ACL_PICO_BCAST 0x08 |
201 | 205 | ||
@@ -205,6 +209,7 @@ enum { | |||
205 | #define ESCO_LINK 0x02 | 209 | #define ESCO_LINK 0x02 |
206 | /* Low Energy links do not have defined link type. Use invented one */ | 210 | /* Low Energy links do not have defined link type. Use invented one */ |
207 | #define LE_LINK 0x80 | 211 | #define LE_LINK 0x80 |
212 | #define AMP_LINK 0x81 | ||
208 | 213 | ||
209 | /* LMP features */ | 214 | /* LMP features */ |
210 | #define LMP_3SLOT 0x01 | 215 | #define LMP_3SLOT 0x01 |
@@ -314,6 +319,9 @@ enum { | |||
314 | #define HCI_FLOW_CTL_MODE_PACKET_BASED 0x00 | 319 | #define HCI_FLOW_CTL_MODE_PACKET_BASED 0x00 |
315 | #define HCI_FLOW_CTL_MODE_BLOCK_BASED 0x01 | 320 | #define HCI_FLOW_CTL_MODE_BLOCK_BASED 0x01 |
316 | 321 | ||
322 | /* The core spec defines 127 as the "not available" value */ | ||
323 | #define HCI_TX_POWER_INVALID 127 | ||
324 | |||
317 | /* Extended Inquiry Response field types */ | 325 | /* Extended Inquiry Response field types */ |
318 | #define EIR_FLAGS 0x01 /* flags */ | 326 | #define EIR_FLAGS 0x01 /* flags */ |
319 | #define EIR_UUID16_SOME 0x02 /* 16-bit UUID, more available */ | 327 | #define EIR_UUID16_SOME 0x02 /* 16-bit UUID, more available */ |
@@ -330,6 +338,13 @@ enum { | |||
330 | #define EIR_SSP_RAND_R 0x0F /* Simple Pairing Randomizer R */ | 338 | #define EIR_SSP_RAND_R 0x0F /* Simple Pairing Randomizer R */ |
331 | #define EIR_DEVICE_ID 0x10 /* device ID */ | 339 | #define EIR_DEVICE_ID 0x10 /* device ID */ |
332 | 340 | ||
341 | /* Low Energy Advertising Flags */ | ||
342 | #define LE_AD_LIMITED 0x01 /* Limited Discoverable */ | ||
343 | #define LE_AD_GENERAL 0x02 /* General Discoverable */ | ||
344 | #define LE_AD_NO_BREDR 0x04 /* BR/EDR not supported */ | ||
345 | #define LE_AD_SIM_LE_BREDR_CTRL 0x08 /* Simultaneous LE & BR/EDR Controller */ | ||
346 | #define LE_AD_SIM_LE_BREDR_HOST 0x10 /* Simultaneous LE & BR/EDR Host */ | ||
347 | |||
333 | /* ----- HCI Commands ---- */ | 348 | /* ----- HCI Commands ---- */ |
334 | #define HCI_OP_NOP 0x0000 | 349 | #define HCI_OP_NOP 0x0000 |
335 | 350 | ||
@@ -556,12 +571,46 @@ struct hci_cp_accept_phy_link { | |||
556 | __u8 key[HCI_AMP_LINK_KEY_SIZE]; | 571 | __u8 key[HCI_AMP_LINK_KEY_SIZE]; |
557 | } __packed; | 572 | } __packed; |
558 | 573 | ||
559 | #define HCI_OP_DISCONN_PHY_LINK 0x0437 | 574 | #define HCI_OP_DISCONN_PHY_LINK 0x0437 |
560 | struct hci_cp_disconn_phy_link { | 575 | struct hci_cp_disconn_phy_link { |
561 | __u8 phy_handle; | 576 | __u8 phy_handle; |
562 | __u8 reason; | 577 | __u8 reason; |
563 | } __packed; | 578 | } __packed; |
564 | 579 | ||
580 | struct ext_flow_spec { | ||
581 | __u8 id; | ||
582 | __u8 stype; | ||
583 | __le16 msdu; | ||
584 | __le32 sdu_itime; | ||
585 | __le32 acc_lat; | ||
586 | __le32 flush_to; | ||
587 | } __packed; | ||
588 | |||
589 | #define HCI_OP_CREATE_LOGICAL_LINK 0x0438 | ||
590 | #define HCI_OP_ACCEPT_LOGICAL_LINK 0x0439 | ||
591 | struct hci_cp_create_accept_logical_link { | ||
592 | __u8 phy_handle; | ||
593 | struct ext_flow_spec tx_flow_spec; | ||
594 | struct ext_flow_spec rx_flow_spec; | ||
595 | } __packed; | ||
596 | |||
597 | #define HCI_OP_DISCONN_LOGICAL_LINK 0x043a | ||
598 | struct hci_cp_disconn_logical_link { | ||
599 | __le16 log_handle; | ||
600 | } __packed; | ||
601 | |||
602 | #define HCI_OP_LOGICAL_LINK_CANCEL 0x043b | ||
603 | struct hci_cp_logical_link_cancel { | ||
604 | __u8 phy_handle; | ||
605 | __u8 flow_spec_id; | ||
606 | } __packed; | ||
607 | |||
608 | struct hci_rp_logical_link_cancel { | ||
609 | __u8 status; | ||
610 | __u8 phy_handle; | ||
611 | __u8 flow_spec_id; | ||
612 | } __packed; | ||
613 | |||
565 | #define HCI_OP_SNIFF_MODE 0x0803 | 614 | #define HCI_OP_SNIFF_MODE 0x0803 |
566 | struct hci_cp_sniff_mode { | 615 | struct hci_cp_sniff_mode { |
567 | __le16 handle; | 616 | __le16 handle; |
@@ -894,6 +943,22 @@ struct hci_rp_le_read_buffer_size { | |||
894 | __u8 le_max_pkt; | 943 | __u8 le_max_pkt; |
895 | } __packed; | 944 | } __packed; |
896 | 945 | ||
946 | #define HCI_OP_LE_READ_ADV_TX_POWER 0x2007 | ||
947 | struct hci_rp_le_read_adv_tx_power { | ||
948 | __u8 status; | ||
949 | __s8 tx_power; | ||
950 | } __packed; | ||
951 | |||
952 | #define HCI_MAX_AD_LENGTH 31 | ||
953 | |||
954 | #define HCI_OP_LE_SET_ADV_DATA 0x2008 | ||
955 | struct hci_cp_le_set_adv_data { | ||
956 | __u8 length; | ||
957 | __u8 data[HCI_MAX_AD_LENGTH]; | ||
958 | } __packed; | ||
959 | |||
960 | #define HCI_OP_LE_SET_ADV_ENABLE 0x200a | ||
961 | |||
897 | #define HCI_OP_LE_SET_SCAN_PARAM 0x200b | 962 | #define HCI_OP_LE_SET_SCAN_PARAM 0x200b |
898 | struct hci_cp_le_set_scan_param { | 963 | struct hci_cp_le_set_scan_param { |
899 | __u8 type; | 964 | __u8 type; |
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index e7d454609881..ef5b85dac3f7 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -73,6 +73,7 @@ struct discovery_state { | |||
73 | struct hci_conn_hash { | 73 | struct hci_conn_hash { |
74 | struct list_head list; | 74 | struct list_head list; |
75 | unsigned int acl_num; | 75 | unsigned int acl_num; |
76 | unsigned int amp_num; | ||
76 | unsigned int sco_num; | 77 | unsigned int sco_num; |
77 | unsigned int le_num; | 78 | unsigned int le_num; |
78 | }; | 79 | }; |
@@ -124,6 +125,14 @@ struct le_scan_params { | |||
124 | 125 | ||
125 | #define HCI_MAX_SHORT_NAME_LENGTH 10 | 126 | #define HCI_MAX_SHORT_NAME_LENGTH 10 |
126 | 127 | ||
128 | struct amp_assoc { | ||
129 | __u16 len; | ||
130 | __u16 offset; | ||
131 | __u16 rem_len; | ||
132 | __u16 len_so_far; | ||
133 | __u8 data[HCI_MAX_AMP_ASSOC_SIZE]; | ||
134 | }; | ||
135 | |||
127 | #define NUM_REASSEMBLY 4 | 136 | #define NUM_REASSEMBLY 4 |
128 | struct hci_dev { | 137 | struct hci_dev { |
129 | struct list_head list; | 138 | struct list_head list; |
@@ -177,6 +186,8 @@ struct hci_dev { | |||
177 | __u32 amp_max_flush_to; | 186 | __u32 amp_max_flush_to; |
178 | __u32 amp_be_flush_to; | 187 | __u32 amp_be_flush_to; |
179 | 188 | ||
189 | struct amp_assoc loc_assoc; | ||
190 | |||
180 | __u8 flow_ctl_mode; | 191 | __u8 flow_ctl_mode; |
181 | 192 | ||
182 | unsigned int auto_accept_delay; | 193 | unsigned int auto_accept_delay; |
@@ -252,8 +263,6 @@ struct hci_dev { | |||
252 | 263 | ||
253 | struct sk_buff_head driver_init; | 264 | struct sk_buff_head driver_init; |
254 | 265 | ||
255 | void *core_data; | ||
256 | |||
257 | atomic_t promisc; | 266 | atomic_t promisc; |
258 | 267 | ||
259 | struct dentry *debugfs; | 268 | struct dentry *debugfs; |
@@ -269,6 +278,10 @@ struct hci_dev { | |||
269 | struct work_struct le_scan; | 278 | struct work_struct le_scan; |
270 | struct le_scan_params le_scan_params; | 279 | struct le_scan_params le_scan_params; |
271 | 280 | ||
281 | __s8 adv_tx_power; | ||
282 | __u8 adv_data[HCI_MAX_AD_LENGTH]; | ||
283 | __u8 adv_data_len; | ||
284 | |||
272 | int (*open)(struct hci_dev *hdev); | 285 | int (*open)(struct hci_dev *hdev); |
273 | int (*close)(struct hci_dev *hdev); | 286 | int (*close)(struct hci_dev *hdev); |
274 | int (*flush)(struct hci_dev *hdev); | 287 | int (*flush)(struct hci_dev *hdev); |
@@ -277,6 +290,8 @@ struct hci_dev { | |||
277 | int (*ioctl)(struct hci_dev *hdev, unsigned int cmd, unsigned long arg); | 290 | int (*ioctl)(struct hci_dev *hdev, unsigned int cmd, unsigned long arg); |
278 | }; | 291 | }; |
279 | 292 | ||
293 | #define HCI_PHY_HANDLE(handle) (handle & 0xff) | ||
294 | |||
280 | struct hci_conn { | 295 | struct hci_conn { |
281 | struct list_head list; | 296 | struct list_head list; |
282 | 297 | ||
@@ -310,6 +325,7 @@ struct hci_conn { | |||
310 | 325 | ||
311 | __u8 remote_cap; | 326 | __u8 remote_cap; |
312 | __u8 remote_auth; | 327 | __u8 remote_auth; |
328 | __u8 remote_id; | ||
313 | bool flush_key; | 329 | bool flush_key; |
314 | 330 | ||
315 | unsigned int sent; | 331 | unsigned int sent; |
@@ -339,10 +355,11 @@ struct hci_conn { | |||
339 | 355 | ||
340 | struct hci_chan { | 356 | struct hci_chan { |
341 | struct list_head list; | 357 | struct list_head list; |
342 | 358 | __u16 handle; | |
343 | struct hci_conn *conn; | 359 | struct hci_conn *conn; |
344 | struct sk_buff_head data_q; | 360 | struct sk_buff_head data_q; |
345 | unsigned int sent; | 361 | unsigned int sent; |
362 | __u8 state; | ||
346 | }; | 363 | }; |
347 | 364 | ||
348 | extern struct list_head hci_dev_list; | 365 | extern struct list_head hci_dev_list; |
@@ -438,6 +455,9 @@ static inline void hci_conn_hash_add(struct hci_dev *hdev, struct hci_conn *c) | |||
438 | case ACL_LINK: | 455 | case ACL_LINK: |
439 | h->acl_num++; | 456 | h->acl_num++; |
440 | break; | 457 | break; |
458 | case AMP_LINK: | ||
459 | h->amp_num++; | ||
460 | break; | ||
441 | case LE_LINK: | 461 | case LE_LINK: |
442 | h->le_num++; | 462 | h->le_num++; |
443 | break; | 463 | break; |
@@ -459,6 +479,9 @@ static inline void hci_conn_hash_del(struct hci_dev *hdev, struct hci_conn *c) | |||
459 | case ACL_LINK: | 479 | case ACL_LINK: |
460 | h->acl_num--; | 480 | h->acl_num--; |
461 | break; | 481 | break; |
482 | case AMP_LINK: | ||
483 | h->amp_num--; | ||
484 | break; | ||
462 | case LE_LINK: | 485 | case LE_LINK: |
463 | h->le_num--; | 486 | h->le_num--; |
464 | break; | 487 | break; |
@@ -475,6 +498,8 @@ static inline unsigned int hci_conn_num(struct hci_dev *hdev, __u8 type) | |||
475 | switch (type) { | 498 | switch (type) { |
476 | case ACL_LINK: | 499 | case ACL_LINK: |
477 | return h->acl_num; | 500 | return h->acl_num; |
501 | case AMP_LINK: | ||
502 | return h->amp_num; | ||
478 | case LE_LINK: | 503 | case LE_LINK: |
479 | return h->le_num; | 504 | return h->le_num; |
480 | case SCO_LINK: | 505 | case SCO_LINK: |
@@ -556,6 +581,7 @@ void hci_conn_check_pending(struct hci_dev *hdev); | |||
556 | struct hci_chan *hci_chan_create(struct hci_conn *conn); | 581 | struct hci_chan *hci_chan_create(struct hci_conn *conn); |
557 | void hci_chan_del(struct hci_chan *chan); | 582 | void hci_chan_del(struct hci_chan *chan); |
558 | void hci_chan_list_flush(struct hci_conn *conn); | 583 | void hci_chan_list_flush(struct hci_conn *conn); |
584 | struct hci_chan *hci_chan_lookup_handle(struct hci_dev *hdev, __u16 handle); | ||
559 | 585 | ||
560 | struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, | 586 | struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, |
561 | __u8 dst_type, __u8 sec_level, __u8 auth_type); | 587 | __u8 dst_type, __u8 sec_level, __u8 auth_type); |
@@ -584,7 +610,10 @@ static inline void hci_conn_put(struct hci_conn *conn) | |||
584 | 610 | ||
585 | if (atomic_dec_and_test(&conn->refcnt)) { | 611 | if (atomic_dec_and_test(&conn->refcnt)) { |
586 | unsigned long timeo; | 612 | unsigned long timeo; |
587 | if (conn->type == ACL_LINK || conn->type == LE_LINK) { | 613 | |
614 | switch (conn->type) { | ||
615 | case ACL_LINK: | ||
616 | case LE_LINK: | ||
588 | del_timer(&conn->idle_timer); | 617 | del_timer(&conn->idle_timer); |
589 | if (conn->state == BT_CONNECTED) { | 618 | if (conn->state == BT_CONNECTED) { |
590 | timeo = conn->disc_timeout; | 619 | timeo = conn->disc_timeout; |
@@ -593,12 +622,20 @@ static inline void hci_conn_put(struct hci_conn *conn) | |||
593 | } else { | 622 | } else { |
594 | timeo = msecs_to_jiffies(10); | 623 | timeo = msecs_to_jiffies(10); |
595 | } | 624 | } |
596 | } else { | 625 | break; |
626 | |||
627 | case AMP_LINK: | ||
628 | timeo = conn->disc_timeout; | ||
629 | break; | ||
630 | |||
631 | default: | ||
597 | timeo = msecs_to_jiffies(10); | 632 | timeo = msecs_to_jiffies(10); |
633 | break; | ||
598 | } | 634 | } |
635 | |||
599 | cancel_delayed_work(&conn->disc_work); | 636 | cancel_delayed_work(&conn->disc_work); |
600 | queue_delayed_work(conn->hdev->workqueue, | 637 | queue_delayed_work(conn->hdev->workqueue, |
601 | &conn->disc_work, timeo); | 638 | &conn->disc_work, timeo); |
602 | } | 639 | } |
603 | } | 640 | } |
604 | 641 | ||
@@ -650,7 +687,7 @@ static inline uint8_t __hci_num_ctrl(void) | |||
650 | } | 687 | } |
651 | 688 | ||
652 | struct hci_dev *hci_dev_get(int index); | 689 | struct hci_dev *hci_dev_get(int index); |
653 | struct hci_dev *hci_get_route(bdaddr_t *src, bdaddr_t *dst); | 690 | struct hci_dev *hci_get_route(bdaddr_t *dst, bdaddr_t *src); |
654 | 691 | ||
655 | struct hci_dev *hci_alloc_dev(void); | 692 | struct hci_dev *hci_alloc_dev(void); |
656 | void hci_free_dev(struct hci_dev *hdev); | 693 | void hci_free_dev(struct hci_dev *hdev); |
@@ -699,6 +736,8 @@ int hci_add_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 *hash, | |||
699 | u8 *randomizer); | 736 | u8 *randomizer); |
700 | int hci_remove_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr); | 737 | int hci_remove_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr); |
701 | 738 | ||
739 | int hci_update_ad(struct hci_dev *hdev); | ||
740 | |||
702 | void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); | 741 | void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); |
703 | 742 | ||
704 | int hci_recv_frame(struct sk_buff *skb); | 743 | int hci_recv_frame(struct sk_buff *skb); |
@@ -715,18 +754,29 @@ void hci_conn_del_sysfs(struct hci_conn *conn); | |||
715 | #define SET_HCIDEV_DEV(hdev, pdev) ((hdev)->dev.parent = (pdev)) | 754 | #define SET_HCIDEV_DEV(hdev, pdev) ((hdev)->dev.parent = (pdev)) |
716 | 755 | ||
717 | /* ----- LMP capabilities ----- */ | 756 | /* ----- LMP capabilities ----- */ |
718 | #define lmp_rswitch_capable(dev) ((dev)->features[0] & LMP_RSWITCH) | ||
719 | #define lmp_encrypt_capable(dev) ((dev)->features[0] & LMP_ENCRYPT) | 757 | #define lmp_encrypt_capable(dev) ((dev)->features[0] & LMP_ENCRYPT) |
758 | #define lmp_rswitch_capable(dev) ((dev)->features[0] & LMP_RSWITCH) | ||
759 | #define lmp_hold_capable(dev) ((dev)->features[0] & LMP_HOLD) | ||
720 | #define lmp_sniff_capable(dev) ((dev)->features[0] & LMP_SNIFF) | 760 | #define lmp_sniff_capable(dev) ((dev)->features[0] & LMP_SNIFF) |
721 | #define lmp_sniffsubr_capable(dev) ((dev)->features[5] & LMP_SNIFF_SUBR) | 761 | #define lmp_park_capable(dev) ((dev)->features[1] & LMP_PARK) |
762 | #define lmp_inq_rssi_capable(dev) ((dev)->features[3] & LMP_RSSI_INQ) | ||
722 | #define lmp_esco_capable(dev) ((dev)->features[3] & LMP_ESCO) | 763 | #define lmp_esco_capable(dev) ((dev)->features[3] & LMP_ESCO) |
764 | #define lmp_bredr_capable(dev) (!((dev)->features[4] & LMP_NO_BREDR)) | ||
765 | #define lmp_le_capable(dev) ((dev)->features[4] & LMP_LE) | ||
766 | #define lmp_sniffsubr_capable(dev) ((dev)->features[5] & LMP_SNIFF_SUBR) | ||
767 | #define lmp_pause_enc_capable(dev) ((dev)->features[5] & LMP_PAUSE_ENC) | ||
768 | #define lmp_ext_inq_capable(dev) ((dev)->features[6] & LMP_EXT_INQ) | ||
769 | #define lmp_le_br_capable(dev) ((dev)->features[6] & LMP_SIMUL_LE_BR) | ||
723 | #define lmp_ssp_capable(dev) ((dev)->features[6] & LMP_SIMPLE_PAIR) | 770 | #define lmp_ssp_capable(dev) ((dev)->features[6] & LMP_SIMPLE_PAIR) |
724 | #define lmp_no_flush_capable(dev) ((dev)->features[6] & LMP_NO_FLUSH) | 771 | #define lmp_no_flush_capable(dev) ((dev)->features[6] & LMP_NO_FLUSH) |
725 | #define lmp_le_capable(dev) ((dev)->features[4] & LMP_LE) | 772 | #define lmp_lsto_capable(dev) ((dev)->features[7] & LMP_LSTO) |
726 | #define lmp_bredr_capable(dev) (!((dev)->features[4] & LMP_NO_BREDR)) | 773 | #define lmp_inq_tx_pwr_capable(dev) ((dev)->features[7] & LMP_INQ_TX_PWR) |
774 | #define lmp_ext_feat_capable(dev) ((dev)->features[7] & LMP_EXTFEATURES) | ||
727 | 775 | ||
728 | /* ----- Extended LMP capabilities ----- */ | 776 | /* ----- Extended LMP capabilities ----- */ |
777 | #define lmp_host_ssp_capable(dev) ((dev)->host_features[0] & LMP_HOST_SSP) | ||
729 | #define lmp_host_le_capable(dev) ((dev)->host_features[0] & LMP_HOST_LE) | 778 | #define lmp_host_le_capable(dev) ((dev)->host_features[0] & LMP_HOST_LE) |
779 | #define lmp_host_le_br_capable(dev) ((dev)->host_features[0] & LMP_HOST_LE_BREDR) | ||
730 | 780 | ||
731 | /* ----- HCI protocols ----- */ | 781 | /* ----- HCI protocols ----- */ |
732 | static inline int hci_proto_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, | 782 | static inline int hci_proto_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, |
@@ -789,6 +839,10 @@ static inline void hci_proto_disconn_cfm(struct hci_conn *conn, __u8 reason) | |||
789 | sco_disconn_cfm(conn, reason); | 839 | sco_disconn_cfm(conn, reason); |
790 | break; | 840 | break; |
791 | 841 | ||
842 | /* L2CAP would be handled for BREDR chan */ | ||
843 | case AMP_LINK: | ||
844 | break; | ||
845 | |||
792 | default: | 846 | default: |
793 | BT_ERR("unknown link type %d", conn->type); | 847 | BT_ERR("unknown link type %d", conn->type); |
794 | break; | 848 | break; |
@@ -841,7 +895,7 @@ struct hci_cb { | |||
841 | 895 | ||
842 | static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status) | 896 | static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status) |
843 | { | 897 | { |
844 | struct list_head *p; | 898 | struct hci_cb *cb; |
845 | __u8 encrypt; | 899 | __u8 encrypt; |
846 | 900 | ||
847 | hci_proto_auth_cfm(conn, status); | 901 | hci_proto_auth_cfm(conn, status); |
@@ -852,8 +906,7 @@ static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status) | |||
852 | encrypt = (conn->link_mode & HCI_LM_ENCRYPT) ? 0x01 : 0x00; | 906 | encrypt = (conn->link_mode & HCI_LM_ENCRYPT) ? 0x01 : 0x00; |
853 | 907 | ||
854 | read_lock(&hci_cb_list_lock); | 908 | read_lock(&hci_cb_list_lock); |
855 | list_for_each(p, &hci_cb_list) { | 909 | list_for_each_entry(cb, &hci_cb_list, list) { |
856 | struct hci_cb *cb = list_entry(p, struct hci_cb, list); | ||
857 | if (cb->security_cfm) | 910 | if (cb->security_cfm) |
858 | cb->security_cfm(conn, status, encrypt); | 911 | cb->security_cfm(conn, status, encrypt); |
859 | } | 912 | } |
@@ -863,7 +916,7 @@ static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status) | |||
863 | static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status, | 916 | static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status, |
864 | __u8 encrypt) | 917 | __u8 encrypt) |
865 | { | 918 | { |
866 | struct list_head *p; | 919 | struct hci_cb *cb; |
867 | 920 | ||
868 | if (conn->sec_level == BT_SECURITY_SDP) | 921 | if (conn->sec_level == BT_SECURITY_SDP) |
869 | conn->sec_level = BT_SECURITY_LOW; | 922 | conn->sec_level = BT_SECURITY_LOW; |
@@ -874,8 +927,7 @@ static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status, | |||
874 | hci_proto_encrypt_cfm(conn, status, encrypt); | 927 | hci_proto_encrypt_cfm(conn, status, encrypt); |
875 | 928 | ||
876 | read_lock(&hci_cb_list_lock); | 929 | read_lock(&hci_cb_list_lock); |
877 | list_for_each(p, &hci_cb_list) { | 930 | list_for_each_entry(cb, &hci_cb_list, list) { |
878 | struct hci_cb *cb = list_entry(p, struct hci_cb, list); | ||
879 | if (cb->security_cfm) | 931 | if (cb->security_cfm) |
880 | cb->security_cfm(conn, status, encrypt); | 932 | cb->security_cfm(conn, status, encrypt); |
881 | } | 933 | } |
@@ -884,11 +936,10 @@ static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status, | |||
884 | 936 | ||
885 | static inline void hci_key_change_cfm(struct hci_conn *conn, __u8 status) | 937 | static inline void hci_key_change_cfm(struct hci_conn *conn, __u8 status) |
886 | { | 938 | { |
887 | struct list_head *p; | 939 | struct hci_cb *cb; |
888 | 940 | ||
889 | read_lock(&hci_cb_list_lock); | 941 | read_lock(&hci_cb_list_lock); |
890 | list_for_each(p, &hci_cb_list) { | 942 | list_for_each_entry(cb, &hci_cb_list, list) { |
891 | struct hci_cb *cb = list_entry(p, struct hci_cb, list); | ||
892 | if (cb->key_change_cfm) | 943 | if (cb->key_change_cfm) |
893 | cb->key_change_cfm(conn, status); | 944 | cb->key_change_cfm(conn, status); |
894 | } | 945 | } |
@@ -898,11 +949,10 @@ static inline void hci_key_change_cfm(struct hci_conn *conn, __u8 status) | |||
898 | static inline void hci_role_switch_cfm(struct hci_conn *conn, __u8 status, | 949 | static inline void hci_role_switch_cfm(struct hci_conn *conn, __u8 status, |
899 | __u8 role) | 950 | __u8 role) |
900 | { | 951 | { |
901 | struct list_head *p; | 952 | struct hci_cb *cb; |
902 | 953 | ||
903 | read_lock(&hci_cb_list_lock); | 954 | read_lock(&hci_cb_list_lock); |
904 | list_for_each(p, &hci_cb_list) { | 955 | list_for_each_entry(cb, &hci_cb_list, list) { |
905 | struct hci_cb *cb = list_entry(p, struct hci_cb, list); | ||
906 | if (cb->role_switch_cfm) | 956 | if (cb->role_switch_cfm) |
907 | cb->role_switch_cfm(conn, status, role); | 957 | cb->role_switch_cfm(conn, status, role); |
908 | } | 958 | } |
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index 7ed8e356425a..f57fab04e7c5 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h | |||
@@ -32,13 +32,14 @@ | |||
32 | /* L2CAP defaults */ | 32 | /* L2CAP defaults */ |
33 | #define L2CAP_DEFAULT_MTU 672 | 33 | #define L2CAP_DEFAULT_MTU 672 |
34 | #define L2CAP_DEFAULT_MIN_MTU 48 | 34 | #define L2CAP_DEFAULT_MIN_MTU 48 |
35 | #define L2CAP_DEFAULT_FLUSH_TO 0xffff | 35 | #define L2CAP_DEFAULT_FLUSH_TO 0xFFFF |
36 | #define L2CAP_EFS_DEFAULT_FLUSH_TO 0xFFFFFFFF | ||
36 | #define L2CAP_DEFAULT_TX_WINDOW 63 | 37 | #define L2CAP_DEFAULT_TX_WINDOW 63 |
37 | #define L2CAP_DEFAULT_EXT_WINDOW 0x3FFF | 38 | #define L2CAP_DEFAULT_EXT_WINDOW 0x3FFF |
38 | #define L2CAP_DEFAULT_MAX_TX 3 | 39 | #define L2CAP_DEFAULT_MAX_TX 3 |
39 | #define L2CAP_DEFAULT_RETRANS_TO 2000 /* 2 seconds */ | 40 | #define L2CAP_DEFAULT_RETRANS_TO 2000 /* 2 seconds */ |
40 | #define L2CAP_DEFAULT_MONITOR_TO 12000 /* 12 seconds */ | 41 | #define L2CAP_DEFAULT_MONITOR_TO 12000 /* 12 seconds */ |
41 | #define L2CAP_DEFAULT_MAX_PDU_SIZE 1009 /* Sized for 3-DH5 packet */ | 42 | #define L2CAP_DEFAULT_MAX_PDU_SIZE 1492 /* Sized for AMP packet */ |
42 | #define L2CAP_DEFAULT_ACK_TO 200 | 43 | #define L2CAP_DEFAULT_ACK_TO 200 |
43 | #define L2CAP_DEFAULT_MAX_SDU_SIZE 0xFFFF | 44 | #define L2CAP_DEFAULT_MAX_SDU_SIZE 0xFFFF |
44 | #define L2CAP_DEFAULT_SDU_ITIME 0xFFFFFFFF | 45 | #define L2CAP_DEFAULT_SDU_ITIME 0xFFFFFFFF |
@@ -51,6 +52,8 @@ | |||
51 | #define L2CAP_ENC_TIMEOUT msecs_to_jiffies(5000) | 52 | #define L2CAP_ENC_TIMEOUT msecs_to_jiffies(5000) |
52 | #define L2CAP_CONN_TIMEOUT msecs_to_jiffies(40000) | 53 | #define L2CAP_CONN_TIMEOUT msecs_to_jiffies(40000) |
53 | #define L2CAP_INFO_TIMEOUT msecs_to_jiffies(4000) | 54 | #define L2CAP_INFO_TIMEOUT msecs_to_jiffies(4000) |
55 | #define L2CAP_MOVE_TIMEOUT msecs_to_jiffies(4000) | ||
56 | #define L2CAP_MOVE_ERTX_TIMEOUT msecs_to_jiffies(60000) | ||
54 | 57 | ||
55 | #define L2CAP_A2MP_DEFAULT_MTU 670 | 58 | #define L2CAP_A2MP_DEFAULT_MTU 670 |
56 | 59 | ||
@@ -433,6 +436,8 @@ struct l2cap_chan { | |||
433 | struct sock *sk; | 436 | struct sock *sk; |
434 | 437 | ||
435 | struct l2cap_conn *conn; | 438 | struct l2cap_conn *conn; |
439 | struct hci_conn *hs_hcon; | ||
440 | struct hci_chan *hs_hchan; | ||
436 | struct kref kref; | 441 | struct kref kref; |
437 | 442 | ||
438 | __u8 state; | 443 | __u8 state; |
@@ -476,6 +481,12 @@ struct l2cap_chan { | |||
476 | unsigned long conn_state; | 481 | unsigned long conn_state; |
477 | unsigned long flags; | 482 | unsigned long flags; |
478 | 483 | ||
484 | __u8 remote_amp_id; | ||
485 | __u8 local_amp_id; | ||
486 | __u8 move_id; | ||
487 | __u8 move_state; | ||
488 | __u8 move_role; | ||
489 | |||
479 | __u16 next_tx_seq; | 490 | __u16 next_tx_seq; |
480 | __u16 expected_ack_seq; | 491 | __u16 expected_ack_seq; |
481 | __u16 expected_tx_seq; | 492 | __u16 expected_tx_seq; |
@@ -538,6 +549,7 @@ struct l2cap_ops { | |||
538 | void (*state_change) (struct l2cap_chan *chan, | 549 | void (*state_change) (struct l2cap_chan *chan, |
539 | int state); | 550 | int state); |
540 | void (*ready) (struct l2cap_chan *chan); | 551 | void (*ready) (struct l2cap_chan *chan); |
552 | void (*defer) (struct l2cap_chan *chan); | ||
541 | struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan, | 553 | struct sk_buff *(*alloc_skb) (struct l2cap_chan *chan, |
542 | unsigned long len, int nb); | 554 | unsigned long len, int nb); |
543 | }; | 555 | }; |
@@ -640,6 +652,9 @@ enum { | |||
640 | enum { | 652 | enum { |
641 | L2CAP_RX_STATE_RECV, | 653 | L2CAP_RX_STATE_RECV, |
642 | L2CAP_RX_STATE_SREJ_SENT, | 654 | L2CAP_RX_STATE_SREJ_SENT, |
655 | L2CAP_RX_STATE_MOVE, | ||
656 | L2CAP_RX_STATE_WAIT_P, | ||
657 | L2CAP_RX_STATE_WAIT_F, | ||
643 | }; | 658 | }; |
644 | 659 | ||
645 | enum { | 660 | enum { |
@@ -670,6 +685,25 @@ enum { | |||
670 | L2CAP_EV_RECV_FRAME, | 685 | L2CAP_EV_RECV_FRAME, |
671 | }; | 686 | }; |
672 | 687 | ||
688 | enum { | ||
689 | L2CAP_MOVE_ROLE_NONE, | ||
690 | L2CAP_MOVE_ROLE_INITIATOR, | ||
691 | L2CAP_MOVE_ROLE_RESPONDER, | ||
692 | }; | ||
693 | |||
694 | enum { | ||
695 | L2CAP_MOVE_STABLE, | ||
696 | L2CAP_MOVE_WAIT_REQ, | ||
697 | L2CAP_MOVE_WAIT_RSP, | ||
698 | L2CAP_MOVE_WAIT_RSP_SUCCESS, | ||
699 | L2CAP_MOVE_WAIT_CONFIRM, | ||
700 | L2CAP_MOVE_WAIT_CONFIRM_RSP, | ||
701 | L2CAP_MOVE_WAIT_LOGICAL_COMP, | ||
702 | L2CAP_MOVE_WAIT_LOGICAL_CFM, | ||
703 | L2CAP_MOVE_WAIT_LOCAL_BUSY, | ||
704 | L2CAP_MOVE_WAIT_PREPARE, | ||
705 | }; | ||
706 | |||
673 | void l2cap_chan_hold(struct l2cap_chan *c); | 707 | void l2cap_chan_hold(struct l2cap_chan *c); |
674 | void l2cap_chan_put(struct l2cap_chan *c); | 708 | void l2cap_chan_put(struct l2cap_chan *c); |
675 | 709 | ||
@@ -745,6 +779,10 @@ static inline void l2cap_chan_no_ready(struct l2cap_chan *chan) | |||
745 | { | 779 | { |
746 | } | 780 | } |
747 | 781 | ||
782 | static inline void l2cap_chan_no_defer(struct l2cap_chan *chan) | ||
783 | { | ||
784 | } | ||
785 | |||
748 | extern bool disable_ertm; | 786 | extern bool disable_ertm; |
749 | 787 | ||
750 | int l2cap_init_sockets(void); | 788 | int l2cap_init_sockets(void); |
@@ -767,6 +805,12 @@ int l2cap_chan_check_security(struct l2cap_chan *chan); | |||
767 | void l2cap_chan_set_defaults(struct l2cap_chan *chan); | 805 | void l2cap_chan_set_defaults(struct l2cap_chan *chan); |
768 | int l2cap_ertm_init(struct l2cap_chan *chan); | 806 | int l2cap_ertm_init(struct l2cap_chan *chan); |
769 | void l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan); | 807 | void l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan); |
808 | void __l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan); | ||
770 | void l2cap_chan_del(struct l2cap_chan *chan, int err); | 809 | void l2cap_chan_del(struct l2cap_chan *chan, int err); |
810 | void l2cap_send_conn_req(struct l2cap_chan *chan); | ||
811 | void l2cap_move_start(struct l2cap_chan *chan); | ||
812 | void l2cap_logical_cfm(struct l2cap_chan *chan, struct hci_chan *hchan, | ||
813 | u8 status); | ||
814 | void __l2cap_physical_cfm(struct l2cap_chan *chan, int result); | ||
771 | 815 | ||
772 | #endif /* __L2CAP_H */ | 816 | #endif /* __L2CAP_H */ |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 7d5b6000378b..e78db2cf3d1b 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -306,6 +306,88 @@ struct key_params { | |||
306 | }; | 306 | }; |
307 | 307 | ||
308 | /** | 308 | /** |
309 | * struct cfg80211_chan_def - channel definition | ||
310 | * @chan: the (control) channel | ||
311 | * @width: channel width | ||
312 | * @center_freq1: center frequency of first segment | ||
313 | * @center_freq2: center frequency of second segment | ||
314 | * (only with 80+80 MHz) | ||
315 | */ | ||
316 | struct cfg80211_chan_def { | ||
317 | struct ieee80211_channel *chan; | ||
318 | enum nl80211_chan_width width; | ||
319 | u32 center_freq1; | ||
320 | u32 center_freq2; | ||
321 | }; | ||
322 | |||
323 | /** | ||
324 | * cfg80211_get_chandef_type - return old channel type from chandef | ||
325 | * @chandef: the channel definition | ||
326 | * | ||
327 | * Returns the old channel type (NOHT, HT20, HT40+/-) from a given | ||
328 | * chandef, which must have a bandwidth allowing this conversion. | ||
329 | */ | ||
330 | static inline enum nl80211_channel_type | ||
331 | cfg80211_get_chandef_type(const struct cfg80211_chan_def *chandef) | ||
332 | { | ||
333 | switch (chandef->width) { | ||
334 | case NL80211_CHAN_WIDTH_20_NOHT: | ||
335 | return NL80211_CHAN_NO_HT; | ||
336 | case NL80211_CHAN_WIDTH_20: | ||
337 | return NL80211_CHAN_HT20; | ||
338 | case NL80211_CHAN_WIDTH_40: | ||
339 | if (chandef->center_freq1 > chandef->chan->center_freq) | ||
340 | return NL80211_CHAN_HT40PLUS; | ||
341 | return NL80211_CHAN_HT40MINUS; | ||
342 | default: | ||
343 | WARN_ON(1); | ||
344 | return NL80211_CHAN_NO_HT; | ||
345 | } | ||
346 | } | ||
347 | |||
348 | /** | ||
349 | * cfg80211_chandef_create - create channel definition using channel type | ||
350 | * @chandef: the channel definition struct to fill | ||
351 | * @channel: the control channel | ||
352 | * @chantype: the channel type | ||
353 | * | ||
354 | * Given a channel type, create a channel definition. | ||
355 | */ | ||
356 | void cfg80211_chandef_create(struct cfg80211_chan_def *chandef, | ||
357 | struct ieee80211_channel *channel, | ||
358 | enum nl80211_channel_type chantype); | ||
359 | |||
360 | /** | ||
361 | * cfg80211_chandef_identical - check if two channel definitions are identical | ||
362 | * @chandef1: first channel definition | ||
363 | * @chandef2: second channel definition | ||
364 | * | ||
365 | * Returns %true if the channels defined by the channel definitions are | ||
366 | * identical, %false otherwise. | ||
367 | */ | ||
368 | static inline bool | ||
369 | cfg80211_chandef_identical(const struct cfg80211_chan_def *chandef1, | ||
370 | const struct cfg80211_chan_def *chandef2) | ||
371 | { | ||
372 | return (chandef1->chan == chandef2->chan && | ||
373 | chandef1->width == chandef2->width && | ||
374 | chandef1->center_freq1 == chandef2->center_freq1 && | ||
375 | chandef1->center_freq2 == chandef2->center_freq2); | ||
376 | } | ||
377 | |||
378 | /** | ||
379 | * cfg80211_chandef_compatible - check if two channel definitions are compatible | ||
380 | * @chandef1: first channel definition | ||
381 | * @chandef2: second channel definition | ||
382 | * | ||
383 | * Returns %NULL if the given channel definitions are incompatible, | ||
384 | * chandef1 or chandef2 otherwise. | ||
385 | */ | ||
386 | const struct cfg80211_chan_def * | ||
387 | cfg80211_chandef_compatible(const struct cfg80211_chan_def *chandef1, | ||
388 | const struct cfg80211_chan_def *chandef2); | ||
389 | |||
390 | /** | ||
309 | * enum survey_info_flags - survey information flags | 391 | * enum survey_info_flags - survey information flags |
310 | * | 392 | * |
311 | * @SURVEY_INFO_NOISE_DBM: noise (in dBm) was filled in | 393 | * @SURVEY_INFO_NOISE_DBM: noise (in dBm) was filled in |
@@ -426,8 +508,7 @@ struct cfg80211_beacon_data { | |||
426 | * | 508 | * |
427 | * Used to configure an AP interface. | 509 | * Used to configure an AP interface. |
428 | * | 510 | * |
429 | * @channel: the channel to start the AP on | 511 | * @chandef: defines the channel to use |
430 | * @channel_type: the channel type to use | ||
431 | * @beacon: beacon data | 512 | * @beacon: beacon data |
432 | * @beacon_interval: beacon interval | 513 | * @beacon_interval: beacon interval |
433 | * @dtim_period: DTIM period | 514 | * @dtim_period: DTIM period |
@@ -441,8 +522,7 @@ struct cfg80211_beacon_data { | |||
441 | * @inactivity_timeout: time in seconds to determine station's inactivity. | 522 | * @inactivity_timeout: time in seconds to determine station's inactivity. |
442 | */ | 523 | */ |
443 | struct cfg80211_ap_settings { | 524 | struct cfg80211_ap_settings { |
444 | struct ieee80211_channel *channel; | 525 | struct cfg80211_chan_def chandef; |
445 | enum nl80211_channel_type channel_type; | ||
446 | 526 | ||
447 | struct cfg80211_beacon_data beacon; | 527 | struct cfg80211_beacon_data beacon; |
448 | 528 | ||
@@ -498,6 +578,7 @@ enum station_parameters_apply_mask { | |||
498 | * @plink_action: plink action to take | 578 | * @plink_action: plink action to take |
499 | * @plink_state: set the peer link state for a station | 579 | * @plink_state: set the peer link state for a station |
500 | * @ht_capa: HT capabilities of station | 580 | * @ht_capa: HT capabilities of station |
581 | * @vht_capa: VHT capabilities of station | ||
501 | * @uapsd_queues: bitmap of queues configured for uapsd. same format | 582 | * @uapsd_queues: bitmap of queues configured for uapsd. same format |
502 | * as the AC bitmap in the QoS info field | 583 | * as the AC bitmap in the QoS info field |
503 | * @max_sp: max Service Period. same format as the MAX_SP in the | 584 | * @max_sp: max Service Period. same format as the MAX_SP in the |
@@ -517,6 +598,7 @@ struct station_parameters { | |||
517 | u8 plink_action; | 598 | u8 plink_action; |
518 | u8 plink_state; | 599 | u8 plink_state; |
519 | struct ieee80211_ht_cap *ht_capa; | 600 | struct ieee80211_ht_cap *ht_capa; |
601 | struct ieee80211_vht_cap *vht_capa; | ||
520 | u8 uapsd_queues; | 602 | u8 uapsd_queues; |
521 | u8 max_sp; | 603 | u8 max_sp; |
522 | }; | 604 | }; |
@@ -580,16 +662,24 @@ enum station_info_flags { | |||
580 | * Used by the driver to indicate the specific rate transmission | 662 | * Used by the driver to indicate the specific rate transmission |
581 | * type for 802.11n transmissions. | 663 | * type for 802.11n transmissions. |
582 | * | 664 | * |
583 | * @RATE_INFO_FLAGS_MCS: @tx_bitrate_mcs filled | 665 | * @RATE_INFO_FLAGS_MCS: mcs field filled with HT MCS |
584 | * @RATE_INFO_FLAGS_40_MHZ_WIDTH: 40 Mhz width transmission | 666 | * @RATE_INFO_FLAGS_VHT_MCS: mcs field filled with VHT MCS |
667 | * @RATE_INFO_FLAGS_40_MHZ_WIDTH: 40 MHz width transmission | ||
668 | * @RATE_INFO_FLAGS_80_MHZ_WIDTH: 80 MHz width transmission | ||
669 | * @RATE_INFO_FLAGS_80P80_MHZ_WIDTH: 80+80 MHz width transmission | ||
670 | * @RATE_INFO_FLAGS_160_MHZ_WIDTH: 160 MHz width transmission | ||
585 | * @RATE_INFO_FLAGS_SHORT_GI: 400ns guard interval | 671 | * @RATE_INFO_FLAGS_SHORT_GI: 400ns guard interval |
586 | * @RATE_INFO_FLAGS_60G: 60gHz MCS | 672 | * @RATE_INFO_FLAGS_60G: 60GHz MCS |
587 | */ | 673 | */ |
588 | enum rate_info_flags { | 674 | enum rate_info_flags { |
589 | RATE_INFO_FLAGS_MCS = 1<<0, | 675 | RATE_INFO_FLAGS_MCS = BIT(0), |
590 | RATE_INFO_FLAGS_40_MHZ_WIDTH = 1<<1, | 676 | RATE_INFO_FLAGS_VHT_MCS = BIT(1), |
591 | RATE_INFO_FLAGS_SHORT_GI = 1<<2, | 677 | RATE_INFO_FLAGS_40_MHZ_WIDTH = BIT(2), |
592 | RATE_INFO_FLAGS_60G = 1<<3, | 678 | RATE_INFO_FLAGS_80_MHZ_WIDTH = BIT(3), |
679 | RATE_INFO_FLAGS_80P80_MHZ_WIDTH = BIT(4), | ||
680 | RATE_INFO_FLAGS_160_MHZ_WIDTH = BIT(5), | ||
681 | RATE_INFO_FLAGS_SHORT_GI = BIT(6), | ||
682 | RATE_INFO_FLAGS_60G = BIT(7), | ||
593 | }; | 683 | }; |
594 | 684 | ||
595 | /** | 685 | /** |
@@ -600,11 +690,13 @@ enum rate_info_flags { | |||
600 | * @flags: bitflag of flags from &enum rate_info_flags | 690 | * @flags: bitflag of flags from &enum rate_info_flags |
601 | * @mcs: mcs index if struct describes a 802.11n bitrate | 691 | * @mcs: mcs index if struct describes a 802.11n bitrate |
602 | * @legacy: bitrate in 100kbit/s for 802.11abg | 692 | * @legacy: bitrate in 100kbit/s for 802.11abg |
693 | * @nss: number of streams (VHT only) | ||
603 | */ | 694 | */ |
604 | struct rate_info { | 695 | struct rate_info { |
605 | u8 flags; | 696 | u8 flags; |
606 | u8 mcs; | 697 | u8 mcs; |
607 | u16 legacy; | 698 | u16 legacy; |
699 | u8 nss; | ||
608 | }; | 700 | }; |
609 | 701 | ||
610 | /** | 702 | /** |
@@ -907,8 +999,7 @@ struct mesh_config { | |||
907 | 999 | ||
908 | /** | 1000 | /** |
909 | * struct mesh_setup - 802.11s mesh setup configuration | 1001 | * struct mesh_setup - 802.11s mesh setup configuration |
910 | * @channel: the channel to start the mesh network on | 1002 | * @chandef: defines the channel to use |
911 | * @channel_type: the channel type to use | ||
912 | * @mesh_id: the mesh ID | 1003 | * @mesh_id: the mesh ID |
913 | * @mesh_id_len: length of the mesh ID, at least 1 and at most 32 bytes | 1004 | * @mesh_id_len: length of the mesh ID, at least 1 and at most 32 bytes |
914 | * @sync_method: which synchronization method to use | 1005 | * @sync_method: which synchronization method to use |
@@ -923,8 +1014,7 @@ struct mesh_config { | |||
923 | * These parameters are fixed when the mesh is created. | 1014 | * These parameters are fixed when the mesh is created. |
924 | */ | 1015 | */ |
925 | struct mesh_setup { | 1016 | struct mesh_setup { |
926 | struct ieee80211_channel *channel; | 1017 | struct cfg80211_chan_def chandef; |
927 | enum nl80211_channel_type channel_type; | ||
928 | const u8 *mesh_id; | 1018 | const u8 *mesh_id; |
929 | u8 mesh_id_len; | 1019 | u8 mesh_id_len; |
930 | u8 sync_method; | 1020 | u8 sync_method; |
@@ -1000,8 +1090,10 @@ struct cfg80211_ssid { | |||
1000 | * @n_channels: total number of channels to scan | 1090 | * @n_channels: total number of channels to scan |
1001 | * @ie: optional information element(s) to add into Probe Request or %NULL | 1091 | * @ie: optional information element(s) to add into Probe Request or %NULL |
1002 | * @ie_len: length of ie in octets | 1092 | * @ie_len: length of ie in octets |
1093 | * @flags: bit field of flags controlling operation | ||
1003 | * @rates: bitmap of rates to advertise for each band | 1094 | * @rates: bitmap of rates to advertise for each band |
1004 | * @wiphy: the wiphy this was for | 1095 | * @wiphy: the wiphy this was for |
1096 | * @scan_start: time (in jiffies) when the scan started | ||
1005 | * @wdev: the wireless device to scan for | 1097 | * @wdev: the wireless device to scan for |
1006 | * @aborted: (internal) scan request was notified as aborted | 1098 | * @aborted: (internal) scan request was notified as aborted |
1007 | * @no_cck: used to send probe requests at non CCK rate in 2GHz band | 1099 | * @no_cck: used to send probe requests at non CCK rate in 2GHz band |
@@ -1012,6 +1104,7 @@ struct cfg80211_scan_request { | |||
1012 | u32 n_channels; | 1104 | u32 n_channels; |
1013 | const u8 *ie; | 1105 | const u8 *ie; |
1014 | size_t ie_len; | 1106 | size_t ie_len; |
1107 | u32 flags; | ||
1015 | 1108 | ||
1016 | u32 rates[IEEE80211_NUM_BANDS]; | 1109 | u32 rates[IEEE80211_NUM_BANDS]; |
1017 | 1110 | ||
@@ -1019,6 +1112,7 @@ struct cfg80211_scan_request { | |||
1019 | 1112 | ||
1020 | /* internal */ | 1113 | /* internal */ |
1021 | struct wiphy *wiphy; | 1114 | struct wiphy *wiphy; |
1115 | unsigned long scan_start; | ||
1022 | bool aborted; | 1116 | bool aborted; |
1023 | bool no_cck; | 1117 | bool no_cck; |
1024 | 1118 | ||
@@ -1044,6 +1138,7 @@ struct cfg80211_match_set { | |||
1044 | * @interval: interval between each scheduled scan cycle | 1138 | * @interval: interval between each scheduled scan cycle |
1045 | * @ie: optional information element(s) to add into Probe Request or %NULL | 1139 | * @ie: optional information element(s) to add into Probe Request or %NULL |
1046 | * @ie_len: length of ie in octets | 1140 | * @ie_len: length of ie in octets |
1141 | * @flags: bit field of flags controlling operation | ||
1047 | * @match_sets: sets of parameters to be matched for a scan result | 1142 | * @match_sets: sets of parameters to be matched for a scan result |
1048 | * entry to be considered valid and to be passed to the host | 1143 | * entry to be considered valid and to be passed to the host |
1049 | * (others are filtered out). | 1144 | * (others are filtered out). |
@@ -1061,6 +1156,7 @@ struct cfg80211_sched_scan_request { | |||
1061 | u32 interval; | 1156 | u32 interval; |
1062 | const u8 *ie; | 1157 | const u8 *ie; |
1063 | size_t ie_len; | 1158 | size_t ie_len; |
1159 | u32 flags; | ||
1064 | struct cfg80211_match_set *match_sets; | 1160 | struct cfg80211_match_set *match_sets; |
1065 | int n_match_sets; | 1161 | int n_match_sets; |
1066 | s32 rssi_thold; | 1162 | s32 rssi_thold; |
@@ -1068,6 +1164,7 @@ struct cfg80211_sched_scan_request { | |||
1068 | /* internal */ | 1164 | /* internal */ |
1069 | struct wiphy *wiphy; | 1165 | struct wiphy *wiphy; |
1070 | struct net_device *dev; | 1166 | struct net_device *dev; |
1167 | unsigned long scan_start; | ||
1071 | 1168 | ||
1072 | /* keep last */ | 1169 | /* keep last */ |
1073 | struct ieee80211_channel *channels[0]; | 1170 | struct ieee80211_channel *channels[0]; |
@@ -1152,6 +1249,9 @@ const u8 *ieee80211_bss_get_ie(struct cfg80211_bss *bss, u8 ie); | |||
1152 | * @key_len: length of WEP key for shared key authentication | 1249 | * @key_len: length of WEP key for shared key authentication |
1153 | * @key_idx: index of WEP key for shared key authentication | 1250 | * @key_idx: index of WEP key for shared key authentication |
1154 | * @key: WEP key for shared key authentication | 1251 | * @key: WEP key for shared key authentication |
1252 | * @sae_data: Non-IE data to use with SAE or %NULL. This starts with | ||
1253 | * Authentication transaction sequence number field. | ||
1254 | * @sae_data_len: Length of sae_data buffer in octets | ||
1155 | */ | 1255 | */ |
1156 | struct cfg80211_auth_request { | 1256 | struct cfg80211_auth_request { |
1157 | struct cfg80211_bss *bss; | 1257 | struct cfg80211_bss *bss; |
@@ -1160,6 +1260,8 @@ struct cfg80211_auth_request { | |||
1160 | enum nl80211_auth_type auth_type; | 1260 | enum nl80211_auth_type auth_type; |
1161 | const u8 *key; | 1261 | const u8 *key; |
1162 | u8 key_len, key_idx; | 1262 | u8 key_len, key_idx; |
1263 | const u8 *sae_data; | ||
1264 | size_t sae_data_len; | ||
1163 | }; | 1265 | }; |
1164 | 1266 | ||
1165 | /** | 1267 | /** |
@@ -1252,8 +1354,7 @@ struct cfg80211_disassoc_request { | |||
1252 | * @ssid_len: The length of the SSID, will always be non-zero. | 1354 | * @ssid_len: The length of the SSID, will always be non-zero. |
1253 | * @bssid: Fixed BSSID requested, maybe be %NULL, if set do not | 1355 | * @bssid: Fixed BSSID requested, maybe be %NULL, if set do not |
1254 | * search for IBSSs with a different BSSID. | 1356 | * search for IBSSs with a different BSSID. |
1255 | * @channel: The channel to use if no IBSS can be found to join. | 1357 | * @chandef: defines the channel to use if no other IBSS to join can be found |
1256 | * @channel_type: channel type (HT mode) | ||
1257 | * @channel_fixed: The channel should be fixed -- do not search for | 1358 | * @channel_fixed: The channel should be fixed -- do not search for |
1258 | * IBSSs to join on other channels. | 1359 | * IBSSs to join on other channels. |
1259 | * @ie: information element(s) to include in the beacon | 1360 | * @ie: information element(s) to include in the beacon |
@@ -1271,8 +1372,7 @@ struct cfg80211_disassoc_request { | |||
1271 | struct cfg80211_ibss_params { | 1372 | struct cfg80211_ibss_params { |
1272 | u8 *ssid; | 1373 | u8 *ssid; |
1273 | u8 *bssid; | 1374 | u8 *bssid; |
1274 | struct ieee80211_channel *channel; | 1375 | struct cfg80211_chan_def chandef; |
1275 | enum nl80211_channel_type channel_type; | ||
1276 | u8 *ie; | 1376 | u8 *ie; |
1277 | u8 ssid_len, ie_len; | 1377 | u8 ssid_len, ie_len; |
1278 | u16 beacon_interval; | 1378 | u16 beacon_interval; |
@@ -1531,13 +1631,19 @@ struct cfg80211_gtk_rekey_data { | |||
1531 | * to a merge. | 1631 | * to a merge. |
1532 | * @leave_ibss: Leave the IBSS. | 1632 | * @leave_ibss: Leave the IBSS. |
1533 | * | 1633 | * |
1634 | * @set_mcast_rate: Set the specified multicast rate (only if vif is in ADHOC or | ||
1635 | * MESH mode) | ||
1636 | * | ||
1534 | * @set_wiphy_params: Notify that wiphy parameters have changed; | 1637 | * @set_wiphy_params: Notify that wiphy parameters have changed; |
1535 | * @changed bitfield (see &enum wiphy_params_flags) describes which values | 1638 | * @changed bitfield (see &enum wiphy_params_flags) describes which values |
1536 | * have changed. The actual parameter values are available in | 1639 | * have changed. The actual parameter values are available in |
1537 | * struct wiphy. If returning an error, no value should be changed. | 1640 | * struct wiphy. If returning an error, no value should be changed. |
1538 | * | 1641 | * |
1539 | * @set_tx_power: set the transmit power according to the parameters, | 1642 | * @set_tx_power: set the transmit power according to the parameters, |
1540 | * the power passed is in mBm, to get dBm use MBM_TO_DBM(). | 1643 | * the power passed is in mBm, to get dBm use MBM_TO_DBM(). The |
1644 | * wdev may be %NULL if power was set for the wiphy, and will | ||
1645 | * always be %NULL unless the driver supports per-vif TX power | ||
1646 | * (as advertised by the nl80211 feature flag.) | ||
1541 | * @get_tx_power: store the current TX power into the dbm variable; | 1647 | * @get_tx_power: store the current TX power into the dbm variable; |
1542 | * return 0 if successful | 1648 | * return 0 if successful |
1543 | * | 1649 | * |
@@ -1708,8 +1814,7 @@ struct cfg80211_ops { | |||
1708 | struct ieee80211_channel *chan); | 1814 | struct ieee80211_channel *chan); |
1709 | 1815 | ||
1710 | int (*set_monitor_channel)(struct wiphy *wiphy, | 1816 | int (*set_monitor_channel)(struct wiphy *wiphy, |
1711 | struct ieee80211_channel *chan, | 1817 | struct cfg80211_chan_def *chandef); |
1712 | enum nl80211_channel_type channel_type); | ||
1713 | 1818 | ||
1714 | int (*scan)(struct wiphy *wiphy, | 1819 | int (*scan)(struct wiphy *wiphy, |
1715 | struct cfg80211_scan_request *request); | 1820 | struct cfg80211_scan_request *request); |
@@ -1732,11 +1837,15 @@ struct cfg80211_ops { | |||
1732 | struct cfg80211_ibss_params *params); | 1837 | struct cfg80211_ibss_params *params); |
1733 | int (*leave_ibss)(struct wiphy *wiphy, struct net_device *dev); | 1838 | int (*leave_ibss)(struct wiphy *wiphy, struct net_device *dev); |
1734 | 1839 | ||
1840 | int (*set_mcast_rate)(struct wiphy *wiphy, struct net_device *dev, | ||
1841 | int rate[IEEE80211_NUM_BANDS]); | ||
1842 | |||
1735 | int (*set_wiphy_params)(struct wiphy *wiphy, u32 changed); | 1843 | int (*set_wiphy_params)(struct wiphy *wiphy, u32 changed); |
1736 | 1844 | ||
1737 | int (*set_tx_power)(struct wiphy *wiphy, | 1845 | int (*set_tx_power)(struct wiphy *wiphy, struct wireless_dev *wdev, |
1738 | enum nl80211_tx_power_setting type, int mbm); | 1846 | enum nl80211_tx_power_setting type, int mbm); |
1739 | int (*get_tx_power)(struct wiphy *wiphy, int *dbm); | 1847 | int (*get_tx_power)(struct wiphy *wiphy, struct wireless_dev *wdev, |
1848 | int *dbm); | ||
1740 | 1849 | ||
1741 | int (*set_wds_peer)(struct wiphy *wiphy, struct net_device *dev, | 1850 | int (*set_wds_peer)(struct wiphy *wiphy, struct net_device *dev, |
1742 | const u8 *addr); | 1851 | const u8 *addr); |
@@ -1767,7 +1876,6 @@ struct cfg80211_ops { | |||
1767 | int (*remain_on_channel)(struct wiphy *wiphy, | 1876 | int (*remain_on_channel)(struct wiphy *wiphy, |
1768 | struct wireless_dev *wdev, | 1877 | struct wireless_dev *wdev, |
1769 | struct ieee80211_channel *chan, | 1878 | struct ieee80211_channel *chan, |
1770 | enum nl80211_channel_type channel_type, | ||
1771 | unsigned int duration, | 1879 | unsigned int duration, |
1772 | u64 *cookie); | 1880 | u64 *cookie); |
1773 | int (*cancel_remain_on_channel)(struct wiphy *wiphy, | 1881 | int (*cancel_remain_on_channel)(struct wiphy *wiphy, |
@@ -1776,10 +1884,8 @@ struct cfg80211_ops { | |||
1776 | 1884 | ||
1777 | int (*mgmt_tx)(struct wiphy *wiphy, struct wireless_dev *wdev, | 1885 | int (*mgmt_tx)(struct wiphy *wiphy, struct wireless_dev *wdev, |
1778 | struct ieee80211_channel *chan, bool offchan, | 1886 | struct ieee80211_channel *chan, bool offchan, |
1779 | enum nl80211_channel_type channel_type, | 1887 | unsigned int wait, const u8 *buf, size_t len, |
1780 | bool channel_type_valid, unsigned int wait, | 1888 | bool no_cck, bool dont_wait_for_ack, u64 *cookie); |
1781 | const u8 *buf, size_t len, bool no_cck, | ||
1782 | bool dont_wait_for_ack, u64 *cookie); | ||
1783 | int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy, | 1889 | int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy, |
1784 | struct wireless_dev *wdev, | 1890 | struct wireless_dev *wdev, |
1785 | u64 cookie); | 1891 | u64 cookie); |
@@ -1834,10 +1940,9 @@ struct cfg80211_ops { | |||
1834 | void (*get_et_strings)(struct wiphy *wiphy, struct net_device *dev, | 1940 | void (*get_et_strings)(struct wiphy *wiphy, struct net_device *dev, |
1835 | u32 sset, u8 *data); | 1941 | u32 sset, u8 *data); |
1836 | 1942 | ||
1837 | struct ieee80211_channel * | 1943 | int (*get_channel)(struct wiphy *wiphy, |
1838 | (*get_channel)(struct wiphy *wiphy, | ||
1839 | struct wireless_dev *wdev, | 1944 | struct wireless_dev *wdev, |
1840 | enum nl80211_channel_type *type); | 1945 | struct cfg80211_chan_def *chandef); |
1841 | 1946 | ||
1842 | int (*start_p2p_device)(struct wiphy *wiphy, | 1947 | int (*start_p2p_device)(struct wiphy *wiphy, |
1843 | struct wireless_dev *wdev); | 1948 | struct wireless_dev *wdev); |
@@ -2445,8 +2550,7 @@ struct wireless_dev { | |||
2445 | spinlock_t event_lock; | 2550 | spinlock_t event_lock; |
2446 | 2551 | ||
2447 | struct cfg80211_internal_bss *current_bss; /* associated / joined */ | 2552 | struct cfg80211_internal_bss *current_bss; /* associated / joined */ |
2448 | struct ieee80211_channel *preset_chan; | 2553 | struct cfg80211_chan_def preset_chandef; |
2449 | enum nl80211_channel_type preset_chantype; | ||
2450 | 2554 | ||
2451 | /* for AP and mesh channel tracking */ | 2555 | /* for AP and mesh channel tracking */ |
2452 | struct ieee80211_channel *channel; | 2556 | struct ieee80211_channel *channel; |
@@ -3326,14 +3430,12 @@ void cfg80211_disconnected(struct net_device *dev, u16 reason, | |||
3326 | * @wdev: wireless device | 3430 | * @wdev: wireless device |
3327 | * @cookie: the request cookie | 3431 | * @cookie: the request cookie |
3328 | * @chan: The current channel (from remain_on_channel request) | 3432 | * @chan: The current channel (from remain_on_channel request) |
3329 | * @channel_type: Channel type | ||
3330 | * @duration: Duration in milliseconds that the driver intents to remain on the | 3433 | * @duration: Duration in milliseconds that the driver intents to remain on the |
3331 | * channel | 3434 | * channel |
3332 | * @gfp: allocation flags | 3435 | * @gfp: allocation flags |
3333 | */ | 3436 | */ |
3334 | void cfg80211_ready_on_channel(struct wireless_dev *wdev, u64 cookie, | 3437 | void cfg80211_ready_on_channel(struct wireless_dev *wdev, u64 cookie, |
3335 | struct ieee80211_channel *chan, | 3438 | struct ieee80211_channel *chan, |
3336 | enum nl80211_channel_type channel_type, | ||
3337 | unsigned int duration, gfp_t gfp); | 3439 | unsigned int duration, gfp_t gfp); |
3338 | 3440 | ||
3339 | /** | 3441 | /** |
@@ -3341,12 +3443,10 @@ void cfg80211_ready_on_channel(struct wireless_dev *wdev, u64 cookie, | |||
3341 | * @wdev: wireless device | 3443 | * @wdev: wireless device |
3342 | * @cookie: the request cookie | 3444 | * @cookie: the request cookie |
3343 | * @chan: The current channel (from remain_on_channel request) | 3445 | * @chan: The current channel (from remain_on_channel request) |
3344 | * @channel_type: Channel type | ||
3345 | * @gfp: allocation flags | 3446 | * @gfp: allocation flags |
3346 | */ | 3447 | */ |
3347 | void cfg80211_remain_on_channel_expired(struct wireless_dev *wdev, u64 cookie, | 3448 | void cfg80211_remain_on_channel_expired(struct wireless_dev *wdev, u64 cookie, |
3348 | struct ieee80211_channel *chan, | 3449 | struct ieee80211_channel *chan, |
3349 | enum nl80211_channel_type channel_type, | ||
3350 | gfp_t gfp); | 3450 | gfp_t gfp); |
3351 | 3451 | ||
3352 | 3452 | ||
@@ -3536,7 +3636,6 @@ void cfg80211_probe_status(struct net_device *dev, const u8 *addr, | |||
3536 | * @len: length of the frame | 3636 | * @len: length of the frame |
3537 | * @freq: frequency the frame was received on | 3637 | * @freq: frequency the frame was received on |
3538 | * @sig_dbm: signal strength in mBm, or 0 if unknown | 3638 | * @sig_dbm: signal strength in mBm, or 0 if unknown |
3539 | * @gfp: allocation flags | ||
3540 | * | 3639 | * |
3541 | * Use this function to report to userspace when a beacon was | 3640 | * Use this function to report to userspace when a beacon was |
3542 | * received. It is not useful to call this when there is no | 3641 | * received. It is not useful to call this when there is no |
@@ -3544,31 +3643,47 @@ void cfg80211_probe_status(struct net_device *dev, const u8 *addr, | |||
3544 | */ | 3643 | */ |
3545 | void cfg80211_report_obss_beacon(struct wiphy *wiphy, | 3644 | void cfg80211_report_obss_beacon(struct wiphy *wiphy, |
3546 | const u8 *frame, size_t len, | 3645 | const u8 *frame, size_t len, |
3547 | int freq, int sig_dbm, gfp_t gfp); | 3646 | int freq, int sig_dbm); |
3548 | 3647 | ||
3549 | /** | 3648 | /** |
3550 | * cfg80211_can_beacon_sec_chan - test if ht40 on extension channel can be used | 3649 | * cfg80211_reg_can_beacon - check if beaconing is allowed |
3551 | * @wiphy: the wiphy | 3650 | * @wiphy: the wiphy |
3552 | * @chan: main channel | 3651 | * @chandef: the channel definition |
3553 | * @channel_type: HT mode | ||
3554 | * | 3652 | * |
3555 | * This function returns true if there is no secondary channel or the secondary | 3653 | * This function returns true if there is no secondary channel or the secondary |
3556 | * channel can be used for beaconing (i.e. is not a radar channel etc.) | 3654 | * channel(s) can be used for beaconing (i.e. is not a radar channel etc.) |
3557 | */ | 3655 | */ |
3558 | bool cfg80211_can_beacon_sec_chan(struct wiphy *wiphy, | 3656 | bool cfg80211_reg_can_beacon(struct wiphy *wiphy, |
3559 | struct ieee80211_channel *chan, | 3657 | struct cfg80211_chan_def *chandef); |
3560 | enum nl80211_channel_type channel_type); | ||
3561 | 3658 | ||
3562 | /* | 3659 | /* |
3563 | * cfg80211_ch_switch_notify - update wdev channel and notify userspace | 3660 | * cfg80211_ch_switch_notify - update wdev channel and notify userspace |
3564 | * @dev: the device which switched channels | 3661 | * @dev: the device which switched channels |
3565 | * @freq: new channel frequency (in MHz) | 3662 | * @chandef: the new channel definition |
3566 | * @type: channel type | ||
3567 | * | 3663 | * |
3568 | * Acquires wdev_lock, so must only be called from sleepable driver context! | 3664 | * Acquires wdev_lock, so must only be called from sleepable driver context! |
3569 | */ | 3665 | */ |
3570 | void cfg80211_ch_switch_notify(struct net_device *dev, int freq, | 3666 | void cfg80211_ch_switch_notify(struct net_device *dev, |
3571 | enum nl80211_channel_type type); | 3667 | struct cfg80211_chan_def *chandef); |
3668 | |||
3669 | /* | ||
3670 | * cfg80211_tdls_oper_request - request userspace to perform TDLS operation | ||
3671 | * @dev: the device on which the operation is requested | ||
3672 | * @peer: the MAC address of the peer device | ||
3673 | * @oper: the requested TDLS operation (NL80211_TDLS_SETUP or | ||
3674 | * NL80211_TDLS_TEARDOWN) | ||
3675 | * @reason_code: the reason code for teardown request | ||
3676 | * @gfp: allocation flags | ||
3677 | * | ||
3678 | * This function is used to request userspace to perform TDLS operation that | ||
3679 | * requires knowledge of keys, i.e., link setup or teardown when the AP | ||
3680 | * connection uses encryption. This is optional mechanism for the driver to use | ||
3681 | * if it can automatically determine when a TDLS link could be useful (e.g., | ||
3682 | * based on traffic and signal strength for a peer). | ||
3683 | */ | ||
3684 | void cfg80211_tdls_oper_request(struct net_device *dev, const u8 *peer, | ||
3685 | enum nl80211_tdls_operation oper, | ||
3686 | u16 reason_code, gfp_t gfp); | ||
3572 | 3687 | ||
3573 | /* | 3688 | /* |
3574 | * cfg80211_calculate_bitrate - calculate actual bitrate (in 100Kbps units) | 3689 | * cfg80211_calculate_bitrate - calculate actual bitrate (in 100Kbps units) |
@@ -3594,6 +3709,26 @@ u32 cfg80211_calculate_bitrate(struct rate_info *rate); | |||
3594 | */ | 3709 | */ |
3595 | void cfg80211_unregister_wdev(struct wireless_dev *wdev); | 3710 | void cfg80211_unregister_wdev(struct wireless_dev *wdev); |
3596 | 3711 | ||
3712 | /** | ||
3713 | * cfg80211_get_p2p_attr - find and copy a P2P attribute from IE buffer | ||
3714 | * @ies: the input IE buffer | ||
3715 | * @len: the input length | ||
3716 | * @attr: the attribute ID to find | ||
3717 | * @buf: output buffer, can be %NULL if the data isn't needed, e.g. | ||
3718 | * if the function is only called to get the needed buffer size | ||
3719 | * @bufsize: size of the output buffer | ||
3720 | * | ||
3721 | * The function finds a given P2P attribute in the (vendor) IEs and | ||
3722 | * copies its contents to the given buffer. | ||
3723 | * | ||
3724 | * The return value is a negative error code (-%EILSEQ or -%ENOENT) if | ||
3725 | * the data is malformed or the attribute can't be found (respectively), | ||
3726 | * or the length of the found attribute (which can be zero). | ||
3727 | */ | ||
3728 | int cfg80211_get_p2p_attr(const u8 *ies, unsigned int len, | ||
3729 | enum ieee80211_p2p_attr_id attr, | ||
3730 | u8 *buf, unsigned int bufsize); | ||
3731 | |||
3597 | /* Logging, debugging and troubleshooting/diagnostic helpers. */ | 3732 | /* Logging, debugging and troubleshooting/diagnostic helpers. */ |
3598 | 3733 | ||
3599 | /* wiphy_printk helpers, similar to dev_printk */ | 3734 | /* wiphy_printk helpers, similar to dev_printk */ |
diff --git a/include/net/cls_cgroup.h b/include/net/cls_cgroup.h index b6a6eeb3905f..2581638f4a3d 100644 --- a/include/net/cls_cgroup.h +++ b/include/net/cls_cgroup.h | |||
@@ -24,12 +24,12 @@ struct cgroup_cls_state | |||
24 | u32 classid; | 24 | u32 classid; |
25 | }; | 25 | }; |
26 | 26 | ||
27 | extern void sock_update_classid(struct sock *sk); | 27 | extern void sock_update_classid(struct sock *sk, struct task_struct *task); |
28 | 28 | ||
29 | #if IS_BUILTIN(CONFIG_NET_CLS_CGROUP) | 29 | #if IS_BUILTIN(CONFIG_NET_CLS_CGROUP) |
30 | static inline u32 task_cls_classid(struct task_struct *p) | 30 | static inline u32 task_cls_classid(struct task_struct *p) |
31 | { | 31 | { |
32 | int classid; | 32 | u32 classid; |
33 | 33 | ||
34 | if (in_interrupt()) | 34 | if (in_interrupt()) |
35 | return 0; | 35 | return 0; |
@@ -61,7 +61,7 @@ static inline u32 task_cls_classid(struct task_struct *p) | |||
61 | } | 61 | } |
62 | #endif | 62 | #endif |
63 | #else /* !CGROUP_NET_CLS_CGROUP */ | 63 | #else /* !CGROUP_NET_CLS_CGROUP */ |
64 | static inline void sock_update_classid(struct sock *sk) | 64 | static inline void sock_update_classid(struct sock *sk, struct task_struct *task) |
65 | { | 65 | { |
66 | } | 66 | } |
67 | 67 | ||
diff --git a/include/net/ip6_checksum.h b/include/net/ip6_checksum.h index bc1b0fda2b04..652d3d309357 100644 --- a/include/net/ip6_checksum.h +++ b/include/net/ip6_checksum.h | |||
@@ -31,6 +31,8 @@ | |||
31 | #include <net/ip.h> | 31 | #include <net/ip.h> |
32 | #include <asm/checksum.h> | 32 | #include <asm/checksum.h> |
33 | #include <linux/in6.h> | 33 | #include <linux/in6.h> |
34 | #include <linux/tcp.h> | ||
35 | #include <linux/ipv6.h> | ||
34 | 36 | ||
35 | #ifndef _HAVE_ARCH_IPV6_CSUM | 37 | #ifndef _HAVE_ARCH_IPV6_CSUM |
36 | 38 | ||
@@ -91,4 +93,37 @@ static __inline__ __sum16 csum_ipv6_magic(const struct in6_addr *saddr, | |||
91 | } | 93 | } |
92 | 94 | ||
93 | #endif | 95 | #endif |
96 | |||
97 | static __inline__ __sum16 tcp_v6_check(int len, | ||
98 | const struct in6_addr *saddr, | ||
99 | const struct in6_addr *daddr, | ||
100 | __wsum base) | ||
101 | { | ||
102 | return csum_ipv6_magic(saddr, daddr, len, IPPROTO_TCP, base); | ||
103 | } | ||
104 | |||
105 | static inline void __tcp_v6_send_check(struct sk_buff *skb, | ||
106 | const struct in6_addr *saddr, | ||
107 | const struct in6_addr *daddr) | ||
108 | { | ||
109 | struct tcphdr *th = tcp_hdr(skb); | ||
110 | |||
111 | if (skb->ip_summed == CHECKSUM_PARTIAL) { | ||
112 | th->check = ~tcp_v6_check(skb->len, saddr, daddr, 0); | ||
113 | skb->csum_start = skb_transport_header(skb) - skb->head; | ||
114 | skb->csum_offset = offsetof(struct tcphdr, check); | ||
115 | } else { | ||
116 | th->check = tcp_v6_check(skb->len, saddr, daddr, | ||
117 | csum_partial(th, th->doff << 2, | ||
118 | skb->csum)); | ||
119 | } | ||
120 | } | ||
121 | |||
122 | static inline void tcp_v6_send_check(struct sock *sk, struct sk_buff *skb) | ||
123 | { | ||
124 | struct ipv6_pinfo *np = inet6_sk(sk); | ||
125 | |||
126 | __tcp_v6_send_check(skb, &np->saddr, &np->daddr); | ||
127 | } | ||
128 | |||
94 | #endif | 129 | #endif |
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h index 8a2a203eb15d..fdc48a94a063 100644 --- a/include/net/ip6_fib.h +++ b/include/net/ip6_fib.h | |||
@@ -47,6 +47,8 @@ struct fib6_config { | |||
47 | unsigned long fc_expires; | 47 | unsigned long fc_expires; |
48 | struct nlattr *fc_mx; | 48 | struct nlattr *fc_mx; |
49 | int fc_mx_len; | 49 | int fc_mx_len; |
50 | int fc_mp_len; | ||
51 | struct nlattr *fc_mp; | ||
50 | 52 | ||
51 | struct nl_info fc_nlinfo; | 53 | struct nl_info fc_nlinfo; |
52 | }; | 54 | }; |
@@ -99,6 +101,14 @@ struct rt6_info { | |||
99 | 101 | ||
100 | struct in6_addr rt6i_gateway; | 102 | struct in6_addr rt6i_gateway; |
101 | 103 | ||
104 | /* Multipath routes: | ||
105 | * siblings is a list of rt6_info that have the the same metric/weight, | ||
106 | * destination, but not the same gateway. nsiblings is just a cache | ||
107 | * to speed up lookup. | ||
108 | */ | ||
109 | struct list_head rt6i_siblings; | ||
110 | unsigned int rt6i_nsiblings; | ||
111 | |||
102 | atomic_t rt6i_ref; | 112 | atomic_t rt6i_ref; |
103 | 113 | ||
104 | /* These are in a separate cache line. */ | 114 | /* These are in a separate cache line. */ |
@@ -107,7 +117,6 @@ struct rt6_info { | |||
107 | struct rt6key rt6i_src; | 117 | struct rt6key rt6i_src; |
108 | struct rt6key rt6i_prefsrc; | 118 | struct rt6key rt6i_prefsrc; |
109 | u32 rt6i_metric; | 119 | u32 rt6i_metric; |
110 | u32 rt6i_peer_genid; | ||
111 | 120 | ||
112 | struct inet6_dev *rt6i_idev; | 121 | struct inet6_dev *rt6i_idev; |
113 | unsigned long _rt6i_peer; | 122 | unsigned long _rt6i_peer; |
@@ -203,6 +212,15 @@ static inline void rt6_set_from(struct rt6_info *rt, struct rt6_info *from) | |||
203 | dst_hold(new); | 212 | dst_hold(new); |
204 | } | 213 | } |
205 | 214 | ||
215 | static inline void ip6_rt_put(struct rt6_info *rt) | ||
216 | { | ||
217 | /* dst_release() accepts a NULL parameter. | ||
218 | * We rely on dst being first structure in struct rt6_info | ||
219 | */ | ||
220 | BUILD_BUG_ON(offsetof(struct rt6_info, dst) != 0); | ||
221 | dst_release(&rt->dst); | ||
222 | } | ||
223 | |||
206 | struct fib6_walker_t { | 224 | struct fib6_walker_t { |
207 | struct list_head lh; | 225 | struct list_head lh; |
208 | struct fib6_node *root, *node; | 226 | struct fib6_node *root, *node; |
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index 5fa2af00634a..27d83183e615 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h | |||
@@ -1,9 +1,6 @@ | |||
1 | #ifndef _NET_IP6_ROUTE_H | 1 | #ifndef _NET_IP6_ROUTE_H |
2 | #define _NET_IP6_ROUTE_H | 2 | #define _NET_IP6_ROUTE_H |
3 | 3 | ||
4 | #define IP6_RT_PRIO_USER 1024 | ||
5 | #define IP6_RT_PRIO_ADDRCONF 256 | ||
6 | |||
7 | struct route_info { | 4 | struct route_info { |
8 | __u8 type; | 5 | __u8 type; |
9 | __u8 length; | 6 | __u8 length; |
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index ee75ccdf5188..68c69d54d392 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
@@ -22,7 +22,10 @@ | |||
22 | #include <linux/ip.h> | 22 | #include <linux/ip.h> |
23 | #include <linux/ipv6.h> /* for struct ipv6hdr */ | 23 | #include <linux/ipv6.h> /* for struct ipv6hdr */ |
24 | #include <net/ipv6.h> | 24 | #include <net/ipv6.h> |
25 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | 25 | #if IS_ENABLED(CONFIG_IP_VS_IPV6) |
26 | #include <linux/netfilter_ipv6/ip6_tables.h> | ||
27 | #endif | ||
28 | #if IS_ENABLED(CONFIG_NF_CONNTRACK) | ||
26 | #include <net/netfilter/nf_conntrack.h> | 29 | #include <net/netfilter/nf_conntrack.h> |
27 | #endif | 30 | #endif |
28 | #include <net/net_namespace.h> /* Netw namespace */ | 31 | #include <net/net_namespace.h> /* Netw namespace */ |
@@ -103,30 +106,117 @@ static inline struct net *seq_file_single_net(struct seq_file *seq) | |||
103 | /* Connections' size value needed by ip_vs_ctl.c */ | 106 | /* Connections' size value needed by ip_vs_ctl.c */ |
104 | extern int ip_vs_conn_tab_size; | 107 | extern int ip_vs_conn_tab_size; |
105 | 108 | ||
106 | |||
107 | struct ip_vs_iphdr { | 109 | struct ip_vs_iphdr { |
108 | int len; | 110 | __u32 len; /* IPv4 simply where L4 starts |
109 | __u8 protocol; | 111 | IPv6 where L4 Transport Header starts */ |
112 | __u32 thoff_reasm; /* Transport Header Offset in nfct_reasm skb */ | ||
113 | __u16 fragoffs; /* IPv6 fragment offset, 0 if first frag (or not frag)*/ | ||
114 | __s16 protocol; | ||
115 | __s32 flags; | ||
110 | union nf_inet_addr saddr; | 116 | union nf_inet_addr saddr; |
111 | union nf_inet_addr daddr; | 117 | union nf_inet_addr daddr; |
112 | }; | 118 | }; |
113 | 119 | ||
120 | /* Dependency to module: nf_defrag_ipv6 */ | ||
121 | #if defined(CONFIG_NF_DEFRAG_IPV6) || defined(CONFIG_NF_DEFRAG_IPV6_MODULE) | ||
122 | static inline struct sk_buff *skb_nfct_reasm(const struct sk_buff *skb) | ||
123 | { | ||
124 | return skb->nfct_reasm; | ||
125 | } | ||
126 | static inline void *frag_safe_skb_hp(const struct sk_buff *skb, int offset, | ||
127 | int len, void *buffer, | ||
128 | const struct ip_vs_iphdr *ipvsh) | ||
129 | { | ||
130 | if (unlikely(ipvsh->fragoffs && skb_nfct_reasm(skb))) | ||
131 | return skb_header_pointer(skb_nfct_reasm(skb), | ||
132 | ipvsh->thoff_reasm, len, buffer); | ||
133 | |||
134 | return skb_header_pointer(skb, offset, len, buffer); | ||
135 | } | ||
136 | #else | ||
137 | static inline struct sk_buff *skb_nfct_reasm(const struct sk_buff *skb) | ||
138 | { | ||
139 | return NULL; | ||
140 | } | ||
141 | static inline void *frag_safe_skb_hp(const struct sk_buff *skb, int offset, | ||
142 | int len, void *buffer, | ||
143 | const struct ip_vs_iphdr *ipvsh) | ||
144 | { | ||
145 | return skb_header_pointer(skb, offset, len, buffer); | ||
146 | } | ||
147 | #endif | ||
148 | |||
114 | static inline void | 149 | static inline void |
115 | ip_vs_fill_iphdr(int af, const void *nh, struct ip_vs_iphdr *iphdr) | 150 | ip_vs_fill_ip4hdr(const void *nh, struct ip_vs_iphdr *iphdr) |
151 | { | ||
152 | const struct iphdr *iph = nh; | ||
153 | |||
154 | iphdr->len = iph->ihl * 4; | ||
155 | iphdr->fragoffs = 0; | ||
156 | iphdr->protocol = iph->protocol; | ||
157 | iphdr->saddr.ip = iph->saddr; | ||
158 | iphdr->daddr.ip = iph->daddr; | ||
159 | } | ||
160 | |||
161 | /* This function handles filling *ip_vs_iphdr, both for IPv4 and IPv6. | ||
162 | * IPv6 requires some extra work, as finding proper header position, | ||
163 | * depend on the IPv6 extension headers. | ||
164 | */ | ||
165 | static inline void | ||
166 | ip_vs_fill_iph_skb(int af, const struct sk_buff *skb, struct ip_vs_iphdr *iphdr) | ||
116 | { | 167 | { |
117 | #ifdef CONFIG_IP_VS_IPV6 | 168 | #ifdef CONFIG_IP_VS_IPV6 |
118 | if (af == AF_INET6) { | 169 | if (af == AF_INET6) { |
119 | const struct ipv6hdr *iph = nh; | 170 | const struct ipv6hdr *iph = |
120 | iphdr->len = sizeof(struct ipv6hdr); | 171 | (struct ipv6hdr *)skb_network_header(skb); |
121 | iphdr->protocol = iph->nexthdr; | ||
122 | iphdr->saddr.in6 = iph->saddr; | 172 | iphdr->saddr.in6 = iph->saddr; |
123 | iphdr->daddr.in6 = iph->daddr; | 173 | iphdr->daddr.in6 = iph->daddr; |
174 | /* ipv6_find_hdr() updates len, flags, thoff_reasm */ | ||
175 | iphdr->thoff_reasm = 0; | ||
176 | iphdr->len = 0; | ||
177 | iphdr->flags = 0; | ||
178 | iphdr->protocol = ipv6_find_hdr(skb, &iphdr->len, -1, | ||
179 | &iphdr->fragoffs, | ||
180 | &iphdr->flags); | ||
181 | /* get proto from re-assembled packet and it's offset */ | ||
182 | if (skb_nfct_reasm(skb)) | ||
183 | iphdr->protocol = ipv6_find_hdr(skb_nfct_reasm(skb), | ||
184 | &iphdr->thoff_reasm, | ||
185 | -1, NULL, NULL); | ||
186 | |||
124 | } else | 187 | } else |
125 | #endif | 188 | #endif |
126 | { | 189 | { |
127 | const struct iphdr *iph = nh; | 190 | const struct iphdr *iph = |
128 | iphdr->len = iph->ihl * 4; | 191 | (struct iphdr *)skb_network_header(skb); |
129 | iphdr->protocol = iph->protocol; | 192 | iphdr->len = iph->ihl * 4; |
193 | iphdr->fragoffs = 0; | ||
194 | iphdr->protocol = iph->protocol; | ||
195 | iphdr->saddr.ip = iph->saddr; | ||
196 | iphdr->daddr.ip = iph->daddr; | ||
197 | } | ||
198 | } | ||
199 | |||
200 | /* This function is a faster version of ip_vs_fill_iph_skb(). | ||
201 | * Where we only populate {s,d}addr (and avoid calling ipv6_find_hdr()). | ||
202 | * This is used by the some of the ip_vs_*_schedule() functions. | ||
203 | * (Mostly done to avoid ABI breakage of external schedulers) | ||
204 | */ | ||
205 | static inline void | ||
206 | ip_vs_fill_iph_addr_only(int af, const struct sk_buff *skb, | ||
207 | struct ip_vs_iphdr *iphdr) | ||
208 | { | ||
209 | #ifdef CONFIG_IP_VS_IPV6 | ||
210 | if (af == AF_INET6) { | ||
211 | const struct ipv6hdr *iph = | ||
212 | (struct ipv6hdr *)skb_network_header(skb); | ||
213 | iphdr->saddr.in6 = iph->saddr; | ||
214 | iphdr->daddr.in6 = iph->daddr; | ||
215 | } else | ||
216 | #endif | ||
217 | { | ||
218 | const struct iphdr *iph = | ||
219 | (struct iphdr *)skb_network_header(skb); | ||
130 | iphdr->saddr.ip = iph->saddr; | 220 | iphdr->saddr.ip = iph->saddr; |
131 | iphdr->daddr.ip = iph->daddr; | 221 | iphdr->daddr.ip = iph->daddr; |
132 | } | 222 | } |
@@ -165,7 +255,7 @@ static inline const char *ip_vs_dbg_addr(int af, char *buf, size_t buf_len, | |||
165 | int len; | 255 | int len; |
166 | #ifdef CONFIG_IP_VS_IPV6 | 256 | #ifdef CONFIG_IP_VS_IPV6 |
167 | if (af == AF_INET6) | 257 | if (af == AF_INET6) |
168 | len = snprintf(&buf[*idx], buf_len - *idx, "[%pI6]", | 258 | len = snprintf(&buf[*idx], buf_len - *idx, "[%pI6c]", |
169 | &addr->in6) + 1; | 259 | &addr->in6) + 1; |
170 | else | 260 | else |
171 | #endif | 261 | #endif |
@@ -398,27 +488,26 @@ struct ip_vs_protocol { | |||
398 | 488 | ||
399 | int (*conn_schedule)(int af, struct sk_buff *skb, | 489 | int (*conn_schedule)(int af, struct sk_buff *skb, |
400 | struct ip_vs_proto_data *pd, | 490 | struct ip_vs_proto_data *pd, |
401 | int *verdict, struct ip_vs_conn **cpp); | 491 | int *verdict, struct ip_vs_conn **cpp, |
492 | struct ip_vs_iphdr *iph); | ||
402 | 493 | ||
403 | struct ip_vs_conn * | 494 | struct ip_vs_conn * |
404 | (*conn_in_get)(int af, | 495 | (*conn_in_get)(int af, |
405 | const struct sk_buff *skb, | 496 | const struct sk_buff *skb, |
406 | const struct ip_vs_iphdr *iph, | 497 | const struct ip_vs_iphdr *iph, |
407 | unsigned int proto_off, | ||
408 | int inverse); | 498 | int inverse); |
409 | 499 | ||
410 | struct ip_vs_conn * | 500 | struct ip_vs_conn * |
411 | (*conn_out_get)(int af, | 501 | (*conn_out_get)(int af, |
412 | const struct sk_buff *skb, | 502 | const struct sk_buff *skb, |
413 | const struct ip_vs_iphdr *iph, | 503 | const struct ip_vs_iphdr *iph, |
414 | unsigned int proto_off, | ||
415 | int inverse); | 504 | int inverse); |
416 | 505 | ||
417 | int (*snat_handler)(struct sk_buff *skb, | 506 | int (*snat_handler)(struct sk_buff *skb, struct ip_vs_protocol *pp, |
418 | struct ip_vs_protocol *pp, struct ip_vs_conn *cp); | 507 | struct ip_vs_conn *cp, struct ip_vs_iphdr *iph); |
419 | 508 | ||
420 | int (*dnat_handler)(struct sk_buff *skb, | 509 | int (*dnat_handler)(struct sk_buff *skb, struct ip_vs_protocol *pp, |
421 | struct ip_vs_protocol *pp, struct ip_vs_conn *cp); | 510 | struct ip_vs_conn *cp, struct ip_vs_iphdr *iph); |
422 | 511 | ||
423 | int (*csum_check)(int af, struct sk_buff *skb, | 512 | int (*csum_check)(int af, struct sk_buff *skb, |
424 | struct ip_vs_protocol *pp); | 513 | struct ip_vs_protocol *pp); |
@@ -518,7 +607,7 @@ struct ip_vs_conn { | |||
518 | NF_ACCEPT can be returned when destination is local. | 607 | NF_ACCEPT can be returned when destination is local. |
519 | */ | 608 | */ |
520 | int (*packet_xmit)(struct sk_buff *skb, struct ip_vs_conn *cp, | 609 | int (*packet_xmit)(struct sk_buff *skb, struct ip_vs_conn *cp, |
521 | struct ip_vs_protocol *pp); | 610 | struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph); |
522 | 611 | ||
523 | /* Note: we can group the following members into a structure, | 612 | /* Note: we can group the following members into a structure, |
524 | in order to save more space, and the following members are | 613 | in order to save more space, and the following members are |
@@ -769,13 +858,11 @@ struct ip_vs_app { | |||
769 | 858 | ||
770 | struct ip_vs_conn * | 859 | struct ip_vs_conn * |
771 | (*conn_in_get)(const struct sk_buff *skb, struct ip_vs_app *app, | 860 | (*conn_in_get)(const struct sk_buff *skb, struct ip_vs_app *app, |
772 | const struct iphdr *iph, unsigned int proto_off, | 861 | const struct iphdr *iph, int inverse); |
773 | int inverse); | ||
774 | 862 | ||
775 | struct ip_vs_conn * | 863 | struct ip_vs_conn * |
776 | (*conn_out_get)(const struct sk_buff *skb, struct ip_vs_app *app, | 864 | (*conn_out_get)(const struct sk_buff *skb, struct ip_vs_app *app, |
777 | const struct iphdr *iph, unsigned int proto_off, | 865 | const struct iphdr *iph, int inverse); |
778 | int inverse); | ||
779 | 866 | ||
780 | int (*state_transition)(struct ip_vs_conn *cp, int direction, | 867 | int (*state_transition)(struct ip_vs_conn *cp, int direction, |
781 | const struct sk_buff *skb, | 868 | const struct sk_buff *skb, |
@@ -1074,14 +1161,12 @@ struct ip_vs_conn *ip_vs_ct_in_get(const struct ip_vs_conn_param *p); | |||
1074 | 1161 | ||
1075 | struct ip_vs_conn * ip_vs_conn_in_get_proto(int af, const struct sk_buff *skb, | 1162 | struct ip_vs_conn * ip_vs_conn_in_get_proto(int af, const struct sk_buff *skb, |
1076 | const struct ip_vs_iphdr *iph, | 1163 | const struct ip_vs_iphdr *iph, |
1077 | unsigned int proto_off, | ||
1078 | int inverse); | 1164 | int inverse); |
1079 | 1165 | ||
1080 | struct ip_vs_conn *ip_vs_conn_out_get(const struct ip_vs_conn_param *p); | 1166 | struct ip_vs_conn *ip_vs_conn_out_get(const struct ip_vs_conn_param *p); |
1081 | 1167 | ||
1082 | struct ip_vs_conn * ip_vs_conn_out_get_proto(int af, const struct sk_buff *skb, | 1168 | struct ip_vs_conn * ip_vs_conn_out_get_proto(int af, const struct sk_buff *skb, |
1083 | const struct ip_vs_iphdr *iph, | 1169 | const struct ip_vs_iphdr *iph, |
1084 | unsigned int proto_off, | ||
1085 | int inverse); | 1170 | int inverse); |
1086 | 1171 | ||
1087 | /* put back the conn without restarting its timer */ | 1172 | /* put back the conn without restarting its timer */ |
@@ -1254,9 +1339,10 @@ extern struct ip_vs_scheduler *ip_vs_scheduler_get(const char *sched_name); | |||
1254 | extern void ip_vs_scheduler_put(struct ip_vs_scheduler *scheduler); | 1339 | extern void ip_vs_scheduler_put(struct ip_vs_scheduler *scheduler); |
1255 | extern struct ip_vs_conn * | 1340 | extern struct ip_vs_conn * |
1256 | ip_vs_schedule(struct ip_vs_service *svc, struct sk_buff *skb, | 1341 | ip_vs_schedule(struct ip_vs_service *svc, struct sk_buff *skb, |
1257 | struct ip_vs_proto_data *pd, int *ignored); | 1342 | struct ip_vs_proto_data *pd, int *ignored, |
1343 | struct ip_vs_iphdr *iph); | ||
1258 | extern int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb, | 1344 | extern int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb, |
1259 | struct ip_vs_proto_data *pd); | 1345 | struct ip_vs_proto_data *pd, struct ip_vs_iphdr *iph); |
1260 | 1346 | ||
1261 | extern void ip_vs_scheduler_err(struct ip_vs_service *svc, const char *msg); | 1347 | extern void ip_vs_scheduler_err(struct ip_vs_service *svc, const char *msg); |
1262 | 1348 | ||
@@ -1315,33 +1401,38 @@ extern void ip_vs_read_estimator(struct ip_vs_stats_user *dst, | |||
1315 | /* | 1401 | /* |
1316 | * Various IPVS packet transmitters (from ip_vs_xmit.c) | 1402 | * Various IPVS packet transmitters (from ip_vs_xmit.c) |
1317 | */ | 1403 | */ |
1318 | extern int ip_vs_null_xmit | 1404 | extern int ip_vs_null_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, |
1319 | (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); | 1405 | struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph); |
1320 | extern int ip_vs_bypass_xmit | 1406 | extern int ip_vs_bypass_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, |
1321 | (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); | 1407 | struct ip_vs_protocol *pp, |
1322 | extern int ip_vs_nat_xmit | 1408 | struct ip_vs_iphdr *iph); |
1323 | (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); | 1409 | extern int ip_vs_nat_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, |
1324 | extern int ip_vs_tunnel_xmit | 1410 | struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph); |
1325 | (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); | 1411 | extern int ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, |
1326 | extern int ip_vs_dr_xmit | 1412 | struct ip_vs_protocol *pp, |
1327 | (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); | 1413 | struct ip_vs_iphdr *iph); |
1328 | extern int ip_vs_icmp_xmit | 1414 | extern int ip_vs_dr_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, |
1329 | (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp, | 1415 | struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph); |
1330 | int offset, unsigned int hooknum); | 1416 | extern int ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, |
1417 | struct ip_vs_protocol *pp, int offset, | ||
1418 | unsigned int hooknum, struct ip_vs_iphdr *iph); | ||
1331 | extern void ip_vs_dst_reset(struct ip_vs_dest *dest); | 1419 | extern void ip_vs_dst_reset(struct ip_vs_dest *dest); |
1332 | 1420 | ||
1333 | #ifdef CONFIG_IP_VS_IPV6 | 1421 | #ifdef CONFIG_IP_VS_IPV6 |
1334 | extern int ip_vs_bypass_xmit_v6 | 1422 | extern int ip_vs_bypass_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp, |
1335 | (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); | 1423 | struct ip_vs_protocol *pp, |
1336 | extern int ip_vs_nat_xmit_v6 | 1424 | struct ip_vs_iphdr *iph); |
1337 | (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); | 1425 | extern int ip_vs_nat_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp, |
1338 | extern int ip_vs_tunnel_xmit_v6 | 1426 | struct ip_vs_protocol *pp, |
1339 | (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); | 1427 | struct ip_vs_iphdr *iph); |
1340 | extern int ip_vs_dr_xmit_v6 | 1428 | extern int ip_vs_tunnel_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp, |
1341 | (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp); | 1429 | struct ip_vs_protocol *pp, |
1342 | extern int ip_vs_icmp_xmit_v6 | 1430 | struct ip_vs_iphdr *iph); |
1343 | (struct sk_buff *skb, struct ip_vs_conn *cp, struct ip_vs_protocol *pp, | 1431 | extern int ip_vs_dr_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp, |
1344 | int offset, unsigned int hooknum); | 1432 | struct ip_vs_protocol *pp, struct ip_vs_iphdr *iph); |
1433 | extern int ip_vs_icmp_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp, | ||
1434 | struct ip_vs_protocol *pp, int offset, | ||
1435 | unsigned int hooknum, struct ip_vs_iphdr *iph); | ||
1345 | #endif | 1436 | #endif |
1346 | 1437 | ||
1347 | #ifdef CONFIG_SYSCTL | 1438 | #ifdef CONFIG_SYSCTL |
diff --git a/include/net/ipip.h b/include/net/ipip.h index ddc077c51f32..21947cf4fa46 100644 --- a/include/net/ipip.h +++ b/include/net/ipip.h | |||
@@ -48,25 +48,27 @@ struct ip_tunnel_prl_entry { | |||
48 | struct rcu_head rcu_head; | 48 | struct rcu_head rcu_head; |
49 | }; | 49 | }; |
50 | 50 | ||
51 | #define __IPTUNNEL_XMIT(stats1, stats2) do { \ | 51 | static inline void iptunnel_xmit(struct sk_buff *skb, struct net_device *dev) |
52 | int err; \ | 52 | { |
53 | int pkt_len = skb->len - skb_transport_offset(skb); \ | 53 | int err; |
54 | \ | 54 | struct iphdr *iph = ip_hdr(skb); |
55 | skb->ip_summed = CHECKSUM_NONE; \ | 55 | int pkt_len = skb->len - skb_transport_offset(skb); |
56 | ip_select_ident(iph, &rt->dst, NULL); \ | 56 | struct pcpu_tstats *tstats = this_cpu_ptr(dev->tstats); |
57 | \ | ||
58 | err = ip_local_out(skb); \ | ||
59 | if (likely(net_xmit_eval(err) == 0)) { \ | ||
60 | u64_stats_update_begin(&(stats1)->syncp); \ | ||
61 | (stats1)->tx_bytes += pkt_len; \ | ||
62 | (stats1)->tx_packets++; \ | ||
63 | u64_stats_update_end(&(stats1)->syncp); \ | ||
64 | } else { \ | ||
65 | (stats2)->tx_errors++; \ | ||
66 | (stats2)->tx_aborted_errors++; \ | ||
67 | } \ | ||
68 | } while (0) | ||
69 | 57 | ||
70 | #define IPTUNNEL_XMIT() __IPTUNNEL_XMIT(txq, stats) | 58 | nf_reset(skb); |
59 | skb->ip_summed = CHECKSUM_NONE; | ||
60 | ip_select_ident(iph, skb_dst(skb), NULL); | ||
61 | |||
62 | err = ip_local_out(skb); | ||
63 | if (likely(net_xmit_eval(err) == 0)) { | ||
64 | u64_stats_update_begin(&tstats->syncp); | ||
65 | tstats->tx_bytes += pkt_len; | ||
66 | tstats->tx_packets++; | ||
67 | u64_stats_update_end(&tstats->syncp); | ||
68 | } else { | ||
69 | dev->stats.tx_errors++; | ||
70 | dev->stats.tx_aborted_errors++; | ||
71 | } | ||
72 | } | ||
71 | 73 | ||
72 | #endif | 74 | #endif |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 82558c8decf8..db7680acd0da 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -144,6 +144,39 @@ struct ieee80211_low_level_stats { | |||
144 | }; | 144 | }; |
145 | 145 | ||
146 | /** | 146 | /** |
147 | * enum ieee80211_chanctx_change - change flag for channel context | ||
148 | * @IEEE80211_CHANCTX_CHANGE_WIDTH: The channel width changed | ||
149 | * @IEEE80211_CHANCTX_CHANGE_RX_CHAINS: The number of RX chains changed | ||
150 | */ | ||
151 | enum ieee80211_chanctx_change { | ||
152 | IEEE80211_CHANCTX_CHANGE_WIDTH = BIT(0), | ||
153 | IEEE80211_CHANCTX_CHANGE_RX_CHAINS = BIT(1), | ||
154 | }; | ||
155 | |||
156 | /** | ||
157 | * struct ieee80211_chanctx_conf - channel context that vifs may be tuned to | ||
158 | * | ||
159 | * This is the driver-visible part. The ieee80211_chanctx | ||
160 | * that contains it is visible in mac80211 only. | ||
161 | * | ||
162 | * @def: the channel definition | ||
163 | * @rx_chains_static: The number of RX chains that must always be | ||
164 | * active on the channel to receive MIMO transmissions | ||
165 | * @rx_chains_dynamic: The number of RX chains that must be enabled | ||
166 | * after RTS/CTS handshake to receive SMPS MIMO transmissions; | ||
167 | * this will always be >= @rx_chains_always. | ||
168 | * @drv_priv: data area for driver use, will always be aligned to | ||
169 | * sizeof(void *), size is determined in hw information. | ||
170 | */ | ||
171 | struct ieee80211_chanctx_conf { | ||
172 | struct cfg80211_chan_def def; | ||
173 | |||
174 | u8 rx_chains_static, rx_chains_dynamic; | ||
175 | |||
176 | u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); | ||
177 | }; | ||
178 | |||
179 | /** | ||
147 | * enum ieee80211_bss_change - BSS change notification flags | 180 | * enum ieee80211_bss_change - BSS change notification flags |
148 | * | 181 | * |
149 | * These flags are used with the bss_info_changed() callback | 182 | * These flags are used with the bss_info_changed() callback |
@@ -172,6 +205,9 @@ struct ieee80211_low_level_stats { | |||
172 | * @BSS_CHANGED_SSID: SSID changed for this BSS (AP mode) | 205 | * @BSS_CHANGED_SSID: SSID changed for this BSS (AP mode) |
173 | * @BSS_CHANGED_AP_PROBE_RESP: Probe Response changed for this BSS (AP mode) | 206 | * @BSS_CHANGED_AP_PROBE_RESP: Probe Response changed for this BSS (AP mode) |
174 | * @BSS_CHANGED_PS: PS changed for this BSS (STA mode) | 207 | * @BSS_CHANGED_PS: PS changed for this BSS (STA mode) |
208 | * @BSS_CHANGED_TXPOWER: TX power setting changed for this interface | ||
209 | * @BSS_CHANGED_P2P_PS: P2P powersave settings (CTWindow, opportunistic PS) | ||
210 | * changed (currently only in P2P client mode, GO mode will be later) | ||
175 | */ | 211 | */ |
176 | enum ieee80211_bss_change { | 212 | enum ieee80211_bss_change { |
177 | BSS_CHANGED_ASSOC = 1<<0, | 213 | BSS_CHANGED_ASSOC = 1<<0, |
@@ -192,6 +228,8 @@ enum ieee80211_bss_change { | |||
192 | BSS_CHANGED_SSID = 1<<15, | 228 | BSS_CHANGED_SSID = 1<<15, |
193 | BSS_CHANGED_AP_PROBE_RESP = 1<<16, | 229 | BSS_CHANGED_AP_PROBE_RESP = 1<<16, |
194 | BSS_CHANGED_PS = 1<<17, | 230 | BSS_CHANGED_PS = 1<<17, |
231 | BSS_CHANGED_TXPOWER = 1<<18, | ||
232 | BSS_CHANGED_P2P_PS = 1<<19, | ||
195 | 233 | ||
196 | /* when adding here, make sure to change ieee80211_reconfig */ | 234 | /* when adding here, make sure to change ieee80211_reconfig */ |
197 | }; | 235 | }; |
@@ -223,6 +261,7 @@ enum ieee80211_rssi_event { | |||
223 | * @assoc: association status | 261 | * @assoc: association status |
224 | * @ibss_joined: indicates whether this station is part of an IBSS | 262 | * @ibss_joined: indicates whether this station is part of an IBSS |
225 | * or not | 263 | * or not |
264 | * @ibss_creator: indicates if a new IBSS network is being created | ||
226 | * @aid: association ID number, valid only when @assoc is true | 265 | * @aid: association ID number, valid only when @assoc is true |
227 | * @use_cts_prot: use CTS protection | 266 | * @use_cts_prot: use CTS protection |
228 | * @use_short_preamble: use 802.11b short preamble; | 267 | * @use_short_preamble: use 802.11b short preamble; |
@@ -247,9 +286,8 @@ enum ieee80211_rssi_event { | |||
247 | * @mcast_rate: per-band multicast rate index + 1 (0: disabled) | 286 | * @mcast_rate: per-band multicast rate index + 1 (0: disabled) |
248 | * @bssid: The BSSID for this BSS | 287 | * @bssid: The BSSID for this BSS |
249 | * @enable_beacon: whether beaconing should be enabled or not | 288 | * @enable_beacon: whether beaconing should be enabled or not |
250 | * @channel_type: Channel type for this BSS -- the hardware might be | 289 | * @chandef: Channel definition for this BSS -- the hardware might be |
251 | * configured for HT40+ while this BSS only uses no-HT, for | 290 | * configured a higher bandwidth than this BSS uses, for example. |
252 | * example. | ||
253 | * @ht_operation_mode: HT operation mode like in &struct ieee80211_ht_operation. | 291 | * @ht_operation_mode: HT operation mode like in &struct ieee80211_ht_operation. |
254 | * This field is only valid when the channel type is one of the HT types. | 292 | * This field is only valid when the channel type is one of the HT types. |
255 | * @cqm_rssi_thold: Connection quality monitor RSSI threshold, a zero value | 293 | * @cqm_rssi_thold: Connection quality monitor RSSI threshold, a zero value |
@@ -273,11 +311,15 @@ enum ieee80211_rssi_event { | |||
273 | * @ssid: The SSID of the current vif. Only valid in AP-mode. | 311 | * @ssid: The SSID of the current vif. Only valid in AP-mode. |
274 | * @ssid_len: Length of SSID given in @ssid. | 312 | * @ssid_len: Length of SSID given in @ssid. |
275 | * @hidden_ssid: The SSID of the current vif is hidden. Only valid in AP-mode. | 313 | * @hidden_ssid: The SSID of the current vif is hidden. Only valid in AP-mode. |
314 | * @txpower: TX power in dBm | ||
315 | * @p2p_ctwindow: P2P CTWindow, only for P2P client interfaces | ||
316 | * @p2p_oppps: P2P opportunistic PS is enabled | ||
276 | */ | 317 | */ |
277 | struct ieee80211_bss_conf { | 318 | struct ieee80211_bss_conf { |
278 | const u8 *bssid; | 319 | const u8 *bssid; |
279 | /* association related data */ | 320 | /* association related data */ |
280 | bool assoc, ibss_joined; | 321 | bool assoc, ibss_joined; |
322 | bool ibss_creator; | ||
281 | u16 aid; | 323 | u16 aid; |
282 | /* erp related data */ | 324 | /* erp related data */ |
283 | bool use_cts_prot; | 325 | bool use_cts_prot; |
@@ -294,7 +336,7 @@ struct ieee80211_bss_conf { | |||
294 | u16 ht_operation_mode; | 336 | u16 ht_operation_mode; |
295 | s32 cqm_rssi_thold; | 337 | s32 cqm_rssi_thold; |
296 | u32 cqm_rssi_hyst; | 338 | u32 cqm_rssi_hyst; |
297 | enum nl80211_channel_type channel_type; | 339 | struct cfg80211_chan_def chandef; |
298 | __be32 arp_addr_list[IEEE80211_BSS_ARP_ADDR_LIST_LEN]; | 340 | __be32 arp_addr_list[IEEE80211_BSS_ARP_ADDR_LIST_LEN]; |
299 | u8 arp_addr_cnt; | 341 | u8 arp_addr_cnt; |
300 | bool arp_filter_enabled; | 342 | bool arp_filter_enabled; |
@@ -304,6 +346,9 @@ struct ieee80211_bss_conf { | |||
304 | u8 ssid[IEEE80211_MAX_SSID_LEN]; | 346 | u8 ssid[IEEE80211_MAX_SSID_LEN]; |
305 | size_t ssid_len; | 347 | size_t ssid_len; |
306 | bool hidden_ssid; | 348 | bool hidden_ssid; |
349 | int txpower; | ||
350 | u8 p2p_ctwindow; | ||
351 | bool p2p_oppps; | ||
307 | }; | 352 | }; |
308 | 353 | ||
309 | /** | 354 | /** |
@@ -454,9 +499,14 @@ enum mac80211_tx_control_flags { | |||
454 | * This is set if the current BSS requires ERP protection. | 499 | * This is set if the current BSS requires ERP protection. |
455 | * @IEEE80211_TX_RC_USE_SHORT_PREAMBLE: Use short preamble. | 500 | * @IEEE80211_TX_RC_USE_SHORT_PREAMBLE: Use short preamble. |
456 | * @IEEE80211_TX_RC_MCS: HT rate. | 501 | * @IEEE80211_TX_RC_MCS: HT rate. |
502 | * @IEEE80211_TX_RC_VHT_MCS: VHT MCS rate, in this case the idx field is split | ||
503 | * into a higher 4 bits (Nss) and lower 4 bits (MCS number) | ||
457 | * @IEEE80211_TX_RC_GREEN_FIELD: Indicates whether this rate should be used in | 504 | * @IEEE80211_TX_RC_GREEN_FIELD: Indicates whether this rate should be used in |
458 | * Greenfield mode. | 505 | * Greenfield mode. |
459 | * @IEEE80211_TX_RC_40_MHZ_WIDTH: Indicates if the Channel Width should be 40 MHz. | 506 | * @IEEE80211_TX_RC_40_MHZ_WIDTH: Indicates if the Channel Width should be 40 MHz. |
507 | * @IEEE80211_TX_RC_80_MHZ_WIDTH: Indicates 80 MHz transmission | ||
508 | * @IEEE80211_TX_RC_160_MHZ_WIDTH: Indicates 160 MHz transmission | ||
509 | * (80+80 isn't supported yet) | ||
460 | * @IEEE80211_TX_RC_DUP_DATA: The frame should be transmitted on both of the | 510 | * @IEEE80211_TX_RC_DUP_DATA: The frame should be transmitted on both of the |
461 | * adjacent 20 MHz channels, if the current channel type is | 511 | * adjacent 20 MHz channels, if the current channel type is |
462 | * NL80211_CHAN_HT40MINUS or NL80211_CHAN_HT40PLUS. | 512 | * NL80211_CHAN_HT40MINUS or NL80211_CHAN_HT40PLUS. |
@@ -467,12 +517,15 @@ enum mac80211_rate_control_flags { | |||
467 | IEEE80211_TX_RC_USE_CTS_PROTECT = BIT(1), | 517 | IEEE80211_TX_RC_USE_CTS_PROTECT = BIT(1), |
468 | IEEE80211_TX_RC_USE_SHORT_PREAMBLE = BIT(2), | 518 | IEEE80211_TX_RC_USE_SHORT_PREAMBLE = BIT(2), |
469 | 519 | ||
470 | /* rate index is an MCS rate number instead of an index */ | 520 | /* rate index is an HT/VHT MCS instead of an index */ |
471 | IEEE80211_TX_RC_MCS = BIT(3), | 521 | IEEE80211_TX_RC_MCS = BIT(3), |
472 | IEEE80211_TX_RC_GREEN_FIELD = BIT(4), | 522 | IEEE80211_TX_RC_GREEN_FIELD = BIT(4), |
473 | IEEE80211_TX_RC_40_MHZ_WIDTH = BIT(5), | 523 | IEEE80211_TX_RC_40_MHZ_WIDTH = BIT(5), |
474 | IEEE80211_TX_RC_DUP_DATA = BIT(6), | 524 | IEEE80211_TX_RC_DUP_DATA = BIT(6), |
475 | IEEE80211_TX_RC_SHORT_GI = BIT(7), | 525 | IEEE80211_TX_RC_SHORT_GI = BIT(7), |
526 | IEEE80211_TX_RC_VHT_MCS = BIT(8), | ||
527 | IEEE80211_TX_RC_80_MHZ_WIDTH = BIT(9), | ||
528 | IEEE80211_TX_RC_160_MHZ_WIDTH = BIT(10), | ||
476 | }; | 529 | }; |
477 | 530 | ||
478 | 531 | ||
@@ -515,10 +568,32 @@ enum mac80211_rate_control_flags { | |||
515 | */ | 568 | */ |
516 | struct ieee80211_tx_rate { | 569 | struct ieee80211_tx_rate { |
517 | s8 idx; | 570 | s8 idx; |
518 | u8 count; | 571 | u16 count:5, |
519 | u8 flags; | 572 | flags:11; |
520 | } __packed; | 573 | } __packed; |
521 | 574 | ||
575 | #define IEEE80211_MAX_TX_RETRY 31 | ||
576 | |||
577 | static inline void ieee80211_rate_set_vht(struct ieee80211_tx_rate *rate, | ||
578 | u8 mcs, u8 nss) | ||
579 | { | ||
580 | WARN_ON(mcs & ~0xF); | ||
581 | WARN_ON(nss & ~0x7); | ||
582 | rate->idx = (nss << 4) | mcs; | ||
583 | } | ||
584 | |||
585 | static inline u8 | ||
586 | ieee80211_rate_get_vht_mcs(const struct ieee80211_tx_rate *rate) | ||
587 | { | ||
588 | return rate->idx & 0xF; | ||
589 | } | ||
590 | |||
591 | static inline u8 | ||
592 | ieee80211_rate_get_vht_nss(const struct ieee80211_tx_rate *rate) | ||
593 | { | ||
594 | return rate->idx >> 4; | ||
595 | } | ||
596 | |||
522 | /** | 597 | /** |
523 | * struct ieee80211_tx_info - skb transmit information | 598 | * struct ieee80211_tx_info - skb transmit information |
524 | * | 599 | * |
@@ -663,13 +738,20 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info) | |||
663 | * the frame. | 738 | * the frame. |
664 | * @RX_FLAG_FAILED_PLCP_CRC: Set this flag if the PCLP check failed on | 739 | * @RX_FLAG_FAILED_PLCP_CRC: Set this flag if the PCLP check failed on |
665 | * the frame. | 740 | * the frame. |
666 | * @RX_FLAG_MACTIME_MPDU: The timestamp passed in the RX status (@mactime | 741 | * @RX_FLAG_MACTIME_START: The timestamp passed in the RX status (@mactime |
667 | * field) is valid and contains the time the first symbol of the MPDU | 742 | * field) is valid and contains the time the first symbol of the MPDU |
668 | * was received. This is useful in monitor mode and for proper IBSS | 743 | * was received. This is useful in monitor mode and for proper IBSS |
669 | * merging. | 744 | * merging. |
745 | * @RX_FLAG_MACTIME_END: The timestamp passed in the RX status (@mactime | ||
746 | * field) is valid and contains the time the last symbol of the MPDU | ||
747 | * (including FCS) was received. | ||
670 | * @RX_FLAG_SHORTPRE: Short preamble was used for this frame | 748 | * @RX_FLAG_SHORTPRE: Short preamble was used for this frame |
671 | * @RX_FLAG_HT: HT MCS was used and rate_idx is MCS index | 749 | * @RX_FLAG_HT: HT MCS was used and rate_idx is MCS index |
750 | * @RX_FLAG_VHT: VHT MCS was used and rate_index is MCS index | ||
672 | * @RX_FLAG_40MHZ: HT40 (40 MHz) was used | 751 | * @RX_FLAG_40MHZ: HT40 (40 MHz) was used |
752 | * @RX_FLAG_80MHZ: 80 MHz was used | ||
753 | * @RX_FLAG_80P80MHZ: 80+80 MHz was used | ||
754 | * @RX_FLAG_160MHZ: 160 MHz was used | ||
673 | * @RX_FLAG_SHORT_GI: Short guard interval was used | 755 | * @RX_FLAG_SHORT_GI: Short guard interval was used |
674 | * @RX_FLAG_NO_SIGNAL_VAL: The signal strength value is not present. | 756 | * @RX_FLAG_NO_SIGNAL_VAL: The signal strength value is not present. |
675 | * Valid only for data frames (mainly A-MPDU) | 757 | * Valid only for data frames (mainly A-MPDU) |
@@ -697,7 +779,7 @@ enum mac80211_rx_flags { | |||
697 | RX_FLAG_IV_STRIPPED = BIT(4), | 779 | RX_FLAG_IV_STRIPPED = BIT(4), |
698 | RX_FLAG_FAILED_FCS_CRC = BIT(5), | 780 | RX_FLAG_FAILED_FCS_CRC = BIT(5), |
699 | RX_FLAG_FAILED_PLCP_CRC = BIT(6), | 781 | RX_FLAG_FAILED_PLCP_CRC = BIT(6), |
700 | RX_FLAG_MACTIME_MPDU = BIT(7), | 782 | RX_FLAG_MACTIME_START = BIT(7), |
701 | RX_FLAG_SHORTPRE = BIT(8), | 783 | RX_FLAG_SHORTPRE = BIT(8), |
702 | RX_FLAG_HT = BIT(9), | 784 | RX_FLAG_HT = BIT(9), |
703 | RX_FLAG_40MHZ = BIT(10), | 785 | RX_FLAG_40MHZ = BIT(10), |
@@ -711,6 +793,11 @@ enum mac80211_rx_flags { | |||
711 | RX_FLAG_AMPDU_IS_LAST = BIT(18), | 793 | RX_FLAG_AMPDU_IS_LAST = BIT(18), |
712 | RX_FLAG_AMPDU_DELIM_CRC_ERROR = BIT(19), | 794 | RX_FLAG_AMPDU_DELIM_CRC_ERROR = BIT(19), |
713 | RX_FLAG_AMPDU_DELIM_CRC_KNOWN = BIT(20), | 795 | RX_FLAG_AMPDU_DELIM_CRC_KNOWN = BIT(20), |
796 | RX_FLAG_MACTIME_END = BIT(21), | ||
797 | RX_FLAG_VHT = BIT(22), | ||
798 | RX_FLAG_80MHZ = BIT(23), | ||
799 | RX_FLAG_80P80MHZ = BIT(24), | ||
800 | RX_FLAG_160MHZ = BIT(25), | ||
714 | }; | 801 | }; |
715 | 802 | ||
716 | /** | 803 | /** |
@@ -731,25 +818,39 @@ enum mac80211_rx_flags { | |||
731 | * @IEEE80211_HW_SIGNAL_* | 818 | * @IEEE80211_HW_SIGNAL_* |
732 | * @antenna: antenna used | 819 | * @antenna: antenna used |
733 | * @rate_idx: index of data rate into band's supported rates or MCS index if | 820 | * @rate_idx: index of data rate into band's supported rates or MCS index if |
734 | * HT rates are use (RX_FLAG_HT) | 821 | * HT or VHT is used (%RX_FLAG_HT/%RX_FLAG_VHT) |
822 | * @vht_nss: number of streams (VHT only) | ||
735 | * @flag: %RX_FLAG_* | 823 | * @flag: %RX_FLAG_* |
736 | * @rx_flags: internal RX flags for mac80211 | 824 | * @rx_flags: internal RX flags for mac80211 |
737 | * @ampdu_reference: A-MPDU reference number, must be a different value for | 825 | * @ampdu_reference: A-MPDU reference number, must be a different value for |
738 | * each A-MPDU but the same for each subframe within one A-MPDU | 826 | * each A-MPDU but the same for each subframe within one A-MPDU |
739 | * @ampdu_delimiter_crc: A-MPDU delimiter CRC | 827 | * @ampdu_delimiter_crc: A-MPDU delimiter CRC |
828 | * @vendor_radiotap_bitmap: radiotap vendor namespace presence bitmap | ||
829 | * @vendor_radiotap_len: radiotap vendor namespace length | ||
830 | * @vendor_radiotap_align: radiotap vendor namespace alignment. Note | ||
831 | * that the actual data must be at the start of the SKB data | ||
832 | * already. | ||
833 | * @vendor_radiotap_oui: radiotap vendor namespace OUI | ||
834 | * @vendor_radiotap_subns: radiotap vendor sub namespace | ||
740 | */ | 835 | */ |
741 | struct ieee80211_rx_status { | 836 | struct ieee80211_rx_status { |
742 | u64 mactime; | 837 | u64 mactime; |
743 | u32 device_timestamp; | 838 | u32 device_timestamp; |
744 | u32 ampdu_reference; | 839 | u32 ampdu_reference; |
745 | u32 flag; | 840 | u32 flag; |
841 | u32 vendor_radiotap_bitmap; | ||
842 | u16 vendor_radiotap_len; | ||
746 | u16 freq; | 843 | u16 freq; |
747 | u8 rate_idx; | 844 | u8 rate_idx; |
845 | u8 vht_nss; | ||
748 | u8 rx_flags; | 846 | u8 rx_flags; |
749 | u8 band; | 847 | u8 band; |
750 | u8 antenna; | 848 | u8 antenna; |
751 | s8 signal; | 849 | s8 signal; |
752 | u8 ampdu_delimiter_crc; | 850 | u8 ampdu_delimiter_crc; |
851 | u8 vendor_radiotap_align; | ||
852 | u8 vendor_radiotap_oui[3]; | ||
853 | u8 vendor_radiotap_subns; | ||
753 | }; | 854 | }; |
754 | 855 | ||
755 | /** | 856 | /** |
@@ -794,6 +895,8 @@ enum ieee80211_conf_flags { | |||
794 | * @IEEE80211_CONF_CHANGE_RETRY_LIMITS: retry limits changed | 895 | * @IEEE80211_CONF_CHANGE_RETRY_LIMITS: retry limits changed |
795 | * @IEEE80211_CONF_CHANGE_IDLE: Idle flag changed | 896 | * @IEEE80211_CONF_CHANGE_IDLE: Idle flag changed |
796 | * @IEEE80211_CONF_CHANGE_SMPS: Spatial multiplexing powersave mode changed | 897 | * @IEEE80211_CONF_CHANGE_SMPS: Spatial multiplexing powersave mode changed |
898 | * Note that this is only valid if channel contexts are not used, | ||
899 | * otherwise each channel context has the number of chains listed. | ||
797 | */ | 900 | */ |
798 | enum ieee80211_conf_changed { | 901 | enum ieee80211_conf_changed { |
799 | IEEE80211_CONF_CHANGE_SMPS = BIT(1), | 902 | IEEE80211_CONF_CHANGE_SMPS = BIT(1), |
@@ -845,7 +948,8 @@ enum ieee80211_smps_mode { | |||
845 | * powersave documentation below. This variable is valid only when | 948 | * powersave documentation below. This variable is valid only when |
846 | * the CONF_PS flag is set. | 949 | * the CONF_PS flag is set. |
847 | * | 950 | * |
848 | * @power_level: requested transmit power (in dBm) | 951 | * @power_level: requested transmit power (in dBm), backward compatibility |
952 | * value only that is set to the minimum of all interfaces | ||
849 | * | 953 | * |
850 | * @channel: the channel to tune to | 954 | * @channel: the channel to tune to |
851 | * @channel_type: the channel (HT) type | 955 | * @channel_type: the channel (HT) type |
@@ -859,7 +963,9 @@ enum ieee80211_smps_mode { | |||
859 | * | 963 | * |
860 | * @smps_mode: spatial multiplexing powersave mode; note that | 964 | * @smps_mode: spatial multiplexing powersave mode; note that |
861 | * %IEEE80211_SMPS_STATIC is used when the device is not | 965 | * %IEEE80211_SMPS_STATIC is used when the device is not |
862 | * configured for an HT channel | 966 | * configured for an HT channel. |
967 | * Note that this is only valid if channel contexts are not used, | ||
968 | * otherwise each channel context has the number of chains listed. | ||
863 | */ | 969 | */ |
864 | struct ieee80211_conf { | 970 | struct ieee80211_conf { |
865 | u32 flags; | 971 | u32 flags; |
@@ -931,6 +1037,11 @@ enum ieee80211_vif_flags { | |||
931 | * at runtime, mac80211 will never touch this field | 1037 | * at runtime, mac80211 will never touch this field |
932 | * @hw_queue: hardware queue for each AC | 1038 | * @hw_queue: hardware queue for each AC |
933 | * @cab_queue: content-after-beacon (DTIM beacon really) queue, AP mode only | 1039 | * @cab_queue: content-after-beacon (DTIM beacon really) queue, AP mode only |
1040 | * @chanctx_conf: The channel context this interface is assigned to, or %NULL | ||
1041 | * when it is not assigned. This pointer is RCU-protected due to the TX | ||
1042 | * path needing to access it; even though the netdev carrier will always | ||
1043 | * be off when it is %NULL there can still be races and packets could be | ||
1044 | * processed after it switches back to %NULL. | ||
934 | * @drv_priv: data area for driver use, will always be aligned to | 1045 | * @drv_priv: data area for driver use, will always be aligned to |
935 | * sizeof(void *). | 1046 | * sizeof(void *). |
936 | */ | 1047 | */ |
@@ -943,6 +1054,8 @@ struct ieee80211_vif { | |||
943 | u8 cab_queue; | 1054 | u8 cab_queue; |
944 | u8 hw_queue[IEEE80211_NUM_ACS]; | 1055 | u8 hw_queue[IEEE80211_NUM_ACS]; |
945 | 1056 | ||
1057 | struct ieee80211_chanctx_conf __rcu *chanctx_conf; | ||
1058 | |||
946 | u32 driver_flags; | 1059 | u32 driver_flags; |
947 | 1060 | ||
948 | /* must be last */ | 1061 | /* must be last */ |
@@ -1076,6 +1189,8 @@ enum ieee80211_sta_state { | |||
1076 | * @aid: AID we assigned to the station if we're an AP | 1189 | * @aid: AID we assigned to the station if we're an AP |
1077 | * @supp_rates: Bitmap of supported rates (per band) | 1190 | * @supp_rates: Bitmap of supported rates (per band) |
1078 | * @ht_cap: HT capabilities of this STA; restricted to our own TX capabilities | 1191 | * @ht_cap: HT capabilities of this STA; restricted to our own TX capabilities |
1192 | * @vht_cap: VHT capabilities of this STA; Not restricting any capabilities | ||
1193 | * of remote STA. Taking as is. | ||
1079 | * @wme: indicates whether the STA supports WME. Only valid during AP-mode. | 1194 | * @wme: indicates whether the STA supports WME. Only valid during AP-mode. |
1080 | * @drv_priv: data area for driver use, will always be aligned to | 1195 | * @drv_priv: data area for driver use, will always be aligned to |
1081 | * sizeof(void *), size is determined in hw information. | 1196 | * sizeof(void *), size is determined in hw information. |
@@ -1088,6 +1203,7 @@ struct ieee80211_sta { | |||
1088 | u8 addr[ETH_ALEN]; | 1203 | u8 addr[ETH_ALEN]; |
1089 | u16 aid; | 1204 | u16 aid; |
1090 | struct ieee80211_sta_ht_cap ht_cap; | 1205 | struct ieee80211_sta_ht_cap ht_cap; |
1206 | struct ieee80211_sta_vht_cap vht_cap; | ||
1091 | bool wme; | 1207 | bool wme; |
1092 | u8 uapsd_queues; | 1208 | u8 uapsd_queues; |
1093 | u8 max_sp; | 1209 | u8 max_sp; |
@@ -1325,6 +1441,8 @@ enum ieee80211_hw_flags { | |||
1325 | * within &struct ieee80211_vif. | 1441 | * within &struct ieee80211_vif. |
1326 | * @sta_data_size: size (in bytes) of the drv_priv data area | 1442 | * @sta_data_size: size (in bytes) of the drv_priv data area |
1327 | * within &struct ieee80211_sta. | 1443 | * within &struct ieee80211_sta. |
1444 | * @chanctx_data_size: size (in bytes) of the drv_priv data area | ||
1445 | * within &struct ieee80211_chanctx_conf. | ||
1328 | * | 1446 | * |
1329 | * @max_rates: maximum number of alternate rate retry stages the hw | 1447 | * @max_rates: maximum number of alternate rate retry stages the hw |
1330 | * can handle. | 1448 | * can handle. |
@@ -1369,6 +1487,7 @@ struct ieee80211_hw { | |||
1369 | int channel_change_time; | 1487 | int channel_change_time; |
1370 | int vif_data_size; | 1488 | int vif_data_size; |
1371 | int sta_data_size; | 1489 | int sta_data_size; |
1490 | int chanctx_data_size; | ||
1372 | int napi_weight; | 1491 | int napi_weight; |
1373 | u16 queues; | 1492 | u16 queues; |
1374 | u16 max_listen_interval; | 1493 | u16 max_listen_interval; |
@@ -2126,6 +2245,14 @@ enum ieee80211_rate_control_changed { | |||
2126 | * @sta_remove: Notifies low level driver about removal of an associated | 2245 | * @sta_remove: Notifies low level driver about removal of an associated |
2127 | * station, AP, IBSS/WDS/mesh peer etc. This callback can sleep. | 2246 | * station, AP, IBSS/WDS/mesh peer etc. This callback can sleep. |
2128 | * | 2247 | * |
2248 | * @sta_add_debugfs: Drivers can use this callback to add debugfs files | ||
2249 | * when a station is added to mac80211's station list. This callback | ||
2250 | * and @sta_remove_debugfs should be within a CONFIG_MAC80211_DEBUGFS | ||
2251 | * conditional. This callback can sleep. | ||
2252 | * | ||
2253 | * @sta_remove_debugfs: Remove the debugfs files which were added using | ||
2254 | * @sta_add_debugfs. This callback can sleep. | ||
2255 | * | ||
2129 | * @sta_notify: Notifies low level driver about power state transition of an | 2256 | * @sta_notify: Notifies low level driver about power state transition of an |
2130 | * associated station, AP, IBSS/WDS/mesh peer etc. For a VIF operating | 2257 | * associated station, AP, IBSS/WDS/mesh peer etc. For a VIF operating |
2131 | * in AP mode, this callback will not be called when the flag | 2258 | * in AP mode, this callback will not be called when the flag |
@@ -2317,6 +2444,27 @@ enum ieee80211_rate_control_changed { | |||
2317 | * The callback will be called before each transmission and upon return | 2444 | * The callback will be called before each transmission and upon return |
2318 | * mac80211 will transmit the frame right away. | 2445 | * mac80211 will transmit the frame right away. |
2319 | * The callback is optional and can (should!) sleep. | 2446 | * The callback is optional and can (should!) sleep. |
2447 | * | ||
2448 | * @add_chanctx: Notifies device driver about new channel context creation. | ||
2449 | * @remove_chanctx: Notifies device driver about channel context destruction. | ||
2450 | * @change_chanctx: Notifies device driver about channel context changes that | ||
2451 | * may happen when combining different virtual interfaces on the same | ||
2452 | * channel context with different settings | ||
2453 | * @assign_vif_chanctx: Notifies device driver about channel context being bound | ||
2454 | * to vif. Possible use is for hw queue remapping. | ||
2455 | * @unassign_vif_chanctx: Notifies device driver about channel context being | ||
2456 | * unbound from vif. | ||
2457 | * @start_ap: Start operation on the AP interface, this is called after all the | ||
2458 | * information in bss_conf is set and beacon can be retrieved. A channel | ||
2459 | * context is bound before this is called. Note that if the driver uses | ||
2460 | * software scan or ROC, this (and @stop_ap) isn't called when the AP is | ||
2461 | * just "paused" for scanning/ROC, which is indicated by the beacon being | ||
2462 | * disabled/enabled via @bss_info_changed. | ||
2463 | * @stop_ap: Stop operation on the AP interface. | ||
2464 | * | ||
2465 | * @restart_complete: Called after a call to ieee80211_restart_hw(), when the | ||
2466 | * reconfiguration has completed. This can help the driver implement the | ||
2467 | * reconfiguration step. This callback may sleep. | ||
2320 | */ | 2468 | */ |
2321 | struct ieee80211_ops { | 2469 | struct ieee80211_ops { |
2322 | void (*tx)(struct ieee80211_hw *hw, | 2470 | void (*tx)(struct ieee80211_hw *hw, |
@@ -2342,6 +2490,9 @@ struct ieee80211_ops { | |||
2342 | struct ieee80211_bss_conf *info, | 2490 | struct ieee80211_bss_conf *info, |
2343 | u32 changed); | 2491 | u32 changed); |
2344 | 2492 | ||
2493 | int (*start_ap)(struct ieee80211_hw *hw, struct ieee80211_vif *vif); | ||
2494 | void (*stop_ap)(struct ieee80211_hw *hw, struct ieee80211_vif *vif); | ||
2495 | |||
2345 | u64 (*prepare_multicast)(struct ieee80211_hw *hw, | 2496 | u64 (*prepare_multicast)(struct ieee80211_hw *hw, |
2346 | struct netdev_hw_addr_list *mc_list); | 2497 | struct netdev_hw_addr_list *mc_list); |
2347 | void (*configure_filter)(struct ieee80211_hw *hw, | 2498 | void (*configure_filter)(struct ieee80211_hw *hw, |
@@ -2383,6 +2534,16 @@ struct ieee80211_ops { | |||
2383 | struct ieee80211_sta *sta); | 2534 | struct ieee80211_sta *sta); |
2384 | int (*sta_remove)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 2535 | int (*sta_remove)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
2385 | struct ieee80211_sta *sta); | 2536 | struct ieee80211_sta *sta); |
2537 | #ifdef CONFIG_MAC80211_DEBUGFS | ||
2538 | void (*sta_add_debugfs)(struct ieee80211_hw *hw, | ||
2539 | struct ieee80211_vif *vif, | ||
2540 | struct ieee80211_sta *sta, | ||
2541 | struct dentry *dir); | ||
2542 | void (*sta_remove_debugfs)(struct ieee80211_hw *hw, | ||
2543 | struct ieee80211_vif *vif, | ||
2544 | struct ieee80211_sta *sta, | ||
2545 | struct dentry *dir); | ||
2546 | #endif | ||
2386 | void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 2547 | void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
2387 | enum sta_notify_cmd, struct ieee80211_sta *sta); | 2548 | enum sta_notify_cmd, struct ieee80211_sta *sta); |
2388 | int (*sta_state)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 2549 | int (*sta_state)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
@@ -2424,8 +2585,8 @@ struct ieee80211_ops { | |||
2424 | int (*get_antenna)(struct ieee80211_hw *hw, u32 *tx_ant, u32 *rx_ant); | 2585 | int (*get_antenna)(struct ieee80211_hw *hw, u32 *tx_ant, u32 *rx_ant); |
2425 | 2586 | ||
2426 | int (*remain_on_channel)(struct ieee80211_hw *hw, | 2587 | int (*remain_on_channel)(struct ieee80211_hw *hw, |
2588 | struct ieee80211_vif *vif, | ||
2427 | struct ieee80211_channel *chan, | 2589 | struct ieee80211_channel *chan, |
2428 | enum nl80211_channel_type channel_type, | ||
2429 | int duration); | 2590 | int duration); |
2430 | int (*cancel_remain_on_channel)(struct ieee80211_hw *hw); | 2591 | int (*cancel_remain_on_channel)(struct ieee80211_hw *hw); |
2431 | int (*set_ringparam)(struct ieee80211_hw *hw, u32 tx, u32 rx); | 2592 | int (*set_ringparam)(struct ieee80211_hw *hw, u32 tx, u32 rx); |
@@ -2461,6 +2622,22 @@ struct ieee80211_ops { | |||
2461 | 2622 | ||
2462 | void (*mgd_prepare_tx)(struct ieee80211_hw *hw, | 2623 | void (*mgd_prepare_tx)(struct ieee80211_hw *hw, |
2463 | struct ieee80211_vif *vif); | 2624 | struct ieee80211_vif *vif); |
2625 | |||
2626 | int (*add_chanctx)(struct ieee80211_hw *hw, | ||
2627 | struct ieee80211_chanctx_conf *ctx); | ||
2628 | void (*remove_chanctx)(struct ieee80211_hw *hw, | ||
2629 | struct ieee80211_chanctx_conf *ctx); | ||
2630 | void (*change_chanctx)(struct ieee80211_hw *hw, | ||
2631 | struct ieee80211_chanctx_conf *ctx, | ||
2632 | u32 changed); | ||
2633 | int (*assign_vif_chanctx)(struct ieee80211_hw *hw, | ||
2634 | struct ieee80211_vif *vif, | ||
2635 | struct ieee80211_chanctx_conf *ctx); | ||
2636 | void (*unassign_vif_chanctx)(struct ieee80211_hw *hw, | ||
2637 | struct ieee80211_vif *vif, | ||
2638 | struct ieee80211_chanctx_conf *ctx); | ||
2639 | |||
2640 | void (*restart_complete)(struct ieee80211_hw *hw); | ||
2464 | }; | 2641 | }; |
2465 | 2642 | ||
2466 | /** | 2643 | /** |
@@ -3145,6 +3322,19 @@ void ieee80211_get_tkip_p2k(struct ieee80211_key_conf *keyconf, | |||
3145 | struct sk_buff *skb, u8 *p2k); | 3322 | struct sk_buff *skb, u8 *p2k); |
3146 | 3323 | ||
3147 | /** | 3324 | /** |
3325 | * ieee80211_aes_cmac_calculate_k1_k2 - calculate the AES-CMAC sub keys | ||
3326 | * | ||
3327 | * This function computes the two AES-CMAC sub-keys, based on the | ||
3328 | * previously installed master key. | ||
3329 | * | ||
3330 | * @keyconf: the parameter passed with the set key | ||
3331 | * @k1: a buffer to be filled with the 1st sub-key | ||
3332 | * @k2: a buffer to be filled with the 2nd sub-key | ||
3333 | */ | ||
3334 | void ieee80211_aes_cmac_calculate_k1_k2(struct ieee80211_key_conf *keyconf, | ||
3335 | u8 *k1, u8 *k2); | ||
3336 | |||
3337 | /** | ||
3148 | * struct ieee80211_key_seq - key sequence counter | 3338 | * struct ieee80211_key_seq - key sequence counter |
3149 | * | 3339 | * |
3150 | * @tkip: TKIP data, containing IV32 and IV16 in host byte order | 3340 | * @tkip: TKIP data, containing IV32 and IV16 in host byte order |
@@ -3294,6 +3484,21 @@ void ieee80211_sched_scan_results(struct ieee80211_hw *hw); | |||
3294 | void ieee80211_sched_scan_stopped(struct ieee80211_hw *hw); | 3484 | void ieee80211_sched_scan_stopped(struct ieee80211_hw *hw); |
3295 | 3485 | ||
3296 | /** | 3486 | /** |
3487 | * enum ieee80211_interface_iteration_flags - interface iteration flags | ||
3488 | * @IEEE80211_IFACE_ITER_NORMAL: Iterate over all interfaces that have | ||
3489 | * been added to the driver; However, note that during hardware | ||
3490 | * reconfiguration (after restart_hw) it will iterate over a new | ||
3491 | * interface and over all the existing interfaces even if they | ||
3492 | * haven't been re-added to the driver yet. | ||
3493 | * @IEEE80211_IFACE_ITER_RESUME_ALL: During resume, iterate over all | ||
3494 | * interfaces, even if they haven't been re-added to the driver yet. | ||
3495 | */ | ||
3496 | enum ieee80211_interface_iteration_flags { | ||
3497 | IEEE80211_IFACE_ITER_NORMAL = 0, | ||
3498 | IEEE80211_IFACE_ITER_RESUME_ALL = BIT(0), | ||
3499 | }; | ||
3500 | |||
3501 | /** | ||
3297 | * ieee80211_iterate_active_interfaces - iterate active interfaces | 3502 | * ieee80211_iterate_active_interfaces - iterate active interfaces |
3298 | * | 3503 | * |
3299 | * This function iterates over the interfaces associated with a given | 3504 | * This function iterates over the interfaces associated with a given |
@@ -3301,13 +3506,15 @@ void ieee80211_sched_scan_stopped(struct ieee80211_hw *hw); | |||
3301 | * This function allows the iterator function to sleep, when the iterator | 3506 | * This function allows the iterator function to sleep, when the iterator |
3302 | * function is atomic @ieee80211_iterate_active_interfaces_atomic can | 3507 | * function is atomic @ieee80211_iterate_active_interfaces_atomic can |
3303 | * be used. | 3508 | * be used. |
3304 | * Does not iterate over a new interface during add_interface() | 3509 | * Does not iterate over a new interface during add_interface(). |
3305 | * | 3510 | * |
3306 | * @hw: the hardware struct of which the interfaces should be iterated over | 3511 | * @hw: the hardware struct of which the interfaces should be iterated over |
3512 | * @iter_flags: iteration flags, see &enum ieee80211_interface_iteration_flags | ||
3307 | * @iterator: the iterator function to call | 3513 | * @iterator: the iterator function to call |
3308 | * @data: first argument of the iterator function | 3514 | * @data: first argument of the iterator function |
3309 | */ | 3515 | */ |
3310 | void ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw, | 3516 | void ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw, |
3517 | u32 iter_flags, | ||
3311 | void (*iterator)(void *data, u8 *mac, | 3518 | void (*iterator)(void *data, u8 *mac, |
3312 | struct ieee80211_vif *vif), | 3519 | struct ieee80211_vif *vif), |
3313 | void *data); | 3520 | void *data); |
@@ -3319,13 +3526,15 @@ void ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw, | |||
3319 | * hardware that are currently active and calls the callback for them. | 3526 | * hardware that are currently active and calls the callback for them. |
3320 | * This function requires the iterator callback function to be atomic, | 3527 | * This function requires the iterator callback function to be atomic, |
3321 | * if that is not desired, use @ieee80211_iterate_active_interfaces instead. | 3528 | * if that is not desired, use @ieee80211_iterate_active_interfaces instead. |
3322 | * Does not iterate over a new interface during add_interface() | 3529 | * Does not iterate over a new interface during add_interface(). |
3323 | * | 3530 | * |
3324 | * @hw: the hardware struct of which the interfaces should be iterated over | 3531 | * @hw: the hardware struct of which the interfaces should be iterated over |
3532 | * @iter_flags: iteration flags, see &enum ieee80211_interface_iteration_flags | ||
3325 | * @iterator: the iterator function to call, cannot sleep | 3533 | * @iterator: the iterator function to call, cannot sleep |
3326 | * @data: first argument of the iterator function | 3534 | * @data: first argument of the iterator function |
3327 | */ | 3535 | */ |
3328 | void ieee80211_iterate_active_interfaces_atomic(struct ieee80211_hw *hw, | 3536 | void ieee80211_iterate_active_interfaces_atomic(struct ieee80211_hw *hw, |
3537 | u32 iter_flags, | ||
3329 | void (*iterator)(void *data, | 3538 | void (*iterator)(void *data, |
3330 | u8 *mac, | 3539 | u8 *mac, |
3331 | struct ieee80211_vif *vif), | 3540 | struct ieee80211_vif *vif), |
@@ -3524,6 +3733,27 @@ void ieee80211_iter_keys(struct ieee80211_hw *hw, | |||
3524 | void *iter_data); | 3733 | void *iter_data); |
3525 | 3734 | ||
3526 | /** | 3735 | /** |
3736 | * ieee80211_iter_chan_contexts_atomic - iterate channel contexts | ||
3737 | * @hw: pointre obtained from ieee80211_alloc_hw(). | ||
3738 | * @iter: iterator function | ||
3739 | * @iter_data: data passed to iterator function | ||
3740 | * | ||
3741 | * Iterate all active channel contexts. This function is atomic and | ||
3742 | * doesn't acquire any locks internally that might be held in other | ||
3743 | * places while calling into the driver. | ||
3744 | * | ||
3745 | * The iterator will not find a context that's being added (during | ||
3746 | * the driver callback to add it) but will find it while it's being | ||
3747 | * removed. | ||
3748 | */ | ||
3749 | void ieee80211_iter_chan_contexts_atomic( | ||
3750 | struct ieee80211_hw *hw, | ||
3751 | void (*iter)(struct ieee80211_hw *hw, | ||
3752 | struct ieee80211_chanctx_conf *chanctx_conf, | ||
3753 | void *data), | ||
3754 | void *iter_data); | ||
3755 | |||
3756 | /** | ||
3527 | * ieee80211_ap_probereq_get - retrieve a Probe Request template | 3757 | * ieee80211_ap_probereq_get - retrieve a Probe Request template |
3528 | * @hw: pointer obtained from ieee80211_alloc_hw(). | 3758 | * @hw: pointer obtained from ieee80211_alloc_hw(). |
3529 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. | 3759 | * @vif: &struct ieee80211_vif pointer from the add_interface callback. |
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index 95e646641184..c5a43f56b796 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h | |||
@@ -23,6 +23,7 @@ | |||
23 | #endif | 23 | #endif |
24 | #include <net/netns/xfrm.h> | 24 | #include <net/netns/xfrm.h> |
25 | 25 | ||
26 | struct user_namespace; | ||
26 | struct proc_dir_entry; | 27 | struct proc_dir_entry; |
27 | struct net_device; | 28 | struct net_device; |
28 | struct sock; | 29 | struct sock; |
@@ -53,6 +54,8 @@ struct net { | |||
53 | struct list_head cleanup_list; /* namespaces on death row */ | 54 | struct list_head cleanup_list; /* namespaces on death row */ |
54 | struct list_head exit_list; /* Use only net_mutex */ | 55 | struct list_head exit_list; /* Use only net_mutex */ |
55 | 56 | ||
57 | struct user_namespace *user_ns; /* Owning user namespace */ | ||
58 | |||
56 | struct proc_dir_entry *proc_net; | 59 | struct proc_dir_entry *proc_net; |
57 | struct proc_dir_entry *proc_net_stat; | 60 | struct proc_dir_entry *proc_net_stat; |
58 | 61 | ||
@@ -126,16 +129,21 @@ struct net { | |||
126 | /* Init's network namespace */ | 129 | /* Init's network namespace */ |
127 | extern struct net init_net; | 130 | extern struct net init_net; |
128 | 131 | ||
129 | #ifdef CONFIG_NET | 132 | #ifdef CONFIG_NET_NS |
130 | extern struct net *copy_net_ns(unsigned long flags, struct net *net_ns); | 133 | extern struct net *copy_net_ns(unsigned long flags, |
131 | 134 | struct user_namespace *user_ns, struct net *old_net); | |
132 | #else /* CONFIG_NET */ | 135 | |
133 | static inline struct net *copy_net_ns(unsigned long flags, struct net *net_ns) | 136 | #else /* CONFIG_NET_NS */ |
137 | #include <linux/sched.h> | ||
138 | #include <linux/nsproxy.h> | ||
139 | static inline struct net *copy_net_ns(unsigned long flags, | ||
140 | struct user_namespace *user_ns, struct net *old_net) | ||
134 | { | 141 | { |
135 | /* There is nothing to copy so this is a noop */ | 142 | if (flags & CLONE_NEWNET) |
136 | return net_ns; | 143 | return ERR_PTR(-EINVAL); |
144 | return old_net; | ||
137 | } | 145 | } |
138 | #endif /* CONFIG_NET */ | 146 | #endif /* CONFIG_NET_NS */ |
139 | 147 | ||
140 | 148 | ||
141 | extern struct list_head net_namespace_list; | 149 | extern struct list_head net_namespace_list; |
diff --git a/include/net/netns/sctp.h b/include/net/netns/sctp.h index 5e5eb1f9f14b..3573a81815ad 100644 --- a/include/net/netns/sctp.h +++ b/include/net/netns/sctp.h | |||
@@ -62,6 +62,9 @@ struct netns_sctp { | |||
62 | /* Whether Cookie Preservative is enabled(1) or not(0) */ | 62 | /* Whether Cookie Preservative is enabled(1) or not(0) */ |
63 | int cookie_preserve_enable; | 63 | int cookie_preserve_enable; |
64 | 64 | ||
65 | /* The namespace default hmac alg */ | ||
66 | char *sctp_hmac_alg; | ||
67 | |||
65 | /* Valid.Cookie.Life - 60 seconds */ | 68 | /* Valid.Cookie.Life - 60 seconds */ |
66 | unsigned int valid_cookie_life; | 69 | unsigned int valid_cookie_life; |
67 | 70 | ||
diff --git a/include/net/nfc/hci.h b/include/net/nfc/hci.h index e900072950cb..671953e11575 100644 --- a/include/net/nfc/hci.h +++ b/include/net/nfc/hci.h | |||
@@ -24,6 +24,12 @@ | |||
24 | 24 | ||
25 | #include <net/nfc/nfc.h> | 25 | #include <net/nfc/nfc.h> |
26 | 26 | ||
27 | struct nfc_phy_ops { | ||
28 | int (*write)(void *dev_id, struct sk_buff *skb); | ||
29 | int (*enable)(void *dev_id); | ||
30 | void (*disable)(void *dev_id); | ||
31 | }; | ||
32 | |||
27 | struct nfc_hci_dev; | 33 | struct nfc_hci_dev; |
28 | 34 | ||
29 | struct nfc_hci_ops { | 35 | struct nfc_hci_ops { |
@@ -38,15 +44,21 @@ struct nfc_hci_ops { | |||
38 | int (*xmit) (struct nfc_hci_dev *hdev, struct sk_buff *skb); | 44 | int (*xmit) (struct nfc_hci_dev *hdev, struct sk_buff *skb); |
39 | int (*start_poll) (struct nfc_hci_dev *hdev, | 45 | int (*start_poll) (struct nfc_hci_dev *hdev, |
40 | u32 im_protocols, u32 tm_protocols); | 46 | u32 im_protocols, u32 tm_protocols); |
47 | int (*dep_link_up)(struct nfc_hci_dev *hdev, struct nfc_target *target, | ||
48 | u8 comm_mode, u8 *gb, size_t gb_len); | ||
49 | int (*dep_link_down)(struct nfc_hci_dev *hdev); | ||
41 | int (*target_from_gate) (struct nfc_hci_dev *hdev, u8 gate, | 50 | int (*target_from_gate) (struct nfc_hci_dev *hdev, u8 gate, |
42 | struct nfc_target *target); | 51 | struct nfc_target *target); |
43 | int (*complete_target_discovered) (struct nfc_hci_dev *hdev, u8 gate, | 52 | int (*complete_target_discovered) (struct nfc_hci_dev *hdev, u8 gate, |
44 | struct nfc_target *target); | 53 | struct nfc_target *target); |
45 | int (*data_exchange) (struct nfc_hci_dev *hdev, | 54 | int (*im_transceive) (struct nfc_hci_dev *hdev, |
46 | struct nfc_target *target, struct sk_buff *skb, | 55 | struct nfc_target *target, struct sk_buff *skb, |
47 | data_exchange_cb_t cb, void *cb_context); | 56 | data_exchange_cb_t cb, void *cb_context); |
57 | int (*tm_send)(struct nfc_hci_dev *hdev, struct sk_buff *skb); | ||
48 | int (*check_presence)(struct nfc_hci_dev *hdev, | 58 | int (*check_presence)(struct nfc_hci_dev *hdev, |
49 | struct nfc_target *target); | 59 | struct nfc_target *target); |
60 | void (*event_received)(struct nfc_hci_dev *hdev, u8 gate, u8 event, | ||
61 | struct sk_buff *skb); | ||
50 | }; | 62 | }; |
51 | 63 | ||
52 | /* Pipes */ | 64 | /* Pipes */ |
@@ -114,6 +126,9 @@ struct nfc_hci_dev { | |||
114 | int async_cb_type; | 126 | int async_cb_type; |
115 | data_exchange_cb_t async_cb; | 127 | data_exchange_cb_t async_cb; |
116 | void *async_cb_context; | 128 | void *async_cb_context; |
129 | |||
130 | u8 *gb; | ||
131 | size_t gb_len; | ||
117 | }; | 132 | }; |
118 | 133 | ||
119 | /* hci device allocation */ | 134 | /* hci device allocation */ |
@@ -134,6 +149,8 @@ void *nfc_hci_get_clientdata(struct nfc_hci_dev *hdev); | |||
134 | 149 | ||
135 | void nfc_hci_driver_failure(struct nfc_hci_dev *hdev, int err); | 150 | void nfc_hci_driver_failure(struct nfc_hci_dev *hdev, int err); |
136 | 151 | ||
152 | int nfc_hci_result_to_errno(u8 result); | ||
153 | |||
137 | /* Host IDs */ | 154 | /* Host IDs */ |
138 | #define NFC_HCI_HOST_CONTROLLER_ID 0x00 | 155 | #define NFC_HCI_HOST_CONTROLLER_ID 0x00 |
139 | #define NFC_HCI_TERMINAL_HOST_ID 0x01 | 156 | #define NFC_HCI_TERMINAL_HOST_ID 0x01 |
@@ -219,5 +236,7 @@ int nfc_hci_send_response(struct nfc_hci_dev *hdev, u8 gate, u8 response, | |||
219 | const u8 *param, size_t param_len); | 236 | const u8 *param, size_t param_len); |
220 | int nfc_hci_send_event(struct nfc_hci_dev *hdev, u8 gate, u8 event, | 237 | int nfc_hci_send_event(struct nfc_hci_dev *hdev, u8 gate, u8 event, |
221 | const u8 *param, size_t param_len); | 238 | const u8 *param, size_t param_len); |
239 | int nfc_hci_target_discovered(struct nfc_hci_dev *hdev, u8 gate); | ||
240 | u32 nfc_hci_sak_to_protocol(u8 sak); | ||
222 | 241 | ||
223 | #endif /* __NET_HCI_H */ | 242 | #endif /* __NET_HCI_H */ |
diff --git a/include/net/nfc/nfc.h b/include/net/nfc/nfc.h index f05b10682c9d..fce80b2f9be7 100644 --- a/include/net/nfc/nfc.h +++ b/include/net/nfc/nfc.h | |||
@@ -95,7 +95,7 @@ struct nfc_genl_data { | |||
95 | }; | 95 | }; |
96 | 96 | ||
97 | struct nfc_dev { | 97 | struct nfc_dev { |
98 | unsigned int idx; | 98 | int idx; |
99 | u32 target_next_idx; | 99 | u32 target_next_idx; |
100 | struct nfc_target *targets; | 100 | struct nfc_target *targets; |
101 | int n_targets; | 101 | int n_targets; |
diff --git a/include/net/protocol.h b/include/net/protocol.h index 929528c73fe8..047c0476c0a0 100644 --- a/include/net/protocol.h +++ b/include/net/protocol.h | |||
@@ -25,9 +25,11 @@ | |||
25 | #define _PROTOCOL_H | 25 | #define _PROTOCOL_H |
26 | 26 | ||
27 | #include <linux/in6.h> | 27 | #include <linux/in6.h> |
28 | #include <linux/skbuff.h> | ||
28 | #if IS_ENABLED(CONFIG_IPV6) | 29 | #if IS_ENABLED(CONFIG_IPV6) |
29 | #include <linux/ipv6.h> | 30 | #include <linux/ipv6.h> |
30 | #endif | 31 | #endif |
32 | #include <linux/netdevice.h> | ||
31 | 33 | ||
32 | /* This is one larger than the largest protocol value that can be | 34 | /* This is one larger than the largest protocol value that can be |
33 | * found in an ipv4 or ipv6 header. Since in both cases the protocol | 35 | * found in an ipv4 or ipv6 header. Since in both cases the protocol |
@@ -40,12 +42,6 @@ struct net_protocol { | |||
40 | void (*early_demux)(struct sk_buff *skb); | 42 | void (*early_demux)(struct sk_buff *skb); |
41 | int (*handler)(struct sk_buff *skb); | 43 | int (*handler)(struct sk_buff *skb); |
42 | void (*err_handler)(struct sk_buff *skb, u32 info); | 44 | void (*err_handler)(struct sk_buff *skb, u32 info); |
43 | int (*gso_send_check)(struct sk_buff *skb); | ||
44 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, | ||
45 | netdev_features_t features); | ||
46 | struct sk_buff **(*gro_receive)(struct sk_buff **head, | ||
47 | struct sk_buff *skb); | ||
48 | int (*gro_complete)(struct sk_buff *skb); | ||
49 | unsigned int no_policy:1, | 45 | unsigned int no_policy:1, |
50 | netns_ok:1; | 46 | netns_ok:1; |
51 | }; | 47 | }; |
@@ -60,23 +56,20 @@ struct inet6_protocol { | |||
60 | struct inet6_skb_parm *opt, | 56 | struct inet6_skb_parm *opt, |
61 | u8 type, u8 code, int offset, | 57 | u8 type, u8 code, int offset, |
62 | __be32 info); | 58 | __be32 info); |
63 | |||
64 | int (*gso_send_check)(struct sk_buff *skb); | ||
65 | struct sk_buff *(*gso_segment)(struct sk_buff *skb, | ||
66 | netdev_features_t features); | ||
67 | struct sk_buff **(*gro_receive)(struct sk_buff **head, | ||
68 | struct sk_buff *skb); | ||
69 | int (*gro_complete)(struct sk_buff *skb); | ||
70 | |||
71 | unsigned int flags; /* INET6_PROTO_xxx */ | 59 | unsigned int flags; /* INET6_PROTO_xxx */ |
72 | }; | 60 | }; |
73 | 61 | ||
74 | #define INET6_PROTO_NOPOLICY 0x1 | 62 | #define INET6_PROTO_NOPOLICY 0x1 |
75 | #define INET6_PROTO_FINAL 0x2 | 63 | #define INET6_PROTO_FINAL 0x2 |
76 | /* This should be set for any extension header which is compatible with GSO. */ | ||
77 | #define INET6_PROTO_GSO_EXTHDR 0x4 | ||
78 | #endif | 64 | #endif |
79 | 65 | ||
66 | struct net_offload { | ||
67 | struct offload_callbacks callbacks; | ||
68 | unsigned int flags; /* Flags used by IPv6 for now */ | ||
69 | }; | ||
70 | /* This should be set for any extension header which is compatible with GSO. */ | ||
71 | #define INET6_PROTO_GSO_EXTHDR 0x1 | ||
72 | |||
80 | /* This is used to register socket interfaces for IP protocols. */ | 73 | /* This is used to register socket interfaces for IP protocols. */ |
81 | struct inet_protosw { | 74 | struct inet_protosw { |
82 | struct list_head list; | 75 | struct list_head list; |
@@ -96,6 +89,8 @@ struct inet_protosw { | |||
96 | #define INET_PROTOSW_ICSK 0x04 /* Is this an inet_connection_sock? */ | 89 | #define INET_PROTOSW_ICSK 0x04 /* Is this an inet_connection_sock? */ |
97 | 90 | ||
98 | extern const struct net_protocol __rcu *inet_protos[MAX_INET_PROTOS]; | 91 | extern const struct net_protocol __rcu *inet_protos[MAX_INET_PROTOS]; |
92 | extern const struct net_offload __rcu *inet_offloads[MAX_INET_PROTOS]; | ||
93 | extern const struct net_offload __rcu *inet6_offloads[MAX_INET_PROTOS]; | ||
99 | 94 | ||
100 | #if IS_ENABLED(CONFIG_IPV6) | 95 | #if IS_ENABLED(CONFIG_IPV6) |
101 | extern const struct inet6_protocol __rcu *inet6_protos[MAX_INET_PROTOS]; | 96 | extern const struct inet6_protocol __rcu *inet6_protos[MAX_INET_PROTOS]; |
@@ -103,6 +98,8 @@ extern const struct inet6_protocol __rcu *inet6_protos[MAX_INET_PROTOS]; | |||
103 | 98 | ||
104 | extern int inet_add_protocol(const struct net_protocol *prot, unsigned char num); | 99 | extern int inet_add_protocol(const struct net_protocol *prot, unsigned char num); |
105 | extern int inet_del_protocol(const struct net_protocol *prot, unsigned char num); | 100 | extern int inet_del_protocol(const struct net_protocol *prot, unsigned char num); |
101 | extern int inet_add_offload(const struct net_offload *prot, unsigned char num); | ||
102 | extern int inet_del_offload(const struct net_offload *prot, unsigned char num); | ||
106 | extern void inet_register_protosw(struct inet_protosw *p); | 103 | extern void inet_register_protosw(struct inet_protosw *p); |
107 | extern void inet_unregister_protosw(struct inet_protosw *p); | 104 | extern void inet_unregister_protosw(struct inet_protosw *p); |
108 | 105 | ||
@@ -112,5 +109,7 @@ extern int inet6_del_protocol(const struct inet6_protocol *prot, unsigned char n | |||
112 | extern int inet6_register_protosw(struct inet_protosw *p); | 109 | extern int inet6_register_protosw(struct inet_protosw *p); |
113 | extern void inet6_unregister_protosw(struct inet_protosw *p); | 110 | extern void inet6_unregister_protosw(struct inet_protosw *p); |
114 | #endif | 111 | #endif |
112 | extern int inet6_add_offload(const struct net_offload *prot, unsigned char num); | ||
113 | extern int inet6_del_offload(const struct net_offload *prot, unsigned char num); | ||
115 | 114 | ||
116 | #endif /* _PROTOCOL_H */ | 115 | #endif /* _PROTOCOL_H */ |
diff --git a/include/net/request_sock.h b/include/net/request_sock.h index b01d8dd9ee7c..a51dbd17c2de 100644 --- a/include/net/request_sock.h +++ b/include/net/request_sock.h | |||
@@ -49,13 +49,16 @@ struct request_sock_ops { | |||
49 | struct request_sock *req); | 49 | struct request_sock *req); |
50 | }; | 50 | }; |
51 | 51 | ||
52 | extern int inet_rtx_syn_ack(struct sock *parent, struct request_sock *req); | ||
53 | |||
52 | /* struct request_sock - mini sock to represent a connection request | 54 | /* struct request_sock - mini sock to represent a connection request |
53 | */ | 55 | */ |
54 | struct request_sock { | 56 | struct request_sock { |
55 | struct request_sock *dl_next; /* Must be first member! */ | 57 | struct request_sock *dl_next; /* Must be first member! */ |
56 | u16 mss; | 58 | u16 mss; |
57 | u8 retrans; | 59 | u8 num_retrans; /* number of retransmits */ |
58 | u8 cookie_ts; /* syncookie: encode tcpopts in timestamp */ | 60 | u8 cookie_ts:1; /* syncookie: encode tcpopts in timestamp */ |
61 | u8 num_timeout:7; /* number of timeouts */ | ||
59 | /* The following two fields can be easily recomputed I think -AK */ | 62 | /* The following two fields can be easily recomputed I think -AK */ |
60 | u32 window_clamp; /* window clamp at creation time */ | 63 | u32 window_clamp; /* window clamp at creation time */ |
61 | u32 rcv_wnd; /* rcv_wnd offered first time */ | 64 | u32 rcv_wnd; /* rcv_wnd offered first time */ |
@@ -231,7 +234,7 @@ static inline int reqsk_queue_removed(struct request_sock_queue *queue, | |||
231 | { | 234 | { |
232 | struct listen_sock *lopt = queue->listen_opt; | 235 | struct listen_sock *lopt = queue->listen_opt; |
233 | 236 | ||
234 | if (req->retrans == 0) | 237 | if (req->num_timeout == 0) |
235 | --lopt->qlen_young; | 238 | --lopt->qlen_young; |
236 | 239 | ||
237 | return --lopt->qlen; | 240 | return --lopt->qlen; |
@@ -269,7 +272,8 @@ static inline void reqsk_queue_hash_req(struct request_sock_queue *queue, | |||
269 | struct listen_sock *lopt = queue->listen_opt; | 272 | struct listen_sock *lopt = queue->listen_opt; |
270 | 273 | ||
271 | req->expires = jiffies + timeout; | 274 | req->expires = jiffies + timeout; |
272 | req->retrans = 0; | 275 | req->num_retrans = 0; |
276 | req->num_timeout = 0; | ||
273 | req->sk = NULL; | 277 | req->sk = NULL; |
274 | req->dl_next = lopt->syn_table[hash]; | 278 | req->dl_next = lopt->syn_table[hash]; |
275 | 279 | ||
diff --git a/include/net/route.h b/include/net/route.h index bc40b633a5c4..2ea40c1b5e00 100644 --- a/include/net/route.h +++ b/include/net/route.h | |||
@@ -198,10 +198,13 @@ struct in_ifaddr; | |||
198 | extern void fib_add_ifaddr(struct in_ifaddr *); | 198 | extern void fib_add_ifaddr(struct in_ifaddr *); |
199 | extern void fib_del_ifaddr(struct in_ifaddr *, struct in_ifaddr *); | 199 | extern void fib_del_ifaddr(struct in_ifaddr *, struct in_ifaddr *); |
200 | 200 | ||
201 | static inline void ip_rt_put(struct rtable * rt) | 201 | static inline void ip_rt_put(struct rtable *rt) |
202 | { | 202 | { |
203 | if (rt) | 203 | /* dst_release() accepts a NULL parameter. |
204 | dst_release(&rt->dst); | 204 | * We rely on dst being first structure in struct rtable |
205 | */ | ||
206 | BUILD_BUG_ON(offsetof(struct rtable, dst) != 0); | ||
207 | dst_release(&rt->dst); | ||
205 | } | 208 | } |
206 | 209 | ||
207 | #define IPTOS_RT_MASK (IPTOS_TOS_MASK & ~3) | 210 | #define IPTOS_RT_MASK (IPTOS_TOS_MASK & ~3) |
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h index 712b3bebeda7..35247271e557 100644 --- a/include/net/sctp/command.h +++ b/include/net/sctp/command.h | |||
@@ -130,8 +130,6 @@ typedef union { | |||
130 | __be16 err; | 130 | __be16 err; |
131 | sctp_state_t state; | 131 | sctp_state_t state; |
132 | sctp_event_timeout_t to; | 132 | sctp_event_timeout_t to; |
133 | unsigned long zero; | ||
134 | void *ptr; | ||
135 | struct sctp_chunk *chunk; | 133 | struct sctp_chunk *chunk; |
136 | struct sctp_association *asoc; | 134 | struct sctp_association *asoc; |
137 | struct sctp_transport *transport; | 135 | struct sctp_transport *transport; |
@@ -154,23 +152,15 @@ typedef union { | |||
154 | * which takes an __s32 and returns a sctp_arg_t containing the | 152 | * which takes an __s32 and returns a sctp_arg_t containing the |
155 | * __s32. So, after foo = SCTP_I32(arg), foo.i32 == arg. | 153 | * __s32. So, after foo = SCTP_I32(arg), foo.i32 == arg. |
156 | */ | 154 | */ |
157 | static inline sctp_arg_t SCTP_NULL(void) | ||
158 | { | ||
159 | sctp_arg_t retval; retval.ptr = NULL; return retval; | ||
160 | } | ||
161 | static inline sctp_arg_t SCTP_NOFORCE(void) | ||
162 | { | ||
163 | sctp_arg_t retval = {.zero = 0UL}; retval.i32 = 0; return retval; | ||
164 | } | ||
165 | static inline sctp_arg_t SCTP_FORCE(void) | ||
166 | { | ||
167 | sctp_arg_t retval = {.zero = 0UL}; retval.i32 = 1; return retval; | ||
168 | } | ||
169 | 155 | ||
170 | #define SCTP_ARG_CONSTRUCTOR(name, type, elt) \ | 156 | #define SCTP_ARG_CONSTRUCTOR(name, type, elt) \ |
171 | static inline sctp_arg_t \ | 157 | static inline sctp_arg_t \ |
172 | SCTP_## name (type arg) \ | 158 | SCTP_## name (type arg) \ |
173 | { sctp_arg_t retval = {.zero = 0UL}; retval.elt = arg; return retval; } | 159 | { sctp_arg_t retval;\ |
160 | memset(&retval, 0, sizeof(sctp_arg_t));\ | ||
161 | retval.elt = arg;\ | ||
162 | return retval;\ | ||
163 | } | ||
174 | 164 | ||
175 | SCTP_ARG_CONSTRUCTOR(I32, __s32, i32) | 165 | SCTP_ARG_CONSTRUCTOR(I32, __s32, i32) |
176 | SCTP_ARG_CONSTRUCTOR(U32, __u32, u32) | 166 | SCTP_ARG_CONSTRUCTOR(U32, __u32, u32) |
@@ -181,7 +171,6 @@ SCTP_ARG_CONSTRUCTOR(ERROR, int, error) | |||
181 | SCTP_ARG_CONSTRUCTOR(PERR, __be16, err) /* protocol error */ | 171 | SCTP_ARG_CONSTRUCTOR(PERR, __be16, err) /* protocol error */ |
182 | SCTP_ARG_CONSTRUCTOR(STATE, sctp_state_t, state) | 172 | SCTP_ARG_CONSTRUCTOR(STATE, sctp_state_t, state) |
183 | SCTP_ARG_CONSTRUCTOR(TO, sctp_event_timeout_t, to) | 173 | SCTP_ARG_CONSTRUCTOR(TO, sctp_event_timeout_t, to) |
184 | SCTP_ARG_CONSTRUCTOR(PTR, void *, ptr) | ||
185 | SCTP_ARG_CONSTRUCTOR(CHUNK, struct sctp_chunk *, chunk) | 174 | SCTP_ARG_CONSTRUCTOR(CHUNK, struct sctp_chunk *, chunk) |
186 | SCTP_ARG_CONSTRUCTOR(ASOC, struct sctp_association *, asoc) | 175 | SCTP_ARG_CONSTRUCTOR(ASOC, struct sctp_association *, asoc) |
187 | SCTP_ARG_CONSTRUCTOR(TRANSPORT, struct sctp_transport *, transport) | 176 | SCTP_ARG_CONSTRUCTOR(TRANSPORT, struct sctp_transport *, transport) |
@@ -192,6 +181,23 @@ SCTP_ARG_CONSTRUCTOR(PACKET, struct sctp_packet *, packet) | |||
192 | SCTP_ARG_CONSTRUCTOR(SACKH, sctp_sackhdr_t *, sackh) | 181 | SCTP_ARG_CONSTRUCTOR(SACKH, sctp_sackhdr_t *, sackh) |
193 | SCTP_ARG_CONSTRUCTOR(DATAMSG, struct sctp_datamsg *, msg) | 182 | SCTP_ARG_CONSTRUCTOR(DATAMSG, struct sctp_datamsg *, msg) |
194 | 183 | ||
184 | static inline sctp_arg_t SCTP_FORCE(void) | ||
185 | { | ||
186 | return SCTP_I32(1); | ||
187 | } | ||
188 | |||
189 | static inline sctp_arg_t SCTP_NOFORCE(void) | ||
190 | { | ||
191 | return SCTP_I32(0); | ||
192 | } | ||
193 | |||
194 | static inline sctp_arg_t SCTP_NULL(void) | ||
195 | { | ||
196 | sctp_arg_t retval; | ||
197 | memset(&retval, 0, sizeof(sctp_arg_t)); | ||
198 | return retval; | ||
199 | } | ||
200 | |||
195 | typedef struct { | 201 | typedef struct { |
196 | sctp_arg_t obj; | 202 | sctp_arg_t obj; |
197 | sctp_verb_t verb; | 203 | sctp_verb_t verb; |
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h index d053d2e99876..c29707d654c0 100644 --- a/include/net/sctp/constants.h +++ b/include/net/sctp/constants.h | |||
@@ -312,14 +312,6 @@ enum { SCTP_MAX_GABS = 16 }; | |||
312 | * functions simpler to write. | 312 | * functions simpler to write. |
313 | */ | 313 | */ |
314 | 314 | ||
315 | #if defined (CONFIG_SCTP_HMAC_MD5) | ||
316 | #define SCTP_COOKIE_HMAC_ALG "hmac(md5)" | ||
317 | #elif defined (CONFIG_SCTP_HMAC_SHA1) | ||
318 | #define SCTP_COOKIE_HMAC_ALG "hmac(sha1)" | ||
319 | #else | ||
320 | #define SCTP_COOKIE_HMAC_ALG NULL | ||
321 | #endif | ||
322 | |||
323 | /* These return values describe the success or failure of a number of | 315 | /* These return values describe the success or failure of a number of |
324 | * routines which form the lower interface to SCTP_outqueue. | 316 | * routines which form the lower interface to SCTP_outqueue. |
325 | */ | 317 | */ |
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h index b5887e1677e4..2a82d1384706 100644 --- a/include/net/sctp/sm.h +++ b/include/net/sctp/sm.h | |||
@@ -234,6 +234,8 @@ struct sctp_chunk *sctp_make_abort_violation(const struct sctp_association *, | |||
234 | struct sctp_chunk *sctp_make_violation_paramlen(const struct sctp_association *, | 234 | struct sctp_chunk *sctp_make_violation_paramlen(const struct sctp_association *, |
235 | const struct sctp_chunk *, | 235 | const struct sctp_chunk *, |
236 | struct sctp_paramhdr *); | 236 | struct sctp_paramhdr *); |
237 | struct sctp_chunk *sctp_make_violation_max_retrans(const struct sctp_association *, | ||
238 | const struct sctp_chunk *); | ||
237 | struct sctp_chunk *sctp_make_heartbeat(const struct sctp_association *, | 239 | struct sctp_chunk *sctp_make_heartbeat(const struct sctp_association *, |
238 | const struct sctp_transport *); | 240 | const struct sctp_transport *); |
239 | struct sctp_chunk *sctp_make_heartbeat_ack(const struct sctp_association *, | 241 | struct sctp_chunk *sctp_make_heartbeat_ack(const struct sctp_association *, |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 64158aa1bb5f..2b2f61dd4036 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -177,6 +177,7 @@ struct sctp_sock { | |||
177 | 177 | ||
178 | /* Access to HMAC transform. */ | 178 | /* Access to HMAC transform. */ |
179 | struct crypto_hash *hmac; | 179 | struct crypto_hash *hmac; |
180 | char *sctp_hmac_alg; | ||
180 | 181 | ||
181 | /* What is our base endpointer? */ | 182 | /* What is our base endpointer? */ |
182 | struct sctp_endpoint *ep; | 183 | struct sctp_endpoint *ep; |
diff --git a/include/net/sctp/ulpqueue.h b/include/net/sctp/ulpqueue.h index 2e5ee0d8458d..ff1b8ba73ab1 100644 --- a/include/net/sctp/ulpqueue.h +++ b/include/net/sctp/ulpqueue.h | |||
@@ -72,7 +72,7 @@ int sctp_ulpq_tail_event(struct sctp_ulpq *, struct sctp_ulpevent *ev); | |||
72 | void sctp_ulpq_renege(struct sctp_ulpq *, struct sctp_chunk *, gfp_t); | 72 | void sctp_ulpq_renege(struct sctp_ulpq *, struct sctp_chunk *, gfp_t); |
73 | 73 | ||
74 | /* Perform partial delivery. */ | 74 | /* Perform partial delivery. */ |
75 | void sctp_ulpq_partial_delivery(struct sctp_ulpq *, struct sctp_chunk *, gfp_t); | 75 | void sctp_ulpq_partial_delivery(struct sctp_ulpq *, gfp_t); |
76 | 76 | ||
77 | /* Abort the partial delivery. */ | 77 | /* Abort the partial delivery. */ |
78 | void sctp_ulpq_abort_pd(struct sctp_ulpq *, gfp_t); | 78 | void sctp_ulpq_abort_pd(struct sctp_ulpq *, gfp_t); |
diff --git a/include/net/tcp.h b/include/net/tcp.h index 6feeccd83dd7..3202bde2a741 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -369,7 +369,6 @@ extern void tcp_shutdown (struct sock *sk, int how); | |||
369 | extern void tcp_v4_early_demux(struct sk_buff *skb); | 369 | extern void tcp_v4_early_demux(struct sk_buff *skb); |
370 | extern int tcp_v4_rcv(struct sk_buff *skb); | 370 | extern int tcp_v4_rcv(struct sk_buff *skb); |
371 | 371 | ||
372 | extern struct inet_peer *tcp_v4_get_peer(struct sock *sk); | ||
373 | extern int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw); | 372 | extern int tcp_v4_tw_remember_stamp(struct inet_timewait_sock *tw); |
374 | extern int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | 373 | extern int tcp_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, |
375 | size_t size); | 374 | size_t size); |
diff --git a/include/uapi/asm-generic/socket.h b/include/uapi/asm-generic/socket.h index b1bea03274d5..2d32d073a6f9 100644 --- a/include/uapi/asm-generic/socket.h +++ b/include/uapi/asm-generic/socket.h | |||
@@ -43,6 +43,7 @@ | |||
43 | /* Socket filtering */ | 43 | /* Socket filtering */ |
44 | #define SO_ATTACH_FILTER 26 | 44 | #define SO_ATTACH_FILTER 26 |
45 | #define SO_DETACH_FILTER 27 | 45 | #define SO_DETACH_FILTER 27 |
46 | #define SO_GET_FILTER SO_ATTACH_FILTER | ||
46 | 47 | ||
47 | #define SO_PEERNAME 28 | 48 | #define SO_PEERNAME 28 |
48 | #define SO_TIMESTAMP 29 | 49 | #define SO_TIMESTAMP 29 |
diff --git a/include/uapi/linux/filter.h b/include/uapi/linux/filter.h index 3d7922433aba..9cfde6941099 100644 --- a/include/uapi/linux/filter.h +++ b/include/uapi/linux/filter.h | |||
@@ -127,7 +127,9 @@ struct sock_fprog { /* Required for SO_ATTACH_FILTER. */ | |||
127 | #define SKF_AD_RXHASH 32 | 127 | #define SKF_AD_RXHASH 32 |
128 | #define SKF_AD_CPU 36 | 128 | #define SKF_AD_CPU 36 |
129 | #define SKF_AD_ALU_XOR_X 40 | 129 | #define SKF_AD_ALU_XOR_X 40 |
130 | #define SKF_AD_MAX 44 | 130 | #define SKF_AD_VLAN_TAG 44 |
131 | #define SKF_AD_VLAN_TAG_PRESENT 48 | ||
132 | #define SKF_AD_MAX 52 | ||
131 | #define SKF_NET_OFF (-0x100000) | 133 | #define SKF_NET_OFF (-0x100000) |
132 | #define SKF_LL_OFF (-0x200000) | 134 | #define SKF_LL_OFF (-0x200000) |
133 | 135 | ||
diff --git a/include/uapi/linux/hdlc/Kbuild b/include/uapi/linux/hdlc/Kbuild index aafaa5aa54d4..8c1d2cb75e33 100644 --- a/include/uapi/linux/hdlc/Kbuild +++ b/include/uapi/linux/hdlc/Kbuild | |||
@@ -1 +1,2 @@ | |||
1 | # UAPI Header export list | 1 | # UAPI Header export list |
2 | header-y += ioctl.h | ||
diff --git a/include/linux/hdlc/ioctl.h b/include/uapi/linux/hdlc/ioctl.h index 583972364357..04bc0274a189 100644 --- a/include/linux/hdlc/ioctl.h +++ b/include/uapi/linux/hdlc/ioctl.h | |||
@@ -34,13 +34,15 @@ | |||
34 | #define LMI_CCITT 3 /* ITU-T Annex A */ | 34 | #define LMI_CCITT 3 /* ITU-T Annex A */ |
35 | #define LMI_CISCO 4 /* The "original" LMI, aka Gang of Four */ | 35 | #define LMI_CISCO 4 /* The "original" LMI, aka Gang of Four */ |
36 | 36 | ||
37 | typedef struct { | 37 | #ifndef __ASSEMBLY__ |
38 | |||
39 | typedef struct { | ||
38 | unsigned int clock_rate; /* bits per second */ | 40 | unsigned int clock_rate; /* bits per second */ |
39 | unsigned int clock_type; /* internal, external, TX-internal etc. */ | 41 | unsigned int clock_type; /* internal, external, TX-internal etc. */ |
40 | unsigned short loopback; | 42 | unsigned short loopback; |
41 | } sync_serial_settings; /* V.35, V.24, X.21 */ | 43 | } sync_serial_settings; /* V.35, V.24, X.21 */ |
42 | 44 | ||
43 | typedef struct { | 45 | typedef struct { |
44 | unsigned int clock_rate; /* bits per second */ | 46 | unsigned int clock_rate; /* bits per second */ |
45 | unsigned int clock_type; /* internal, external, TX-internal etc. */ | 47 | unsigned int clock_type; /* internal, external, TX-internal etc. */ |
46 | unsigned short loopback; | 48 | unsigned short loopback; |
@@ -78,4 +80,5 @@ typedef struct { | |||
78 | 80 | ||
79 | /* PPP doesn't need any info now - supply length = 0 to ioctl */ | 81 | /* PPP doesn't need any info now - supply length = 0 to ioctl */ |
80 | 82 | ||
83 | #endif /* __ASSEMBLY__ */ | ||
81 | #endif /* __HDLC_IOCTL_H__ */ | 84 | #endif /* __HDLC_IOCTL_H__ */ |
diff --git a/include/uapi/linux/if_bridge.h b/include/uapi/linux/if_bridge.h index a8fe9549ddbc..b3885791e11e 100644 --- a/include/uapi/linux/if_bridge.h +++ b/include/uapi/linux/if_bridge.h | |||
@@ -97,5 +97,23 @@ struct __fdb_entry { | |||
97 | __u16 unused; | 97 | __u16 unused; |
98 | }; | 98 | }; |
99 | 99 | ||
100 | /* Bridge Flags */ | ||
101 | #define BRIDGE_FLAGS_MASTER 1 /* Bridge command to/from master */ | ||
102 | #define BRIDGE_FLAGS_SELF 2 /* Bridge command to/from lowerdev */ | ||
100 | 103 | ||
104 | #define BRIDGE_MODE_VEB 0 /* Default loopback mode */ | ||
105 | #define BRIDGE_MODE_VEPA 1 /* 802.1Qbg defined VEPA mode */ | ||
106 | |||
107 | /* Bridge management nested attributes | ||
108 | * [IFLA_AF_SPEC] = { | ||
109 | * [IFLA_BRIDGE_FLAGS] | ||
110 | * [IFLA_BRIDGE_MODE] | ||
111 | * } | ||
112 | */ | ||
113 | enum { | ||
114 | IFLA_BRIDGE_FLAGS, | ||
115 | IFLA_BRIDGE_MODE, | ||
116 | __IFLA_BRIDGE_MAX, | ||
117 | }; | ||
118 | #define IFLA_BRIDGE_MAX (__IFLA_BRIDGE_MAX - 1) | ||
101 | #endif /* _UAPI_LINUX_IF_BRIDGE_H */ | 119 | #endif /* _UAPI_LINUX_IF_BRIDGE_H */ |
diff --git a/include/uapi/linux/if_ether.h b/include/uapi/linux/if_ether.h index 0343e1f0582c..67fb87ca1094 100644 --- a/include/uapi/linux/if_ether.h +++ b/include/uapi/linux/if_ether.h | |||
@@ -48,6 +48,7 @@ | |||
48 | #define ETH_P_BPQ 0x08FF /* G8BPQ AX.25 Ethernet Packet [ NOT AN OFFICIALLY REGISTERED ID ] */ | 48 | #define ETH_P_BPQ 0x08FF /* G8BPQ AX.25 Ethernet Packet [ NOT AN OFFICIALLY REGISTERED ID ] */ |
49 | #define ETH_P_IEEEPUP 0x0a00 /* Xerox IEEE802.3 PUP packet */ | 49 | #define ETH_P_IEEEPUP 0x0a00 /* Xerox IEEE802.3 PUP packet */ |
50 | #define ETH_P_IEEEPUPAT 0x0a01 /* Xerox IEEE802.3 PUP Addr Trans packet */ | 50 | #define ETH_P_IEEEPUPAT 0x0a01 /* Xerox IEEE802.3 PUP Addr Trans packet */ |
51 | #define ETH_P_BATMAN 0x4305 /* B.A.T.M.A.N.-Advanced packet [ NOT AN OFFICIALLY REGISTERED ID ] */ | ||
51 | #define ETH_P_DEC 0x6000 /* DEC Assigned proto */ | 52 | #define ETH_P_DEC 0x6000 /* DEC Assigned proto */ |
52 | #define ETH_P_DNA_DL 0x6001 /* DEC DNA Dump/Load */ | 53 | #define ETH_P_DNA_DL 0x6001 /* DEC DNA Dump/Load */ |
53 | #define ETH_P_DNA_RC 0x6002 /* DEC DNA Remote Console */ | 54 | #define ETH_P_DNA_RC 0x6002 /* DEC DNA Remote Console */ |
diff --git a/include/uapi/linux/if_link.h b/include/uapi/linux/if_link.h index 5c80cb11518b..bb58aeb7f34d 100644 --- a/include/uapi/linux/if_link.h +++ b/include/uapi/linux/if_link.h | |||
@@ -205,6 +205,23 @@ enum { | |||
205 | 205 | ||
206 | #define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1) | 206 | #define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1) |
207 | 207 | ||
208 | enum { | ||
209 | BRIDGE_MODE_UNSPEC, | ||
210 | BRIDGE_MODE_HAIRPIN, | ||
211 | }; | ||
212 | |||
213 | enum { | ||
214 | IFLA_BRPORT_UNSPEC, | ||
215 | IFLA_BRPORT_STATE, /* Spanning tree state */ | ||
216 | IFLA_BRPORT_PRIORITY, /* " priority */ | ||
217 | IFLA_BRPORT_COST, /* " cost */ | ||
218 | IFLA_BRPORT_MODE, /* mode (hairpin) */ | ||
219 | IFLA_BRPORT_GUARD, /* bpdu guard */ | ||
220 | IFLA_BRPORT_PROTECT, /* root port protection */ | ||
221 | __IFLA_BRPORT_MAX | ||
222 | }; | ||
223 | #define IFLA_BRPORT_MAX (__IFLA_BRPORT_MAX - 1) | ||
224 | |||
208 | struct ifla_cacheinfo { | 225 | struct ifla_cacheinfo { |
209 | __u32 max_reasm_len; | 226 | __u32 max_reasm_len; |
210 | __u32 tstamp; /* ipv6InterfaceTable updated timestamp */ | 227 | __u32 tstamp; /* ipv6InterfaceTable updated timestamp */ |
@@ -285,6 +302,10 @@ enum { | |||
285 | IFLA_VXLAN_AGEING, | 302 | IFLA_VXLAN_AGEING, |
286 | IFLA_VXLAN_LIMIT, | 303 | IFLA_VXLAN_LIMIT, |
287 | IFLA_VXLAN_PORT_RANGE, | 304 | IFLA_VXLAN_PORT_RANGE, |
305 | IFLA_VXLAN_PROXY, | ||
306 | IFLA_VXLAN_RSC, | ||
307 | IFLA_VXLAN_L2MISS, | ||
308 | IFLA_VXLAN_L3MISS, | ||
288 | __IFLA_VXLAN_MAX | 309 | __IFLA_VXLAN_MAX |
289 | }; | 310 | }; |
290 | #define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1) | 311 | #define IFLA_VXLAN_MAX (__IFLA_VXLAN_MAX - 1) |
diff --git a/include/uapi/linux/if_packet.h b/include/uapi/linux/if_packet.h index f3799295d231..f9a60375f0d0 100644 --- a/include/uapi/linux/if_packet.h +++ b/include/uapi/linux/if_packet.h | |||
@@ -50,6 +50,7 @@ struct sockaddr_ll { | |||
50 | #define PACKET_TX_TIMESTAMP 16 | 50 | #define PACKET_TX_TIMESTAMP 16 |
51 | #define PACKET_TIMESTAMP 17 | 51 | #define PACKET_TIMESTAMP 17 |
52 | #define PACKET_FANOUT 18 | 52 | #define PACKET_FANOUT 18 |
53 | #define PACKET_TX_HAS_OFF 19 | ||
53 | 54 | ||
54 | #define PACKET_FANOUT_HASH 0 | 55 | #define PACKET_FANOUT_HASH 0 |
55 | #define PACKET_FANOUT_LB 1 | 56 | #define PACKET_FANOUT_LB 1 |
diff --git a/include/uapi/linux/if_tun.h b/include/uapi/linux/if_tun.h index 25a585ce23e6..958497ad5bb5 100644 --- a/include/uapi/linux/if_tun.h +++ b/include/uapi/linux/if_tun.h | |||
@@ -34,6 +34,7 @@ | |||
34 | #define TUN_ONE_QUEUE 0x0080 | 34 | #define TUN_ONE_QUEUE 0x0080 |
35 | #define TUN_PERSIST 0x0100 | 35 | #define TUN_PERSIST 0x0100 |
36 | #define TUN_VNET_HDR 0x0200 | 36 | #define TUN_VNET_HDR 0x0200 |
37 | #define TUN_TAP_MQ 0x0400 | ||
37 | 38 | ||
38 | /* Ioctl defines */ | 39 | /* Ioctl defines */ |
39 | #define TUNSETNOCSUM _IOW('T', 200, int) | 40 | #define TUNSETNOCSUM _IOW('T', 200, int) |
@@ -53,6 +54,7 @@ | |||
53 | #define TUNDETACHFILTER _IOW('T', 214, struct sock_fprog) | 54 | #define TUNDETACHFILTER _IOW('T', 214, struct sock_fprog) |
54 | #define TUNGETVNETHDRSZ _IOR('T', 215, int) | 55 | #define TUNGETVNETHDRSZ _IOR('T', 215, int) |
55 | #define TUNSETVNETHDRSZ _IOW('T', 216, int) | 56 | #define TUNSETVNETHDRSZ _IOW('T', 216, int) |
57 | #define TUNSETQUEUE _IOW('T', 217, int) | ||
56 | 58 | ||
57 | /* TUNSETIFF ifr flags */ | 59 | /* TUNSETIFF ifr flags */ |
58 | #define IFF_TUN 0x0001 | 60 | #define IFF_TUN 0x0001 |
@@ -61,6 +63,9 @@ | |||
61 | #define IFF_ONE_QUEUE 0x2000 | 63 | #define IFF_ONE_QUEUE 0x2000 |
62 | #define IFF_VNET_HDR 0x4000 | 64 | #define IFF_VNET_HDR 0x4000 |
63 | #define IFF_TUN_EXCL 0x8000 | 65 | #define IFF_TUN_EXCL 0x8000 |
66 | #define IFF_MULTI_QUEUE 0x0100 | ||
67 | #define IFF_ATTACH_QUEUE 0x0200 | ||
68 | #define IFF_DETACH_QUEUE 0x0400 | ||
64 | 69 | ||
65 | /* Features for GSO (TUNSETOFFLOAD). */ | 70 | /* Features for GSO (TUNSETOFFLOAD). */ |
66 | #define TUN_F_CSUM 0x01 /* You can hand me unchecksummed packets. */ | 71 | #define TUN_F_CSUM 0x01 /* You can hand me unchecksummed packets. */ |
diff --git a/include/uapi/linux/if_tunnel.h b/include/uapi/linux/if_tunnel.h index 5db5942575fe..aee73d0611fb 100644 --- a/include/uapi/linux/if_tunnel.h +++ b/include/uapi/linux/if_tunnel.h | |||
@@ -37,6 +37,26 @@ struct ip_tunnel_parm { | |||
37 | struct iphdr iph; | 37 | struct iphdr iph; |
38 | }; | 38 | }; |
39 | 39 | ||
40 | enum { | ||
41 | IFLA_IPTUN_UNSPEC, | ||
42 | IFLA_IPTUN_LINK, | ||
43 | IFLA_IPTUN_LOCAL, | ||
44 | IFLA_IPTUN_REMOTE, | ||
45 | IFLA_IPTUN_TTL, | ||
46 | IFLA_IPTUN_TOS, | ||
47 | IFLA_IPTUN_ENCAP_LIMIT, | ||
48 | IFLA_IPTUN_FLOWINFO, | ||
49 | IFLA_IPTUN_FLAGS, | ||
50 | IFLA_IPTUN_PROTO, | ||
51 | IFLA_IPTUN_PMTUDISC, | ||
52 | IFLA_IPTUN_6RD_PREFIX, | ||
53 | IFLA_IPTUN_6RD_RELAY_PREFIX, | ||
54 | IFLA_IPTUN_6RD_PREFIXLEN, | ||
55 | IFLA_IPTUN_6RD_RELAY_PREFIXLEN, | ||
56 | __IFLA_IPTUN_MAX, | ||
57 | }; | ||
58 | #define IFLA_IPTUN_MAX (__IFLA_IPTUN_MAX - 1) | ||
59 | |||
40 | /* SIT-mode i_flags */ | 60 | /* SIT-mode i_flags */ |
41 | #define SIT_ISATAP 0x0001 | 61 | #define SIT_ISATAP 0x0001 |
42 | 62 | ||
diff --git a/include/uapi/linux/in6.h b/include/uapi/linux/in6.h index 1e3159989958..f79c3721da6e 100644 --- a/include/uapi/linux/in6.h +++ b/include/uapi/linux/in6.h | |||
@@ -240,6 +240,7 @@ struct in6_flowlabel_req { | |||
240 | * | 240 | * |
241 | * IP6T_SO_GET_REVISION_MATCH 68 | 241 | * IP6T_SO_GET_REVISION_MATCH 68 |
242 | * IP6T_SO_GET_REVISION_TARGET 69 | 242 | * IP6T_SO_GET_REVISION_TARGET 69 |
243 | * IP6T_SO_ORIGINAL_DST 80 | ||
243 | */ | 244 | */ |
244 | 245 | ||
245 | /* RFC5014: Source address selection */ | 246 | /* RFC5014: Source address selection */ |
diff --git a/include/uapi/linux/inet_diag.h b/include/uapi/linux/inet_diag.h index 8c469af939aa..bbde90fa5838 100644 --- a/include/uapi/linux/inet_diag.h +++ b/include/uapi/linux/inet_diag.h | |||
@@ -109,9 +109,10 @@ enum { | |||
109 | INET_DIAG_TOS, | 109 | INET_DIAG_TOS, |
110 | INET_DIAG_TCLASS, | 110 | INET_DIAG_TCLASS, |
111 | INET_DIAG_SKMEMINFO, | 111 | INET_DIAG_SKMEMINFO, |
112 | INET_DIAG_SHUTDOWN, | ||
112 | }; | 113 | }; |
113 | 114 | ||
114 | #define INET_DIAG_MAX INET_DIAG_SKMEMINFO | 115 | #define INET_DIAG_MAX INET_DIAG_SHUTDOWN |
115 | 116 | ||
116 | 117 | ||
117 | /* INET_DIAG_MEM */ | 118 | /* INET_DIAG_MEM */ |
diff --git a/include/uapi/linux/ipv6.h b/include/uapi/linux/ipv6.h index a6d7d1c536c3..5a2991cf0251 100644 --- a/include/uapi/linux/ipv6.h +++ b/include/uapi/linux/ipv6.h | |||
@@ -157,6 +157,7 @@ enum { | |||
157 | DEVCONF_DISABLE_IPV6, | 157 | DEVCONF_DISABLE_IPV6, |
158 | DEVCONF_ACCEPT_DAD, | 158 | DEVCONF_ACCEPT_DAD, |
159 | DEVCONF_FORCE_TLLAO, | 159 | DEVCONF_FORCE_TLLAO, |
160 | DEVCONF_NDISC_NOTIFY, | ||
160 | DEVCONF_MAX | 161 | DEVCONF_MAX |
161 | }; | 162 | }; |
162 | 163 | ||
diff --git a/include/uapi/linux/ipv6_route.h b/include/uapi/linux/ipv6_route.h index 0459664c2636..2be7bd174751 100644 --- a/include/uapi/linux/ipv6_route.h +++ b/include/uapi/linux/ipv6_route.h | |||
@@ -55,4 +55,7 @@ struct in6_rtmsg { | |||
55 | #define RTMSG_NEWROUTE 0x21 | 55 | #define RTMSG_NEWROUTE 0x21 |
56 | #define RTMSG_DELROUTE 0x22 | 56 | #define RTMSG_DELROUTE 0x22 |
57 | 57 | ||
58 | #define IP6_RT_PRIO_USER 1024 | ||
59 | #define IP6_RT_PRIO_ADDRCONF 256 | ||
60 | |||
58 | #endif /* _UAPI_LINUX_IPV6_ROUTE_H */ | 61 | #endif /* _UAPI_LINUX_IPV6_ROUTE_H */ |
diff --git a/include/uapi/linux/netconf.h b/include/uapi/linux/netconf.h new file mode 100644 index 000000000000..75dcbc587fb5 --- /dev/null +++ b/include/uapi/linux/netconf.h | |||
@@ -0,0 +1,23 @@ | |||
1 | #ifndef _UAPI_LINUX_NETCONF_H_ | ||
2 | #define _UAPI_LINUX_NETCONF_H_ | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | #include <linux/netlink.h> | ||
6 | |||
7 | struct netconfmsg { | ||
8 | __u8 ncm_family; | ||
9 | }; | ||
10 | |||
11 | enum { | ||
12 | NETCONFA_UNSPEC, | ||
13 | NETCONFA_IFINDEX, | ||
14 | NETCONFA_FORWARDING, | ||
15 | NETCONFA_RP_FILTER, | ||
16 | __NETCONFA_MAX | ||
17 | }; | ||
18 | #define NETCONFA_MAX (__NETCONFA_MAX - 1) | ||
19 | |||
20 | #define NETCONFA_IFINDEX_ALL -1 | ||
21 | #define NETCONFA_IFINDEX_DEFAULT -2 | ||
22 | |||
23 | #endif /* _UAPI_LINUX_NETCONF_H_ */ | ||
diff --git a/include/uapi/linux/netfilter_ipv6/ip6_tables.h b/include/uapi/linux/netfilter_ipv6/ip6_tables.h index bf1ef65cc582..649c68062dca 100644 --- a/include/uapi/linux/netfilter_ipv6/ip6_tables.h +++ b/include/uapi/linux/netfilter_ipv6/ip6_tables.h | |||
@@ -178,6 +178,9 @@ struct ip6t_error { | |||
178 | #define IP6T_SO_GET_REVISION_TARGET (IP6T_BASE_CTL + 5) | 178 | #define IP6T_SO_GET_REVISION_TARGET (IP6T_BASE_CTL + 5) |
179 | #define IP6T_SO_GET_MAX IP6T_SO_GET_REVISION_TARGET | 179 | #define IP6T_SO_GET_MAX IP6T_SO_GET_REVISION_TARGET |
180 | 180 | ||
181 | /* obtain original address if REDIRECT'd connection */ | ||
182 | #define IP6T_SO_ORIGINAL_DST 80 | ||
183 | |||
181 | /* ICMP matching stuff */ | 184 | /* ICMP matching stuff */ |
182 | struct ip6t_icmp { | 185 | struct ip6t_icmp { |
183 | __u8 type; /* type to match */ | 186 | __u8 type; /* type to match */ |
diff --git a/include/uapi/linux/nfc.h b/include/uapi/linux/nfc.h index d908d17da56d..0e63cee8d810 100644 --- a/include/uapi/linux/nfc.h +++ b/include/uapi/linux/nfc.h | |||
@@ -60,6 +60,13 @@ | |||
60 | * target mode. | 60 | * target mode. |
61 | * @NFC_EVENT_DEVICE_DEACTIVATED: event emitted when the adapter is deactivated | 61 | * @NFC_EVENT_DEVICE_DEACTIVATED: event emitted when the adapter is deactivated |
62 | * from target mode. | 62 | * from target mode. |
63 | * @NFC_CMD_LLC_GET_PARAMS: request LTO, RW, and MIUX parameters for a device | ||
64 | * @NFC_CMD_LLC_SET_PARAMS: set one or more of LTO, RW, and MIUX parameters for | ||
65 | * a device. LTO must be set before the link is up otherwise -EINPROGRESS | ||
66 | * is returned. RW and MIUX can be set at anytime and will be passed in | ||
67 | * subsequent CONNECT and CC messages. | ||
68 | * If one of the passed parameters is wrong none is set and -EINVAL is | ||
69 | * returned. | ||
63 | */ | 70 | */ |
64 | enum nfc_commands { | 71 | enum nfc_commands { |
65 | NFC_CMD_UNSPEC, | 72 | NFC_CMD_UNSPEC, |
@@ -77,6 +84,8 @@ enum nfc_commands { | |||
77 | NFC_EVENT_TARGET_LOST, | 84 | NFC_EVENT_TARGET_LOST, |
78 | NFC_EVENT_TM_ACTIVATED, | 85 | NFC_EVENT_TM_ACTIVATED, |
79 | NFC_EVENT_TM_DEACTIVATED, | 86 | NFC_EVENT_TM_DEACTIVATED, |
87 | NFC_CMD_LLC_GET_PARAMS, | ||
88 | NFC_CMD_LLC_SET_PARAMS, | ||
80 | /* private: internal use only */ | 89 | /* private: internal use only */ |
81 | __NFC_CMD_AFTER_LAST | 90 | __NFC_CMD_AFTER_LAST |
82 | }; | 91 | }; |
@@ -102,6 +111,9 @@ enum nfc_commands { | |||
102 | * @NFC_ATTR_RF_MODE: Initiator or target | 111 | * @NFC_ATTR_RF_MODE: Initiator or target |
103 | * @NFC_ATTR_IM_PROTOCOLS: Initiator mode protocols to poll for | 112 | * @NFC_ATTR_IM_PROTOCOLS: Initiator mode protocols to poll for |
104 | * @NFC_ATTR_TM_PROTOCOLS: Target mode protocols to listen for | 113 | * @NFC_ATTR_TM_PROTOCOLS: Target mode protocols to listen for |
114 | * @NFC_ATTR_LLC_PARAM_LTO: Link TimeOut parameter | ||
115 | * @NFC_ATTR_LLC_PARAM_RW: Receive Window size parameter | ||
116 | * @NFC_ATTR_LLC_PARAM_MIUX: MIU eXtension parameter | ||
105 | */ | 117 | */ |
106 | enum nfc_attrs { | 118 | enum nfc_attrs { |
107 | NFC_ATTR_UNSPEC, | 119 | NFC_ATTR_UNSPEC, |
@@ -119,6 +131,9 @@ enum nfc_attrs { | |||
119 | NFC_ATTR_DEVICE_POWERED, | 131 | NFC_ATTR_DEVICE_POWERED, |
120 | NFC_ATTR_IM_PROTOCOLS, | 132 | NFC_ATTR_IM_PROTOCOLS, |
121 | NFC_ATTR_TM_PROTOCOLS, | 133 | NFC_ATTR_TM_PROTOCOLS, |
134 | NFC_ATTR_LLC_PARAM_LTO, | ||
135 | NFC_ATTR_LLC_PARAM_RW, | ||
136 | NFC_ATTR_LLC_PARAM_MIUX, | ||
122 | /* private: internal use only */ | 137 | /* private: internal use only */ |
123 | __NFC_ATTR_AFTER_LAST | 138 | __NFC_ATTR_AFTER_LAST |
124 | }; | 139 | }; |
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index 7df9b500c804..33a417481ad8 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h | |||
@@ -118,8 +118,9 @@ | |||
118 | * to get a list of all present wiphys. | 118 | * to get a list of all present wiphys. |
119 | * @NL80211_CMD_SET_WIPHY: set wiphy parameters, needs %NL80211_ATTR_WIPHY or | 119 | * @NL80211_CMD_SET_WIPHY: set wiphy parameters, needs %NL80211_ATTR_WIPHY or |
120 | * %NL80211_ATTR_IFINDEX; can be used to set %NL80211_ATTR_WIPHY_NAME, | 120 | * %NL80211_ATTR_IFINDEX; can be used to set %NL80211_ATTR_WIPHY_NAME, |
121 | * %NL80211_ATTR_WIPHY_TXQ_PARAMS, %NL80211_ATTR_WIPHY_FREQ, | 121 | * %NL80211_ATTR_WIPHY_TXQ_PARAMS, %NL80211_ATTR_WIPHY_FREQ (and the |
122 | * %NL80211_ATTR_WIPHY_CHANNEL_TYPE, %NL80211_ATTR_WIPHY_RETRY_SHORT, | 122 | * attributes determining the channel width; this is used for setting |
123 | * monitor mode channel), %NL80211_ATTR_WIPHY_RETRY_SHORT, | ||
123 | * %NL80211_ATTR_WIPHY_RETRY_LONG, %NL80211_ATTR_WIPHY_FRAG_THRESHOLD, | 124 | * %NL80211_ATTR_WIPHY_RETRY_LONG, %NL80211_ATTR_WIPHY_FRAG_THRESHOLD, |
124 | * and/or %NL80211_ATTR_WIPHY_RTS_THRESHOLD. | 125 | * and/or %NL80211_ATTR_WIPHY_RTS_THRESHOLD. |
125 | * However, for setting the channel, see %NL80211_CMD_SET_CHANNEL | 126 | * However, for setting the channel, see %NL80211_CMD_SET_CHANNEL |
@@ -171,7 +172,7 @@ | |||
171 | * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY, | 172 | * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY, |
172 | * %NL80211_ATTR_AUTH_TYPE and %NL80211_ATTR_INACTIVITY_TIMEOUT. | 173 | * %NL80211_ATTR_AUTH_TYPE and %NL80211_ATTR_INACTIVITY_TIMEOUT. |
173 | * The channel to use can be set on the interface or be given using the | 174 | * The channel to use can be set on the interface or be given using the |
174 | * %NL80211_ATTR_WIPHY_FREQ and %NL80211_ATTR_WIPHY_CHANNEL_TYPE attrs. | 175 | * %NL80211_ATTR_WIPHY_FREQ and the attributes determining channel width. |
175 | * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP | 176 | * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP |
176 | * @NL80211_CMD_STOP_AP: Stop AP operation on the given interface | 177 | * @NL80211_CMD_STOP_AP: Stop AP operation on the given interface |
177 | * @NL80211_CMD_DEL_BEACON: old alias for %NL80211_CMD_STOP_AP | 178 | * @NL80211_CMD_DEL_BEACON: old alias for %NL80211_CMD_STOP_AP |
@@ -401,8 +402,7 @@ | |||
401 | * a response while being associated to an AP on another channel. | 402 | * a response while being associated to an AP on another channel. |
402 | * %NL80211_ATTR_IFINDEX is used to specify which interface (and thus | 403 | * %NL80211_ATTR_IFINDEX is used to specify which interface (and thus |
403 | * radio) is used. %NL80211_ATTR_WIPHY_FREQ is used to specify the | 404 | * radio) is used. %NL80211_ATTR_WIPHY_FREQ is used to specify the |
404 | * frequency for the operation and %NL80211_ATTR_WIPHY_CHANNEL_TYPE may be | 405 | * frequency for the operation. |
405 | * optionally used to specify additional channel parameters. | ||
406 | * %NL80211_ATTR_DURATION is used to specify the duration in milliseconds | 406 | * %NL80211_ATTR_DURATION is used to specify the duration in milliseconds |
407 | * to remain on the channel. This command is also used as an event to | 407 | * to remain on the channel. This command is also used as an event to |
408 | * notify when the requested duration starts (it may take a while for the | 408 | * notify when the requested duration starts (it may take a while for the |
@@ -440,12 +440,11 @@ | |||
440 | * as an event indicating reception of a frame that was not processed in | 440 | * as an event indicating reception of a frame that was not processed in |
441 | * kernel code, but is for us (i.e., which may need to be processed in a | 441 | * kernel code, but is for us (i.e., which may need to be processed in a |
442 | * user space application). %NL80211_ATTR_FRAME is used to specify the | 442 | * user space application). %NL80211_ATTR_FRAME is used to specify the |
443 | * frame contents (including header). %NL80211_ATTR_WIPHY_FREQ (and | 443 | * frame contents (including header). %NL80211_ATTR_WIPHY_FREQ is used |
444 | * optionally %NL80211_ATTR_WIPHY_CHANNEL_TYPE) is used to indicate on | 444 | * to indicate on which channel the frame is to be transmitted or was |
445 | * which channel the frame is to be transmitted or was received. If this | 445 | * received. If this channel is not the current channel (remain-on-channel |
446 | * channel is not the current channel (remain-on-channel or the | 446 | * or the operational channel) the device will switch to the given channel |
447 | * operational channel) the device will switch to the given channel and | 447 | * and transmit the frame, optionally waiting for a response for the time |
448 | * transmit the frame, optionally waiting for a response for the time | ||
449 | * specified using %NL80211_ATTR_DURATION. When called, this operation | 448 | * specified using %NL80211_ATTR_DURATION. When called, this operation |
450 | * returns a cookie (%NL80211_ATTR_COOKIE) that will be included with the | 449 | * returns a cookie (%NL80211_ATTR_COOKIE) that will be included with the |
451 | * TX status event pertaining to the TX request. | 450 | * TX status event pertaining to the TX request. |
@@ -473,8 +472,8 @@ | |||
473 | * command is used as an event to indicate the that a trigger level was | 472 | * command is used as an event to indicate the that a trigger level was |
474 | * reached. | 473 | * reached. |
475 | * @NL80211_CMD_SET_CHANNEL: Set the channel (using %NL80211_ATTR_WIPHY_FREQ | 474 | * @NL80211_CMD_SET_CHANNEL: Set the channel (using %NL80211_ATTR_WIPHY_FREQ |
476 | * and %NL80211_ATTR_WIPHY_CHANNEL_TYPE) the given interface (identifed | 475 | * and the attributes determining channel width) the given interface |
477 | * by %NL80211_ATTR_IFINDEX) shall operate on. | 476 | * (identifed by %NL80211_ATTR_IFINDEX) shall operate on. |
478 | * In case multiple channels are supported by the device, the mechanism | 477 | * In case multiple channels are supported by the device, the mechanism |
479 | * with which it switches channels is implementation-defined. | 478 | * with which it switches channels is implementation-defined. |
480 | * When a monitor interface is given, it can only switch channel while | 479 | * When a monitor interface is given, it can only switch channel while |
@@ -526,6 +525,12 @@ | |||
526 | * of PMKSA caching dandidates. | 525 | * of PMKSA caching dandidates. |
527 | * | 526 | * |
528 | * @NL80211_CMD_TDLS_OPER: Perform a high-level TDLS command (e.g. link setup). | 527 | * @NL80211_CMD_TDLS_OPER: Perform a high-level TDLS command (e.g. link setup). |
528 | * In addition, this can be used as an event to request userspace to take | ||
529 | * actions on TDLS links (set up a new link or tear down an existing one). | ||
530 | * In such events, %NL80211_ATTR_TDLS_OPERATION indicates the requested | ||
531 | * operation, %NL80211_ATTR_MAC contains the peer MAC address, and | ||
532 | * %NL80211_ATTR_REASON_CODE the reason code to be used (only with | ||
533 | * %NL80211_TDLS_TEARDOWN). | ||
529 | * @NL80211_CMD_TDLS_MGMT: Send a TDLS management frame. | 534 | * @NL80211_CMD_TDLS_MGMT: Send a TDLS management frame. |
530 | * | 535 | * |
531 | * @NL80211_CMD_UNEXPECTED_FRAME: Used by an application controlling an AP | 536 | * @NL80211_CMD_UNEXPECTED_FRAME: Used by an application controlling an AP |
@@ -562,8 +567,8 @@ | |||
562 | * | 567 | * |
563 | * @NL80211_CMD_CH_SWITCH_NOTIFY: An AP or GO may decide to switch channels | 568 | * @NL80211_CMD_CH_SWITCH_NOTIFY: An AP or GO may decide to switch channels |
564 | * independently of the userspace SME, send this event indicating | 569 | * independently of the userspace SME, send this event indicating |
565 | * %NL80211_ATTR_IFINDEX is now on %NL80211_ATTR_WIPHY_FREQ with | 570 | * %NL80211_ATTR_IFINDEX is now on %NL80211_ATTR_WIPHY_FREQ and the |
566 | * %NL80211_ATTR_WIPHY_CHANNEL_TYPE. | 571 | * attributes determining channel width. |
567 | * | 572 | * |
568 | * @NL80211_CMD_START_P2P_DEVICE: Start the given P2P Device, identified by | 573 | * @NL80211_CMD_START_P2P_DEVICE: Start the given P2P Device, identified by |
569 | * its %NL80211_ATTR_WDEV identifier. It must have been created with | 574 | * its %NL80211_ATTR_WDEV identifier. It must have been created with |
@@ -578,6 +583,9 @@ | |||
578 | * station, due to particular reason. %NL80211_ATTR_CONN_FAILED_REASON | 583 | * station, due to particular reason. %NL80211_ATTR_CONN_FAILED_REASON |
579 | * is used for this. | 584 | * is used for this. |
580 | * | 585 | * |
586 | * @NL80211_CMD_SET_MCAST_RATE: Change the rate used to send multicast frames | ||
587 | * for IBSS or MESH vif. | ||
588 | * | ||
581 | * @NL80211_CMD_MAX: highest used command number | 589 | * @NL80211_CMD_MAX: highest used command number |
582 | * @__NL80211_CMD_AFTER_LAST: internal use | 590 | * @__NL80211_CMD_AFTER_LAST: internal use |
583 | */ | 591 | */ |
@@ -726,6 +734,8 @@ enum nl80211_commands { | |||
726 | 734 | ||
727 | NL80211_CMD_CONN_FAILED, | 735 | NL80211_CMD_CONN_FAILED, |
728 | 736 | ||
737 | NL80211_CMD_SET_MCAST_RATE, | ||
738 | |||
729 | /* add new commands above here */ | 739 | /* add new commands above here */ |
730 | 740 | ||
731 | /* used to define NL80211_CMD_MAX below */ | 741 | /* used to define NL80211_CMD_MAX below */ |
@@ -762,14 +772,26 @@ enum nl80211_commands { | |||
762 | * /sys/class/ieee80211/<phyname>/index | 772 | * /sys/class/ieee80211/<phyname>/index |
763 | * @NL80211_ATTR_WIPHY_NAME: wiphy name (used for renaming) | 773 | * @NL80211_ATTR_WIPHY_NAME: wiphy name (used for renaming) |
764 | * @NL80211_ATTR_WIPHY_TXQ_PARAMS: a nested array of TX queue parameters | 774 | * @NL80211_ATTR_WIPHY_TXQ_PARAMS: a nested array of TX queue parameters |
765 | * @NL80211_ATTR_WIPHY_FREQ: frequency of the selected channel in MHz | 775 | * @NL80211_ATTR_WIPHY_FREQ: frequency of the selected channel in MHz, |
776 | * defines the channel together with the (deprecated) | ||
777 | * %NL80211_ATTR_WIPHY_CHANNEL_TYPE attribute or the attributes | ||
778 | * %NL80211_ATTR_CHANNEL_WIDTH and if needed %NL80211_ATTR_CENTER_FREQ1 | ||
779 | * and %NL80211_ATTR_CENTER_FREQ2 | ||
780 | * @NL80211_ATTR_CHANNEL_WIDTH: u32 attribute containing one of the values | ||
781 | * of &enum nl80211_chan_width, describing the channel width. See the | ||
782 | * documentation of the enum for more information. | ||
783 | * @NL80211_ATTR_CENTER_FREQ1: Center frequency of the first part of the | ||
784 | * channel, used for anything but 20 MHz bandwidth | ||
785 | * @NL80211_ATTR_CENTER_FREQ2: Center frequency of the second part of the | ||
786 | * channel, used only for 80+80 MHz bandwidth | ||
766 | * @NL80211_ATTR_WIPHY_CHANNEL_TYPE: included with NL80211_ATTR_WIPHY_FREQ | 787 | * @NL80211_ATTR_WIPHY_CHANNEL_TYPE: included with NL80211_ATTR_WIPHY_FREQ |
767 | * if HT20 or HT40 are allowed (i.e., 802.11n disabled if not included): | 788 | * if HT20 or HT40 are to be used (i.e., HT disabled if not included): |
768 | * NL80211_CHAN_NO_HT = HT not allowed (i.e., same as not including | 789 | * NL80211_CHAN_NO_HT = HT not allowed (i.e., same as not including |
769 | * this attribute) | 790 | * this attribute) |
770 | * NL80211_CHAN_HT20 = HT20 only | 791 | * NL80211_CHAN_HT20 = HT20 only |
771 | * NL80211_CHAN_HT40MINUS = secondary channel is below the primary channel | 792 | * NL80211_CHAN_HT40MINUS = secondary channel is below the primary channel |
772 | * NL80211_CHAN_HT40PLUS = secondary channel is above the primary channel | 793 | * NL80211_CHAN_HT40PLUS = secondary channel is above the primary channel |
794 | * This attribute is now deprecated. | ||
773 | * @NL80211_ATTR_WIPHY_RETRY_SHORT: TX retry limit for frames whose length is | 795 | * @NL80211_ATTR_WIPHY_RETRY_SHORT: TX retry limit for frames whose length is |
774 | * less than or equal to the RTS threshold; allowed range: 1..255; | 796 | * less than or equal to the RTS threshold; allowed range: 1..255; |
775 | * dot11ShortRetryLimit; u8 | 797 | * dot11ShortRetryLimit; u8 |
@@ -1273,6 +1295,14 @@ enum nl80211_commands { | |||
1273 | * the connection request from a station. nl80211_connect_failed_reason | 1295 | * the connection request from a station. nl80211_connect_failed_reason |
1274 | * enum has different reasons of connection failure. | 1296 | * enum has different reasons of connection failure. |
1275 | * | 1297 | * |
1298 | * @NL80211_ATTR_SAE_DATA: SAE elements in Authentication frames. This starts | ||
1299 | * with the Authentication transaction sequence number field. | ||
1300 | * | ||
1301 | * @NL80211_ATTR_VHT_CAPABILITY: VHT Capability information element (from | ||
1302 | * association request when used with NL80211_CMD_NEW_STATION) | ||
1303 | * | ||
1304 | * @NL80211_ATTR_SCAN_FLAGS: scan request control flags (u32) | ||
1305 | * | ||
1276 | * @NL80211_ATTR_MAX: highest attribute number currently defined | 1306 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
1277 | * @__NL80211_ATTR_AFTER_LAST: internal use | 1307 | * @__NL80211_ATTR_AFTER_LAST: internal use |
1278 | */ | 1308 | */ |
@@ -1530,6 +1560,16 @@ enum nl80211_attrs { | |||
1530 | 1560 | ||
1531 | NL80211_ATTR_CONN_FAILED_REASON, | 1561 | NL80211_ATTR_CONN_FAILED_REASON, |
1532 | 1562 | ||
1563 | NL80211_ATTR_SAE_DATA, | ||
1564 | |||
1565 | NL80211_ATTR_VHT_CAPABILITY, | ||
1566 | |||
1567 | NL80211_ATTR_SCAN_FLAGS, | ||
1568 | |||
1569 | NL80211_ATTR_CHANNEL_WIDTH, | ||
1570 | NL80211_ATTR_CENTER_FREQ1, | ||
1571 | NL80211_ATTR_CENTER_FREQ2, | ||
1572 | |||
1533 | /* add attributes here, update the policy in nl80211.c */ | 1573 | /* add attributes here, update the policy in nl80211.c */ |
1534 | 1574 | ||
1535 | __NL80211_ATTR_AFTER_LAST, | 1575 | __NL80211_ATTR_AFTER_LAST, |
@@ -1573,6 +1613,7 @@ enum nl80211_attrs { | |||
1573 | #define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 16 | 1613 | #define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 16 |
1574 | #define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24 | 1614 | #define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24 |
1575 | #define NL80211_HT_CAPABILITY_LEN 26 | 1615 | #define NL80211_HT_CAPABILITY_LEN 26 |
1616 | #define NL80211_VHT_CAPABILITY_LEN 12 | ||
1576 | 1617 | ||
1577 | #define NL80211_MAX_NR_CIPHER_SUITES 5 | 1618 | #define NL80211_MAX_NR_CIPHER_SUITES 5 |
1578 | #define NL80211_MAX_NR_AKM_SUITES 2 | 1619 | #define NL80211_MAX_NR_AKM_SUITES 2 |
@@ -1693,10 +1734,15 @@ struct nl80211_sta_flag_update { | |||
1693 | * @__NL80211_RATE_INFO_INVALID: attribute number 0 is reserved | 1734 | * @__NL80211_RATE_INFO_INVALID: attribute number 0 is reserved |
1694 | * @NL80211_RATE_INFO_BITRATE: total bitrate (u16, 100kbit/s) | 1735 | * @NL80211_RATE_INFO_BITRATE: total bitrate (u16, 100kbit/s) |
1695 | * @NL80211_RATE_INFO_MCS: mcs index for 802.11n (u8) | 1736 | * @NL80211_RATE_INFO_MCS: mcs index for 802.11n (u8) |
1696 | * @NL80211_RATE_INFO_40_MHZ_WIDTH: 40 Mhz dualchannel bitrate | 1737 | * @NL80211_RATE_INFO_40_MHZ_WIDTH: 40 MHz dualchannel bitrate |
1697 | * @NL80211_RATE_INFO_SHORT_GI: 400ns guard interval | 1738 | * @NL80211_RATE_INFO_SHORT_GI: 400ns guard interval |
1698 | * @NL80211_RATE_INFO_BITRATE32: total bitrate (u32, 100kbit/s) | 1739 | * @NL80211_RATE_INFO_BITRATE32: total bitrate (u32, 100kbit/s) |
1699 | * @NL80211_RATE_INFO_MAX: highest rate_info number currently defined | 1740 | * @NL80211_RATE_INFO_MAX: highest rate_info number currently defined |
1741 | * @NL80211_RATE_INFO_VHT_MCS: MCS index for VHT (u8) | ||
1742 | * @NL80211_RATE_INFO_VHT_NSS: number of streams in VHT (u8) | ||
1743 | * @NL80211_RATE_INFO_80_MHZ_WIDTH: 80 MHz VHT rate | ||
1744 | * @NL80211_RATE_INFO_80P80_MHZ_WIDTH: 80+80 MHz VHT rate | ||
1745 | * @NL80211_RATE_INFO_160_MHZ_WIDTH: 160 MHz VHT rate | ||
1700 | * @__NL80211_RATE_INFO_AFTER_LAST: internal use | 1746 | * @__NL80211_RATE_INFO_AFTER_LAST: internal use |
1701 | */ | 1747 | */ |
1702 | enum nl80211_rate_info { | 1748 | enum nl80211_rate_info { |
@@ -1706,6 +1752,11 @@ enum nl80211_rate_info { | |||
1706 | NL80211_RATE_INFO_40_MHZ_WIDTH, | 1752 | NL80211_RATE_INFO_40_MHZ_WIDTH, |
1707 | NL80211_RATE_INFO_SHORT_GI, | 1753 | NL80211_RATE_INFO_SHORT_GI, |
1708 | NL80211_RATE_INFO_BITRATE32, | 1754 | NL80211_RATE_INFO_BITRATE32, |
1755 | NL80211_RATE_INFO_VHT_MCS, | ||
1756 | NL80211_RATE_INFO_VHT_NSS, | ||
1757 | NL80211_RATE_INFO_80_MHZ_WIDTH, | ||
1758 | NL80211_RATE_INFO_80P80_MHZ_WIDTH, | ||
1759 | NL80211_RATE_INFO_160_MHZ_WIDTH, | ||
1709 | 1760 | ||
1710 | /* keep last */ | 1761 | /* keep last */ |
1711 | __NL80211_RATE_INFO_AFTER_LAST, | 1762 | __NL80211_RATE_INFO_AFTER_LAST, |
@@ -2414,6 +2465,15 @@ enum nl80211_ac { | |||
2414 | #define NL80211_TXQ_Q_BE NL80211_AC_BE | 2465 | #define NL80211_TXQ_Q_BE NL80211_AC_BE |
2415 | #define NL80211_TXQ_Q_BK NL80211_AC_BK | 2466 | #define NL80211_TXQ_Q_BK NL80211_AC_BK |
2416 | 2467 | ||
2468 | /** | ||
2469 | * enum nl80211_channel_type - channel type | ||
2470 | * @NL80211_CHAN_NO_HT: 20 MHz, non-HT channel | ||
2471 | * @NL80211_CHAN_HT20: 20 MHz HT channel | ||
2472 | * @NL80211_CHAN_HT40MINUS: HT40 channel, secondary channel | ||
2473 | * below the control channel | ||
2474 | * @NL80211_CHAN_HT40PLUS: HT40 channel, secondary channel | ||
2475 | * above the control channel | ||
2476 | */ | ||
2417 | enum nl80211_channel_type { | 2477 | enum nl80211_channel_type { |
2418 | NL80211_CHAN_NO_HT, | 2478 | NL80211_CHAN_NO_HT, |
2419 | NL80211_CHAN_HT20, | 2479 | NL80211_CHAN_HT20, |
@@ -2422,6 +2482,32 @@ enum nl80211_channel_type { | |||
2422 | }; | 2482 | }; |
2423 | 2483 | ||
2424 | /** | 2484 | /** |
2485 | * enum nl80211_chan_width - channel width definitions | ||
2486 | * | ||
2487 | * These values are used with the %NL80211_ATTR_CHANNEL_WIDTH | ||
2488 | * attribute. | ||
2489 | * | ||
2490 | * @NL80211_CHAN_WIDTH_20_NOHT: 20 MHz, non-HT channel | ||
2491 | * @NL80211_CHAN_WIDTH_20: 20 MHz HT channel | ||
2492 | * @NL80211_CHAN_WIDTH_40: 40 MHz channel, the %NL80211_ATTR_CENTER_FREQ1 | ||
2493 | * attribute must be provided as well | ||
2494 | * @NL80211_CHAN_WIDTH_80: 80 MHz channel, the %NL80211_ATTR_CENTER_FREQ1 | ||
2495 | * attribute must be provided as well | ||
2496 | * @NL80211_CHAN_WIDTH_80P80: 80+80 MHz channel, the %NL80211_ATTR_CENTER_FREQ1 | ||
2497 | * and %NL80211_ATTR_CENTER_FREQ2 attributes must be provided as well | ||
2498 | * @NL80211_CHAN_WIDTH_160: 160 MHz channel, the %NL80211_ATTR_CENTER_FREQ1 | ||
2499 | * attribute must be provided as well | ||
2500 | */ | ||
2501 | enum nl80211_chan_width { | ||
2502 | NL80211_CHAN_WIDTH_20_NOHT, | ||
2503 | NL80211_CHAN_WIDTH_20, | ||
2504 | NL80211_CHAN_WIDTH_40, | ||
2505 | NL80211_CHAN_WIDTH_80, | ||
2506 | NL80211_CHAN_WIDTH_80P80, | ||
2507 | NL80211_CHAN_WIDTH_160, | ||
2508 | }; | ||
2509 | |||
2510 | /** | ||
2425 | * enum nl80211_bss - netlink attributes for a BSS | 2511 | * enum nl80211_bss - netlink attributes for a BSS |
2426 | * | 2512 | * |
2427 | * @__NL80211_BSS_INVALID: invalid | 2513 | * @__NL80211_BSS_INVALID: invalid |
@@ -2489,6 +2575,7 @@ enum nl80211_bss_status { | |||
2489 | * @NL80211_AUTHTYPE_SHARED_KEY: Shared Key authentication (WEP only) | 2575 | * @NL80211_AUTHTYPE_SHARED_KEY: Shared Key authentication (WEP only) |
2490 | * @NL80211_AUTHTYPE_FT: Fast BSS Transition (IEEE 802.11r) | 2576 | * @NL80211_AUTHTYPE_FT: Fast BSS Transition (IEEE 802.11r) |
2491 | * @NL80211_AUTHTYPE_NETWORK_EAP: Network EAP (some Cisco APs and mainly LEAP) | 2577 | * @NL80211_AUTHTYPE_NETWORK_EAP: Network EAP (some Cisco APs and mainly LEAP) |
2578 | * @NL80211_AUTHTYPE_SAE: Simultaneous authentication of equals | ||
2492 | * @__NL80211_AUTHTYPE_NUM: internal | 2579 | * @__NL80211_AUTHTYPE_NUM: internal |
2493 | * @NL80211_AUTHTYPE_MAX: maximum valid auth algorithm | 2580 | * @NL80211_AUTHTYPE_MAX: maximum valid auth algorithm |
2494 | * @NL80211_AUTHTYPE_AUTOMATIC: determine automatically (if necessary by | 2581 | * @NL80211_AUTHTYPE_AUTOMATIC: determine automatically (if necessary by |
@@ -2500,6 +2587,7 @@ enum nl80211_auth_type { | |||
2500 | NL80211_AUTHTYPE_SHARED_KEY, | 2587 | NL80211_AUTHTYPE_SHARED_KEY, |
2501 | NL80211_AUTHTYPE_FT, | 2588 | NL80211_AUTHTYPE_FT, |
2502 | NL80211_AUTHTYPE_NETWORK_EAP, | 2589 | NL80211_AUTHTYPE_NETWORK_EAP, |
2590 | NL80211_AUTHTYPE_SAE, | ||
2503 | 2591 | ||
2504 | /* keep last */ | 2592 | /* keep last */ |
2505 | __NL80211_AUTHTYPE_NUM, | 2593 | __NL80211_AUTHTYPE_NUM, |
@@ -3028,6 +3116,16 @@ enum nl80211_ap_sme_features { | |||
3028 | * in the interface combinations, even when it's only used for scan | 3116 | * in the interface combinations, even when it's only used for scan |
3029 | * and remain-on-channel. This could be due to, for example, the | 3117 | * and remain-on-channel. This could be due to, for example, the |
3030 | * remain-on-channel implementation requiring a channel context. | 3118 | * remain-on-channel implementation requiring a channel context. |
3119 | * @NL80211_FEATURE_SAE: This driver supports simultaneous authentication of | ||
3120 | * equals (SAE) with user space SME (NL80211_CMD_AUTHENTICATE) in station | ||
3121 | * mode | ||
3122 | * @NL80211_FEATURE_LOW_PRIORITY_SCAN: This driver supports low priority scan | ||
3123 | * @NL80211_FEATURE_SCAN_FLUSH: Scan flush is supported | ||
3124 | * @NL80211_FEATURE_AP_SCAN: Support scanning using an AP vif | ||
3125 | * @NL80211_FEATURE_VIF_TXPOWER: The driver supports per-vif TX power setting | ||
3126 | * @NL80211_FEATURE_NEED_OBSS_SCAN: The driver expects userspace to perform | ||
3127 | * OBSS scans and generate 20/40 BSS coex reports. This flag is used only | ||
3128 | * for drivers implementing the CONNECT API, for AUTH/ASSOC it is implied. | ||
3031 | */ | 3129 | */ |
3032 | enum nl80211_feature_flags { | 3130 | enum nl80211_feature_flags { |
3033 | NL80211_FEATURE_SK_TX_STATUS = 1 << 0, | 3131 | NL80211_FEATURE_SK_TX_STATUS = 1 << 0, |
@@ -3035,6 +3133,12 @@ enum nl80211_feature_flags { | |||
3035 | NL80211_FEATURE_INACTIVITY_TIMER = 1 << 2, | 3133 | NL80211_FEATURE_INACTIVITY_TIMER = 1 << 2, |
3036 | NL80211_FEATURE_CELL_BASE_REG_HINTS = 1 << 3, | 3134 | NL80211_FEATURE_CELL_BASE_REG_HINTS = 1 << 3, |
3037 | NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL = 1 << 4, | 3135 | NL80211_FEATURE_P2P_DEVICE_NEEDS_CHANNEL = 1 << 4, |
3136 | NL80211_FEATURE_SAE = 1 << 5, | ||
3137 | NL80211_FEATURE_LOW_PRIORITY_SCAN = 1 << 6, | ||
3138 | NL80211_FEATURE_SCAN_FLUSH = 1 << 7, | ||
3139 | NL80211_FEATURE_AP_SCAN = 1 << 8, | ||
3140 | NL80211_FEATURE_VIF_TXPOWER = 1 << 9, | ||
3141 | NL80211_FEATURE_NEED_OBSS_SCAN = 1 << 10, | ||
3038 | }; | 3142 | }; |
3039 | 3143 | ||
3040 | /** | 3144 | /** |
@@ -3069,4 +3173,25 @@ enum nl80211_connect_failed_reason { | |||
3069 | NL80211_CONN_FAIL_BLOCKED_CLIENT, | 3173 | NL80211_CONN_FAIL_BLOCKED_CLIENT, |
3070 | }; | 3174 | }; |
3071 | 3175 | ||
3176 | /** | ||
3177 | * enum nl80211_scan_flags - scan request control flags | ||
3178 | * | ||
3179 | * Scan request control flags are used to control the handling | ||
3180 | * of NL80211_CMD_TRIGGER_SCAN and NL80211_CMD_START_SCHED_SCAN | ||
3181 | * requests. | ||
3182 | * | ||
3183 | * @NL80211_SCAN_FLAG_LOW_PRIORITY: scan request has low priority | ||
3184 | * @NL80211_SCAN_FLAG_FLUSH: flush cache before scanning | ||
3185 | * @NL80211_SCAN_FLAG_AP: force a scan even if the interface is configured | ||
3186 | * as AP and the beaconing has already been configured. This attribute is | ||
3187 | * dangerous because will destroy stations performance as a lot of frames | ||
3188 | * will be lost while scanning off-channel, therefore it must be used only | ||
3189 | * when really needed | ||
3190 | */ | ||
3191 | enum nl80211_scan_flags { | ||
3192 | NL80211_SCAN_FLAG_LOW_PRIORITY = 1<<0, | ||
3193 | NL80211_SCAN_FLAG_FLUSH = 1<<1, | ||
3194 | NL80211_SCAN_FLAG_AP = 1<<2, | ||
3195 | }; | ||
3196 | |||
3072 | #endif /* __LINUX_NL80211_H */ | 3197 | #endif /* __LINUX_NL80211_H */ |
diff --git a/include/uapi/linux/ptp_clock.h b/include/uapi/linux/ptp_clock.h index 94e981f810a2..b65c834f83e9 100644 --- a/include/uapi/linux/ptp_clock.h +++ b/include/uapi/linux/ptp_clock.h | |||
@@ -67,12 +67,26 @@ struct ptp_perout_request { | |||
67 | unsigned int rsv[4]; /* Reserved for future use. */ | 67 | unsigned int rsv[4]; /* Reserved for future use. */ |
68 | }; | 68 | }; |
69 | 69 | ||
70 | #define PTP_MAX_SAMPLES 25 /* Maximum allowed offset measurement samples. */ | ||
71 | |||
72 | struct ptp_sys_offset { | ||
73 | unsigned int n_samples; /* Desired number of measurements. */ | ||
74 | unsigned int rsv[3]; /* Reserved for future use. */ | ||
75 | /* | ||
76 | * Array of interleaved system/phc time stamps. The kernel | ||
77 | * will provide 2*n_samples + 1 time stamps, with the last | ||
78 | * one as a system time stamp. | ||
79 | */ | ||
80 | struct ptp_clock_time ts[2 * PTP_MAX_SAMPLES + 1]; | ||
81 | }; | ||
82 | |||
70 | #define PTP_CLK_MAGIC '=' | 83 | #define PTP_CLK_MAGIC '=' |
71 | 84 | ||
72 | #define PTP_CLOCK_GETCAPS _IOR(PTP_CLK_MAGIC, 1, struct ptp_clock_caps) | 85 | #define PTP_CLOCK_GETCAPS _IOR(PTP_CLK_MAGIC, 1, struct ptp_clock_caps) |
73 | #define PTP_EXTTS_REQUEST _IOW(PTP_CLK_MAGIC, 2, struct ptp_extts_request) | 86 | #define PTP_EXTTS_REQUEST _IOW(PTP_CLK_MAGIC, 2, struct ptp_extts_request) |
74 | #define PTP_PEROUT_REQUEST _IOW(PTP_CLK_MAGIC, 3, struct ptp_perout_request) | 87 | #define PTP_PEROUT_REQUEST _IOW(PTP_CLK_MAGIC, 3, struct ptp_perout_request) |
75 | #define PTP_ENABLE_PPS _IOW(PTP_CLK_MAGIC, 4, int) | 88 | #define PTP_ENABLE_PPS _IOW(PTP_CLK_MAGIC, 4, int) |
89 | #define PTP_SYS_OFFSET _IOW(PTP_CLK_MAGIC, 5, struct ptp_sys_offset) | ||
76 | 90 | ||
77 | struct ptp_extts_event { | 91 | struct ptp_extts_event { |
78 | struct ptp_clock_time t; /* Time event occured. */ | 92 | struct ptp_clock_time t; /* Time event occured. */ |
diff --git a/include/uapi/linux/rtnetlink.h b/include/uapi/linux/rtnetlink.h index fcd768b09f6e..3dee071770d5 100644 --- a/include/uapi/linux/rtnetlink.h +++ b/include/uapi/linux/rtnetlink.h | |||
@@ -120,6 +120,11 @@ enum { | |||
120 | RTM_SETDCB, | 120 | RTM_SETDCB, |
121 | #define RTM_SETDCB RTM_SETDCB | 121 | #define RTM_SETDCB RTM_SETDCB |
122 | 122 | ||
123 | RTM_NEWNETCONF = 80, | ||
124 | #define RTM_NEWNETCONF RTM_NEWNETCONF | ||
125 | RTM_GETNETCONF = 82, | ||
126 | #define RTM_GETNETCONF RTM_GETNETCONF | ||
127 | |||
123 | __RTM_MAX, | 128 | __RTM_MAX, |
124 | #define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1) | 129 | #define RTM_MAX (((__RTM_MAX + 3) & ~3) - 1) |
125 | }; | 130 | }; |
@@ -587,6 +592,10 @@ enum rtnetlink_groups { | |||
587 | #define RTNLGRP_PHONET_ROUTE RTNLGRP_PHONET_ROUTE | 592 | #define RTNLGRP_PHONET_ROUTE RTNLGRP_PHONET_ROUTE |
588 | RTNLGRP_DCB, | 593 | RTNLGRP_DCB, |
589 | #define RTNLGRP_DCB RTNLGRP_DCB | 594 | #define RTNLGRP_DCB RTNLGRP_DCB |
595 | RTNLGRP_IPV4_NETCONF, | ||
596 | #define RTNLGRP_IPV4_NETCONF RTNLGRP_IPV4_NETCONF | ||
597 | RTNLGRP_IPV6_NETCONF, | ||
598 | #define RTNLGRP_IPV6_NETCONF RTNLGRP_IPV6_NETCONF | ||
590 | __RTNLGRP_MAX | 599 | __RTNLGRP_MAX |
591 | }; | 600 | }; |
592 | #define RTNLGRP_MAX (__RTNLGRP_MAX - 1) | 601 | #define RTNLGRP_MAX (__RTNLGRP_MAX - 1) |
diff --git a/include/uapi/linux/unix_diag.h b/include/uapi/linux/unix_diag.h index b1d2bf16b33c..b8a24941db21 100644 --- a/include/uapi/linux/unix_diag.h +++ b/include/uapi/linux/unix_diag.h | |||
@@ -37,6 +37,7 @@ enum { | |||
37 | UNIX_DIAG_ICONS, | 37 | UNIX_DIAG_ICONS, |
38 | UNIX_DIAG_RQLEN, | 38 | UNIX_DIAG_RQLEN, |
39 | UNIX_DIAG_MEMINFO, | 39 | UNIX_DIAG_MEMINFO, |
40 | UNIX_DIAG_SHUTDOWN, | ||
40 | 41 | ||
41 | UNIX_DIAG_MAX, | 42 | UNIX_DIAG_MAX, |
42 | }; | 43 | }; |
diff --git a/include/uapi/linux/usb/cdc.h b/include/uapi/linux/usb/cdc.h index 81a927930bfd..f35aa0a338c7 100644 --- a/include/uapi/linux/usb/cdc.h +++ b/include/uapi/linux/usb/cdc.h | |||
@@ -19,6 +19,7 @@ | |||
19 | #define USB_CDC_SUBCLASS_OBEX 0x0b | 19 | #define USB_CDC_SUBCLASS_OBEX 0x0b |
20 | #define USB_CDC_SUBCLASS_EEM 0x0c | 20 | #define USB_CDC_SUBCLASS_EEM 0x0c |
21 | #define USB_CDC_SUBCLASS_NCM 0x0d | 21 | #define USB_CDC_SUBCLASS_NCM 0x0d |
22 | #define USB_CDC_SUBCLASS_MBIM 0x0e | ||
22 | 23 | ||
23 | #define USB_CDC_PROTO_NONE 0 | 24 | #define USB_CDC_PROTO_NONE 0 |
24 | 25 | ||
@@ -33,6 +34,7 @@ | |||
33 | #define USB_CDC_PROTO_EEM 7 | 34 | #define USB_CDC_PROTO_EEM 7 |
34 | 35 | ||
35 | #define USB_CDC_NCM_PROTO_NTB 1 | 36 | #define USB_CDC_NCM_PROTO_NTB 1 |
37 | #define USB_CDC_MBIM_PROTO_NTB 2 | ||
36 | 38 | ||
37 | /*-------------------------------------------------------------------------*/ | 39 | /*-------------------------------------------------------------------------*/ |
38 | 40 | ||
@@ -53,6 +55,7 @@ | |||
53 | #define USB_CDC_DMM_TYPE 0x14 | 55 | #define USB_CDC_DMM_TYPE 0x14 |
54 | #define USB_CDC_OBEX_TYPE 0x15 | 56 | #define USB_CDC_OBEX_TYPE 0x15 |
55 | #define USB_CDC_NCM_TYPE 0x1a | 57 | #define USB_CDC_NCM_TYPE 0x1a |
58 | #define USB_CDC_MBIM_TYPE 0x1b | ||
56 | 59 | ||
57 | /* "Header Functional Descriptor" from CDC spec 5.2.3.1 */ | 60 | /* "Header Functional Descriptor" from CDC spec 5.2.3.1 */ |
58 | struct usb_cdc_header_desc { | 61 | struct usb_cdc_header_desc { |
@@ -187,6 +190,21 @@ struct usb_cdc_ncm_desc { | |||
187 | __le16 bcdNcmVersion; | 190 | __le16 bcdNcmVersion; |
188 | __u8 bmNetworkCapabilities; | 191 | __u8 bmNetworkCapabilities; |
189 | } __attribute__ ((packed)); | 192 | } __attribute__ ((packed)); |
193 | |||
194 | /* "MBIM Control Model Functional Descriptor" */ | ||
195 | struct usb_cdc_mbim_desc { | ||
196 | __u8 bLength; | ||
197 | __u8 bDescriptorType; | ||
198 | __u8 bDescriptorSubType; | ||
199 | |||
200 | __le16 bcdMBIMVersion; | ||
201 | __le16 wMaxControlMessage; | ||
202 | __u8 bNumberFilters; | ||
203 | __u8 bMaxFilterSize; | ||
204 | __le16 wMaxSegmentSize; | ||
205 | __u8 bmNetworkCapabilities; | ||
206 | } __attribute__ ((packed)); | ||
207 | |||
190 | /*-------------------------------------------------------------------------*/ | 208 | /*-------------------------------------------------------------------------*/ |
191 | 209 | ||
192 | /* | 210 | /* |
@@ -332,6 +350,11 @@ struct usb_cdc_ncm_nth32 { | |||
332 | #define USB_CDC_NCM_NDP32_CRC_SIGN 0x316D636E /* ncm1 */ | 350 | #define USB_CDC_NCM_NDP32_CRC_SIGN 0x316D636E /* ncm1 */ |
333 | #define USB_CDC_NCM_NDP32_NOCRC_SIGN 0x306D636E /* ncm0 */ | 351 | #define USB_CDC_NCM_NDP32_NOCRC_SIGN 0x306D636E /* ncm0 */ |
334 | 352 | ||
353 | #define USB_CDC_MBIM_NDP16_IPS_SIGN 0x00535049 /* IPS<sessionID> : IPS0 for now */ | ||
354 | #define USB_CDC_MBIM_NDP32_IPS_SIGN 0x00737069 /* ips<sessionID> : ips0 for now */ | ||
355 | #define USB_CDC_MBIM_NDP16_DSS_SIGN 0x00535344 /* DSS<sessionID> */ | ||
356 | #define USB_CDC_MBIM_NDP32_DSS_SIGN 0x00737364 /* dss<sessionID> */ | ||
357 | |||
335 | /* 16-bit NCM Datagram Pointer Entry */ | 358 | /* 16-bit NCM Datagram Pointer Entry */ |
336 | struct usb_cdc_ncm_dpe16 { | 359 | struct usb_cdc_ncm_dpe16 { |
337 | __le16 wDatagramIndex; | 360 | __le16 wDatagramIndex; |