Ver Fonte

qcacld-3.0: Add connection check before dhcp protection

Add connection check in set_power_mgmt() before enabling dhcp
protection since set_power_mgmt() can be called in disconnected
state as well for enabling power save.

Change-Id: I4b1796ba45ebf0561f4b58b066bfa63c0ca697ea
CRs-Fixed: 2690325
Alan Chen há 4 anos atrás
pai
commit
d72007751c
1 ficheiros alterados com 9 adições e 2 exclusões
  1. 9 2
      core/hdd/src/wlan_hdd_power.c

+ 9 - 2
core/hdd/src/wlan_hdd_power.c

@@ -2137,8 +2137,15 @@ static int __wlan_hdd_cfg80211_set_power_mgmt(struct wiphy *wiphy,
 
 	status = wlan_hdd_set_powersave(adapter, allow_power_save, timeout);
 
-	allow_power_save ? hdd_stop_dhcp_ind(adapter) :
-		hdd_start_dhcp_ind(adapter);
+	if (hdd_adapter_is_connected_sta(adapter)) {
+		hdd_debug("vdev mode %d enable dhcp protection",
+			  adapter->device_mode);
+		allow_power_save ? hdd_stop_dhcp_ind(adapter) :
+			hdd_start_dhcp_ind(adapter);
+	} else {
+		hdd_debug("vdev mod %d disconnected ignore dhcp protection",
+			  adapter->device_mode);
+	}
 
 	hdd_exit();
 	return status;