qcacld-3.0: Replace typedef tSmePeerInfoHddCbkInfo

The Linux Coding Style enumerates a few special cases where typedefs
are useful, but stresses "NEVER EVER use a typedef unless you can
clearly match one of those rules." The tSmePeerInfoHddCbkInfo typedef
does not meet any of those criteria, so replace it with a reference to
the underlying struct.

Further note the Linux Coding Style frowns upon mixed-case names so in
conjunction rename the underlying struct to be in compliance.

Change-Id: I751e865a5d3ad64ee46794a28a11b2671e405d34
CRs-Fixed: 2400318
This commit is contained in:
Jeff Johnson
2019-02-17 17:18:43 -08:00
committed by nshrivas
parent d6a2316239
commit 56ba88aeb5
2 changed files with 16 additions and 14 deletions

View File

@@ -70,14 +70,14 @@ typedef enum eSmeState {
#define SME_IS_READY(mac) (SME_STATE_READY == (mac)->sme.state) #define SME_IS_READY(mac) (SME_STATE_READY == (mac)->sme.state)
/* HDD Callback function */ /* HDD Callback function */
typedef void (*ibss_peer_info_cb)(void *pUserData, typedef void (*ibss_peer_info_cb)(void *cb_context,
tSirPeerInfoRspParams *infoParam); tSirPeerInfoRspParams *infoParam);
/* Peer info */ /* Peer info */
typedef struct tagSmePeerInfoHddCbkInfo { struct ibss_peer_info_cb_info {
void *pUserData; void *peer_info_cb_context;
ibss_peer_info_cb peer_info_cb; ibss_peer_info_cb peer_info_cb;
} tSmePeerInfoHddCbkInfo; };
/** /**
* struct stats_ext_event - stats_ext_event payload * struct stats_ext_event - stats_ext_event payload
@@ -259,7 +259,7 @@ struct sme_context {
void **sme_cmd_buf_addr; void **sme_cmd_buf_addr;
tDblLinkList sme_cmd_freelist; /* preallocated roam cmd list */ tDblLinkList sme_cmd_freelist; /* preallocated roam cmd list */
enum QDF_OPMODE curr_device_mode; enum QDF_OPMODE curr_device_mode;
tSmePeerInfoHddCbkInfo peerInfoParams; struct ibss_peer_info_cb_info peerInfoParams;
#ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR #ifdef FEATURE_WLAN_DIAG_SUPPORT_CSR
host_event_wlan_status_payload_type eventPayload; host_event_wlan_status_payload_type eventPayload;
#endif #endif

View File

@@ -1761,19 +1761,21 @@ QDF_STATUS sme_ibss_peer_info_response_handler(struct mac_context *mac,
tpSirIbssGetPeerInfoRspParams tpSirIbssGetPeerInfoRspParams
pIbssPeerInfoParams) pIbssPeerInfoParams)
{ {
if (NULL == mac) { struct ibss_peer_info_cb_info *cb_info;
if (!mac) {
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_FATAL, QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_FATAL,
"%s: mac is null", __func__); "%s: mac is null", __func__);
return QDF_STATUS_E_FAILURE; return QDF_STATUS_E_FAILURE;
} }
if (mac->sme.peerInfoParams.peer_info_cb == NULL) { cb_info = &mac->sme.peerInfoParams;
if (!cb_info->peer_info_cb) {
QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR, QDF_TRACE(QDF_MODULE_ID_SME, QDF_TRACE_LEVEL_ERROR,
"%s: HDD callback is null", __func__); "%s: HDD callback is null", __func__);
return QDF_STATUS_E_FAILURE; return QDF_STATUS_E_FAILURE;
} }
mac->sme.peerInfoParams.peer_info_cb(mac->sme.peerInfoParams.pUserData, cb_info->peer_info_cb(cb_info->peer_info_cb_context,
&pIbssPeerInfoParams-> &pIbssPeerInfoParams->ibssPeerInfoRspParams);
ibssPeerInfoRspParams);
return QDF_STATUS_SUCCESS; return QDF_STATUS_SUCCESS;
} }
@@ -7631,14 +7633,14 @@ QDF_STATUS sme_send_rmc_action_period(mac_handle_t mac_handle,
/* /*
* sme_request_ibss_peer_info() - request ibss peer info * sme_request_ibss_peer_info() - request ibss peer info
* @mac_handle: Opaque handle to the global MAC context * @mac_handle: Opaque handle to the global MAC context
* @pUserData: Pointer to user data * @cb_context: Pointer to user data
* @peer_info_cb: Peer info callback * @peer_info_cb: Peer info callback
* @allPeerInfoReqd: All peer info required or not * @allPeerInfoReqd: All peer info required or not
* @staIdx: sta index * @staIdx: sta index
* *
* Return: QDF_STATUS * Return: QDF_STATUS
*/ */
QDF_STATUS sme_request_ibss_peer_info(mac_handle_t mac_handle, void *pUserData, QDF_STATUS sme_request_ibss_peer_info(mac_handle_t mac_handle, void *cb_context,
ibss_peer_info_cb peer_info_cb, ibss_peer_info_cb peer_info_cb,
bool allPeerInfoReqd, uint8_t staIdx) bool allPeerInfoReqd, uint8_t staIdx)
{ {
@@ -7651,7 +7653,7 @@ QDF_STATUS sme_request_ibss_peer_info(mac_handle_t mac_handle, void *pUserData,
status = sme_acquire_global_lock(&mac->sme); status = sme_acquire_global_lock(&mac->sme);
if (QDF_STATUS_SUCCESS == status) { if (QDF_STATUS_SUCCESS == status) {
mac->sme.peerInfoParams.peer_info_cb = peer_info_cb; mac->sme.peerInfoParams.peer_info_cb = peer_info_cb;
mac->sme.peerInfoParams.pUserData = pUserData; mac->sme.peerInfoParams.peer_info_cb_context = cb_context;
pIbssInfoReqParams = (tSirIbssGetPeerInfoReqParams *) pIbssInfoReqParams = (tSirIbssGetPeerInfoReqParams *)
qdf_mem_malloc(sizeof(tSirIbssGetPeerInfoReqParams)); qdf_mem_malloc(sizeof(tSirIbssGetPeerInfoReqParams));