From d7673a3c081eb280dcdc83078e7f4adb12a75975 Mon Sep 17 00:00:00 2001 From: Rajeev Kumar Date: Fri, 3 Feb 2017 00:39:49 -0800 Subject: [PATCH] qcacmn: Remove duplicate (ext)service ready structures from WMI Object manager psoc service ready api provides host (ext)service ready data structures hence remove duplicate copy from wmi_unified_param.h and change WMI to use psoc service ready data structures. Change-Id: Iaec20e9b818077ed1ca58754c4b1bc6deaedd761 CRs-Fixed: 2002016 --- .../inc/service_ready_event_handler.h | 30 --- .../src/service_ready_event_handler.c | 38 ++-- .../inc/wlan_objmgr_psoc_service_ready_api.h | 107 ++------- .../src/wlan_objmgr_psoc_service_ready_api.c | 14 +- wmi/inc/wmi_unified_api.h | 14 +- wmi/inc/wmi_unified_param.h | 207 ------------------ wmi/inc/wmi_unified_priv.h | 13 +- wmi/src/wmi_unified_api.c | 12 +- wmi/src/wmi_unified_non_tlv.c | 6 +- wmi/src/wmi_unified_tlv.c | 14 +- 10 files changed, 76 insertions(+), 379 deletions(-) diff --git a/target_if/init_deinit/inc/service_ready_event_handler.h b/target_if/init_deinit/inc/service_ready_event_handler.h index 34145ecf529f..ecebd1230579 100644 --- a/target_if/init_deinit/inc/service_ready_event_handler.h +++ b/target_if/init_deinit/inc/service_ready_event_handler.h @@ -37,36 +37,6 @@ #include "wlan_objmgr_psoc_obj.h" #include "target_if.h" -#define MAX_HW_MODE (2) -#define MAX_MAC_PHY_CAP (5) -#define MAX_PHY_REG_CAP (3) - -/** - * struct service_ready_param - service ready structure - * @wmi_service_bitmap: wmi service bitmap - * @target_caps: traget capability - * @hal_reg_cap: hal reg capability - */ -struct service_ready_param { - uint32_t wmi_service_bitmap[wmi_services_max]; - target_capability_info target_caps; - TARGET_HAL_REG_CAPABILITIES hal_reg_cap; -}; - -/** - * struct ext_service_ready_param - ext service ready structure - * @service_ext_param: service ext param - * @hw_mode_caps: hw mode caps - * @mac_phy_cap: mac phy cap - * @reg_cap: regulatory capability - */ -struct ext_service_ready_param { - struct wmi_host_service_ext_param service_ext_param; - struct wmi_host_hw_mode_caps hw_mode_caps[MAX_HW_MODE]; - struct wmi_host_mac_phy_caps mac_phy_cap[MAX_MAC_PHY_CAP]; - struct WMI_HOST_HAL_REG_CAPABILITIES_EXT reg_cap[MAX_PHY_REG_CAP]; -}; - /** * init_deinit_service_ready_event_handler() - service ready handler * @handle: opaqueue pointer to scn diff --git a/target_if/init_deinit/src/service_ready_event_handler.c b/target_if/init_deinit/src/service_ready_event_handler.c index 4391bf22e7b9..bf3e6499a754 100644 --- a/target_if/init_deinit/src/service_ready_event_handler.c +++ b/target_if/init_deinit/src/service_ready_event_handler.c @@ -39,7 +39,7 @@ static int populate_service_bitmap(void *wmi_handle, uint8_t *event, } static int populate_target_cap(void *wmi_handle, uint8_t *event, - target_capability_info *cap) + struct wlan_psoc_target_capability_info *cap) { QDF_STATUS status; @@ -53,7 +53,7 @@ static int populate_target_cap(void *wmi_handle, uint8_t *event, } static int populate_hal_reg_cap(void *wmi_handle, uint8_t *event, - TARGET_HAL_REG_CAPABILITIES *cap) + struct wlan_psoc_hal_reg_capability *cap) { QDF_STATUS status; @@ -71,7 +71,7 @@ int init_deinit_service_ready_event_handler(ol_scn_t scn_handle, uint32_t data_len) { int err_code; - struct service_ready_param *service_param; + struct wlan_objmgr_psoc_service_ready_param *service_param; struct wlan_objmgr_psoc *psoc; wmi_legacy_service_ready_callback legacy_callback; void *wmi_handle; @@ -89,14 +89,14 @@ int init_deinit_service_ready_event_handler(ol_scn_t scn_handle, wmi_handle = psoc->tgt_if_handle; - service_param = qdf_mem_malloc(sizeof(struct service_ready_param)); + service_param = qdf_mem_malloc(sizeof(*service_param)); if (!service_param) { - WMI_LOGE("wmi_service_ready_param memory alloc failed"); + WMI_LOGE("memory alloc failed for psoc service ready"); return -ENOMEM; } err_code = populate_service_bitmap(wmi_handle, event, - service_param->wmi_service_bitmap); + service_param->service_bitmap); if (err_code) goto free_param_and_exit; @@ -123,7 +123,7 @@ free_param_and_exit: } static int populate_service_ready_ext_param(void *handle, uint8_t *evt, - struct wmi_host_service_ext_param *param) + struct wlan_psoc_host_service_ext_param *param) { QDF_STATUS status; @@ -137,8 +137,8 @@ static int populate_service_ready_ext_param(void *handle, uint8_t *evt, } static int populate_mac_phy_capability(void *handle, uint8_t *evt, - struct wmi_host_hw_mode_caps *hw_cap, uint8_t *total_mac_phy, - struct ext_service_ready_param *service_param) + struct wlan_psoc_host_hw_mode_caps *hw_cap, uint8_t *total_mac_phy, + struct wlan_objmgr_psoc_ext_service_ready_param *service_param) { QDF_STATUS status; uint32_t hw_mode_id; @@ -159,7 +159,7 @@ static int populate_mac_phy_capability(void *handle, uint8_t *evt, return qdf_status_to_os_return(status); } (*total_mac_phy)++; - if (*total_mac_phy > MAX_MAC_PHY_CAP) { + if (*total_mac_phy > PSOC_MAX_MAC_PHY_CAP) { WMI_LOGE("total mac phy exceeds max limit %d", *total_mac_phy); return -EINVAL; @@ -173,7 +173,7 @@ static int populate_mac_phy_capability(void *handle, uint8_t *evt, } static int get_hw_mode(void *handle, uint8_t *evt, uint8_t i, - struct wmi_host_hw_mode_caps *cap) + struct wlan_psoc_host_hw_mode_caps *cap) { QDF_STATUS status; @@ -187,15 +187,15 @@ static int get_hw_mode(void *handle, uint8_t *evt, uint8_t i, } static int populate_hw_mode_capability(void *wmi_handle, - uint8_t *event, uint8_t *total_mac_phy, - struct ext_service_ready_param *service_param) + uint8_t *event, uint8_t *total_mac_phy, + struct wlan_objmgr_psoc_ext_service_ready_param *service_param) { QDF_STATUS status = QDF_STATUS_SUCCESS; uint8_t hw_idx; uint32_t num_hw_modes; num_hw_modes = service_param->service_ext_param.num_hw_modes; - if (num_hw_modes > MAX_HW_MODE) { + if (num_hw_modes > PSOC_MAX_HW_MODE) { WMI_LOGE("invalid num_hw_modes %d", num_hw_modes); return -EINVAL; } @@ -219,14 +219,14 @@ return_exit: } static int populate_phy_reg_capability(void *handle, uint8_t *event, - struct ext_service_ready_param *service_param) + struct wlan_objmgr_psoc_ext_service_ready_param *service_param) { uint8_t reg_idx; uint32_t num_phy_reg_cap; QDF_STATUS status = QDF_STATUS_SUCCESS; num_phy_reg_cap = service_param->service_ext_param.num_phy; - if (num_phy_reg_cap > MAX_PHY_REG_CAP) { + if (num_phy_reg_cap > PSOC_MAX_PHY_REG_CAP) { WMI_LOGE("Invalid num_phy_reg_cap %d", num_phy_reg_cap); return -EINVAL; } @@ -249,7 +249,7 @@ int init_deinit_service_ext_ready_event_handler(ol_scn_t scn_handle, uint32_t data_len) { int err_code; - struct ext_service_ready_param *service_param; + struct wlan_objmgr_psoc_ext_service_ready_param *service_param; struct wlan_objmgr_psoc *psoc; wmi_legacy_service_ready_callback legacy_callback; void *wmi_handle; @@ -268,9 +268,9 @@ int init_deinit_service_ext_ready_event_handler(ol_scn_t scn_handle, wmi_handle = psoc->tgt_if_handle; service_param = - qdf_mem_malloc(sizeof(struct ext_service_ready_param)); + qdf_mem_malloc(sizeof(*service_param)); if (!service_param) { - WMI_LOGE("wmi_service_ready_param alloc failed"); + WMI_LOGE("ext_service_ready_param alloc failed"); return QDF_STATUS_E_NOMEM; } diff --git a/umac/cmn_services/obj_mgr/inc/wlan_objmgr_psoc_service_ready_api.h b/umac/cmn_services/obj_mgr/inc/wlan_objmgr_psoc_service_ready_api.h index af7e9c036a9b..28012c4b038f 100644 --- a/umac/cmn_services/obj_mgr/inc/wlan_objmgr_psoc_service_ready_api.h +++ b/umac/cmn_services/obj_mgr/inc/wlan_objmgr_psoc_service_ready_api.h @@ -25,15 +25,12 @@ #include "qdf_types.h" -/* Below constants are derived from their WMI counter part because of WIN - * direct attach limitation which avoids WMI macro usage in common code - */ -#define OBJMGR_SERVICE_BM_SIZE ((128 + sizeof(uint32_t) - 1) / sizeof(uint32_t)) -#define OBJMGR_HOST_MAX_NUM_SS (8) -#define OBJMGR_HOST_MAX_PHY_SIZE (3) -#define OBJMGR_MAX_HW_MODE (2) -#define OBJMGR_MAX_MAC_PHY_CAP (5) -#define OBJMGR_MAX_PHY_REG_CAP (3) +#define PSOC_SERVICE_BM_SIZE ((128 + sizeof(uint32_t) - 1) / sizeof(uint32_t)) +#define PSOC_HOST_MAX_NUM_SS (8) +#define PSOC_HOST_MAX_PHY_SIZE (3) +#define PSOC_MAX_HW_MODE (2) +#define PSOC_MAX_MAC_PHY_CAP (5) +#define PSOC_MAX_PHY_REG_CAP (3) /* forward declaration of object manager psoc object type */ struct wlan_objmgr_psoc; @@ -49,11 +46,6 @@ struct wlan_objmgr_psoc; * @high_2ghz_chan: higher 2.4 GHz channels * @low_5ghz_chan: lower 5 GHz channels * @high_5ghz_chan: higher 5 GHz channels - * - * wlan_psoc_hal_reg_capability is derived from TARGET_HAL_REG_CAPABILITIES - * because of WIN direct attach limitation which blocks WMI data structures and - * WMI APIs direct usage in common code. So whenever TARGET_HAL_REG_CAPABILITIES - * changes wlan_psoc_hal_reg_capability also needs to be updated accordingly. */ struct wlan_psoc_hal_reg_capability { uint32_t eeprom_rd; @@ -86,12 +78,6 @@ struct wlan_psoc_hal_reg_capability { * @txrx_chainmask: TXRX chain mask * @default_dbs_hw_mode_index: DBS hw mode index * @num_msdu_desc: number of msdu desc - * - * wlan_psoc_target_capability_info is derived from target_capability_info - * because of WIN direct attach limitation which blocks WMI data structures and - * WMI APIs direct usage in common code. So whenever target_capability_info - * changes wlan_psoc_target_capability_info also needs to be updated - * accordingly. */ struct wlan_psoc_target_capability_info { uint32_t phy_capability; @@ -118,15 +104,9 @@ struct wlan_psoc_target_capability_info { * @service_bitmap: service bitmap * @target_caps: traget capability * @hal_reg_cap: hal reg capability - * - * wlan_objmgr_psoc_service_ready_param is derived from wmi_service_ready_param - * because of WIN direct attach limitation which blocks WMI data structures and - * WMI APIs direct usage in common code. So whenever wmi_service_ready_param - * changes wlan_objmgr_psoc_service_ready_param also needs to be updated - * accordingly. */ struct wlan_objmgr_psoc_service_ready_param { - uint32_t service_bitmap[OBJMGR_SERVICE_BM_SIZE]; + uint32_t service_bitmap[PSOC_SERVICE_BM_SIZE]; struct wlan_psoc_target_capability_info target_caps; struct wlan_psoc_hal_reg_capability hal_reg_cap; }; @@ -144,13 +124,6 @@ struct wlan_objmgr_psoc_service_ready_param { * @high_2ghz_chan: 2G channel High * @low_5ghz_chan: 5G channel low * @high_5ghz_chan: 5G channel High - * - * wlan_psoc_host_hal_reg_capabilities_ext is derived from - * WMI_HOST_HAL_REG_CAPABILITIES_EXT because of WIN direct attach limitation - * which blocks WMI data structures and WMI APIs direct usage in common code. - * So whenever WMI_HOST_HAL_REG_CAPABILITIES_EXT changes - * wlan_psoc_host_hal_reg_capabilities_ext also needs to be updated - * accordingly. */ struct wlan_psoc_host_hal_reg_capabilities_ext { uint32_t phy_id; @@ -166,24 +139,17 @@ struct wlan_psoc_host_hal_reg_capabilities_ext { }; /** - * struct wlan_objmgr_host_ppe_threshold - PPE threshold + * struct wlan_psoc_host_ppe_threshold - PPE threshold * @numss_m1: NSS - 1 * @ru_count: Max RU count * @ppet16_ppet8_ru3_ru0: ppet8 and ppet16 for max num ss - * - * wlan_objmgr_host_ppe_threshold is derived from wmi_host_ppe_threshold - * because of WIN direct attach limitation which blocks WMI data structures and - * WMI APIs direct usage in common code. So whenever wmi_host_ppe_threshold - * changes wlan_objmgr_host_ppe_threshold also needs to be updated - * accordingly. */ -struct wlan_objmgr_host_ppe_threshold { +struct wlan_psoc_host_ppe_threshold { uint32_t numss_m1; uint32_t ru_count; - uint32_t ppet16_ppet8_ru3_ru0[OBJMGR_HOST_MAX_NUM_SS]; + uint32_t ppet16_ppet8_ru3_ru0[PSOC_HOST_MAX_NUM_SS]; }; - /** * struct wlan_psoc_host_mac_phy_caps - Phy caps recvd in EXT service * @hw_mode_id: identify a particular set of HW characteristics, @@ -232,12 +198,6 @@ struct wlan_objmgr_host_ppe_threshold { * @he_cap_phy_info_5G: 5G HE capability phy field * @he_ppet2G: 2G HE PPET info * @he_ppet5G: 5G HE PPET info - * - * wlan_psoc_host_mac_phy_caps is derived from wmi_host_mac_phy_caps - * because of WIN direct attach limitation which blocks WMI data structures and - * WMI APIs direct usage in common code. So whenever wmi_host_mac_phy_caps - * changes wlan_psoc_host_mac_phy_caps also needs to be updated - * accordingly. */ struct wlan_psoc_host_mac_phy_caps { uint32_t hw_mode_id; @@ -267,10 +227,10 @@ struct wlan_psoc_host_mac_phy_caps { uint32_t he_supp_mcs_5G; uint32_t tx_chain_mask_5G; uint32_t rx_chain_mask_5G; - uint32_t he_cap_phy_info_2G[OBJMGR_HOST_MAX_PHY_SIZE]; - uint32_t he_cap_phy_info_5G[OBJMGR_HOST_MAX_PHY_SIZE]; - struct wlan_objmgr_host_ppe_threshold he_ppet2G; - struct wlan_objmgr_host_ppe_threshold he_ppet5G; + uint32_t he_cap_phy_info_2G[PSOC_HOST_MAX_PHY_SIZE]; + uint32_t he_cap_phy_info_5G[PSOC_HOST_MAX_PHY_SIZE]; + struct wlan_psoc_host_ppe_threshold he_ppet2G; + struct wlan_psoc_host_ppe_threshold he_ppet5G; }; /** @@ -286,30 +246,22 @@ struct wlan_psoc_host_hw_mode_caps { uint32_t hw_mode_config_type; }; - - /** * struct wlan_psoc_host_service_ext_param - EXT service base params in event * @default_conc_scan_config_bits: Default concurrenct scan config * @default_fw_config_bits: Default HW config bits - * @wlan_objmgr_host_ppe_threshold ppet: Host PPE threshold struct + * @wlan_psoc_host_ppe_threshold ppet: Host PPE threshold struct * @he_cap_info: HE capabality info * @mpdu_density: units are microseconds * @max_bssid_rx_filters: Maximum no of BSSID based RX filters host can program * Value 0 means FW hasn't given any limit to host. * @num_hw_modes: Number of HW modes in event * @num_phy: Number of Phy mode. - * - * wlan_psoc_host_service_ext_param is derived from wmi_host_service_ext_param - * because of WIN direct attach limitation which blocks WMI data structures and - * WMI APIs direct usage in common code. So whenever wmi_host_service_ext_param - * changes wlan_psoc_host_service_ext_param also needs to be updated - * accordingly. */ struct wlan_psoc_host_service_ext_param { uint32_t default_conc_scan_config_bits; uint32_t default_fw_config_bits; - struct wlan_objmgr_host_ppe_threshold ppet; + struct wlan_psoc_host_ppe_threshold ppet; uint32_t he_cap_info; uint32_t mpdu_density; uint32_t max_bssid_rx_filters; @@ -323,51 +275,38 @@ struct wlan_psoc_host_service_ext_param { * @hw_mode_caps: hw mode caps * @mac_phy_cap: mac phy cap * @reg_cap: regulatory capability - * - * wlan_objmgr_psoc_ext_service_ready_param is derived from - * wmi_ext_service_ready_param because of WIN direct attach limitation which - * blocks WMI data structures and WMI APIs direct usage in common code. - * So whenever wmi_ext_service_ready_param changes - * wlan_objmgr_psoc_ext_service_ready_param also needs to be updated - * accordingly. */ struct wlan_objmgr_psoc_ext_service_ready_param { struct wlan_psoc_host_service_ext_param service_ext_param; - struct wlan_psoc_host_hw_mode_caps hw_mode_caps[OBJMGR_MAX_HW_MODE]; + struct wlan_psoc_host_hw_mode_caps hw_mode_caps[PSOC_MAX_HW_MODE]; struct wlan_psoc_host_mac_phy_caps - mac_phy_cap[OBJMGR_MAX_MAC_PHY_CAP]; + mac_phy_cap[PSOC_MAX_MAC_PHY_CAP]; struct wlan_psoc_host_hal_reg_capabilities_ext - reg_cap[OBJMGR_MAX_PHY_REG_CAP]; + reg_cap[PSOC_MAX_PHY_REG_CAP]; }; /** * wlan_objmgr_populate_service_ready_data() - populate wmi service ready data * in psoc * @psoc: psoc object pointer - * @service_ready_data: opaque pointer to wmi service ready data, it is - * intentionally taken opaque because WMI service ready - * type can't be used in common umac component because - * of WIN direct target limitation + * @service_ready_data: pointer to wmi service ready data * * Return: QDF status */ void wlan_objmgr_populate_service_ready_data(struct wlan_objmgr_psoc *psoc, - void *service_ready_data); + struct wlan_objmgr_psoc_service_ready_param *service_ready_data); /** * wlan_objmgr_populate_ext_service_ready_data() - populate wmi ext service * ready data in psoc * @psoc: psoc object pointer - * @ext_service_data: opaque pointer to ext wmi service ready data, it is - * intentionally taken opaque because WMI service ready - * type can't be used in common umac component because - * of WIN direct target limitation + * @ext_service_data: pointer to ext wmi service ready data * * Return: QDF status */ void wlan_objmgr_populate_ext_service_ready_data(struct wlan_objmgr_psoc *psoc, - void *ext_service_data); + struct wlan_objmgr_psoc_ext_service_ready_param *ext_service_data); #endif /* _WLAN_OBJMGR_PSOC_SERVICE_READY_API_H_*/ diff --git a/umac/cmn_services/obj_mgr/src/wlan_objmgr_psoc_service_ready_api.c b/umac/cmn_services/obj_mgr/src/wlan_objmgr_psoc_service_ready_api.c index ec65cf8e4dbe..781354384b04 100644 --- a/umac/cmn_services/obj_mgr/src/wlan_objmgr_psoc_service_ready_api.c +++ b/umac/cmn_services/obj_mgr/src/wlan_objmgr_psoc_service_ready_api.c @@ -26,26 +26,20 @@ void wlan_objmgr_populate_service_ready_data(struct wlan_objmgr_psoc *psoc, - void *data) + struct wlan_objmgr_psoc_service_ready_param *data) { - struct wlan_objmgr_psoc_service_ready_param *service_ready_data = data; - wlan_psoc_obj_lock(psoc); - qdf_mem_copy(&psoc->service_param, service_ready_data, - sizeof(psoc->service_param)); + psoc->service_param = *data; wlan_psoc_obj_unlock(psoc); } EXPORT_SYMBOL(wlan_objmgr_populate_service_ready_data); void wlan_objmgr_populate_ext_service_ready_data(struct wlan_objmgr_psoc *psoc, - void *data) + struct wlan_objmgr_psoc_ext_service_ready_param *data) { - struct wlan_objmgr_psoc_ext_service_ready_param *ext_data = data; - wlan_psoc_obj_lock(psoc); - qdf_mem_copy(&psoc->ext_service_param, ext_data, - sizeof(psoc->ext_service_param)); + psoc->ext_service_param = *data; wlan_psoc_obj_unlock(psoc); } EXPORT_SYMBOL(wlan_objmgr_populate_ext_service_ready_data); diff --git a/wmi/inc/wmi_unified_api.h b/wmi/inc/wmi_unified_api.h index f4fb89e9c016..d37ac652f716 100644 --- a/wmi/inc/wmi_unified_api.h +++ b/wmi/inc/wmi_unified_api.h @@ -1065,10 +1065,11 @@ QDF_STATUS wmi_save_service_bitmap(void *wmi_hdl, void *evt_buf, QDF_STATUS wmi_save_fw_version(void *wmi_hdl, void *evt_buf); QDF_STATUS wmi_get_target_cap_from_service_ready(void *wmi_hdl, - void *evt_buf, target_capability_info *ev); + void *evt_buf, + struct wlan_psoc_target_capability_info *ev); QDF_STATUS wmi_extract_hal_reg_cap(void *wmi_hdl, void *evt_buf, - TARGET_HAL_REG_CAPABILITIES *hal_reg_cap); + struct wlan_psoc_hal_reg_capability *hal_reg_cap); host_mem_req *wmi_extract_host_mem_req_from_service_ready(void *wmi_hdl, void *evt_buf, uint8_t *num_entries); @@ -1325,22 +1326,21 @@ QDF_STATUS wmi_unified_peer_rx_reorder_queue_remove_send(void *wmi_hdl, struct rx_reorder_queue_remove_params *param); QDF_STATUS wmi_extract_service_ready_ext(void *wmi_hdl, uint8_t *evt_buf, - struct wmi_host_service_ext_param *param); + struct wlan_psoc_host_service_ext_param *param); QDF_STATUS wmi_extract_hw_mode_cap_service_ready_ext( void *wmi_hdl, uint8_t *evt_buf, uint8_t hw_mode_idx, - struct wmi_host_hw_mode_caps *param); + struct wlan_psoc_host_hw_mode_caps *param); QDF_STATUS wmi_extract_mac_phy_cap_service_ready_ext( void *wmi_hdl, uint8_t *evt_buf, uint8_t hw_mode_id, uint8_t phy_id, - struct wmi_host_mac_phy_caps *param); + struct wlan_psoc_host_mac_phy_caps *param); QDF_STATUS wmi_extract_reg_cap_service_ready_ext( void *wmi_hdl, uint8_t *evt_buf, uint8_t phy_idx, - struct WMI_HOST_HAL_REG_CAPABILITIES_EXT *param); - + struct wlan_psoc_host_hal_reg_capabilities_ext *param); QDF_STATUS wmi_extract_pdev_utf_event(void *wmi_hdl, uint8_t *evt_buf, struct wmi_host_pdev_utf_event *param); diff --git a/wmi/inc/wmi_unified_param.h b/wmi/inc/wmi_unified_param.h index e1e71a4e671a..d1de13c9ec96 100644 --- a/wmi/inc/wmi_unified_param.h +++ b/wmi/inc/wmi_unified_param.h @@ -3371,24 +3371,6 @@ struct ext_scan_setbssi_hotlist_params { struct ap_threshold_params ap[WMI_WLAN_EXTSCAN_MAX_HOTLIST_APS]; }; -/** - * struct TARGET_HAL_REG_CAPABILITIES - This is replication of REG table - * structure defined by target. This is added here to remove dependency - * on FW headers so that host can be agnostic to different defintions in - * both the targets. - */ -typedef struct { - uint32_t eeprom_rd; /* regdomain value specified in EEPROM */ - uint32_t eeprom_rd_ext; /* regdomain */ - uint32_t regcap1; /* CAP1 capabilities bit map */ - uint32_t regcap2; /* REGDMN EEPROM CAP */ - uint32_t wireless_modes; /* REGDMN MODE */ - uint32_t low_2ghz_chan; - uint32_t high_2ghz_chan; - uint32_t low_5ghz_chan; - uint32_t high_5ghz_chan; -} TARGET_HAL_REG_CAPABILITIES; - /** * struct host_mem_req - Host memory request paramseters request by target * @req_id: Request id to identify the request. @@ -5410,46 +5392,6 @@ typedef enum { } wmi_conv_service_ids; #define WMI_SERVICE_UNAVAILABLE 0xFFFF -/** - * struct target_capability_info - Target capabilities in service ready - * @phy_capability: PHY capabilities - * @max_frag_entry: Maximum frag entries - * @num_rf_chains: Number of RF chains supported - * @ht_cap_info: HT cap info - * @vht_cap_info: VHT cap info - * @vht_supp_mcs: VHT Supported MCS - * @hw_min_tx_power: HW minimum tx power - * @hw_max_tx_power: HW maximum tx power - * @sys_cap_info: sys capability info - * @min_pkt_size_enable: Enterprise mode short pkt enable - * @max_bcn_ie_size: Max beacon and probe rsp IE offload size - * @max_num_scan_channels: Max scan channels - * @max_supported_macs: max supported MCS - * @wmi_fw_sub_feat_caps: FW sub feature capabilities - * @txrx_chainmask: TXRX chain mask - * @default_dbs_hw_mode_index: DBS hw mode index - * @num_msdu_desc: number of msdu desc - */ -typedef struct { - uint32_t phy_capability; - uint32_t max_frag_entry; - uint32_t num_rf_chains; - uint32_t ht_cap_info; - uint32_t vht_cap_info; - uint32_t vht_supp_mcs; - uint32_t hw_min_tx_power; - uint32_t hw_max_tx_power; - uint32_t sys_cap_info; - uint32_t min_pkt_size_enable; - uint32_t max_bcn_ie_size; - uint32_t max_num_scan_channels; - uint32_t max_supported_macs; - uint32_t wmi_fw_sub_feat_caps; - uint32_t txrx_chainmask; - uint32_t default_dbs_hw_mode_index; - uint32_t num_msdu_desc; -} target_capability_info; - /** * enum WMI_DBG_PARAM - Debug params * @WMI_DBGLOG_LOG_LEVEL: Set the loglevel @@ -7049,155 +6991,6 @@ enum wmi_host_hw_mode_config_type { WMI_HOST_HW_MODE_MAX, }; -/** - * struct wmi_host_service_ext_param - EXT service base params in event - * @default_conc_scan_config_bits: Default concurrenct scan config - * @default_fw_config_bits: Default HW config bits - * @wmi_host_ppe_threshold ppet: Host PPE threshold struct - * @he_cap_info: HE capabality info - * @mpdu_density: units are microseconds - * @max_bssid_rx_filters: Maximum no of BSSID based RX filters host can program - * Value 0 means FW hasn't given any limit to host. - * @num_hw_modes: Number of HW modes in event - * @num_phy: Number of Phy mode. - */ -struct wmi_host_service_ext_param { - uint32_t default_conc_scan_config_bits; - uint32_t default_fw_config_bits; - struct wmi_host_ppe_threshold ppet; - uint32_t he_cap_info; - uint32_t mpdu_density; - uint32_t max_bssid_rx_filters; - uint32_t num_hw_modes; - uint32_t num_phy; -}; - -/** - * struct wmi_host_hw_mode_caps - HW mode capabilities in EXT event - * @hw_mode_id: identify a particular set of HW characteristics, - * as specified by the subsequent fields - * @phy_id_map: BIT0 represents phy_id 0, BIT1 represent phy_id 1 and so on - * @hw_mode_config_type: HW mode config type - */ -struct wmi_host_hw_mode_caps { - uint32_t hw_mode_id; - uint32_t phy_id_map; - uint32_t hw_mode_config_type; -}; - -/** - * struct wmi_host_mac_phy_caps - Phy caps recvd in EXT service - * @hw_mode_id: identify a particular set of HW characteristics, - * as specified by the subsequent fields. WMI_MAC_PHY_CAPABILITIES - * element must be mapped to its parent WMI_HW_MODE_CAPABILITIES - * element using hw_mode_id. No particular ordering of - * WMI_MAC_PHY_CAPABILITIES elements should be - * assumed, though in practice the elements may always be ordered - * by hw_mode_id. - * @pdev_id: pdev_id starts with 1. pdev_id 1 => phy_id 0, pdev_id 2 => phy_id 1 - * @phy_id: Starts with 0 - * @bitmap of supported modulations - * @supported_bands: supported bands, enum WLAN_BAND_CAPABILITY (mapped to - * enum WMI_HOST_WLAN_BAND_CAPABILITY within host) - * @ampdu_density: ampdu density 0 for no restriction, 1 for 1/4 us, - * 2 for 1/2 us, 3 for 1 us,4 for 2 us, 5 for 4 us, - * 6 for 8 us,7 for 16 us - * @max_bw_supported_2G: max bw supported 2G, enum wmi_channel_width (mapped to - * enum wmi_host_channel_width within host) - * @ht_cap_info_2G: WMI HT Capability, WMI_HT_CAP defines - * @vht_cap_info_2G: VHT capability info field of 802.11ac, WMI_VHT_CAP defines - * @vht_supp_mcs_2G: VHT Supported MCS Set field Rx/Tx same - * The max VHT-MCS for n SS subfield (where n = 1,...,8) is encoded as - * follows - * - 0 indicates support for VHT-MCS 0-7 for n spatial streams - * - 1 indicates support for VHT-MCS 0-8 for n spatial streams - * - 2 indicates support for VHT-MCS 0-9 for n spatial streams - * - 3 indicates that n spatial streams is not supported - * @he_cap_info_2G: HE capability info field of 802.11ax, WMI_HE_CAP defines - * @he_supp_mcs_2G: HE Supported MCS Set field Rx/Tx same - * @tx_chain_mask_2G: Valid Transmit chain mask - * @rx_chain_mask_2G: Valid Receive chain mask - * @max_bw_supported_5G: max bw supported 5G, enum wmi_channel_width (mapped to - * enum wmi_host_channel_width within host) - * @ht_cap_info_5G: WMI HT Capability, WMI_HT_CAP defines - * @vht_cap_info_5G: VHT capability info field of 802.11ac, WMI_VHT_CAP defines - * @vht_supp_mcs_5G: VHT Supported MCS Set field Rx/Tx same - * The max VHT-MCS for n SS subfield (where n = 1,...,8) is encoded as - * follows - * - 0 indicates support for VHT-MCS 0-7 for n spatial streams - * - 1 indicates support for VHT-MCS 0-8 for n spatial streams - * - 2 indicates support for VHT-MCS 0-9 for n spatial streams - * - 3 indicates that n spatial streams is not supported - * @he_cap_info_5G: HE capability info field of 802.11ax, WMI_HE_CAP defines - * @he_supp_mcs_5G: HE Supported MCS Set field Rx/Tx same - * @tx_chain_mask_5G: Valid Transmit chain mask - * @rx_chain_mask_5G: Valid Receive chain mask - * @he_cap_phy_info_2G: 2G HE capability phy field - * @he_cap_phy_info_5G: 5G HE capability phy field - * @he_ppet2G: 2G HE PPET info - * @he_ppet5G: 5G HE PPET info - */ -struct wmi_host_mac_phy_caps { - uint32_t hw_mode_id; - uint32_t pdev_id; - uint32_t phy_id; - uint32_t supports_11b:1, - supports_11g:1, - supports_11a:1, - supports_11n:1, - supports_11ac:1, - supports_11ax:1; - uint32_t supported_bands; - uint32_t ampdu_density; - uint32_t max_bw_supported_2G; - uint32_t ht_cap_info_2G; - uint32_t vht_cap_info_2G; - uint32_t vht_supp_mcs_2G; - uint32_t he_cap_info_2G; - uint32_t he_supp_mcs_2G; - uint32_t tx_chain_mask_2G; - uint32_t rx_chain_mask_2G; - uint32_t max_bw_supported_5G; - uint32_t ht_cap_info_5G; - uint32_t vht_cap_info_5G; - uint32_t vht_supp_mcs_5G; - uint32_t he_cap_info_5G; - uint32_t he_supp_mcs_5G; - uint32_t tx_chain_mask_5G; - uint32_t rx_chain_mask_5G; - uint32_t he_cap_phy_info_2G[WMI_HOST_MAX_HECAP_PHY_SIZE]; - uint32_t he_cap_phy_info_5G[WMI_HOST_MAX_HECAP_PHY_SIZE]; - struct wmi_host_ppe_threshold he_ppet2G; - struct wmi_host_ppe_threshold he_ppet5G; -}; - -/** - * struct WMI_HOST_HAL_REG_CAPABILITIES_EXT: Below are Reg caps per PHY. - * Please note PHY ID starts with 0. - * @phy_id: phy id starts with 0. - * @eeprom_reg_domain: regdomain value specified in EEPROM - * @eeprom_reg_domain_ext: regdomain - * @regcap1: CAP1 capabilities bit map, see REGDMN_CAP1_ defines - * @regcap2: REGDMN EEPROM CAP, see REGDMN_EEPROM_EEREGCAP_ defines - * @wireless_modes: REGDMN MODE, see REGDMN_MODE_ enum - * @low_2ghz_chan: 2G channel low - * @high_2ghz_chan: 2G channel High - * @low_5ghz_chan: 5G channel low - * @high_5ghz_chan: 5G channel High - */ -struct WMI_HOST_HAL_REG_CAPABILITIES_EXT { - uint32_t phy_id; - uint32_t eeprom_reg_domain; - uint32_t eeprom_reg_domain_ext; - uint32_t regcap1; - uint32_t regcap2; - uint32_t wireless_modes; - uint32_t low_2ghz_chan; - uint32_t high_2ghz_chan; - uint32_t low_5ghz_chan; - uint32_t high_5ghz_chan; -}; - /* * struct wmi_host_peer_txmu_cnt_event * @tx_mu_transmitted - MU-MIMO tx count diff --git a/wmi/inc/wmi_unified_priv.h b/wmi/inc/wmi_unified_priv.h index 673972f04b1a..e214026f7c37 100644 --- a/wmi/inc/wmi_unified_priv.h +++ b/wmi/inc/wmi_unified_priv.h @@ -35,6 +35,7 @@ #include "a_types.h" #include "wmi_unified_param.h" #include "qdf_atomic.h" +#include "wlan_objmgr_psoc_service_ready_api.h" #define WMI_UNIFIED_MAX_EVENT 0x100 #ifdef CONFIG_MCL @@ -914,7 +915,7 @@ void (*save_service_bitmap)(wmi_unified_t wmi_handle, bool (*is_service_enabled)(wmi_unified_t wmi_handle, uint32_t service_id); QDF_STATUS (*get_target_cap_from_service_ready)(wmi_unified_t wmi_handle, - void *evt_buf, target_capability_info *ev); + void *evt_buf, struct wlan_psoc_target_capability_info *ev); QDF_STATUS (*extract_fw_version)(wmi_unified_t wmi_handle, void *ev, struct wmi_host_fw_ver *fw_ver); @@ -923,7 +924,7 @@ QDF_STATUS (*extract_fw_abi_version)(wmi_unified_t wmi_handle, void *ev, struct wmi_host_fw_abi_ver *fw_ver); QDF_STATUS (*extract_hal_reg_cap)(wmi_unified_t wmi_handle, void *evt_buf, - TARGET_HAL_REG_CAPABILITIES *hal_reg_cap); + struct wlan_psoc_hal_reg_capability *hal_reg_cap); host_mem_req * (*extract_host_mem_req)(wmi_unified_t wmi_handle, void *evt_buf, uint8_t *num_entries); @@ -1205,24 +1206,24 @@ QDF_STATUS (*send_peer_rx_reorder_queue_remove_cmd)(wmi_unified_t wmi_handle, QDF_STATUS (*extract_service_ready_ext)(wmi_unified_t wmi_handle, uint8_t *evt_buf, - struct wmi_host_service_ext_param *param); + struct wlan_psoc_host_service_ext_param *param); QDF_STATUS (*extract_hw_mode_cap_service_ready_ext)( wmi_unified_t wmi_handle, uint8_t *evt_buf, uint8_t hw_mode_idx, - struct wmi_host_hw_mode_caps *param); + struct wlan_psoc_host_hw_mode_caps *param); QDF_STATUS (*extract_mac_phy_cap_service_ready_ext)( wmi_unified_t wmi_handle, uint8_t *evt_buf, uint8_t hw_mode_id, uint8_t phy_id, - struct wmi_host_mac_phy_caps *param); + struct wlan_psoc_host_mac_phy_caps *param); QDF_STATUS (*extract_reg_cap_service_ready_ext)( wmi_unified_t wmi_handle, uint8_t *evt_buf, uint8_t phy_idx, - struct WMI_HOST_HAL_REG_CAPABILITIES_EXT *param); + struct wlan_psoc_host_hal_reg_capabilities_ext *param); QDF_STATUS (*extract_pdev_utf_event)(wmi_unified_t wmi_hdl, uint8_t *evt_buf, diff --git a/wmi/src/wmi_unified_api.c b/wmi/src/wmi_unified_api.c index a3e7f9d1c31b..84990bc56052 100644 --- a/wmi/src/wmi_unified_api.c +++ b/wmi/src/wmi_unified_api.c @@ -4393,7 +4393,7 @@ bool wmi_service_enabled(void *wmi_hdl, uint32_t service_id) * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure */ QDF_STATUS wmi_get_target_cap_from_service_ready(void *wmi_hdl, - void *evt_buf, target_capability_info *ev) + void *evt_buf, struct wlan_psoc_target_capability_info *ev) { wmi_unified_t wmi = (wmi_unified_t) wmi_hdl; @@ -4453,7 +4453,7 @@ QDF_STATUS wmi_extract_fw_abi_version(void *wmi_hdl, * Return: QDF_STATUS_SUCCESS on success and QDF_STATUS_E_FAILURE for failure */ QDF_STATUS wmi_extract_hal_reg_cap(void *wmi_hdl, void *evt_buf, - TARGET_HAL_REG_CAPABILITIES *hal_reg_cap) + struct wlan_psoc_hal_reg_capability *hal_reg_cap) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; @@ -6197,7 +6197,7 @@ QDF_STATUS wmi_unified_send_btcoex_duty_cycle_cmd(void *wmi_hdl, * Return: QDF_STATUS_SUCCESS on success, QDF_STATUS_E_** on error */ QDF_STATUS wmi_extract_service_ready_ext(void *wmi_hdl, uint8_t *evt_buf, - struct wmi_host_service_ext_param *param) + struct wlan_psoc_host_service_ext_param *param) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; @@ -6221,7 +6221,7 @@ QDF_STATUS wmi_extract_service_ready_ext(void *wmi_hdl, uint8_t *evt_buf, QDF_STATUS wmi_extract_hw_mode_cap_service_ready_ext( void *wmi_hdl, uint8_t *evt_buf, uint8_t hw_mode_idx, - struct wmi_host_hw_mode_caps *param) + struct wlan_psoc_host_hw_mode_caps *param) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; @@ -6248,7 +6248,7 @@ QDF_STATUS wmi_extract_mac_phy_cap_service_ready_ext( uint8_t *evt_buf, uint8_t hw_mode_id, uint8_t phy_id, - struct wmi_host_mac_phy_caps *param) + struct wlan_psoc_host_mac_phy_caps *param) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; @@ -6273,7 +6273,7 @@ QDF_STATUS wmi_extract_mac_phy_cap_service_ready_ext( QDF_STATUS wmi_extract_reg_cap_service_ready_ext( void *wmi_hdl, uint8_t *evt_buf, uint8_t phy_idx, - struct WMI_HOST_HAL_REG_CAPABILITIES_EXT *param) + struct wlan_psoc_host_hal_reg_capabilities_ext *param) { wmi_unified_t wmi_handle = (wmi_unified_t) wmi_hdl; diff --git a/wmi/src/wmi_unified_non_tlv.c b/wmi/src/wmi_unified_non_tlv.c index 314b12fcd0e8..07b1dbdfe8a9 100644 --- a/wmi/src/wmi_unified_non_tlv.c +++ b/wmi/src/wmi_unified_non_tlv.c @@ -5454,7 +5454,7 @@ static bool is_service_enabled_non_tlv(wmi_unified_t wmi_handle, */ static QDF_STATUS extract_service_ready_non_tlv(wmi_unified_t wmi_handle, void *evt_buf, - target_capability_info *cap) + struct wlan_psoc_target_capability_info *cap) { wmi_service_ready_event *ev; @@ -5535,7 +5535,7 @@ static QDF_STATUS extract_fw_abi_version_non_tlv(wmi_unified_t wmi_handle, */ static QDF_STATUS extract_hal_reg_cap_non_tlv(wmi_unified_t wmi_handle, void *evt_buf, - TARGET_HAL_REG_CAPABILITIES *cap) + struct wlan_psoc_hal_reg_capability *cap) { wmi_service_ready_event *ev; u_int32_t wireless_modes_orig = 0; @@ -5543,7 +5543,7 @@ static QDF_STATUS extract_hal_reg_cap_non_tlv(wmi_unified_t wmi_handle, ev = (wmi_service_ready_event *) evt_buf; qdf_mem_copy(cap, &ev->hal_reg_capabilities, - sizeof(TARGET_HAL_REG_CAPABILITIES)); + sizeof(struct wlan_psoc_hal_reg_capability)); /* Convert REGDMN_MODE values sent by target to host internal * WMI_HOST_REGDMN_MODE values. diff --git a/wmi/src/wmi_unified_tlv.c b/wmi/src/wmi_unified_tlv.c index 24bc8a3f2db6..2efb99f4a67f 100644 --- a/wmi/src/wmi_unified_tlv.c +++ b/wmi/src/wmi_unified_tlv.c @@ -12427,7 +12427,7 @@ static bool is_service_enabled_tlv(wmi_unified_t wmi_handle, * Return: QDF_STATUS_SUCCESS for success or error code */ static QDF_STATUS extract_service_ready_tlv(wmi_unified_t wmi_handle, - void *evt_buf, target_capability_info *cap) + void *evt_buf, struct wlan_psoc_target_capability_info *cap) { WMI_SERVICE_READY_EVENTID_param_tlvs *param_buf; wmi_service_ready_event_fixed_param *ev; @@ -12471,7 +12471,7 @@ static QDF_STATUS extract_service_ready_tlv(wmi_unified_t wmi_handle, * Return: QDF_STATUS_SUCCESS for success or error code */ static QDF_STATUS extract_hal_reg_cap_tlv(wmi_unified_t wmi_handle, - void *evt_buf, TARGET_HAL_REG_CAPABILITIES *cap) + void *evt_buf, struct wlan_psoc_hal_reg_capability *cap) { WMI_SERVICE_READY_EVENTID_param_tlvs *param_buf; u_int32_t wireless_modes_orig = 0; @@ -12480,7 +12480,7 @@ static QDF_STATUS extract_hal_reg_cap_tlv(wmi_unified_t wmi_handle, qdf_mem_copy(cap, (((uint8_t *)param_buf->hal_reg_capabilities) + sizeof(uint32_t)), - sizeof(TARGET_HAL_REG_CAPABILITIES)); + sizeof(struct wlan_psoc_hal_reg_capability)); /* Convert REGDMN_MODE values sent by target to host internal * WMI_HOST_REGDMN_MODE values. @@ -13507,7 +13507,7 @@ static QDF_STATUS extract_channel_hopping_event_tlv(wmi_unified_t wmi_handle, * Return: QDF_STATUS_SUCCESS for success or error code */ static QDF_STATUS extract_service_ready_ext_tlv(wmi_unified_t wmi_handle, - uint8_t *event, struct wmi_host_service_ext_param *param) + uint8_t *event, struct wlan_psoc_host_service_ext_param *param) { WMI_SERVICE_READY_EXT_EVENTID_param_tlvs *param_buf; wmi_service_ready_ext_event_fixed_param *ev; @@ -13559,7 +13559,7 @@ static QDF_STATUS extract_service_ready_ext_tlv(wmi_unified_t wmi_handle, static QDF_STATUS extract_hw_mode_cap_service_ready_ext_tlv( wmi_unified_t wmi_handle, uint8_t *event, uint8_t hw_mode_idx, - struct wmi_host_hw_mode_caps *param) + struct wlan_psoc_host_hw_mode_caps *param) { WMI_SERVICE_READY_EXT_EVENTID_param_tlvs *param_buf; WMI_SOC_MAC_PHY_HW_MODE_CAPS *hw_caps; @@ -13598,7 +13598,7 @@ static QDF_STATUS extract_hw_mode_cap_service_ready_ext_tlv( static QDF_STATUS extract_mac_phy_cap_service_ready_ext_tlv( wmi_unified_t wmi_handle, uint8_t *event, uint8_t hw_mode_id, uint8_t phy_id, - struct wmi_host_mac_phy_caps *param) + struct wlan_psoc_host_mac_phy_caps *param) { WMI_SERVICE_READY_EXT_EVENTID_param_tlvs *param_buf; WMI_MAC_PHY_CAPABILITIES *mac_phy_caps; @@ -13695,7 +13695,7 @@ static QDF_STATUS extract_mac_phy_cap_service_ready_ext_tlv( static QDF_STATUS extract_reg_cap_service_ready_ext_tlv( wmi_unified_t wmi_handle, uint8_t *event, uint8_t phy_idx, - struct WMI_HOST_HAL_REG_CAPABILITIES_EXT *param) + struct wlan_psoc_host_hal_reg_capabilities_ext *param) { WMI_SERVICE_READY_EXT_EVENTID_param_tlvs *param_buf; WMI_SOC_HAL_REG_CAPABILITIES *reg_caps;