Просмотр исходного кода

qcacld-3.0: Revamp tBeaconGenParams

Currently all but one of the fields in tBeaconGenParams are unused. In
addition the one field that is used, as well as the struct itself, do
not conform to the Linux coding style. Therefore replace the typedef
with a properly named struct which contains a properly named field.

Change-Id: I246f45831854db07d5ff6835a1df222e771a5146
CRs-Fixed: 2378330
Jeff Johnson 6 лет назад
Родитель
Сommit
66d9fad9d4

+ 11 - 12
core/mac/src/pe/lim/lim_process_mlm_rsp_messages.c

@@ -3306,25 +3306,24 @@ free:
 	qdf_mem_free(body);
 }
 
-QDF_STATUS lim_send_beacon_ind(struct mac_context *mac, struct pe_session *pe_session,
+QDF_STATUS lim_send_beacon_ind(struct mac_context *mac,
+			       struct pe_session *pe_session,
 			       enum sir_bcn_update_reason reason)
 {
-	tBeaconGenParams *pBeaconGenParams = NULL;
-	struct scheduler_msg limMsg = {0};
-	/** Allocate the Memory for Beacon Pre Message and for Stations in PoweSave*/
+	struct beacon_gen_params *params;
+	struct scheduler_msg msg = {0};
+
 	if (!pe_session) {
 		pe_err("Error:Unable to get the PESessionEntry");
 		return QDF_STATUS_E_INVAL;
 	}
-	pBeaconGenParams = qdf_mem_malloc(sizeof(*pBeaconGenParams));
-	if (!pBeaconGenParams) {
-		pe_err("Unable to allocate memory during sending beaconPreMessage");
+	params = qdf_mem_malloc(sizeof(*params));
+	if (!params)
 		return QDF_STATUS_E_NOMEM;
-	}
-	qdf_mem_copy((void *)pBeaconGenParams->bssId,
-		     (void *)pe_session->bssId, QDF_MAC_ADDR_SIZE);
-	limMsg.bodyptr = pBeaconGenParams;
-	return sch_process_pre_beacon_ind(mac, &limMsg, reason);
+	qdf_mem_copy(params->bssid, pe_session->bssId, QDF_MAC_ADDR_SIZE);
+	msg.bodyptr = params;
+
+	return sch_process_pre_beacon_ind(mac, &msg, reason);
 }
 
 void lim_process_rx_channel_status_event(struct mac_context *mac_ctx, void *buf)

+ 3 - 3
core/mac/src/pe/sch/sch_beacon_gen.c

@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2018 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2012-2019 The Linux Foundation. All rights reserved.
  *
  * Permission to use, copy, modify, and/or distribute this software for
  * any purpose with or without fee is hereby granted, provided that the
@@ -1003,13 +1003,13 @@ QDF_STATUS sch_process_pre_beacon_ind(struct mac_context *mac,
 				      struct scheduler_msg *limMsg,
 				      enum sir_bcn_update_reason reason)
 {
-	tpBeaconGenParams pMsg = (tpBeaconGenParams) limMsg->bodyptr;
+	struct beacon_gen_params *pMsg = limMsg->bodyptr;
 	uint32_t beaconSize;
 	struct pe_session *pe_session;
 	uint8_t sessionId;
 	QDF_STATUS status = QDF_STATUS_E_FAILURE;
 
-	pe_session = pe_find_session_by_bssid(mac, pMsg->bssId, &sessionId);
+	pe_session = pe_find_session_by_bssid(mac, pMsg->bssid, &sessionId);
 	if (!pe_session) {
 		pe_err("session lookup fails");
 		goto end;

+ 5 - 20
core/wma/inc/wma_if.h

@@ -590,27 +590,12 @@ typedef struct {
 #endif /* FEATURE_OEM_DATA_SUPPORT */
 
 /**
- * struct tBeaconGenParams - params required for beacon gen request
- * @bssIdx: Identifies the BSSID for which it is time to generate a beacon
- * @bssId: BSSID
- * @numOfSta: Number of stations in power save, who have data pending
- * @numOfStaWithoutData: Number of stations in power save,
- *                       who don't have any data pending
- * @fBroadcastTrafficPending: broadcast traffic pending flag
- * @dtimCount: DTIM count
- * @rsvd: reserved(padding)
+ * struct beacon_gen_params - params required for beacon gen request
+ * @bssdd: BSSID for which it is time to generate a beacon
  */
-typedef struct sBeaconGenParams {
-	uint8_t bssIdx;
-	tSirMacAddr bssId;
-#ifdef FIXME_VOLANS
-	uint8_t numOfSta;
-	uint8_t numOfStaWithoutData;
-	uint8_t fBroadcastTrafficPending;
-	uint8_t dtimCount;
-#endif /* FIXME_VOLANS */
-	uint8_t rsvd[3];
-} tBeaconGenParams, *tpBeaconGenParams;
+struct beacon_gen_params {
+	tSirMacAddr bssid;
+};
 
 /**
  * struct tSendbeaconParams - send beacon parameters