From: Dedy Lansky <dlansky@codeaurora.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: Dedy Lansky <dlansky@codeaurora.org>,
linux-wireless@vger.kernel.org,
Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>
Subject: [PATCH v2 2/2] cfg80211: add support for connecting to PBSS network type
Date: Sun, 8 Feb 2015 15:52:04 +0200 [thread overview]
Message-ID: <1423403524-22540-3-git-send-email-dlansky@codeaurora.org> (raw)
In-Reply-To: <1423403524-22540-1-git-send-email-dlansky@codeaurora.org>
sme.c assumes BSS is of ESS type. With 802.11ad and the new PBSS network
type, this is not always true.
On DMG (60GHz) band, P2P connection uses PBSS network. Detect P2P
connection for DMG band and adjust BSS type to PBSS.
When connect starts (cfg80211_connect), store the bss type in new field in wdev
(conn_bss_type). This field is used later (e.g. in __cfg80211_connect_result)
when calling cfg80211_get_bss() for finding the BSS we are connecting to.
Signed-off-by: Dedy Lansky <dlansky@codeaurora.org>
---
include/net/cfg80211.h | 2 ++
net/wireless/sme.c | 12 +++++++++---
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index acf8f09..da346b1 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -3426,6 +3426,7 @@ struct cfg80211_cached_keys;
* registered for unexpected class 3 frames (AP mode)
* @conn: (private) cfg80211 software SME connection state machine data
* @connect_keys: (private) keys to set after connection is established
+ * @conn_bss_type: connecting/connected BSS type
* @ibss_fixed: (private) IBSS is using fixed BSSID
* @ibss_dfs_possible: (private) IBSS may change to a DFS channel
* @event_list: (private) list for internal event processing
@@ -3456,6 +3457,7 @@ struct wireless_dev {
u8 ssid_len, mesh_id_len, mesh_id_up_len;
struct cfg80211_conn *conn;
struct cfg80211_cached_keys *connect_keys;
+ enum ieee80211_bss_type conn_bss_type;
struct list_head event_list;
spinlock_t event_lock;
diff --git a/net/wireless/sme.c b/net/wireless/sme.c
index ea1da66..bf79bf2 100644
--- a/net/wireless/sme.c
+++ b/net/wireless/sme.c
@@ -264,7 +264,7 @@ static struct cfg80211_bss *cfg80211_get_conn_bss(struct wireless_dev *wdev)
wdev->conn->params.bssid,
wdev->conn->params.ssid,
wdev->conn->params.ssid_len,
- IEEE80211_BSS_TYPE_ESS,
+ wdev->conn_bss_type,
IEEE80211_PRIVACY(wdev->conn->params.privacy));
if (!bss)
return NULL;
@@ -633,7 +633,7 @@ void __cfg80211_connect_result(struct net_device *dev, const u8 *bssid,
WARN_ON_ONCE(!wiphy_to_rdev(wdev->wiphy)->ops->connect);
bss = cfg80211_get_bss(wdev->wiphy, NULL, bssid,
wdev->ssid, wdev->ssid_len,
- IEEE80211_BSS_TYPE_ESS,
+ wdev->conn_bss_type,
IEEE80211_PRIVACY_ANY);
if (bss)
cfg80211_hold_bss(bss_from_pub(bss));
@@ -792,7 +792,7 @@ void cfg80211_roamed(struct net_device *dev,
bss = cfg80211_get_bss(wdev->wiphy, channel, bssid, wdev->ssid,
wdev->ssid_len,
- IEEE80211_BSS_TYPE_ESS, IEEE80211_PRIVACY_ANY);
+ wdev->conn_bss_type, IEEE80211_PRIVACY_ANY);
if (WARN_ON(!bss))
return;
@@ -961,6 +961,12 @@ int cfg80211_connect(struct cfg80211_registered_device *rdev,
memcpy(wdev->ssid, connect->ssid, connect->ssid_len);
wdev->ssid_len = connect->ssid_len;
+ wdev->conn_bss_type = IEEE80211_BSS_TYPE_ESS;
+ if (connect->channel &&
+ connect->channel->band == IEEE80211_BAND_60GHZ &&
+ wdev->iftype == NL80211_IFTYPE_P2P_CLIENT)
+ wdev->conn_bss_type = IEEE80211_BSS_TYPE_PBSS;
+
if (!rdev->ops->connect)
err = cfg80211_sme_connect(wdev, connect, prev_bssid);
else
--
1.9.1
next prev parent reply other threads:[~2015-02-08 13:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-08 13:52 [PATCH v2 0/2] cfg80211: PBSS Basic Support Dedy Lansky
2015-02-08 13:52 ` [PATCH v2 1/2] cfg80211: add bss_type and privacy arguments in cfg80211_get_bss() Dedy Lansky
2015-03-03 9:08 ` Johannes Berg
2015-02-08 13:52 ` Dedy Lansky [this message]
2015-03-03 9:13 ` [PATCH v2 2/2] cfg80211: add support for connecting to PBSS network type Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1423403524-22540-3-git-send-email-dlansky@codeaurora.org \
--to=dlansky@codeaurora.org \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=qca_vkondrat@qca.qualcomm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).