浏览代码

qcacld-3.0: Don't disconnect if not in connected state

When the country changes, there is a check to see if the current phy
mode or freq or ch width is not allowed, in which case, disconnect
the adapter. However, this check can run even if the adapter is not
currently connected. Add an extra check to see if it is even connected
first, before checking if disconnection is necessary.

Change-Id: Ic4243fd85205e930e49d6f8f9f0e4399851e870a
CRs-Fixed: 3139370
Lincoln Tran 3 年之前
父节点
当前提交
b05fef2682
共有 1 个文件被更改,包括 7 次插入3 次删除
  1. 7 3
      core/hdd/src/wlan_hdd_regulatory.c

+ 7 - 3
core/hdd/src/wlan_hdd_regulatory.c

@@ -1614,10 +1614,14 @@ static void hdd_country_change_update_sta(struct hdd_context *hdd_ctx)
 								    adapter,
 								    oper_freq);
 
-			if (phy_changed || freq_changed || width_changed) {
+			if (hdd_is_vdev_in_conn_state(adapter) &&
+			    (phy_changed || freq_changed || width_changed)) {
+				hdd_debug("changed: phy %d, freq %d, width %d",
+					  phy_changed, freq_changed,
+					  width_changed);
 				wlan_hdd_cm_issue_disconnect(adapter,
-							 REASON_UNSPEC_FAILURE,
-							 false);
+							REASON_UNSPEC_FAILURE,
+							false);
 				sta_ctx->reg_phymode = csr_phy_mode;
 			}
 			break;