Skip to contentSkip to conversation

cfg80211/mac80211 patches from our internal tree 2023-06-08

PATCH New [email protected] 1 participant 5 messages Jun 11, 2023 mac80211

lore
Share & tools
lore
#0 lore raw

cover cfg80211/mac80211 patches from our internal tree 2023-06-08

From: Gregory Greenman <[email protected]>

Hi

A bunch of patches from our internal tree with mac80211 and cfg80211 changes. It's the continuation of the previous patch set, sent on 2023-06-08.

Thanks,
Gregory

Benjamin Berg (1):
wifi: mac80211: fragment per STA profile correctly

Ilan Peer (3):
wifi: mac80211: Add debugfs entry to report dormant links
wifi: mac80211: Do not use "non-MLD AP" syntax
wifi: mac80211: Fix permissions for valid_links debugfs entry

 include/net/mac80211.h        |  9 ++++++---
 net/mac80211/debugfs_netdev.c | 23 +++++++++++++++--------
 net/mac80211/ieee80211_i.h    |  2 +-
 net/mac80211/mlme.c           |  5 +++--
 net/mac80211/util.c           |  4 ++--
 5 files changed, 27 insertions(+), 16 deletions(-)
Signature · 1 line
2.38.1
#1 lore raw

PATCH 1/4 wifi: mac80211: Add debugfs entry to report dormant links

From: Ilan Peer <[email protected]>

Add debugfs entry to report dormant (valid but disabled) links.

---
 net/mac80211/debugfs_netdev.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
net/mac80211/debugfs_netdev.c +14 -0
index 3fea86c9a276..6253d0127207 100644
@@ -693,6 +693,19 @@ IEEE80211_IF_FILE(dot11MeshConnectedToAuthServer,
 	debugfs_create_file(#name, mode, sdata->vif.debugfs_dir, \
 			    sdata, &name##_ops)
 
+#define DEBUGFS_ADD_X(_bits, _name, _mode) \
+	debugfs_create_x##_bits(#_name, _mode, sdata->vif.debugfs_dir, \
+				&sdata->vif._name)
+
+#define DEBUGFS_ADD_X8(_name, _mode) \
+	DEBUGFS_ADD_X(8, _name, _mode)
+
+#define DEBUGFS_ADD_X16(_name, _mode) \
+	DEBUGFS_ADD_X(16, _name, _mode)
+
+#define DEBUGFS_ADD_X32(_name, _mode) \
+	DEBUGFS_ADD_X(32, _name, _mode)
+
 #define DEBUGFS_ADD(name) DEBUGFS_ADD_MODE(name, 0400)
 
 static void add_common_files(struct ieee80211_sub_if_data *sdata)
@@ -722,6 +735,7 @@ static void add_sta_files(struct ieee80211_sub_if_data *sdata)
 	DEBUGFS_ADD_MODE(tdls_wider_bw, 0600);
 	DEBUGFS_ADD_MODE(valid_links, 0200);
 	DEBUGFS_ADD_MODE(active_links, 0600);
+	DEBUGFS_ADD_X16(dormant_links, 0400);
 }
 
 static void add_ap_files(struct ieee80211_sub_if_data *sdata)
Signature · 1 line
2.38.1
#2 lore raw

PATCH 2/4 wifi: mac80211: Do not use "non-MLD AP" syntax

In reply to [email protected]

From: Ilan Peer <[email protected]>

Instead clarify the cases where link ID == 0 is intended for an AP STA that is not part of an AP MLD.

---
 include/net/mac80211.h | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
include/net/mac80211.h +6 -3
index b5704ef4308f..914448cb0ecf 100644
@@ -5282,7 +5282,8 @@ struct ieee80211_mutable_offsets {
  * @vif: &struct ieee80211_vif pointer from the add_interface callback.
  * @offs: &struct ieee80211_mutable_offsets pointer to struct that will
  *	receive the offsets that may be updated by the driver.
- * @link_id: the link id to which the beacon belongs (or 0 for a non-MLD AP)
+ * @link_id: the link id to which the beacon belongs (or 0 for an AP STA
+ *	that is not associated with AP MLD).
  *
  * If the driver implements beaconing modes, it must use this function to
  * obtain the beacon template.
@@ -5379,7 +5380,8 @@ void ieee80211_beacon_free_ema_list(struct ieee80211_ema_beacons *ema_beacons);
  * @tim_length: pointer to variable that will receive the TIM IE length,
  *	(including the ID and length bytes!).
  *	Set to 0 if invalid (in non-AP modes).
- * @link_id: the link id to which the beacon belongs (or 0 for a non-MLD AP)
+ * @link_id: the link id to which the beacon belongs (or 0 for an AP STA
+ *	that is not associated with AP MLD).
  *
  * If the driver implements beaconing modes, it must use this function to
  * obtain the beacon frame.
@@ -5402,7 +5404,8 @@ struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw,
  * ieee80211_beacon_get - beacon generation function
  * @hw: pointer obtained from ieee80211_alloc_hw().
  * @vif: &struct ieee80211_vif pointer from the add_interface callback.
- * @link_id: the link id to which the beacon belongs (or 0 for a non-MLD AP)
+ * @link_id: the link id to which the beacon belongs (or 0 for an AP STA
+ *	that is not associated with AP MLD).
  *
  * See ieee80211_beacon_get_tim().
  *
Signature · 1 line
2.38.1
#3 lore raw

PATCH 3/4 wifi: mac80211: Fix permissions for valid_links debugfs entry

In reply to [email protected]

From: Ilan Peer <[email protected]>

The entry should be a read only one and not a write only one. Fix it. While at it, change the code to use debugs_create_x16().

Fixes 3d9011029227 ("wifi: mac80211: implement link switching")
---
 net/mac80211/debugfs_netdev.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)
net/mac80211/debugfs_netdev.c +1 -8
index 6253d0127207..b45a45df062b 100644
@@ -598,13 +598,6 @@ static ssize_t ieee80211_if_parse_tsf(
 }
 IEEE80211_IF_FILE_RW(tsf);
 
-static ssize_t ieee80211_if_fmt_valid_links(const struct ieee80211_sub_if_data *sdata,
-					    char *buf, int buflen)
-{
-	return snprintf(buf, buflen, "0x%x\n", sdata->vif.valid_links);
-}
-IEEE80211_IF_FILE_R(valid_links);
-
 static ssize_t ieee80211_if_fmt_active_links(const struct ieee80211_sub_if_data *sdata,
 					     char *buf, int buflen)
 {
@@ -733,7 +726,7 @@ static void add_sta_files(struct ieee80211_sub_if_data *sdata)
 	DEBUGFS_ADD_MODE(uapsd_queues, 0600);
 	DEBUGFS_ADD_MODE(uapsd_max_sp_len, 0600);
 	DEBUGFS_ADD_MODE(tdls_wider_bw, 0600);
-	DEBUGFS_ADD_MODE(valid_links, 0200);
+	DEBUGFS_ADD_X16(valid_links, 0400);
 	DEBUGFS_ADD_MODE(active_links, 0600);
 	DEBUGFS_ADD_X16(dormant_links, 0400);
 }
Signature · 1 line
2.38.1
#4 lore raw

PATCH 4/4 wifi: mac80211: fragment per STA profile correctly

In reply to [email protected]

From: Benjamin Berg <[email protected]>

When fragmenting the ML per STA profile, the element ID should be IEEE80211_MLE_SUBELEM_PER_STA_PROFILE rather than WLAN_EID_FRAGMENT.

Change the helper function to take the to be used element ID and pass the appropriate value for each of the fragmentation levels.

Fixes 81151ce462e5 ("wifi: mac80211: support MLO authentication/association with one link")
---
 net/mac80211/ieee80211_i.h | 2 +-
 net/mac80211/mlme.c        | 5 +++--
 net/mac80211/util.c        | 4 ++--
 3 files changed, 6 insertions(+), 5 deletions(-)
net/mac80211/ieee80211_i.h +1 -1
index 561a2980f92f..4afd5095366c 100644
@@ -2317,7 +2317,7 @@ ieee802_11_parse_elems(const u8 *start, size_t len, bool action,
 	return ieee802_11_parse_elems_crc(start, len, action, 0, 0, bss);
 }
 
-void ieee80211_fragment_element(struct sk_buff *skb, u8 *len_pos);
+void ieee80211_fragment_element(struct sk_buff *skb, u8 *len_pos, u8 frag_id);
 
 extern const int ieee802_1d_to_ac[8];
 
net/mac80211/mlme.c +3 -2
index 6970d5e7ac8f..738822b82d3e 100644
@@ -1367,10 +1367,11 @@ static void ieee80211_assoc_add_ml_elem(struct ieee80211_sub_if_data *sdata,
 		ieee80211_add_non_inheritance_elem(skb, outer_present_elems,
 						   link_present_elems);
 
-		ieee80211_fragment_element(skb, subelem_len);
+		ieee80211_fragment_element(skb, subelem_len,
+					   IEEE80211_MLE_SUBELEM_FRAGMENT);
 	}
 
-	ieee80211_fragment_element(skb, ml_elem_len);
+	ieee80211_fragment_element(skb, ml_elem_len, WLAN_EID_FRAGMENT);
 }
 
 static int ieee80211_send_assoc(struct ieee80211_sub_if_data *sdata)
net/mac80211/util.c +2 -2
index 3aa363bdb6e0..2fc07717bcad 100644
@@ -5128,7 +5128,7 @@ u8 *ieee80211_ie_build_eht_cap(u8 *pos,
 	return pos;
 }
 
-void ieee80211_fragment_element(struct sk_buff *skb, u8 *len_pos)
+void ieee80211_fragment_element(struct sk_buff *skb, u8 *len_pos, u8 frag_id)
 {
 	unsigned int elem_len;
 
@@ -5148,7 +5148,7 @@ void ieee80211_fragment_element(struct sk_buff *skb, u8 *len_pos)
 		memmove(len_pos + 255 + 3, len_pos + 255 + 1, elem_len);
 		/* place the fragment ID */
 		len_pos += 255 + 1;
-		*len_pos = WLAN_EID_FRAGMENT;
+		*len_pos = frag_id;
 		/* and point to fragment length to update later */
 		len_pos++;
 	}
Signature · 1 line
2.38.1