History

mac80211: add more HT/VHT/HE state logging

Add more logging in places that affect HT/VHT/HE state, so things get easier to debug.

Johannes Berg committed 4 years ago

Commit 636ccda1 parent 7f599ae1 file · +33 −12Browse files

Unified · Split

net/mac80211/mlme.c+33−12
@@ -164,12 +164,15 @@ ieee80211_determine_chantype(struct ieee80211_sub_if_data *sdata, · 163 unmodified lines
164164 chandef->freq1_offset = channel->freq_offset;
165165
166166 if (channel->band == NL80211_BAND_6GHZ) {
167− if (!ieee80211_chandef_he_6ghz_oper(sdata, he_oper, chandef))
167+ if (!ieee80211_chandef_he_6ghz_oper(sdata, he_oper, chandef)) {
168+ mlme_dbg(sdata,
169+ "bad 6 GHz operation, disabling HT/VHT/HE\n");
168170 ret = IEEE80211_STA_DISABLE_HT |
169171 IEEE80211_STA_DISABLE_VHT |
170172 IEEE80211_STA_DISABLE_HE;
171− else
173+ } else {
172174 ret = 0;
175+ }
173176 vht_chandef = *chandef;
174177 goto out;
175178 } else if (sband->band == NL80211_BAND_S1GHZ) {
@@ -190,6 +193,7 @@ ieee80211_determine_chantype(struct ieee80211_sub_if_data *sdata, · 14 unmodified lines
190193 ieee80211_apply_htcap_overrides(sdata, &sta_ht_cap);
191194
192195 if (!ht_oper || !sta_ht_cap.ht_supported) {
196+ mlme_dbg(sdata, "HT operation missing / HT not supported\n");
193197 ret = IEEE80211_STA_DISABLE_HT |
194198 IEEE80211_STA_DISABLE_VHT |
195199 IEEE80211_STA_DISABLE_HE;
@@ -223,6 +227,7 @@ ieee80211_determine_chantype(struct ieee80211_sub_if_data *sdata, · 27 unmodified lines
223227 if (sta_ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) {
224228 ieee80211_chandef_ht_oper(ht_oper, chandef);
225229 } else {
230+ mlme_dbg(sdata, "40 MHz not supported\n");
226231 /* 40 MHz (and 80 MHz) must be supported for VHT */
227232 ret = IEEE80211_STA_DISABLE_VHT;
228233 /* also mark 40 MHz disabled */
@@ -231,6 +236,7 @@ ieee80211_determine_chantype(struct ieee80211_sub_if_data *sdata, · 2 unmodified lines
231236 }
232237
233238 if (!vht_oper || !sband->vht_cap.vht_supported) {
239+ mlme_dbg(sdata, "VHT operation missing / VHT not supported\n");
234240 ret = IEEE80211_STA_DISABLE_VHT;
235241 goto out;
236242 }
@@ -253,7 +259,7 @@ ieee80211_determine_chantype(struct ieee80211_sub_if_data *sdata, · 16 unmodified lines
253259 &vht_chandef)) {
254260 if (!(ifmgd->flags & IEEE80211_STA_DISABLE_HE))
255261 sdata_info(sdata,
256− "HE AP VHT information is invalid, disable HE\n");
262+ "HE AP VHT information is invalid, disabling HE\n");
257263 ret = IEEE80211_STA_DISABLE_HE;
258264 goto out;
259265 }
@@ -263,7 +269,7 @@ ieee80211_determine_chantype(struct ieee80211_sub_if_data *sdata, · 3 unmodified lines
263269 &vht_chandef)) {
264270 if (!(ifmgd->flags & IEEE80211_STA_DISABLE_VHT))
265271 sdata_info(sdata,
266− "AP VHT information is invalid, disable VHT\n");
272+ "AP VHT information is invalid, disabling VHT\n");
267273 ret = IEEE80211_STA_DISABLE_VHT;
268274 goto out;
269275 }
@@ -271,7 +277,7 @@ ieee80211_determine_chantype(struct ieee80211_sub_if_data *sdata, · 1 unmodified line
271277 if (!cfg80211_chandef_valid(&vht_chandef)) {
272278 if (!(ifmgd->flags & IEEE80211_STA_DISABLE_VHT))
273279 sdata_info(sdata,
274− "AP VHT information is invalid, disable VHT\n");
280+ "AP VHT information is invalid, disabling VHT\n");
275281 ret = IEEE80211_STA_DISABLE_VHT;
276282 goto out;
277283 }
@@ -284,7 +290,7 @@ ieee80211_determine_chantype(struct ieee80211_sub_if_data *sdata, · 6 unmodified lines
284290 if (!cfg80211_chandef_compatible(chandef, &vht_chandef)) {
285291 if (!(ifmgd->flags & IEEE80211_STA_DISABLE_VHT))
286292 sdata_info(sdata,
287− "AP VHT information doesn't match HT, disable VHT\n");
293+ "AP VHT information doesn't match HT, disabling VHT\n");
288294 ret = IEEE80211_STA_DISABLE_VHT;
289295 goto out;
290296 }
@@ -5036,19 +5042,23 @@ static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata, · 4745 unmodified lines
50365042
50375043 /* disable HT/VHT/HE if we don't support them */
50385044 if (!sband->ht_cap.ht_supported && !is_6ghz) {
5045+ mlme_dbg(sdata, "HT not supported, disabling HT/VHT/HE\n");
50395046 ifmgd->flags |= IEEE80211_STA_DISABLE_HT;
50405047 ifmgd->flags |= IEEE80211_STA_DISABLE_VHT;
50415048 ifmgd->flags |= IEEE80211_STA_DISABLE_HE;
50425049 }
50435050
50445051 if (!sband->vht_cap.vht_supported && is_5ghz) {
5052+ mlme_dbg(sdata, "VHT not supported, disabling VHT/HE\n");
50455053 ifmgd->flags |= IEEE80211_STA_DISABLE_VHT;
50465054 ifmgd->flags |= IEEE80211_STA_DISABLE_HE;
50475055 }
50485056
50495057 if (!ieee80211_get_he_iftype_cap(sband,
5050− ieee80211_vif_type_p2p(&sdata->vif)))
5058+ ieee80211_vif_type_p2p(&sdata->vif))) {
5059+ mlme_dbg(sdata, "HE not supported, disabling it\n");
50515060 ifmgd->flags |= IEEE80211_STA_DISABLE_HE;
5061+ }
50525062
50535063 if (!(ifmgd->flags & IEEE80211_STA_DISABLE_HT) && !is_6ghz) {
50545064 ht_oper = elems->ht_operation;
@@ -5072,6 +5082,8 @@ static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata, · 17 unmodified lines
50725082 }
50735083
50745084 if (!elems->vht_cap_elem) {
5085+ sdata_info(sdata,
5086+ "bad VHT capabilities, disabling VHT\n");
50755087 ifmgd->flags |= IEEE80211_STA_DISABLE_VHT;
50765088 vht_oper = NULL;
50775089 }
@@ -5119,8 +5131,10 @@ static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata, · 41 unmodified lines
51195131 break;
51205132 }
51215133
5122− if (!have_80mhz)
5134+ if (!have_80mhz) {
5135+ sdata_info(sdata, "80 MHz not supported, disabling VHT\n");
51235136 ifmgd->flags |= IEEE80211_STA_DISABLE_VHT;
5137+ }
51245138
51255139 if (sband->band == NL80211_BAND_S1GHZ) {
51265140 s1g_oper = elems->s1g_oper;
@@ -5684,12 +5698,14 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata, · 557 unmodified lines
56845698 else if (!is_6ghz)
56855699 ifmgd->flags |= IEEE80211_STA_DISABLE_HT;
56865700 vht_elem = ieee80211_bss_get_elem(req->bss, WLAN_EID_VHT_CAPABILITY);
5687− if (vht_elem && vht_elem->datalen >= sizeof(struct ieee80211_vht_cap))
5701+ if (vht_elem && vht_elem->datalen >= sizeof(struct ieee80211_vht_cap)) {
56885702 memcpy(&assoc_data->ap_vht_cap, vht_elem->data,
56895703 sizeof(struct ieee80211_vht_cap));
5690− else if (is_5ghz)
5704+ } else if (is_5ghz) {
5705+ sdata_info(sdata, "VHT capa missing/short, disabling VHT/HE\n");
56915706 ifmgd->flags |= IEEE80211_STA_DISABLE_VHT |
56925707 IEEE80211_STA_DISABLE_HE;
5708+ }
56935709 rcu_read_unlock();
56945710
56955711 if (WARN((sdata->vif.driver_flags & IEEE80211_VIF_SUPPORTS_UAPSD) &&
@@ -5763,16 +5779,21 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata, · 67 unmodified lines
57635779 }
57645780
57655781 if (req->flags & ASSOC_REQ_DISABLE_HT) {
5782+ mlme_dbg(sdata, "HT disabled by flag, disabling HT/VHT/HE\n");
57665783 ifmgd->flags |= IEEE80211_STA_DISABLE_HT;
57675784 ifmgd->flags |= IEEE80211_STA_DISABLE_VHT;
57685785 ifmgd->flags |= IEEE80211_STA_DISABLE_HE;
57695786 }
57705787
5771− if (req->flags & ASSOC_REQ_DISABLE_VHT)
5788+ if (req->flags & ASSOC_REQ_DISABLE_VHT) {
5789+ mlme_dbg(sdata, "VHT disabled by flag, disabling VHT\n");
57725790 ifmgd->flags |= IEEE80211_STA_DISABLE_VHT;
5791+ }
57735792
5774− if (req->flags & ASSOC_REQ_DISABLE_HE)
5793+ if (req->flags & ASSOC_REQ_DISABLE_HE) {
5794+ mlme_dbg(sdata, "HE disabled by flag, disabling VHT\n");
57755795 ifmgd->flags |= IEEE80211_STA_DISABLE_HE;
5796+ }
57765797
57775798 err = ieee80211_prep_connection(sdata, req->bss, true, override);
57785799 if (err)

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t