Преглед на файлове

qcacld-3.0: Return EBUSY instead of EINVAL in SSR case

In the SAP + p2g go SSR case, wpa_supplicant
will receive INTERFACE_UNAVAILABLE while driver
is doing SSR, then it will triger wpa_supplicant
to remove the p2p go from the interface and
change the mode from NL80211_IFTYPE_P2P_GO to
NL80211_IFTYPE_STATION. But it has the possibility
that switch mode failure due to qdf_is_recovering
is true from __dsc_vdev_can_trans, then
wpa_supplicant will get error code -EINVAL from
wlan_hdd_cfg80211_change_iface.
But current wpa_supplicant just only support
mode switch retry in the EBUSY case, so change the
return value from EINVAL to EBUSY if driver is
in recovery state to let wpa_supplicant has the
chance to do mode switch retry in the SSR case.

Change-Id: Id0f959a1e8386061d0258f520dba17e9efae1d08
CRs-Fixed: 2929212
Chaoli Zhou преди 3 години
родител
ревизия
c4e53f966a
променени са 1 файла, в които са добавени 13 реда и са изтрити 1 реда
  1. 13 1
      core/hdd/src/wlan_hdd_cfg80211.c

+ 13 - 1
core/hdd/src/wlan_hdd_cfg80211.c

@@ -18557,7 +18557,7 @@ static int _wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy,
 
 	errno = osif_vdev_sync_trans_start(net_dev, &vdev_sync);
 	if (errno)
-		return errno;
+		goto err;
 
 	errno = __wlan_hdd_cfg80211_change_iface(wiphy, net_dev, type,
 						 flags, params);
@@ -18565,6 +18565,18 @@ static int _wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy,
 	osif_vdev_sync_trans_stop(vdev_sync);
 
 	return errno;
+err:
+	/* In the SSR case, errno will be -EINVAL from
+	 * __dsc_vdev_can_trans with qdf_is_recovering()
+	 * is true, only change -EINVAL to -EBUSY to make
+	 * wpa_supplicant has chance to retry mode switch.
+	 * Meanwhile do not touch the errno from
+	 * __wlan_hdd_cfg80211_change_iface with this
+	 * change.
+	 */
+	if (errno && errno != -EAGAIN && errno != -EBUSY)
+		errno = -EBUSY;
+	return errno;
 }
 
 #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 12, 0)