From c1bece57dd8465fd7c5df0828ee39f6110d8eb00 Mon Sep 17 00:00:00 2001 From: Basamma Yakkanahalli Date: Sun, 13 Nov 2022 15:25:20 +0530 Subject: [PATCH] qcacmn: Handle CU and BPCC for probe and assoc response Add changes to indicate ongoing critical update CU flags and BPCC values in probe and assoc/reassoc response. For beacon FW update the CU flags and BPCC values in impacted and partner links and keeps the latest copy of BPCC for ML VDEV. The similar CU indication needs to be considered for probe, assoc/reassoc response. FW indicate to host the ongoing CU flag within DTIM interval for impacted, and latest BPCC values of AP MLDs in impacted and partner link VDEVs as part of mgmt_rx_event. Extract cu_vdev_bitmap and bpcc values CU information from wmi_prb_tmpl_ml_info TLV for probe and assoc / reassoc request. Pass these values to umac, mgmt and ol layer as part of rx status. Refer these values to update CU flag in capability information, and BPCC values to update BSS Parameter Change Count in RNR, MLIE and per sta profile. CRs-Fixed: 3301916 Change-Id: I92ededb6598f85f3ea21b9d5e69d182c6180e30d --- .../dispatcher/inc/wlan_mgmt_txrx_utils_api.h | 29 +++++++ wmi/inc/wmi_unified_11be_api.h | 12 +++ wmi/inc/wmi_unified_priv.h | 4 + wmi/src/wmi_unified_11be_api.c | 11 +++ wmi/src/wmi_unified_11be_tlv.c | 75 +++++++++++++++++++ 5 files changed, 131 insertions(+) diff --git a/umac/cmn_services/mgmt_txrx/dispatcher/inc/wlan_mgmt_txrx_utils_api.h b/umac/cmn_services/mgmt_txrx/dispatcher/inc/wlan_mgmt_txrx_utils_api.h index 4b9b39f0b6..daae27a7d6 100644 --- a/umac/cmn_services/mgmt_txrx/dispatcher/inc/wlan_mgmt_txrx_utils_api.h +++ b/umac/cmn_services/mgmt_txrx/dispatcher/inc/wlan_mgmt_txrx_utils_api.h @@ -832,6 +832,32 @@ struct mgmt_rx_event_ext_params { uint16_t reo_win_size; }; +#ifdef WLAN_FEATURE_11BE_MLO +#define CU_VDEV_MAP_MASK 0xFFFF +#define CU_MAX_MLO_LINKS 6 +#define MAX_AP_MLDS_PER_LINK 16 +/** + * struct mlo_mgmt_ml_info - Ongoing Critical Update information. + * @cu_vdev_map: Per link critical update ap vdev bit map. + * bit 0 Indicate vap with least vdev id in a link + * bit 15 Indicate vap with max vdev id in a link + * @vdev_bpcc: Each byte contains BPCC value per MLO VAP + * 16 byte entries for each link corresponding to AP MLD in a link. + * Max number of byte entries will be + * (max MLO links supported * max AP MLDs in a link). + * + * The mlo_mgmt_ml_info contain AP MLD CU indication and latest copies of BSS + * parameter change count BPCC values of all AP MLDs in an available MLO links. + * Per-link contains 16 AP MLDs at max. + * 16 bits to indicate respective AP MLD VDEVs in a link. + * Number of max links supported are 6. + */ +struct mlo_mgmt_ml_info { + uint16_t cu_vdev_map[CU_MAX_MLO_LINKS]; + uint8_t vdev_bpcc[MAX_AP_MLDS_PER_LINK * CU_MAX_MLO_LINKS]; +}; +#endif + /** * struct mgmt_rx_event_params - host mgmt header params * @chan_freq: channel frequency on which this frame is received @@ -880,6 +906,9 @@ struct mgmt_rx_event_params { struct frame_pn_params pn_params; struct mgmt_rx_event_ext_params *ext_params; struct frm_conn_ap is_conn_ap; +#ifdef WLAN_FEATURE_11BE_MLO + struct mlo_mgmt_ml_info cu_params; +#endif }; #ifdef WLAN_MGMT_RX_REO_SUPPORT diff --git a/wmi/inc/wmi_unified_11be_api.h b/wmi/inc/wmi_unified_11be_api.h index 90fe149c3f..a64988c2ba 100644 --- a/wmi/inc/wmi_unified_11be_api.h +++ b/wmi/inc/wmi_unified_11be_api.h @@ -52,6 +52,18 @@ wmi_extract_mlo_link_set_active_resp(wmi_unified_t wmi, QDF_STATUS wmi_send_mlo_link_set_active_cmd(wmi_unified_t wmi_handle, struct mlo_link_set_active_param *param); + +/** + * wmi_extract_mgmt_rx_ml_cu_params() - extract mlo cu params from event + * @wmi_handle: wmi handle + * @evt_buf: pointer to event buffer + * @cu_params: Pointer to mlo CU params + * + * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure + */ +QDF_STATUS +wmi_extract_mgmt_rx_ml_cu_params(wmi_unified_t wmi_handle, void *evt_buf, + struct mlo_mgmt_ml_info *cu_params); #endif /*WLAN_FEATURE_11BE_MLO*/ #ifdef WLAN_FEATURE_11BE diff --git a/wmi/inc/wmi_unified_priv.h b/wmi/inc/wmi_unified_priv.h index 62173c863d..27e9b2245a 100644 --- a/wmi/inc/wmi_unified_priv.h +++ b/wmi/inc/wmi_unified_priv.h @@ -3031,6 +3031,10 @@ QDF_STATUS (*extract_mlo_link_set_active_resp)(wmi_unified_t wmi_handle, void *evt_buf, struct mlo_link_set_active_resp *resp); +QDF_STATUS +(*extract_mgmt_rx_ml_cu_params)(wmi_unified_t wmi_handle, + void *evt_buf, + struct mlo_mgmt_ml_info *cu_params); #endif #ifdef WLAN_FEATURE_SON diff --git a/wmi/src/wmi_unified_11be_api.c b/wmi/src/wmi_unified_11be_api.c index 5461773677..2f5294661a 100644 --- a/wmi/src/wmi_unified_11be_api.c +++ b/wmi/src/wmi_unified_11be_api.c @@ -70,3 +70,14 @@ QDF_STATUS wmi_send_mlo_peer_tid_to_link_map_cmd( return QDF_STATUS_E_FAILURE; } #endif /* WLAN_FEATURE_11BE */ + +QDF_STATUS +wmi_extract_mgmt_rx_ml_cu_params(wmi_unified_t wmi, void *evt_buf, + struct mlo_mgmt_ml_info *cu_params) +{ + if (wmi->ops->extract_mgmt_rx_ml_cu_params) + return wmi->ops->extract_mgmt_rx_ml_cu_params( + wmi, evt_buf, cu_params); + + return QDF_STATUS_E_FAILURE; +} diff --git a/wmi/src/wmi_unified_11be_tlv.c b/wmi/src/wmi_unified_11be_tlv.c index aeb2234302..428b89a41f 100644 --- a/wmi/src/wmi_unified_11be_tlv.c +++ b/wmi/src/wmi_unified_11be_tlv.c @@ -975,6 +975,79 @@ static void wmi_11be_attach_mlo_setup_tlv(wmi_unified_t wmi_handle) #endif /*WLAN_MLO_MULTI_CHIP*/ +/** + * extract_mgmt_rx_ml_cu_params_tlv() - extract MGMT Critical Update params + * from MGMT_RX_EVENT_ID + * @wmi_handle: wmi handle + * @evt_buf: pointer to event buffer + * @cu_params: Pointer to MGMT Critical update parameters + * + * Return: QDF_STATUS_SUCCESS for success or error code + */ +static +QDF_STATUS extract_mgmt_rx_ml_cu_params_tlv(wmi_unified_t wmi_handle, + void *evt_buf, + struct mlo_mgmt_ml_info *cu_params) +{ + WMI_MGMT_RX_EVENTID_param_tlvs *param_tlvs; + wmi_mgmt_ml_info *cu_params_tlv; + wmi_mgmt_rx_hdr *ev_hdr; + uint32_t num_bpcc_bufp; + + param_tlvs = evt_buf; + if (!param_tlvs) { + wmi_err(" MGMT RX param_tlvs is NULL"); + return QDF_STATUS_E_INVAL; + } + + ev_hdr = param_tlvs->hdr; + if (!ev_hdr) { + wmi_err("Rx event is NULL"); + return QDF_STATUS_E_INVAL; + } + + if (!cu_params) { + wmi_debug("MGMT Rx CU params is NULL"); + return QDF_STATUS_E_INVAL; + } + + cu_params_tlv = param_tlvs->ml_info; + if (!cu_params_tlv) { + wmi_debug("mgmt_ml_info TLV is not sent by FW"); + return QDF_STATUS_E_INVAL; + } + + cu_params->cu_vdev_map[0] = + cu_params_tlv->cu_vdev_map_1 & CU_VDEV_MAP_MASK; + cu_params->cu_vdev_map[1] = + (cu_params_tlv->cu_vdev_map_1 >> 16) & CU_VDEV_MAP_MASK; + cu_params->cu_vdev_map[2] = + cu_params_tlv->cu_vdev_map_2 & CU_VDEV_MAP_MASK; + cu_params->cu_vdev_map[3] = + (cu_params_tlv->cu_vdev_map_2 >> 16) & CU_VDEV_MAP_MASK; + cu_params->cu_vdev_map[4] = + cu_params_tlv->cu_vdev_map_3 & CU_VDEV_MAP_MASK; + cu_params->cu_vdev_map[5] = + (cu_params_tlv->cu_vdev_map_3 >> 16) & CU_VDEV_MAP_MASK; + + /* At present MAX_LINKS_SUPPORTED are 6. + * cu_vdev_map_4 which required for links + * 7 and 8 is unused. + */ + num_bpcc_bufp = param_tlvs->num_bpcc_bufp; + if (param_tlvs->num_bpcc_bufp > sizeof(cu_params->vdev_bpcc)) { + wmi_err("Invalid num_bpcc_bufp:%u", num_bpcc_bufp); + return QDF_STATUS_E_INVAL; + } + qdf_mem_copy(cu_params->vdev_bpcc, param_tlvs->bpcc_bufp, + num_bpcc_bufp); + + qdf_trace_hex_dump(QDF_MODULE_ID_WMI, QDF_TRACE_LEVEL_DEBUG, + param_tlvs->bpcc_bufp, num_bpcc_bufp); + + return QDF_STATUS_SUCCESS; +} + void wmi_11be_attach_tlv(wmi_unified_t wmi_handle) { struct wmi_ops *ops = wmi_handle->ops; @@ -988,4 +1061,6 @@ void wmi_11be_attach_tlv(wmi_unified_t wmi_handle) ops->send_mlo_peer_tid_to_link_map = send_mlo_peer_tid_to_link_map_cmd_tlv; #endif /* WLAN_FEATURE_11BE */ + ops->extract_mgmt_rx_ml_cu_params = + extract_mgmt_rx_ml_cu_params_tlv; }