summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/wil6210/p2p.c
diff options
context:
space:
mode:
authorLior David <qca_liord@qca.qualcomm.com>2016-03-01 19:18:13 +0200
committerKalle Valo <kvalo@qca.qualcomm.com>2016-03-07 11:43:20 +0200
commit4332cac17b5c0cb80d8b99fda33a0faad3238b0e (patch)
tree15e1bccbb368f770b360b4a1653c811a1dca65a2 /drivers/net/wireless/ath/wil6210/p2p.c
parente6d68341e7286386451adf14cebb635a52b0effe (diff)
downloadtalos-obmc-linux-4332cac17b5c0cb80d8b99fda33a0faad3238b0e.tar.gz
talos-obmc-linux-4332cac17b5c0cb80d8b99fda33a0faad3238b0e.zip
wil6210: P2P_DEVICE virtual interface support
Added support for the P2P_DEVICE virtual interface. This interface is intended for P2P management operations such as discovery and GO negotiation. Normally it is implemented by drivers to allow a separate interface for P2P management with its own MAC address, but for 11ad drivers it is needed to support P2P search, since it cannot otherwise be separated from normal scan. Since we only support a single interface/MAC address, we can't easily separate between primary and P2P_DEVICE interfaces. For example when a management packet arrives we can't tell for which interface it is intended. To work around this, we store a pointer to the interface where the last "radio operation" was triggered such as scan or remain on channel, and we forward management packets and scan results to this interface. Signed-off-by: Lior David <qca_liord@qca.qualcomm.com> Signed-off-by: Maya Erez <qca_merez@qca.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/wil6210/p2p.c')
-rw-r--r--drivers/net/wireless/ath/wil6210/p2p.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/drivers/net/wireless/ath/wil6210/p2p.c b/drivers/net/wireless/ath/wil6210/p2p.c
index 974bf84dbf52..d223648076a0 100644
--- a/drivers/net/wireless/ath/wil6210/p2p.c
+++ b/drivers/net/wireless/ath/wil6210/p2p.c
@@ -22,13 +22,6 @@
#define P2P_SEARCH_DURATION_MS 500
#define P2P_DEFAULT_BI 100
-int wil_scan_is_p2p_search(struct wil6210_priv *wil,
- struct cfg80211_scan_request *request)
-{
- /* need P2P_DEVICE changes to make this work */
- return 0;
-}
-
void wil_p2p_discovery_timer_fn(ulong x)
{
struct wil6210_priv *wil = (void *)x;
@@ -183,10 +176,14 @@ void wil_p2p_cancel_listen(struct wil6210_priv *wil, u64 cookie)
__func__, p2p->cookie, cookie);
wil_p2p_stop_discovery(wil);
- cfg80211_remain_on_channel_expired(wil->wdev,
+
+ mutex_lock(&wil->p2p_wdev_mutex);
+ cfg80211_remain_on_channel_expired(wil->radio_wdev,
p2p->cookie,
&p2p->listen_chan,
GFP_KERNEL);
+ wil->radio_wdev = wil->wdev;
+ mutex_unlock(&wil->p2p_wdev_mutex);
}
void wil_p2p_listen_expired(struct work_struct *work)
@@ -199,10 +196,15 @@ void wil_p2p_listen_expired(struct work_struct *work)
wil_dbg_misc(wil, "%s()\n", __func__);
wil_p2p_stop_discovery(wil);
- cfg80211_remain_on_channel_expired(wil->wdev,
+
+ mutex_lock(&wil->p2p_wdev_mutex);
+ cfg80211_remain_on_channel_expired(wil->radio_wdev,
p2p->cookie,
&p2p->listen_chan,
GFP_KERNEL);
+ wil->radio_wdev = wil->wdev;
+ mutex_unlock(&wil->p2p_wdev_mutex);
+
}
void wil_p2p_search_expired(struct work_struct *work)
@@ -215,6 +217,10 @@ void wil_p2p_search_expired(struct work_struct *work)
wil_dbg_misc(wil, "%s()\n", __func__);
wil_p2p_stop_discovery(wil);
+
+ mutex_lock(&wil->p2p_wdev_mutex);
cfg80211_scan_done(wil->scan_request, 0);
wil->scan_request = NULL;
+ wil->radio_wdev = wil->wdev;
+ mutex_unlock(&wil->p2p_wdev_mutex);
}
OpenPOWER on IntegriCloud