2012-11-07 11:53:04

by Antonio Quartulli

[permalink] [raw]
Subject: [PATCH 1/2] cfg80211: store the ssid into wirless_dev in AP mode

Store the configured ssid in wdev->ssid when starting an AP

Signed-off-by: Antonio Quartulli <[email protected]>
---
net/wireless/ap.c | 1 +
net/wireless/nl80211.c | 2 ++
2 files changed, 3 insertions(+)

diff --git a/net/wireless/ap.c b/net/wireless/ap.c
index e143505..324e8d8 100644
--- a/net/wireless/ap.c
+++ b/net/wireless/ap.c
@@ -28,6 +28,7 @@ static int __cfg80211_stop_ap(struct cfg80211_registered_device *rdev,
if (!err) {
wdev->beacon_interval = 0;
wdev->channel = NULL;
+ wdev->ssid_len = 0;
}

return err;
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index ba44f98..e521ca0 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -2649,6 +2649,8 @@ static int nl80211_start_ap(struct sk_buff *skb, struct genl_info *info)
wdev->preset_chantype = params.channel_type;
wdev->beacon_interval = params.beacon_interval;
wdev->channel = params.channel;
+ wdev->ssid_len = params.ssid_len;
+ memcpy(wdev->ssid, params.ssid, wdev->ssid_len);
}
return err;
}
--
1.8.0



2012-11-07 16:56:59

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH 1/2] cfg80211: store the ssid into wirless_dev in AP mode

On Wed, 2012-11-07 at 12:52 +0100, Antonio Quartulli wrote:
> Store the configured ssid in wdev->ssid when starting an AP

Applied both.

johannes


2012-11-07 11:53:05

by Antonio Quartulli

[permalink] [raw]
Subject: [PATCH 2/2] nl80211: send the NL80211_ATTR_SSID in nl80211_send_iface()

The userspace may want to know what is the current ssid that a given
interface is using. This patch enables nl80211 to send the
NL80211_ATTR_SSID attribute in nl80211_send_iface().

Signed-off-by: Antonio Quartulli <[email protected]>
---
net/wireless/nl80211.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
index e521ca0..c18b2fc 100644
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
@@ -1787,6 +1787,11 @@ static int nl80211_send_iface(struct sk_buff *msg, u32 portid, u32 seq, int flag
goto nla_put_failure;
}

+ if (wdev->ssid_len) {
+ if (nla_put(msg, NL80211_ATTR_SSID, wdev->ssid_len, wdev->ssid))
+ goto nla_put_failure;
+ }
+
return genlmsg_end(msg, hdr);

nla_put_failure:
--
1.8.0