diff options
| author | David S. Miller <davem@davemloft.net> | 2015-03-31 16:39:04 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2015-03-31 16:39:04 -0400 |
| commit | 7b6249bba940f57c20cdde793b306ca3831778c7 (patch) | |
| tree | 24caf2ec9ea6fca08fe225228614807d0919b4b2 /include | |
| parent | fbcb21705930f2930f506149d0b8d36dfbe45107 (diff) | |
| parent | 2c44be81f0fc147eed9dc63e2601318b2c007aeb (diff) | |
Merge tag 'mac80211-next-for-davem-2015-03-30' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
Johannes Berg says:
====================
Lots of updates for net-next; along with the usual flurry
of small fixes, cleanups and internal features we have:
* VHT support for TDLS and IBSS (conditional on drivers though)
* first TX performance improvements (the biggest will come later)
* many suspend/resume (race) fixes
* name_assign_type support from Tom Gundersen
====================
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
| -rw-r--r-- | include/net/cfg80211.h | 65 | ||||
| -rw-r--r-- | include/net/iw_handler.h | 22 | ||||
| -rw-r--r-- | include/net/mac80211.h | 150 | ||||
| -rw-r--r-- | include/uapi/linux/nl80211.h | 34 |
4 files changed, 244 insertions, 27 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index f977abec07f6..441306436569 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
| @@ -215,6 +215,39 @@ enum ieee80211_rate_flags { | |||
| 215 | }; | 215 | }; |
| 216 | 216 | ||
| 217 | /** | 217 | /** |
| 218 | * enum ieee80211_bss_type - BSS type filter | ||
| 219 | * | ||
| 220 | * @IEEE80211_BSS_TYPE_ESS: Infrastructure BSS | ||
| 221 | * @IEEE80211_BSS_TYPE_PBSS: Personal BSS | ||
| 222 | * @IEEE80211_BSS_TYPE_IBSS: Independent BSS | ||
| 223 | * @IEEE80211_BSS_TYPE_MBSS: Mesh BSS | ||
| 224 | * @IEEE80211_BSS_TYPE_ANY: Wildcard value for matching any BSS type | ||
| 225 | */ | ||
| 226 | enum ieee80211_bss_type { | ||
| 227 | IEEE80211_BSS_TYPE_ESS, | ||
| 228 | IEEE80211_BSS_TYPE_PBSS, | ||
| 229 | IEEE80211_BSS_TYPE_IBSS, | ||
| 230 | IEEE80211_BSS_TYPE_MBSS, | ||
| 231 | IEEE80211_BSS_TYPE_ANY | ||
| 232 | }; | ||
| 233 | |||
| 234 | /** | ||
| 235 | * enum ieee80211_privacy - BSS privacy filter | ||
| 236 | * | ||
| 237 | * @IEEE80211_PRIVACY_ON: privacy bit set | ||
| 238 | * @IEEE80211_PRIVACY_OFF: privacy bit clear | ||
| 239 | * @IEEE80211_PRIVACY_ANY: Wildcard value for matching any privacy setting | ||
| 240 | */ | ||
| 241 | enum ieee80211_privacy { | ||
| 242 | IEEE80211_PRIVACY_ON, | ||
| 243 | IEEE80211_PRIVACY_OFF, | ||
| 244 | IEEE80211_PRIVACY_ANY | ||
| 245 | }; | ||
| 246 | |||
| 247 | #define IEEE80211_PRIVACY(x) \ | ||
| 248 | ((x) ? IEEE80211_PRIVACY_ON : IEEE80211_PRIVACY_OFF) | ||
| 249 | |||
| 250 | /** | ||
| 218 | * struct ieee80211_rate - bitrate definition | 251 | * struct ieee80211_rate - bitrate definition |
| 219 | * | 252 | * |
| 220 | * This structure describes a bitrate that an 802.11 PHY can | 253 | * This structure describes a bitrate that an 802.11 PHY can |
| @@ -2423,6 +2456,7 @@ struct cfg80211_ops { | |||
| 2423 | 2456 | ||
| 2424 | struct wireless_dev * (*add_virtual_intf)(struct wiphy *wiphy, | 2457 | struct wireless_dev * (*add_virtual_intf)(struct wiphy *wiphy, |
| 2425 | const char *name, | 2458 | const char *name, |
| 2459 | unsigned char name_assign_type, | ||
| 2426 | enum nl80211_iftype type, | 2460 | enum nl80211_iftype type, |
| 2427 | u32 *flags, | 2461 | u32 *flags, |
| 2428 | struct vif_params *params); | 2462 | struct vif_params *params); |
| @@ -4010,14 +4044,16 @@ struct cfg80211_bss *cfg80211_get_bss(struct wiphy *wiphy, | |||
| 4010 | struct ieee80211_channel *channel, | 4044 | struct ieee80211_channel *channel, |
| 4011 | const u8 *bssid, | 4045 | const u8 *bssid, |
| 4012 | const u8 *ssid, size_t ssid_len, | 4046 | const u8 *ssid, size_t ssid_len, |
| 4013 | u16 capa_mask, u16 capa_val); | 4047 | enum ieee80211_bss_type bss_type, |
| 4048 | enum ieee80211_privacy); | ||
| 4014 | static inline struct cfg80211_bss * | 4049 | static inline struct cfg80211_bss * |
| 4015 | cfg80211_get_ibss(struct wiphy *wiphy, | 4050 | cfg80211_get_ibss(struct wiphy *wiphy, |
| 4016 | struct ieee80211_channel *channel, | 4051 | struct ieee80211_channel *channel, |
| 4017 | const u8 *ssid, size_t ssid_len) | 4052 | const u8 *ssid, size_t ssid_len) |
| 4018 | { | 4053 | { |
| 4019 | return cfg80211_get_bss(wiphy, channel, NULL, ssid, ssid_len, | 4054 | return cfg80211_get_bss(wiphy, channel, NULL, ssid, ssid_len, |
| 4020 | WLAN_CAPABILITY_IBSS, WLAN_CAPABILITY_IBSS); | 4055 | IEEE80211_BSS_TYPE_IBSS, |
| 4056 | IEEE80211_PRIVACY_ANY); | ||
| 4021 | } | 4057 | } |
| 4022 | 4058 | ||
| 4023 | /** | 4059 | /** |
| @@ -4258,6 +4294,7 @@ struct sk_buff *__cfg80211_alloc_reply_skb(struct wiphy *wiphy, | |||
| 4258 | int approxlen); | 4294 | int approxlen); |
| 4259 | 4295 | ||
| 4260 | struct sk_buff *__cfg80211_alloc_event_skb(struct wiphy *wiphy, | 4296 | struct sk_buff *__cfg80211_alloc_event_skb(struct wiphy *wiphy, |
| 4297 | struct wireless_dev *wdev, | ||
| 4261 | enum nl80211_commands cmd, | 4298 | enum nl80211_commands cmd, |
| 4262 | enum nl80211_attrs attr, | 4299 | enum nl80211_attrs attr, |
| 4263 | int vendor_event_idx, | 4300 | int vendor_event_idx, |
| @@ -4312,6 +4349,7 @@ int cfg80211_vendor_cmd_reply(struct sk_buff *skb); | |||
| 4312 | /** | 4349 | /** |
| 4313 | * cfg80211_vendor_event_alloc - allocate vendor-specific event skb | 4350 | * cfg80211_vendor_event_alloc - allocate vendor-specific event skb |
| 4314 | * @wiphy: the wiphy | 4351 | * @wiphy: the wiphy |
| 4352 | * @wdev: the wireless device | ||
| 4315 | * @event_idx: index of the vendor event in the wiphy's vendor_events | 4353 | * @event_idx: index of the vendor event in the wiphy's vendor_events |
| 4316 | * @approxlen: an upper bound of the length of the data that will | 4354 | * @approxlen: an upper bound of the length of the data that will |
| 4317 | * be put into the skb | 4355 | * be put into the skb |
| @@ -4320,16 +4358,20 @@ int cfg80211_vendor_cmd_reply(struct sk_buff *skb); | |||
| 4320 | * This function allocates and pre-fills an skb for an event on the | 4358 | * This function allocates and pre-fills an skb for an event on the |
| 4321 | * vendor-specific multicast group. | 4359 | * vendor-specific multicast group. |
| 4322 | * | 4360 | * |
| 4361 | * If wdev != NULL, both the ifindex and identifier of the specified | ||
| 4362 | * wireless device are added to the event message before the vendor data | ||
| 4363 | * attribute. | ||
| 4364 | * | ||
| 4323 | * When done filling the skb, call cfg80211_vendor_event() with the | 4365 | * When done filling the skb, call cfg80211_vendor_event() with the |
| 4324 | * skb to send the event. | 4366 | * skb to send the event. |
| 4325 | * | 4367 | * |
| 4326 | * Return: An allocated and pre-filled skb. %NULL if any errors happen. | 4368 | * Return: An allocated and pre-filled skb. %NULL if any errors happen. |
| 4327 | */ | 4369 | */ |
| 4328 | static inline struct sk_buff * | 4370 | static inline struct sk_buff * |
| 4329 | cfg80211_vendor_event_alloc(struct wiphy *wiphy, int approxlen, | 4371 | cfg80211_vendor_event_alloc(struct wiphy *wiphy, struct wireless_dev *wdev, |
| 4330 | int event_idx, gfp_t gfp) | 4372 | int approxlen, int event_idx, gfp_t gfp) |
| 4331 | { | 4373 | { |
| 4332 | return __cfg80211_alloc_event_skb(wiphy, NL80211_CMD_VENDOR, | 4374 | return __cfg80211_alloc_event_skb(wiphy, wdev, NL80211_CMD_VENDOR, |
| 4333 | NL80211_ATTR_VENDOR_DATA, | 4375 | NL80211_ATTR_VENDOR_DATA, |
| 4334 | event_idx, approxlen, gfp); | 4376 | event_idx, approxlen, gfp); |
| 4335 | } | 4377 | } |
| @@ -4430,7 +4472,7 @@ static inline int cfg80211_testmode_reply(struct sk_buff *skb) | |||
| 4430 | static inline struct sk_buff * | 4472 | static inline struct sk_buff * |
| 4431 | cfg80211_testmode_alloc_event_skb(struct wiphy *wiphy, int approxlen, gfp_t gfp) | 4473 | cfg80211_testmode_alloc_event_skb(struct wiphy *wiphy, int approxlen, gfp_t gfp) |
| 4432 | { | 4474 | { |
| 4433 | return __cfg80211_alloc_event_skb(wiphy, NL80211_CMD_TESTMODE, | 4475 | return __cfg80211_alloc_event_skb(wiphy, NULL, NL80211_CMD_TESTMODE, |
| 4434 | NL80211_ATTR_TESTDATA, -1, | 4476 | NL80211_ATTR_TESTDATA, -1, |
| 4435 | approxlen, gfp); | 4477 | approxlen, gfp); |
| 4436 | } | 4478 | } |
| @@ -4860,6 +4902,17 @@ void cfg80211_ch_switch_started_notify(struct net_device *dev, | |||
| 4860 | bool ieee80211_operating_class_to_band(u8 operating_class, | 4902 | bool ieee80211_operating_class_to_band(u8 operating_class, |
| 4861 | enum ieee80211_band *band); | 4903 | enum ieee80211_band *band); |
| 4862 | 4904 | ||
| 4905 | /** | ||
| 4906 | * ieee80211_chandef_to_operating_class - convert chandef to operation class | ||
| 4907 | * | ||
| 4908 | * @chandef: the chandef to convert | ||
| 4909 | * @op_class: a pointer to the resulting operating class | ||
| 4910 | * | ||
| 4911 | * Returns %true if the conversion was successful, %false otherwise. | ||
| 4912 | */ | ||
| 4913 | bool ieee80211_chandef_to_operating_class(struct cfg80211_chan_def *chandef, | ||
| 4914 | u8 *op_class); | ||
| 4915 | |||
| 4863 | /* | 4916 | /* |
| 4864 | * cfg80211_tdls_oper_request - request userspace to perform TDLS operation | 4917 | * cfg80211_tdls_oper_request - request userspace to perform TDLS operation |
| 4865 | * @dev: the device on which the operation is requested | 4918 | * @dev: the device on which the operation is requested |
diff --git a/include/net/iw_handler.h b/include/net/iw_handler.h index a830b01baba4..8f81bbbc38fc 100644 --- a/include/net/iw_handler.h +++ b/include/net/iw_handler.h | |||
| @@ -519,6 +519,17 @@ iwe_stream_add_event(struct iw_request_info *info, char *stream, char *ends, | |||
| 519 | return stream; | 519 | return stream; |
| 520 | } | 520 | } |
| 521 | 521 | ||
| 522 | static inline char * | ||
| 523 | iwe_stream_add_event_check(struct iw_request_info *info, char *stream, | ||
| 524 | char *ends, struct iw_event *iwe, int event_len) | ||
| 525 | { | ||
| 526 | char *res = iwe_stream_add_event(info, stream, ends, iwe, event_len); | ||
| 527 | |||
| 528 | if (res == stream) | ||
| 529 | return ERR_PTR(-E2BIG); | ||
| 530 | return res; | ||
| 531 | } | ||
| 532 | |||
| 522 | /*------------------------------------------------------------------*/ | 533 | /*------------------------------------------------------------------*/ |
| 523 | /* | 534 | /* |
| 524 | * Wrapper to add an short Wireless Event containing a pointer to a | 535 | * Wrapper to add an short Wireless Event containing a pointer to a |
| @@ -545,6 +556,17 @@ iwe_stream_add_point(struct iw_request_info *info, char *stream, char *ends, | |||
| 545 | return stream; | 556 | return stream; |
| 546 | } | 557 | } |
| 547 | 558 | ||
| 559 | static inline char * | ||
| 560 | iwe_stream_add_point_check(struct iw_request_info *info, char *stream, | ||
| 561 | char *ends, struct iw_event *iwe, char *extra) | ||
| 562 | { | ||
| 563 | char *res = iwe_stream_add_point(info, stream, ends, iwe, extra); | ||
| 564 | |||
| 565 | if (res == stream) | ||
| 566 | return ERR_PTR(-E2BIG); | ||
| 567 | return res; | ||
| 568 | } | ||
| 569 | |||
| 548 | /*------------------------------------------------------------------*/ | 570 | /*------------------------------------------------------------------*/ |
| 549 | /* | 571 | /* |
| 550 | * Wrapper to add a value to a Wireless Event in a stream of events. | 572 | * Wrapper to add a value to a Wireless Event in a stream of events. |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index d52914b75331..201bc68e0cff 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
| @@ -301,17 +301,86 @@ enum ieee80211_bss_change { | |||
| 301 | #define IEEE80211_BSS_ARP_ADDR_LIST_LEN 4 | 301 | #define IEEE80211_BSS_ARP_ADDR_LIST_LEN 4 |
| 302 | 302 | ||
| 303 | /** | 303 | /** |
| 304 | * enum ieee80211_rssi_event - RSSI threshold event | 304 | * enum ieee80211_event_type - event to be notified to the low level driver |
| 305 | * An indicator for when RSSI goes below/above a certain threshold. | 305 | * @RSSI_EVENT: AP's rssi crossed the a threshold set by the driver. |
| 306 | * @RSSI_EVENT_HIGH: AP's rssi crossed the high threshold set by the driver. | 306 | * @MLME_EVENT: event related to MLME |
| 307 | * @RSSI_EVENT_LOW: AP's rssi crossed the low threshold set by the driver. | ||
| 308 | */ | 307 | */ |
| 309 | enum ieee80211_rssi_event { | 308 | enum ieee80211_event_type { |
| 309 | RSSI_EVENT, | ||
| 310 | MLME_EVENT, | ||
| 311 | }; | ||
| 312 | |||
| 313 | /** | ||
| 314 | * enum ieee80211_rssi_event_data - relevant when event type is %RSSI_EVENT | ||
| 315 | * @RSSI_EVENT_HIGH: AP's rssi went below the threshold set by the driver. | ||
| 316 | * @RSSI_EVENT_LOW: AP's rssi went above the threshold set by the driver. | ||
| 317 | */ | ||
| 318 | enum ieee80211_rssi_event_data { | ||
| 310 | RSSI_EVENT_HIGH, | 319 | RSSI_EVENT_HIGH, |
| 311 | RSSI_EVENT_LOW, | 320 | RSSI_EVENT_LOW, |
| 312 | }; | 321 | }; |
| 313 | 322 | ||
| 314 | /** | 323 | /** |
| 324 | * enum ieee80211_rssi_event - data attached to an %RSSI_EVENT | ||
| 325 | * @data: See &enum ieee80211_rssi_event_data | ||
| 326 | */ | ||
| 327 | struct ieee80211_rssi_event { | ||
| 328 | enum ieee80211_rssi_event_data data; | ||
| 329 | }; | ||
| 330 | |||
| 331 | /** | ||
| 332 | * enum ieee80211_mlme_event_data - relevant when event type is %MLME_EVENT | ||
| 333 | * @AUTH_EVENT: the MLME operation is authentication | ||
| 334 | * @ASSOC_EVENT: the MLME operation is association | ||
| 335 | * @DEAUTH_RX_EVENT: deauth received.. | ||
| 336 | * @DEAUTH_TX_EVENT: deauth sent. | ||
| 337 | */ | ||
| 338 | enum ieee80211_mlme_event_data { | ||
| 339 | AUTH_EVENT, | ||
| 340 | ASSOC_EVENT, | ||
| 341 | DEAUTH_RX_EVENT, | ||
| 342 | DEAUTH_TX_EVENT, | ||
| 343 | }; | ||
| 344 | |||
| 345 | /** | ||
| 346 | * enum ieee80211_mlme_event_status - relevant when event type is %MLME_EVENT | ||
| 347 | * @MLME_SUCCESS: the MLME operation completed successfully. | ||
| 348 | * @MLME_DENIED: the MLME operation was denied by the peer. | ||
| 349 | * @MLME_TIMEOUT: the MLME operation timed out. | ||
| 350 | */ | ||
| 351 | enum ieee80211_mlme_event_status { | ||
| 352 | MLME_SUCCESS, | ||
| 353 | MLME_DENIED, | ||
| 354 | MLME_TIMEOUT, | ||
| 355 | }; | ||
| 356 | |||
| 357 | /** | ||
| 358 | * enum ieee80211_mlme_event - data attached to an %MLME_EVENT | ||
| 359 | * @data: See &enum ieee80211_mlme_event_data | ||
| 360 | * @status: See &enum ieee80211_mlme_event_status | ||
| 361 | * @reason: the reason code if applicable | ||
| 362 | */ | ||
| 363 | struct ieee80211_mlme_event { | ||
| 364 | enum ieee80211_mlme_event_data data; | ||
| 365 | enum ieee80211_mlme_event_status status; | ||
| 366 | u16 reason; | ||
| 367 | }; | ||
| 368 | |||
| 369 | /** | ||
| 370 | * struct ieee80211_event - event to be sent to the driver | ||
| 371 | * @type The event itself. See &enum ieee80211_event_type. | ||
| 372 | * @rssi: relevant if &type is %RSSI_EVENT | ||
| 373 | * @mlme: relevant if &type is %AUTH_EVENT | ||
| 374 | */ | ||
| 375 | struct ieee80211_event { | ||
| 376 | enum ieee80211_event_type type; | ||
| 377 | union { | ||
| 378 | struct ieee80211_rssi_event rssi; | ||
| 379 | struct ieee80211_mlme_event mlme; | ||
| 380 | } u; | ||
| 381 | }; | ||
| 382 | |||
| 383 | /** | ||
| 315 | * struct ieee80211_bss_conf - holds the BSS's changing parameters | 384 | * struct ieee80211_bss_conf - holds the BSS's changing parameters |
| 316 | * | 385 | * |
| 317 | * This structure keeps information about a BSS (and an association | 386 | * This structure keeps information about a BSS (and an association |
| @@ -337,12 +406,15 @@ enum ieee80211_rssi_event { | |||
| 337 | * HW flag %IEEE80211_HW_TIMING_BEACON_ONLY is set, then this can | 406 | * HW flag %IEEE80211_HW_TIMING_BEACON_ONLY is set, then this can |
| 338 | * only come from a beacon, but might not become valid until after | 407 | * only come from a beacon, but might not become valid until after |
| 339 | * association when a beacon is received (which is notified with the | 408 | * association when a beacon is received (which is notified with the |
| 340 | * %BSS_CHANGED_DTIM flag.) | 409 | * %BSS_CHANGED_DTIM flag.). See also sync_dtim_count important notice. |
| 341 | * @sync_device_ts: the device timestamp corresponding to the sync_tsf, | 410 | * @sync_device_ts: the device timestamp corresponding to the sync_tsf, |
| 342 | * the driver/device can use this to calculate synchronisation | 411 | * the driver/device can use this to calculate synchronisation |
| 343 | * (see @sync_tsf) | 412 | * (see @sync_tsf). See also sync_dtim_count important notice. |
| 344 | * @sync_dtim_count: Only valid when %IEEE80211_HW_TIMING_BEACON_ONLY | 413 | * @sync_dtim_count: Only valid when %IEEE80211_HW_TIMING_BEACON_ONLY |
| 345 | * is requested, see @sync_tsf/@sync_device_ts. | 414 | * is requested, see @sync_tsf/@sync_device_ts. |
| 415 | * IMPORTANT: These three sync_* parameters would possibly be out of sync | ||
| 416 | * by the time the driver will use them. The synchronized view is currently | ||
| 417 | * guaranteed only in certain callbacks. | ||
| 346 | * @beacon_int: beacon interval | 418 | * @beacon_int: beacon interval |
| 347 | * @assoc_capability: capabilities taken from assoc resp | 419 | * @assoc_capability: capabilities taken from assoc resp |
| 348 | * @basic_rates: bitmap of basic rates, each bit stands for an | 420 | * @basic_rates: bitmap of basic rates, each bit stands for an |
| @@ -1279,6 +1351,19 @@ static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif) | |||
| 1279 | struct ieee80211_vif *wdev_to_ieee80211_vif(struct wireless_dev *wdev); | 1351 | struct ieee80211_vif *wdev_to_ieee80211_vif(struct wireless_dev *wdev); |
| 1280 | 1352 | ||
| 1281 | /** | 1353 | /** |
| 1354 | * ieee80211_vif_to_wdev - return a wdev struct from a vif | ||
| 1355 | * @vif: the vif to get the wdev for | ||
| 1356 | * | ||
| 1357 | * This can be used by mac80211 drivers with direct cfg80211 APIs | ||
| 1358 | * (like the vendor commands) that needs to get the wdev for a vif. | ||
| 1359 | * | ||
| 1360 | * Note that this function may return %NULL if the given wdev isn't | ||
| 1361 | * associated with a vif that the driver knows about (e.g. monitor | ||
| 1362 | * or AP_VLAN interfaces.) | ||
| 1363 | */ | ||
| 1364 | struct wireless_dev *ieee80211_vif_to_wdev(struct ieee80211_vif *vif); | ||
| 1365 | |||
| 1366 | /** | ||
| 1282 | * enum ieee80211_key_flags - key flags | 1367 | * enum ieee80211_key_flags - key flags |
| 1283 | * | 1368 | * |
| 1284 | * These flags are used for communication about keys between the driver | 1369 | * These flags are used for communication about keys between the driver |
| @@ -1472,7 +1557,8 @@ struct ieee80211_sta_rates { | |||
| 1472 | * @supp_rates: Bitmap of supported rates (per band) | 1557 | * @supp_rates: Bitmap of supported rates (per band) |
| 1473 | * @ht_cap: HT capabilities of this STA; restricted to our own capabilities | 1558 | * @ht_cap: HT capabilities of this STA; restricted to our own capabilities |
| 1474 | * @vht_cap: VHT capabilities of this STA; restricted to our own capabilities | 1559 | * @vht_cap: VHT capabilities of this STA; restricted to our own capabilities |
| 1475 | * @wme: indicates whether the STA supports QoS/WME. | 1560 | * @wme: indicates whether the STA supports QoS/WME (if local devices does, |
| 1561 | * otherwise always false) | ||
| 1476 | * @drv_priv: data area for driver use, will always be aligned to | 1562 | * @drv_priv: data area for driver use, will always be aligned to |
| 1477 | * sizeof(void *), size is determined in hw information. | 1563 | * sizeof(void *), size is determined in hw information. |
| 1478 | * @uapsd_queues: bitmap of queues configured for uapsd. Only valid | 1564 | * @uapsd_queues: bitmap of queues configured for uapsd. Only valid |
| @@ -1488,6 +1574,7 @@ struct ieee80211_sta_rates { | |||
| 1488 | * @tdls: indicates whether the STA is a TDLS peer | 1574 | * @tdls: indicates whether the STA is a TDLS peer |
| 1489 | * @tdls_initiator: indicates the STA is an initiator of the TDLS link. Only | 1575 | * @tdls_initiator: indicates the STA is an initiator of the TDLS link. Only |
| 1490 | * valid if the STA is a TDLS peer in the first place. | 1576 | * valid if the STA is a TDLS peer in the first place. |
| 1577 | * @mfp: indicates whether the STA uses management frame protection or not. | ||
| 1491 | */ | 1578 | */ |
| 1492 | struct ieee80211_sta { | 1579 | struct ieee80211_sta { |
| 1493 | u32 supp_rates[IEEE80211_NUM_BANDS]; | 1580 | u32 supp_rates[IEEE80211_NUM_BANDS]; |
| @@ -1504,6 +1591,7 @@ struct ieee80211_sta { | |||
| 1504 | struct ieee80211_sta_rates __rcu *rates; | 1591 | struct ieee80211_sta_rates __rcu *rates; |
| 1505 | bool tdls; | 1592 | bool tdls; |
| 1506 | bool tdls_initiator; | 1593 | bool tdls_initiator; |
| 1594 | bool mfp; | ||
| 1507 | 1595 | ||
| 1508 | /* must be last */ | 1596 | /* must be last */ |
| 1509 | u8 drv_priv[0] __aligned(sizeof(void *)); | 1597 | u8 drv_priv[0] __aligned(sizeof(void *)); |
| @@ -2844,8 +2932,9 @@ enum ieee80211_reconfig_type { | |||
| 2844 | * @set_bitrate_mask: Set a mask of rates to be used for rate control selection | 2932 | * @set_bitrate_mask: Set a mask of rates to be used for rate control selection |
| 2845 | * when transmitting a frame. Currently only legacy rates are handled. | 2933 | * when transmitting a frame. Currently only legacy rates are handled. |
| 2846 | * The callback can sleep. | 2934 | * The callback can sleep. |
| 2847 | * @rssi_callback: Notify driver when the average RSSI goes above/below | 2935 | * @event_callback: Notify driver about any event in mac80211. See |
| 2848 | * thresholds that were registered previously. The callback can sleep. | 2936 | * &enum ieee80211_event_type for the different types. |
| 2937 | * The callback can sleep. | ||
| 2849 | * | 2938 | * |
| 2850 | * @release_buffered_frames: Release buffered frames according to the given | 2939 | * @release_buffered_frames: Release buffered frames according to the given |
| 2851 | * parameters. In the case where the driver buffers some frames for | 2940 | * parameters. In the case where the driver buffers some frames for |
| @@ -3141,9 +3230,9 @@ struct ieee80211_ops { | |||
| 3141 | bool (*tx_frames_pending)(struct ieee80211_hw *hw); | 3230 | bool (*tx_frames_pending)(struct ieee80211_hw *hw); |
| 3142 | int (*set_bitrate_mask)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, | 3231 | int (*set_bitrate_mask)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, |
| 3143 | const struct cfg80211_bitrate_mask *mask); | 3232 | const struct cfg80211_bitrate_mask *mask); |
| 3144 | void (*rssi_callback)(struct ieee80211_hw *hw, | 3233 | void (*event_callback)(struct ieee80211_hw *hw, |
| 3145 | struct ieee80211_vif *vif, | 3234 | struct ieee80211_vif *vif, |
| 3146 | enum ieee80211_rssi_event rssi_event); | 3235 | const struct ieee80211_event *event); |
| 3147 | 3236 | ||
| 3148 | void (*allow_buffered_frames)(struct ieee80211_hw *hw, | 3237 | void (*allow_buffered_frames)(struct ieee80211_hw *hw, |
| 3149 | struct ieee80211_sta *sta, | 3238 | struct ieee80211_sta *sta, |
| @@ -4343,13 +4432,33 @@ void ieee80211_sched_scan_stopped(struct ieee80211_hw *hw); | |||
| 4343 | * haven't been re-added to the driver yet. | 4432 | * haven't been re-added to the driver yet. |
| 4344 | * @IEEE80211_IFACE_ITER_RESUME_ALL: During resume, iterate over all | 4433 | * @IEEE80211_IFACE_ITER_RESUME_ALL: During resume, iterate over all |
| 4345 | * interfaces, even if they haven't been re-added to the driver yet. | 4434 | * interfaces, even if they haven't been re-added to the driver yet. |
| 4435 | * @IEEE80211_IFACE_ITER_ACTIVE: Iterate only active interfaces (netdev is up). | ||
| 4346 | */ | 4436 | */ |
| 4347 | enum ieee80211_interface_iteration_flags { | 4437 | enum ieee80211_interface_iteration_flags { |
| 4348 | IEEE80211_IFACE_ITER_NORMAL = 0, | 4438 | IEEE80211_IFACE_ITER_NORMAL = 0, |
| 4349 | IEEE80211_IFACE_ITER_RESUME_ALL = BIT(0), | 4439 | IEEE80211_IFACE_ITER_RESUME_ALL = BIT(0), |
| 4440 | IEEE80211_IFACE_ITER_ACTIVE = BIT(1), | ||
| 4350 | }; | 4441 | }; |
| 4351 | 4442 | ||
| 4352 | /** | 4443 | /** |
| 4444 | * ieee80211_iterate_interfaces - iterate interfaces | ||
| 4445 | * | ||
| 4446 | * This function iterates over the interfaces associated with a given | ||
| 4447 | * hardware and calls the callback for them. This includes active as well as | ||
| 4448 | * inactive interfaces. This function allows the iterator function to sleep. | ||
| 4449 | * Will iterate over a new interface during add_interface(). | ||
| 4450 | * | ||
| 4451 | * @hw: the hardware struct of which the interfaces should be iterated over | ||
| 4452 | * @iter_flags: iteration flags, see &enum ieee80211_interface_iteration_flags | ||
| 4453 | * @iterator: the iterator function to call | ||
| 4454 | * @data: first argument of the iterator function | ||
| 4455 | */ | ||
| 4456 | void ieee80211_iterate_interfaces(struct ieee80211_hw *hw, u32 iter_flags, | ||
| 4457 | void (*iterator)(void *data, u8 *mac, | ||
| 4458 | struct ieee80211_vif *vif), | ||
| 4459 | void *data); | ||
| 4460 | |||
| 4461 | /** | ||
| 4353 | * ieee80211_iterate_active_interfaces - iterate active interfaces | 4462 | * ieee80211_iterate_active_interfaces - iterate active interfaces |
| 4354 | * | 4463 | * |
| 4355 | * This function iterates over the interfaces associated with a given | 4464 | * This function iterates over the interfaces associated with a given |
| @@ -4364,11 +4473,16 @@ enum ieee80211_interface_iteration_flags { | |||
| 4364 | * @iterator: the iterator function to call | 4473 | * @iterator: the iterator function to call |
| 4365 | * @data: first argument of the iterator function | 4474 | * @data: first argument of the iterator function |
| 4366 | */ | 4475 | */ |
| 4367 | void ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw, | 4476 | static inline void |
| 4368 | u32 iter_flags, | 4477 | ieee80211_iterate_active_interfaces(struct ieee80211_hw *hw, u32 iter_flags, |
| 4369 | void (*iterator)(void *data, u8 *mac, | 4478 | void (*iterator)(void *data, u8 *mac, |
| 4370 | struct ieee80211_vif *vif), | 4479 | struct ieee80211_vif *vif), |
| 4371 | void *data); | 4480 | void *data) |
| 4481 | { | ||
| 4482 | ieee80211_iterate_interfaces(hw, | ||
| 4483 | iter_flags | IEEE80211_IFACE_ITER_ACTIVE, | ||
| 4484 | iterator, data); | ||
| 4485 | } | ||
| 4372 | 4486 | ||
| 4373 | /** | 4487 | /** |
| 4374 | * ieee80211_iterate_active_interfaces_atomic - iterate active interfaces | 4488 | * ieee80211_iterate_active_interfaces_atomic - iterate active interfaces |
diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h index 68b294e83944..241220c43e86 100644 --- a/include/uapi/linux/nl80211.h +++ b/include/uapi/linux/nl80211.h | |||
| @@ -25,6 +25,19 @@ | |||
| 25 | * | 25 | * |
| 26 | */ | 26 | */ |
| 27 | 27 | ||
| 28 | /* | ||
| 29 | * This header file defines the userspace API to the wireless stack. Please | ||
| 30 | * be careful not to break things - i.e. don't move anything around or so | ||
| 31 | * unless you can demonstrate that it breaks neither API nor ABI. | ||
| 32 | * | ||
| 33 | * Additions to the API should be accompanied by actual implementations in | ||
| 34 | * an upstream driver, so that example implementations exist in case there | ||
| 35 | * are ever concerns about the precise semantics of the API or changes are | ||
| 36 | * needed, and to ensure that code for dead (no longer implemented) API | ||
| 37 | * can actually be identified and removed. | ||
| 38 | * Nonetheless, semantics should also be documented carefully in this file. | ||
| 39 | */ | ||
| 40 | |||
| 28 | #include <linux/types.h> | 41 | #include <linux/types.h> |
| 29 | 42 | ||
| 30 | #define NL80211_GENL_NAME "nl80211" | 43 | #define NL80211_GENL_NAME "nl80211" |
| @@ -1684,6 +1697,10 @@ enum nl80211_commands { | |||
| 1684 | * If set during scheduled scan start then the new scan req will be | 1697 | * If set during scheduled scan start then the new scan req will be |
| 1685 | * owned by the netlink socket that created it and the scheduled scan will | 1698 | * owned by the netlink socket that created it and the scheduled scan will |
| 1686 | * be stopped when the socket is closed. | 1699 | * be stopped when the socket is closed. |
| 1700 | * If set during configuration of regulatory indoor operation then the | ||
| 1701 | * regulatory indoor configuration would be owned by the netlink socket | ||
| 1702 | * that configured the indoor setting, and the indoor operation would be | ||
| 1703 | * cleared when the socket is closed. | ||
| 1687 | * | 1704 | * |
| 1688 | * @NL80211_ATTR_TDLS_INITIATOR: flag attribute indicating the current end is | 1705 | * @NL80211_ATTR_TDLS_INITIATOR: flag attribute indicating the current end is |
| 1689 | * the TDLS link initiator. | 1706 | * the TDLS link initiator. |
| @@ -1737,8 +1754,12 @@ enum nl80211_commands { | |||
| 1737 | * should be contained in the result as the sum of the respective counters | 1754 | * should be contained in the result as the sum of the respective counters |
| 1738 | * over all channels. | 1755 | * over all channels. |
| 1739 | * | 1756 | * |
| 1740 | * @NL80211_ATTR_SCHED_SCAN_DELAY: delay before a scheduled scan (or a | 1757 | * @NL80211_ATTR_SCHED_SCAN_DELAY: delay before the first cycle of a |
| 1741 | * WoWLAN net-detect scan) is started, u32 in seconds. | 1758 | * scheduled scan (or a WoWLAN net-detect scan) is started, u32 |
| 1759 | * in seconds. | ||
| 1760 | |||
| 1761 | * @NL80211_ATTR_REG_INDOOR: flag attribute, if set indicates that the device | ||
| 1762 | * is operating in an indoor environment. | ||
| 1742 | * | 1763 | * |
| 1743 | * @NUM_NL80211_ATTR: total number of nl80211_attrs available | 1764 | * @NUM_NL80211_ATTR: total number of nl80211_attrs available |
| 1744 | * @NL80211_ATTR_MAX: highest attribute number currently defined | 1765 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
| @@ -2107,6 +2128,8 @@ enum nl80211_attrs { | |||
| 2107 | 2128 | ||
| 2108 | NL80211_ATTR_SCHED_SCAN_DELAY, | 2129 | NL80211_ATTR_SCHED_SCAN_DELAY, |
| 2109 | 2130 | ||
| 2131 | NL80211_ATTR_REG_INDOOR, | ||
| 2132 | |||
| 2110 | /* add attributes here, update the policy in nl80211.c */ | 2133 | /* add attributes here, update the policy in nl80211.c */ |
| 2111 | 2134 | ||
| 2112 | __NL80211_ATTR_AFTER_LAST, | 2135 | __NL80211_ATTR_AFTER_LAST, |
| @@ -3092,7 +3115,8 @@ enum nl80211_mesh_power_mode { | |||
| 3092 | * | 3115 | * |
| 3093 | * @NL80211_MESHCONF_PLINK_TIMEOUT: If no tx activity is seen from a STA we've | 3116 | * @NL80211_MESHCONF_PLINK_TIMEOUT: If no tx activity is seen from a STA we've |
| 3094 | * established peering with for longer than this time (in seconds), then | 3117 | * established peering with for longer than this time (in seconds), then |
| 3095 | * remove it from the STA's list of peers. Default is 30 minutes. | 3118 | * remove it from the STA's list of peers. You may set this to 0 to disable |
| 3119 | * the removal of the STA. Default is 30 minutes. | ||
| 3096 | * | 3120 | * |
| 3097 | * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use | 3121 | * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use |
| 3098 | */ | 3122 | */ |
| @@ -3694,6 +3718,8 @@ struct nl80211_pattern_support { | |||
| 3694 | * @NL80211_WOWLAN_TRIG_ANY: wake up on any activity, do not really put | 3718 | * @NL80211_WOWLAN_TRIG_ANY: wake up on any activity, do not really put |
| 3695 | * the chip into a special state -- works best with chips that have | 3719 | * the chip into a special state -- works best with chips that have |
| 3696 | * support for low-power operation already (flag) | 3720 | * support for low-power operation already (flag) |
| 3721 | * Note that this mode is incompatible with all of the others, if | ||
| 3722 | * any others are even supported by the device. | ||
| 3697 | * @NL80211_WOWLAN_TRIG_DISCONNECT: wake up on disconnect, the way disconnect | 3723 | * @NL80211_WOWLAN_TRIG_DISCONNECT: wake up on disconnect, the way disconnect |
| 3698 | * is detected is implementation-specific (flag) | 3724 | * is detected is implementation-specific (flag) |
| 3699 | * @NL80211_WOWLAN_TRIG_MAGIC_PKT: wake up on magic packet (6x 0xff, followed | 3725 | * @NL80211_WOWLAN_TRIG_MAGIC_PKT: wake up on magic packet (6x 0xff, followed |
| @@ -4327,11 +4353,13 @@ enum nl80211_feature_flags { | |||
| 4327 | 4353 | ||
| 4328 | /** | 4354 | /** |
| 4329 | * enum nl80211_ext_feature_index - bit index of extended features. | 4355 | * enum nl80211_ext_feature_index - bit index of extended features. |
| 4356 | * @NL80211_EXT_FEATURE_VHT_IBSS: This driver supports IBSS with VHT datarates. | ||
| 4330 | * | 4357 | * |
| 4331 | * @NUM_NL80211_EXT_FEATURES: number of extended features. | 4358 | * @NUM_NL80211_EXT_FEATURES: number of extended features. |
| 4332 | * @MAX_NL80211_EXT_FEATURES: highest extended feature index. | 4359 | * @MAX_NL80211_EXT_FEATURES: highest extended feature index. |
| 4333 | */ | 4360 | */ |
| 4334 | enum nl80211_ext_feature_index { | 4361 | enum nl80211_ext_feature_index { |
| 4362 | NL80211_EXT_FEATURE_VHT_IBSS, | ||
| 4335 | 4363 | ||
| 4336 | /* add new features before the definition below */ | 4364 | /* add new features before the definition below */ |
| 4337 | NUM_NL80211_EXT_FEATURES, | 4365 | NUM_NL80211_EXT_FEATURES, |
