diff options
author | John W. Linville <linville@tuxdriver.com> | 2012-11-26 14:46:41 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-11-26 14:46:41 -0500 |
commit | 62c8003ecb973986958e9dade4a7e598349caf48 (patch) | |
tree | 0e831639cd6449c2955234cfc37ef46481c788d1 /include/net | |
parent | e4cb3ff9311e0817e65cda7bc53898348aab7527 (diff) | |
parent | ec816087e8978b74c1bd5fae0e335dd97d964e9f (diff) |
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
Diffstat (limited to 'include/net')
-rw-r--r-- | include/net/cfg80211.h | 170 | ||||
-rw-r--r-- | include/net/mac80211.h | 66 |
2 files changed, 173 insertions, 63 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 8a1aec54e68f..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; |
@@ -1728,8 +1814,7 @@ struct cfg80211_ops { | |||
1728 | struct ieee80211_channel *chan); | 1814 | struct ieee80211_channel *chan); |
1729 | 1815 | ||
1730 | int (*set_monitor_channel)(struct wiphy *wiphy, | 1816 | int (*set_monitor_channel)(struct wiphy *wiphy, |
1731 | struct ieee80211_channel *chan, | 1817 | struct cfg80211_chan_def *chandef); |
1732 | enum nl80211_channel_type channel_type); | ||
1733 | 1818 | ||
1734 | int (*scan)(struct wiphy *wiphy, | 1819 | int (*scan)(struct wiphy *wiphy, |
1735 | struct cfg80211_scan_request *request); | 1820 | struct cfg80211_scan_request *request); |
@@ -1791,7 +1876,6 @@ struct cfg80211_ops { | |||
1791 | int (*remain_on_channel)(struct wiphy *wiphy, | 1876 | int (*remain_on_channel)(struct wiphy *wiphy, |
1792 | struct wireless_dev *wdev, | 1877 | struct wireless_dev *wdev, |
1793 | struct ieee80211_channel *chan, | 1878 | struct ieee80211_channel *chan, |
1794 | enum nl80211_channel_type channel_type, | ||
1795 | unsigned int duration, | 1879 | unsigned int duration, |
1796 | u64 *cookie); | 1880 | u64 *cookie); |
1797 | int (*cancel_remain_on_channel)(struct wiphy *wiphy, | 1881 | int (*cancel_remain_on_channel)(struct wiphy *wiphy, |
@@ -1800,10 +1884,8 @@ struct cfg80211_ops { | |||
1800 | 1884 | ||
1801 | int (*mgmt_tx)(struct wiphy *wiphy, struct wireless_dev *wdev, | 1885 | int (*mgmt_tx)(struct wiphy *wiphy, struct wireless_dev *wdev, |
1802 | struct ieee80211_channel *chan, bool offchan, | 1886 | struct ieee80211_channel *chan, bool offchan, |
1803 | enum nl80211_channel_type channel_type, | 1887 | unsigned int wait, const u8 *buf, size_t len, |
1804 | bool channel_type_valid, unsigned int wait, | 1888 | bool no_cck, bool dont_wait_for_ack, u64 *cookie); |
1805 | const u8 *buf, size_t len, bool no_cck, | ||
1806 | bool dont_wait_for_ack, u64 *cookie); | ||
1807 | int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy, | 1889 | int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy, |
1808 | struct wireless_dev *wdev, | 1890 | struct wireless_dev *wdev, |
1809 | u64 cookie); | 1891 | u64 cookie); |
@@ -1858,10 +1940,9 @@ struct cfg80211_ops { | |||
1858 | void (*get_et_strings)(struct wiphy *wiphy, struct net_device *dev, | 1940 | void (*get_et_strings)(struct wiphy *wiphy, struct net_device *dev, |
1859 | u32 sset, u8 *data); | 1941 | u32 sset, u8 *data); |
1860 | 1942 | ||
1861 | struct ieee80211_channel * | 1943 | int (*get_channel)(struct wiphy *wiphy, |
1862 | (*get_channel)(struct wiphy *wiphy, | ||
1863 | struct wireless_dev *wdev, | 1944 | struct wireless_dev *wdev, |
1864 | enum nl80211_channel_type *type); | 1945 | struct cfg80211_chan_def *chandef); |
1865 | 1946 | ||
1866 | int (*start_p2p_device)(struct wiphy *wiphy, | 1947 | int (*start_p2p_device)(struct wiphy *wiphy, |
1867 | struct wireless_dev *wdev); | 1948 | struct wireless_dev *wdev); |
@@ -2469,8 +2550,7 @@ struct wireless_dev { | |||
2469 | spinlock_t event_lock; | 2550 | spinlock_t event_lock; |
2470 | 2551 | ||
2471 | struct cfg80211_internal_bss *current_bss; /* associated / joined */ | 2552 | struct cfg80211_internal_bss *current_bss; /* associated / joined */ |
2472 | struct ieee80211_channel *preset_chan; | 2553 | struct cfg80211_chan_def preset_chandef; |
2473 | enum nl80211_channel_type preset_chantype; | ||
2474 | 2554 | ||
2475 | /* for AP and mesh channel tracking */ | 2555 | /* for AP and mesh channel tracking */ |
2476 | struct ieee80211_channel *channel; | 2556 | struct ieee80211_channel *channel; |
@@ -3350,14 +3430,12 @@ void cfg80211_disconnected(struct net_device *dev, u16 reason, | |||
3350 | * @wdev: wireless device | 3430 | * @wdev: wireless device |
3351 | * @cookie: the request cookie | 3431 | * @cookie: the request cookie |
3352 | * @chan: The current channel (from remain_on_channel request) | 3432 | * @chan: The current channel (from remain_on_channel request) |
3353 | * @channel_type: Channel type | ||
3354 | * @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 |
3355 | * channel | 3434 | * channel |
3356 | * @gfp: allocation flags | 3435 | * @gfp: allocation flags |
3357 | */ | 3436 | */ |
3358 | void cfg80211_ready_on_channel(struct wireless_dev *wdev, u64 cookie, | 3437 | void cfg80211_ready_on_channel(struct wireless_dev *wdev, u64 cookie, |
3359 | struct ieee80211_channel *chan, | 3438 | struct ieee80211_channel *chan, |
3360 | enum nl80211_channel_type channel_type, | ||
3361 | unsigned int duration, gfp_t gfp); | 3439 | unsigned int duration, gfp_t gfp); |
3362 | 3440 | ||
3363 | /** | 3441 | /** |
@@ -3365,12 +3443,10 @@ void cfg80211_ready_on_channel(struct wireless_dev *wdev, u64 cookie, | |||
3365 | * @wdev: wireless device | 3443 | * @wdev: wireless device |
3366 | * @cookie: the request cookie | 3444 | * @cookie: the request cookie |
3367 | * @chan: The current channel (from remain_on_channel request) | 3445 | * @chan: The current channel (from remain_on_channel request) |
3368 | * @channel_type: Channel type | ||
3369 | * @gfp: allocation flags | 3446 | * @gfp: allocation flags |
3370 | */ | 3447 | */ |
3371 | 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, |
3372 | struct ieee80211_channel *chan, | 3449 | struct ieee80211_channel *chan, |
3373 | enum nl80211_channel_type channel_type, | ||
3374 | gfp_t gfp); | 3450 | gfp_t gfp); |
3375 | 3451 | ||
3376 | 3452 | ||
@@ -3570,28 +3646,25 @@ void cfg80211_report_obss_beacon(struct wiphy *wiphy, | |||
3570 | int freq, int sig_dbm); | 3646 | int freq, int sig_dbm); |
3571 | 3647 | ||
3572 | /** | 3648 | /** |
3573 | * cfg80211_can_beacon_sec_chan - test if ht40 on extension channel can be used | 3649 | * cfg80211_reg_can_beacon - check if beaconing is allowed |
3574 | * @wiphy: the wiphy | 3650 | * @wiphy: the wiphy |
3575 | * @chan: main channel | 3651 | * @chandef: the channel definition |
3576 | * @channel_type: HT mode | ||
3577 | * | 3652 | * |
3578 | * 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 |
3579 | * 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.) |
3580 | */ | 3655 | */ |
3581 | bool cfg80211_can_beacon_sec_chan(struct wiphy *wiphy, | 3656 | bool cfg80211_reg_can_beacon(struct wiphy *wiphy, |
3582 | struct ieee80211_channel *chan, | 3657 | struct cfg80211_chan_def *chandef); |
3583 | enum nl80211_channel_type channel_type); | ||
3584 | 3658 | ||
3585 | /* | 3659 | /* |
3586 | * cfg80211_ch_switch_notify - update wdev channel and notify userspace | 3660 | * cfg80211_ch_switch_notify - update wdev channel and notify userspace |
3587 | * @dev: the device which switched channels | 3661 | * @dev: the device which switched channels |
3588 | * @freq: new channel frequency (in MHz) | 3662 | * @chandef: the new channel definition |
3589 | * @type: channel type | ||
3590 | * | 3663 | * |
3591 | * 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! |
3592 | */ | 3665 | */ |
3593 | void cfg80211_ch_switch_notify(struct net_device *dev, int freq, | 3666 | void cfg80211_ch_switch_notify(struct net_device *dev, |
3594 | enum nl80211_channel_type type); | 3667 | struct cfg80211_chan_def *chandef); |
3595 | 3668 | ||
3596 | /* | 3669 | /* |
3597 | * cfg80211_tdls_oper_request - request userspace to perform TDLS operation | 3670 | * cfg80211_tdls_oper_request - request userspace to perform TDLS operation |
@@ -3652,8 +3725,9 @@ void cfg80211_unregister_wdev(struct wireless_dev *wdev); | |||
3652 | * the data is malformed or the attribute can't be found (respectively), | 3725 | * the data is malformed or the attribute can't be found (respectively), |
3653 | * or the length of the found attribute (which can be zero). | 3726 | * or the length of the found attribute (which can be zero). |
3654 | */ | 3727 | */ |
3655 | unsigned int cfg80211_get_p2p_attr(const u8 *ies, unsigned int len, | 3728 | int cfg80211_get_p2p_attr(const u8 *ies, unsigned int len, |
3656 | u8 attr, u8 *buf, unsigned int bufsize); | 3729 | enum ieee80211_p2p_attr_id attr, |
3730 | u8 *buf, unsigned int bufsize); | ||
3657 | 3731 | ||
3658 | /* Logging, debugging and troubleshooting/diagnostic helpers. */ | 3732 | /* Logging, debugging and troubleshooting/diagnostic helpers. */ |
3659 | 3733 | ||
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index e1293c7e4d2c..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 | ||
@@ -288,9 +286,8 @@ enum ieee80211_rssi_event { | |||
288 | * @mcast_rate: per-band multicast rate index + 1 (0: disabled) | 286 | * @mcast_rate: per-band multicast rate index + 1 (0: disabled) |
289 | * @bssid: The BSSID for this BSS | 287 | * @bssid: The BSSID for this BSS |
290 | * @enable_beacon: whether beaconing should be enabled or not | 288 | * @enable_beacon: whether beaconing should be enabled or not |
291 | * @channel_type: Channel type for this BSS -- the hardware might be | 289 | * @chandef: Channel definition for this BSS -- the hardware might be |
292 | * configured for HT40+ while this BSS only uses no-HT, for | 290 | * configured a higher bandwidth than this BSS uses, for example. |
293 | * example. | ||
294 | * @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. |
295 | * 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. |
296 | * @cqm_rssi_thold: Connection quality monitor RSSI threshold, a zero value | 293 | * @cqm_rssi_thold: Connection quality monitor RSSI threshold, a zero value |
@@ -339,7 +336,7 @@ struct ieee80211_bss_conf { | |||
339 | u16 ht_operation_mode; | 336 | u16 ht_operation_mode; |
340 | s32 cqm_rssi_thold; | 337 | s32 cqm_rssi_thold; |
341 | u32 cqm_rssi_hyst; | 338 | u32 cqm_rssi_hyst; |
342 | enum nl80211_channel_type channel_type; | 339 | struct cfg80211_chan_def chandef; |
343 | __be32 arp_addr_list[IEEE80211_BSS_ARP_ADDR_LIST_LEN]; | 340 | __be32 arp_addr_list[IEEE80211_BSS_ARP_ADDR_LIST_LEN]; |
344 | u8 arp_addr_cnt; | 341 | u8 arp_addr_cnt; |
345 | bool arp_filter_enabled; | 342 | bool arp_filter_enabled; |
@@ -502,9 +499,14 @@ enum mac80211_tx_control_flags { | |||
502 | * This is set if the current BSS requires ERP protection. | 499 | * This is set if the current BSS requires ERP protection. |
503 | * @IEEE80211_TX_RC_USE_SHORT_PREAMBLE: Use short preamble. | 500 | * @IEEE80211_TX_RC_USE_SHORT_PREAMBLE: Use short preamble. |
504 | * @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) | ||
505 | * @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 |
506 | * Greenfield mode. | 505 | * Greenfield mode. |
507 | * @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) | ||
508 | * @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 |
509 | * adjacent 20 MHz channels, if the current channel type is | 511 | * adjacent 20 MHz channels, if the current channel type is |
510 | * NL80211_CHAN_HT40MINUS or NL80211_CHAN_HT40PLUS. | 512 | * NL80211_CHAN_HT40MINUS or NL80211_CHAN_HT40PLUS. |
@@ -515,12 +517,15 @@ enum mac80211_rate_control_flags { | |||
515 | IEEE80211_TX_RC_USE_CTS_PROTECT = BIT(1), | 517 | IEEE80211_TX_RC_USE_CTS_PROTECT = BIT(1), |
516 | IEEE80211_TX_RC_USE_SHORT_PREAMBLE = BIT(2), | 518 | IEEE80211_TX_RC_USE_SHORT_PREAMBLE = BIT(2), |
517 | 519 | ||
518 | /* rate index is an MCS rate number instead of an index */ | 520 | /* rate index is an HT/VHT MCS instead of an index */ |
519 | IEEE80211_TX_RC_MCS = BIT(3), | 521 | IEEE80211_TX_RC_MCS = BIT(3), |
520 | IEEE80211_TX_RC_GREEN_FIELD = BIT(4), | 522 | IEEE80211_TX_RC_GREEN_FIELD = BIT(4), |
521 | IEEE80211_TX_RC_40_MHZ_WIDTH = BIT(5), | 523 | IEEE80211_TX_RC_40_MHZ_WIDTH = BIT(5), |
522 | IEEE80211_TX_RC_DUP_DATA = BIT(6), | 524 | IEEE80211_TX_RC_DUP_DATA = BIT(6), |
523 | 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), | ||
524 | }; | 529 | }; |
525 | 530 | ||
526 | 531 | ||
@@ -563,10 +568,32 @@ enum mac80211_rate_control_flags { | |||
563 | */ | 568 | */ |
564 | struct ieee80211_tx_rate { | 569 | struct ieee80211_tx_rate { |
565 | s8 idx; | 570 | s8 idx; |
566 | u8 count; | 571 | u16 count:5, |
567 | u8 flags; | 572 | flags:11; |
568 | } __packed; | 573 | } __packed; |
569 | 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 | |||
570 | /** | 597 | /** |
571 | * struct ieee80211_tx_info - skb transmit information | 598 | * struct ieee80211_tx_info - skb transmit information |
572 | * | 599 | * |
@@ -720,7 +747,11 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info) | |||
720 | * (including FCS) was received. | 747 | * (including FCS) was received. |
721 | * @RX_FLAG_SHORTPRE: Short preamble was used for this frame | 748 | * @RX_FLAG_SHORTPRE: Short preamble was used for this frame |
722 | * @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 | ||
723 | * @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 | ||
724 | * @RX_FLAG_SHORT_GI: Short guard interval was used | 755 | * @RX_FLAG_SHORT_GI: Short guard interval was used |
725 | * @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. |
726 | * Valid only for data frames (mainly A-MPDU) | 757 | * Valid only for data frames (mainly A-MPDU) |
@@ -763,6 +794,10 @@ enum mac80211_rx_flags { | |||
763 | RX_FLAG_AMPDU_DELIM_CRC_ERROR = BIT(19), | 794 | RX_FLAG_AMPDU_DELIM_CRC_ERROR = BIT(19), |
764 | RX_FLAG_AMPDU_DELIM_CRC_KNOWN = BIT(20), | 795 | RX_FLAG_AMPDU_DELIM_CRC_KNOWN = BIT(20), |
765 | RX_FLAG_MACTIME_END = BIT(21), | 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), | ||
766 | }; | 801 | }; |
767 | 802 | ||
768 | /** | 803 | /** |
@@ -783,7 +818,8 @@ enum mac80211_rx_flags { | |||
783 | * @IEEE80211_HW_SIGNAL_* | 818 | * @IEEE80211_HW_SIGNAL_* |
784 | * @antenna: antenna used | 819 | * @antenna: antenna used |
785 | * @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 |
786 | * 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) | ||
787 | * @flag: %RX_FLAG_* | 823 | * @flag: %RX_FLAG_* |
788 | * @rx_flags: internal RX flags for mac80211 | 824 | * @rx_flags: internal RX flags for mac80211 |
789 | * @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 |
@@ -806,6 +842,7 @@ struct ieee80211_rx_status { | |||
806 | u16 vendor_radiotap_len; | 842 | u16 vendor_radiotap_len; |
807 | u16 freq; | 843 | u16 freq; |
808 | u8 rate_idx; | 844 | u8 rate_idx; |
845 | u8 vht_nss; | ||
809 | u8 rx_flags; | 846 | u8 rx_flags; |
810 | u8 band; | 847 | u8 band; |
811 | u8 antenna; | 848 | u8 antenna; |
@@ -2550,7 +2587,6 @@ struct ieee80211_ops { | |||
2550 | int (*remain_on_channel)(struct ieee80211_hw *hw, | 2587 | int (*remain_on_channel)(struct ieee80211_hw *hw, |
2551 | struct ieee80211_vif *vif, | 2588 | struct ieee80211_vif *vif, |
2552 | struct ieee80211_channel *chan, | 2589 | struct ieee80211_channel *chan, |
2553 | enum nl80211_channel_type channel_type, | ||
2554 | int duration); | 2590 | int duration); |
2555 | int (*cancel_remain_on_channel)(struct ieee80211_hw *hw); | 2591 | int (*cancel_remain_on_channel)(struct ieee80211_hw *hw); |
2556 | int (*set_ringparam)(struct ieee80211_hw *hw, u32 tx, u32 rx); | 2592 | int (*set_ringparam)(struct ieee80211_hw *hw, u32 tx, u32 rx); |