工具/软件:
尊敬的 TI 专家:
我 在移植到 Linux 内核 5.10.240 (https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.10.240.tar.xz) 时遇到 CC33XX-Linux-MPU v1.0.2.10 补丁问题。
首先我应用了补丁 cc33xx_kernel.patch、但我发现了一些拒绝 (net/mac80211/mlme.c.Rej)。
@@ -235,11 +235,20 @@
if (sta_ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40) {
ieee80211_chandef_ht_oper(ht_oper, chandef);
} else {
+
mlme_dbg(sdata, "40 MHz not supported\n");
- /* 40 MHz (and 80 MHz) must be supported for VHT */
- ret = IEEE80211_CONN_DISABLE_VHT;
- /* also mark 40 MHz disabled */
- ret |= IEEE80211_CONN_DISABLE_40MHZ;
+
+ /* 40 MHz (and 80 MHz) must be supported for 5GHZ VHT
+ unless peer allows operating mode notification. If so a 20MHz
+ station can ask from peer to lower bandwidth. */
+ if (channel->band != NL80211_BAND_2GHZ){
+ ret = IEEE80211_CONN_DISABLE_40MHZ;
+ }else{
+ ret = IEEE80211_CONN_DISABLE_VHT;
+ /* also mark 40 MHz disabled */
+ ret |= IEEE80211_CONN_DISABLE_40MHZ;
+ }
+
goto out;
}
@@ -5027,6 +5039,25 @@
&assoc_data->link[link_id].ap_vht_cap,
assoc_data->link[link_id].conn_flags);
+ //Add operation mode notification element when operating at 20 MHz bandwidth
+ if(chanctx_conf->def.width == NL80211_CHAN_WIDTH_20)
+ {
+ /* Operating Mode Notification element */
+ rx_nss = 0;
+ rx_nss_type= 0;
+ opmode_notif |= IEEE80211_OPMODE_NOTIF_CHANWIDTH_20MHZ;
+ rx_nss <<= IEEE80211_OPMODE_NOTIF_RX_NSS_SHIFT;
+ rx_nss_type <<= (IEEE80211_OPMODE_NOTIF_RX_NSS_SHIFT + 3);
+ opmode_notif |= rx_nss;
+ opmode_notif |= rx_nss_type;
+
+ pos = skb_put(skb, 2 + sizeof(u8));
+
+ *pos++ = WLAN_EID_OPMODE_NOTIF;
+ *pos++ = sizeof(u8);
+ *pos++ = opmode_notif;
+ }
+
if (link)
link->conf->mu_mimo_owner = mu_mimo_owner;
ADD_PRESENT_ELEM(WLAN_EID_VHT_CAPABILITY);
@@ -5316,6 +5347,7 @@
/* HT, VHT, HE, EHT */
size += 2 + sizeof(struct ieee80211_ht_cap);
size += 2 + sizeof(struct ieee80211_vht_cap);
+ size += 2 + sizeof(u8); /*VHT operating mode Notification elem*/
size += 2 + 1 + sizeof(struct ieee80211_he_cap_elem) +
sizeof(struct ieee80211_he_mcs_nss_supp) +
IEEE80211_HE_PPE_THRES_MAX_LEN;
@@ -8654,9 +8688,15 @@
have_80mhz = true;
break;
}
+
+ //get operating mode notification capable element
+ const u8* extended_cap_ie = ieee80211_bss_get_ie(cbss,WLAN_EID_EXT_CAPABILITY);
+ if ( (extended_cap_ie) && (extended_cap_ie[1] >= 8) &&
+ (extended_cap_ie[9] & WLAN_EXT_CAPA8_OPMODE_NOTIF))
+ operating_mode_notif_capable = true;
- if (!have_80mhz) {
- sdata_info(sdata, "80 MHz not supported, disabling VHT\n");
+ if ((!have_80mhz) && (!operating_mode_notif_capable)) {
+ sdata_info(sdata, "80 MHz not supported nor operating mode notification capable, disabling VHT\n");
*conn_flags |= IEEE80211_CONN_DISABLE_VHT;
}
虽然修补程序工作正常、但与 cc33xx_kernel.patch 相比、我还发现一些代码被忽略。
我想确认以下代码对于 5.10.y 是否不必要?
+ //Add operation mode notification element when operating at 20 MHz bandwidth
+ if(chanctx_conf->def.width == NL80211_CHAN_WIDTH_20)
+ {
+ /* Operating Mode Notification element */
+ rx_nss = 0;
+ rx_nss_type= 0;
+ opmode_notif |= IEEE80211_OPMODE_NOTIF_CHANWIDTH_20MHZ;
+ rx_nss <<= IEEE80211_OPMODE_NOTIF_RX_NSS_SHIFT;
+ rx_nss_type <<= (IEEE80211_OPMODE_NOTIF_RX_NSS_SHIFT + 3);
+ opmode_notif |= rx_nss;
+ opmode_notif |= rx_nss_type;
+
+ pos = skb_put(skb, 2 + sizeof(u8));
+
+ *pos++ = WLAN_EID_OPMODE_NOTIF;
+ *pos++ = sizeof(u8);
+ *pos++ = opmode_notif;
+ }
+
@@ -8654,9 +8688,15 @@
have_80mhz = true;
break;
}
+
+ //get operating mode notification capable element
+ const u8* extended_cap_ie = ieee80211_bss_get_ie(cbss,WLAN_EID_EXT_CAPABILITY);
+ if ( (extended_cap_ie) && (extended_cap_ie[1] >= 8) &&
+ (extended_cap_ie[9] & WLAN_EXT_CAPA8_OPMODE_NOTIF))
+ operating_mode_notif_capable = true;
- if (!have_80mhz) {
- sdata_info(sdata, "80 MHz not supported, disabling VHT\n");
+ if ((!have_80mhz) && (!operating_mode_notif_capable)) {
+ sdata_info(sdata, "80 MHz not supported nor operating mode notification capable, disabling VHT\n");
*conn_flags |= IEEE80211_CONN_DISABLE_VHT;
}