瀏覽代碼

qcacld-3.0: notify reg change event once wifi on from GUI

Add regulatory notify event when wifi ON by GUI.
In new framework test, When turning on Wi-Fi, it is
expecting driver to indicate NL80211_CMD_[WIPHY]_ REG_CHANGE
event with country code to wificond.

Change-Id: Icb0bdec097db14905de6234573d05fffbe0e4500
CRs-Fixed: 3186188
Liangwei Dong 2 年之前
父節點
當前提交
010e18b838
共有 1 個文件被更改,包括 33 次插入0 次删除
  1. 33 0
      core/hdd/src/wlan_hdd_main.c

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

@@ -17785,6 +17785,36 @@ static void hdd_inform_wifi_off(void)
 	osif_psoc_sync_op_stop(psoc_sync);
 }
 
+#if defined CFG80211_USER_HINT_CELL_BASE_SELF_MANAGED || \
+	(LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0))
+static void hdd_inform_wifi_on(void)
+{
+	int ret;
+	struct hdd_context *hdd_ctx = cds_get_context(QDF_MODULE_ID_HDD);
+	struct osif_psoc_sync *psoc_sync;
+
+	hdd_nofl_debug("inform regdomain for wifi on");
+	ret = wlan_hdd_validate_context(hdd_ctx);
+	if (ret)
+		return;
+	if (!wlan_hdd_validate_modules_state(hdd_ctx))
+		return;
+	if (!hdd_ctx->wiphy)
+		return;
+	ret = osif_psoc_sync_op_start(wiphy_dev(hdd_ctx->wiphy), &psoc_sync);
+	if (ret)
+		return;
+	if (hdd_ctx->wiphy->registered)
+		hdd_send_wiphy_regd_sync_event(hdd_ctx);
+
+	osif_psoc_sync_op_stop(psoc_sync);
+}
+#else
+static void hdd_inform_wifi_on(void)
+{
+}
+#endif
+
 static int hdd_validate_wlan_string(const char __user *user_buf)
 {
 	char buf[15];
@@ -18014,6 +18044,9 @@ static ssize_t wlan_hdd_state_ctrl_param_write(struct file *filp,
 		}
 		hdd_ctx->is_wlan_disabled = false;
 	}
+
+	if (id == WLAN_ON_STR)
+		hdd_inform_wifi_on();
 exit:
 	hdd_exit();
 	return count;