qcacmn: Make hif_opaque_softc as global HIF context

Make hif_opaque_softc as global HIF Context and cleanup
ol_softc structure to bmi structure. No one else is using ol_softc
numbers.

Change-Id: Ib6447d2b67d41a30ec22903720900d7e4d55c7a9
CRs-Fixed: 967765
This commit is contained in:
Komal Seelam
2016-02-24 19:22:48 +05:30
committed by Gerrit - the friendly Code Review server
parent a5911d3ca2
commit 5584a7cf92
18 changed files with 240 additions and 227 deletions

View File

@@ -171,7 +171,7 @@ struct hif_target_info {
uint32_t soc_version;
};
struct ol_softc {
struct hif_opaque_softc {
};
typedef enum {
@@ -235,7 +235,7 @@ struct htc_callbacks {
};
/* This API detaches the HTC layer from the HIF device */
void hif_detach_htc(struct ol_softc *scn);
void hif_detach_htc(struct hif_opaque_softc *scn);
/****************************************************************/
/* BMI and Diag window abstraction */
@@ -250,7 +250,7 @@ void hif_detach_htc(struct ol_softc *scn);
/*
* API to handle HIF-specific BMI message exchanges, this API is synchronous
* and only allowed to be called from a context that can block (sleep) */
CDF_STATUS hif_exchange_bmi_msg(struct ol_softc *scn,
CDF_STATUS hif_exchange_bmi_msg(struct hif_opaque_softc *scn,
cdf_dma_addr_t cmd, cdf_dma_addr_t rsp,
uint8_t *pSendMessage, uint32_t Length,
uint8_t *pResponseMessage,
@@ -266,11 +266,11 @@ CDF_STATUS hif_exchange_bmi_msg(struct ol_softc *scn,
*
* hif_diag_read_mem reads an arbitrary length of arbitrarily aligned memory.
*/
CDF_STATUS hif_diag_read_access(struct ol_softc *scn, uint32_t address,
CDF_STATUS hif_diag_read_access(struct hif_opaque_softc *scn, uint32_t address,
uint32_t *data);
CDF_STATUS hif_diag_read_mem(struct ol_softc *scn, uint32_t address,
CDF_STATUS hif_diag_read_mem(struct hif_opaque_softc *scn, uint32_t address,
uint8_t *data, int nbytes);
void hif_dump_target_memory(struct ol_softc *scn, void *ramdump_base,
void hif_dump_target_memory(struct hif_opaque_softc *scn, void *ramdump_base,
uint32_t address, uint32_t size);
/*
* APIs to handle HIF specific diagnostic write accesses. These APIs are
@@ -283,18 +283,18 @@ void hif_dump_target_memory(struct ol_softc *scn, void *ramdump_base,
*
* hif_diag_write_mem writes an arbitrary length of arbitrarily aligned memory.
*/
CDF_STATUS hif_diag_write_access(struct ol_softc *scn, uint32_t address,
CDF_STATUS hif_diag_write_access(struct hif_opaque_softc *scn, uint32_t address,
uint32_t data);
CDF_STATUS hif_diag_write_mem(struct ol_softc *scn, uint32_t address,
CDF_STATUS hif_diag_write_mem(struct hif_opaque_softc *scn, uint32_t address,
uint8_t *data, int nbytes);
/*
* Set the FASTPATH_mode_on flag in sc, for use by data path
*/
#ifdef WLAN_FEATURE_FASTPATH
void hif_enable_fastpath(struct ol_softc *hif_ctx);
bool hif_is_fastpath_mode_enabled(struct ol_softc *hif_ctx);
void *hif_get_ce_handle(struct ol_softc *hif_ctx, int);
void hif_enable_fastpath(struct hif_opaque_softc *hif_ctx);
bool hif_is_fastpath_mode_enabled(struct hif_opaque_softc *hif_ctx);
void *hif_get_ce_handle(struct hif_opaque_softc *hif_ctx, int);
#endif
#if defined(HIF_PCI) && !defined(A_SIMOS_DEVHOST)
@@ -369,7 +369,7 @@ void *hif_get_ce_handle(struct ol_softc *hif_ctx, int);
#endif
#ifdef IPA_OFFLOAD
void hif_ipa_get_ce_resource(struct ol_softc *scn,
void hif_ipa_get_ce_resource(struct hif_opaque_softc *scn,
cdf_dma_addr_t *ce_sr_base_paddr,
uint32_t *ce_sr_ring_size,
cdf_dma_addr_t *ce_reg_paddr);
@@ -387,7 +387,7 @@ void hif_ipa_get_ce_resource(struct ol_softc *scn,
*
* Return: None
*/
static inline void hif_ipa_get_ce_resource(struct ol_softc *scn,
static inline void hif_ipa_get_ce_resource(struct hif_opaque_softc *scn,
cdf_dma_addr_t *ce_sr_base_paddr,
uint32_t *ce_sr_ring_size,
cdf_dma_addr_t *ce_reg_paddr)
@@ -432,122 +432,128 @@ typedef struct pci_device_id hif_bus_id;
typedef struct device hif_bus_id;
#endif
void hif_post_init(struct ol_softc *scn, void *hHTC,
void hif_post_init(struct hif_opaque_softc *scn, void *hHTC,
struct hif_msg_callbacks *callbacks);
CDF_STATUS hif_start(struct ol_softc *scn);
void hif_stop(struct ol_softc *scn);
void hif_flush_surprise_remove(struct ol_softc *scn);
void hif_dump(struct ol_softc *scn, uint8_t CmdId, bool start);
CDF_STATUS hif_send_head(struct ol_softc *scn, uint8_t PipeID,
CDF_STATUS hif_start(struct hif_opaque_softc *scn);
void hif_stop(struct hif_opaque_softc *scn);
void hif_flush_surprise_remove(struct hif_opaque_softc *scn);
void hif_dump(struct hif_opaque_softc *scn, uint8_t CmdId, bool start);
CDF_STATUS hif_send_head(struct hif_opaque_softc *scn, uint8_t PipeID,
uint32_t transferID, uint32_t nbytes,
cdf_nbuf_t wbuf, uint32_t data_attr);
void hif_send_complete_check(struct ol_softc *scn, uint8_t PipeID,
void hif_send_complete_check(struct hif_opaque_softc *scn, uint8_t PipeID,
int force);
void hif_cancel_deferred_target_sleep(struct ol_softc *scn);
void hif_get_default_pipe(struct ol_softc *scn, uint8_t *ULPipe,
void hif_cancel_deferred_target_sleep(struct hif_opaque_softc *scn);
void hif_get_default_pipe(struct hif_opaque_softc *scn, uint8_t *ULPipe,
uint8_t *DLPipe);
int hif_map_service_to_pipe(struct ol_softc *scn, uint16_t svc_id,
int hif_map_service_to_pipe(struct hif_opaque_softc *scn, uint16_t svc_id,
uint8_t *ul_pipe, uint8_t *dl_pipe, int *ul_is_polled,
int *dl_is_polled);
uint16_t hif_get_free_queue_number(struct ol_softc *scn, uint8_t PipeID);
void *hif_get_targetdef(struct ol_softc *scn);
uint16_t
hif_get_free_queue_number(struct hif_opaque_softc *scn, uint8_t PipeID);
void *hif_get_targetdef(struct hif_opaque_softc *scn);
uint32_t hif_hia_item_address(uint32_t target_type, uint32_t item_offset);
void hif_set_target_sleep(struct ol_softc *scn, bool sleep_ok,
void hif_set_target_sleep(struct hif_opaque_softc *scn, bool sleep_ok,
bool wait_for_it);
int hif_check_fw_reg(struct ol_softc *scn);
int hif_check_soc_status(struct ol_softc *scn);
void hif_disable_isr(struct ol_softc *scn);
void hif_reset_soc(struct ol_softc *scn);
void hif_disable_aspm(struct ol_softc *);
void
hif_save_htc_htt_config_endpoint(struct ol_softc *hif_ctx, int htc_endpoint);
int hif_check_fw_reg(struct hif_opaque_softc *scn);
int hif_check_soc_status(struct hif_opaque_softc *scn);
void hif_get_hw_info(struct hif_opaque_softc *scn, u32 *version, u32 *revision,
const char **target_name);
void hif_disable_isr(struct hif_opaque_softc *scn);
void hif_reset_soc(struct hif_opaque_softc *scn);
void hif_disable_aspm(struct hif_opaque_softc *);
void hif_save_htc_htt_config_endpoint(struct hif_opaque_softc *hif_ctx,
int htc_endpoint);
CDF_STATUS hif_open(cdf_device_t cdf_ctx, enum ath_hal_bus_type bus_type);
void hif_close(struct ol_softc *hif_ctx);
CDF_STATUS hif_enable(struct ol_softc *hif_ctx, struct device *dev, void *bdev,
const hif_bus_id *bid, enum ath_hal_bus_type bus_type,
void hif_close(struct hif_opaque_softc *hif_ctx);
CDF_STATUS hif_enable(struct hif_opaque_softc *hif_ctx, struct device *dev,
void *bdev, const hif_bus_id *bid,
enum ath_hal_bus_type bus_type,
enum hif_enable_type type);
void hif_disable(struct ol_softc *hif_ctx, enum hif_disable_type type);
void hif_enable_power_gating(struct ol_softc *hif_ctx);
void hif_disable(struct hif_opaque_softc *hif_ctx, enum hif_disable_type type);
void hif_enable_power_gating(struct hif_opaque_softc *hif_ctx);
#ifdef FEATURE_RUNTIME_PM
struct hif_pm_runtime_lock;
int hif_pm_runtime_get(struct ol_softc *hif_ctx);
void hif_pm_runtime_get_noresume(struct ol_softc *hif_ctx);
int hif_pm_runtime_put(struct ol_softc *hif_ctx);
int hif_pm_runtime_get(struct hif_opaque_softc *hif_ctx);
void hif_pm_runtime_get_noresume(struct hif_opaque_softc *hif_ctx);
int hif_pm_runtime_put(struct hif_opaque_softc *hif_ctx);
struct hif_pm_runtime_lock *hif_runtime_lock_init(const char *name);
void hif_runtime_lock_deinit(struct ol_softc *hif_ctx,
void hif_runtime_lock_deinit(struct hif_opaque_softc *hif_ctx,
struct hif_pm_runtime_lock *lock);
int hif_pm_runtime_prevent_suspend(struct ol_softc *ol_sc,
int hif_pm_runtime_prevent_suspend(struct hif_opaque_softc *ol_sc,
struct hif_pm_runtime_lock *lock);
int hif_pm_runtime_allow_suspend(struct ol_softc *ol_sc,
int hif_pm_runtime_allow_suspend(struct hif_opaque_softc *ol_sc,
struct hif_pm_runtime_lock *lock);
int hif_pm_runtime_prevent_suspend_timeout(struct ol_softc *ol_sc,
int hif_pm_runtime_prevent_suspend_timeout(struct hif_opaque_softc *ol_sc,
struct hif_pm_runtime_lock *lock, unsigned int delay);
#else
struct hif_pm_runtime_lock {
const char *name;
};
static inline void hif_pm_runtime_get_noresume(struct ol_softc *hif_ctx)
static inline void hif_pm_runtime_get_noresume(struct hif_opaque_softc *hif_ctx)
{}
static inline int hif_pm_runtime_get(struct ol_softc *hif_ctx)
static inline int hif_pm_runtime_get(struct hif_opaque_softc *hif_ctx)
{ return 0; }
static inline int hif_pm_runtime_put(struct ol_softc *hif_ctx)
static inline int hif_pm_runtime_put(struct hif_opaque_softc *hif_ctx)
{ return 0; }
static inline struct hif_pm_runtime_lock *hif_runtime_lock_init(
const char *name)
{ return NULL; }
static inline void
hif_runtime_lock_deinit(struct ol_softc *hif_ctx,
hif_runtime_lock_deinit(struct hif_opaque_softc *hif_ctx,
struct hif_pm_runtime_lock *lock) {}
static inline int hif_pm_runtime_prevent_suspend(struct ol_softc *ol_sc,
static inline int hif_pm_runtime_prevent_suspend(struct hif_opaque_softc *ol_sc,
struct hif_pm_runtime_lock *lock)
{ return 0; }
static inline int hif_pm_runtime_allow_suspend(struct ol_softc *ol_sc,
static inline int hif_pm_runtime_allow_suspend(struct hif_opaque_softc *ol_sc,
struct hif_pm_runtime_lock *lock)
{ return 0; }
static inline int
hif_pm_runtime_prevent_suspend_timeout(struct ol_softc *ol_sc,
hif_pm_runtime_prevent_suspend_timeout(struct hif_opaque_softc *ol_sc,
struct hif_pm_runtime_lock *lock, unsigned int delay)
{ return 0; }
#endif
void hif_enable_power_management(struct ol_softc *hif_ctx);
void hif_disable_power_management(struct ol_softc *hif_ctx);
void hif_enable_power_management(struct hif_opaque_softc *hif_ctx);
void hif_disable_power_management(struct hif_opaque_softc *hif_ctx);
void hif_vote_link_down(struct ol_softc *);
void hif_vote_link_up(struct ol_softc *);
bool hif_can_suspend_link(struct ol_softc *);
void hif_vote_link_down(struct hif_opaque_softc *);
void hif_vote_link_up(struct hif_opaque_softc *);
bool hif_can_suspend_link(struct hif_opaque_softc *);
int hif_bus_resume(struct ol_softc *);
int hif_bus_suspend(struct ol_softc *);
int hif_bus_resume(struct hif_opaque_softc *);
int hif_bus_suspend(struct hif_opaque_softc *);
#ifdef FEATURE_RUNTIME_PM
int hif_pre_runtime_suspend(struct ol_softc *hif_ctx);
void hif_pre_runtime_resume(struct ol_softc *hif_ctx);
int hif_runtime_suspend(struct ol_softc *hif_ctx);
int hif_runtime_resume(struct ol_softc *hif_ctx);
void hif_process_runtime_suspend_success(struct ol_softc *);
void hif_process_runtime_suspend_failure(struct ol_softc *);
void hif_process_runtime_resume_success(struct ol_softc *);
int hif_pre_runtime_suspend(struct hif_opaque_softc *hif_ctx);
void hif_pre_runtime_resume(struct hif_opaque_softc *hif_ctx);
int hif_runtime_suspend(struct hif_opaque_softc *hif_ctx);
int hif_runtime_resume(struct hif_opaque_softc *hif_ctx);
void hif_process_runtime_suspend_success(struct hif_opaque_softc *);
void hif_process_runtime_suspend_failure(struct hif_opaque_softc *);
void hif_process_runtime_resume_success(struct hif_opaque_softc *);
#endif
int hif_dump_registers(struct ol_softc *scn);
int ol_copy_ramdump(struct ol_softc *scn);
void hif_crash_shutdown(struct ol_softc *hif_ctx);
void hif_get_hw_info(struct ol_softc *scn, u32 *version, u32 *revision,
int hif_dump_registers(struct hif_opaque_softc *scn);
int ol_copy_ramdump(struct hif_opaque_softc *scn);
void hif_crash_shutdown(struct hif_opaque_softc *hif_ctx);
void hif_get_hw_info(struct hif_opaque_softc *scn, u32 *version, u32 *revision,
const char **target_name);
void hif_lro_flush_cb_register(struct ol_softc *scn,
void hif_lro_flush_cb_register(struct hif_opaque_softc *scn,
void (handler)(void *), void *data);
void hif_lro_flush_cb_deregister(struct ol_softc *scn);
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 ramdump_info *hif_get_ramdump_ctx(struct ol_softc *hif_ctx);
ol_target_status hif_get_target_status(struct ol_softc *hif_ctx);
void hif_set_target_status(struct ol_softc *hif_ctx, ol_target_status);
void hif_init_ini_config(struct ol_softc *hif_ctx, struct hif_config_info *cfg);
void hif_lro_flush_cb_deregister(struct hif_opaque_softc *scn);
struct hif_target_info *hif_get_target_info_handle(struct hif_opaque_softc *
scn);
struct hif_config_info *hif_get_ini_handle(struct hif_opaque_softc *scn);
struct ramdump_info *hif_get_ramdump_ctx(struct hif_opaque_softc *hif_ctx);
ol_target_status hif_get_target_status(struct hif_opaque_softc *hif_ctx);
void hif_set_target_status(struct hif_opaque_softc *hif_ctx, ol_target_status);
void hif_init_ini_config(struct hif_opaque_softc *hif_ctx,
struct hif_config_info *cfg);
#ifdef __cplusplus
}
#endif

View File

@@ -37,7 +37,7 @@
/* CLD headers */
#include <hif.h> /* struct ol_softc; */
#include <hif.h> /* struct hif_opaque_softc; */
/**
* common stuff
@@ -69,32 +69,32 @@ enum qca_napi_event {
* where FEATURE_NAPI is defined
*/
int hif_napi_create(struct ol_softc *hif,
int hif_napi_create(struct hif_opaque_softc *hif,
uint8_t pipe_id,
int (*poll)(struct napi_struct *, int),
int budget,
int scale);
int hif_napi_destroy(struct ol_softc *hif,
int hif_napi_destroy(struct hif_opaque_softc *hif,
uint8_t id,
int force);
struct qca_napi_data *hif_napi_get_all(struct ol_softc *hif);
struct qca_napi_data *hif_napi_get_all(struct hif_opaque_softc *hif);
int hif_napi_event(struct ol_softc *hif,
int hif_napi_event(struct hif_opaque_softc *hif,
enum qca_napi_event event,
void *data);
/* called from the ISR within hif, so, ce is known */
int hif_napi_enabled(struct ol_softc *hif, int ce);
int hif_napi_enabled(struct hif_opaque_softc *hif, int ce);
/* called from hdd (napi_poll), using napi id as a selector */
void hif_napi_enable_irq(struct ol_softc *hif, int id);
void hif_napi_enable_irq(struct hif_opaque_softc *hif, int id);
/* called by ce_tasklet.c::ce_irq_handler */
int hif_napi_schedule(struct ol_softc *scn, int ce_id);
int hif_napi_schedule(struct hif_opaque_softc *scn, int ce_id);
/* called by hdd_napi, which is called by kernel */
int hif_napi_poll(struct ol_softc *hif_ctx,
int hif_napi_poll(struct hif_opaque_softc *hif_ctx,
struct napi_struct *napi, int budget);
#ifdef FEATURE_NAPI_DEBUG
@@ -115,35 +115,36 @@ int hif_napi_poll(struct ol_softc *hif_ctx,
#define NAPI_DEBUG(fmt, ...) /* NO-OP */
static inline int hif_napi_create(struct ol_softc *hif,
static inline int hif_napi_create(struct hif_opaque_softc *hif,
uint8_t pipe_id,
int (*poll)(struct napi_struct *, int),
int budget,
int scale)
{ return -EPERM; }
static inline int hif_napi_destroy(struct ol_softc *hif,
static inline int hif_napi_destroy(struct hif_opaque_softc *hif,
uint8_t id,
int force)
{ return -EPERM; }
static inline struct qca_napi_data *hif_napi_get_all(struct ol_softc *hif)
static inline struct qca_napi_data *hif_napi_get_all(
struct hif_opaque_softc *hif)
{ return NULL; }
static inline int hif_napi_event(struct ol_softc *hif,
static inline int hif_napi_event(struct hif_opaque_softc *hif,
enum qca_napi_event event,
void *data)
{ return -EPERM; }
/* called from the ISR within hif, so, ce is known */
static inline int hif_napi_enabled(struct ol_softc *hif, int ce)
static inline int hif_napi_enabled(struct hif_opaque_softc *hif, int ce)
{ return 0; }
/* called from hdd (napi_poll), using napi id as a selector */
static inline void hif_napi_enable_irq(struct ol_softc *hif, int id)
static inline void hif_napi_enable_irq(struct hif_opaque_softc *hif, int id)
{ return; }
static inline int hif_napi_schedule(struct ol_softc *hif, int ce_id)
static inline int hif_napi_schedule(struct hif_opaque_softc *hif, int ce_id)
{ return 0; }
static inline int hif_napi_poll(struct napi_struct *napi, int budget)

View File

@@ -54,9 +54,9 @@ static struct proc_dir_entry *proc_file, *proc_dir;
static void *get_hif_hdl_from_file(struct file *file)
{
struct ol_softc *scn;
struct hif_opaque_softc *scn;
scn = (struct ol_softc *)PDE_DATA(file_inode(file));
scn = (struct hif_opaque_softc *)PDE_DATA(file_inode(file));
return (void *)scn;
}

View File

@@ -474,8 +474,8 @@ static inline void ce_pkt_error_count_incr(
bool ce_check_rx_pending(struct hif_softc *scn, int ce_id);
#if defined(FEATURE_LRO)
void ce_lro_flush_cb_register(struct hif_softc *scn,
void ce_lro_flush_cb_register(struct hif_opaque_softc *scn,
void (handler)(void *), void *data);
void ce_lro_flush_cb_deregister(struct hif_softc *scn);
void ce_lro_flush_cb_deregister(struct hif_opaque_softc *scn);
#endif
#endif /* __COPY_ENGINE_API_H__ */

View File

@@ -137,7 +137,7 @@ void hif_bmi_recv_data(struct CE_handle *copyeng, void *ce_context,
}
#endif
CDF_STATUS hif_exchange_bmi_msg(struct ol_softc *hif_ctx,
CDF_STATUS hif_exchange_bmi_msg(struct hif_opaque_softc *hif_ctx,
cdf_dma_addr_t bmi_cmd_da,
cdf_dma_addr_t bmi_rsp_da,
uint8_t *bmi_request,

View File

@@ -51,7 +51,8 @@
#include "epping_main.h"
#include "cds_concurrency.h"
void hif_dump_target_memory(struct ol_softc *hif_ctx, void *ramdump_base,
void
hif_dump_target_memory(struct hif_opaque_softc *hif_ctx, void *ramdump_base,
uint32_t address, uint32_t size)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
@@ -96,8 +97,8 @@ void hif_dump_target_memory(struct ol_softc *hif_ctx, void *ramdump_base,
*/
CDF_STATUS
hif_diag_read_mem(struct ol_softc *hif_ctx, uint32_t address, uint8_t *data,
int nbytes)
hif_diag_read_mem(struct hif_opaque_softc *hif_ctx, uint32_t address,
uint8_t *data, int nbytes)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn);
@@ -260,7 +261,7 @@ done:
}
/* Read 4-byte aligned data from Target memory or register */
CDF_STATUS hif_diag_read_access(struct ol_softc *hif_ctx,
CDF_STATUS hif_diag_read_access(struct hif_opaque_softc *hif_ctx,
uint32_t address, uint32_t *data)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
@@ -278,7 +279,7 @@ CDF_STATUS hif_diag_read_access(struct ol_softc *hif_ctx,
}
}
CDF_STATUS hif_diag_write_mem(struct ol_softc *hif_ctx,
CDF_STATUS hif_diag_write_mem(struct hif_opaque_softc *hif_ctx,
uint32_t address, uint8_t *data, int nbytes)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
@@ -432,8 +433,8 @@ done:
}
/* Write 4B data to Target memory or register */
CDF_STATUS hif_diag_write_access(struct ol_softc *hif_ctx, uint32_t address,
uint32_t data)
CDF_STATUS hif_diag_write_access(struct hif_opaque_softc *hif_ctx,
uint32_t address, uint32_t data)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);

View File

@@ -539,7 +539,7 @@ void ce_fini(struct CE_handle *copyeng)
cdf_mem_free(CE_state);
}
void hif_detach_htc(struct ol_softc *hif_ctx)
void hif_detach_htc(struct hif_opaque_softc *hif_ctx)
{
struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(hif_ctx);
@@ -551,7 +551,7 @@ void hif_detach_htc(struct ol_softc *hif_ctx)
/* Send the first nbytes bytes of the buffer */
CDF_STATUS
hif_send_head(struct ol_softc *hif_ctx,
hif_send_head(struct hif_opaque_softc *hif_ctx,
uint8_t pipe, unsigned int transfer_id, unsigned int nbytes,
cdf_nbuf_t nbuf, unsigned int data_attr)
{
@@ -633,7 +633,8 @@ hif_send_head(struct ol_softc *hif_ctx,
return status;
}
void hif_send_complete_check(struct ol_softc *hif_ctx, uint8_t pipe, int force)
void hif_send_complete_check(struct hif_opaque_softc *hif_ctx, uint8_t pipe,
int force)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
@@ -662,7 +663,8 @@ void hif_send_complete_check(struct ol_softc *hif_ctx, uint8_t pipe, int force)
#endif
}
uint16_t hif_get_free_queue_number(struct ol_softc *hif_ctx, uint8_t pipe)
uint16_t
hif_get_free_queue_number(struct hif_opaque_softc *hif_ctx, uint8_t pipe)
{
struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(hif_ctx);
struct HIF_CE_pipe_info *pipe_info = &(hif_state->pipe_info[pipe]);
@@ -790,7 +792,7 @@ hif_pci_ce_recv_data(struct CE_handle *copyeng, void *ce_context,
/* TBDXXX: Set CE High Watermark; invoke txResourceAvailHandler in response */
void
hif_post_init(struct ol_softc *hif_ctx, void *unused,
hif_post_init(struct hif_opaque_softc *hif_ctx, void *unused,
struct hif_msg_callbacks *callbacks)
{
struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(hif_ctx);
@@ -877,8 +879,8 @@ static void hif_msg_callbacks_install(struct hif_softc *scn)
sizeof(hif_state->msg_callbacks_pending));
}
void
hif_get_default_pipe(struct ol_softc *hif_hdl, uint8_t *ULPipe, uint8_t *DLPipe)
void hif_get_default_pipe(struct hif_opaque_softc *hif_hdl, uint8_t *ULPipe,
uint8_t *DLPipe)
{
int ul_is_polled, dl_is_polled;
@@ -1050,7 +1052,7 @@ done:
return rv;
}
CDF_STATUS hif_start(struct ol_softc *hif_ctx)
CDF_STATUS hif_start(struct hif_opaque_softc *hif_ctx)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn);
@@ -1077,7 +1079,7 @@ CDF_STATUS hif_start(struct ol_softc *hif_ctx)
*
* Retrun: void
*/
void hif_enable_fastpath(struct ol_softc *hif_ctx)
void hif_enable_fastpath(struct hif_opaque_softc *hif_ctx)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
@@ -1093,7 +1095,7 @@ void hif_enable_fastpath(struct ol_softc *hif_ctx)
*
* Return: bool
*/
bool hif_is_fastpath_mode_enabled(struct ol_softc *hif_ctx)
bool hif_is_fastpath_mode_enabled(struct hif_opaque_softc *hif_ctx)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
@@ -1109,7 +1111,7 @@ bool hif_is_fastpath_mode_enabled(struct ol_softc *hif_ctx)
*
* Return: void
*/
void *hif_get_ce_handle(struct ol_softc *hif_ctx, int id)
void *hif_get_ce_handle(struct hif_opaque_softc *hif_ctx, int id)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
@@ -1228,7 +1230,7 @@ void hif_buffer_cleanup(struct HIF_CE_state *hif_state)
}
}
void hif_flush_surprise_remove(struct ol_softc *hif_ctx)
void hif_flush_surprise_remove(struct hif_opaque_softc *hif_ctx)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn);
@@ -1236,7 +1238,7 @@ void hif_flush_surprise_remove(struct ol_softc *hif_ctx)
hif_buffer_cleanup(hif_state);
}
void hif_stop(struct ol_softc *hif_ctx)
void hif_stop(struct hif_opaque_softc *hif_ctx)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(hif_ctx);
@@ -1498,7 +1500,7 @@ void hif_wake_target_cpu(struct hif_softc *scn)
{
CDF_STATUS rv;
uint32_t core_ctrl;
struct ol_softc *hif_hdl = GET_HIF_OPAQUE_HDL(scn);
struct hif_opaque_softc *hif_hdl = GET_HIF_OPAQUE_HDL(scn);
rv = hif_diag_read_access(hif_hdl,
SOC_CORE_BASE_ADDRESS | CORE_CTRL_ADDRESS,
@@ -1576,7 +1578,7 @@ int hif_set_hia(struct hif_softc *scn)
uint32_t chip_id;
#endif
uint32_t pipe_cfg_addr;
struct ol_softc *hif_hdl = GET_HIF_OPAQUE_HDL(scn);
struct hif_opaque_softc *hif_hdl = GET_HIF_OPAQUE_HDL(scn);
struct hif_target_info *tgt_info = hif_get_target_info_handle(hif_hdl);
uint32_t target_type = tgt_info->target_type;
@@ -1863,7 +1865,7 @@ int hif_config_ce(struct hif_softc *scn)
CDF_STATUS rv = CDF_STATUS_SUCCESS;
int ret;
struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(scn);
struct ol_softc *hif_hdl = GET_HIF_OPAQUE_HDL(scn);
struct hif_opaque_softc *hif_hdl = GET_HIF_OPAQUE_HDL(scn);
struct icnss_soc_info soc_info;
struct hif_target_info *tgt_info = hif_get_target_info_handle(hif_hdl);
@@ -2051,7 +2053,7 @@ err:
*
* Return: None
*/
void hif_ipa_get_ce_resource(struct ol_softc *hif_ctx,
void hif_ipa_get_ce_resource(struct hif_opaque_softc *hif_ctx,
cdf_dma_addr_t *ce_sr_base_paddr,
uint32_t *ce_sr_ring_size,
cdf_dma_addr_t *ce_reg_paddr)
@@ -2207,12 +2209,12 @@ u32 shadow_dst_wr_ind_addr(struct hif_softc *scn, u32 ctrl_addr)
*
* Return: none
*/
void ce_lro_flush_cb_register(struct hif_softc *scn,
void ce_lro_flush_cb_register(struct hif_opaque_softc *hif_hdl,
void (handler)(void *), void *data)
{
uint8_t ul, dl;
int ul_polled, dl_polled;
struct ol_softc *hif_hdl = GET_HIF_OPAQUE_HDL(scn);
struct hif_softc *scn = HIF_GET_SOFTC(hif_hdl);
CDF_ASSERT(scn != NULL);
@@ -2238,11 +2240,11 @@ void ce_lro_flush_cb_register(struct hif_softc *scn,
*
* Return: none
*/
void ce_lro_flush_cb_deregister(struct hif_softc *scn)
void ce_lro_flush_cb_deregister(struct hif_opaque_softc *hif_hdl)
{
uint8_t ul, dl;
int ul_polled, dl_polled;
struct ol_softc *hif_hdl = GET_HIF_OPAQUE_HDL(scn);
struct hif_softc *scn = HIF_GET_SOFTC(hif_hdl);
CDF_ASSERT(scn != NULL);
@@ -2277,7 +2279,7 @@ void ce_lro_flush_cb_deregister(struct hif_softc *scn)
* Return: Indicates whether this operation was successful.
*/
int hif_map_service_to_pipe(struct ol_softc *hif_hdl, uint16_t svc_id,
int hif_map_service_to_pipe(struct hif_opaque_softc *hif_hdl, uint16_t svc_id,
uint8_t *ul_pipe, uint8_t *dl_pipe, int *ul_is_polled,
int *dl_is_polled)
{
@@ -2463,7 +2465,7 @@ static inline void hif_config_rri_on_ddr(struct hif_softc *scn)
/**
* hif_dump_ce_registers() - dump ce registers
* @scn: ol_softc pointer.
* @scn: hif_opaque_softc pointer.
*
* Output the copy engine registers
*
@@ -2471,7 +2473,7 @@ static inline void hif_config_rri_on_ddr(struct hif_softc *scn)
*/
int hif_dump_ce_registers(struct hif_softc *scn)
{
struct ol_softc *hif_hdl = GET_HIF_OPAQUE_HDL(scn);
struct hif_opaque_softc *hif_hdl = GET_HIF_OPAQUE_HDL(scn);
uint32_t ce_reg_address = CE0_BASE_ADDRESS;
uint32_t ce_reg_values[CE_COUNT_MAX][CE_USEFUL_SIZE >> 2];
uint32_t ce_reg_word_size = CE_USEFUL_SIZE >> 2;

View File

@@ -522,7 +522,7 @@ int ce_send_fast(struct CE_handle *copyeng, cdf_nbuf_t *msdus,
{
struct CE_state *ce_state = (struct CE_state *)copyeng;
struct hif_softc *scn = ce_state->scn;
struct ol_softc *hif_hdl = GET_HIF_OPAQUE_HDL(scn);
struct hif_opaque_softc *hif_hdl = GET_HIF_OPAQUE_HDL(scn);
struct CE_ring_state *src_ring = ce_state->src_ring;
u_int32_t ctrl_addr = ce_state->ctrl_addr;
unsigned int nentries_mask = src_ring->nentries_mask;

View File

@@ -142,7 +142,7 @@ static void init_tasklet_work(struct work_struct *work,
*
* Return: N/A
*/
void init_tasklet_workers(struct ol_softc *scn)
void init_tasklet_workers(struct hif_opaque_softc *scn)
{
uint32_t id;
@@ -284,7 +284,7 @@ static irqreturn_t ce_irq_handler(int irq, void *context)
struct ce_tasklet_entry *tasklet_entry = context;
struct HIF_CE_state *hif_ce_state = tasklet_entry->hif_ce_state;
struct hif_softc *scn = HIF_GET_SOFTC(hif_ce_state);
struct ol_softc *hif_hdl = GET_HIF_OPAQUE_HDL(scn);
struct hif_opaque_softc *hif_hdl = GET_HIF_OPAQUE_HDL(scn);
uint32_t host_status;
int ce_id = icnss_get_ce_id(irq);

View File

@@ -28,7 +28,7 @@
#ifndef __CE_TASKLET_H__
#define __CE_TASKLET_H__
#include "ce_main.h"
void init_tasklet_workers(struct ol_softc *scn);
void init_tasklet_workers(struct hif_opaque_softc *scn);
void ce_tasklet_init(struct HIF_CE_state *hif_ce_state, uint32_t mask);
void ce_tasklet_kill(struct hif_softc *scn);
CDF_STATUS ce_register_irq(struct HIF_CE_state *hif_ce_state, uint32_t mask);

View File

@@ -69,7 +69,7 @@
#define PCIE_ACCESS_DUMP 4
#endif
void hif_dump(struct ol_softc *hif_ctx, uint8_t cmd_id, bool start)
void hif_dump(struct hif_opaque_softc *hif_ctx, uint8_t cmd_id, bool start)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
switch (cmd_id) {
@@ -107,11 +107,11 @@ void hif_dump(struct ol_softc *hif_ctx, uint8_t cmd_id, bool start)
*
* SThis fucntion shuts down the device
*
* @scn: ol_softc
* @scn: hif_opaque_softc
*
* Return: void
*/
void hif_shut_down_device(struct ol_softc *scn)
void hif_shut_down_device(struct hif_opaque_softc *scn)
{
hif_stop(scn);
}
@@ -123,11 +123,11 @@ void hif_shut_down_device(struct ol_softc *scn)
*
* This function cancels the defered target sleep
*
* @scn: ol_softc
* @scn: hif_opaque_softc
*
* Return: void
*/
void hif_cancel_deferred_target_sleep(struct ol_softc *hif_ctx)
void hif_cancel_deferred_target_sleep(struct hif_opaque_softc *hif_ctx)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
@@ -156,7 +156,7 @@ A_target_id_t hif_get_target_id(struct hif_softc *scn)
*
* Return: void
*/
void hif_set_target_sleep(struct ol_softc *hif_ctx,
void hif_set_target_sleep(struct hif_opaque_softc *hif_ctx,
bool sleep_ok, bool wait_for_it)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
@@ -258,7 +258,7 @@ irqreturn_t hif_fw_interrupt_handler(int irq, void *arg)
*
* Return: void *
*/
void *hif_get_targetdef(struct ol_softc *hif_ctx)
void *hif_get_targetdef(struct hif_opaque_softc *hif_ctx)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
@@ -279,7 +279,7 @@ void *hif_get_targetdef(struct ol_softc *hif_ctx)
*
* Return: n/a
*/
void hif_vote_link_down(struct ol_softc *hif_ctx)
void hif_vote_link_down(struct hif_opaque_softc *hif_ctx)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
CDF_BUG(scn);
@@ -300,7 +300,7 @@ void hif_vote_link_down(struct ol_softc *hif_ctx)
*
* Return: n/a
*/
void hif_vote_link_up(struct ol_softc *hif_ctx)
void hif_vote_link_up(struct hif_opaque_softc *hif_ctx)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
CDF_BUG(scn);
@@ -322,7 +322,7 @@ void hif_vote_link_up(struct ol_softc *hif_ctx)
*
* Return: false if hif will guarantee link up durring suspend.
*/
bool hif_can_suspend_link(struct ol_softc *hif_ctx)
bool hif_can_suspend_link(struct hif_opaque_softc *hif_ctx)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
CDF_BUG(scn);
@@ -402,8 +402,8 @@ cdf_size_t init_buffer_count(cdf_size_t maxSize)
*
* Return: void
*/
void
hif_save_htc_htt_config_endpoint(struct ol_softc *hif_ctx, int htc_endpoint)
void hif_save_htc_htt_config_endpoint(struct hif_opaque_softc *hif_ctx,
int htc_endpoint)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
@@ -444,7 +444,7 @@ static const char *hif_get_hw_name(struct hif_target_info *info)
*
* Return: n/a
*/
void hif_get_hw_info(struct ol_softc *scn, u32 *version, u32 *revision,
void hif_get_hw_info(struct hif_opaque_softc *scn, u32 *version, u32 *revision,
const char **target_name)
{
struct hif_target_info *info = hif_get_target_info_handle(scn);
@@ -460,7 +460,7 @@ void hif_get_hw_info(struct ol_softc *scn, u32 *version, u32 *revision,
*/
CDF_STATUS hif_open(cdf_device_t cdf_ctx, enum ath_hal_bus_type bus_type)
{
struct ol_softc *hif_hdl;
struct hif_opaque_softc *hif_hdl;
struct hif_softc *scn;
v_CONTEXT_t cds_context;
CDF_STATUS status = CDF_STATUS_SUCCESS;
@@ -498,12 +498,12 @@ CDF_STATUS hif_open(cdf_device_t cdf_ctx, enum ath_hal_bus_type bus_type)
*
* Return: n/a
*/
void hif_close(struct ol_softc *hif_ctx)
void hif_close(struct hif_opaque_softc *hif_ctx)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
if (scn == NULL) {
HIF_ERROR("%s: ol_softc is NULL", __func__);
HIF_ERROR("%s: hif_opaque_softc is NULL", __func__);
return;
}
@@ -528,7 +528,7 @@ void hif_close(struct ol_softc *hif_ctx)
*
* Return: CDF_STATUS
*/
CDF_STATUS hif_enable(struct ol_softc *hif_ctx, struct device *dev,
CDF_STATUS hif_enable(struct hif_opaque_softc *hif_ctx, struct device *dev,
void *bdev, const hif_bus_id *bid,
enum ath_hal_bus_type bus_type,
enum hif_enable_type type)
@@ -604,7 +604,7 @@ void hif_wlan_disable(void)
icnss_wlan_disable(mode);
}
void hif_disable(struct ol_softc *hif_ctx, enum hif_disable_type type)
void hif_disable(struct hif_opaque_softc *hif_ctx, enum hif_disable_type type)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
@@ -641,7 +641,7 @@ void hif_disable(struct ol_softc *hif_ctx, enum hif_disable_type type)
static void hif_crash_shutdown_dump_bus_register(void *hif_ctx)
{
struct ol_softc *scn = hif_ctx;
struct hif_opaque_softc *scn = hif_ctx;
if (hif_check_soc_status(scn))
return;
@@ -659,7 +659,7 @@ static void hif_crash_shutdown_dump_bus_register(void *hif_ctx)
*
* Return: n/a
*/
void hif_crash_shutdown(struct ol_softc *hif_ctx)
void hif_crash_shutdown(struct hif_opaque_softc *hif_ctx)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(hif_ctx);
@@ -690,7 +690,7 @@ out:
return;
}
#else
void hif_crash_shutdown(struct ol_softc *hif_ctx)
void hif_crash_shutdown(struct hif_opaque_softc *hif_ctx)
{
HIF_INFO_MED("%s: Collecting target RAM dump disabled",
__func__);
@@ -706,7 +706,7 @@ void hif_crash_shutdown(struct ol_softc *hif_ctx)
*
* Return: int
*/
int hif_check_fw_reg(struct ol_softc *scn)
int hif_check_fw_reg(struct hif_opaque_softc *scn)
{
return 0;
}
@@ -807,7 +807,7 @@ end:
*
* Return: pointer to hif_config_info
*/
struct hif_config_info *hif_get_ini_handle(struct ol_softc *hif_ctx)
struct hif_config_info *hif_get_ini_handle(struct hif_opaque_softc *hif_ctx)
{
struct hif_softc *sc = HIF_GET_SOFTC(hif_ctx);
@@ -820,7 +820,8 @@ struct hif_config_info *hif_get_ini_handle(struct ol_softc *hif_ctx)
*
* Return: Pointer to hif_target_info
*/
struct hif_target_info *hif_get_target_info_handle(struct ol_softc *hif_ctx)
struct hif_target_info *hif_get_target_info_handle(
struct hif_opaque_softc *hif_ctx)
{
struct hif_softc *sc = HIF_GET_SOFTC(hif_ctx);
@@ -837,7 +838,7 @@ struct hif_target_info *hif_get_target_info_handle(struct ol_softc *hif_ctx)
*
* Return: void
*/
void hif_lro_flush_cb_register(struct ol_softc *scn,
void hif_lro_flush_cb_register(struct hif_opaque_softc *scn,
void (handler)(void *), void *data)
{
ce_lro_flush_cb_register(scn, handler, data);
@@ -849,7 +850,7 @@ void hif_lro_flush_cb_register(struct ol_softc *scn,
*
* Return: void
*/
void hif_lro_flush_cb_deregister(struct ol_softc *scn)
void hif_lro_flush_cb_deregister(struct hif_opaque_softc *scn)
{
ce_lro_flush_cb_deregister(scn);
}
@@ -861,7 +862,7 @@ void hif_lro_flush_cb_deregister(struct ol_softc *scn)
*
* Return: enum ol_target_status
*/
ol_target_status hif_get_target_status(struct ol_softc *hif_ctx)
ol_target_status hif_get_target_status(struct hif_opaque_softc *hif_ctx)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
@@ -875,7 +876,8 @@ ol_target_status hif_get_target_status(struct ol_softc *hif_ctx)
*
* Return: void
*/
void hif_set_target_status(struct ol_softc *hif_ctx, ol_target_status status)
void hif_set_target_status(struct hif_opaque_softc *hif_ctx,
ol_target_status status)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
@@ -889,7 +891,8 @@ void hif_set_target_status(struct ol_softc *hif_ctx, ol_target_status status)
*
* Return: void
*/
void hif_init_ini_config(struct ol_softc *hif_ctx, struct hif_config_info *cfg)
void hif_init_ini_config(struct hif_opaque_softc *hif_ctx,
struct hif_config_info *cfg)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);

View File

@@ -101,7 +101,7 @@
#define HIF_GET_PCI_SOFTC(scn) ((struct hif_pci_softc *)scn)
#define HIF_GET_CE_STATE(scn) ((struct HIF_CE_state *)scn)
#define HIF_GET_SOFTC(scn) ((struct hif_softc *)scn)
#define GET_HIF_OPAQUE_HDL(scn) ((struct ol_softc *)scn)
#define GET_HIF_OPAQUE_HDL(scn) ((struct hif_opaque_softc *)scn)
struct hif_ce_stats {
int hif_pipe_no_resrc_count;
@@ -109,7 +109,7 @@ struct hif_ce_stats {
};
struct hif_softc {
struct ol_softc osc;
struct hif_opaque_softc osc;
struct hif_config_info hif_config;
struct hif_target_info target_info;
void __iomem *mem;

View File

@@ -67,7 +67,7 @@ enum napi_decision_vector {
* = 0: <should never happen>
* > 0: id of the created object (for multi-NAPI, number of objects created)
*/
int hif_napi_create(struct ol_softc *hif_ctx,
int hif_napi_create(struct hif_opaque_softc *hif_ctx,
uint8_t pipe_id,
int (*poll)(struct napi_struct *, int),
int budget,
@@ -144,7 +144,7 @@ int hif_napi_create(struct ol_softc *hif_ctx,
* 0 < : error
* 0 = : success
*/
int hif_napi_destroy(struct ol_softc *hif_ctx,
int hif_napi_destroy(struct hif_opaque_softc *hif_ctx,
uint8_t id,
int force)
{
@@ -224,7 +224,7 @@ int hif_napi_destroy(struct ol_softc *hif_ctx,
* Return:
* <addr>: address of the whole HIF NAPI structure
*/
inline struct qca_napi_data *hif_napi_get_all(struct ol_softc *hif_ctx)
inline struct qca_napi_data *hif_napi_get_all(struct hif_opaque_softc *hif_ctx)
{
struct hif_softc *hif = HIF_GET_SOFTC(hif_ctx);
@@ -250,7 +250,7 @@ inline struct qca_napi_data *hif_napi_get_all(struct ol_softc *hif_ctx)
* = 0: NAPI is now disabled
* = 1: NAPI is now enabled
*/
int hif_napi_event(struct ol_softc *hif_ctx, enum qca_napi_event event,
int hif_napi_event(struct hif_opaque_softc *hif_ctx, enum qca_napi_event event,
void *data)
{
int rc;
@@ -338,7 +338,7 @@ int hif_napi_event(struct ol_softc *hif_ctx, enum qca_napi_event event,
*
* Return: bool
*/
int hif_napi_enabled(struct ol_softc *hif_ctx, int ce)
int hif_napi_enabled(struct hif_opaque_softc *hif_ctx, int ce)
{
int rc;
struct hif_softc *hif = HIF_GET_SOFTC(hif_ctx);
@@ -359,7 +359,7 @@ int hif_napi_enabled(struct ol_softc *hif_ctx, int ce)
*
* Return: void
*/
inline void hif_napi_enable_irq(struct ol_softc *hif, int id)
inline void hif_napi_enable_irq(struct hif_opaque_softc *hif, int id)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif);
@@ -374,7 +374,7 @@ inline void hif_napi_enable_irq(struct ol_softc *hif, int id)
*
* Return: void
*/
int hif_napi_schedule(struct ol_softc *hif_ctx, int ce_id)
int hif_napi_schedule(struct hif_opaque_softc *hif_ctx, int ce_id)
{
int cpu = smp_processor_id();
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
@@ -408,8 +408,8 @@ int hif_napi_schedule(struct ol_softc *hif_ctx, int ce_id)
* Returns:
* int: the amount of work done in this poll ( <= budget)
*/
int
hif_napi_poll(struct ol_softc *hif_ctx, struct napi_struct *napi, int budget)
int hif_napi_poll(struct hif_opaque_softc *hif_ctx, struct napi_struct *napi,
int budget)
{
int rc = 0; /* default: no work done, also takes care of error */
int normalized, bucket;

View File

@@ -32,5 +32,5 @@ void priv_dump_agc(struct hif_softc *scn);
void priv_start_cap_chaninfo(struct hif_softc *scn);
void priv_dump_chaninfo(struct hif_softc *scn);
void priv_dump_bbwatchdog(struct hif_softc *scn);
void hif_shut_down_device(struct ol_softc *scn);
void hif_shut_down_device(struct hif_opaque_softc *scn);
#endif /* __MP_DEV_H__ */

View File

@@ -531,7 +531,7 @@ void hif_pci_device_warm_reset(struct hif_pci_softc *sc)
}
#ifndef QCA_WIFI_3_0
int hif_check_fw_reg(struct ol_softc *hif_ctx)
int hif_check_fw_reg(struct hif_opaque_softc *hif_ctx)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(scn);
@@ -551,7 +551,7 @@ int hif_check_fw_reg(struct ol_softc *hif_ctx)
}
#endif
int hif_check_soc_status(struct ol_softc *hif_ctx)
int hif_check_soc_status(struct hif_opaque_softc *hif_ctx)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
uint16_t device_id;
@@ -611,7 +611,7 @@ int hif_check_soc_status(struct ol_softc *hif_ctx)
/**
* hif_dump_pci_registers(): dump PCI debug registers
* @scn: struct ol_softc
* @scn: struct hif_softc
*
* This function dumps pci debug registers
*
@@ -744,13 +744,13 @@ static void hif_dump_pci_registers(struct hif_softc *scn)
/**
* hif_dump_registers(): dump bus debug registers
* @scn: struct ol_softc
* @scn: struct hif_opaque_softc
*
* This function dumps hif bus debug registers
*
* Return: 0 for success or error code
*/
int hif_dump_registers(struct ol_softc *hif_ctx)
int hif_dump_registers(struct hif_opaque_softc *hif_ctx)
{
int status;
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
@@ -1146,7 +1146,7 @@ static void hif_pm_runtime_stop(struct hif_pci_softc *sc) {}
* the soc sleep after the driver finishes loading and re-enabling
* aspm (hif_enable_power_gating).
*/
void hif_enable_power_management(struct ol_softc *hif_ctx)
void hif_enable_power_management(struct hif_opaque_softc *hif_ctx)
{
struct hif_pci_softc *pci_ctx = HIF_GET_PCI_SOFTC(hif_ctx);
@@ -1166,7 +1166,7 @@ void hif_enable_power_management(struct ol_softc *hif_ctx)
* if runtime pm is not started. Should be updated to take care
* of aspm and soc sleep for driver load.
*/
void hif_disable_power_management(struct ol_softc *hif_ctx)
void hif_disable_power_management(struct hif_opaque_softc *hif_ctx)
{
struct hif_pci_softc *pci_ctx = HIF_GET_PCI_SOFTC(hif_ctx);
@@ -1673,7 +1673,7 @@ void hif_disable_bus(struct hif_softc *scn)
static void hif_runtime_prevent_linkdown(struct hif_softc *scn, bool flag)
{
struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(scn);
struct ol_softc *hif_hdl = GET_HIF_OPAQUE_HDL(scn);
struct hif_opaque_softc *hif_hdl = GET_HIF_OPAQUE_HDL(scn);
if (flag)
hif_pm_runtime_prevent_suspend(hif_hdl,
@@ -1706,7 +1706,7 @@ void hif_bus_prevent_linkdown(struct hif_softc *scn, bool flag)
cnss_wlan_pm_control(flag);
}
#else
void hif_bus_prevent_linkdown(struct ol_softc *scn, bool flag)
void hif_bus_prevent_linkdown(struct hif_opaque_softc *scn, bool flag)
{
HIF_ERROR("wlan: %s pcie power collapse",
(flag ? "disable" : "enable"));
@@ -1813,7 +1813,7 @@ static int hif_bus_resume_link_up(struct hif_softc *scn)
static int hif_bus_suspend_link_down(struct hif_softc *scn)
{
struct pci_dev *pdev;
struct ol_softc *hif_hdl = GET_HIF_OPAQUE_HDL(scn);
struct hif_opaque_softc *hif_hdl = GET_HIF_OPAQUE_HDL(scn);
struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(scn);
int status = 0;
@@ -1871,7 +1871,7 @@ static int hif_bus_resume_link_down(struct hif_softc *scn)
*
* Return: 0 for success and non-zero error code for failure
*/
int hif_bus_suspend(struct ol_softc *hif_ctx)
int hif_bus_suspend(struct hif_opaque_softc *hif_ctx)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
@@ -1888,7 +1888,7 @@ int hif_bus_suspend(struct ol_softc *hif_ctx)
*
* Return: 0 for success and non-zero error code for failure
*/
int hif_bus_resume(struct ol_softc *hif_ctx)
int hif_bus_resume(struct hif_opaque_softc *hif_ctx)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
@@ -2014,7 +2014,7 @@ static void hif_log_runtime_resume_success(void *hif_ctx)
* mark last busy to delay a retry.
* adjust the runtime_pm state.
*/
void hif_process_runtime_suspend_failure(struct ol_softc *hif_ctx)
void hif_process_runtime_suspend_failure(struct hif_opaque_softc *hif_ctx)
{
struct hif_pci_softc *sc = get_sc(hif_ctx);
@@ -2035,7 +2035,7 @@ void hif_process_runtime_suspend_failure(struct ol_softc *hif_ctx)
*
* return -EINVAL if the bus won't go down. otherwise return 0
*/
int hif_pre_runtime_suspend(struct ol_softc *hif_ctx)
int hif_pre_runtime_suspend(struct hif_opaque_softc *hif_ctx)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
@@ -2054,7 +2054,7 @@ int hif_pre_runtime_suspend(struct ol_softc *hif_ctx)
* Record the success.
* adjust the runtime_pm state
*/
void hif_process_runtime_suspend_success(struct ol_softc *hif_ctx)
void hif_process_runtime_suspend_success(struct hif_opaque_softc *hif_ctx)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
@@ -2067,7 +2067,7 @@ void hif_process_runtime_suspend_success(struct ol_softc *hif_ctx)
*
* update the runtime pm state.
*/
void hif_pre_runtime_resume(struct ol_softc *hif_ctx)
void hif_pre_runtime_resume(struct hif_opaque_softc *hif_ctx)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
@@ -2080,7 +2080,7 @@ void hif_pre_runtime_resume(struct ol_softc *hif_ctx)
* record the success.
* adjust the runtime_pm state
*/
void hif_process_runtime_resume_success(struct ol_softc *hif_ctx)
void hif_process_runtime_resume_success(struct hif_opaque_softc *hif_ctx)
{
struct hif_pci_softc *sc = get_sc(hif_ctx);
@@ -2096,7 +2096,7 @@ void hif_process_runtime_resume_success(struct ol_softc *hif_ctx)
*
* Return: 0 for success and non-zero error code for failure
*/
int hif_runtime_suspend(struct ol_softc *hif_ctx)
int hif_runtime_suspend(struct hif_opaque_softc *hif_ctx)
{
return hif_bus_suspend(hif_ctx);
}
@@ -2109,7 +2109,7 @@ int hif_runtime_suspend(struct ol_softc *hif_ctx)
* since runtime pm may cause ce_send_fast to skip the register
* write.
*/
static void hif_fastpath_resume(struct ol_softc *hif_ctx)
static void hif_fastpath_resume(struct hif_opaque_softc *hif_ctx)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
struct CE_state *ce_state;
@@ -2131,7 +2131,7 @@ static void hif_fastpath_resume(struct ol_softc *hif_ctx)
}
}
#else
static void hif_fastpath_resume(struct ol_softc *hif_ctx) {}
static void hif_fastpath_resume(struct hif_opaque_softc *hif_ctx) {}
#endif
@@ -2140,7 +2140,7 @@ static void hif_fastpath_resume(struct ol_softc *hif_ctx) {}
*
* Return: 0 for success and non-zero error code for failure
*/
int hif_runtime_resume(struct ol_softc *hif_ctx)
int hif_runtime_resume(struct hif_opaque_softc *hif_ctx)
{
int status = hif_bus_resume(hif_ctx);
@@ -2167,7 +2167,7 @@ static void hif_free_msi_ctx(struct hif_softc *scn)
}
#endif
void hif_disable_isr(struct ol_softc *ol_sc)
void hif_disable_isr(struct hif_opaque_softc *ol_sc)
{
struct hif_softc *scn = HIF_GET_SOFTC(ol_sc);
struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(scn);
@@ -2181,7 +2181,7 @@ void hif_disable_isr(struct ol_softc *ol_sc)
}
/* Function to reset SoC */
void hif_reset_soc(struct ol_softc *ol_sc)
void hif_reset_soc(struct hif_opaque_softc *ol_sc)
{
struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(ol_sc);
struct hif_target_info *tgt_info = hif_get_target_info_handle(ol_sc);
@@ -2200,7 +2200,7 @@ void hif_reset_soc(struct ol_softc *ol_sc)
#endif
}
void hif_disable_aspm(struct ol_softc *hif_ctx)
void hif_disable_aspm(struct hif_opaque_softc *hif_ctx)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(hif_ctx);
@@ -2223,7 +2223,7 @@ void hif_disable_aspm(struct ol_softc *hif_ctx)
*
* Return: none
*/
void hif_enable_power_gating(struct ol_softc *hif_ctx)
void hif_enable_power_gating(struct hif_opaque_softc *hif_ctx)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(hif_ctx);
@@ -2293,7 +2293,7 @@ hif_target_sleep_state_adjust(struct hif_softc *scn,
A_target_id_t pci_addr = scn->mem;
static int max_delay;
struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(scn);
struct ol_softc *hif_hdl = GET_HIF_OPAQUE_HDL(scn);
struct hif_opaque_softc *hif_hdl = GET_HIF_OPAQUE_HDL(scn);
static int debug;
struct hif_config_info *cfg = hif_get_ini_handle(hif_hdl);
@@ -2700,7 +2700,7 @@ CDF_STATUS hif_enable_bus(struct hif_softc *ol_sc,
int ret = 0;
uint32_t hif_type, target_type;
struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(ol_sc);
struct ol_softc *hif_hdl = GET_HIF_OPAQUE_HDL(ol_sc);
struct hif_opaque_softc *hif_hdl = GET_HIF_OPAQUE_HDL(ol_sc);
uint16_t revision_id;
uint32_t lcr_val;
int probe_again = 0;
@@ -2825,7 +2825,7 @@ int hif_get_target_type(struct hif_softc *ol_sc, struct device *dev,
#ifdef FEATURE_RUNTIME_PM
void hif_pm_runtime_get_noresume(struct ol_softc *hif_ctx)
void hif_pm_runtime_get_noresume(struct hif_opaque_softc *hif_ctx)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(hif_ctx);
@@ -2850,7 +2850,7 @@ void hif_pm_runtime_get_noresume(struct ol_softc *hif_ctx)
* return: success if the bus is up and a get has been issued
* otherwise an error code.
*/
int hif_pm_runtime_get(struct ol_softc *hif_ctx)
int hif_pm_runtime_get(struct hif_opaque_softc *hif_ctx)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(hif_ctx);
@@ -2906,7 +2906,7 @@ int hif_pm_runtime_get(struct ol_softc *hif_ctx)
*
* return: CDF_STATUS_SUCCESS if the put is performed
*/
int hif_pm_runtime_put(struct ol_softc *hif_ctx)
int hif_pm_runtime_put(struct hif_opaque_softc *hif_ctx)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx);
struct hif_pci_softc *sc = HIF_GET_PCI_SOFTC(hif_ctx);
@@ -3094,7 +3094,7 @@ static void hif_pm_runtime_lock_timeout_fn(unsigned long data)
spin_unlock_irqrestore(&hif_sc->runtime_lock, flags);
}
int hif_pm_runtime_prevent_suspend(struct ol_softc *ol_sc,
int hif_pm_runtime_prevent_suspend(struct hif_opaque_softc *ol_sc,
struct hif_pm_runtime_lock *data)
{
struct hif_softc *sc = HIF_GET_SOFTC(ol_sc);
@@ -3116,7 +3116,7 @@ int hif_pm_runtime_prevent_suspend(struct ol_softc *ol_sc,
return 0;
}
int hif_pm_runtime_allow_suspend(struct ol_softc *ol_sc,
int hif_pm_runtime_allow_suspend(struct hif_opaque_softc *ol_sc,
struct hif_pm_runtime_lock *data)
{
struct hif_softc *sc = HIF_GET_SOFTC(ol_sc);
@@ -3168,7 +3168,7 @@ int hif_pm_runtime_allow_suspend(struct ol_softc *ol_sc,
*
* Return: 0 on success and negative error code on failure
*/
int hif_pm_runtime_prevent_suspend_timeout(struct ol_softc *ol_sc,
int hif_pm_runtime_prevent_suspend_timeout(struct hif_opaque_softc *ol_sc,
struct hif_pm_runtime_lock *lock, unsigned int delay)
{
struct hif_softc *sc = HIF_GET_SOFTC(ol_sc);
@@ -3261,7 +3261,7 @@ struct hif_pm_runtime_lock *hif_runtime_lock_init(const char *name)
*
* Return: void
*/
void hif_runtime_lock_deinit(struct ol_softc *hif_ctx,
void hif_runtime_lock_deinit(struct hif_opaque_softc *hif_ctx,
struct hif_pm_runtime_lock *data)
{
unsigned long flags;

View File

@@ -78,7 +78,7 @@ bool hif_targ_is_awake(struct hif_softc *scn, void *__iomem *mem)
* Return: void
*/
/* Function to reset SoC */
void hif_reset_soc(struct ol_softc *hif_ctx)
void hif_reset_soc(struct hif_opaque_softc *hif_ctx)
{
}
@@ -91,7 +91,7 @@ void hif_reset_soc(struct ol_softc *hif_ctx)
*
* Return: void
*/
void hif_disable_isr(struct ol_softc *hif_ctx)
void hif_disable_isr(struct hif_opaque_softc *hif_ctx)
{
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx)
@@ -115,13 +115,13 @@ static void hif_dump_snoc_registers(struct hif_softc *scn)
/**
* hif_dump_registers(): dump bus debug registers
* @scn: struct ol_softc
* @scn: struct hif_opaque_softc
*
* This function dumps hif bus debug registers
*
* Return: 0 for success or error code
*/
int hif_dump_registers(struct ol_softc *hif_ctx)
int hif_dump_registers(struct hif_opaque_softc *hif_ctx)
{
int status;
struct hif_softc *scn = HIF_GET_SOFTC(hif_ctx)
@@ -143,7 +143,7 @@ int hif_dump_registers(struct ol_softc *hif_ctx)
*
* Return: 0 for success and non-zero for failure
*/
int hif_bus_suspend(struct ol_softc *hif_ctx)
int hif_bus_suspend(struct hif_opaque_softc *hif_ctx)
{
return 0;
}
@@ -156,7 +156,7 @@ int hif_bus_suspend(struct ol_softc *hif_ctx)
*
* Return: 0 for success and non-zero for failure
*/
int hif_bus_resume(struct ol_softc *hif_ctx)
int hif_bus_resume(struct hif_opaque_softc *hif_ctx)
{
return 0;
}
@@ -166,7 +166,7 @@ int hif_bus_resume(struct ol_softc *hif_ctx)
*
* Return: n/a
*/
void hif_enable_power_gating(struct ol_softc *hif_ctx)
void hif_enable_power_gating(struct hif_opaque_softc *hif_ctx)
{
}
@@ -175,7 +175,7 @@ void hif_enable_power_gating(struct ol_softc *hif_ctx)
*
* Return: n/a
*/
void hif_disable_aspm(struct ol_softc *hif_ctx)
void hif_disable_aspm(struct hif_opaque_softc *hif_ctx)
{
}

View File

@@ -832,26 +832,26 @@ void *htc_get_targetdef(HTC_HANDLE htc_handle)
/**
* htc_set_target_to_sleep() - set target to sleep
* @context: ol_softc context
* @context: hif_opaque_softc context
*
* Return: none
*/
void htc_set_target_to_sleep(void *context)
{
struct ol_softc *scn = (struct ol_softc *)context;
struct hif_opaque_softc *scn = (struct hif_opaque_softc *)context;
hif_set_target_sleep(scn, true, false);
}
/**
* htc_cancel_deferred_target_sleep() - cancel deferred target sleep
* @context: ol_softc context
* @context: hif_opaque_softc context
*
* Return: none
*/
void htc_cancel_deferred_target_sleep(void *context)
{
struct ol_softc *scn = (struct ol_softc *)context;
struct hif_opaque_softc *scn = (struct hif_opaque_softc *)context;
hif_cancel_deferred_target_sleep(scn);
}

View File

@@ -153,7 +153,7 @@ enum ol_ath_htc_pkt_ecodes {
};
/* our HTC target state */
typedef struct _HTC_TARGET {
struct ol_softc *hif_dev;
struct hif_opaque_softc *hif_dev;
HTC_ENDPOINT endpoint[ENDPOINT_MAX];
cdf_spinlock_t HTCLock;
cdf_spinlock_t HTCRxLock;