diff --git a/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_public_struct.h b/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_public_struct.h index e79ab5ecd2..4c3e9ffda5 100644 --- a/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_public_struct.h +++ b/umac/mlme/connection_mgr/dispatcher/inc/wlan_cm_public_struct.h @@ -233,6 +233,8 @@ enum wlan_cm_source { * @vht_caps_mask: mask of valid vht caps * @fils_info: Fills related connect info * @is_non_assoc_link: non assoc link + * @link_id: IEEE link ID of the candidate + * -mandatory and only used for link VDEV connect * @mld_addr: MLD address of candidate * -mandatory and only used for link VDEV connect * @ml_parnter_info: ml partner link info @@ -264,6 +266,7 @@ struct wlan_cm_connect_req { #endif bool is_non_assoc_link; #ifdef WLAN_FEATURE_11BE_MLO + uint8_t link_id; struct qdf_mac_addr mld_addr; struct mlo_partner_info ml_parnter_info; #endif diff --git a/umac/scan/core/src/wlan_scan_filter.c b/umac/scan/core/src/wlan_scan_filter.c index 4037f55a02..5f383dced9 100644 --- a/umac/scan/core/src/wlan_scan_filter.c +++ b/umac/scan/core/src/wlan_scan_filter.c @@ -721,6 +721,15 @@ static bool scm_mlo_filter_match(struct wlan_objmgr_pdev *pdev, } } + if (filter->match_link_id && filter->link_id != WLAN_INVALID_LINK_ID && + filter->link_id != util_scan_entry_self_linkid(db_entry)) { + scm_debug(QDF_MAC_ADDR_FMT " link id %d mismatch filter link id %d", + QDF_MAC_ADDR_REF(db_entry->bssid.bytes), + util_scan_entry_self_linkid(db_entry), + filter->link_id); + return false; + } + if (!db_entry->ie_list.multi_link_bv) return true; if (!filter->band_bitmap) diff --git a/umac/scan/dispatcher/inc/wlan_scan_public_structs.h b/umac/scan/dispatcher/inc/wlan_scan_public_structs.h index 8142373747..377065c471 100644 --- a/umac/scan/dispatcher/inc/wlan_scan_public_structs.h +++ b/umac/scan/dispatcher/inc/wlan_scan_public_structs.h @@ -741,6 +741,7 @@ enum dot11_mode_filter { * @ignore_nol_chan: Ignore entry with channel in the NOL list * @ignore_6ghz_channel: ignore 6Ghz channels * @match_mld_addr: Flag to match mld addr of scan entry + * @match_link_id: Flag to match self IEEE link id of scan entry * @age_threshold: If set return entry which are newer than the age_threshold * @num_of_bssid: number of bssid passed * @num_of_ssid: number of ssid @@ -766,6 +767,7 @@ enum dot11_mode_filter { * @ccx_validate_bss: Function pointer to custom bssid filter * @ccx_validate_bss_arg: Function argument to custom bssid filter * @band_bitmap: Allowed band bit map, BIT0: 2G, BIT1: 5G, BIT2: 6G + * @link_id: IEEE link ID to match if @match_link_id is set to %true * @mld_addr: MLD addr to match if @match_mld_addr is set to true. */ struct scan_filter { @@ -775,7 +777,8 @@ struct scan_filter { ignore_auth_enc_type:1, ignore_nol_chan:1, ignore_6ghz_channel:1, - match_mld_addr:1; + match_mld_addr:1, + match_link_id:1; qdf_time_t age_threshold; uint8_t num_of_bssid; uint8_t num_of_ssid; @@ -804,6 +807,7 @@ struct scan_filter { bss_filter_arg_t ccx_validate_bss_arg; #ifdef WLAN_FEATURE_11BE_MLO uint32_t band_bitmap; + uint8_t link_id; struct qdf_mac_addr mld_addr; #endif }; diff --git a/umac/scan/dispatcher/inc/wlan_scan_utils_api.h b/umac/scan/dispatcher/inc/wlan_scan_utils_api.h index a9456203cf..f369807dcd 100644 --- a/umac/scan/dispatcher/inc/wlan_scan_utils_api.h +++ b/umac/scan/dispatcher/inc/wlan_scan_utils_api.h @@ -141,12 +141,32 @@ util_scan_entry_mldaddr(struct scan_cache_entry *scan_entry) return mld_addr; } + +/** + * util_scan_entry_self_linkid() - Function to get self IEEE link id + * @scan_entry: scan entry + * + * API will return self IEEE link ID + * + * Return: Value of self IEEE link ID + */ +static inline uint8_t +util_scan_entry_self_linkid(struct scan_cache_entry *scan_entry) +{ + return scan_entry->ml_info.self_link_id; +} #else static inline struct qdf_mac_addr * util_scan_entry_mldaddr(struct scan_cache_entry *scan_entry) { return NULL; } + +static inline uint8_t +util_scan_entry_self_linkid(struct scan_cache_entry *scan_entry) +{ + return WLAN_INVALID_LINK_ID; +} #endif /** diff --git a/umac/scan/dispatcher/src/wlan_scan_utils_api.c b/umac/scan/dispatcher/src/wlan_scan_utils_api.c index 5123f9b7b8..a002d890f7 100644 --- a/umac/scan/dispatcher/src/wlan_scan_utils_api.c +++ b/umac/scan/dispatcher/src/wlan_scan_utils_api.c @@ -2386,6 +2386,8 @@ static void util_scan_update_ml_info(struct wlan_objmgr_pdev *pdev, bool is_ml_ie_valid = true; uint8_t *end_ptr = NULL; + scan_entry->ml_info.self_link_id = WLAN_INVALID_LINK_ID; + if (!scan_entry->ie_list.ehtcap && scan_entry->ie_list.multi_link_bv) { scan_entry->ie_list.multi_link_bv = NULL; return; @@ -2431,8 +2433,8 @@ static void util_scan_update_ml_info(struct wlan_objmgr_pdev *pdev, util_get_ml_bv_partner_link_info(pdev, scan_entry); } #else -static void util_scan_update_ml_info(struct wlan_objmgr_pdev *pdev, - struct scan_cache_entry *scan_entry) +static inline void util_scan_update_ml_info(struct wlan_objmgr_pdev *pdev, + struct scan_cache_entry *scan_entry) { } #endif