Commit 6b41f832 authored by Johannes Berg's avatar Johannes Berg

wifi: mac80211: HT: make ieee80211_ht_cap_ie_to_sta_ht_cap() MLO-aware

Update ieee80211_ht_cap_ie_to_sta_ht_cap() to handle per-link
data.
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 2b4ad309
...@@ -1758,7 +1758,7 @@ static int sta_apply_parameters(struct ieee80211_local *local, ...@@ -1758,7 +1758,7 @@ static int sta_apply_parameters(struct ieee80211_local *local,
if (params->ht_capa) if (params->ht_capa)
ieee80211_ht_cap_ie_to_sta_ht_cap(sdata, sband, ieee80211_ht_cap_ie_to_sta_ht_cap(sdata, sband,
params->ht_capa, sta); params->ht_capa, sta, 0);
/* VHT can override some HT caps such as the A-MSDU max length */ /* VHT can override some HT caps such as the A-MSDU max length */
if (params->vht_capa) if (params->vht_capa)
......
...@@ -138,7 +138,7 @@ void ieee80211_apply_htcap_overrides(struct ieee80211_sub_if_data *sdata, ...@@ -138,7 +138,7 @@ void ieee80211_apply_htcap_overrides(struct ieee80211_sub_if_data *sdata,
bool ieee80211_ht_cap_ie_to_sta_ht_cap(struct ieee80211_sub_if_data *sdata, bool ieee80211_ht_cap_ie_to_sta_ht_cap(struct ieee80211_sub_if_data *sdata,
struct ieee80211_supported_band *sband, struct ieee80211_supported_band *sband,
const struct ieee80211_ht_cap *ht_cap_ie, const struct ieee80211_ht_cap *ht_cap_ie,
struct sta_info *sta) struct sta_info *sta, unsigned int link_id)
{ {
struct ieee80211_sta_ht_cap ht_cap, own_cap; struct ieee80211_sta_ht_cap ht_cap, own_cap;
u8 ampdu_info, tx_mcs_set_cap; u8 ampdu_info, tx_mcs_set_cap;
...@@ -243,11 +243,12 @@ bool ieee80211_ht_cap_ie_to_sta_ht_cap(struct ieee80211_sub_if_data *sdata, ...@@ -243,11 +243,12 @@ bool ieee80211_ht_cap_ie_to_sta_ht_cap(struct ieee80211_sub_if_data *sdata,
sta->sta.max_amsdu_len = IEEE80211_MAX_MPDU_LEN_HT_3839; sta->sta.max_amsdu_len = IEEE80211_MAX_MPDU_LEN_HT_3839;
apply: apply:
changed = memcmp(&sta->sta.deflink.ht_cap, &ht_cap, sizeof(ht_cap)); changed = memcmp(&sta->sta.link[link_id]->ht_cap,
&ht_cap, sizeof(ht_cap));
memcpy(&sta->sta.deflink.ht_cap, &ht_cap, sizeof(ht_cap)); memcpy(&sta->sta.link[link_id]->ht_cap, &ht_cap, sizeof(ht_cap));
switch (sdata->vif.bss_conf.chandef.width) { switch (sdata->vif.link_conf[link_id]->chandef.width) {
default: default:
WARN_ON_ONCE(1); WARN_ON_ONCE(1);
fallthrough; fallthrough;
...@@ -264,9 +265,9 @@ bool ieee80211_ht_cap_ie_to_sta_ht_cap(struct ieee80211_sub_if_data *sdata, ...@@ -264,9 +265,9 @@ bool ieee80211_ht_cap_ie_to_sta_ht_cap(struct ieee80211_sub_if_data *sdata,
break; break;
} }
sta->sta.deflink.bandwidth = bw; sta->sta.link[link_id]->bandwidth = bw;
sta->deflink.cur_max_bandwidth = sta->link[link_id]->cur_max_bandwidth =
ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40 ? ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40 ?
IEEE80211_STA_RX_BW_40 : IEEE80211_STA_RX_BW_20; IEEE80211_STA_RX_BW_40 : IEEE80211_STA_RX_BW_20;
......
...@@ -1051,7 +1051,7 @@ static void ieee80211_update_sta_info(struct ieee80211_sub_if_data *sdata, ...@@ -1051,7 +1051,7 @@ static void ieee80211_update_sta_info(struct ieee80211_sub_if_data *sdata,
memcpy(&htcap_ie, elems->ht_cap_elem, sizeof(htcap_ie)); memcpy(&htcap_ie, elems->ht_cap_elem, sizeof(htcap_ie));
rates_updated |= ieee80211_ht_cap_ie_to_sta_ht_cap(sdata, sband, rates_updated |= ieee80211_ht_cap_ie_to_sta_ht_cap(sdata, sband,
&htcap_ie, &htcap_ie,
sta); sta, 0);
if (elems->vht_operation && elems->vht_cap_elem && if (elems->vht_operation && elems->vht_cap_elem &&
sdata->u.ibss.chandef.width != NL80211_CHAN_WIDTH_20 && sdata->u.ibss.chandef.width != NL80211_CHAN_WIDTH_20 &&
......
...@@ -2065,7 +2065,7 @@ void ieee80211_apply_htcap_overrides(struct ieee80211_sub_if_data *sdata, ...@@ -2065,7 +2065,7 @@ void ieee80211_apply_htcap_overrides(struct ieee80211_sub_if_data *sdata,
bool ieee80211_ht_cap_ie_to_sta_ht_cap(struct ieee80211_sub_if_data *sdata, bool ieee80211_ht_cap_ie_to_sta_ht_cap(struct ieee80211_sub_if_data *sdata,
struct ieee80211_supported_band *sband, struct ieee80211_supported_band *sband,
const struct ieee80211_ht_cap *ht_cap_ie, const struct ieee80211_ht_cap *ht_cap_ie,
struct sta_info *sta); struct sta_info *sta, unsigned int link_id);
void ieee80211_send_delba(struct ieee80211_sub_if_data *sdata, void ieee80211_send_delba(struct ieee80211_sub_if_data *sdata,
const u8 *da, u16 tid, const u8 *da, u16 tid,
u16 initiator, u16 reason_code); u16 initiator, u16 reason_code);
......
...@@ -438,7 +438,7 @@ static void mesh_sta_info_init(struct ieee80211_sub_if_data *sdata, ...@@ -438,7 +438,7 @@ static void mesh_sta_info_init(struct ieee80211_sub_if_data *sdata,
sta->sta.deflink.supp_rates[sband->band] = rates; sta->sta.deflink.supp_rates[sband->band] = rates;
if (ieee80211_ht_cap_ie_to_sta_ht_cap(sdata, sband, if (ieee80211_ht_cap_ie_to_sta_ht_cap(sdata, sband,
elems->ht_cap_elem, sta)) elems->ht_cap_elem, sta, 0))
changed |= IEEE80211_RC_BW_CHANGED; changed |= IEEE80211_RC_BW_CHANGED;
ieee80211_vht_cap_ie_to_sta_vht_cap(sdata, sband, ieee80211_vht_cap_ie_to_sta_vht_cap(sdata, sband,
......
...@@ -3566,7 +3566,7 @@ static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata, ...@@ -3566,7 +3566,7 @@ static bool ieee80211_assoc_success(struct ieee80211_sub_if_data *sdata,
/* Set up internal HT/VHT capabilities */ /* Set up internal HT/VHT capabilities */
if (elems->ht_cap_elem && !(ifmgd->flags & IEEE80211_STA_DISABLE_HT)) if (elems->ht_cap_elem && !(ifmgd->flags & IEEE80211_STA_DISABLE_HT))
ieee80211_ht_cap_ie_to_sta_ht_cap(sdata, sband, ieee80211_ht_cap_ie_to_sta_ht_cap(sdata, sband,
elems->ht_cap_elem, sta); elems->ht_cap_elem, sta, 0);
if (elems->vht_cap_elem && !(ifmgd->flags & IEEE80211_STA_DISABLE_VHT)) if (elems->vht_cap_elem && !(ifmgd->flags & IEEE80211_STA_DISABLE_VHT))
ieee80211_vht_cap_ie_to_sta_vht_cap(sdata, sband, ieee80211_vht_cap_ie_to_sta_vht_cap(sdata, sband,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment