Explorar o código

qcacld-3.0: Iterate all link for invalid STA channel discon

Iterate through all the active links in STA adapter to check
if the VDEV is on invalid channel. If it is on invalid channel,
disconnect the STA.

Change-Id: Iabaadb116861e40e79fa04398854bed7dc4e029e
CRs-Fixed: 3522506
Vinod Kumar Pirla %!s(int64=2) %!d(string=hai) anos
pai
achega
86ae5134b7
Modificáronse 1 ficheiros con 15 adicións e 14 borrados
  1. 15 14
      core/hdd/src/wlan_hdd_hostapd.c

+ 15 - 14
core/hdd/src/wlan_hdd_hostapd.c

@@ -5622,28 +5622,29 @@ hdd_check_and_disconnect_sta_on_invalid_channel(struct hdd_context *hdd_ctx,
 {
 	struct hdd_adapter *sta_adapter;
 	uint32_t sta_chan_freq;
+	struct wlan_hdd_link_info *link_info;
+
+	sta_adapter = hdd_get_adapter(hdd_ctx, QDF_STA_MODE);
 
-	sta_chan_freq = hdd_get_operating_chan_freq(hdd_ctx, QDF_STA_MODE);
-	if (!sta_chan_freq) {
-		hdd_err("STA not connected");
+	if (!sta_adapter) {
+		hdd_err("STA adapter does not exist");
 		return;
 	}
 
-	hdd_err("STA connected on %d", sta_chan_freq);
+	hdd_adapter_for_each_active_link_info(sta_adapter, link_info) {
+		sta_chan_freq = hdd_get_link_info_home_channel(link_info);
+		if (!sta_chan_freq)
+			continue;
 
-	if (sme_is_channel_valid(hdd_ctx->mac_handle, sta_chan_freq)) {
-		hdd_err("STA connected on %d and it is valid", sta_chan_freq);
-		return;
-	}
+		hdd_err("VDEV-%d STA connected on %d",
+			link_info->vdev_id, sta_chan_freq);
 
-	sta_adapter = hdd_get_adapter(hdd_ctx, QDF_STA_MODE);
+		if (sme_is_channel_valid(hdd_ctx->mac_handle, sta_chan_freq))
+			continue;
 
-	if (!sta_adapter) {
-		hdd_err("STA adapter does not exist");
-		return;
+		hdd_err("chan %d not valid, issue disconnect", sta_chan_freq);
+		wlan_hdd_cm_issue_disconnect(link_info, reason, false);
 	}
-	hdd_err("chan %d not valid, issue disconnect", sta_chan_freq);
-	wlan_hdd_cm_issue_disconnect(sta_adapter->deflink, reason, false);
 }
 
 /**