Explorar el Código

qcacld-3.0: Pass the arg by reference while calling sme_pdev_set_pcl()

While calling sme_pdev_set_pcl() API, driver is passing the argument
by value. The size of the argument is 280 bytes which is not good
design.

Pass the argument by reference instead of passing it by value to make
design simple.

CRs-Fixed: 2233212
Change-Id: I92849fb125fe864c1c7c7977bce392a7bcfe4121
Krunal Soni hace 7 años
padre
commit
8a090df3e5
Se han modificado 2 ficheros con 12 adiciones y 6 borrados
  1. 1 1
      core/sme/inc/sme_api.h
  2. 11 5
      core/sme/src/common/sme_api.c

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

@@ -1029,7 +1029,7 @@ void sme_update_user_configured_nss(tHalHandle hal, uint8_t nss);
 
 bool sme_is_any_session_in_connected_state(tHalHandle h_hal);
 
-QDF_STATUS sme_pdev_set_pcl(struct policy_mgr_pcl_list msg);
+QDF_STATUS sme_pdev_set_pcl(struct policy_mgr_pcl_list *msg);
 QDF_STATUS sme_pdev_set_hw_mode(struct policy_mgr_hw_mode msg);
 void sme_register_hw_mode_trans_cb(tHalHandle hal,
 		hw_mode_transition_cb callback);

+ 11 - 5
core/sme/src/common/sme_api.c

@@ -13296,7 +13296,7 @@ QDF_STATUS sme_set_rssi_monitoring(tHalHandle hal,
  * Sends the command to WMA to send WMI_PDEV_SET_PCL_CMDID to FW
  * Return: QDF_STATUS_SUCCESS on successful posting
  */
-QDF_STATUS sme_pdev_set_pcl(struct policy_mgr_pcl_list msg)
+QDF_STATUS sme_pdev_set_pcl(struct policy_mgr_pcl_list *msg)
 {
 	QDF_STATUS status = QDF_STATUS_SUCCESS;
 	tpAniSirGlobal mac   = sme_get_mac_context();
@@ -13308,6 +13308,12 @@ QDF_STATUS sme_pdev_set_pcl(struct policy_mgr_pcl_list msg)
 		sme_err("mac is NULL");
 		return QDF_STATUS_E_FAILURE;
 	}
+
+	if (!msg) {
+		sme_err("msg is NULL");
+		return QDF_STATUS_E_FAILURE;
+	}
+
 	len = sizeof(*req_msg);
 
 	req_msg = qdf_mem_malloc(len);
@@ -13316,12 +13322,12 @@ QDF_STATUS sme_pdev_set_pcl(struct policy_mgr_pcl_list msg)
 		return QDF_STATUS_E_NOMEM;
 	}
 
-	for (i = 0; i < msg.pcl_len; i++) {
-		req_msg->pcl_list[i] =  msg.pcl_list[i];
-		req_msg->weight_list[i] =  msg.weight_list[i];
+	for (i = 0; i < msg->pcl_len; i++) {
+		req_msg->pcl_list[i] =  msg->pcl_list[i];
+		req_msg->weight_list[i] =  msg->weight_list[i];
 	}
 
-	req_msg->pcl_len = msg.pcl_len;
+	req_msg->pcl_len = msg->pcl_len;
 
 	status = sme_acquire_global_lock(&mac->sme);
 	if (status != QDF_STATUS_SUCCESS) {