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

Commit 4858c569 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "wil6210: abort P2P search when stopping P2P device"

parents 083b9646 faa6bfc0
Loading
Loading
Loading
Loading
+16 −0
Original line number Original line Diff line number Diff line
@@ -377,6 +377,10 @@ static int wil_cfg80211_scan(struct wiphy *wiphy,
	/* social scan on P2P_DEVICE is handled as p2p search */
	/* social scan on P2P_DEVICE is handled as p2p search */
	if (wdev->iftype == NL80211_IFTYPE_P2P_DEVICE &&
	if (wdev->iftype == NL80211_IFTYPE_P2P_DEVICE &&
	    wil_p2p_is_social_scan(request)) {
	    wil_p2p_is_social_scan(request)) {
		if (!wil->p2p.p2p_dev_started) {
			wil_err(wil, "P2P search requested on stopped P2P device\n");
			return -EIO;
		}
		wil->scan_request = request;
		wil->scan_request = request;
		wil->radio_wdev = wdev;
		wil->radio_wdev = wdev;
		rc = wil_p2p_search(wil, request);
		rc = wil_p2p_search(wil, request);
@@ -1350,6 +1354,7 @@ static int wil_cfg80211_start_p2p_device(struct wiphy *wiphy,
	struct wil6210_priv *wil = wiphy_to_wil(wiphy);
	struct wil6210_priv *wil = wiphy_to_wil(wiphy);


	wil_dbg_misc(wil, "%s: entered\n", __func__);
	wil_dbg_misc(wil, "%s: entered\n", __func__);
	wil->p2p.p2p_dev_started = 1;
	return 0;
	return 0;
}
}


@@ -1357,8 +1362,19 @@ static void wil_cfg80211_stop_p2p_device(struct wiphy *wiphy,
					 struct wireless_dev *wdev)
					 struct wireless_dev *wdev)
{
{
	struct wil6210_priv *wil = wiphy_to_wil(wiphy);
	struct wil6210_priv *wil = wiphy_to_wil(wiphy);
	u8 started;


	wil_dbg_misc(wil, "%s: entered\n", __func__);
	wil_dbg_misc(wil, "%s: entered\n", __func__);
	mutex_lock(&wil->mutex);
	started = wil_p2p_stop_discovery(wil);
	if (started && wil->scan_request) {
		cfg80211_scan_done(wil->scan_request, 1);
		wil->scan_request = NULL;
		wil->radio_wdev = wil->wdev;
	}
	mutex_unlock(&wil->mutex);

	wil->p2p.p2p_dev_started = 0;
}
}


static struct cfg80211_ops wil_cfg80211_ops = {
static struct cfg80211_ops wil_cfg80211_ops = {
+1 −0
Original line number Original line Diff line number Diff line
@@ -458,6 +458,7 @@ struct wil_tid_crypto_rx {
struct wil_p2p_info {
struct wil_p2p_info {
	struct ieee80211_channel listen_chan;
	struct ieee80211_channel listen_chan;
	u8 discovery_started;
	u8 discovery_started;
	u8 p2p_dev_started;
	u64 cookie;
	u64 cookie;
	struct timer_list discovery_timer; /* listen/search duration */
	struct timer_list discovery_timer; /* listen/search duration */
	struct work_struct discovery_expired_work; /* listen/search expire */
	struct work_struct discovery_expired_work; /* listen/search expire */