All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miri Korenblit <miriam.rachel.korenblit@intel.com>
To: johannes@sipsolutions.net
Cc: linux-wireless@vger.kernel.org,
	Johannes Berg <johannes.berg@intel.com>,
	Gregory Greenman <gregory.greenman@intel.com>
Subject: [PATCH 14/15] wifi: mac80211: take EML/MLD capa from assoc response
Date: Tue,  2 Jan 2024 21:35:43 +0200	[thread overview]
Message-ID: <20240102213313.1d10f1d1dbab.I545e955675e2269a52496a22ae7822d95b40235e@changeid> (raw)
In-Reply-To: <20240102193544.157749-1-miriam.rachel.korenblit@intel.com>

From: Johannes Berg <johannes.berg@intel.com>

The association response is more likely to be correct
than a random scan result, which really also should be
correct, but we generally prefer to take data from the
association response, so do that here as well.

Also reset the data so it doesn't hang around from an
old connection to a non-MLO connection, drivers would
hopefully not look at it, but less surprise this way.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
---
 net/mac80211/mlme.c | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)

diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index fba596d81280..576ba6b25db9 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -3086,9 +3086,14 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
 	memset(sdata->vif.bss_conf.tx_pwr_env, 0,
 	       sizeof(sdata->vif.bss_conf.tx_pwr_env));
 
+	sdata->vif.cfg.eml_cap = 0;
+	sdata->vif.cfg.eml_med_sync_delay = 0;
+	sdata->vif.cfg.mld_capa_op = 0;
+
 	memset(&sdata->u.mgd.ttlm_info, 0,
 	       sizeof(sdata->u.mgd.ttlm_info));
 	wiphy_delayed_work_cancel(sdata->local->hw.wiphy, &ifmgd->ttlm_work);
+
 	wiphy_delayed_work_cancel(sdata->local->hw.wiphy,
 				  &ifmgd->neg_ttlm_timeout_work);
 	ieee80211_vif_set_links(sdata, 0, 0);
@@ -4981,16 +4986,8 @@ static int ieee80211_prep_channel(struct ieee80211_sub_if_data *sdata,
 		    eht_ml_elem &&
 		    ieee80211_mle_type_ok(eht_ml_elem->data + 1,
 					  IEEE80211_ML_CONTROL_TYPE_BASIC,
-					  eht_ml_elem->datalen - 1)) {
+					  eht_ml_elem->datalen - 1))
 			supports_mlo = true;
-
-			sdata->vif.cfg.eml_cap =
-				ieee80211_mle_get_eml_cap(eht_ml_elem->data + 1);
-			sdata->vif.cfg.eml_med_sync_delay =
-				ieee80211_mle_get_eml_med_sync_delay(eht_ml_elem->data + 1);
-			sdata->vif.cfg.mld_capa_op =
-				ieee80211_mle_get_mld_capa_op(eht_ml_elem->data + 1);
-		}
 	}
 
 	/* Allow VHT if at least one channel on the sband supports 80 MHz */
@@ -5432,6 +5429,13 @@ static void ieee80211_rx_mgmt_assoc_resp(struct ieee80211_sub_if_data *sdata,
 					   assoc_data->ap_addr);
 				goto abandon_assoc;
 			}
+
+			sdata->vif.cfg.eml_cap =
+				ieee80211_mle_get_eml_cap((const void *)elems->ml_basic);
+			sdata->vif.cfg.eml_med_sync_delay =
+				ieee80211_mle_get_eml_med_sync_delay((const void *)elems->ml_basic);
+			sdata->vif.cfg.mld_capa_op =
+				ieee80211_mle_get_mld_capa_op((const void *)elems->ml_basic);
 		}
 
 		sdata->vif.cfg.aid = aid;
-- 
2.34.1


  parent reply	other threads:[~2024-01-02 19:36 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-02 19:35 [PATCH 00/15] cfg80211/mac80211 patches from our internal tree 2024-01-02 Miri Korenblit
2024-01-02 19:35 ` [PATCH 01/15] wifi: cfg80211: correct comment about MLD ID Miri Korenblit
2024-01-02 19:35 ` [PATCH 02/15] wifi: cfg80211: parse all ML elements in an ML probe response Miri Korenblit
2024-01-02 19:35 ` [PATCH 03/15] wifi: cfg80211: add RNR with reporting AP information Miri Korenblit
2024-01-17 13:45   ` Benjamin Berg
2024-01-02 19:35 ` [PATCH 04/15] wifi: ieee80211: add definitions for negotiated TID to Link map Miri Korenblit
2024-01-02 19:35 ` [PATCH 05/15] wifi: mac80211: process and save negotiated TID to Link mapping request Miri Korenblit
2024-01-02 19:35 ` [PATCH 06/15] wifi: mac80211_hwsim: handle TID to link mapping neg request Miri Korenblit
2024-01-02 19:35 ` [PATCH 07/15] wifi: mac80211_hwsim: handle BSS_CHANGED_MLD_TTLM Miri Korenblit
2024-01-02 19:35 ` [PATCH 08/15] wifi: mac80211: add support for negotiated TTLM request Miri Korenblit
2024-01-02 19:35 ` [PATCH 09/15] wifi: mac80211_hwsim: Declare support for negotiated TTLM Miri Korenblit
2024-01-02 19:35 ` [PATCH 10/15] wifi: cfg80211: add support for SPP A-MSDUs Miri Korenblit
2024-01-02 19:35 ` [PATCH 11/15] wifi: mac80211: " Miri Korenblit
2024-01-02 19:35 ` [PATCH 12/15] wifi: mac80211_hwsim: advertise AP-side EMLSR/EMLMR capa Miri Korenblit
2024-01-02 19:35 ` [PATCH 13/15] wifi: mac80211: remove redundant ML element check Miri Korenblit
2024-01-02 19:35 ` Miri Korenblit [this message]
2024-01-02 19:35 ` [PATCH 15/15] wifi: cfg80211: validate MLO connections better Miri Korenblit

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240102213313.1d10f1d1dbab.I545e955675e2269a52496a22ae7822d95b40235e@changeid \
    --to=miriam.rachel.korenblit@intel.com \
    --cc=gregory.greenman@intel.com \
    --cc=johannes.berg@intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.