Jelajahi Sumber

qcacld-3.0: Refactor WNI_CFG_WPS_UUID cfg to mlme component

WNI_CFG_WPS_UUID should be refactored and adopted by the mlme
component.

Move the cfg item to cfg_mlme_wps_params.h

Change-Id: I79db155ad16998e9d7a7e20c01efbcba1681d61e
CRs-Fixed: 2366599
Pragaspathi Thilagaraj 6 tahun lalu
induk
melakukan
2b9259f963

+ 5 - 0
components/mlme/core/src/wlan_mlme_main.c

@@ -1848,6 +1848,11 @@ static void mlme_init_wps_params_cfg(struct wlan_objmgr_psoc *psoc,
 				cfg_default(CFG_WPS_PIMARY_DEVICE_OUI);
 	wps_params->wps_state = cfg_default(CFG_WPS_STATE);
 	wps_params->wps_version = cfg_default(CFG_WPS_VERSION);
+	wps_params->wps_uuid.max_len = MLME_CFG_WPS_UUID_MAX_LEN;
+	qdf_uint8_array_parse(cfg_default(CFG_WPS_UUID),
+			      wps_params->wps_uuid.data,
+			      MLME_CFG_WPS_UUID_MAX_LEN,
+			      &wps_params->wps_uuid.len);
 }
 
 static void mlme_init_btm_cfg(struct wlan_mlme_btm *btm)

+ 12 - 1
components/mlme/dispatcher/inc/cfg_mlme_wps_params.h

@@ -87,6 +87,16 @@
 				CFG_VALUE_OR_DEFAULT, \
 				"wps device password id")
 
+#define WPS_UUID_DEF_STR "0xa, 0xb, 0xc, 0xd, 0xe, 0xf"
+#define WPS_UUID_DEF_LEN (sizeof(WPS_UUID_DEF_STR) - 1)
+
+#define CFG_WPS_UUID CFG_STRING( \
+		"wps_uuid", \
+		0, \
+		WPS_UUID_DEF_LEN, \
+		WPS_UUID_DEF_STR, \
+		"wps uuid")
+
 #define CFG_WPS_ALL \
 	CFG(CFG_WPS_ENABLE) \
 	CFG(CFG_WPS_STATE) \
@@ -95,7 +105,8 @@
 	CFG(CFG_WPS_PRIMARY_DEVICE_CATEGORY) \
 	CFG(CFG_WPS_PIMARY_DEVICE_OUI) \
 	CFG(CFG_WPS_DEVICE_SUB_CATEGORY) \
-	CFG(CFG_WPS_DEVICE_PASSWORD_ID)
+	CFG(CFG_WPS_DEVICE_PASSWORD_ID) \
+	CFG(CFG_WPS_UUID)
 
 #endif /* __CFG_MLME_WPS_PARAMS_H */
 

+ 11 - 0
components/mlme/dispatcher/inc/wlan_mlme_api.h

@@ -2050,4 +2050,15 @@ QDF_STATUS wlan_mlme_override_bmps_imps(struct wlan_objmgr_psoc *psoc);
 QDF_STATUS wlan_mlme_is_imps_enabled(struct wlan_objmgr_psoc *psoc,
 				     bool *value);
 
+/*
+ * wlan_mlme_get_wps_uuid() - get the wps uuid string
+ * @wps_params:   pointer to mlme wps parameters structure
+ * @data:          data to which the parameter is to be copied
+ *
+ * Return None
+ *
+ */
+void
+wlan_mlme_get_wps_uuid(struct wlan_mlme_wps_params *wps_params, uint8_t *data);
+
 #endif /* _WLAN_MLME_API_H_ */

+ 3 - 0
components/mlme/dispatcher/inc/wlan_mlme_public_struct.h

@@ -482,6 +482,7 @@ struct wlan_mlme_ht_caps {
 	bool short_slot_time_enabled;
 };
 
+#define MLME_CFG_WPS_UUID_MAX_LEN    16
 /*
  * struct wlan_mlme_wps_params - All wps based related cfg items
  *
@@ -493,6 +494,7 @@ struct wlan_mlme_ht_caps {
  * @wps_primary_device_oui - primary device OUI
  * @wps_device_sub_category - device sub category
  * @wps_device_password_id - password id of device
+ * @wps_uuid - wps uuid to be sent in probe
  */
 struct wlan_mlme_wps_params {
 	uint8_t enable_wps;
@@ -503,6 +505,7 @@ struct wlan_mlme_wps_params {
 	uint32_t wps_primary_device_oui;
 	uint16_t wps_device_sub_category;
 	uint32_t wps_device_password_id;
+	struct mlme_cfg_str wps_uuid;
 };
 
 #define MLME_CFG_LISTEN_INTERVAL        1

+ 8 - 0
components/mlme/dispatcher/src/wlan_mlme_api.c

@@ -3012,3 +3012,11 @@ QDF_STATUS wlan_mlme_override_bmps_imps(struct wlan_objmgr_psoc *psoc)
 
 	return QDF_STATUS_SUCCESS;
 }
+
+void wlan_mlme_get_wps_uuid(struct wlan_mlme_wps_params *wps_params,
+			    uint8_t *data)
+{
+	qdf_size_t len = wps_params->wps_uuid.len;
+
+	wlan_mlme_get_cfg_str(data, &wps_params->wps_uuid, &len);
+}

+ 0 - 1
core/mac/inc/wni_cfg.h

@@ -36,7 +36,6 @@ enum {
 	WNI_CFG_SCAN_CONTROL_LIST,
 	WNI_CFG_SCAN_IN_POWERSAVE,
 	WNI_CFG_IBSS_AUTO_BSSID,
-	WNI_CFG_WPS_UUID,
 	WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED,
 	WNI_CFG_IBSS_ATIM_WIN_SIZE,
 	WNI_CFG_PS_WOW_DATA_INACTIVITY_TIMEOUT,

+ 0 - 1
core/mac/src/cfg/cfg_param_name.c

@@ -50,7 +50,6 @@ const char *cfg_get_string(uint16_t cfg_id)
 	CASE_RETURN_STRING(WNI_CFG_LOCAL_POWER_CONSTRAINT);
 	CASE_RETURN_STRING(WNI_CFG_SCAN_CONTROL_LIST);
 	CASE_RETURN_STRING(WNI_CFG_IBSS_AUTO_BSSID);
-	CASE_RETURN_STRING(WNI_CFG_WPS_UUID);
 	CASE_RETURN_STRING(WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED);
 	CASE_RETURN_STRING(WNI_CFG_IBSS_ATIM_WIN_SIZE);
 	CASE_RETURN_STRING(WNI_CFG_PS_WOW_DATA_INACTIVITY_TIMEOUT);

+ 0 - 7
core/mac/src/cfg/cfg_proc_msg.c

@@ -83,9 +83,6 @@ cgstatic cfg_static[CFG_PARAM_MAX_NUM] = {
 	WNI_CFG_IBSS_AUTO_BSSID_STAMIN,
 	WNI_CFG_IBSS_AUTO_BSSID_STAMAX,
 	WNI_CFG_IBSS_AUTO_BSSID_STADEF},
-	{WNI_CFG_WPS_UUID,
-	CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_NTF_LIM,
-	0, 0, 0},
 	{WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED,
 	CFG_CTL_VALID | CFG_CTL_RE | CFG_CTL_WE | CFG_CTL_INT,
 	WNI_CFG_ENABLE_MCC_ADAPTIVE_SCHED_STAMIN,
@@ -144,10 +141,6 @@ cfgstatic_string cfg_static_string[CFG_MAX_STATIC_STRING] = {
 	 0x8c, 0x0, 0x90, 0x0, 0x95, 0x1, 0x97, 0x1, 0x99, 0x1, 0x9b, 0x1, 0x9d,
 	 0x1, 0x9f, 0x1, 0xa1, 0x1, 0xa5, 0x1, 0xf0, 0x1, 0xf2, 0x1, 0xf4, 0x1,
 	 0xf6, 0x1, 0xf8, 0x1, 0xfa, 0x1, 0xfc, 0x1} },
-	{WNI_CFG_WPS_UUID,
-	WNI_CFG_WPS_UUID_LEN,
-	6,
-	{0xa, 0xb, 0xc, 0xd, 0xe, 0xf} },
 };
 
 /*--------------------------------------------------------------------*/

+ 5 - 7
core/mac/src/sys/legacy/src/utils/src/parser_api.c

@@ -5315,14 +5315,12 @@ QDF_STATUS populate_dot11f_wsc_in_probe_res(struct mac_context *mac,
 		pDot11f->ResponseType.resType = RESP_TYPE_AP;
 	}
 
-	/* UUID is a 16 byte long binary. Still use wlan_cfg_get_str to get it. */
+	/* UUID is a 16 byte long binary*/
 	pDot11f->UUID_E.present = 1;
-	cfgStrLen = WNI_CFG_WPS_UUID_LEN;
-	if (wlan_cfg_get_str(mac,
-			     WNI_CFG_WPS_UUID,
-			     pDot11f->UUID_E.uuid, &cfgStrLen) != QDF_STATUS_SUCCESS) {
-		*(pDot11f->UUID_E.uuid) = '\0';
-	}
+	*pDot11f->UUID_E.uuid = '\0';
+
+	wlan_mlme_get_wps_uuid(&mac->mlme_cfg->wps_params,
+			       pDot11f->UUID_E.uuid);
 
 	pDot11f->Manufacturer.present = 1;
 	cfgStrLen = sizeof(pDot11f->Manufacturer.name);