Browse Source

qcacld-3.0: Converge on struct gateway_update_req_param

The driver currently defines two different data structures to hold
Gateway Update parameters:
- legacy struct gateway_param_update_req
- unified WMI struct gateway_update_req_param

To align with the converged software architecture remove the legacy
definition and exclusively use the unified WMI definition.

Change-Id: Icc56c4d83808e3661593d2e4735533442d48eb7e
CRs-Fixed: 2404089
Jeff Johnson 6 years ago
parent
commit
38d0ce6787

+ 3 - 3
core/hdd/src/wlan_hdd_subnet_detect.c

@@ -75,7 +75,7 @@ static int __wlan_hdd_cfg80211_set_gateway_params(struct wiphy *wiphy,
 	struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
 	struct hdd_context *hdd_ctx = wiphy_priv(wiphy);
 	struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_GW_PARAM_CONFIG_MAX + 1];
-	struct gateway_param_update_req req = { 0 };
+	struct gateway_update_req_param req = { 0 };
 	int ret;
 	QDF_STATUS status;
 	bool subnet_detection_enabled;
@@ -148,9 +148,9 @@ static int __wlan_hdd_cfg80211_set_gateway_params(struct wiphy *wiphy,
 
 	req.max_retries = 3;
 	req.timeout = 100;   /* in milliseconds */
-	req.session_id = adapter->vdev_id;
+	req.vdev_id = adapter->vdev_id;
 
-	hdd_debug("Configuring gateway for session %d", req.session_id);
+	hdd_debug("Configuring gateway for session %d", req.vdev_id);
 	hdd_debug("mac:%pM, ipv4:%pI4 (type %d), ipv6:%pI6c (type %d)",
 		  req.gw_mac_addr.bytes,
 		  req.ipv4_addr, req.ipv4_addr_type,

+ 0 - 28
core/mac/inc/sir_api.h

@@ -4604,34 +4604,6 @@ enum powersave_qpower_mode {
 	QPOWER_DUTY_CYCLING = 2
 };
 
-#ifdef FEATURE_LFR_SUBNET_DETECTION
-/**
- * struct gateway_param_update_req - gateway parameter update request
- * @request_id: request id
- * @session_id: session id
- * @max_retries: Max ARP/NS retry attempts
- * @timeout: Retry interval
- * @ipv4_addr_type: on ipv4 network
- * @ipv6_addr_type: on ipv6 network
- * @gw_mac_addr: gateway mac addr
- * @ipv4_addr: ipv4 addr
- * @ipv6_addr: ipv6 addr
- */
-struct gateway_param_update_req {
-	uint32_t     request_id;
-	uint32_t     session_id;
-	uint32_t     max_retries;
-	uint32_t     timeout;
-	uint32_t     ipv4_addr_type;
-	uint32_t     ipv6_addr_type;
-	struct qdf_mac_addr  gw_mac_addr;
-	uint8_t      ipv4_addr[QDF_IPV4_ADDR_SIZE];
-	uint8_t      ipv6_addr[QDF_IPV6_ADDR_SIZE];
-};
-#else
-struct gateway_param_update_req;
-#endif /* FEATURE_LFR_SUBNET_DETECTION */
-
 /**
  * struct sir_sme_ext_change_chan_req - channel change request
  * @message_type: message id

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

@@ -1528,7 +1528,7 @@ sme_get_opclass(mac_handle_t mac_handle, uint8_t channel, uint8_t bw_offset,
 
 #ifdef FEATURE_LFR_SUBNET_DETECTION
 QDF_STATUS sme_gateway_param_update(mac_handle_t mac_handle,
-				struct gateway_param_update_req *request);
+				struct gateway_update_req_param *request);
 #endif
 
 void sme_update_fine_time_measurement_capab(mac_handle_t mac_handle,

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

@@ -11978,11 +11978,11 @@ QDF_STATUS sme_soc_set_dual_mac_config(struct policy_mgr_dual_mac_config msg)
  * This routine will update gateway parameters to WMA
  */
 QDF_STATUS sme_gateway_param_update(mac_handle_t mac_handle,
-				    struct gateway_param_update_req *gw_params)
+				    struct gateway_update_req_param *gw_params)
 {
 	QDF_STATUS qdf_status;
 	struct scheduler_msg message = {0};
-	struct gateway_param_update_req *request_buf;
+	struct gateway_update_req_param *request_buf;
 
 	request_buf = qdf_mem_malloc(sizeof(*request_buf));
 	if (!request_buf)

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

@@ -1750,12 +1750,24 @@ QDF_STATUS
 wma_config_debug_module_cmd(wmi_unified_t wmi_handle, A_UINT32 param,
 		A_UINT32 val, A_UINT32 *module_id_bitmap,
 		A_UINT32 bitmap_len);
+
 #ifdef FEATURE_LFR_SUBNET_DETECTION
+/**
+ * wma_set_gateway_params() - set gateway parameters
+ * @wma: WMA handle
+ * @req: gateway update request parameter structure
+ *
+ * This function takes the incoming @req and sends it down to the
+ * firmware
+ *
+ * Return: QDF_STATUS
+ */
 QDF_STATUS wma_set_gateway_params(tp_wma_handle wma,
-					struct gateway_param_update_req *req);
+				  struct gateway_update_req_param *req);
 #else
-static inline QDF_STATUS wma_set_gateway_params(tp_wma_handle wma,
-					struct gateway_param_update_req *req)
+static inline
+QDF_STATUS wma_set_gateway_params(tp_wma_handle wma,
+				  struct gateway_update_req_param *req)
 {
 	return QDF_STATUS_SUCCESS;
 }

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

@@ -8783,8 +8783,7 @@ static QDF_STATUS wma_mc_process_msg(struct scheduler_msg *msg)
 		qdf_mem_free(msg->bodyptr);
 		break;
 	case WMA_GW_PARAM_UPDATE_REQ:
-		wma_set_gateway_params(wma_handle,
-			(struct gateway_param_update_req *)msg->bodyptr);
+		wma_set_gateway_params(wma_handle, msg->bodyptr);
 		qdf_mem_free(msg->bodyptr);
 		break;
 	case WMA_SET_ADAPT_DWELLTIME_CONF_PARAMS:

+ 2 - 28
core/wma/src/wma_scan_roam.c

@@ -5041,41 +5041,15 @@ int wma_roam_event_callback(WMA_HANDLE handle, uint8_t *event_buf,
 }
 
 #ifdef FEATURE_LFR_SUBNET_DETECTION
-/**
- * wma_set_gateway_params() - set gateway parameters
- * @wma: WMA handle
- * @req: gateway parameter update request structure
- *
- * This function reads the incoming @req and fill in the destination
- * WMI structure and sends down the gateway configs down to the firmware
- *
- * Return: QDF_STATUS
- */
 QDF_STATUS wma_set_gateway_params(tp_wma_handle wma,
-					struct gateway_param_update_req *req)
+				  struct gateway_update_req_param *req)
 {
-	struct gateway_update_req_param params = {0};
-
 	if (!wma) {
 		WMA_LOGE("%s: wma handle is NULL", __func__);
 		return QDF_STATUS_E_INVAL;
 	}
 
-	params.request_id = req->request_id;
-	params.vdev_id = req->session_id;
-	params.max_retries = req->max_retries;
-	params.timeout = req->timeout;
-	params.ipv4_addr_type = req->ipv4_addr_type;
-	params.ipv6_addr_type = req->ipv6_addr_type;
-	qdf_mem_copy(&params.gw_mac_addr, &req->gw_mac_addr,
-			sizeof(struct qdf_mac_addr));
-	qdf_mem_copy(params.ipv4_addr, req->ipv4_addr,
-				QDF_IPV4_ADDR_SIZE);
-	qdf_mem_copy(params.ipv6_addr, req->ipv6_addr,
-				QDF_IPV6_ADDR_SIZE);
-
-	return wmi_unified_set_gateway_params_cmd(wma->wmi_handle,
-							&params);
+	return wmi_unified_set_gateway_params_cmd(wma->wmi_handle, req);
 }
 #endif /* FEATURE_LFR_SUBNET_DETECTION */