qcacmn: Correct the return types of HIF functions

A few functions in HIF component returns QDF status value with return
type as  non QDF STATUS. For such functions, update the return type as
QDF_STATUS.

Change-Id: I69644a2206266ffe2c2d105056f9fec452f5d972
CRs-Fixed: 2734818
This commit is contained in:
Shashikala Prabhu
2020-07-14 18:16:24 +05:30
committed by snandini
parent 30f2d61e6d
commit b87eec2b53
9 changed files with 84 additions and 61 deletions

View File

@@ -665,15 +665,25 @@ bool hif_is_polled_mode_enabled(struct hif_opaque_softc *hif_ctx);
void hif_enable_fastpath(struct hif_opaque_softc *hif_ctx); void hif_enable_fastpath(struct hif_opaque_softc *hif_ctx);
bool hif_is_fastpath_mode_enabled(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 ret); void *hif_get_ce_handle(struct hif_opaque_softc *hif_ctx, int ret);
int hif_ce_fastpath_cb_register(struct hif_opaque_softc *hif_ctx,
/**
* hif_ce_fastpath_cb_register() - Register callback for fastpath msg handler
* @handler: Callback funtcion
* @context: handle for callback function
*
* Return: QDF_STATUS_SUCCESS on success or QDF_STATUS_E_FAILURE
*/
QDF_STATUS hif_ce_fastpath_cb_register(
struct hif_opaque_softc *hif_ctx,
fastpath_msg_handler handler, void *context); fastpath_msg_handler handler, void *context);
#else #else
static inline int hif_ce_fastpath_cb_register(struct hif_opaque_softc *hif_ctx, static inline QDF_STATUS hif_ce_fastpath_cb_register(
fastpath_msg_handler handler, struct hif_opaque_softc *hif_ctx,
void *context) fastpath_msg_handler handler, void *context)
{ {
return QDF_STATUS_E_FAILURE; return QDF_STATUS_E_FAILURE;
} }
static inline void *hif_get_ce_handle(struct hif_opaque_softc *hif_ctx, int ret) static inline void *hif_get_ce_handle(struct hif_opaque_softc *hif_ctx, int ret)
{ {
return NULL; return NULL;

View File

@@ -143,13 +143,13 @@ struct CE_attr;
* nbytes - number of bytes to send * nbytes - number of bytes to send
* transfer_id - arbitrary ID; reflected to destination * transfer_id - arbitrary ID; reflected to destination
* flags - CE_SEND_FLAG_* values * flags - CE_SEND_FLAG_* values
* Returns 0 on success; otherwise an error status. * Returns QDF_STATUS.
* *
* Note: If no flags are specified, use CE's default data swap mode. * Note: If no flags are specified, use CE's default data swap mode.
* *
* Implementation note: pushes 1 buffer to Source ring * Implementation note: pushes 1 buffer to Source ring
*/ */
int ce_send(struct CE_handle *copyeng, QDF_STATUS ce_send(struct CE_handle *copyeng,
void *per_transfer_send_context, void *per_transfer_send_context,
qdf_dma_addr_t buffer, qdf_dma_addr_t buffer,
unsigned int nbytes, unsigned int nbytes,
@@ -194,8 +194,17 @@ unsigned int ce_sendlist_sizeof(void);
/* Initialize a sendlist */ /* Initialize a sendlist */
void ce_sendlist_init(struct ce_sendlist *sendlist); void ce_sendlist_init(struct ce_sendlist *sendlist);
/* Append a simple buffer (address/length) to a sendlist. */ /**
int ce_sendlist_buf_add(struct ce_sendlist *sendlist, * ce_sendlist_buf_add() - Append a simple buffer (address/length) to a sendlist
* @sendlist: Sendlist
* @buffer: buffer
* @nbytes: numer of bytes to append
* @flags: flags
* @user_flags: user flags
*
* Return: QDF_STATUS
*/
QDF_STATUS ce_sendlist_buf_add(struct ce_sendlist *sendlist,
qdf_dma_addr_t buffer, qdf_dma_addr_t buffer,
unsigned int nbytes, unsigned int nbytes,
/* OR-ed with internal flags */ /* OR-ed with internal flags */
@@ -203,16 +212,18 @@ int ce_sendlist_buf_add(struct ce_sendlist *sendlist,
uint32_t user_flags); uint32_t user_flags);
/* /*
* Queue a "sendlist" of buffers to be sent using gather to a single * ce_sendlist_send() - Queue a "sendlist" of buffers to be sent using gather to
* anonymous destination buffer * a single anonymous destination buffer
* copyeng - which copy engine to use * @copyeng: which copy engine to use
* sendlist - list of simple buffers to send using gather * @per_transfer_send_context: Per transfer send context
* transfer_id - arbitrary ID; reflected to destination * @sendlist: list of simple buffers to send using gather
* Returns 0 on success; otherwise an error status. * @transfer_id: arbitrary ID; reflected to destination
* *
* Implementation note: Pushes multiple buffers with Gather to Source ring. * Implementation note: Pushes multiple buffers with Gather to Source ring.
*
* Return: QDF_STATUS
*/ */
int ce_sendlist_send(struct CE_handle *copyeng, QDF_STATUS ce_sendlist_send(struct CE_handle *copyeng,
void *per_transfer_send_context, void *per_transfer_send_context,
struct ce_sendlist *sendlist, struct ce_sendlist *sendlist,
unsigned int transfer_id); unsigned int transfer_id);
@@ -499,16 +510,17 @@ struct ce_ops {
int (*ce_ring_setup)(struct hif_softc *scn, uint8_t ring_type, int (*ce_ring_setup)(struct hif_softc *scn, uint8_t ring_type,
uint32_t ce_id, struct CE_ring_state *ring, uint32_t ce_id, struct CE_ring_state *ring,
struct CE_attr *attr); struct CE_attr *attr);
int (*ce_send_nolock)(struct CE_handle *copyeng, QDF_STATUS (*ce_send_nolock)(struct CE_handle *copyeng,
void *per_transfer_context, void *per_transfer_context,
qdf_dma_addr_t buffer, qdf_dma_addr_t buffer,
uint32_t nbytes, uint32_t nbytes,
uint32_t transfer_id, uint32_t transfer_id,
uint32_t flags, uint32_t flags,
uint32_t user_flags); uint32_t user_flags);
int (*ce_sendlist_send)(struct CE_handle *copyeng, QDF_STATUS (*ce_sendlist_send)(struct CE_handle *copyeng,
void *per_transfer_context, void *per_transfer_context,
struct ce_sendlist *sendlist, unsigned int transfer_id); struct ce_sendlist *sendlist,
unsigned int transfer_id);
QDF_STATUS (*ce_revoke_recv_next)(struct CE_handle *copyeng, QDF_STATUS (*ce_revoke_recv_next)(struct CE_handle *copyeng,
void **per_CE_contextp, void **per_CE_contextp,
void **per_transfer_contextp, void **per_transfer_contextp,

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2015-2019 The Linux Foundation. All rights reserved. * Copyright (c) 2015-2020 The Linux Foundation. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -134,7 +134,7 @@ QDF_STATUS hif_exchange_bmi_msg(struct hif_opaque_softc *hif_ctx,
struct CE_handle *ce_send_hdl = send_pipe_info->ce_hdl; struct CE_handle *ce_send_hdl = send_pipe_info->ce_hdl;
qdf_dma_addr_t CE_request, CE_response = 0; qdf_dma_addr_t CE_request, CE_response = 0;
struct BMI_transaction *transaction = NULL; struct BMI_transaction *transaction = NULL;
int status = QDF_STATUS_SUCCESS; QDF_STATUS status = QDF_STATUS_SUCCESS;
struct HIF_CE_pipe_info *recv_pipe_info = struct HIF_CE_pipe_info *recv_pipe_info =
&(hif_state->pipe_info[BMI_CE_NUM_TO_HOST]); &(hif_state->pipe_info[BMI_CE_NUM_TO_HOST]);
struct CE_handle *ce_recv = recv_pipe_info->ce_hdl; struct CE_handle *ce_recv = recv_pipe_info->ce_hdl;

View File

@@ -2068,7 +2068,8 @@ hif_send_head(struct hif_opaque_softc *hif_ctx,
struct CE_handle *ce_hdl = pipe_info->ce_hdl; struct CE_handle *ce_hdl = pipe_info->ce_hdl;
int bytes = nbytes, nfrags = 0; int bytes = nbytes, nfrags = 0;
struct ce_sendlist sendlist; struct ce_sendlist sendlist;
int status, i = 0; int i = 0;
QDF_STATUS status;
unsigned int mux_id = 0; unsigned int mux_id = 0;
if (nbytes > qdf_nbuf_len(nbuf)) { if (nbytes > qdf_nbuf_len(nbuf)) {

View File

@@ -375,7 +375,7 @@ void war_ce_src_ring_write_idx_set(struct hif_softc *scn,
qdf_export_symbol(war_ce_src_ring_write_idx_set); qdf_export_symbol(war_ce_src_ring_write_idx_set);
int QDF_STATUS
ce_send(struct CE_handle *copyeng, ce_send(struct CE_handle *copyeng,
void *per_transfer_context, void *per_transfer_context,
qdf_dma_addr_t buffer, qdf_dma_addr_t buffer,
@@ -385,7 +385,7 @@ ce_send(struct CE_handle *copyeng,
uint32_t user_flag) uint32_t user_flag)
{ {
struct CE_state *CE_state = (struct CE_state *)copyeng; struct CE_state *CE_state = (struct CE_state *)copyeng;
int status; QDF_STATUS status;
struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(CE_state->scn); struct HIF_CE_state *hif_state = HIF_GET_CE_STATE(CE_state->scn);
qdf_spin_lock_bh(&CE_state->ce_index_lock); qdf_spin_lock_bh(&CE_state->ce_index_lock);
@@ -410,7 +410,7 @@ void ce_sendlist_init(struct ce_sendlist *sendlist)
sl->num_items = 0; sl->num_items = 0;
} }
int QDF_STATUS
ce_sendlist_buf_add(struct ce_sendlist *sendlist, ce_sendlist_buf_add(struct ce_sendlist *sendlist,
qdf_dma_addr_t buffer, qdf_dma_addr_t buffer,
uint32_t nbytes, uint32_t nbytes,
@@ -436,7 +436,7 @@ ce_sendlist_buf_add(struct ce_sendlist *sendlist,
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }
int QDF_STATUS
ce_sendlist_send(struct CE_handle *copyeng, ce_sendlist_send(struct CE_handle *copyeng,
void *per_transfer_context, void *per_transfer_context,
struct ce_sendlist *sendlist, unsigned int transfer_id) struct ce_sendlist *sendlist, unsigned int transfer_id)

View File

@@ -522,7 +522,7 @@ static inline bool ce_is_fastpath_enabled(struct hif_softc *scn)
} }
#endif /* WLAN_FEATURE_FASTPATH */ #endif /* WLAN_FEATURE_FASTPATH */
static int static QDF_STATUS
ce_send_nolock_legacy(struct CE_handle *copyeng, ce_send_nolock_legacy(struct CE_handle *copyeng,
void *per_transfer_context, void *per_transfer_context,
qdf_dma_addr_t buffer, qdf_dma_addr_t buffer,
@@ -531,7 +531,7 @@ ce_send_nolock_legacy(struct CE_handle *copyeng,
uint32_t flags, uint32_t flags,
uint32_t user_flags) uint32_t user_flags)
{ {
int status; QDF_STATUS status;
struct CE_state *CE_state = (struct CE_state *)copyeng; struct CE_state *CE_state = (struct CE_state *)copyeng;
struct CE_ring_state *src_ring = CE_state->src_ring; struct CE_ring_state *src_ring = CE_state->src_ring;
uint32_t ctrl_addr = CE_state->ctrl_addr; uint32_t ctrl_addr = CE_state->ctrl_addr;
@@ -622,12 +622,12 @@ ce_send_nolock_legacy(struct CE_handle *copyeng,
return status; return status;
} }
static int static QDF_STATUS
ce_sendlist_send_legacy(struct CE_handle *copyeng, ce_sendlist_send_legacy(struct CE_handle *copyeng,
void *per_transfer_context, void *per_transfer_context,
struct ce_sendlist *sendlist, unsigned int transfer_id) struct ce_sendlist *sendlist, unsigned int transfer_id)
{ {
int status = -ENOMEM; QDF_STATUS status = QDF_STATUS_E_NOMEM;
struct ce_sendlist_s *sl = (struct ce_sendlist_s *)sendlist; struct ce_sendlist_s *sl = (struct ce_sendlist_s *)sendlist;
struct CE_state *CE_state = (struct CE_state *)copyeng; struct CE_state *CE_state = (struct CE_state *)copyeng;
struct CE_ring_state *src_ring = CE_state->src_ring; struct CE_ring_state *src_ring = CE_state->src_ring;

View File

@@ -132,7 +132,7 @@ void hif_record_ce_srng_desc_event(struct hif_softc *scn, int ce_id,
} }
#endif /* HIF_CONFIG_SLUB_DEBUG_ON || HIF_CE_DEBUG_DATA_BUF */ #endif /* HIF_CONFIG_SLUB_DEBUG_ON || HIF_CE_DEBUG_DATA_BUF */
static int static QDF_STATUS
ce_send_nolock_srng(struct CE_handle *copyeng, ce_send_nolock_srng(struct CE_handle *copyeng,
void *per_transfer_context, void *per_transfer_context,
qdf_dma_addr_t buffer, qdf_dma_addr_t buffer,
@@ -141,7 +141,7 @@ ce_send_nolock_srng(struct CE_handle *copyeng,
uint32_t flags, uint32_t flags,
uint32_t user_flags) uint32_t user_flags)
{ {
int status; QDF_STATUS status;
struct CE_state *CE_state = (struct CE_state *)copyeng; struct CE_state *CE_state = (struct CE_state *)copyeng;
struct CE_ring_state *src_ring = CE_state->src_ring; struct CE_ring_state *src_ring = CE_state->src_ring;
unsigned int nentries_mask = src_ring->nentries_mask; unsigned int nentries_mask = src_ring->nentries_mask;
@@ -215,12 +215,12 @@ ce_send_nolock_srng(struct CE_handle *copyeng,
return status; return status;
} }
static int static QDF_STATUS
ce_sendlist_send_srng(struct CE_handle *copyeng, ce_sendlist_send_srng(struct CE_handle *copyeng,
void *per_transfer_context, void *per_transfer_context,
struct ce_sendlist *sendlist, unsigned int transfer_id) struct ce_sendlist *sendlist, unsigned int transfer_id)
{ {
int status = -ENOMEM; QDF_STATUS status = QDF_STATUS_E_NOMEM;
struct ce_sendlist_s *sl = (struct ce_sendlist_s *)sendlist; struct ce_sendlist_s *sl = (struct ce_sendlist_s *)sendlist;
struct CE_state *CE_state = (struct CE_state *)copyeng; struct CE_state *CE_state = (struct CE_state *)copyeng;
struct CE_ring_state *src_ring = CE_state->src_ring; struct CE_ring_state *src_ring = CE_state->src_ring;

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013-2018 The Linux Foundation. All rights reserved. * Copyright (c) 2013-2018, 2020 The Linux Foundation. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -56,7 +56,7 @@ qdf_export_symbol(hif_send_fast);
* *
* Return: QDF_STATUS_SUCCESS on success or QDF_STATUS_E_FAILURE * Return: QDF_STATUS_SUCCESS on success or QDF_STATUS_E_FAILURE
*/ */
int hif_ce_fastpath_cb_register(struct hif_opaque_softc *hif_ctx, QDF_STATUS hif_ce_fastpath_cb_register(struct hif_opaque_softc *hif_ctx,
fastpath_msg_handler handler, fastpath_msg_handler handler,
void *context) void *context)
{ {

View File

@@ -1,5 +1,5 @@
/* /*
* Copyright (c) 2013-2019 The Linux Foundation. All rights reserved. * Copyright (c) 2013-2020 The Linux Foundation. All rights reserved.
* *
* Permission to use, copy, modify, and/or distribute this software for * Permission to use, copy, modify, and/or distribute this software for
* any purpose with or without fee is hereby granted, provided that the * any purpose with or without fee is hereby granted, provided that the
@@ -109,7 +109,7 @@ void hif_sdio_stop(struct hif_softc *hif_ctx)
* *
* send tx data on a given pipe id * send tx data on a given pipe id
* *
* Return: int * Return: QDF_STATUS
*/ */
QDF_STATUS hif_send_head(struct hif_opaque_softc *hif_ctx, uint8_t pipe, QDF_STATUS hif_send_head(struct hif_opaque_softc *hif_ctx, uint8_t pipe,
uint32_t transfer_id, uint32_t nbytes, qdf_nbuf_t buf, uint32_t transfer_id, uint32_t nbytes, qdf_nbuf_t buf,