qcacmn: Refactor BMI members from ol_softc

Group BMI members and access bmi info from hif instead of
dereferencing hif context.

Change-Id: I082f648490be0078df7d90cc8ebbf745b64fd97a
CRs-Fixed: 967765
This commit is contained in:
Komal Seelam
2016-02-01 19:22:17 +05:30
parent 7fca106501
commit b3a3bdf89f
3 changed files with 30 additions and 18 deletions

View File

@@ -181,11 +181,24 @@ struct hif_target_info {
uint32_t soc_version;
};
struct bmi_info {
uint8_t *bmi_cmd_buff;
uint8_t *bmi_rsp_buff;
dma_addr_t bmi_cmd_da;
dma_addr_t bmi_rsp_da;
uint8_t *cal_in_flash;
bool bmi_done;
#ifdef CONFIG_CNSS
struct cnss_fw_files fw_files;
#endif
};
struct ol_softc {
void __iomem *mem; /* IO mapped memory base address */
cdf_dma_addr_t mem_pa;
struct hif_config_info hif_config;
struct hif_target_info target_info;
struct bmi_info bmi_ctx;
/*
* handle for code that uses the osdep.h version of OS
* abstraction primitives
@@ -210,18 +223,6 @@ struct ol_softc {
/* status of target init */
WLAN_INIT_STATUS wlan_init_status;
/* BMI info */
/* OS-dependent private info for BMI */
bool bmi_done;
uint8_t *bmi_cmd_buff;
dma_addr_t bmi_cmd_da;
OS_DMA_MEM_CONTEXT(bmicmd_dmacontext)
uint8_t *bmi_rsp_buff;
dma_addr_t bmi_rsp_da;
/* length of last response */
OS_DMA_MEM_CONTEXT(bmirsp_dmacontext)
/* Handles for Lower Layers : filled in at init time */
hif_handle_t hif_hdl;
#ifdef HIF_PCI
@@ -236,9 +237,6 @@ struct ol_softc {
void *htc_handle;
uint8_t vow_extstats;
#ifdef CONFIG_CNSS
struct cnss_fw_files fw_files;
#endif
struct targetdef_s *targetdef;
struct ce_reg_def *target_ce_def;
struct hostdef_s *hostdef;
@@ -657,6 +655,7 @@ void hif_get_hw_info(struct ol_softc *scn, u32 *version, u32 *revision,
const char **target_name);
struct hif_target_info *hif_get_target_info_handle(struct ol_softc *scn);
struct hif_config_info *hif_get_ini_handle(struct ol_softc *scn);
struct bmi_info *hif_get_bmi_ctx(void *hif_ctx);
#ifdef __cplusplus
}
#endif

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2015 The Linux Foundation. All rights reserved.
* Copyright (c) 2015-2016 The Linux Foundation. All rights reserved.
*
* Previously licensed under the ISC license by Qualcomm Atheros, Inc.
*
@@ -156,6 +156,7 @@ CDF_STATUS hif_exchange_bmi_msg(struct ol_softc *scn,
unsigned int mux_id = 0;
unsigned int transaction_id = 0xffff;
unsigned int user_flags = 0;
struct bmi_info *info = hif_get_bmi_ctx(scn);
#ifdef BMI_RSP_POLLING
cdf_dma_addr_t buf;
unsigned int completed_nbytes, id, flags;
@@ -190,7 +191,7 @@ CDF_STATUS hif_exchange_bmi_msg(struct ol_softc *scn,
* CE_request = dma_map_single(dev,
* (void *)bmi_request, request_length, DMA_TO_DEVICE);
*/
CE_request = scn->bmi_cmd_da;
CE_request = info->bmi_cmd_da;
transaction->bmi_request_CE = CE_request;
if (bmi_response) {
@@ -199,7 +200,7 @@ CDF_STATUS hif_exchange_bmi_msg(struct ol_softc *scn,
* CE_response = dma_map_single(dev, bmi_response,
* BMI_DATASZ_MAX, DMA_FROM_DEVICE);
*/
CE_response = scn->bmi_rsp_da;
CE_response = info->bmi_rsp_da;
transaction->bmi_response_host = bmi_response;
transaction->bmi_response_CE = CE_response;
/* dma_cache_sync(dev, bmi_response,

View File

@@ -3329,3 +3329,15 @@ void hif_runtime_lock_deinit(struct hif_pm_runtime_lock *data)
}
#endif /* FEATURE_RUNTIME_PM */
/**
* hif_get_bmi_ctx() - API to get BMI context
* @hif_ctx: HIF Context
*
* Return: Pointer to BMI Context
*/
struct bmi_info *hif_get_bmi_ctx(void *hif_ctx)
{
struct ol_softc *sc = hif_ctx;
return &sc->bmi_ctx;
}