@@ -194,11 +194,32 @@ ieee80211_bss_info_update(struct ieee80211_local *local,
194
194
if (scan_sdata && scan_sdata -> vif .type == NL80211_IFTYPE_STATION &&
195
195
scan_sdata -> vif .cfg .assoc &&
196
196
ieee80211_have_rx_timestamp (rx_status )) {
197
- bss_meta .parent_tsf =
198
- ieee80211_calculate_rx_timestamp (local , rx_status ,
199
- len + FCS_LEN , 24 );
200
- ether_addr_copy (bss_meta .parent_bssid ,
201
- scan_sdata -> vif .bss_conf .bssid );
197
+ struct ieee80211_bss_conf * link_conf = NULL ;
198
+
199
+ /* for an MLO connection, set the TSF data only in case we have
200
+ * an indication on which of the links the frame was received
201
+ */
202
+ if (ieee80211_vif_is_mld (& scan_sdata -> vif )) {
203
+ if (rx_status -> link_valid ) {
204
+ s8 link_id = rx_status -> link_id ;
205
+
206
+ link_conf =
207
+ rcu_dereference (scan_sdata -> vif .link_conf [link_id ]);
208
+ }
209
+ } else {
210
+ link_conf = & scan_sdata -> vif .bss_conf ;
211
+ }
212
+
213
+ if (link_conf ) {
214
+ bss_meta .parent_tsf =
215
+ ieee80211_calculate_rx_timestamp (local ,
216
+ rx_status ,
217
+ len + FCS_LEN ,
218
+ 24 );
219
+
220
+ ether_addr_copy (bss_meta .parent_bssid ,
221
+ link_conf -> bssid );
222
+ }
202
223
}
203
224
rcu_read_unlock ();
204
225
@@ -666,6 +687,21 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata,
666
687
if (local -> scan_req )
667
688
return - EBUSY ;
668
689
690
+ /* For an MLO connection, if a link ID was specified, validate that it
691
+ * is indeed active. If no link ID was specified, select one of the
692
+ * active links.
693
+ */
694
+ if (ieee80211_vif_is_mld (& sdata -> vif )) {
695
+ if (req -> tsf_report_link_id >= 0 ) {
696
+ if (!(sdata -> vif .active_links &
697
+ BIT (req -> tsf_report_link_id )))
698
+ return - EINVAL ;
699
+ } else {
700
+ req -> tsf_report_link_id =
701
+ __ffs (sdata -> vif .active_links );
702
+ }
703
+ }
704
+
669
705
if (!__ieee80211_can_leave_ch (sdata ))
670
706
return - EBUSY ;
671
707
@@ -714,6 +750,8 @@ static int __ieee80211_start_scan(struct ieee80211_sub_if_data *sdata,
714
750
local -> hw_scan_req -> req .duration = req -> duration ;
715
751
local -> hw_scan_req -> req .duration_mandatory =
716
752
req -> duration_mandatory ;
753
+ local -> hw_scan_req -> req .tsf_report_link_id =
754
+ req -> tsf_report_link_id ;
717
755
718
756
local -> hw_scan_band = 0 ;
719
757
local -> hw_scan_req -> req .n_6ghz_params = req -> n_6ghz_params ;
0 commit comments