Skip to content

Commit 219c386

Browse files
alexbondarinteljmberg-intel
authored andcommitted
mac80211: allow drivers to set default uAPSD parameters
mac80211 currently sets uAPSD parameters to have VO AC trigger- and delivery-enabled, with maximum service period length. Allow drivers to change these default settings since different uAPSD client implementations may handle errors differently and be able to recover from some errors. Note: some APs may not function correctly if one or all ACs are trigger- and delivery-enabled, see http://thread.gmane.org/gmane.linux.kernel.wireless.general/93577. We retested with this AP and later firmware doesn't have this bug any more. Signed-off-by: Alexander Bondar <alexander.bondar@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
1 parent c3ffeab commit 219c386

3 files changed

Lines changed: 17 additions & 2 deletions

File tree

‎include/net/mac80211.h‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1534,6 +1534,17 @@ enum ieee80211_hw_flags {
15341534
* @netdev_features: netdev features to be set in each netdev created
15351535
* from this HW. Note only HW checksum features are currently
15361536
* compatible with mac80211. Other feature bits will be rejected.
1537+
*
1538+
* @uapsd_queues: This bitmap is included in (re)association frame to indicate
1539+
* for each access category if it is uAPSD trigger-enabled and delivery-
1540+
* enabled. Use IEEE80211_WMM_IE_STA_QOSINFO_AC_* to set this bitmap.
1541+
* Each bit corresponds to different AC. Value '1' in specific bit means
1542+
* that corresponding AC is both trigger- and delivery-enabled. '0' means
1543+
* neither enabled.
1544+
*
1545+
* @uapsd_max_sp_len: maximum number of total buffered frames the WMM AP may
1546+
* deliver to a WMM STA during any Service Period triggered by the WMM STA.
1547+
* Use IEEE80211_WMM_IE_STA_QOSINFO_SP_* for correct values.
15371548
*/
15381549
struct ieee80211_hw {
15391550
struct ieee80211_conf conf;
@@ -1559,6 +1570,8 @@ struct ieee80211_hw {
15591570
u8 radiotap_mcs_details;
15601571
u16 radiotap_vht_details;
15611572
netdev_features_t netdev_features;
1573+
u8 uapsd_queues;
1574+
u8 uapsd_max_sp_len;
15621575
};
15631576

15641577
/**

‎net/mac80211/main.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,8 @@ struct ieee80211_hw *ieee80211_alloc_hw(size_t priv_data_len,
587587
IEEE80211_RADIOTAP_MCS_HAVE_BW;
588588
local->hw.radiotap_vht_details = IEEE80211_RADIOTAP_VHT_KNOWN_GI |
589589
IEEE80211_RADIOTAP_VHT_KNOWN_BANDWIDTH;
590+
local->hw.uapsd_queues = IEEE80211_DEFAULT_UAPSD_QUEUES;
591+
local->hw.uapsd_max_sp_len = IEEE80211_DEFAULT_MAX_SP_LEN;
590592
local->user_power_level = IEEE80211_UNSET_POWER_LEVEL;
591593
wiphy->ht_capa_mod_mask = &mac80211_ht_capa_mod_mask;
592594
wiphy->vht_capa_mod_mask = &mac80211_vht_capa_mod_mask;

‎net/mac80211/mlme.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3525,8 +3525,8 @@ void ieee80211_sta_setup_sdata(struct ieee80211_sub_if_data *sdata)
35253525

35263526
ifmgd->flags = 0;
35273527
ifmgd->powersave = sdata->wdev.ps;
3528-
ifmgd->uapsd_queues = IEEE80211_DEFAULT_UAPSD_QUEUES;
3529-
ifmgd->uapsd_max_sp_len = IEEE80211_DEFAULT_MAX_SP_LEN;
3528+
ifmgd->uapsd_queues = sdata->local->hw.uapsd_queues;
3529+
ifmgd->uapsd_max_sp_len = sdata->local->hw.uapsd_max_sp_len;
35303530
ifmgd->p2p_noa_index = -1;
35313531

35323532
mutex_init(&ifmgd->mtx);

0 commit comments

Comments
 (0)