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
164 chandef->freq1_offset = channel->freq_offset;164 chandef->freq1_offset = channel->freq_offset;
165 165
166 if (channel->band == NL80211_BAND_6GHZ) {166 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");
168 ret = IEEE80211_STA_DISABLE_HT |170 ret = IEEE80211_STA_DISABLE_HT |
169 IEEE80211_STA_DISABLE_VHT |171 IEEE80211_STA_DISABLE_VHT |
170 IEEE80211_STA_DISABLE_HE;172 IEEE80211_STA_DISABLE_HE;
171 else173 } else {
172 ret = 0;174 ret = 0;
175 }
173 vht_chandef = *chandef;176 vht_chandef = *chandef;
174 goto out;177 goto out;
175 } else if (sband->band == NL80211_BAND_S1GHZ) {178 } else if (sband->band == NL80211_BAND_S1GHZ) {
@@ -190,6 +193,7 @@ ieee80211_determine_chantype(struct ieee80211_sub_if_data *sdata, · 14 unmodified lines
190 ieee80211_apply_htcap_overrides(sdata, &sta_ht_cap);193 ieee80211_apply_htcap_overrides(sdata, &sta_ht_cap);
191 194
192 if (!ht_oper || !sta_ht_cap.ht_supported) {195 if (!ht_oper || !sta_ht_cap.ht_supported) {
196 mlme_dbg(sdata, "HT operation missing / HT not supported\n");
193 ret = IEEE80211_STA_DISABLE_HT |197 ret = IEEE80211_STA_DISABLE_HT |
194 IEEE80211_STA_DISABLE_VHT |198 IEEE80211_STA_DISABLE_VHT |
195 IEEE80211_STA_DISABLE_HE;199 IEEE80211_STA_DISABLE_HE;
@@ -223,6 +227,7 @@ ieee80211_determine_chantype(struct ieee80211_sub_if_data *sdata, · 27 unmodified lines
223 if (sta_ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) {227 if (sta_ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) {
224 ieee80211_chandef_ht_oper(ht_oper, chandef);228 ieee80211_chandef_ht_oper(ht_oper, chandef);
225 } else {229 } else {
230 mlme_dbg(sdata, "40 MHz not supported\n");
226 /* 40 MHz (and 80 MHz) must be supported for VHT */231 /* 40 MHz (and 80 MHz) must be supported for VHT */
227 ret = IEEE80211_STA_DISABLE_VHT;232 ret = IEEE80211_STA_DISABLE_VHT;
228 /* also mark 40 MHz disabled */233 /* also mark 40 MHz disabled */
@@ -231,6 +236,7 @@ ieee80211_determine_chantype(struct ieee80211_sub_if_data *sdata, · 2 unmodified lines
231 }236 }
232 237
233 if (!vht_oper || !sband->vht_cap.vht_supported) {238 if (!vht_oper || !sband->vht_cap.vht_supported) {
239 mlme_dbg(sdata, "VHT operation missing / VHT not supported\n");
234 ret = IEEE80211_STA_DISABLE_VHT;240 ret = IEEE80211_STA_DISABLE_VHT;
235 goto out;241 goto out;
236 }242 }
@@ -253,7 +259,7 @@ ieee80211_determine_chantype(struct ieee80211_sub_if_data *sdata, · 16 unmodified lines
253 &vht_chandef)) {259 &vht_chandef)) {
254 if (!(ifmgd->flags & IEEE80211_STA_DISABLE_HE))260 if (!(ifmgd->flags & IEEE80211_STA_DISABLE_HE))
255 sdata_info(sdata,261 sdata_info(sdata,
256 "HE AP VHT information is invalid, disable HE\n");262 "HE AP VHT information is invalid, disabling HE\n");
257 ret = IEEE80211_STA_DISABLE_HE;263 ret = IEEE80211_STA_DISABLE_HE;
258 goto out;264 goto out;
259 }265 }
@@ -263,7 +269,7 @@ ieee80211_determine_chantype(struct ieee80211_sub_if_data *sdata, · 3 unmodified lines
263 &vht_chandef)) {269 &vht_chandef)) {
264 if (!(ifmgd->flags & IEEE80211_STA_DISABLE_VHT))270 if (!(ifmgd->flags & IEEE80211_STA_DISABLE_VHT))
265 sdata_info(sdata,271 sdata_info(sdata,
266 "AP VHT information is invalid, disable VHT\n");272 "AP VHT information is invalid, disabling VHT\n");
267 ret = IEEE80211_STA_DISABLE_VHT;273 ret = IEEE80211_STA_DISABLE_VHT;
268 goto out;274 goto out;
269 }275 }
@@ -271,7 +277,7 @@ ieee80211_determine_chantype(struct ieee80211_sub_if_data *sdata, · 1 unmodified line
271 if (!cfg80211_chandef_valid(&vht_chandef)) {277 if (!cfg80211_chandef_valid(&vht_chandef)) {
272 if (!(ifmgd->flags & IEEE80211_STA_DISABLE_VHT))278 if (!(ifmgd->flags & IEEE80211_STA_DISABLE_VHT))
273 sdata_info(sdata,279 sdata_info(sdata,
274 "AP VHT information is invalid, disable VHT\n");280 "AP VHT information is invalid, disabling VHT\n");
275 ret = IEEE80211_STA_DISABLE_VHT;281 ret = IEEE80211_STA_DISABLE_VHT;
276 goto out;282 goto out;
277 }283 }
@@ -284,7 +290,7 @@ ieee80211_determine_chantype(struct ieee80211_sub_if_data *sdata, · 6 unmodified lines
284 if (!cfg80211_chandef_compatible(chandef, &vht_chandef)) {290 if (!cfg80211_chandef_compatible(chandef, &vht_chandef)) {
285 if (!(ifmgd->flags & IEEE80211_STA_DISABLE_VHT))291 if (!(ifmgd->flags & IEEE80211_STA_DISABLE_VHT))
286 sdata_info(sdata,292 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");
288 ret = IEEE80211_STA_DISABLE_VHT;294 ret = IEEE80211_STA_DISABLE_VHT;
289 goto out;295 goto out;
290 }296 }
@@ -5036,19 +5042,23 @@ static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata, · 4745 unmodified lines
5036 5042
5037 /* disable HT/VHT/HE if we don't support them */5043 /* disable HT/VHT/HE if we don't support them */
5038 if (!sband->ht_cap.ht_supported && !is_6ghz) {5044 if (!sband->ht_cap.ht_supported && !is_6ghz) {
5045 mlme_dbg(sdata, "HT not supported, disabling HT/VHT/HE\n");
5039 ifmgd->flags |= IEEE80211_STA_DISABLE_HT;5046 ifmgd->flags |= IEEE80211_STA_DISABLE_HT;
5040 ifmgd->flags |= IEEE80211_STA_DISABLE_VHT;5047 ifmgd->flags |= IEEE80211_STA_DISABLE_VHT;
5041 ifmgd->flags |= IEEE80211_STA_DISABLE_HE;5048 ifmgd->flags |= IEEE80211_STA_DISABLE_HE;
5042 }5049 }
5043 5050
5044 if (!sband->vht_cap.vht_supported && is_5ghz) {5051 if (!sband->vht_cap.vht_supported && is_5ghz) {
5052 mlme_dbg(sdata, "VHT not supported, disabling VHT/HE\n");
5045 ifmgd->flags |= IEEE80211_STA_DISABLE_VHT;5053 ifmgd->flags |= IEEE80211_STA_DISABLE_VHT;
5046 ifmgd->flags |= IEEE80211_STA_DISABLE_HE;5054 ifmgd->flags |= IEEE80211_STA_DISABLE_HE;
5047 }5055 }
5048 5056
5049 if (!ieee80211_get_he_iftype_cap(sband,5057 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");
5051 ifmgd->flags |= IEEE80211_STA_DISABLE_HE;5060 ifmgd->flags |= IEEE80211_STA_DISABLE_HE;
5061 }
5052 5062
5053 if (!(ifmgd->flags & IEEE80211_STA_DISABLE_HT) && !is_6ghz) {5063 if (!(ifmgd->flags & IEEE80211_STA_DISABLE_HT) && !is_6ghz) {
5054 ht_oper = elems->ht_operation;5064 ht_oper = elems->ht_operation;
@@ -5072,6 +5082,8 @@ static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata, · 17 unmodified lines
5072 }5082 }
5073 5083
5074 if (!elems->vht_cap_elem) {5084 if (!elems->vht_cap_elem) {
5085 sdata_info(sdata,
5086 "bad VHT capabilities, disabling VHT\n");
5075 ifmgd->flags |= IEEE80211_STA_DISABLE_VHT;5087 ifmgd->flags |= IEEE80211_STA_DISABLE_VHT;
5076 vht_oper = NULL;5088 vht_oper = NULL;
5077 }5089 }
@@ -5119,8 +5131,10 @@ static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata, · 41 unmodified lines
5119 break;5131 break;
5120 }5132 }
5121 5133
5122 if (!have_80mhz)5134 if (!have_80mhz) {
5135 sdata_info(sdata, "80 MHz not supported, disabling VHT\n");
5123 ifmgd->flags |= IEEE80211_STA_DISABLE_VHT;5136 ifmgd->flags |= IEEE80211_STA_DISABLE_VHT;
5137 }
5124 5138
5125 if (sband->band == NL80211_BAND_S1GHZ) {5139 if (sband->band == NL80211_BAND_S1GHZ) {
5126 s1g_oper = elems->s1g_oper;5140 s1g_oper = elems->s1g_oper;
@@ -5684,12 +5698,14 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata, · 557 unmodified lines
5684 else if (!is_6ghz)5698 else if (!is_6ghz)
5685 ifmgd->flags |= IEEE80211_STA_DISABLE_HT;5699 ifmgd->flags |= IEEE80211_STA_DISABLE_HT;
5686 vht_elem = ieee80211_bss_get_elem(req->bss, WLAN_EID_VHT_CAPABILITY);5700 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)) {
5688 memcpy(&assoc_data->ap_vht_cap, vht_elem->data,5702 memcpy(&assoc_data->ap_vht_cap, vht_elem->data,
5689 sizeof(struct ieee80211_vht_cap));5703 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");
5691 ifmgd->flags |= IEEE80211_STA_DISABLE_VHT |5706 ifmgd->flags |= IEEE80211_STA_DISABLE_VHT |
5692 IEEE80211_STA_DISABLE_HE;5707 IEEE80211_STA_DISABLE_HE;
5708 }
5693 rcu_read_unlock();5709 rcu_read_unlock();
5694 5710
5695 if (WARN((sdata->vif.driver_flags & IEEE80211_VIF_SUPPORTS_UAPSD) &&5711 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
5763 }5779 }
5764 5780
5765 if (req->flags & ASSOC_REQ_DISABLE_HT) {5781 if (req->flags & ASSOC_REQ_DISABLE_HT) {
5782 mlme_dbg(sdata, "HT disabled by flag, disabling HT/VHT/HE\n");
5766 ifmgd->flags |= IEEE80211_STA_DISABLE_HT;5783 ifmgd->flags |= IEEE80211_STA_DISABLE_HT;
5767 ifmgd->flags |= IEEE80211_STA_DISABLE_VHT;5784 ifmgd->flags |= IEEE80211_STA_DISABLE_VHT;
5768 ifmgd->flags |= IEEE80211_STA_DISABLE_HE;5785 ifmgd->flags |= IEEE80211_STA_DISABLE_HE;
5769 }5786 }
5770 5787
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");
5772 ifmgd->flags |= IEEE80211_STA_DISABLE_VHT;5790 ifmgd->flags |= IEEE80211_STA_DISABLE_VHT;
5791 }
5773 5792
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");
5775 ifmgd->flags |= IEEE80211_STA_DISABLE_HE;5795 ifmgd->flags |= IEEE80211_STA_DISABLE_HE;
5796 }
5776 5797
5777 err = ieee80211_prep_connection(sdata, req->bss, true, override);5798 err = ieee80211_prep_connection(sdata, req->bss, true, override);
5778 if (err)5799 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