From c673777be4ea78b215220526ed60a5d5c4d4d7d0 Mon Sep 17 00:00:00 2001 From: Sumedh Baikady Date: Fri, 28 Feb 2020 18:00:28 -0800 Subject: [PATCH] qcacmn: Add WMI event support for dynamic Muedca Add support for WMI event to host to process dynamically selected Muedca values and update the mgmt frames with the new set of values. Extract the params and store in Muedca_param struct from control path, to be used for updating mgmt frames. Change-Id: I6cc7756d1a246ff994edef195f6191d280bc5c47 --- .../inc/wlan_vdev_mgr_tgt_if_tx_defs.h | 19 +++++++++++ wmi/inc/wmi_unified_param.h | 1 + wmi/inc/wmi_unified_priv.h | 4 +++ wmi/src/wmi_unified_tlv.c | 2 ++ wmi/src/wmi_unified_vdev_tlv.c | 34 +++++++++++++++++++ 5 files changed, 60 insertions(+) diff --git a/umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_tgt_if_tx_defs.h b/umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_tgt_if_tx_defs.h index b0f041b1d4..f80d1514e8 100644 --- a/umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_tgt_if_tx_defs.h +++ b/umac/mlme/vdev_mgr/dispatcher/inc/wlan_vdev_mgr_tgt_if_tx_defs.h @@ -523,4 +523,23 @@ struct peer_delete_all_params { uint8_t vdev_id; }; +#define AC_MAX 4 +#define WMI_MUEDCA_PARAM_MASK 0xff +/** + * struct muedca_params - MU-EDCA parameters + * @muedca_ecwmin: CWmin in exponential form + * @muedca_ecwmax: CWmax in exponential form + * @muedca_aifsn: AIFSN parameter + * @muedca_acm: ACM parameter + * @muedca_timer: MU EDCA timer value + */ +struct muedca_params { + uint32_t pdev_id; + uint8_t muedca_ecwmin[AC_MAX]; /* CWmin in exponential form */ + uint8_t muedca_ecwmax[AC_MAX]; /* CWmax in exponential form */ + uint8_t muedca_aifsn[AC_MAX]; /* AIFSN parameter */ + uint8_t muedca_acm[AC_MAX]; /* ACM parameter */ + uint8_t muedca_timer[AC_MAX]; /* MU EDCA timer value */ +}; + #endif /* __WLAN_VDEV_MGR_TX_OPS_DEFS_H__ */ diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h index a673c267e3..9b168e8db5 100644 --- a/wmi/inc/wmi_unified_param.h +++ b/wmi/inc/wmi_unified_param.h @@ -4603,6 +4603,7 @@ typedef enum { wmi_wlan_time_sync_q_master_slave_offset_eventid, #endif wmi_roam_scan_chan_list_id, + wmi_muedca_params_config_eventid, wmi_events_max, } wmi_conv_event_id; diff --git a/wmi/inc/wmi_unified_priv.h b/wmi/inc/wmi_unified_priv.h index 65346ebe40..b2fb2a10dc 100644 --- a/wmi/inc/wmi_unified_priv.h +++ b/wmi/inc/wmi_unified_priv.h @@ -1497,6 +1497,10 @@ QDF_STATUS (*extract_ext_tbttoffset_num_vdevs)(wmi_unified_t wmi_hdl, void *evt_buf, uint32_t *num_vdevs); +QDF_STATUS (*extract_muedca_params_handler)(wmi_unified_t wmi_hdl, + void *evt_buf, + struct muedca_params *muedca_param_list); + QDF_STATUS (*extract_mgmt_rx_params)(wmi_unified_t wmi_handle, void *evt_buf, struct mgmt_rx_event_params *hdr, uint8_t **bufp); diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index 73d3f76a28..70c9955250 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -14095,6 +14095,8 @@ static void populate_tlv_events_id(uint32_t *event_ids) #endif event_ids[wmi_roam_scan_chan_list_id] = WMI_ROAM_SCAN_CHANNEL_LIST_EVENTID; + event_ids[wmi_muedca_params_config_eventid] = + WMI_MUEDCA_PARAMS_CONFIG_EVENTID; } /** diff --git a/wmi/src/wmi_unified_vdev_tlv.c b/wmi/src/wmi_unified_vdev_tlv.c index 08894d1266..6ec776069b 100644 --- a/wmi/src/wmi_unified_vdev_tlv.c +++ b/wmi/src/wmi_unified_vdev_tlv.c @@ -350,6 +350,38 @@ static QDF_STATUS extract_ext_tbttoffset_update_params_tlv( return QDF_STATUS_SUCCESS; } +static QDF_STATUS extract_muedca_params_tlv(wmi_unified_t wmi_hdl, + void *evt_buf, + struct muedca_params *muedca_param_list) +{ + WMI_MUEDCA_PARAMS_CONFIG_EVENTID_param_tlvs *param_buf; + wmi_muedca_params_config_event_fixed_param *muedca_param; + int i; + + param_buf = (WMI_MUEDCA_PARAMS_CONFIG_EVENTID_param_tlvs *)evt_buf; + if (!param_buf) { + WMI_LOGE("%s: Invalid muedca evt buffer", __func__); + return QDF_STATUS_E_INVAL; + } + muedca_param = param_buf->fixed_param; + + muedca_param_list->pdev_id = wmi_hdl->ops-> + convert_pdev_id_target_to_host(wmi_hdl, + muedca_param->pdev_id); + for (i = 0; i < WMI_AC_MAX; i++) { + muedca_param_list->muedca_aifsn[i] = muedca_param->aifsn[i] & + WMI_MUEDCA_PARAM_MASK; + muedca_param_list->muedca_ecwmin[i] = muedca_param->ecwmin[i] & + WMI_MUEDCA_PARAM_MASK; + muedca_param_list->muedca_ecwmax[i] = muedca_param->ecwmax[i] & + WMI_MUEDCA_PARAM_MASK; + muedca_param_list->muedca_timer[i] = muedca_param->muedca_expiration_time[i] & + WMI_MUEDCA_PARAM_MASK; + } + + return QDF_STATUS_SUCCESS; +} + void wmi_vdev_attach_tlv(struct wmi_unified *wmi_handle) { struct wmi_ops *wmi_ops; @@ -373,6 +405,8 @@ void wmi_vdev_attach_tlv(struct wmi_unified *wmi_handle) extract_ext_tbttoffset_update_params_tlv; wmi_ops->extract_ext_tbttoffset_num_vdevs = extract_ext_tbttoffset_num_vdevs_tlv; + wmi_ops->extract_muedca_params_handler = + extract_muedca_params_tlv; wmi_ops->send_vdev_set_neighbour_rx_cmd = send_vdev_set_neighbour_rx_cmd_tlv; wmi_ops->send_beacon_send_cmd = send_beacon_send_cmd_tlv;