linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] wireless: display wext SSID when connected by cfg80211
@ 2009-08-05  2:05 Zhu Yi
  2009-08-05  5:19 ` Johannes Berg
  0 siblings, 1 reply; 5+ messages in thread
From: Zhu Yi @ 2009-08-05  2:05 UTC (permalink / raw)
  To: linville; +Cc: linux-wireless, Zhu Yi

cfg80211 displays correct link info when connected by wext. But if
the connection is setup by cfg80211, wext cannot display the SSID.
This patch fixed this issue.

Signed-off-by: Zhu Yi <yi.zhu@intel.com>
---
diff --git a/net/wireless/wext-sme.c b/net/wireless/wext-sme.c
index 7bacbd1..48c165b 100644
--- a/net/wireless/wext-sme.c
+++ b/net/wireless/wext-sme.c
@@ -210,6 +210,10 @@ int cfg80211_mgd_wext_giwessid(struct net_device *dev,
 		data->flags = 1;
 		data->length = wdev->wext.connect.ssid_len;
 		memcpy(ssid, wdev->wext.connect.ssid, data->length);
+	} else if (wdev->ssid && wdev->ssid_len) {
+		data->flags = 1;
+		data->length = wdev->ssid_len;
+		memcpy(ssid, wdev->ssid, data->length);
 	} else
 		data->flags = 0;
 	wdev_unlock(wdev);

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] wireless: display wext SSID when connected by cfg80211
  2009-08-05  2:05 [PATCH] wireless: display wext SSID when connected by cfg80211 Zhu Yi
@ 2009-08-05  5:19 ` Johannes Berg
  2009-08-05  5:27   ` Zhu Yi
  0 siblings, 1 reply; 5+ messages in thread
From: Johannes Berg @ 2009-08-05  5:19 UTC (permalink / raw)
  To: Zhu Yi; +Cc: linville, linux-wireless

[-- Attachment #1: Type: text/plain, Size: 1108 bytes --]

On Wed, 2009-08-05 at 10:05 +0800, Zhu Yi wrote:
> cfg80211 displays correct link info when connected by wext. But if
> the connection is setup by cfg80211, wext cannot display the SSID.
> This patch fixed this issue.
> 
> Signed-off-by: Zhu Yi <yi.zhu@intel.com>
> ---
> diff --git a/net/wireless/wext-sme.c b/net/wireless/wext-sme.c
> index 7bacbd1..48c165b 100644
> --- a/net/wireless/wext-sme.c
> +++ b/net/wireless/wext-sme.c
> @@ -210,6 +210,10 @@ int cfg80211_mgd_wext_giwessid(struct net_device *dev,
>  		data->flags = 1;
>  		data->length = wdev->wext.connect.ssid_len;
>  		memcpy(ssid, wdev->wext.connect.ssid, data->length);
> +	} else if (wdev->ssid && wdev->ssid_len) {
> +		data->flags = 1;
> +		data->length = wdev->ssid_len;
> +		memcpy(ssid, wdev->ssid, data->length);

Hmm. I suspect using wdev->current_bss would be less prone to breakage,
since we've had some trouble with wdev->ssid already, and current_bss
has to be present all the time for various nl80211 too. I guess
ultimately it doesn't matter that much since somebody will see the
problem.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] wireless: display wext SSID when connected by cfg80211
  2009-08-05  5:19 ` Johannes Berg
@ 2009-08-05  5:27   ` Zhu Yi
  2009-08-05  5:35     ` Johannes Berg
  0 siblings, 1 reply; 5+ messages in thread
From: Zhu Yi @ 2009-08-05  5:27 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linville, linux-wireless

On Wed, 2009-08-05 at 13:19 +0800, Johannes Berg wrote:
> On Wed, 2009-08-05 at 10:05 +0800, Zhu Yi wrote:
> > cfg80211 displays correct link info when connected by wext. But if
> > the connection is setup by cfg80211, wext cannot display the SSID.
> > This patch fixed this issue.
> > 
> > Signed-off-by: Zhu Yi <yi.zhu@intel.com>
> > ---
> > diff --git a/net/wireless/wext-sme.c b/net/wireless/wext-sme.c
> > index 7bacbd1..48c165b 100644
> > --- a/net/wireless/wext-sme.c
> > +++ b/net/wireless/wext-sme.c
> > @@ -210,6 +210,10 @@ int cfg80211_mgd_wext_giwessid(struct net_device *dev,
> >  		data->flags = 1;
> >  		data->length = wdev->wext.connect.ssid_len;
> >  		memcpy(ssid, wdev->wext.connect.ssid, data->length);
> > +	} else if (wdev->ssid && wdev->ssid_len) {
> > +		data->flags = 1;
> > +		data->length = wdev->ssid_len;
> > +		memcpy(ssid, wdev->ssid, data->length);
> 
> Hmm. I suspect using wdev->current_bss would be less prone to breakage,
> since we've had some trouble with wdev->ssid already, and current_bss
> has to be present all the time for various nl80211 too. I guess
> ultimately it doesn't matter that much since somebody will see the
> problem.

Yeah, I'm lazy to parse the current_bss.pub->information_elements for
SSID in the first instance. Should we implement some beacon parsing in
cfg80211 or move ieee802_11_parse_elems from mac80211?

Thanks,
-yi


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] wireless: display wext SSID when connected by cfg80211
  2009-08-05  5:27   ` Zhu Yi
@ 2009-08-05  5:35     ` Johannes Berg
  2009-08-05  5:39       ` Zhu Yi
  0 siblings, 1 reply; 5+ messages in thread
From: Johannes Berg @ 2009-08-05  5:35 UTC (permalink / raw)
  To: Zhu Yi; +Cc: linville, linux-wireless

[-- Attachment #1: Type: text/plain, Size: 584 bytes --]

On Wed, 2009-08-05 at 13:27 +0800, Zhu Yi wrote:

> Yeah, I'm lazy to parse the current_bss.pub->information_elements for
> SSID in the first instance. Should we implement some beacon parsing in
> cfg80211 or move ieee802_11_parse_elems from mac80211?

There's ieee80211_bss_get_ie() in cfg80211, which doesn't give you the
length/data in two separate values, but otherwise behaves pretty
similarly. IOW, something like

const u8 *ssid = ieee80211_bss_get_ie(bss /* or &bss->pub */, WLAN_EID_SSID);
if (ssid) {
	ssid_len = ssid[1];
	ssid_data = ssid + 2;
}

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] wireless: display wext SSID when connected by cfg80211
  2009-08-05  5:35     ` Johannes Berg
@ 2009-08-05  5:39       ` Zhu Yi
  0 siblings, 0 replies; 5+ messages in thread
From: Zhu Yi @ 2009-08-05  5:39 UTC (permalink / raw)
  To: Johannes Berg; +Cc: linville, linux-wireless

On Wed, 2009-08-05 at 13:35 +0800, Johannes Berg wrote:
> On Wed, 2009-08-05 at 13:27 +0800, Zhu Yi wrote:
> 
> > Yeah, I'm lazy to parse the current_bss.pub->information_elements for
> > SSID in the first instance. Should we implement some beacon parsing in
> > cfg80211 or move ieee802_11_parse_elems from mac80211?
> 
> There's ieee80211_bss_get_ie() in cfg80211, which doesn't give you the
> length/data in two separate values, but otherwise behaves pretty
> similarly. IOW, something like
> 
> const u8 *ssid = ieee80211_bss_get_ie(bss /* or &bss->pub */, WLAN_EID_SSID);
> if (ssid) {
> 	ssid_len = ssid[1];
> 	ssid_data = ssid + 2;
> }

Ah, I missed that. Will send out a patch.

Thanks,
-yi


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-08-05  5:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-05  2:05 [PATCH] wireless: display wext SSID when connected by cfg80211 Zhu Yi
2009-08-05  5:19 ` Johannes Berg
2009-08-05  5:27   ` Zhu Yi
2009-08-05  5:35     ` Johannes Berg
2009-08-05  5:39       ` Zhu Yi

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).