Browse Source

qcacld-3.0: Replace typedef tSirIbssPeerInactivityInd

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 tSirIbssPeerInactivityInd
typedef does not meet any of those criteria, so replace it (and the
"tp" variant) with a reference to the underlying struct.

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

Change-Id: I392d7db54aa78c390aa268aacca39818b6ec5aca
CRs-Fixed: 2396056
Jeff Johnson 6 years ago
parent
commit
834dcdd3d6
3 changed files with 21 additions and 24 deletions
  1. 2 2
      core/mac/inc/sir_api.h
  2. 13 14
      core/mac/src/pe/lim/lim_ibss_peer_mgmt.c
  3. 6 8
      core/wma/src/wma_mgmt.c

+ 2 - 2
core/mac/inc/sir_api.h

@@ -1697,11 +1697,11 @@ typedef struct sSmeIbssPeerInd {
 	/* Beacon will be appended for new Peer indication. */
 } tSmeIbssPeerInd, *tpSmeIbssPeerInd;
 
-typedef struct sSirIbssPeerInactivityInd {
+struct ibss_peer_inactivity_ind {
 	uint8_t bssIdx;
 	uint8_t staIdx;
 	struct qdf_mac_addr peer_addr;
-} tSirIbssPeerInactivityInd, *tpSirIbssPeerInactivityInd;
+};
 
 /**
  * struct lim_channel_status

+ 13 - 14
core/mac/src/pe/lim/lim_ibss_peer_mgmt.c

@@ -1784,27 +1784,27 @@ void lim_ibss_decide_protection_on_delete(struct mac_context *mac_ctx,
 	}
 }
 
-/** -----------------------------------------------------------------
-   \fn __lim_ibss_peer_inactivity_handler
-   \brief Internal function. Deletes FW indicated peer which is inactive
- \
-   \param  struct mac_context *   mac
-   \param  struct pe_session *      pe_session
-   \param  tpSirIbssPeerInactivityInd peerInactivityInd
-   \return None
-   -----------------------------------------------------------------*/
+/**
+ * __lim_ibss_peer_inactivity_handler() - Handle inactive IBSS peer
+ * @mac: Global MAC context
+ * @pe_session: PE session
+ * @ind: IBSS peer inactivity indication
+ *
+ * Internal function. Deletes FW indicated peer which is inactive
+ *
+ * Return: None
+ */
 static void
 __lim_ibss_peer_inactivity_handler(struct mac_context *mac,
 				   struct pe_session *pe_session,
-				   tpSirIbssPeerInactivityInd peerInactivityInd)
+				   struct ibss_peer_inactivity_ind *ind)
 {
 	if (pe_session->limMlmState != eLIM_MLM_BSS_STARTED_STATE) {
 		return;
 	}
 
 	/* delete the peer for which heartbeat is observed */
-	lim_ibss_delete_peer(mac, pe_session,
-					  peerInactivityInd->peer_addr.bytes);
+	lim_ibss_delete_peer(mac, pe_session, ind->peer_addr.bytes);
 }
 
 /** -------------------------------------------------------------
@@ -1825,8 +1825,7 @@ void lim_process_ibss_peer_inactivity(struct mac_context *mac, void *buf)
 	 */
 	uint8_t i;
 
-	tSirIbssPeerInactivityInd *peerInactivityInd =
-		(tSirIbssPeerInactivityInd *) buf;
+	struct ibss_peer_inactivity_ind *peerInactivityInd = buf;
 
 	/*
 	 * If IBSS is not started or heartbeat offload is not enabled

+ 6 - 8
core/wma/src/wma_mgmt.c

@@ -345,7 +345,7 @@ int wma_peer_sta_kickout_event_handler(void *handle, uint8_t *event,
 	void *peer;
 	struct cdp_pdev *pdev;
 	tpDeleteStaContext del_sta_ctx;
-	tpSirIbssPeerInactivityInd p_inactivity;
+	struct ibss_peer_inactivity_ind *inactivity;
 	void *soc = cds_get_context(QDF_MODULE_ID_SOC);
 
 	WMA_LOGD("%s: Enter", __func__);
@@ -378,19 +378,17 @@ int wma_peer_sta_kickout_event_handler(void *handle, uint8_t *event,
 
 	switch (kickout_event->reason) {
 	case WMI_PEER_STA_KICKOUT_REASON_IBSS_DISCONNECT:
-		p_inactivity = (tpSirIbssPeerInactivityInd)
-					qdf_mem_malloc(sizeof(
-						tSirIbssPeerInactivityInd));
-		if (!p_inactivity) {
+		inactivity = qdf_mem_malloc(sizeof(*inactivity));
+		if (!inactivity) {
 			WMA_LOGE("QDF MEM Alloc Failed for tSirIbssPeerInactivity");
 			return -ENOMEM;
 		}
 
-		p_inactivity->staIdx = peer_id;
-		qdf_mem_copy(p_inactivity->peer_addr.bytes, macaddr,
+		inactivity->staIdx = peer_id;
+		qdf_mem_copy(inactivity->peer_addr.bytes, macaddr,
 			     IEEE80211_ADDR_LEN);
 		wma_send_msg(wma, WMA_IBSS_PEER_INACTIVITY_IND,
-			     (void *)p_inactivity, 0);
+			     inactivity, 0);
 		goto exit_handler;
 #ifdef FEATURE_WLAN_TDLS
 	case WMI_PEER_STA_KICKOUT_REASON_TDLS_DISCONNECT: