Browse Source

qcacld-3.0: Replace typedef tSirSmeMissedBeaconInd

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 tSirSmeMissedBeaconInd 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: I24f35dd3248c78c9f9cab3d724032ae1fa5e890d
CRs-Fixed: 2395997
Jeff Johnson 6 years ago
parent
commit
cbc8532c57
4 changed files with 23 additions and 27 deletions
  1. 2 2
      core/mac/inc/sir_api.h
  2. 12 1
      core/mac/src/pe/include/lim_api.h
  3. 3 15
      core/mac/src/pe/lim/lim_api.c
  4. 6 9
      core/wma/src/wma_mgmt.c

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

@@ -1372,11 +1372,11 @@ struct mic_failure_ind {
 	tSirMicFailureInfo info;
 };
 
-typedef struct sSirSmeMissedBeaconInd {
+struct missed_beacon_ind {
 	uint16_t messageType;   /* eWNI_SME_MISSED_BEACON_IND */
 	uint16_t length;
 	uint8_t bssIdx;
-} tSirSmeMissedBeaconInd, *tpSirSmeMissedBeaconInd;
+};
 
 /* / Definition for Set Context request */
 /* / ---> MAC */

+ 12 - 1
core/mac/src/pe/include/lim_api.h

@@ -242,8 +242,19 @@ QDF_STATUS lim_update_short_slot(struct mac_context *mac,
 				    tpUpdateBeaconParams pBeaconParams,
 				    struct pe_session *);
 
+/**
+ * lim_ps_offload_handle_missed_beacon_ind() - handle missed beacon indication
+ * @mac: global mac context
+ * @msg: message
+ *
+ * This function process the SIR_HAL_MISSED_BEACON_IND
+ * message from HAL, to do active AP probing.
+ *
+ * Return: void
+ */
 void lim_ps_offload_handle_missed_beacon_ind(struct mac_context *mac,
-					     struct scheduler_msg *pMsg);
+					     struct scheduler_msg *msg);
+
 void lim_send_heart_beat_timeout_ind(struct mac_context *mac, struct pe_session *pe_session);
 tMgmtFrmDropReason lim_is_pkt_candidate_for_drop(struct mac_context *mac,
 						 uint8_t *pRxPacketInfo,

+ 3 - 15
core/mac/src/pe/lim/lim_api.c

@@ -1845,23 +1845,12 @@ void lim_send_heart_beat_timeout_ind(struct mac_context *mac,
 	}
 }
 
-/**
- * lim_ps_offload_handle_missed_beacon_ind(): handles missed beacon indication
- * @mac : global mac context
- * @pMsg: message
- *
- * This function process the SIR_HAL_MISSED_BEACON_IND
- * message from HAL, to do active AP probing.
- *
- * Return: void
- */
 void lim_ps_offload_handle_missed_beacon_ind(struct mac_context *mac,
-					     struct scheduler_msg *pMsg)
+					     struct scheduler_msg *msg)
 {
-	tpSirSmeMissedBeaconInd pSirMissedBeaconInd =
-		(tpSirSmeMissedBeaconInd) pMsg->bodyptr;
+	struct missed_beacon_ind *missed_beacon_ind = msg->bodyptr;
 	struct pe_session *pe_session =
-		pe_find_session_by_bss_idx(mac, pSirMissedBeaconInd->bssIdx);
+		pe_find_session_by_bss_idx(mac, missed_beacon_ind->bssIdx);
 
 	if (!pe_session) {
 		pe_err("session does not exist for given BSSId");
@@ -1874,7 +1863,6 @@ void lim_ps_offload_handle_missed_beacon_ind(struct mac_context *mac,
 
 	/*  Do AP probing immediately */
 	lim_send_heart_beat_timeout_ind(mac, pe_session);
-	return;
 }
 
 #ifdef FEATURE_WLAN_MCC_TO_SCC_SWITCH

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

@@ -3151,25 +3151,22 @@ void wma_set_keepalive_req(tp_wma_handle wma,
  */
 void wma_beacon_miss_handler(tp_wma_handle wma, uint32_t vdev_id, int32_t rssi)
 {
-	tSirSmeMissedBeaconInd *beacon_miss_ind;
+	struct missed_beacon_ind *beacon_miss_ind;
 	struct mac_context *mac = cds_get_context(QDF_MODULE_ID_PE);
 
-	beacon_miss_ind = (tSirSmeMissedBeaconInd *) qdf_mem_malloc
-				  (sizeof(tSirSmeMissedBeaconInd));
-
-	if (NULL == beacon_miss_ind) {
-		WMA_LOGE("%s: Memory allocation failure", __func__);
+	beacon_miss_ind = qdf_mem_malloc(sizeof(*beacon_miss_ind));
+	if (!beacon_miss_ind)
 		return;
-	}
+
 	if (mac && mac->sme.tx_queue_cb)
 		mac->sme.tx_queue_cb(mac->hdd_handle, vdev_id,
 				     WLAN_STOP_ALL_NETIF_QUEUE,
 				     WLAN_CONTROL_PATH);
 	beacon_miss_ind->messageType = WMA_MISSED_BEACON_IND;
-	beacon_miss_ind->length = sizeof(tSirSmeMissedBeaconInd);
+	beacon_miss_ind->length = sizeof(*beacon_miss_ind);
 	beacon_miss_ind->bssIdx = vdev_id;
 
-	wma_send_msg(wma, WMA_MISSED_BEACON_IND, (void *)beacon_miss_ind, 0);
+	wma_send_msg(wma, WMA_MISSED_BEACON_IND, beacon_miss_ind, 0);
 	if (!wmi_service_enabled(wma->wmi_handle,
 				 wmi_service_hw_db2dbm_support))
 		rssi += WMA_TGT_NOISE_FLOOR_DBM;