Skip to content

Commit 1bb9a8a

Browse files
committed
mac80211: use HE 6 GHz band capability and pass it to the driver
In order to handle 6 GHz AP side, take the HE 6 GHz band capability data and pass it to the driver (which needs it for A-MPDU spacing and A-MPDU length). Link: https://lore.kernel.org/r/[email protected] Co-developed-by: Rajkumar Manoharan <[email protected]> Signed-off-by: Rajkumar Manoharan <[email protected]> Link: https://lore.kernel.org/r/20200528213443.784e4890d82f.I5f1230d5ab27e84e7bbe88e3645b24ea15a0c146@changeid Signed-off-by: Johannes Berg <[email protected]>
1 parent 3b3ec3d commit 1bb9a8a

File tree

6 files changed

+59
-3
lines changed

6 files changed

+59
-3
lines changed

include/net/mac80211.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Copyright 2007-2010 Johannes Berg <[email protected]>
88
* Copyright 2013-2014 Intel Mobile Communications GmbH
99
* Copyright (C) 2015 - 2017 Intel Deutschland GmbH
10-
* Copyright (C) 2018 - 2019 Intel Corporation
10+
* Copyright (C) 2018 - 2020 Intel Corporation
1111
*/
1212

1313
#ifndef MAC80211_H
@@ -1977,6 +1977,7 @@ struct ieee80211_sta_txpwr {
19771977
* @ht_cap: HT capabilities of this STA; restricted to our own capabilities
19781978
* @vht_cap: VHT capabilities of this STA; restricted to our own capabilities
19791979
* @he_cap: HE capabilities of this STA
1980+
* @he_6ghz_capa: on 6 GHz, holds the HE 6 GHz band capabilities
19801981
* @max_rx_aggregation_subframes: maximal amount of frames in a single AMPDU
19811982
* that this station is allowed to transmit to us.
19821983
* Can be modified by driver.
@@ -2016,6 +2017,7 @@ struct ieee80211_sta {
20162017
struct ieee80211_sta_ht_cap ht_cap;
20172018
struct ieee80211_sta_vht_cap vht_cap;
20182019
struct ieee80211_sta_he_cap he_cap;
2020+
struct ieee80211_he_6ghz_capa he_6ghz_capa;
20192021
u16 max_rx_aggregation_subframes;
20202022
bool wme;
20212023
u8 uapsd_queues;

net/mac80211/cfg.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1520,7 +1520,9 @@ static int sta_apply_parameters(struct ieee80211_local *local,
15201520
if (params->he_capa)
15211521
ieee80211_he_cap_ie_to_sta_he_cap(sdata, sband,
15221522
(void *)params->he_capa,
1523-
params->he_capa_len, sta);
1523+
params->he_capa_len,
1524+
(void *)params->he_6ghz_capa,
1525+
sta);
15241526

15251527
if (params->opmode_notif_used) {
15261528
/* returned value is only needed for rc update, but the

net/mac80211/he.c

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,55 @@
88

99
#include "ieee80211_i.h"
1010

11+
static void
12+
ieee80211_update_from_he_6ghz_capa(const struct ieee80211_he_6ghz_capa *he_6ghz_capa,
13+
struct sta_info *sta)
14+
{
15+
enum ieee80211_smps_mode smps_mode;
16+
17+
if (sta->sdata->vif.type == NL80211_IFTYPE_AP ||
18+
sta->sdata->vif.type == NL80211_IFTYPE_AP_VLAN) {
19+
switch (le16_get_bits(he_6ghz_capa->capa,
20+
IEEE80211_HE_6GHZ_CAP_SM_PS)) {
21+
case WLAN_HT_CAP_SM_PS_INVALID:
22+
case WLAN_HT_CAP_SM_PS_STATIC:
23+
smps_mode = IEEE80211_SMPS_STATIC;
24+
break;
25+
case WLAN_HT_CAP_SM_PS_DYNAMIC:
26+
smps_mode = IEEE80211_SMPS_DYNAMIC;
27+
break;
28+
case WLAN_HT_CAP_SM_PS_DISABLED:
29+
smps_mode = IEEE80211_SMPS_OFF;
30+
break;
31+
}
32+
33+
sta->sta.smps_mode = smps_mode;
34+
} else {
35+
sta->sta.smps_mode = IEEE80211_SMPS_OFF;
36+
}
37+
38+
switch (le16_get_bits(he_6ghz_capa->capa,
39+
IEEE80211_HE_6GHZ_CAP_MAX_MPDU_LEN)) {
40+
case IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_11454:
41+
sta->sta.max_amsdu_len = IEEE80211_MAX_MPDU_LEN_VHT_11454;
42+
break;
43+
case IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_7991:
44+
sta->sta.max_amsdu_len = IEEE80211_MAX_MPDU_LEN_VHT_7991;
45+
break;
46+
case IEEE80211_VHT_CAP_MAX_MPDU_LENGTH_3895:
47+
default:
48+
sta->sta.max_amsdu_len = IEEE80211_MAX_MPDU_LEN_VHT_3895;
49+
break;
50+
}
51+
52+
sta->sta.he_6ghz_capa = *he_6ghz_capa;
53+
}
54+
1155
void
1256
ieee80211_he_cap_ie_to_sta_he_cap(struct ieee80211_sub_if_data *sdata,
1357
struct ieee80211_supported_band *sband,
1458
const u8 *he_cap_ie, u8 he_cap_len,
59+
const struct ieee80211_he_6ghz_capa *he_6ghz_capa,
1560
struct sta_info *sta)
1661
{
1762
struct ieee80211_sta_he_cap *he_cap = &sta->sta.he_cap;
@@ -53,6 +98,9 @@ ieee80211_he_cap_ie_to_sta_he_cap(struct ieee80211_sub_if_data *sdata,
5398

5499
sta->cur_max_bandwidth = ieee80211_sta_cap_rx_bw(sta);
55100
sta->sta.bandwidth = ieee80211_sta_cur_vht_bw(sta);
101+
102+
if (sband->band == NL80211_BAND_6GHZ && he_6ghz_capa)
103+
ieee80211_update_from_he_6ghz_capa(he_6ghz_capa, sta);
56104
}
57105

58106
void

net/mac80211/ieee80211_i.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1899,6 +1899,7 @@ void
18991899
ieee80211_he_cap_ie_to_sta_he_cap(struct ieee80211_sub_if_data *sdata,
19001900
struct ieee80211_supported_band *sband,
19011901
const u8 *he_cap_ie, u8 he_cap_len,
1902+
const struct ieee80211_he_6ghz_capa *he_6ghz_capa,
19021903
struct sta_info *sta);
19031904
void
19041905
ieee80211_he_spr_ie_to_bss_conf(struct ieee80211_vif *vif,

net/mac80211/mesh_plink.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,9 @@ static void mesh_sta_info_init(struct ieee80211_sub_if_data *sdata,
444444
elems->vht_cap_elem, sta);
445445

446446
ieee80211_he_cap_ie_to_sta_he_cap(sdata, sband, elems->he_cap,
447-
elems->he_cap_len, sta);
447+
elems->he_cap_len,
448+
elems->he_6ghz_capa,
449+
sta);
448450

449451
if (bw != sta->sta.bandwidth)
450452
changed |= IEEE80211_RC_BW_CHANGED;

net/mac80211/mlme.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3430,6 +3430,7 @@ static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata,
34303430
ieee80211_he_cap_ie_to_sta_he_cap(sdata, sband,
34313431
elems->he_cap,
34323432
elems->he_cap_len,
3433+
elems->he_6ghz_capa,
34333434
sta);
34343435

34353436
bss_conf->he_support = sta->sta.he_cap.has_he;

0 commit comments

Comments
 (0)