Эх сурвалжийг харах

qcacld-3.0: Replace typedef tSirPlmReq

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 tSirPlmReq 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: Ie7eb223daef08337dda492e2d63754eb69ca09b9
CRs-Fixed: 2394995
Jeff Johnson 6 жил өмнө
parent
commit
b120a829a9

+ 5 - 4
core/hdd/src/wlan_hdd_ioctl.c

@@ -1489,7 +1489,7 @@ hdd_parse_set_roam_scan_channels(struct hdd_adapter *adapter, const char *comman
 /**
  * hdd_parse_plm_cmd() - HDD Parse Plm command
  * @pValue:	Pointer to input data
- * @pPlmRequest:Pointer to output struct tpSirPlmReq
+ * @pPlmRequest:Pointer to output struct plm_req
  *
  * This function parses the plm command passed in the format
  * CCXPLMREQ<space><enable><space><dialog_token><space>
@@ -1500,7 +1500,8 @@ hdd_parse_set_roam_scan_channels(struct hdd_adapter *adapter, const char *comman
  *
  * Return: 0 for success non-zero for failure
  */
-static QDF_STATUS hdd_parse_plm_cmd(uint8_t *pValue, tSirPlmReq *pPlmRequest)
+static QDF_STATUS hdd_parse_plm_cmd(uint8_t *pValue,
+				    struct plm_req *pPlmRequest)
 {
 	uint8_t *cmdPtr = NULL;
 	int count, content = 0, ret = 0;
@@ -5637,9 +5638,9 @@ static int drv_cmd_ccx_plm_req(struct hdd_adapter *adapter,
 	int ret = 0;
 	uint8_t *value = command;
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
-	tpSirPlmReq pPlmRequest = NULL;
+	struct plm_req *pPlmRequest = NULL;
 
-	pPlmRequest = qdf_mem_malloc(sizeof(tSirPlmReq));
+	pPlmRequest = qdf_mem_malloc(sizeof(struct plm_req));
 	if (NULL == pPlmRequest) {
 		ret = -ENOMEM;
 		goto exit;

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

@@ -873,7 +873,7 @@ typedef struct sEsePEContext {
 	tEseTSMContext tsm;
 } tEsePEContext, *tpEsePEContext;
 
-typedef struct sSirPlmReq {
+struct plm_req {
 	uint16_t diag_token;    /* Dialog token */
 	uint16_t meas_token;    /* measurement token */
 	uint16_t numBursts;     /* total number of bursts */
@@ -889,7 +889,7 @@ typedef struct sSirPlmReq {
 	uint8_t plmChList[CFG_VALID_CHANNEL_LIST_LEN];
 	uint8_t sessionId;
 	bool enable;
-} tSirPlmReq, *tpSirPlmReq;
+};
 
 #endif /* FEATURE_WLAN_ESE */
 

+ 1 - 1
core/sme/inc/sme_api.h

@@ -593,7 +593,7 @@ QDF_STATUS sme_set_cckm_ie(mac_handle_t mac_handle,
 QDF_STATUS sme_set_ese_beacon_request(mac_handle_t mac_handle,
 				      const uint8_t sessionId,
 				      const tCsrEseBeaconReq *pEseBcnReq);
-QDF_STATUS sme_set_plm_request(mac_handle_t mac_handle, tpSirPlmReq pPlm);
+QDF_STATUS sme_set_plm_request(mac_handle_t mac_handle, struct plm_req *pPlm);
 #endif /*FEATURE_WLAN_ESE */
 QDF_STATUS sme_get_modify_profile_fields(mac_handle_t mac_handle,
 					 uint8_t sessionId,

+ 1 - 1
core/sme/src/common/sme_api.c

@@ -1452,7 +1452,7 @@ QDF_STATUS sme_update_is_ese_feature_enabled(mac_handle_t mac_handle,
  *
  * Return: QDF_STATUS enumeration
  */
-QDF_STATUS sme_set_plm_request(mac_handle_t mac_handle, tpSirPlmReq pPlmReq)
+QDF_STATUS sme_set_plm_request(mac_handle_t mac_handle, struct plm_req *pPlmReq)
 {
 	QDF_STATUS status;
 	bool ret = false;

+ 3 - 3
core/wma/inc/wma_internal.h

@@ -1123,9 +1123,9 @@ void wma_add_ts_req(tp_wma_handle wma, struct add_ts_param *msg);
 #ifdef FEATURE_WLAN_ESE
 QDF_STATUS wma_process_tsm_stats_req(tp_wma_handle wma_handler,
 				     void *pTsmStatsMsg);
-QDF_STATUS wma_plm_start(tp_wma_handle wma, const tpSirPlmReq plm);
-QDF_STATUS wma_plm_stop(tp_wma_handle wma, const tpSirPlmReq plm);
-void wma_config_plm(tp_wma_handle wma, tpSirPlmReq plm);
+QDF_STATUS wma_plm_start(tp_wma_handle wma, const struct plm_req *plm);
+QDF_STATUS wma_plm_stop(tp_wma_handle wma, const struct plm_req *plm);
+void wma_config_plm(tp_wma_handle wma, struct plm_req *plm);
 #endif
 
 QDF_STATUS wma_process_mcbc_set_filter_req(tp_wma_handle wma_handle,

+ 2 - 1
core/wma/src/wma_main.c

@@ -8436,7 +8436,8 @@ static QDF_STATUS wma_mc_process_msg(struct scheduler_msg *msg)
 		break;
 #ifdef FEATURE_WLAN_ESE
 	case WMA_SET_PLM_REQ:
-		wma_config_plm(wma_handle, (tpSirPlmReq) msg->bodyptr);
+		wma_config_plm(wma_handle, msg->bodyptr);
+		qdf_mem_free(msg->bodyptr);
 		break;
 #endif
 	case WMA_GET_STATISTICS_REQ:

+ 5 - 11
core/wma/src/wma_scan_roam.c

@@ -3257,7 +3257,7 @@ send_resp:
  *
  * Return: QDF status
  */
-QDF_STATUS wma_plm_start(tp_wma_handle wma, const tpSirPlmReq plm)
+QDF_STATUS wma_plm_start(tp_wma_handle wma, const struct plm_req *plm)
 {
 	struct plm_req_params params = {0};
 	uint32_t num_channels;
@@ -3327,7 +3327,7 @@ QDF_STATUS wma_plm_start(tp_wma_handle wma, const tpSirPlmReq plm)
  *
  * Return: QDF status
  */
-QDF_STATUS wma_plm_stop(tp_wma_handle wma, const tpSirPlmReq plm)
+QDF_STATUS wma_plm_stop(tp_wma_handle wma, const struct plm_req *plm)
 {
 	struct plm_req_params params = {0};
 	QDF_STATUS status;
@@ -3373,15 +3373,15 @@ QDF_STATUS wma_plm_stop(tp_wma_handle wma, const tpSirPlmReq plm)
 }
 
 /**
- * wma_config_plm()- config PLM
+ * wma_config_plm() - config PLM
  * @wma: wma handle
  * @plm: plm request parameters
  *
  * Return: none
  */
-void wma_config_plm(tp_wma_handle wma, tpSirPlmReq plm)
+void wma_config_plm(tp_wma_handle wma, struct plm_req *plm)
 {
-	QDF_STATUS ret = 0;
+	QDF_STATUS ret;
 
 	if (NULL == plm || NULL == wma)
 		return;
@@ -3394,12 +3394,6 @@ void wma_config_plm(tp_wma_handle wma, tpSirPlmReq plm)
 	if (ret)
 		WMA_LOGE("%s: PLM %s failed %d", __func__,
 			 plm->enable ? "start" : "stop", ret);
-
-	/* SME expects WMA to free tpSirPlmReq memory after
-	 * processing PLM request.
-	 */
-	qdf_mem_free(plm);
-	plm = NULL;
 }
 #endif