diff options
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/bcma/bcma.h | 5 | ||||
-rw-r--r-- | include/linux/ieee80211.h | 72 | ||||
-rw-r--r-- | include/linux/nfc/pn544.h | 104 | ||||
-rw-r--r-- | include/linux/platform_data/pn544.h | 44 | ||||
-rw-r--r-- | include/linux/ssb/ssb_regs.h | 2 | ||||
-rw-r--r-- | include/net/bluetooth/amp.h | 4 | ||||
-rw-r--r-- | include/net/bluetooth/hci.h | 29 | ||||
-rw-r--r-- | include/net/bluetooth/hci_core.h | 48 | ||||
-rw-r--r-- | include/net/bluetooth/l2cap.h | 38 | ||||
-rw-r--r-- | include/net/cfg80211.h | 223 | ||||
-rw-r--r-- | include/net/mac80211.h | 158 | ||||
-rw-r--r-- | include/net/nfc/hci.h | 3 | ||||
-rw-r--r-- | include/uapi/linux/nl80211.h | 113 |
13 files changed, 629 insertions, 214 deletions
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h index fd15d9829705..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; |
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index 85764a900731..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 | * |
@@ -1114,11 +1163,13 @@ struct ieee80211_ht_operation { | |||
1114 | * STA can receive. Rate expressed in units of 1 Mbps. | 1163 | * STA can receive. Rate expressed in units of 1 Mbps. |
1115 | * 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 |
1116 | * 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. | ||
1117 | * @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 |
1118 | * @tx_highest: Indicates highest long GI VHT PPDU data rate | 1168 | * @tx_highest: Indicates highest long GI VHT PPDU data rate |
1119 | * STA can transmit. Rate expressed in units of 1 Mbps. | 1169 | * STA can transmit. Rate expressed in units of 1 Mbps. |
1120 | * 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 |
1121 | * 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. | ||
1122 | */ | 1173 | */ |
1123 | struct ieee80211_vht_mcs_info { | 1174 | struct ieee80211_vht_mcs_info { |
1124 | __le16 rx_mcs_map; | 1175 | __le16 rx_mcs_map; |
@@ -1128,6 +1179,27 @@ struct ieee80211_vht_mcs_info { | |||
1128 | } __packed; | 1179 | } __packed; |
1129 | 1180 | ||
1130 | /** | 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 | /** | ||
1131 | * struct ieee80211_vht_cap - VHT capabilities | 1203 | * struct ieee80211_vht_cap - VHT capabilities |
1132 | * | 1204 | * |
1133 | * This structure is the "VHT capabilities element" as | 1205 | * This structure is the "VHT capabilities element" as |
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/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/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/net/bluetooth/amp.h b/include/net/bluetooth/amp.h index 2e7c79ea0463..7ea3db77ba89 100644 --- a/include/net/bluetooth/amp.h +++ b/include/net/bluetooth/amp.h | |||
@@ -46,5 +46,9 @@ void amp_accept_phylink(struct hci_dev *hdev, struct amp_mgr *mgr, | |||
46 | struct hci_conn *hcon); | 46 | struct hci_conn *hcon); |
47 | void amp_write_remote_assoc(struct hci_dev *hdev, u8 handle); | 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); | 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); | ||
49 | 53 | ||
50 | #endif /* __AMP_H */ | 54 | #endif /* __AMP_H */ |
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h index 88cbbda61027..45eee08157bb 100644 --- a/include/net/bluetooth/hci.h +++ b/include/net/bluetooth/hci.h | |||
@@ -115,6 +115,7 @@ enum { | |||
115 | HCI_SSP_ENABLED, | 115 | HCI_SSP_ENABLED, |
116 | HCI_HS_ENABLED, | 116 | HCI_HS_ENABLED, |
117 | HCI_LE_ENABLED, | 117 | HCI_LE_ENABLED, |
118 | HCI_LE_PERIPHERAL, | ||
118 | HCI_CONNECTABLE, | 119 | HCI_CONNECTABLE, |
119 | HCI_DISCOVERABLE, | 120 | HCI_DISCOVERABLE, |
120 | HCI_LINK_SECURITY, | 121 | HCI_LINK_SECURITY, |
@@ -153,7 +154,7 @@ enum { | |||
153 | #define HCI_DISCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ | 154 | #define HCI_DISCONN_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ |
154 | #define HCI_PAIRING_TIMEOUT msecs_to_jiffies(60000) /* 60 seconds */ | 155 | #define HCI_PAIRING_TIMEOUT msecs_to_jiffies(60000) /* 60 seconds */ |
155 | #define HCI_INIT_TIMEOUT msecs_to_jiffies(10000) /* 10 seconds */ | 156 | #define HCI_INIT_TIMEOUT msecs_to_jiffies(10000) /* 10 seconds */ |
156 | #define HCI_CMD_TIMEOUT msecs_to_jiffies(1000) /* 1 second */ | 157 | #define HCI_CMD_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ |
157 | #define HCI_ACL_TX_TIMEOUT msecs_to_jiffies(45000) /* 45 seconds */ | 158 | #define HCI_ACL_TX_TIMEOUT msecs_to_jiffies(45000) /* 45 seconds */ |
158 | #define HCI_AUTO_OFF_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ | 159 | #define HCI_AUTO_OFF_TIMEOUT msecs_to_jiffies(2000) /* 2 seconds */ |
159 | 160 | ||
@@ -318,6 +319,9 @@ enum { | |||
318 | #define HCI_FLOW_CTL_MODE_PACKET_BASED 0x00 | 319 | #define HCI_FLOW_CTL_MODE_PACKET_BASED 0x00 |
319 | #define HCI_FLOW_CTL_MODE_BLOCK_BASED 0x01 | 320 | #define HCI_FLOW_CTL_MODE_BLOCK_BASED 0x01 |
320 | 321 | ||
322 | /* The core spec defines 127 as the "not available" value */ | ||
323 | #define HCI_TX_POWER_INVALID 127 | ||
324 | |||
321 | /* Extended Inquiry Response field types */ | 325 | /* Extended Inquiry Response field types */ |
322 | #define EIR_FLAGS 0x01 /* flags */ | 326 | #define EIR_FLAGS 0x01 /* flags */ |
323 | #define EIR_UUID16_SOME 0x02 /* 16-bit UUID, more available */ | 327 | #define EIR_UUID16_SOME 0x02 /* 16-bit UUID, more available */ |
@@ -334,6 +338,13 @@ enum { | |||
334 | #define EIR_SSP_RAND_R 0x0F /* Simple Pairing Randomizer R */ | 338 | #define EIR_SSP_RAND_R 0x0F /* Simple Pairing Randomizer R */ |
335 | #define EIR_DEVICE_ID 0x10 /* device ID */ | 339 | #define EIR_DEVICE_ID 0x10 /* device ID */ |
336 | 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 | |||
337 | /* ----- HCI Commands ---- */ | 348 | /* ----- HCI Commands ---- */ |
338 | #define HCI_OP_NOP 0x0000 | 349 | #define HCI_OP_NOP 0x0000 |
339 | 350 | ||
@@ -932,6 +943,22 @@ struct hci_rp_le_read_buffer_size { | |||
932 | __u8 le_max_pkt; | 943 | __u8 le_max_pkt; |
933 | } __packed; | 944 | } __packed; |
934 | 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 | |||
935 | #define HCI_OP_LE_SET_SCAN_PARAM 0x200b | 962 | #define HCI_OP_LE_SET_SCAN_PARAM 0x200b |
936 | struct hci_cp_le_set_scan_param { | 963 | struct hci_cp_le_set_scan_param { |
937 | __u8 type; | 964 | __u8 type; |
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 9fe8e2dec870..ef5b85dac3f7 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -278,6 +278,10 @@ struct hci_dev { | |||
278 | struct work_struct le_scan; | 278 | struct work_struct le_scan; |
279 | struct le_scan_params le_scan_params; | 279 | struct le_scan_params le_scan_params; |
280 | 280 | ||
281 | __s8 adv_tx_power; | ||
282 | __u8 adv_data[HCI_MAX_AD_LENGTH]; | ||
283 | __u8 adv_data_len; | ||
284 | |||
281 | int (*open)(struct hci_dev *hdev); | 285 | int (*open)(struct hci_dev *hdev); |
282 | int (*close)(struct hci_dev *hdev); | 286 | int (*close)(struct hci_dev *hdev); |
283 | int (*flush)(struct hci_dev *hdev); | 287 | int (*flush)(struct hci_dev *hdev); |
@@ -355,6 +359,7 @@ struct hci_chan { | |||
355 | struct hci_conn *conn; | 359 | struct hci_conn *conn; |
356 | struct sk_buff_head data_q; | 360 | struct sk_buff_head data_q; |
357 | unsigned int sent; | 361 | unsigned int sent; |
362 | __u8 state; | ||
358 | }; | 363 | }; |
359 | 364 | ||
360 | extern struct list_head hci_dev_list; | 365 | extern struct list_head hci_dev_list; |
@@ -682,7 +687,7 @@ static inline uint8_t __hci_num_ctrl(void) | |||
682 | } | 687 | } |
683 | 688 | ||
684 | struct hci_dev *hci_dev_get(int index); | 689 | struct hci_dev *hci_dev_get(int index); |
685 | 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); |
686 | 691 | ||
687 | struct hci_dev *hci_alloc_dev(void); | 692 | struct hci_dev *hci_alloc_dev(void); |
688 | void hci_free_dev(struct hci_dev *hdev); | 693 | void hci_free_dev(struct hci_dev *hdev); |
@@ -731,6 +736,8 @@ int hci_add_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 *hash, | |||
731 | u8 *randomizer); | 736 | u8 *randomizer); |
732 | 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); |
733 | 738 | ||
739 | int hci_update_ad(struct hci_dev *hdev); | ||
740 | |||
734 | 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); |
735 | 742 | ||
736 | int hci_recv_frame(struct sk_buff *skb); | 743 | int hci_recv_frame(struct sk_buff *skb); |
@@ -747,18 +754,29 @@ void hci_conn_del_sysfs(struct hci_conn *conn); | |||
747 | #define SET_HCIDEV_DEV(hdev, pdev) ((hdev)->dev.parent = (pdev)) | 754 | #define SET_HCIDEV_DEV(hdev, pdev) ((hdev)->dev.parent = (pdev)) |
748 | 755 | ||
749 | /* ----- LMP capabilities ----- */ | 756 | /* ----- LMP capabilities ----- */ |
750 | #define lmp_rswitch_capable(dev) ((dev)->features[0] & LMP_RSWITCH) | ||
751 | #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) | ||
752 | #define lmp_sniff_capable(dev) ((dev)->features[0] & LMP_SNIFF) | 760 | #define lmp_sniff_capable(dev) ((dev)->features[0] & LMP_SNIFF) |
753 | #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) | ||
754 | #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) | ||
755 | #define lmp_ssp_capable(dev) ((dev)->features[6] & LMP_SIMPLE_PAIR) | 770 | #define lmp_ssp_capable(dev) ((dev)->features[6] & LMP_SIMPLE_PAIR) |
756 | #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) |
757 | #define lmp_le_capable(dev) ((dev)->features[4] & LMP_LE) | 772 | #define lmp_lsto_capable(dev) ((dev)->features[7] & LMP_LSTO) |
758 | #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) | ||
759 | 775 | ||
760 | /* ----- Extended LMP capabilities ----- */ | 776 | /* ----- Extended LMP capabilities ----- */ |
777 | #define lmp_host_ssp_capable(dev) ((dev)->host_features[0] & LMP_HOST_SSP) | ||
761 | #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) | ||
762 | 780 | ||
763 | /* ----- HCI protocols ----- */ | 781 | /* ----- HCI protocols ----- */ |
764 | 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, |
@@ -877,7 +895,7 @@ struct hci_cb { | |||
877 | 895 | ||
878 | 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) |
879 | { | 897 | { |
880 | struct list_head *p; | 898 | struct hci_cb *cb; |
881 | __u8 encrypt; | 899 | __u8 encrypt; |
882 | 900 | ||
883 | hci_proto_auth_cfm(conn, status); | 901 | hci_proto_auth_cfm(conn, status); |
@@ -888,8 +906,7 @@ static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status) | |||
888 | encrypt = (conn->link_mode & HCI_LM_ENCRYPT) ? 0x01 : 0x00; | 906 | encrypt = (conn->link_mode & HCI_LM_ENCRYPT) ? 0x01 : 0x00; |
889 | 907 | ||
890 | read_lock(&hci_cb_list_lock); | 908 | read_lock(&hci_cb_list_lock); |
891 | list_for_each(p, &hci_cb_list) { | 909 | list_for_each_entry(cb, &hci_cb_list, list) { |
892 | struct hci_cb *cb = list_entry(p, struct hci_cb, list); | ||
893 | if (cb->security_cfm) | 910 | if (cb->security_cfm) |
894 | cb->security_cfm(conn, status, encrypt); | 911 | cb->security_cfm(conn, status, encrypt); |
895 | } | 912 | } |
@@ -899,7 +916,7 @@ static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status) | |||
899 | 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, |
900 | __u8 encrypt) | 917 | __u8 encrypt) |
901 | { | 918 | { |
902 | struct list_head *p; | 919 | struct hci_cb *cb; |
903 | 920 | ||
904 | if (conn->sec_level == BT_SECURITY_SDP) | 921 | if (conn->sec_level == BT_SECURITY_SDP) |
905 | conn->sec_level = BT_SECURITY_LOW; | 922 | conn->sec_level = BT_SECURITY_LOW; |
@@ -910,8 +927,7 @@ static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status, | |||
910 | hci_proto_encrypt_cfm(conn, status, encrypt); | 927 | hci_proto_encrypt_cfm(conn, status, encrypt); |
911 | 928 | ||
912 | read_lock(&hci_cb_list_lock); | 929 | read_lock(&hci_cb_list_lock); |
913 | list_for_each(p, &hci_cb_list) { | 930 | list_for_each_entry(cb, &hci_cb_list, list) { |
914 | struct hci_cb *cb = list_entry(p, struct hci_cb, list); | ||
915 | if (cb->security_cfm) | 931 | if (cb->security_cfm) |
916 | cb->security_cfm(conn, status, encrypt); | 932 | cb->security_cfm(conn, status, encrypt); |
917 | } | 933 | } |
@@ -920,11 +936,10 @@ static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status, | |||
920 | 936 | ||
921 | 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) |
922 | { | 938 | { |
923 | struct list_head *p; | 939 | struct hci_cb *cb; |
924 | 940 | ||
925 | read_lock(&hci_cb_list_lock); | 941 | read_lock(&hci_cb_list_lock); |
926 | list_for_each(p, &hci_cb_list) { | 942 | list_for_each_entry(cb, &hci_cb_list, list) { |
927 | struct hci_cb *cb = list_entry(p, struct hci_cb, list); | ||
928 | if (cb->key_change_cfm) | 943 | if (cb->key_change_cfm) |
929 | cb->key_change_cfm(conn, status); | 944 | cb->key_change_cfm(conn, status); |
930 | } | 945 | } |
@@ -934,11 +949,10 @@ static inline void hci_key_change_cfm(struct hci_conn *conn, __u8 status) | |||
934 | 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, |
935 | __u8 role) | 950 | __u8 role) |
936 | { | 951 | { |
937 | struct list_head *p; | 952 | struct hci_cb *cb; |
938 | 953 | ||
939 | read_lock(&hci_cb_list_lock); | 954 | read_lock(&hci_cb_list_lock); |
940 | list_for_each(p, &hci_cb_list) { | 955 | list_for_each_entry(cb, &hci_cb_list, list) { |
941 | struct hci_cb *cb = list_entry(p, struct hci_cb, list); | ||
942 | if (cb->role_switch_cfm) | 956 | if (cb->role_switch_cfm) |
943 | cb->role_switch_cfm(conn, status, role); | 957 | cb->role_switch_cfm(conn, status, role); |
944 | } | 958 | } |
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index 6e23afdf65c1..f57fab04e7c5 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h | |||
@@ -52,6 +52,8 @@ | |||
52 | #define L2CAP_ENC_TIMEOUT msecs_to_jiffies(5000) | 52 | #define L2CAP_ENC_TIMEOUT msecs_to_jiffies(5000) |
53 | #define L2CAP_CONN_TIMEOUT msecs_to_jiffies(40000) | 53 | #define L2CAP_CONN_TIMEOUT msecs_to_jiffies(40000) |
54 | #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) | ||
55 | 57 | ||
56 | #define L2CAP_A2MP_DEFAULT_MTU 670 | 58 | #define L2CAP_A2MP_DEFAULT_MTU 670 |
57 | 59 | ||
@@ -434,6 +436,8 @@ struct l2cap_chan { | |||
434 | struct sock *sk; | 436 | struct sock *sk; |
435 | 437 | ||
436 | struct l2cap_conn *conn; | 438 | struct l2cap_conn *conn; |
439 | struct hci_conn *hs_hcon; | ||
440 | struct hci_chan *hs_hchan; | ||
437 | struct kref kref; | 441 | struct kref kref; |
438 | 442 | ||
439 | __u8 state; | 443 | __u8 state; |
@@ -477,6 +481,12 @@ struct l2cap_chan { | |||
477 | unsigned long conn_state; | 481 | unsigned long conn_state; |
478 | unsigned long flags; | 482 | unsigned long flags; |
479 | 483 | ||
484 | __u8 remote_amp_id; | ||
485 | __u8 local_amp_id; | ||
486 | __u8 move_id; | ||
487 | __u8 move_state; | ||
488 | __u8 move_role; | ||
489 | |||
480 | __u16 next_tx_seq; | 490 | __u16 next_tx_seq; |
481 | __u16 expected_ack_seq; | 491 | __u16 expected_ack_seq; |
482 | __u16 expected_tx_seq; | 492 | __u16 expected_tx_seq; |
@@ -509,8 +519,6 @@ struct l2cap_chan { | |||
509 | __u32 remote_acc_lat; | 519 | __u32 remote_acc_lat; |
510 | __u32 remote_flush_to; | 520 | __u32 remote_flush_to; |
511 | 521 | ||
512 | __u8 ctrl_id; | ||
513 | |||
514 | struct delayed_work chan_timer; | 522 | struct delayed_work chan_timer; |
515 | struct delayed_work retrans_timer; | 523 | struct delayed_work retrans_timer; |
516 | struct delayed_work monitor_timer; | 524 | struct delayed_work monitor_timer; |
@@ -644,6 +652,9 @@ enum { | |||
644 | enum { | 652 | enum { |
645 | L2CAP_RX_STATE_RECV, | 653 | L2CAP_RX_STATE_RECV, |
646 | 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, | ||
647 | }; | 658 | }; |
648 | 659 | ||
649 | enum { | 660 | enum { |
@@ -674,6 +685,25 @@ enum { | |||
674 | L2CAP_EV_RECV_FRAME, | 685 | L2CAP_EV_RECV_FRAME, |
675 | }; | 686 | }; |
676 | 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 | |||
677 | void l2cap_chan_hold(struct l2cap_chan *c); | 707 | void l2cap_chan_hold(struct l2cap_chan *c); |
678 | void l2cap_chan_put(struct l2cap_chan *c); | 708 | void l2cap_chan_put(struct l2cap_chan *c); |
679 | 709 | ||
@@ -778,5 +808,9 @@ void l2cap_chan_add(struct l2cap_conn *conn, struct l2cap_chan *chan); | |||
778 | 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); |
779 | void l2cap_chan_del(struct l2cap_chan *chan, int err); | 809 | void l2cap_chan_del(struct l2cap_chan *chan, int err); |
780 | void l2cap_send_conn_req(struct l2cap_chan *chan); | 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); | ||
781 | 815 | ||
782 | #endif /* __L2CAP_H */ | 816 | #endif /* __L2CAP_H */ |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index c6964572890f..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 | ||
@@ -582,16 +662,24 @@ enum station_info_flags { | |||
582 | * Used by the driver to indicate the specific rate transmission | 662 | * Used by the driver to indicate the specific rate transmission |
583 | * type for 802.11n transmissions. | 663 | * type for 802.11n transmissions. |
584 | * | 664 | * |
585 | * @RATE_INFO_FLAGS_MCS: @tx_bitrate_mcs filled | 665 | * @RATE_INFO_FLAGS_MCS: mcs field filled with HT MCS |
586 | * @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 | ||
587 | * @RATE_INFO_FLAGS_SHORT_GI: 400ns guard interval | 671 | * @RATE_INFO_FLAGS_SHORT_GI: 400ns guard interval |
588 | * @RATE_INFO_FLAGS_60G: 60gHz MCS | 672 | * @RATE_INFO_FLAGS_60G: 60GHz MCS |
589 | */ | 673 | */ |
590 | enum rate_info_flags { | 674 | enum rate_info_flags { |
591 | RATE_INFO_FLAGS_MCS = 1<<0, | 675 | RATE_INFO_FLAGS_MCS = BIT(0), |
592 | RATE_INFO_FLAGS_40_MHZ_WIDTH = 1<<1, | 676 | RATE_INFO_FLAGS_VHT_MCS = BIT(1), |
593 | RATE_INFO_FLAGS_SHORT_GI = 1<<2, | 677 | RATE_INFO_FLAGS_40_MHZ_WIDTH = BIT(2), |
594 | 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), | ||
595 | }; | 683 | }; |
596 | 684 | ||
597 | /** | 685 | /** |
@@ -602,11 +690,13 @@ enum rate_info_flags { | |||
602 | * @flags: bitflag of flags from &enum rate_info_flags | 690 | * @flags: bitflag of flags from &enum rate_info_flags |
603 | * @mcs: mcs index if struct describes a 802.11n bitrate | 691 | * @mcs: mcs index if struct describes a 802.11n bitrate |
604 | * @legacy: bitrate in 100kbit/s for 802.11abg | 692 | * @legacy: bitrate in 100kbit/s for 802.11abg |
693 | * @nss: number of streams (VHT only) | ||
605 | */ | 694 | */ |
606 | struct rate_info { | 695 | struct rate_info { |
607 | u8 flags; | 696 | u8 flags; |
608 | u8 mcs; | 697 | u8 mcs; |
609 | u16 legacy; | 698 | u16 legacy; |
699 | u8 nss; | ||
610 | }; | 700 | }; |
611 | 701 | ||
612 | /** | 702 | /** |
@@ -909,8 +999,7 @@ struct mesh_config { | |||
909 | 999 | ||
910 | /** | 1000 | /** |
911 | * struct mesh_setup - 802.11s mesh setup configuration | 1001 | * struct mesh_setup - 802.11s mesh setup configuration |
912 | * @channel: the channel to start the mesh network on | 1002 | * @chandef: defines the channel to use |
913 | * @channel_type: the channel type to use | ||
914 | * @mesh_id: the mesh ID | 1003 | * @mesh_id: the mesh ID |
915 | * @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 |
916 | * @sync_method: which synchronization method to use | 1005 | * @sync_method: which synchronization method to use |
@@ -925,8 +1014,7 @@ struct mesh_config { | |||
925 | * These parameters are fixed when the mesh is created. | 1014 | * These parameters are fixed when the mesh is created. |
926 | */ | 1015 | */ |
927 | struct mesh_setup { | 1016 | struct mesh_setup { |
928 | struct ieee80211_channel *channel; | 1017 | struct cfg80211_chan_def chandef; |
929 | enum nl80211_channel_type channel_type; | ||
930 | const u8 *mesh_id; | 1018 | const u8 *mesh_id; |
931 | u8 mesh_id_len; | 1019 | u8 mesh_id_len; |
932 | u8 sync_method; | 1020 | u8 sync_method; |
@@ -1266,8 +1354,7 @@ struct cfg80211_disassoc_request { | |||
1266 | * @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. |
1267 | * @bssid: Fixed BSSID requested, maybe be %NULL, if set do not | 1355 | * @bssid: Fixed BSSID requested, maybe be %NULL, if set do not |
1268 | * search for IBSSs with a different BSSID. | 1356 | * search for IBSSs with a different BSSID. |
1269 | * @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 |
1270 | * @channel_type: channel type (HT mode) | ||
1271 | * @channel_fixed: The channel should be fixed -- do not search for | 1358 | * @channel_fixed: The channel should be fixed -- do not search for |
1272 | * IBSSs to join on other channels. | 1359 | * IBSSs to join on other channels. |
1273 | * @ie: information element(s) to include in the beacon | 1360 | * @ie: information element(s) to include in the beacon |
@@ -1285,8 +1372,7 @@ struct cfg80211_disassoc_request { | |||
1285 | struct cfg80211_ibss_params { | 1372 | struct cfg80211_ibss_params { |
1286 | u8 *ssid; | 1373 | u8 *ssid; |
1287 | u8 *bssid; | 1374 | u8 *bssid; |
1288 | struct ieee80211_channel *channel; | 1375 | struct cfg80211_chan_def chandef; |
1289 | enum nl80211_channel_type channel_type; | ||
1290 | u8 *ie; | 1376 | u8 *ie; |
1291 | u8 ssid_len, ie_len; | 1377 | u8 ssid_len, ie_len; |
1292 | u16 beacon_interval; | 1378 | u16 beacon_interval; |
@@ -1545,13 +1631,19 @@ struct cfg80211_gtk_rekey_data { | |||
1545 | * to a merge. | 1631 | * to a merge. |
1546 | * @leave_ibss: Leave the IBSS. | 1632 | * @leave_ibss: Leave the IBSS. |
1547 | * | 1633 | * |
1634 | * @set_mcast_rate: Set the specified multicast rate (only if vif is in ADHOC or | ||
1635 | * MESH mode) | ||
1636 | * | ||
1548 | * @set_wiphy_params: Notify that wiphy parameters have changed; | 1637 | * @set_wiphy_params: Notify that wiphy parameters have changed; |
1549 | * @changed bitfield (see &enum wiphy_params_flags) describes which values | 1638 | * @changed bitfield (see &enum wiphy_params_flags) describes which values |
1550 | * have changed. The actual parameter values are available in | 1639 | * have changed. The actual parameter values are available in |
1551 | * struct wiphy. If returning an error, no value should be changed. | 1640 | * struct wiphy. If returning an error, no value should be changed. |
1552 | * | 1641 | * |
1553 | * @set_tx_power: set the transmit power according to the parameters, | 1642 | * @set_tx_power: set the transmit power according to the parameters, |
1554 | * 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.) | ||
1555 | * @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; |
1556 | * return 0 if successful | 1648 | * return 0 if successful |
1557 | * | 1649 | * |
@@ -1722,8 +1814,7 @@ struct cfg80211_ops { | |||
1722 | struct ieee80211_channel *chan); | 1814 | struct ieee80211_channel *chan); |
1723 | 1815 | ||
1724 | int (*set_monitor_channel)(struct wiphy *wiphy, | 1816 | int (*set_monitor_channel)(struct wiphy *wiphy, |
1725 | struct ieee80211_channel *chan, | 1817 | struct cfg80211_chan_def *chandef); |
1726 | enum nl80211_channel_type channel_type); | ||
1727 | 1818 | ||
1728 | int (*scan)(struct wiphy *wiphy, | 1819 | int (*scan)(struct wiphy *wiphy, |
1729 | struct cfg80211_scan_request *request); | 1820 | struct cfg80211_scan_request *request); |
@@ -1746,11 +1837,15 @@ struct cfg80211_ops { | |||
1746 | struct cfg80211_ibss_params *params); | 1837 | struct cfg80211_ibss_params *params); |
1747 | int (*leave_ibss)(struct wiphy *wiphy, struct net_device *dev); | 1838 | int (*leave_ibss)(struct wiphy *wiphy, struct net_device *dev); |
1748 | 1839 | ||
1840 | int (*set_mcast_rate)(struct wiphy *wiphy, struct net_device *dev, | ||
1841 | int rate[IEEE80211_NUM_BANDS]); | ||
1842 | |||
1749 | int (*set_wiphy_params)(struct wiphy *wiphy, u32 changed); | 1843 | int (*set_wiphy_params)(struct wiphy *wiphy, u32 changed); |
1750 | 1844 | ||
1751 | int (*set_tx_power)(struct wiphy *wiphy, | 1845 | int (*set_tx_power)(struct wiphy *wiphy, struct wireless_dev *wdev, |
1752 | enum nl80211_tx_power_setting type, int mbm); | 1846 | enum nl80211_tx_power_setting type, int mbm); |
1753 | int (*get_tx_power)(struct wiphy *wiphy, int *dbm); | 1847 | int (*get_tx_power)(struct wiphy *wiphy, struct wireless_dev *wdev, |
1848 | int *dbm); | ||
1754 | 1849 | ||
1755 | int (*set_wds_peer)(struct wiphy *wiphy, struct net_device *dev, | 1850 | int (*set_wds_peer)(struct wiphy *wiphy, struct net_device *dev, |
1756 | const u8 *addr); | 1851 | const u8 *addr); |
@@ -1781,7 +1876,6 @@ struct cfg80211_ops { | |||
1781 | int (*remain_on_channel)(struct wiphy *wiphy, | 1876 | int (*remain_on_channel)(struct wiphy *wiphy, |
1782 | struct wireless_dev *wdev, | 1877 | struct wireless_dev *wdev, |
1783 | struct ieee80211_channel *chan, | 1878 | struct ieee80211_channel *chan, |
1784 | enum nl80211_channel_type channel_type, | ||
1785 | unsigned int duration, | 1879 | unsigned int duration, |
1786 | u64 *cookie); | 1880 | u64 *cookie); |
1787 | int (*cancel_remain_on_channel)(struct wiphy *wiphy, | 1881 | int (*cancel_remain_on_channel)(struct wiphy *wiphy, |
@@ -1790,10 +1884,8 @@ struct cfg80211_ops { | |||
1790 | 1884 | ||
1791 | int (*mgmt_tx)(struct wiphy *wiphy, struct wireless_dev *wdev, | 1885 | int (*mgmt_tx)(struct wiphy *wiphy, struct wireless_dev *wdev, |
1792 | struct ieee80211_channel *chan, bool offchan, | 1886 | struct ieee80211_channel *chan, bool offchan, |
1793 | enum nl80211_channel_type channel_type, | 1887 | unsigned int wait, const u8 *buf, size_t len, |
1794 | bool channel_type_valid, unsigned int wait, | 1888 | bool no_cck, bool dont_wait_for_ack, u64 *cookie); |
1795 | const u8 *buf, size_t len, bool no_cck, | ||
1796 | bool dont_wait_for_ack, u64 *cookie); | ||
1797 | int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy, | 1889 | int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy, |
1798 | struct wireless_dev *wdev, | 1890 | struct wireless_dev *wdev, |
1799 | u64 cookie); | 1891 | u64 cookie); |
@@ -1848,10 +1940,9 @@ struct cfg80211_ops { | |||
1848 | void (*get_et_strings)(struct wiphy *wiphy, struct net_device *dev, | 1940 | void (*get_et_strings)(struct wiphy *wiphy, struct net_device *dev, |
1849 | u32 sset, u8 *data); | 1941 | u32 sset, u8 *data); |
1850 | 1942 | ||
1851 | struct ieee80211_channel * | 1943 | int (*get_channel)(struct wiphy *wiphy, |
1852 | (*get_channel)(struct wiphy *wiphy, | ||
1853 | struct wireless_dev *wdev, | 1944 | struct wireless_dev *wdev, |
1854 | enum nl80211_channel_type *type); | 1945 | struct cfg80211_chan_def *chandef); |
1855 | 1946 | ||
1856 | int (*start_p2p_device)(struct wiphy *wiphy, | 1947 | int (*start_p2p_device)(struct wiphy *wiphy, |
1857 | struct wireless_dev *wdev); | 1948 | struct wireless_dev *wdev); |
@@ -2459,8 +2550,7 @@ struct wireless_dev { | |||
2459 | spinlock_t event_lock; | 2550 | spinlock_t event_lock; |
2460 | 2551 | ||
2461 | struct cfg80211_internal_bss *current_bss; /* associated / joined */ | 2552 | struct cfg80211_internal_bss *current_bss; /* associated / joined */ |
2462 | struct ieee80211_channel *preset_chan; | 2553 | struct cfg80211_chan_def preset_chandef; |
2463 | enum nl80211_channel_type preset_chantype; | ||
2464 | 2554 | ||
2465 | /* for AP and mesh channel tracking */ | 2555 | /* for AP and mesh channel tracking */ |
2466 | struct ieee80211_channel *channel; | 2556 | struct ieee80211_channel *channel; |
@@ -3340,14 +3430,12 @@ void cfg80211_disconnected(struct net_device *dev, u16 reason, | |||
3340 | * @wdev: wireless device | 3430 | * @wdev: wireless device |
3341 | * @cookie: the request cookie | 3431 | * @cookie: the request cookie |
3342 | * @chan: The current channel (from remain_on_channel request) | 3432 | * @chan: The current channel (from remain_on_channel request) |
3343 | * @channel_type: Channel type | ||
3344 | * @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 |
3345 | * channel | 3434 | * channel |
3346 | * @gfp: allocation flags | 3435 | * @gfp: allocation flags |
3347 | */ | 3436 | */ |
3348 | void cfg80211_ready_on_channel(struct wireless_dev *wdev, u64 cookie, | 3437 | void cfg80211_ready_on_channel(struct wireless_dev *wdev, u64 cookie, |
3349 | struct ieee80211_channel *chan, | 3438 | struct ieee80211_channel *chan, |
3350 | enum nl80211_channel_type channel_type, | ||
3351 | unsigned int duration, gfp_t gfp); | 3439 | unsigned int duration, gfp_t gfp); |
3352 | 3440 | ||
3353 | /** | 3441 | /** |
@@ -3355,12 +3443,10 @@ void cfg80211_ready_on_channel(struct wireless_dev *wdev, u64 cookie, | |||
3355 | * @wdev: wireless device | 3443 | * @wdev: wireless device |
3356 | * @cookie: the request cookie | 3444 | * @cookie: the request cookie |
3357 | * @chan: The current channel (from remain_on_channel request) | 3445 | * @chan: The current channel (from remain_on_channel request) |
3358 | * @channel_type: Channel type | ||
3359 | * @gfp: allocation flags | 3446 | * @gfp: allocation flags |
3360 | */ | 3447 | */ |
3361 | 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, |
3362 | struct ieee80211_channel *chan, | 3449 | struct ieee80211_channel *chan, |
3363 | enum nl80211_channel_type channel_type, | ||
3364 | gfp_t gfp); | 3450 | gfp_t gfp); |
3365 | 3451 | ||
3366 | 3452 | ||
@@ -3550,7 +3636,6 @@ void cfg80211_probe_status(struct net_device *dev, const u8 *addr, | |||
3550 | * @len: length of the frame | 3636 | * @len: length of the frame |
3551 | * @freq: frequency the frame was received on | 3637 | * @freq: frequency the frame was received on |
3552 | * @sig_dbm: signal strength in mBm, or 0 if unknown | 3638 | * @sig_dbm: signal strength in mBm, or 0 if unknown |
3553 | * @gfp: allocation flags | ||
3554 | * | 3639 | * |
3555 | * Use this function to report to userspace when a beacon was | 3640 | * Use this function to report to userspace when a beacon was |
3556 | * 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 |
@@ -3558,31 +3643,47 @@ void cfg80211_probe_status(struct net_device *dev, const u8 *addr, | |||
3558 | */ | 3643 | */ |
3559 | void cfg80211_report_obss_beacon(struct wiphy *wiphy, | 3644 | void cfg80211_report_obss_beacon(struct wiphy *wiphy, |
3560 | const u8 *frame, size_t len, | 3645 | const u8 *frame, size_t len, |
3561 | int freq, int sig_dbm, gfp_t gfp); | 3646 | int freq, int sig_dbm); |
3562 | 3647 | ||
3563 | /** | 3648 | /** |
3564 | * cfg80211_can_beacon_sec_chan - test if ht40 on extension channel can be used | 3649 | * cfg80211_reg_can_beacon - check if beaconing is allowed |
3565 | * @wiphy: the wiphy | 3650 | * @wiphy: the wiphy |
3566 | * @chan: main channel | 3651 | * @chandef: the channel definition |
3567 | * @channel_type: HT mode | ||
3568 | * | 3652 | * |
3569 | * 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 |
3570 | * 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.) |
3571 | */ | 3655 | */ |
3572 | bool cfg80211_can_beacon_sec_chan(struct wiphy *wiphy, | 3656 | bool cfg80211_reg_can_beacon(struct wiphy *wiphy, |
3573 | struct ieee80211_channel *chan, | 3657 | struct cfg80211_chan_def *chandef); |
3574 | enum nl80211_channel_type channel_type); | ||
3575 | 3658 | ||
3576 | /* | 3659 | /* |
3577 | * cfg80211_ch_switch_notify - update wdev channel and notify userspace | 3660 | * cfg80211_ch_switch_notify - update wdev channel and notify userspace |
3578 | * @dev: the device which switched channels | 3661 | * @dev: the device which switched channels |
3579 | * @freq: new channel frequency (in MHz) | 3662 | * @chandef: the new channel definition |
3580 | * @type: channel type | ||
3581 | * | 3663 | * |
3582 | * 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! |
3583 | */ | 3665 | */ |
3584 | void cfg80211_ch_switch_notify(struct net_device *dev, int freq, | 3666 | void cfg80211_ch_switch_notify(struct net_device *dev, |
3585 | 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); | ||
3586 | 3687 | ||
3587 | /* | 3688 | /* |
3588 | * cfg80211_calculate_bitrate - calculate actual bitrate (in 100Kbps units) | 3689 | * cfg80211_calculate_bitrate - calculate actual bitrate (in 100Kbps units) |
@@ -3608,6 +3709,26 @@ u32 cfg80211_calculate_bitrate(struct rate_info *rate); | |||
3608 | */ | 3709 | */ |
3609 | void cfg80211_unregister_wdev(struct wireless_dev *wdev); | 3710 | void cfg80211_unregister_wdev(struct wireless_dev *wdev); |
3610 | 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 | |||
3611 | /* Logging, debugging and troubleshooting/diagnostic helpers. */ | 3732 | /* Logging, debugging and troubleshooting/diagnostic helpers. */ |
3612 | 3733 | ||
3613 | /* wiphy_printk helpers, similar to dev_printk */ | 3734 | /* wiphy_printk helpers, similar to dev_printk */ |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 00b7204708bd..db7680acd0da 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -145,11 +145,11 @@ struct ieee80211_low_level_stats { | |||
145 | 145 | ||
146 | /** | 146 | /** |
147 | * enum ieee80211_chanctx_change - change flag for channel context | 147 | * enum ieee80211_chanctx_change - change flag for channel context |
148 | * @IEEE80211_CHANCTX_CHANGE_CHANNEL_TYPE: The channel type was changed | 148 | * @IEEE80211_CHANCTX_CHANGE_WIDTH: The channel width changed |
149 | * @IEEE80211_CHANCTX_CHANGE_RX_CHAINS: The number of RX chains changed | 149 | * @IEEE80211_CHANCTX_CHANGE_RX_CHAINS: The number of RX chains changed |
150 | */ | 150 | */ |
151 | enum ieee80211_chanctx_change { | 151 | enum ieee80211_chanctx_change { |
152 | IEEE80211_CHANCTX_CHANGE_CHANNEL_TYPE = BIT(0), | 152 | IEEE80211_CHANCTX_CHANGE_WIDTH = BIT(0), |
153 | IEEE80211_CHANCTX_CHANGE_RX_CHAINS = BIT(1), | 153 | IEEE80211_CHANCTX_CHANGE_RX_CHAINS = BIT(1), |
154 | }; | 154 | }; |
155 | 155 | ||
@@ -159,8 +159,7 @@ enum ieee80211_chanctx_change { | |||
159 | * This is the driver-visible part. The ieee80211_chanctx | 159 | * This is the driver-visible part. The ieee80211_chanctx |
160 | * that contains it is visible in mac80211 only. | 160 | * that contains it is visible in mac80211 only. |
161 | * | 161 | * |
162 | * @channel: the channel to tune to | 162 | * @def: the channel definition |
163 | * @channel_type: the channel (HT) type | ||
164 | * @rx_chains_static: The number of RX chains that must always be | 163 | * @rx_chains_static: The number of RX chains that must always be |
165 | * active on the channel to receive MIMO transmissions | 164 | * active on the channel to receive MIMO transmissions |
166 | * @rx_chains_dynamic: The number of RX chains that must be enabled | 165 | * @rx_chains_dynamic: The number of RX chains that must be enabled |
@@ -170,8 +169,7 @@ enum ieee80211_chanctx_change { | |||
170 | * sizeof(void *), size is determined in hw information. | 169 | * sizeof(void *), size is determined in hw information. |
171 | */ | 170 | */ |
172 | struct ieee80211_chanctx_conf { | 171 | struct ieee80211_chanctx_conf { |
173 | struct ieee80211_channel *channel; | 172 | struct cfg80211_chan_def def; |
174 | enum nl80211_channel_type channel_type; | ||
175 | 173 | ||
176 | u8 rx_chains_static, rx_chains_dynamic; | 174 | u8 rx_chains_static, rx_chains_dynamic; |
177 | 175 | ||
@@ -207,6 +205,9 @@ struct ieee80211_chanctx_conf { | |||
207 | * @BSS_CHANGED_SSID: SSID changed for this BSS (AP mode) | 205 | * @BSS_CHANGED_SSID: SSID changed for this BSS (AP mode) |
208 | * @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) |
209 | * @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) | ||
210 | */ | 211 | */ |
211 | enum ieee80211_bss_change { | 212 | enum ieee80211_bss_change { |
212 | BSS_CHANGED_ASSOC = 1<<0, | 213 | BSS_CHANGED_ASSOC = 1<<0, |
@@ -227,6 +228,8 @@ enum ieee80211_bss_change { | |||
227 | BSS_CHANGED_SSID = 1<<15, | 228 | BSS_CHANGED_SSID = 1<<15, |
228 | BSS_CHANGED_AP_PROBE_RESP = 1<<16, | 229 | BSS_CHANGED_AP_PROBE_RESP = 1<<16, |
229 | BSS_CHANGED_PS = 1<<17, | 230 | BSS_CHANGED_PS = 1<<17, |
231 | BSS_CHANGED_TXPOWER = 1<<18, | ||
232 | BSS_CHANGED_P2P_PS = 1<<19, | ||
230 | 233 | ||
231 | /* when adding here, make sure to change ieee80211_reconfig */ | 234 | /* when adding here, make sure to change ieee80211_reconfig */ |
232 | }; | 235 | }; |
@@ -283,9 +286,8 @@ enum ieee80211_rssi_event { | |||
283 | * @mcast_rate: per-band multicast rate index + 1 (0: disabled) | 286 | * @mcast_rate: per-band multicast rate index + 1 (0: disabled) |
284 | * @bssid: The BSSID for this BSS | 287 | * @bssid: The BSSID for this BSS |
285 | * @enable_beacon: whether beaconing should be enabled or not | 288 | * @enable_beacon: whether beaconing should be enabled or not |
286 | * @channel_type: Channel type for this BSS -- the hardware might be | 289 | * @chandef: Channel definition for this BSS -- the hardware might be |
287 | * configured for HT40+ while this BSS only uses no-HT, for | 290 | * configured a higher bandwidth than this BSS uses, for example. |
288 | * example. | ||
289 | * @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. |
290 | * 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. |
291 | * @cqm_rssi_thold: Connection quality monitor RSSI threshold, a zero value | 293 | * @cqm_rssi_thold: Connection quality monitor RSSI threshold, a zero value |
@@ -309,6 +311,9 @@ enum ieee80211_rssi_event { | |||
309 | * @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. |
310 | * @ssid_len: Length of SSID given in @ssid. | 312 | * @ssid_len: Length of SSID given in @ssid. |
311 | * @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 | ||
312 | */ | 317 | */ |
313 | struct ieee80211_bss_conf { | 318 | struct ieee80211_bss_conf { |
314 | const u8 *bssid; | 319 | const u8 *bssid; |
@@ -331,7 +336,7 @@ struct ieee80211_bss_conf { | |||
331 | u16 ht_operation_mode; | 336 | u16 ht_operation_mode; |
332 | s32 cqm_rssi_thold; | 337 | s32 cqm_rssi_thold; |
333 | u32 cqm_rssi_hyst; | 338 | u32 cqm_rssi_hyst; |
334 | enum nl80211_channel_type channel_type; | 339 | struct cfg80211_chan_def chandef; |
335 | __be32 arp_addr_list[IEEE80211_BSS_ARP_ADDR_LIST_LEN]; | 340 | __be32 arp_addr_list[IEEE80211_BSS_ARP_ADDR_LIST_LEN]; |
336 | u8 arp_addr_cnt; | 341 | u8 arp_addr_cnt; |
337 | bool arp_filter_enabled; | 342 | bool arp_filter_enabled; |
@@ -341,6 +346,9 @@ struct ieee80211_bss_conf { | |||
341 | u8 ssid[IEEE80211_MAX_SSID_LEN]; | 346 | u8 ssid[IEEE80211_MAX_SSID_LEN]; |
342 | size_t ssid_len; | 347 | size_t ssid_len; |
343 | bool hidden_ssid; | 348 | bool hidden_ssid; |
349 | int txpower; | ||
350 | u8 p2p_ctwindow; | ||
351 | bool p2p_oppps; | ||
344 | }; | 352 | }; |
345 | 353 | ||
346 | /** | 354 | /** |
@@ -491,9 +499,14 @@ enum mac80211_tx_control_flags { | |||
491 | * This is set if the current BSS requires ERP protection. | 499 | * This is set if the current BSS requires ERP protection. |
492 | * @IEEE80211_TX_RC_USE_SHORT_PREAMBLE: Use short preamble. | 500 | * @IEEE80211_TX_RC_USE_SHORT_PREAMBLE: Use short preamble. |
493 | * @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) | ||
494 | * @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 |
495 | * Greenfield mode. | 505 | * Greenfield mode. |
496 | * @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) | ||
497 | * @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 |
498 | * adjacent 20 MHz channels, if the current channel type is | 511 | * adjacent 20 MHz channels, if the current channel type is |
499 | * NL80211_CHAN_HT40MINUS or NL80211_CHAN_HT40PLUS. | 512 | * NL80211_CHAN_HT40MINUS or NL80211_CHAN_HT40PLUS. |
@@ -504,12 +517,15 @@ enum mac80211_rate_control_flags { | |||
504 | IEEE80211_TX_RC_USE_CTS_PROTECT = BIT(1), | 517 | IEEE80211_TX_RC_USE_CTS_PROTECT = BIT(1), |
505 | IEEE80211_TX_RC_USE_SHORT_PREAMBLE = BIT(2), | 518 | IEEE80211_TX_RC_USE_SHORT_PREAMBLE = BIT(2), |
506 | 519 | ||
507 | /* rate index is an MCS rate number instead of an index */ | 520 | /* rate index is an HT/VHT MCS instead of an index */ |
508 | IEEE80211_TX_RC_MCS = BIT(3), | 521 | IEEE80211_TX_RC_MCS = BIT(3), |
509 | IEEE80211_TX_RC_GREEN_FIELD = BIT(4), | 522 | IEEE80211_TX_RC_GREEN_FIELD = BIT(4), |
510 | IEEE80211_TX_RC_40_MHZ_WIDTH = BIT(5), | 523 | IEEE80211_TX_RC_40_MHZ_WIDTH = BIT(5), |
511 | IEEE80211_TX_RC_DUP_DATA = BIT(6), | 524 | IEEE80211_TX_RC_DUP_DATA = BIT(6), |
512 | 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), | ||
513 | }; | 529 | }; |
514 | 530 | ||
515 | 531 | ||
@@ -552,10 +568,32 @@ enum mac80211_rate_control_flags { | |||
552 | */ | 568 | */ |
553 | struct ieee80211_tx_rate { | 569 | struct ieee80211_tx_rate { |
554 | s8 idx; | 570 | s8 idx; |
555 | u8 count; | 571 | u16 count:5, |
556 | u8 flags; | 572 | flags:11; |
557 | } __packed; | 573 | } __packed; |
558 | 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 | |||
559 | /** | 597 | /** |
560 | * struct ieee80211_tx_info - skb transmit information | 598 | * struct ieee80211_tx_info - skb transmit information |
561 | * | 599 | * |
@@ -700,13 +738,20 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info) | |||
700 | * the frame. | 738 | * the frame. |
701 | * @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 |
702 | * the frame. | 740 | * the frame. |
703 | * @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 |
704 | * 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 |
705 | * 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 |
706 | * 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. | ||
707 | * @RX_FLAG_SHORTPRE: Short preamble was used for this frame | 748 | * @RX_FLAG_SHORTPRE: Short preamble was used for this frame |
708 | * @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 | ||
709 | * @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 | ||
710 | * @RX_FLAG_SHORT_GI: Short guard interval was used | 755 | * @RX_FLAG_SHORT_GI: Short guard interval was used |
711 | * @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. |
712 | * Valid only for data frames (mainly A-MPDU) | 757 | * Valid only for data frames (mainly A-MPDU) |
@@ -734,7 +779,7 @@ enum mac80211_rx_flags { | |||
734 | RX_FLAG_IV_STRIPPED = BIT(4), | 779 | RX_FLAG_IV_STRIPPED = BIT(4), |
735 | RX_FLAG_FAILED_FCS_CRC = BIT(5), | 780 | RX_FLAG_FAILED_FCS_CRC = BIT(5), |
736 | RX_FLAG_FAILED_PLCP_CRC = BIT(6), | 781 | RX_FLAG_FAILED_PLCP_CRC = BIT(6), |
737 | RX_FLAG_MACTIME_MPDU = BIT(7), | 782 | RX_FLAG_MACTIME_START = BIT(7), |
738 | RX_FLAG_SHORTPRE = BIT(8), | 783 | RX_FLAG_SHORTPRE = BIT(8), |
739 | RX_FLAG_HT = BIT(9), | 784 | RX_FLAG_HT = BIT(9), |
740 | RX_FLAG_40MHZ = BIT(10), | 785 | RX_FLAG_40MHZ = BIT(10), |
@@ -748,6 +793,11 @@ enum mac80211_rx_flags { | |||
748 | RX_FLAG_AMPDU_IS_LAST = BIT(18), | 793 | RX_FLAG_AMPDU_IS_LAST = BIT(18), |
749 | RX_FLAG_AMPDU_DELIM_CRC_ERROR = BIT(19), | 794 | RX_FLAG_AMPDU_DELIM_CRC_ERROR = BIT(19), |
750 | 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), | ||
751 | }; | 801 | }; |
752 | 802 | ||
753 | /** | 803 | /** |
@@ -768,25 +818,39 @@ enum mac80211_rx_flags { | |||
768 | * @IEEE80211_HW_SIGNAL_* | 818 | * @IEEE80211_HW_SIGNAL_* |
769 | * @antenna: antenna used | 819 | * @antenna: antenna used |
770 | * @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 |
771 | * 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) | ||
772 | * @flag: %RX_FLAG_* | 823 | * @flag: %RX_FLAG_* |
773 | * @rx_flags: internal RX flags for mac80211 | 824 | * @rx_flags: internal RX flags for mac80211 |
774 | * @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 |
775 | * 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 |
776 | * @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 | ||
777 | */ | 835 | */ |
778 | struct ieee80211_rx_status { | 836 | struct ieee80211_rx_status { |
779 | u64 mactime; | 837 | u64 mactime; |
780 | u32 device_timestamp; | 838 | u32 device_timestamp; |
781 | u32 ampdu_reference; | 839 | u32 ampdu_reference; |
782 | u32 flag; | 840 | u32 flag; |
841 | u32 vendor_radiotap_bitmap; | ||
842 | u16 vendor_radiotap_len; | ||
783 | u16 freq; | 843 | u16 freq; |
784 | u8 rate_idx; | 844 | u8 rate_idx; |
845 | u8 vht_nss; | ||
785 | u8 rx_flags; | 846 | u8 rx_flags; |
786 | u8 band; | 847 | u8 band; |
787 | u8 antenna; | 848 | u8 antenna; |
788 | s8 signal; | 849 | s8 signal; |
789 | 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; | ||
790 | }; | 854 | }; |
791 | 855 | ||
792 | /** | 856 | /** |
@@ -884,7 +948,8 @@ enum ieee80211_smps_mode { | |||
884 | * powersave documentation below. This variable is valid only when | 948 | * powersave documentation below. This variable is valid only when |
885 | * the CONF_PS flag is set. | 949 | * the CONF_PS flag is set. |
886 | * | 950 | * |
887 | * @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 | ||
888 | * | 953 | * |
889 | * @channel: the channel to tune to | 954 | * @channel: the channel to tune to |
890 | * @channel_type: the channel (HT) type | 955 | * @channel_type: the channel (HT) type |
@@ -2180,6 +2245,14 @@ enum ieee80211_rate_control_changed { | |||
2180 | * @sta_remove: Notifies low level driver about removal of an associated | 2245 | * @sta_remove: Notifies low level driver about removal of an associated |
2181 | * station, AP, IBSS/WDS/mesh peer etc. This callback can sleep. | 2246 | * station, AP, IBSS/WDS/mesh peer etc. This callback can sleep. |
2182 | * | 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 | * | ||
2183 | * @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 |
2184 | * 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 |
2185 | * 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 |
@@ -2381,6 +2454,17 @@ enum ieee80211_rate_control_changed { | |||
2381 | * to vif. Possible use is for hw queue remapping. | 2454 | * to vif. Possible use is for hw queue remapping. |
2382 | * @unassign_vif_chanctx: Notifies device driver about channel context being | 2455 | * @unassign_vif_chanctx: Notifies device driver about channel context being |
2383 | * unbound from vif. | 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. | ||
2384 | */ | 2468 | */ |
2385 | struct ieee80211_ops { | 2469 | struct ieee80211_ops { |
2386 | void (*tx)(struct ieee80211_hw *hw, | 2470 | void (*tx)(struct ieee80211_hw *hw, |
@@ -2406,6 +2490,9 @@ struct ieee80211_ops { | |||
2406 | struct ieee80211_bss_conf *info, | 2490 | struct ieee80211_bss_conf *info, |
2407 | u32 changed); | 2491 | u32 changed); |
2408 | 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 | |||
2409 | u64 (*prepare_multicast)(struct ieee80211_hw *hw, | 2496 | u64 (*prepare_multicast)(struct ieee80211_hw *hw, |
2410 | struct netdev_hw_addr_list *mc_list); | 2497 | struct netdev_hw_addr_list *mc_list); |
2411 | void (*configure_filter)(struct ieee80211_hw *hw, | 2498 | void (*configure_filter)(struct ieee80211_hw *hw, |
@@ -2447,6 +2534,16 @@ struct ieee80211_ops { | |||
2447 | struct ieee80211_sta *sta); | 2534 | struct ieee80211_sta *sta); |
2448 | int (*sta_remove)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 2535 | int (*sta_remove)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
2449 | 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 | ||
2450 | void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 2547 | void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
2451 | enum sta_notify_cmd, struct ieee80211_sta *sta); | 2548 | enum sta_notify_cmd, struct ieee80211_sta *sta); |
2452 | int (*sta_state)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 2549 | int (*sta_state)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
@@ -2488,8 +2585,8 @@ struct ieee80211_ops { | |||
2488 | 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); |
2489 | 2586 | ||
2490 | int (*remain_on_channel)(struct ieee80211_hw *hw, | 2587 | int (*remain_on_channel)(struct ieee80211_hw *hw, |
2588 | struct ieee80211_vif *vif, | ||
2491 | struct ieee80211_channel *chan, | 2589 | struct ieee80211_channel *chan, |
2492 | enum nl80211_channel_type channel_type, | ||
2493 | int duration); | 2590 | int duration); |
2494 | int (*cancel_remain_on_channel)(struct ieee80211_hw *hw); | 2591 | int (*cancel_remain_on_channel)(struct ieee80211_hw *hw); |
2495 | int (*set_ringparam)(struct ieee80211_hw *hw, u32 tx, u32 rx); | 2592 | int (*set_ringparam)(struct ieee80211_hw *hw, u32 tx, u32 rx); |
@@ -2539,6 +2636,8 @@ struct ieee80211_ops { | |||
2539 | void (*unassign_vif_chanctx)(struct ieee80211_hw *hw, | 2636 | void (*unassign_vif_chanctx)(struct ieee80211_hw *hw, |
2540 | struct ieee80211_vif *vif, | 2637 | struct ieee80211_vif *vif, |
2541 | struct ieee80211_chanctx_conf *ctx); | 2638 | struct ieee80211_chanctx_conf *ctx); |
2639 | |||
2640 | void (*restart_complete)(struct ieee80211_hw *hw); | ||
2542 | }; | 2641 | }; |
2543 | 2642 | ||
2544 | /** | 2643 | /** |
@@ -3385,6 +3484,21 @@ void ieee80211_sched_scan_results(struct ieee80211_hw *hw); | |||
3385 | void ieee80211_sched_scan_stopped(struct ieee80211_hw *hw); | 3484 | void ieee80211_sched_scan_stopped(struct ieee80211_hw *hw); |
3386 | 3485 | ||
3387 | /** | 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 | /** | ||
3388 | * ieee80211_iterate_active_interfaces - iterate active interfaces | 3502 | * ieee80211_iterate_active_interfaces - iterate active interfaces |
3389 | * | 3503 | * |
3390 | * This function iterates over the interfaces associated with a given | 3504 | * This function iterates over the interfaces associated with a given |
@@ -3392,13 +3506,15 @@ void ieee80211_sched_scan_stopped(struct ieee80211_hw *hw); | |||
3392 | * This function allows the iterator function to sleep, when the iterator | 3506 | * This function allows the iterator function to sleep, when the iterator |
3393 | * function is atomic @ieee80211_iterate_active_interfaces_atomic can | 3507 | * function is atomic @ieee80211_iterate_active_interfaces_atomic can |
3394 | * be used. | 3508 | * be used. |
3395 | * Does not iterate over a new interface during add_interface() | 3509 | * Does not iterate over a new interface during add_interface(). |
3396 | * | 3510 | * |
3397 | * @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 | ||
3398 | * @iterator: the iterator function to call | 3513 | * @iterator: the iterator function to call |
3399 | * @data: first argument of the iterator function | 3514 | * @data: first argument of the iterator function |
3400 | */ | 3515 | */ |
3401 | void ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw, | 3516 | void ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw, |
3517 | u32 iter_flags, | ||
3402 | void (*iterator)(void *data, u8 *mac, | 3518 | void (*iterator)(void *data, u8 *mac, |
3403 | struct ieee80211_vif *vif), | 3519 | struct ieee80211_vif *vif), |
3404 | void *data); | 3520 | void *data); |
@@ -3410,13 +3526,15 @@ void ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw, | |||
3410 | * hardware that are currently active and calls the callback for them. | 3526 | * hardware that are currently active and calls the callback for them. |
3411 | * This function requires the iterator callback function to be atomic, | 3527 | * This function requires the iterator callback function to be atomic, |
3412 | * if that is not desired, use @ieee80211_iterate_active_interfaces instead. | 3528 | * if that is not desired, use @ieee80211_iterate_active_interfaces instead. |
3413 | * Does not iterate over a new interface during add_interface() | 3529 | * Does not iterate over a new interface during add_interface(). |
3414 | * | 3530 | * |
3415 | * @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 | ||
3416 | * @iterator: the iterator function to call, cannot sleep | 3533 | * @iterator: the iterator function to call, cannot sleep |
3417 | * @data: first argument of the iterator function | 3534 | * @data: first argument of the iterator function |
3418 | */ | 3535 | */ |
3419 | 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, | ||
3420 | void (*iterator)(void *data, | 3538 | void (*iterator)(void *data, |
3421 | u8 *mac, | 3539 | u8 *mac, |
3422 | struct ieee80211_vif *vif), | 3540 | struct ieee80211_vif *vif), |
diff --git a/include/net/nfc/hci.h b/include/net/nfc/hci.h index 639f50af42df..671953e11575 100644 --- a/include/net/nfc/hci.h +++ b/include/net/nfc/hci.h | |||
@@ -149,6 +149,8 @@ void *nfc_hci_get_clientdata(struct nfc_hci_dev *hdev); | |||
149 | 149 | ||
150 | 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); |
151 | 151 | ||
152 | int nfc_hci_result_to_errno(u8 result); | ||
153 | |||
152 | /* Host IDs */ | 154 | /* Host IDs */ |
153 | #define NFC_HCI_HOST_CONTROLLER_ID 0x00 | 155 | #define NFC_HCI_HOST_CONTROLLER_ID 0x00 |
154 | #define NFC_HCI_TERMINAL_HOST_ID 0x01 | 156 | #define NFC_HCI_TERMINAL_HOST_ID 0x01 |
@@ -235,5 +237,6 @@ int nfc_hci_send_response(struct nfc_hci_dev *hdev, u8 gate, u8 response, | |||
235 | 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, |
236 | const u8 *param, size_t param_len); | 238 | const u8 *param, size_t param_len); |
237 | int nfc_hci_target_discovered(struct nfc_hci_dev *hdev, u8 gate); | 239 | int nfc_hci_target_discovered(struct nfc_hci_dev *hdev, u8 gate); |
240 | u32 nfc_hci_sak_to_protocol(u8 sak); | ||
238 | 241 | ||
239 | #endif /* __NET_HCI_H */ | 242 | #endif /* __NET_HCI_H */ |
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index 617d0fbfc96f..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 |
@@ -1544,6 +1566,10 @@ enum nl80211_attrs { | |||
1544 | 1566 | ||
1545 | NL80211_ATTR_SCAN_FLAGS, | 1567 | NL80211_ATTR_SCAN_FLAGS, |
1546 | 1568 | ||
1569 | NL80211_ATTR_CHANNEL_WIDTH, | ||
1570 | NL80211_ATTR_CENTER_FREQ1, | ||
1571 | NL80211_ATTR_CENTER_FREQ2, | ||
1572 | |||
1547 | /* add attributes here, update the policy in nl80211.c */ | 1573 | /* add attributes here, update the policy in nl80211.c */ |
1548 | 1574 | ||
1549 | __NL80211_ATTR_AFTER_LAST, | 1575 | __NL80211_ATTR_AFTER_LAST, |
@@ -1708,10 +1734,15 @@ struct nl80211_sta_flag_update { | |||
1708 | * @__NL80211_RATE_INFO_INVALID: attribute number 0 is reserved | 1734 | * @__NL80211_RATE_INFO_INVALID: attribute number 0 is reserved |
1709 | * @NL80211_RATE_INFO_BITRATE: total bitrate (u16, 100kbit/s) | 1735 | * @NL80211_RATE_INFO_BITRATE: total bitrate (u16, 100kbit/s) |
1710 | * @NL80211_RATE_INFO_MCS: mcs index for 802.11n (u8) | 1736 | * @NL80211_RATE_INFO_MCS: mcs index for 802.11n (u8) |
1711 | * @NL80211_RATE_INFO_40_MHZ_WIDTH: 40 Mhz dualchannel bitrate | 1737 | * @NL80211_RATE_INFO_40_MHZ_WIDTH: 40 MHz dualchannel bitrate |
1712 | * @NL80211_RATE_INFO_SHORT_GI: 400ns guard interval | 1738 | * @NL80211_RATE_INFO_SHORT_GI: 400ns guard interval |
1713 | * @NL80211_RATE_INFO_BITRATE32: total bitrate (u32, 100kbit/s) | 1739 | * @NL80211_RATE_INFO_BITRATE32: total bitrate (u32, 100kbit/s) |
1714 | * @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 | ||
1715 | * @__NL80211_RATE_INFO_AFTER_LAST: internal use | 1746 | * @__NL80211_RATE_INFO_AFTER_LAST: internal use |
1716 | */ | 1747 | */ |
1717 | enum nl80211_rate_info { | 1748 | enum nl80211_rate_info { |
@@ -1721,6 +1752,11 @@ enum nl80211_rate_info { | |||
1721 | NL80211_RATE_INFO_40_MHZ_WIDTH, | 1752 | NL80211_RATE_INFO_40_MHZ_WIDTH, |
1722 | NL80211_RATE_INFO_SHORT_GI, | 1753 | NL80211_RATE_INFO_SHORT_GI, |
1723 | 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, | ||
1724 | 1760 | ||
1725 | /* keep last */ | 1761 | /* keep last */ |
1726 | __NL80211_RATE_INFO_AFTER_LAST, | 1762 | __NL80211_RATE_INFO_AFTER_LAST, |
@@ -2429,6 +2465,15 @@ enum nl80211_ac { | |||
2429 | #define NL80211_TXQ_Q_BE NL80211_AC_BE | 2465 | #define NL80211_TXQ_Q_BE NL80211_AC_BE |
2430 | #define NL80211_TXQ_Q_BK NL80211_AC_BK | 2466 | #define NL80211_TXQ_Q_BK NL80211_AC_BK |
2431 | 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 | */ | ||
2432 | enum nl80211_channel_type { | 2477 | enum nl80211_channel_type { |
2433 | NL80211_CHAN_NO_HT, | 2478 | NL80211_CHAN_NO_HT, |
2434 | NL80211_CHAN_HT20, | 2479 | NL80211_CHAN_HT20, |
@@ -2437,6 +2482,32 @@ enum nl80211_channel_type { | |||
2437 | }; | 2482 | }; |
2438 | 2483 | ||
2439 | /** | 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 | /** | ||
2440 | * enum nl80211_bss - netlink attributes for a BSS | 2511 | * enum nl80211_bss - netlink attributes for a BSS |
2441 | * | 2512 | * |
2442 | * @__NL80211_BSS_INVALID: invalid | 2513 | * @__NL80211_BSS_INVALID: invalid |
@@ -3051,6 +3122,10 @@ enum nl80211_ap_sme_features { | |||
3051 | * @NL80211_FEATURE_LOW_PRIORITY_SCAN: This driver supports low priority scan | 3122 | * @NL80211_FEATURE_LOW_PRIORITY_SCAN: This driver supports low priority scan |
3052 | * @NL80211_FEATURE_SCAN_FLUSH: Scan flush is supported | 3123 | * @NL80211_FEATURE_SCAN_FLUSH: Scan flush is supported |
3053 | * @NL80211_FEATURE_AP_SCAN: Support scanning using an AP vif | 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. | ||
3054 | */ | 3129 | */ |
3055 | enum nl80211_feature_flags { | 3130 | enum nl80211_feature_flags { |
3056 | NL80211_FEATURE_SK_TX_STATUS = 1 << 0, | 3131 | NL80211_FEATURE_SK_TX_STATUS = 1 << 0, |
@@ -3062,6 +3137,8 @@ enum nl80211_feature_flags { | |||
3062 | NL80211_FEATURE_LOW_PRIORITY_SCAN = 1 << 6, | 3137 | NL80211_FEATURE_LOW_PRIORITY_SCAN = 1 << 6, |
3063 | NL80211_FEATURE_SCAN_FLUSH = 1 << 7, | 3138 | NL80211_FEATURE_SCAN_FLUSH = 1 << 7, |
3064 | NL80211_FEATURE_AP_SCAN = 1 << 8, | 3139 | NL80211_FEATURE_AP_SCAN = 1 << 8, |
3140 | NL80211_FEATURE_VIF_TXPOWER = 1 << 9, | ||
3141 | NL80211_FEATURE_NEED_OBSS_SCAN = 1 << 10, | ||
3065 | }; | 3142 | }; |
3066 | 3143 | ||
3067 | /** | 3144 | /** |