Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 300632cd authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "wil6210: do not reset FW in STA to P2P client interface switch"

parents 595756c9 dfe40273
Loading
Loading
Loading
Loading
+12 −1
Original line number Diff line number Diff line
@@ -917,6 +917,16 @@ static int wil_cfg80211_del_iface(struct wiphy *wiphy,
	return rc;
}

static bool wil_is_safe_switch(enum nl80211_iftype from,
			       enum nl80211_iftype to)
{
	if (from == NL80211_IFTYPE_STATION &&
	    to == NL80211_IFTYPE_P2P_CLIENT)
		return true;

	return false;
}

static int wil_cfg80211_change_iface(struct wiphy *wiphy,
				     struct net_device *ndev,
				     enum nl80211_iftype type,
@@ -942,7 +952,8 @@ static int wil_cfg80211_change_iface(struct wiphy *wiphy,
	 * because it can cause significant disruption
	 */
	if (!wil_has_other_active_ifaces(wil, ndev, true, false) &&
	    netif_running(ndev) && !wil_is_recovery_blocked(wil)) {
	    netif_running(ndev) && !wil_is_recovery_blocked(wil) &&
	    !wil_is_safe_switch(wdev->iftype, type)) {
		wil_dbg_misc(wil, "interface is up. resetting...\n");
		mutex_lock(&wil->mutex);
		__wil_down(wil);