diff options
Diffstat (limited to 'include/net/cfg80211.h')
-rw-r--r-- | include/net/cfg80211.h | 221 |
1 files changed, 163 insertions, 58 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index b44a2e5321a3..2fd06c60ffbb 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -37,6 +37,7 @@ | |||
37 | * | 37 | * |
38 | * @IEEE80211_BAND_2GHZ: 2.4GHz ISM band | 38 | * @IEEE80211_BAND_2GHZ: 2.4GHz ISM band |
39 | * @IEEE80211_BAND_5GHZ: around 5GHz band (4.9-5.7) | 39 | * @IEEE80211_BAND_5GHZ: around 5GHz band (4.9-5.7) |
40 | * @IEEE80211_NUM_BANDS: number of defined bands | ||
40 | */ | 41 | */ |
41 | enum ieee80211_band { | 42 | enum ieee80211_band { |
42 | IEEE80211_BAND_2GHZ = NL80211_BAND_2GHZ, | 43 | IEEE80211_BAND_2GHZ = NL80211_BAND_2GHZ, |
@@ -89,7 +90,7 @@ enum ieee80211_channel_flags { | |||
89 | * @max_power: maximum transmission power (in dBm) | 90 | * @max_power: maximum transmission power (in dBm) |
90 | * @beacon_found: helper to regulatory code to indicate when a beacon | 91 | * @beacon_found: helper to regulatory code to indicate when a beacon |
91 | * has been found on this channel. Use regulatory_hint_found_beacon() | 92 | * has been found on this channel. Use regulatory_hint_found_beacon() |
92 | * to enable this, this is is useful only on 5 GHz band. | 93 | * to enable this, this is useful only on 5 GHz band. |
93 | * @orig_mag: internal use | 94 | * @orig_mag: internal use |
94 | * @orig_mpwr: internal use | 95 | * @orig_mpwr: internal use |
95 | */ | 96 | */ |
@@ -188,6 +189,7 @@ struct ieee80211_sta_ht_cap { | |||
188 | * in this band. Must be sorted to give a valid "supported | 189 | * in this band. Must be sorted to give a valid "supported |
189 | * rates" IE, i.e. CCK rates first, then OFDM. | 190 | * rates" IE, i.e. CCK rates first, then OFDM. |
190 | * @n_bitrates: Number of bitrates in @bitrates | 191 | * @n_bitrates: Number of bitrates in @bitrates |
192 | * @ht_cap: HT capabilities in this band | ||
191 | */ | 193 | */ |
192 | struct ieee80211_supported_band { | 194 | struct ieee80211_supported_band { |
193 | struct ieee80211_channel *channels; | 195 | struct ieee80211_channel *channels; |
@@ -225,6 +227,7 @@ struct vif_params { | |||
225 | * @seq: sequence counter (IV/PN) for TKIP and CCMP keys, only used | 227 | * @seq: sequence counter (IV/PN) for TKIP and CCMP keys, only used |
226 | * with the get_key() callback, must be in little endian, | 228 | * with the get_key() callback, must be in little endian, |
227 | * length given by @seq_len. | 229 | * length given by @seq_len. |
230 | * @seq_len: length of @seq. | ||
228 | */ | 231 | */ |
229 | struct key_params { | 232 | struct key_params { |
230 | u8 *key; | 233 | u8 *key; |
@@ -237,6 +240,8 @@ struct key_params { | |||
237 | /** | 240 | /** |
238 | * enum survey_info_flags - survey information flags | 241 | * enum survey_info_flags - survey information flags |
239 | * | 242 | * |
243 | * @SURVEY_INFO_NOISE_DBM: noise (in dBm) was filled in | ||
244 | * | ||
240 | * Used by the driver to indicate which info in &struct survey_info | 245 | * Used by the driver to indicate which info in &struct survey_info |
241 | * it has filled in during the get_survey(). | 246 | * it has filled in during the get_survey(). |
242 | */ | 247 | */ |
@@ -247,13 +252,13 @@ enum survey_info_flags { | |||
247 | /** | 252 | /** |
248 | * struct survey_info - channel survey response | 253 | * struct survey_info - channel survey response |
249 | * | 254 | * |
250 | * Used by dump_survey() to report back per-channel survey information. | ||
251 | * | ||
252 | * @channel: the channel this survey record reports, mandatory | 255 | * @channel: the channel this survey record reports, mandatory |
253 | * @filled: bitflag of flags from &enum survey_info_flags | 256 | * @filled: bitflag of flags from &enum survey_info_flags |
254 | * @noise: channel noise in dBm. This and all following fields are | 257 | * @noise: channel noise in dBm. This and all following fields are |
255 | * optional | 258 | * optional |
256 | * | 259 | * |
260 | * Used by dump_survey() to report back per-channel survey information. | ||
261 | * | ||
257 | * This structure can later be expanded with things like | 262 | * This structure can later be expanded with things like |
258 | * channel duty cycle etc. | 263 | * channel duty cycle etc. |
259 | */ | 264 | */ |
@@ -288,7 +293,7 @@ struct beacon_parameters { | |||
288 | * | 293 | * |
289 | * @PLINK_ACTION_INVALID: action 0 is reserved | 294 | * @PLINK_ACTION_INVALID: action 0 is reserved |
290 | * @PLINK_ACTION_OPEN: start mesh peer link establishment | 295 | * @PLINK_ACTION_OPEN: start mesh peer link establishment |
291 | * @PLINK_ACTION_BLOCL: block traffic from this mesh peer | 296 | * @PLINK_ACTION_BLOCK: block traffic from this mesh peer |
292 | */ | 297 | */ |
293 | enum plink_actions { | 298 | enum plink_actions { |
294 | PLINK_ACTION_INVALID, | 299 | PLINK_ACTION_INVALID, |
@@ -311,6 +316,8 @@ enum plink_actions { | |||
311 | * (bitmask of BIT(NL80211_STA_FLAG_...)) | 316 | * (bitmask of BIT(NL80211_STA_FLAG_...)) |
312 | * @listen_interval: listen interval or -1 for no change | 317 | * @listen_interval: listen interval or -1 for no change |
313 | * @aid: AID or zero for no change | 318 | * @aid: AID or zero for no change |
319 | * @plink_action: plink action to take | ||
320 | * @ht_capa: HT capabilities of station | ||
314 | */ | 321 | */ |
315 | struct station_parameters { | 322 | struct station_parameters { |
316 | u8 *supported_rates; | 323 | u8 *supported_rates; |
@@ -448,13 +455,13 @@ enum monitor_flags { | |||
448 | * Used by the driver to indicate which info in &struct mpath_info it has filled | 455 | * Used by the driver to indicate which info in &struct mpath_info it has filled |
449 | * in during get_station() or dump_station(). | 456 | * in during get_station() or dump_station(). |
450 | * | 457 | * |
451 | * MPATH_INFO_FRAME_QLEN: @frame_qlen filled | 458 | * @MPATH_INFO_FRAME_QLEN: @frame_qlen filled |
452 | * MPATH_INFO_SN: @sn filled | 459 | * @MPATH_INFO_SN: @sn filled |
453 | * MPATH_INFO_METRIC: @metric filled | 460 | * @MPATH_INFO_METRIC: @metric filled |
454 | * MPATH_INFO_EXPTIME: @exptime filled | 461 | * @MPATH_INFO_EXPTIME: @exptime filled |
455 | * MPATH_INFO_DISCOVERY_TIMEOUT: @discovery_timeout filled | 462 | * @MPATH_INFO_DISCOVERY_TIMEOUT: @discovery_timeout filled |
456 | * MPATH_INFO_DISCOVERY_RETRIES: @discovery_retries filled | 463 | * @MPATH_INFO_DISCOVERY_RETRIES: @discovery_retries filled |
457 | * MPATH_INFO_FLAGS: @flags filled | 464 | * @MPATH_INFO_FLAGS: @flags filled |
458 | */ | 465 | */ |
459 | enum mpath_info_flags { | 466 | enum mpath_info_flags { |
460 | MPATH_INFO_FRAME_QLEN = BIT(0), | 467 | MPATH_INFO_FRAME_QLEN = BIT(0), |
@@ -587,6 +594,7 @@ struct cfg80211_ssid { | |||
587 | * @ie_len: length of ie in octets | 594 | * @ie_len: length of ie in octets |
588 | * @wiphy: the wiphy this was for | 595 | * @wiphy: the wiphy this was for |
589 | * @dev: the interface | 596 | * @dev: the interface |
597 | * @aborted: (internal) scan request was notified as aborted | ||
590 | */ | 598 | */ |
591 | struct cfg80211_scan_request { | 599 | struct cfg80211_scan_request { |
592 | struct cfg80211_ssid *ssids; | 600 | struct cfg80211_ssid *ssids; |
@@ -623,6 +631,7 @@ enum cfg80211_signal_type { | |||
623 | * This structure describes a BSS (which may also be a mesh network) | 631 | * This structure describes a BSS (which may also be a mesh network) |
624 | * for use in scan results and similar. | 632 | * for use in scan results and similar. |
625 | * | 633 | * |
634 | * @channel: channel this BSS is on | ||
626 | * @bssid: BSSID of the BSS | 635 | * @bssid: BSSID of the BSS |
627 | * @tsf: timestamp of last received update | 636 | * @tsf: timestamp of last received update |
628 | * @beacon_interval: the beacon interval as from the frame | 637 | * @beacon_interval: the beacon interval as from the frame |
@@ -801,6 +810,7 @@ struct cfg80211_disassoc_request { | |||
801 | * @beacon_interval: beacon interval to use | 810 | * @beacon_interval: beacon interval to use |
802 | * @privacy: this is a protected network, keys will be configured | 811 | * @privacy: this is a protected network, keys will be configured |
803 | * after joining | 812 | * after joining |
813 | * @basic_rates: bitmap of basic rates to use when creating the IBSS | ||
804 | */ | 814 | */ |
805 | struct cfg80211_ibss_params { | 815 | struct cfg80211_ibss_params { |
806 | u8 *ssid; | 816 | u8 *ssid; |
@@ -809,6 +819,7 @@ struct cfg80211_ibss_params { | |||
809 | u8 *ie; | 819 | u8 *ie; |
810 | u8 ssid_len, ie_len; | 820 | u8 ssid_len, ie_len; |
811 | u16 beacon_interval; | 821 | u16 beacon_interval; |
822 | u32 basic_rates; | ||
812 | bool channel_fixed; | 823 | bool channel_fixed; |
813 | bool privacy; | 824 | bool privacy; |
814 | }; | 825 | }; |
@@ -826,8 +837,8 @@ struct cfg80211_ibss_params { | |||
826 | * @ssid: SSID | 837 | * @ssid: SSID |
827 | * @ssid_len: Length of ssid in octets | 838 | * @ssid_len: Length of ssid in octets |
828 | * @auth_type: Authentication type (algorithm) | 839 | * @auth_type: Authentication type (algorithm) |
829 | * @assoc_ie: IEs for association request | 840 | * @ie: IEs for association request |
830 | * @assoc_ie_len: Length of assoc_ie in octets | 841 | * @ie_len: Length of assoc_ie in octets |
831 | * @privacy: indicates whether privacy-enabled APs should be used | 842 | * @privacy: indicates whether privacy-enabled APs should be used |
832 | * @crypto: crypto settings | 843 | * @crypto: crypto settings |
833 | * @key_len: length of WEP key for shared key authentication | 844 | * @key_len: length of WEP key for shared key authentication |
@@ -850,10 +861,11 @@ struct cfg80211_connect_params { | |||
850 | 861 | ||
851 | /** | 862 | /** |
852 | * enum wiphy_params_flags - set_wiphy_params bitfield values | 863 | * enum wiphy_params_flags - set_wiphy_params bitfield values |
853 | * WIPHY_PARAM_RETRY_SHORT: wiphy->retry_short has changed | 864 | * @WIPHY_PARAM_RETRY_SHORT: wiphy->retry_short has changed |
854 | * WIPHY_PARAM_RETRY_LONG: wiphy->retry_long has changed | 865 | * @WIPHY_PARAM_RETRY_LONG: wiphy->retry_long has changed |
855 | * WIPHY_PARAM_FRAG_THRESHOLD: wiphy->frag_threshold has changed | 866 | * @WIPHY_PARAM_FRAG_THRESHOLD: wiphy->frag_threshold has changed |
856 | * WIPHY_PARAM_RTS_THRESHOLD: wiphy->rts_threshold has changed | 867 | * @WIPHY_PARAM_RTS_THRESHOLD: wiphy->rts_threshold has changed |
868 | * @WIPHY_PARAM_COVERAGE_CLASS: coverage class changed | ||
857 | */ | 869 | */ |
858 | enum wiphy_params_flags { | 870 | enum wiphy_params_flags { |
859 | WIPHY_PARAM_RETRY_SHORT = 1 << 0, | 871 | WIPHY_PARAM_RETRY_SHORT = 1 << 0, |
@@ -863,19 +875,6 @@ enum wiphy_params_flags { | |||
863 | WIPHY_PARAM_COVERAGE_CLASS = 1 << 4, | 875 | WIPHY_PARAM_COVERAGE_CLASS = 1 << 4, |
864 | }; | 876 | }; |
865 | 877 | ||
866 | /** | ||
867 | * enum tx_power_setting - TX power adjustment | ||
868 | * | ||
869 | * @TX_POWER_AUTOMATIC: the dbm parameter is ignored | ||
870 | * @TX_POWER_LIMITED: limit TX power by the dbm parameter | ||
871 | * @TX_POWER_FIXED: fix TX power to the dbm parameter | ||
872 | */ | ||
873 | enum tx_power_setting { | ||
874 | TX_POWER_AUTOMATIC, | ||
875 | TX_POWER_LIMITED, | ||
876 | TX_POWER_FIXED, | ||
877 | }; | ||
878 | |||
879 | /* | 878 | /* |
880 | * cfg80211_bitrate_mask - masks for bitrate control | 879 | * cfg80211_bitrate_mask - masks for bitrate control |
881 | */ | 880 | */ |
@@ -949,10 +948,16 @@ struct cfg80211_pmksa { | |||
949 | * @del_beacon: Remove beacon configuration and stop sending the beacon. | 948 | * @del_beacon: Remove beacon configuration and stop sending the beacon. |
950 | * | 949 | * |
951 | * @add_station: Add a new station. | 950 | * @add_station: Add a new station. |
952 | * | ||
953 | * @del_station: Remove a station; @mac may be NULL to remove all stations. | 951 | * @del_station: Remove a station; @mac may be NULL to remove all stations. |
954 | * | ||
955 | * @change_station: Modify a given station. | 952 | * @change_station: Modify a given station. |
953 | * @get_station: get station information for the station identified by @mac | ||
954 | * @dump_station: dump station callback -- resume dump at index @idx | ||
955 | * | ||
956 | * @add_mpath: add a fixed mesh path | ||
957 | * @del_mpath: delete a given mesh path | ||
958 | * @change_mpath: change a given mesh path | ||
959 | * @get_mpath: get a mesh path for the given parameters | ||
960 | * @dump_mpath: dump mesh path callback -- resume dump at index @idx | ||
956 | * | 961 | * |
957 | * @get_mesh_params: Put the current mesh parameters into *params | 962 | * @get_mesh_params: Put the current mesh parameters into *params |
958 | * | 963 | * |
@@ -960,8 +965,6 @@ struct cfg80211_pmksa { | |||
960 | * The mask is a bitfield which tells us which parameters to | 965 | * The mask is a bitfield which tells us which parameters to |
961 | * set, and which to leave alone. | 966 | * set, and which to leave alone. |
962 | * | 967 | * |
963 | * @set_mesh_cfg: set mesh parameters (by now, just mesh id) | ||
964 | * | ||
965 | * @change_bss: Modify parameters for a given BSS. | 968 | * @change_bss: Modify parameters for a given BSS. |
966 | * | 969 | * |
967 | * @set_txq_params: Set TX queue parameters | 970 | * @set_txq_params: Set TX queue parameters |
@@ -1002,6 +1005,8 @@ struct cfg80211_pmksa { | |||
1002 | * @get_tx_power: store the current TX power into the dbm variable; | 1005 | * @get_tx_power: store the current TX power into the dbm variable; |
1003 | * return 0 if successful | 1006 | * return 0 if successful |
1004 | * | 1007 | * |
1008 | * @set_wds_peer: set the WDS peer for a WDS interface | ||
1009 | * | ||
1005 | * @rfkill_poll: polls the hw rfkill line, use cfg80211 reporting | 1010 | * @rfkill_poll: polls the hw rfkill line, use cfg80211 reporting |
1006 | * functions to adjust rfkill hw state | 1011 | * functions to adjust rfkill hw state |
1007 | * | 1012 | * |
@@ -1019,6 +1024,8 @@ struct cfg80211_pmksa { | |||
1019 | * | 1024 | * |
1020 | * @testmode_cmd: run a test mode command | 1025 | * @testmode_cmd: run a test mode command |
1021 | * | 1026 | * |
1027 | * @set_bitrate_mask: set the bitrate mask configuration | ||
1028 | * | ||
1022 | * @set_pmksa: Cache a PMKID for a BSSID. This is mostly useful for fullmac | 1029 | * @set_pmksa: Cache a PMKID for a BSSID. This is mostly useful for fullmac |
1023 | * devices running firmwares capable of generating the (re) association | 1030 | * devices running firmwares capable of generating the (re) association |
1024 | * RSN IE. It allows for faster roaming between WPA2 BSSIDs. | 1031 | * RSN IE. It allows for faster roaming between WPA2 BSSIDs. |
@@ -1129,7 +1136,7 @@ struct cfg80211_ops { | |||
1129 | int (*set_wiphy_params)(struct wiphy *wiphy, u32 changed); | 1136 | int (*set_wiphy_params)(struct wiphy *wiphy, u32 changed); |
1130 | 1137 | ||
1131 | int (*set_tx_power)(struct wiphy *wiphy, | 1138 | int (*set_tx_power)(struct wiphy *wiphy, |
1132 | enum tx_power_setting type, int dbm); | 1139 | enum nl80211_tx_power_setting type, int mbm); |
1133 | int (*get_tx_power)(struct wiphy *wiphy, int *dbm); | 1140 | int (*get_tx_power)(struct wiphy *wiphy, int *dbm); |
1134 | 1141 | ||
1135 | int (*set_wds_peer)(struct wiphy *wiphy, struct net_device *dev, | 1142 | int (*set_wds_peer)(struct wiphy *wiphy, struct net_device *dev, |
@@ -1168,6 +1175,7 @@ struct cfg80211_ops { | |||
1168 | int (*action)(struct wiphy *wiphy, struct net_device *dev, | 1175 | int (*action)(struct wiphy *wiphy, struct net_device *dev, |
1169 | struct ieee80211_channel *chan, | 1176 | struct ieee80211_channel *chan, |
1170 | enum nl80211_channel_type channel_type, | 1177 | enum nl80211_channel_type channel_type, |
1178 | bool channel_type_valid, | ||
1171 | const u8 *buf, size_t len, u64 *cookie); | 1179 | const u8 *buf, size_t len, u64 *cookie); |
1172 | 1180 | ||
1173 | int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev, | 1181 | int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev, |
@@ -1230,8 +1238,6 @@ struct mac_address { | |||
1230 | 1238 | ||
1231 | /** | 1239 | /** |
1232 | * struct wiphy - wireless hardware description | 1240 | * struct wiphy - wireless hardware description |
1233 | * @idx: the wiphy index assigned to this item | ||
1234 | * @class_dev: the class device representing /sys/class/ieee80211/<wiphy-name> | ||
1235 | * @reg_notifier: the driver's regulatory notification callback | 1241 | * @reg_notifier: the driver's regulatory notification callback |
1236 | * @regd: the driver's regulatory domain, if one was requested via | 1242 | * @regd: the driver's regulatory domain, if one was requested via |
1237 | * the regulatory_hint() API. This can be used by the driver | 1243 | * the regulatory_hint() API. This can be used by the driver |
@@ -1245,7 +1251,7 @@ struct mac_address { | |||
1245 | * @frag_threshold: Fragmentation threshold (dot11FragmentationThreshold); | 1251 | * @frag_threshold: Fragmentation threshold (dot11FragmentationThreshold); |
1246 | * -1 = fragmentation disabled, only odd values >= 256 used | 1252 | * -1 = fragmentation disabled, only odd values >= 256 used |
1247 | * @rts_threshold: RTS threshold (dot11RTSThreshold); -1 = RTS/CTS disabled | 1253 | * @rts_threshold: RTS threshold (dot11RTSThreshold); -1 = RTS/CTS disabled |
1248 | * @net: the network namespace this wiphy currently lives in | 1254 | * @_net: the network namespace this wiphy currently lives in |
1249 | * @perm_addr: permanent MAC address of this device | 1255 | * @perm_addr: permanent MAC address of this device |
1250 | * @addr_mask: If the device supports multiple MAC addresses by masking, | 1256 | * @addr_mask: If the device supports multiple MAC addresses by masking, |
1251 | * set this to a mask with variable bits set to 1, e.g. if the last | 1257 | * set this to a mask with variable bits set to 1, e.g. if the last |
@@ -1258,6 +1264,28 @@ struct mac_address { | |||
1258 | * by default for perm_addr. In this case, the mask should be set to | 1264 | * by default for perm_addr. In this case, the mask should be set to |
1259 | * all-zeroes. In this case it is assumed that the device can handle | 1265 | * all-zeroes. In this case it is assumed that the device can handle |
1260 | * the same number of arbitrary MAC addresses. | 1266 | * the same number of arbitrary MAC addresses. |
1267 | * @debugfsdir: debugfs directory used for this wiphy, will be renamed | ||
1268 | * automatically on wiphy renames | ||
1269 | * @dev: (virtual) struct device for this wiphy | ||
1270 | * @wext: wireless extension handlers | ||
1271 | * @priv: driver private data (sized according to wiphy_new() parameter) | ||
1272 | * @interface_modes: bitmask of interfaces types valid for this wiphy, | ||
1273 | * must be set by driver | ||
1274 | * @flags: wiphy flags, see &enum wiphy_flags | ||
1275 | * @bss_priv_size: each BSS struct has private data allocated with it, | ||
1276 | * this variable determines its size | ||
1277 | * @max_scan_ssids: maximum number of SSIDs the device can scan for in | ||
1278 | * any given scan | ||
1279 | * @max_scan_ie_len: maximum length of user-controlled IEs device can | ||
1280 | * add to probe request frames transmitted during a scan, must not | ||
1281 | * include fixed IEs like supported rates | ||
1282 | * @coverage_class: current coverage class | ||
1283 | * @fw_version: firmware version for ethtool reporting | ||
1284 | * @hw_version: hardware version for ethtool reporting | ||
1285 | * @max_num_pmkids: maximum number of PMKIDs supported by device | ||
1286 | * @privid: a pointer that drivers can use to identify if an arbitrary | ||
1287 | * wiphy is theirs, e.g. in global notifiers | ||
1288 | * @bands: information about bands/channels supported by this device | ||
1261 | */ | 1289 | */ |
1262 | struct wiphy { | 1290 | struct wiphy { |
1263 | /* assign these fields before you register the wiphy */ | 1291 | /* assign these fields before you register the wiphy */ |
@@ -1330,27 +1358,16 @@ struct wiphy { | |||
1330 | char priv[0] __attribute__((__aligned__(NETDEV_ALIGN))); | 1358 | char priv[0] __attribute__((__aligned__(NETDEV_ALIGN))); |
1331 | }; | 1359 | }; |
1332 | 1360 | ||
1333 | #ifdef CONFIG_NET_NS | ||
1334 | static inline struct net *wiphy_net(struct wiphy *wiphy) | 1361 | static inline struct net *wiphy_net(struct wiphy *wiphy) |
1335 | { | 1362 | { |
1336 | return wiphy->_net; | 1363 | return read_pnet(&wiphy->_net); |
1337 | } | 1364 | } |
1338 | 1365 | ||
1339 | static inline void wiphy_net_set(struct wiphy *wiphy, struct net *net) | 1366 | static inline void wiphy_net_set(struct wiphy *wiphy, struct net *net) |
1340 | { | 1367 | { |
1341 | wiphy->_net = net; | 1368 | write_pnet(&wiphy->_net, net); |
1342 | } | ||
1343 | #else | ||
1344 | static inline struct net *wiphy_net(struct wiphy *wiphy) | ||
1345 | { | ||
1346 | return &init_net; | ||
1347 | } | 1369 | } |
1348 | 1370 | ||
1349 | static inline void wiphy_net_set(struct wiphy *wiphy, struct net *net) | ||
1350 | { | ||
1351 | } | ||
1352 | #endif | ||
1353 | |||
1354 | /** | 1371 | /** |
1355 | * wiphy_priv - return priv from wiphy | 1372 | * wiphy_priv - return priv from wiphy |
1356 | * | 1373 | * |
@@ -1399,7 +1416,7 @@ static inline struct device *wiphy_dev(struct wiphy *wiphy) | |||
1399 | * | 1416 | * |
1400 | * @wiphy: The wiphy whose name to return | 1417 | * @wiphy: The wiphy whose name to return |
1401 | */ | 1418 | */ |
1402 | static inline const char *wiphy_name(struct wiphy *wiphy) | 1419 | static inline const char *wiphy_name(const struct wiphy *wiphy) |
1403 | { | 1420 | { |
1404 | return dev_name(&wiphy->dev); | 1421 | return dev_name(&wiphy->dev); |
1405 | } | 1422 | } |
@@ -1471,13 +1488,14 @@ struct cfg80211_cached_keys; | |||
1471 | * @ssid: (private) Used by the internal configuration code | 1488 | * @ssid: (private) Used by the internal configuration code |
1472 | * @ssid_len: (private) Used by the internal configuration code | 1489 | * @ssid_len: (private) Used by the internal configuration code |
1473 | * @wext: (private) Used by the internal wireless extensions compat code | 1490 | * @wext: (private) Used by the internal wireless extensions compat code |
1474 | * @wext_bssid: (private) Used by the internal wireless extensions compat code | ||
1475 | * @use_4addr: indicates 4addr mode is used on this interface, must be | 1491 | * @use_4addr: indicates 4addr mode is used on this interface, must be |
1476 | * set by driver (if supported) on add_interface BEFORE registering the | 1492 | * set by driver (if supported) on add_interface BEFORE registering the |
1477 | * netdev and may otherwise be used by driver read-only, will be update | 1493 | * netdev and may otherwise be used by driver read-only, will be update |
1478 | * by cfg80211 on change_interface | 1494 | * by cfg80211 on change_interface |
1479 | * @action_registrations: list of registrations for action frames | 1495 | * @action_registrations: list of registrations for action frames |
1480 | * @action_registrations_lock: lock for the list | 1496 | * @action_registrations_lock: lock for the list |
1497 | * @mtx: mutex used to lock data in this struct | ||
1498 | * @cleanup_work: work struct used for cleanup that can't be done directly | ||
1481 | */ | 1499 | */ |
1482 | struct wireless_dev { | 1500 | struct wireless_dev { |
1483 | struct wiphy *wiphy; | 1501 | struct wiphy *wiphy; |
@@ -1551,11 +1569,13 @@ static inline void *wdev_priv(struct wireless_dev *wdev) | |||
1551 | 1569 | ||
1552 | /** | 1570 | /** |
1553 | * ieee80211_channel_to_frequency - convert channel number to frequency | 1571 | * ieee80211_channel_to_frequency - convert channel number to frequency |
1572 | * @chan: channel number | ||
1554 | */ | 1573 | */ |
1555 | extern int ieee80211_channel_to_frequency(int chan); | 1574 | extern int ieee80211_channel_to_frequency(int chan); |
1556 | 1575 | ||
1557 | /** | 1576 | /** |
1558 | * ieee80211_frequency_to_channel - convert frequency to channel number | 1577 | * ieee80211_frequency_to_channel - convert frequency to channel number |
1578 | * @freq: center frequency | ||
1559 | */ | 1579 | */ |
1560 | extern int ieee80211_frequency_to_channel(int freq); | 1580 | extern int ieee80211_frequency_to_channel(int freq); |
1561 | 1581 | ||
@@ -1570,6 +1590,8 @@ extern struct ieee80211_channel *__ieee80211_get_channel(struct wiphy *wiphy, | |||
1570 | int freq); | 1590 | int freq); |
1571 | /** | 1591 | /** |
1572 | * ieee80211_get_channel - get channel struct from wiphy for specified frequency | 1592 | * ieee80211_get_channel - get channel struct from wiphy for specified frequency |
1593 | * @wiphy: the struct wiphy to get the channel for | ||
1594 | * @freq: the center frequency of the channel | ||
1573 | */ | 1595 | */ |
1574 | static inline struct ieee80211_channel * | 1596 | static inline struct ieee80211_channel * |
1575 | ieee80211_get_channel(struct wiphy *wiphy, int freq) | 1597 | ieee80211_get_channel(struct wiphy *wiphy, int freq) |
@@ -1630,9 +1652,6 @@ struct ieee80211_radiotap_vendor_namespaces { | |||
1630 | * @is_radiotap_ns: indicates whether the current namespace is the default | 1652 | * @is_radiotap_ns: indicates whether the current namespace is the default |
1631 | * radiotap namespace or not | 1653 | * radiotap namespace or not |
1632 | * | 1654 | * |
1633 | * @overrides: override standard radiotap fields | ||
1634 | * @n_overrides: number of overrides | ||
1635 | * | ||
1636 | * @_rtheader: pointer to the radiotap header we are walking through | 1655 | * @_rtheader: pointer to the radiotap header we are walking through |
1637 | * @_max_length: length of radiotap header in cpu byte ordering | 1656 | * @_max_length: length of radiotap header in cpu byte ordering |
1638 | * @_arg_index: next argument index | 1657 | * @_arg_index: next argument index |
@@ -1933,6 +1952,10 @@ int cfg80211_wext_giwap(struct net_device *dev, | |||
1933 | struct iw_request_info *info, | 1952 | struct iw_request_info *info, |
1934 | struct sockaddr *ap_addr, char *extra); | 1953 | struct sockaddr *ap_addr, char *extra); |
1935 | 1954 | ||
1955 | int cfg80211_wext_siwpmksa(struct net_device *dev, | ||
1956 | struct iw_request_info *info, | ||
1957 | struct iw_point *data, char *extra); | ||
1958 | |||
1936 | /* | 1959 | /* |
1937 | * callbacks for asynchronous cfg80211 methods, notification | 1960 | * callbacks for asynchronous cfg80211 methods, notification |
1938 | * functions and BSS handling helpers | 1961 | * functions and BSS handling helpers |
@@ -1948,10 +1971,12 @@ int cfg80211_wext_giwap(struct net_device *dev, | |||
1948 | void cfg80211_scan_done(struct cfg80211_scan_request *request, bool aborted); | 1971 | void cfg80211_scan_done(struct cfg80211_scan_request *request, bool aborted); |
1949 | 1972 | ||
1950 | /** | 1973 | /** |
1951 | * cfg80211_inform_bss - inform cfg80211 of a new BSS | 1974 | * cfg80211_inform_bss_frame - inform cfg80211 of a received BSS frame |
1952 | * | 1975 | * |
1953 | * @wiphy: the wiphy reporting the BSS | 1976 | * @wiphy: the wiphy reporting the BSS |
1954 | * @bss: the found BSS | 1977 | * @channel: The channel the frame was received on |
1978 | * @mgmt: the management frame (probe response or beacon) | ||
1979 | * @len: length of the management frame | ||
1955 | * @signal: the signal strength, type depends on the wiphy's signal_type | 1980 | * @signal: the signal strength, type depends on the wiphy's signal_type |
1956 | * @gfp: context flags | 1981 | * @gfp: context flags |
1957 | * | 1982 | * |
@@ -1964,6 +1989,23 @@ cfg80211_inform_bss_frame(struct wiphy *wiphy, | |||
1964 | struct ieee80211_mgmt *mgmt, size_t len, | 1989 | struct ieee80211_mgmt *mgmt, size_t len, |
1965 | s32 signal, gfp_t gfp); | 1990 | s32 signal, gfp_t gfp); |
1966 | 1991 | ||
1992 | /** | ||
1993 | * cfg80211_inform_bss - inform cfg80211 of a new BSS | ||
1994 | * | ||
1995 | * @wiphy: the wiphy reporting the BSS | ||
1996 | * @channel: The channel the frame was received on | ||
1997 | * @bssid: the BSSID of the BSS | ||
1998 | * @timestamp: the TSF timestamp sent by the peer | ||
1999 | * @capability: the capability field sent by the peer | ||
2000 | * @beacon_interval: the beacon interval announced by the peer | ||
2001 | * @ie: additional IEs sent by the peer | ||
2002 | * @ielen: length of the additional IEs | ||
2003 | * @signal: the signal strength, type depends on the wiphy's signal_type | ||
2004 | * @gfp: context flags | ||
2005 | * | ||
2006 | * This informs cfg80211 that BSS information was found and | ||
2007 | * the BSS should be updated/added. | ||
2008 | */ | ||
1967 | struct cfg80211_bss* | 2009 | struct cfg80211_bss* |
1968 | cfg80211_inform_bss(struct wiphy *wiphy, | 2010 | cfg80211_inform_bss(struct wiphy *wiphy, |
1969 | struct ieee80211_channel *channel, | 2011 | struct ieee80211_channel *channel, |
@@ -2378,4 +2420,67 @@ void cfg80211_cqm_rssi_notify(struct net_device *dev, | |||
2378 | enum nl80211_cqm_rssi_threshold_event rssi_event, | 2420 | enum nl80211_cqm_rssi_threshold_event rssi_event, |
2379 | gfp_t gfp); | 2421 | gfp_t gfp); |
2380 | 2422 | ||
2423 | #ifdef __KERNEL__ | ||
2424 | |||
2425 | /* Logging, debugging and troubleshooting/diagnostic helpers. */ | ||
2426 | |||
2427 | /* wiphy_printk helpers, similar to dev_printk */ | ||
2428 | |||
2429 | #define wiphy_printk(level, wiphy, format, args...) \ | ||
2430 | printk(level "%s: " format, wiphy_name(wiphy), ##args) | ||
2431 | #define wiphy_emerg(wiphy, format, args...) \ | ||
2432 | wiphy_printk(KERN_EMERG, wiphy, format, ##args) | ||
2433 | #define wiphy_alert(wiphy, format, args...) \ | ||
2434 | wiphy_printk(KERN_ALERT, wiphy, format, ##args) | ||
2435 | #define wiphy_crit(wiphy, format, args...) \ | ||
2436 | wiphy_printk(KERN_CRIT, wiphy, format, ##args) | ||
2437 | #define wiphy_err(wiphy, format, args...) \ | ||
2438 | wiphy_printk(KERN_ERR, wiphy, format, ##args) | ||
2439 | #define wiphy_warn(wiphy, format, args...) \ | ||
2440 | wiphy_printk(KERN_WARNING, wiphy, format, ##args) | ||
2441 | #define wiphy_notice(wiphy, format, args...) \ | ||
2442 | wiphy_printk(KERN_NOTICE, wiphy, format, ##args) | ||
2443 | #define wiphy_info(wiphy, format, args...) \ | ||
2444 | wiphy_printk(KERN_INFO, wiphy, format, ##args) | ||
2445 | |||
2446 | int wiphy_debug(const struct wiphy *wiphy, const char *format, ...) | ||
2447 | __attribute__ ((format (printf, 2, 3))); | ||
2448 | |||
2449 | #if defined(DEBUG) | ||
2450 | #define wiphy_dbg(wiphy, format, args...) \ | ||
2451 | wiphy_printk(KERN_DEBUG, wiphy, format, ##args) | ||
2452 | #elif defined(CONFIG_DYNAMIC_DEBUG) | ||
2453 | #define wiphy_dbg(wiphy, format, args...) \ | ||
2454 | dynamic_pr_debug("%s: " format, wiphy_name(wiphy), ##args) | ||
2455 | #else | ||
2456 | #define wiphy_dbg(wiphy, format, args...) \ | ||
2457 | ({ \ | ||
2458 | if (0) \ | ||
2459 | wiphy_printk(KERN_DEBUG, wiphy, format, ##args); \ | ||
2460 | 0; \ | ||
2461 | }) | ||
2462 | #endif | ||
2463 | |||
2464 | #if defined(VERBOSE_DEBUG) | ||
2465 | #define wiphy_vdbg wiphy_dbg | ||
2466 | #else | ||
2467 | |||
2468 | #define wiphy_vdbg(wiphy, format, args...) \ | ||
2469 | ({ \ | ||
2470 | if (0) \ | ||
2471 | wiphy_printk(KERN_DEBUG, wiphy, format, ##args); \ | ||
2472 | 0; \ | ||
2473 | }) | ||
2474 | #endif | ||
2475 | |||
2476 | /* | ||
2477 | * wiphy_WARN() acts like wiphy_printk(), but with the key difference | ||
2478 | * of using a WARN/WARN_ON to get the message out, including the | ||
2479 | * file/line information and a backtrace. | ||
2480 | */ | ||
2481 | #define wiphy_WARN(wiphy, format, args...) \ | ||
2482 | WARN(1, "wiphy: %s\n" format, wiphy_name(wiphy), ##args); | ||
2483 | |||
2484 | #endif | ||
2485 | |||
2381 | #endif /* __NET_CFG80211_H */ | 2486 | #endif /* __NET_CFG80211_H */ |