qcacmn: Converge initial HOST FW handshake

Implement service ready, ext service ready
ready event handler, init command preparation
and other required APIs

Change-Id: Iaf707227c1e94bb492dd86bd2d0916a1cf875498
CRs-Fixed: 2177109
This commit is contained in:
Srinivas Pitla
2017-12-21 10:24:42 +05:30
committed by snandini
parent 9af4f65f61
commit cc75651c34
14 changed files with 2265 additions and 674 deletions

View File

@@ -0,0 +1,104 @@
/*
* Copyright (c) 2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all
* copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/**
* DOC: init_cmd_api.h
*
* Public APIs to prepare and send init command
*/
#ifndef _INIT_DEINIT_INIT_CMD_H_
#define _INIT_DEINIT_INIT_CMD_H_
/* max size if 256k */
#define HOST_MEM_CHUNK_MAX_SIZE (256 * 1024)
#define HOST_MEM_CHUNK_MAX_SIZE_POWER2 (8 + 10)
#define TXBF_CV_POOL0 2
#define TXBF_CV_POOL1 3
#define TXBF_CV_POOL2 4
#define HOST_CONTIGUOUS_MEM_CHUNK_REQUIRED 0x8
/**
* enum wlan_fw_mem_prio - defines FW Memory requirement type
* @FW_MEM_HIGH_PRIORITY: Memory requires contiguous memory allocation
* @FW_MEM_LOW_PRIORITY: Memory can be fragmented
* @FW_PRIORITY_MAX: Invalid type
*/
enum wlan_fw_mem_prio {
FW_MEM_HIGH_PRIORITY = 0,
FW_MEM_LOW_PRIORITY,
FW_PRIORITY_MAX
};
/**
* init_deinit_handle_host_mem_req() - handle host memory request
* @psoc: PSOC object
* @tgt_info: PSOC_INFO object
* @event: Event buffer from FW
*
* API to handle memory request from FW and allocate memory chunks
*
* Return: SUCCESS on successful memory allocation
* On FAILURE (appropriate failure codes are returned)
*/
QDF_STATUS init_deinit_handle_host_mem_req(
struct wlan_objmgr_psoc *psoc,
struct target_psoc_info *tgt_info, uint8_t *event);
/**
* init_deinit_free_num_units() - Free allocated mem chunks
* @psoc: PSOC object
* @tgt_info: PSOC_INFO object
*
* API to free memory
*
* Return: SUCCESS on successful memory free
* On FAILURE (appropriate failure codes are returned)
*/
QDF_STATUS init_deinit_free_num_units(struct wlan_objmgr_psoc *psoc,
struct target_psoc_info *tgt_hdl);
/**
* init_deinit_derive_band_to_mac_param() - Derive band to mac param
* @psoc: PSOC object
* @tgt_info: PSOC_INFO object
* @band_to_mac: BAND_TO_MAC object
*
* API to derive band to mac param
*
* Return: void
*/
void init_deinit_derive_band_to_mac_param(
struct wlan_objmgr_psoc *psoc,
struct target_psoc_info *tgt_info,
struct wmi_host_pdev_band_to_mac *band_to_mac);
/**
* init_deinit_prepare_send_init_cmd() - prepare send init cmd
* @psoc: PSOC object
* @tgt_info: PSOC_INFO object
*
* API to prepare send init command
*
* Return: void
*/
void init_deinit_prepare_send_init_cmd(
struct wlan_objmgr_psoc *psoc,
struct target_psoc_info *tgt_info);
#endif /* _INIT_DEINIT_INIT_CMD_H_*/

View File

@@ -0,0 +1,156 @@
/*
* Copyright (c) 2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all
* copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/**
* DOC: init_deinit_ucfg.h
*
* Public APIs to get target_if info
*/
#ifndef _INIT_DEINIT_UCFG_H_
#define _INIT_DEINIT_UCFG_H_
/**
* ucfg_get_service_param() - get service param
* @psoc: pointer to psoc
*
* API to get service parameters
*
* Return: service parameter array pointer
*/
uint32_t *ucfg_get_service_param(struct wlan_objmgr_psoc *psoc);
/**
* ucfg_is_service_param_bit_enabled() - check service param bit enabled
* @service_param: Service bitmap array
* @bit_idx: Service bit index to be checked
*
* API to check service param bitmap
*
* Return: true, if service is enabled
* false, if service is not enabled
*/
bool ucfg_is_service_param_bit_enabled(uint32_t *service_param,
uint16_t bit_idx);
/**
* ucfg_get_dfs_offload() - get dfs offload
* @psoc: pointer to psoc
* @is_tgt_offload: boolean flag for offload enabled/disabled
*
* API to get dfs offload
*
* Return: SUCCESS, if API is invoked without any failures
*/
QDF_STATUS ucfg_get_dfs_offload(struct wlan_objmgr_psoc *psoc,
bool *is_tgt_offload);
/**
* ucfg_get_tgt_res_cfg() - get target resource config
* @psoc: pointer to psoc
*
* API to get target resource config
*
* Return: target resource configuration
*/
target_resource_config *ucfg_get_tgt_res_cfg(struct wlan_objmgr_psoc *psoc);
/**
* ucfg_get_target_cap() - get target capability
* @psoc: pointer to psoc
*
* API to get target capability
*
* Return: target capability Information
*/
struct wlan_psoc_target_capability_info *ucfg_get_target_cap(
struct wlan_objmgr_psoc *psoc);
/**
* ucfg_get_pdev_idx() - get pdev id
* @pdev: pointer to pdev
*
* API to get pdev id
*
* Return: pdev id
*/
int32_t ucfg_get_pdev_idx(struct wlan_objmgr_pdev *pdev);
/**
* ucfg_get_pdev_target_type() - check pdev target type
* @pdev: pointer to pdev
* @target_type: target type ptr, it is assigned with pdev target_type
* target type stores the radio code
*
* API to check pdev target type
*
* Return: Success if found required target type else Failure
*/
QDF_STATUS ucfg_get_pdev_target_type(struct wlan_objmgr_pdev *pdev,
uint32_t *target_type);
/**
* ucfg_get_tgt_type() - get target type
* @psoc: pointer to psoc
*
* API to get target type
*
* Return: target type (value to identify particular radio)
*/
uint32_t ucfg_get_tgt_type(struct wlan_objmgr_psoc *psoc);
/**
* ucfg_get_tgt_version() - get target version
* @psoc: pointer to psoc
*
* API to get target version
*
* Return: target version
*/
uint32_t ucfg_get_tgt_version(struct wlan_objmgr_psoc *psoc);
/**
* ucfg_get_tgt_revision() - get target revision
* @psoc: pointer to psoc
*
* API to get target revision
*
* Return: target revision
*/
uint32_t ucfg_get_tgt_revision(struct wlan_objmgr_psoc *psoc);
/**
* ucfg_is_target_ar900b() - checks the target type
* @psoc: pointer to psoc
*
* API to check target type
*
* Return: True on presence of required target type else false
*/
bool ucfg_is_target_ar900b(struct wlan_objmgr_psoc *psoc);
/**
* ucfg_get_pdev_wmi_handle() - get pdev wmi handle
* @pdev: pointer to dev
*
* API to get wmi handle
*
* Return: wmi handle
*/
void *ucfg_get_pdev_wmi_handle(struct wlan_objmgr_pdev *pdev);
#endif /* _INIT_DEINIT_UCFG_H_ */

View File

@@ -0,0 +1,38 @@
/*
* Copyright (c) 2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all
* copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/**
* DOC: init_event_handler.h
*
* Public API file for common WMI event handlers
*/
#ifndef _INIT_EVENT_HANDLER_H_
#define _INIT_EVENT_HANDLER_H_
/**
* init_deinit_register_tgt_psoc_ev_handlers() - register tgt if handlers
* @psoc: PSOC object
*
* API to register tgt handlers
*
* Return: SUCCESS on successful registration
*/
QDF_STATUS init_deinit_register_tgt_psoc_ev_handlers(
struct wlan_objmgr_psoc *psoc);
#endif /* _INIT_EVENT_HANDLER_H_ */

View File

@@ -1,68 +0,0 @@
/*
* Copyright (c) 2017 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all
* copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/**
* DOC: wmi_unified_event_handler.h
*
* Public API file for common WMI event handlers
*/
#ifndef _WMI_UNIFIED_EVENT_HANDLER_H_
#define _WMI_UNIFIED_EVENT_HANDLER_H_
#include "athdefs.h"
#include "osapi_linux.h"
#include "a_types.h"
#include "a_debug.h"
#include "ol_if_athvar.h"
#include "ol_defines.h"
#include "qdf_types.h"
#include "qdf_util.h"
#include "wmi_unified_priv.h"
#include "wmi_unified_param.h"
#include "wlan_objmgr_psoc_obj.h"
#include "target_if.h"
#include "target_if_scan.h"
#include "target_if_reg.h"
/**
* init_deinit_service_ready_event_handler() - service ready handler
* @handle: opaqueue pointer to scn
* @event: pointer to event buffer
* @event_len: event length
*
* WMI common event handler for WMI_SERVICE_READY_EVENTID
*
* Return: 0 for success, negative error code for failure
*/
int init_deinit_service_ready_event_handler(ol_scn_t handle, uint8_t *event,
uint32_t event_len);
/**
* init_deinit_service_ext_ready_event_handler() - ext service ready handler
* @handle: opaqueue pointer to scn
* @event: pointer to event buffer
* @event_len: event length
*
* WMI common event handler for WMI_SERVICE_READY_EXT_EVENTID
*
* Return: 0 for success, negative error code for failure
*/
int init_deinit_service_ext_ready_event_handler(ol_scn_t handle, uint8_t *event,
uint32_t event_len);
#endif /* _WMI_UNIFIED_EVENT_HANDLER_H_ */

View File

@@ -0,0 +1,298 @@
/*
* Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all
* copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/**
* DOC: service_ready_param.h
*
* Public structures to access (ext)service ready data
*/
#ifndef _SERVICE_READY_PARAM_H_
#define _SERVICE_READY_PARAM_H_
#include "qdf_types.h"
/**
* struct wlan_psoc_hal_reg_capability - hal reg table in psoc
* @eeprom_rd: regdomain value specified in EEPROM
* @eeprom_rd_ext: regdomain
* @regcap1: CAP1 capabilities bit map
* @regcap2: REGDMN EEPROM CAP
* @wireless_modes: REGDMN MODE
* @low_2ghz_chan: lower 2.4GHz channels
* @high_2ghz_chan: higher 2.4 GHz channels
* @low_5ghz_chan: lower 5 GHz channels
* @high_5ghz_chan: higher 5 GHz channels
*/
struct wlan_psoc_hal_reg_capability {
uint32_t eeprom_rd;
uint32_t eeprom_rd_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 wlan_psoc_target_capability_info - target capabilities in psoc
* @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
* @fw_version: FW build version
* @fw_version_1: Second dword of FW version (Valid for non-tlv FW)
*/
struct wlan_psoc_target_capability_info {
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;
uint32_t fw_version;
uint32_t fw_version_1;
};
/**
* struct wlan_psoc_host_ppe_threshold - PPE threshold
* @numss_m1: NSS - 1
* @ru_bit_mask: RU bit mask indicating the supported RU's
* @ppet16_ppet8_ru3_ru0: ppet8 and ppet16 for max num ss
*/
struct wlan_psoc_host_ppe_threshold {
uint32_t numss_m1;
uint32_t ru_bit_mask;
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,
* 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
* @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
* @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
* @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
* @chainmask_table_id: chain mask table id
*/
struct wlan_psoc_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[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;
uint32_t chainmask_table_id;
};
/**
* struct wlan_psoc_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 wlan_psoc_host_hw_mode_caps {
uint32_t hw_mode_id;
uint32_t phy_id_map;
uint32_t hw_mode_config_type;
};
/**
* struct wlan_psoc_host_dbr_ring_caps - Direct buffer rx module ring
* capability maintained by PSOC
* @pdev_id: Pdev id of the pdev
* @mod_id: Module id
* @ring_elems_min: Minimum number of pointers in the ring
* @min_buf_size: Minimum size of each buffer entry in the ring
* @min_buf_align: Minimum alignment of the addresses in the ring
*/
struct wlan_psoc_host_dbr_ring_caps {
uint32_t pdev_id;
uint32_t mod_id;
uint32_t ring_elems_min;
uint32_t min_buf_size;
uint32_t min_buf_align;
};
/**
* struct wlan_psoc_host_chainmask_capabilities - chain mask capabilities list
* @supports_chan_width_20: channel width 20 support for this chain mask.
* @supports_chan_width_40: channel width 40 support for this chain mask.
* @supports_chan_width_80: channel width 80 support for this chain mask.
* @supports_chan_width_160: channel width 160 support for this chain mask.
* @supports_chan_width_80P80: channel width 80P80 support for this chain mask.
* @chain_mask_2G: 2G support for this chain mask.
* @chain_mask_5G: 5G support for this chain mask.
* @chain_mask_tx: Tx support for this chain mask.
* @chain_mask_rx: Rx support for this chain mask.
* @supports_aDFS: Agile DFS support for this chain mask.
* @chainmask: chain mask value.
*/
struct wlan_psoc_host_chainmask_capabilities {
uint32_t supports_chan_width_20:1,
supports_chan_width_40:1,
supports_chan_width_80:1,
supports_chan_width_160:1,
supports_chan_width_80P80:1,
reserved:22,
chain_mask_2G:1,
chain_mask_5G:1,
chain_mask_tx:1,
chain_mask_rx:1,
supports_aDFS:1;
uint32_t chainmask;
};
/**
* struct wlan_psoc_host_chainmask_table - chain mask table
* @table_id: tableid.
* @num_valid_chainmasks: num valid chainmasks.
* @cap_list: pointer to wlan_psoc_host_chainmask_capabilities list.
*/
struct wlan_psoc_host_chainmask_table {
uint32_t table_id;
uint32_t num_valid_chainmasks;
struct wlan_psoc_host_chainmask_capabilities *cap_list;
};
/**
* 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_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.
* @fw_build_vers_ext: Extended FW build version info.
* bits 27:0 rsvd
* bits 31:28 CRM sub ID
* @num_hw_modes: Number of HW modes in event
* @num_phy: Number of Phy mode.
* @num_chainmask_tables: Number of chain mask tables.
* @num_dbr_ring_caps: Number of direct buf rx ring capabilities
* @chainmask_table: Available chain mask tables.
*/
struct wlan_psoc_host_service_ext_param {
uint32_t default_conc_scan_config_bits;
uint32_t default_fw_config_bits;
struct wlan_psoc_host_ppe_threshold ppet;
uint32_t he_cap_info;
uint32_t mpdu_density;
uint32_t max_bssid_rx_filters;
uint32_t fw_build_vers_ext;
uint32_t num_hw_modes;
uint32_t num_phy;
uint32_t num_chainmask_tables;
uint32_t num_dbr_ring_caps;
struct wlan_psoc_host_chainmask_table
chainmask_table[PSOC_MAX_CHAINMASK_TABLES];
};
#endif /* _SERVICE_READY_PARAM_H_*/

View File

@@ -0,0 +1,241 @@
/*
* Copyright (c) 2017-2018 The Linux Foundation. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the
* above copyright notice and this permission notice appear in all
* copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
/**
* DOC: service_ready_util.h
*
* Public APIs to access (ext)service ready data from psoc object
*/
#ifndef _SERVICE_READY_UTIL_H_
#define _SERVICE_READY_UTIL_H_
#include "wlan_objmgr_psoc_obj.h"
#include "service_ready_param.h"
#include "target_if.h"
/**
* init_deinit_chainmask_table_alloc()
* - allocate chainmask table capability list.
* @service_ext_param: pointer to server ext param.
*
* Allocates capability list based on num_valid_chainmasks for that table.
*
* Return: QDF Status.
*/
QDF_STATUS init_deinit_chainmask_table_alloc(
struct wlan_psoc_host_service_ext_param *service_ext_param);
/**
* init_deinit_chainmask_table_free()
* -free chainmask table capability list.
* @service_ext_param: pointer to server ext param.
*
* free capability list based on num_valid_chainmasks for that table.
*
* Return: QDF Status.
*/
QDF_STATUS init_deinit_chainmask_table_free(
struct wlan_psoc_host_service_ext_param *service_ext_param);
/**
* init_deinit_populate_service_bitmap() - populate service bitmap
* @wmi_handle: wmi handle
* @event: event buffer received from FW
* @service_bitmap: service bitmap information
*
* API to populate service bit map
*
* Return: zero on successful population of service bitmap or failure flag
*/
int init_deinit_populate_service_bitmap(void *wmi_handle, uint8_t *event,
uint32_t *service_bitmap);
/**
* init_deinit_populate_fw_version_cmd() - populate FW version
* @wmi_handle: wmi handle
* @event: event buffer received from FW
*
* API to populate FW version
*
* Return: zero on successful population of fw_version command or failure flag
*/
int init_deinit_populate_fw_version_cmd(void *wmi_handle, uint8_t *event);
/**
* init_deinit_populate_target_cap() - populate target cap
* @wmi_handle: wmi handle
* @event: event buffer received from FW
* @cap: target capability info object
*
* API to populate target cap
*
* Return: zero on successful population of target cap or failure flag
*/
int init_deinit_populate_target_cap(void *wmi_handle, uint8_t *event,
struct wlan_psoc_target_capability_info *cap);
/**
* init_deinit_populate_service_ready_ext_param() - populate service ready ext
* parameter
* @handle: WMI handle pointer
* @evt: event buffer received from FW
* @param: service ext param object
*
* API to populate service ready ext param
*
* Return: zero on successful parsing of service ready ext parameter or failure
*/
int init_deinit_populate_service_ready_ext_param(void *handle, uint8_t *evt,
struct wlan_psoc_host_service_ext_param *param);
/**
* init_deinit_populate_chainmask_tables() - populate chainmaks tables
* @handle: WMI handle pointer
* @evt: event buffer received from FW
* @param: chainmaks_table object
*
* API to populate chainmaks tables
*
* Return: zero on successful parsing of chainmaks tables or failure flag
*/
int init_deinit_populate_chainmask_tables(void *handle, uint8_t *evt,
struct wlan_psoc_host_chainmask_table *param);
/**
* init_deinit_populate_mac_phy_capability() - populate mac phy capability
* @handle: WMI handle pointer
* @evt: event buffer received from FW
* @hw_cap: hw_mode_caps object
* @info: tgt_info object
*
* API to populate mac phy capability
*
* Return: zero on successful population of mac physical capability or failure
*/
int init_deinit_populate_mac_phy_capability(void *handle, uint8_t *evt,
struct wlan_psoc_host_hw_mode_caps *hw_cap, struct tgt_info *info);
/**
* init_deinit_populate_hw_mode_capability() - populate hw mode capability
* @wmi_handle: WMI handle pointer
* @event: event buffer received from FW
* @tgt_hdl: target_psoc_info object
*
* API to populate hw mode capability
*
* Return: zero on successful parsing of hw mode capability or failure
*/
int init_deinit_populate_hw_mode_capability(void *wmi_handle,
uint8_t *event, struct target_psoc_info *tgt_hdl);
/**
* init_deinit_populate_dbr_ring_cap() - populate dbr ring capability
* @psoc: PSOC object
* @handle: WMI handle pointer
* @event: event buffer received from FW
* @info: tgt_info object
*
* API to populate dbr ring capability
*
* Return: zero on successful parsing of dbr ring capability or failure
*/
int init_deinit_populate_dbr_ring_cap(struct wlan_objmgr_psoc *psoc,
void *handle, uint8_t *event,
struct tgt_info *info);
/**
* init_deinit_populate_phy_reg_cap() - populate phy reg capability
* @psoc: PSOC object
* @wmi_handle: WMI handle pointer
* @event: event buffer received from FW
* @info: tgt_info object
* @service_ready: service ready determiner
*
* API to populate phy reg capability
*
* Return: zero on successful parsing of physical reg capability or failure flag
*/
int init_deinit_populate_phy_reg_cap(struct wlan_objmgr_psoc *psoc,
void *wmi_handle, uint8_t *event,
struct tgt_info *info, bool service_ready);
/**
* init_deinit_validate_160_80p80_fw_caps() - validate 160 80p80 fw caps
* @psoc: PSOC object
* @tgt_info: target_psoc_info object
*
* API to validate 160 80p80 fw caps
*
* Return: SUCCESS on successful validation of 160 80p80 forward caps or Failure
*/
QDF_STATUS init_deinit_validate_160_80p80_fw_caps(
struct wlan_objmgr_psoc *psoc,
struct target_psoc_info *tgt_info);
/**
* init_deinit_chainmask_config() - config chainmask
* @psoc: PSOC object
* @tgt_info: target_psoc_info object
*
* API to config chainmask
*
* Return: none
*/
void init_deinit_chainmask_config(
struct wlan_objmgr_psoc *psoc,
struct target_psoc_info *tgt_info);
/**
* init_deinit_is_service_ext_msg() - check service ext message
* @psoc: PSOC object
* @tgt_info: target_psoc_info object
*
* API to check whether service ext message is enabled
*
* Return: SUCCESS on successful check of service_ext message or Failure
*/
QDF_STATUS init_deinit_is_service_ext_msg(
struct wlan_objmgr_psoc *psoc,
struct target_psoc_info *tgt_info);
/**
* init_deinit_is_preferred_hw_mode_supported() - check support of preferred
* hw mode
* @psoc: PSOC object
* @tgt_info: target_psoc_info object
*
* API to check whether preferred hardware mode is enabled
*
* Return: True on support of preferred hardware support or False
*/
bool init_deinit_is_preferred_hw_mode_supported(
struct wlan_objmgr_psoc *psoc,
struct target_psoc_info *tgt_info);
/**
* init_deinit_wakeup_host_wait() - wakeup host wait
* @psoc: PSOC object
* @tgt_info: target_psoc_info object
*
* API to wakeup FW ready wait queue
*
* Return: None
*/
void init_deinit_wakeup_host_wait(
struct wlan_objmgr_psoc *psoc,
struct target_psoc_info *tgt_info);
#endif /* _SERVICE_READY_UTIL_H_*/