Commit de86c5f6 authored by Ilan Peer's avatar Ilan Peer Committed by Johannes Berg
Browse files

wifi: mac80211: Add support for EPCS configuration



Add support for configuring EPCS state:

- When EPCS is enabled, send an EPCS enable request action frame
  to the AP. When the AP replies with EPCS enable response, enable
  EPCS by applying the QoS parameters provided by the AP. Do so for
  all the valid MLD links. Once EPCS is enabled, support processing
  of unsolicited EPCS enable response frames.
- When EPCS is disabled, send an EPCS teardown request to the AP
  and apply the QoS parameters as obtained from the last received
  beacons. Do so for all the valid links.

Signed-off-by: default avatarIlan Peer <ilan.peer@intel.com>
Signed-off-by: default avatarMiri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250205110958.7a90afd7e140.I3f602d65f5c1fd849d6c70b12307dda33aa91ccb@changeid


Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 9696b80b
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -1543,6 +1543,10 @@ struct ieee80211_mgmt {
					u8 count;
					u8 variable[];
				} __packed ml_reconf_resp;
				struct {
					u8 action_code;
					u8 variable[];
				} __packed epcs;
			} u;
		} __packed action;
		DECLARE_FLEX_ARRAY(u8, body); /* Generic frame body */
@@ -5570,6 +5574,9 @@ static inline bool ieee80211_mle_reconf_sta_prof_size_ok(const u8 *data,
	       fixed + prof->sta_info_len - 1 <= len;
}

#define IEEE80211_MLE_STA_EPCS_CONTROL_LINK_ID			0x000f
#define IEEE80211_EPCS_ENA_RESP_BODY_LEN                        3

static inline bool ieee80211_tid_to_link_map_size_ok(const u8 *data, size_t len)
{
	const struct ieee80211_ttlm_elem *t2l = (const void *)data;
+2 −1
Original line number Diff line number Diff line
@@ -702,6 +702,7 @@ struct ieee80211_parsed_tpe {
 * @tpe: transmit power envelope information
 * @pwr_reduction: power constraint of BSS.
 * @eht_support: does this BSS support EHT
 * @epcs_support: does this BSS support EPCS
 * @csa_active: marks whether a channel switch is going on.
 * @mu_mimo_owner: indicates interface owns MU-MIMO capability
 * @chanctx_conf: The channel context this interface is assigned to, or %NULL
@@ -823,7 +824,7 @@ struct ieee80211_bss_conf {

	u8 pwr_reduction;
	bool eht_support;

	bool epcs_support;
	bool csa_active;

	bool mu_mimo_owner;
+9 −0
Original line number Diff line number Diff line
@@ -5196,6 +5196,14 @@ ieee80211_assoc_ml_reconf(struct wiphy *wiphy, struct net_device *dev,
	return ieee80211_mgd_assoc_ml_reconf(sdata, add_links, rem_links);
}

static int
ieee80211_set_epcs(struct wiphy *wiphy, struct net_device *dev, bool enable)
{
	struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);

	return ieee80211_mgd_set_epcs(sdata, enable);
}

const struct cfg80211_ops mac80211_config_ops = {
	.add_virtual_intf = ieee80211_add_iface,
	.del_virtual_intf = ieee80211_del_iface,
@@ -5311,4 +5319,5 @@ const struct cfg80211_ops mac80211_config_ops = {
	.set_ttlm = ieee80211_set_ttlm,
	.get_radio_mask = ieee80211_get_radio_mask,
	.assoc_ml_reconf = ieee80211_assoc_ml_reconf,
	.set_epcs = ieee80211_set_epcs,
};
+11 −0
Original line number Diff line number Diff line
@@ -613,6 +613,12 @@ struct ieee80211_if_managed {
		u16 added_links;
		u8 dialog_token;
	} reconf;

	/* Support for epcs */
	struct {
		bool enabled;
		u8 dialog_token;
	} epcs;
};

struct ieee80211_if_ibss {
@@ -2775,6 +2781,11 @@ int ieee80211_req_neg_ttlm(struct ieee80211_sub_if_data *sdata,
void ieee80211_check_wbrf_support(struct ieee80211_local *local);
void ieee80211_add_wbrf(struct ieee80211_local *local, struct cfg80211_chan_def *chandef);
void ieee80211_remove_wbrf(struct ieee80211_local *local, struct cfg80211_chan_def *chandef);
int ieee80211_mgd_set_epcs(struct ieee80211_sub_if_data *sdata, bool enable);
void ieee80211_process_epcs_ena_resp(struct ieee80211_sub_if_data *sdata,
				     struct ieee80211_mgmt *mgmt, size_t len);
void ieee80211_process_epcs_teardown(struct ieee80211_sub_if_data *sdata,
				     struct ieee80211_mgmt *mgmt, size_t len);

int ieee80211_mgd_assoc_ml_reconf(struct ieee80211_sub_if_data *sdata,
				  struct cfg80211_assoc_link *add_links,
+8 −0
Original line number Diff line number Diff line
@@ -1556,6 +1556,14 @@ static void ieee80211_iface_process_skb(struct ieee80211_local *local,
				ieee80211_process_ml_reconf_resp(sdata, mgmt,
								 skb->len);
				break;
			case WLAN_PROTECTED_EHT_ACTION_EPCS_ENABLE_RESP:
				ieee80211_process_epcs_ena_resp(sdata, mgmt,
								skb->len);
				break;
			case WLAN_PROTECTED_EHT_ACTION_EPCS_ENABLE_TEARDOWN:
				ieee80211_process_epcs_teardown(sdata, mgmt,
								skb->len);
				break;
			default:
				break;
			}
Loading