Răsfoiți Sursa

qcacld-3.0: Add INI param to read MAC address from MAC cfg file

Currently, Driver reads MAC address from MAC cfg file if it is present.
Kernel has a timeout of 60secs and userspace tries to loop till the
file is read if it is during the boot. So this will result in dsc
transaction timeout if the MAC cfg file is not present in the device.

To avoid this, add INI parameter to read this MAC cfg file and enable
it only when the MAC cfg file is present in the device.

Change-Id: I0bd9c089b6077534a07cb68deb07feb6064a5b88
CRs-Fixed: 2877424
Bapiraju Alla 4 ani în urmă
părinte
comite
f94358e440

+ 21 - 0
core/hdd/inc/hdd_config.h

@@ -777,6 +777,26 @@ struct dhcp_server {
 	0, \
 	"enable/disable MAC address provisioning feature")
 
+/*
+ * </ini>
+ * read_mac_addr_from_mac_file - Use/ignore MAC address from mac cfg file
+ * @Min: 0
+ * @Max: 1
+ * @Default: 0
+ *
+ * This ini is used whether to configure MAC address from the cfg file or not
+ *
+ * Supported Feature: STA/SAP/P2P
+ *
+ * Usage: External
+ *
+ * </ini>
+ */
+#define CFG_READ_MAC_ADDR_FROM_MAC_FILE CFG_INI_BOOL( \
+	"read_mac_addr_from_mac_file", \
+	0, \
+	"Use/ignore MAC address from cfg file")
+
 /*
  * <ini>
  * provisioned_intf_pool - It is bit mask value of Interfaces
@@ -1814,6 +1834,7 @@ enum host_log_level {
 	CFG(CFG_NB_COMMANDS_RATE_LIMIT) \
 	CFG(CFG_HDD_DOT11_MODE) \
 	CFG(CFG_ENABLE_DISABLE_CHANNEL) \
+	CFG(CFG_READ_MAC_ADDR_FROM_MAC_FILE) \
 	CFG(CFG_SAR_CONVERSION) \
 	CFG(CFG_WOW_DISABLE) \
 	CFG(CFG_ENABLE_HOST_MODULE_LOG_LEVEL) \

+ 1 - 0
core/hdd/inc/wlan_hdd_cfg.h

@@ -267,6 +267,7 @@ struct hdd_config {
 	uint32_t sta_stats_cache_expiry_time;
 #endif
 	int icmp_req_to_fw_mark_interval;
+	bool read_mac_addr_from_mac_file;
 };
 
 /**

+ 5 - 0
core/hdd/src/wlan_hdd_cfg.c

@@ -203,6 +203,11 @@ QDF_STATUS hdd_update_mac_config(struct hdd_context *hdd_ctx)
 
 	QDF_STATUS qdf_status = QDF_STATUS_SUCCESS;
 
+	if (!hdd_ctx->config->read_mac_addr_from_mac_file) {
+		hdd_debug("Reading MAC address from MAC file is not enabled.");
+		return QDF_STATUS_E_FAILURE;
+	}
+
 	memset(mac_table, 0, sizeof(mac_table));
 	status = request_firmware(&fw, WLAN_MAC_FILE, hdd_ctx->parent_dev);
 	if (status) {

+ 2 - 0
core/hdd/src/wlan_hdd_main.c

@@ -12440,6 +12440,8 @@ static void hdd_cfg_params_init(struct hdd_context *hdd_ctx)
 	hdd_sar_cfg_update(config, psoc);
 	hdd_init_qmi_stats(config, psoc);
 	hdd_club_ll_stats_in_get_sta_cfg_update(config, psoc);
+	config->read_mac_addr_from_mac_file =
+			cfg_get(psoc, CFG_READ_MAC_ADDR_FROM_MAC_FILE);
 }
 
 struct hdd_context *hdd_context_create(struct device *dev)