|
@@ -1114,18 +1114,56 @@ wlan_convert_link_id_to_diag_band(struct qdf_mac_addr *peer_mld,
|
|
|
return band_bitmap;
|
|
|
}
|
|
|
|
|
|
+static uint8_t
|
|
|
+wlan_get_supported_link_band_bitmap(struct mlo_link_switch_context *link_ctx)
|
|
|
+{
|
|
|
+ uint8_t band_bitmap = 0, i = 0;
|
|
|
+ struct mlo_link_info link_info;
|
|
|
+ struct wlan_channel *chan_info;
|
|
|
+ enum wlan_diag_wifi_band band;
|
|
|
+
|
|
|
+ for (i = 0; i < WLAN_MAX_ML_BSS_LINKS; i++) {
|
|
|
+ link_info = link_ctx->links_info[i];
|
|
|
+
|
|
|
+ chan_info = link_info.link_chan_info;
|
|
|
+ if (!chan_info)
|
|
|
+ continue;
|
|
|
+
|
|
|
+ band = wlan_convert_freq_to_diag_band(chan_info->ch_freq);
|
|
|
+ if (band == WLAN_INVALID_BAND)
|
|
|
+ continue;
|
|
|
+
|
|
|
+ band_bitmap |= BIT(band - 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ return band_bitmap;
|
|
|
+}
|
|
|
+
|
|
|
void wlan_connectivity_mld_link_status_event(struct wlan_objmgr_psoc *psoc,
|
|
|
struct mlo_link_switch_params *src)
|
|
|
{
|
|
|
+ struct wlan_mlo_peer_context *ml_peer = NULL;
|
|
|
+ struct wlan_mlo_dev_context *mld_ctx = NULL;
|
|
|
+
|
|
|
WLAN_HOST_DIAG_EVENT_DEF(wlan_diag_event,
|
|
|
struct wlan_diag_mlo_link_status);
|
|
|
|
|
|
qdf_mem_zero(&wlan_diag_event,
|
|
|
sizeof(struct wlan_diag_mlo_link_status));
|
|
|
|
|
|
+ ml_peer = wlan_mlo_get_mlpeer_by_peer_mladdr(&src->mld_addr, &mld_ctx);
|
|
|
+
|
|
|
+ if (!mld_ctx) {
|
|
|
+ logging_err("mlo dev ctx for mld_mac: "
|
|
|
+ QDF_MAC_ADDR_FMT
|
|
|
+ " not found",
|
|
|
+ QDF_MAC_ADDR_REF(src->mld_addr.bytes));
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
wlan_diag_event.diag_cmn.timestamp_us = qdf_get_time_of_the_day_us();
|
|
|
wlan_diag_event.diag_cmn.ktime_us = qdf_ktime_to_us(qdf_ktime_get());
|
|
|
- wlan_diag_event.version = DIAG_MLO_LINK_STATUS_VERSION;
|
|
|
+ wlan_diag_event.version = DIAG_MLO_LINK_STATUS_VERSION_2;
|
|
|
|
|
|
wlan_diag_event.active_link =
|
|
|
wlan_convert_link_id_to_diag_band(&src->mld_addr,
|
|
@@ -1138,6 +1176,20 @@ void wlan_connectivity_mld_link_status_event(struct wlan_objmgr_psoc *psoc,
|
|
|
if (!wlan_diag_event.prev_active_link)
|
|
|
return;
|
|
|
|
|
|
+ if (!mld_ctx->link_ctx) {
|
|
|
+ logging_err("link ctx for mld_mac: "
|
|
|
+ QDF_MAC_ADDR_FMT
|
|
|
+ " not found",
|
|
|
+ QDF_MAC_ADDR_REF(src->mld_addr.bytes));
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ wlan_diag_event.associated_links =
|
|
|
+ wlan_get_supported_link_band_bitmap(mld_ctx->link_ctx);
|
|
|
+
|
|
|
+ if (!wlan_diag_event.associated_links)
|
|
|
+ return;
|
|
|
+
|
|
|
wlan_diag_event.reason = src->reason_code;
|
|
|
/*
|
|
|
* FW timestamp received from FW in milliseconds and to be sent to
|