* [PATCH] mac80211: Allow scan to be requested in AP mode
@ 2009-04-16 15:44 Jouni Malinen
2009-04-16 15:51 ` Johannes Berg
0 siblings, 1 reply; 4+ messages in thread
From: Jouni Malinen @ 2009-04-16 15:44 UTC (permalink / raw)
To: John W. Linville, Johannes Berg; +Cc: linux-wireless
We can allow scan requests in AP mode as long as the interface has not
yet been configured to send out Beacon frames (or if beaconing has
been disabled prior to the scan request). This makes it easier to scan
for neighboring BSSes during AP initialization and makes it possible
to run a scan without setting the interface down, if needed. Without
this change, the only available option would be to set the interface
down, move into station mode, and set the interface up, prior to
requesting the scan.
Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
---
net/mac80211/cfg.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- uml.orig/net/mac80211/cfg.c 2009-04-16 18:20:19.000000000 +0300
+++ uml/net/mac80211/cfg.c 2009-04-16 18:33:44.000000000 +0300
@@ -1167,7 +1167,8 @@ static int ieee80211_scan(struct wiphy *
if (sdata->vif.type != NL80211_IFTYPE_STATION &&
sdata->vif.type != NL80211_IFTYPE_ADHOC &&
- sdata->vif.type != NL80211_IFTYPE_MESH_POINT)
+ sdata->vif.type != NL80211_IFTYPE_MESH_POINT &&
+ (sdata->vif.type != NL80211_IFTYPE_AP || sdata->u.ap.beacon))
return -EOPNOTSUPP;
return ieee80211_request_scan(sdata, req);
--
Jouni Malinen PGP id EFC895FA
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mac80211: Allow scan to be requested in AP mode
2009-04-16 15:44 [PATCH] mac80211: Allow scan to be requested in AP mode Jouni Malinen
@ 2009-04-16 15:51 ` Johannes Berg
2009-04-16 16:00 ` Jouni Malinen
0 siblings, 1 reply; 4+ messages in thread
From: Johannes Berg @ 2009-04-16 15:51 UTC (permalink / raw)
To: Jouni Malinen; +Cc: John W. Linville, linux-wireless
[-- Attachment #1: Type: text/plain, Size: 1440 bytes --]
On Thu, 2009-04-16 at 18:44 +0300, Jouni Malinen wrote:
> We can allow scan requests in AP mode as long as the interface has not
> yet been configured to send out Beacon frames (or if beaconing has
> been disabled prior to the scan request). This makes it easier to scan
> for neighboring BSSes during AP initialization and makes it possible
> to run a scan without setting the interface down, if needed. Without
> this change, the only available option would be to set the interface
> down, move into station mode, and set the interface up, prior to
> requesting the scan.
>
> Signed-off-by: Jouni Malinen <jouni.malinen@atheros.com>
>
> ---
> net/mac80211/cfg.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> --- uml.orig/net/mac80211/cfg.c 2009-04-16 18:20:19.000000000 +0300
> +++ uml/net/mac80211/cfg.c 2009-04-16 18:33:44.000000000 +0300
> @@ -1167,7 +1167,8 @@ static int ieee80211_scan(struct wiphy *
>
> if (sdata->vif.type != NL80211_IFTYPE_STATION &&
> sdata->vif.type != NL80211_IFTYPE_ADHOC &&
> - sdata->vif.type != NL80211_IFTYPE_MESH_POINT)
> + sdata->vif.type != NL80211_IFTYPE_MESH_POINT &&
> + (sdata->vif.type != NL80211_IFTYPE_AP || sdata->u.ap.beacon))
> return -EOPNOTSUPP;
Should this return a different error code for AP then? Maybe -EBUSY for
AP && beacon? Then again, EBUSY is already returned for "already
scanning". hmm.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mac80211: Allow scan to be requested in AP mode
2009-04-16 15:51 ` Johannes Berg
@ 2009-04-16 16:00 ` Jouni Malinen
2009-04-16 16:03 ` Johannes Berg
0 siblings, 1 reply; 4+ messages in thread
From: Jouni Malinen @ 2009-04-16 16:00 UTC (permalink / raw)
To: Johannes Berg; +Cc: Jouni Malinen, John W. Linville, linux-wireless
On Thu, Apr 16, 2009 at 05:51:57PM +0200, Johannes Berg wrote:
> On Thu, 2009-04-16 at 18:44 +0300, Jouni Malinen wrote:
> > --- uml.orig/net/mac80211/cfg.c 2009-04-16 18:20:19.000000000 +0300
> > +++ uml/net/mac80211/cfg.c 2009-04-16 18:33:44.000000000 +0300
> > @@ -1167,7 +1167,8 @@ static int ieee80211_scan(struct wiphy *
> >
> > if (sdata->vif.type != NL80211_IFTYPE_STATION &&
> > sdata->vif.type != NL80211_IFTYPE_ADHOC &&
> > - sdata->vif.type != NL80211_IFTYPE_MESH_POINT)
> > + sdata->vif.type != NL80211_IFTYPE_MESH_POINT &&
> > + (sdata->vif.type != NL80211_IFTYPE_AP || sdata->u.ap.beacon))
> > return -EOPNOTSUPP;
>
> Should this return a different error code for AP then? Maybe -EBUSY for
> AP && beacon? Then again, EBUSY is already returned for "already
> scanning". hmm.
I thought about that for a moment, but did not come up with a good error
code.. ;-) EBUSY is not a good option here since that could be used by
applications to decide that they should try again (which would not help
here at all). If someone has a better one in mind, I would have no
problems changing this, but I don't see much problems with EOPNOTSUPP
either.
--
Jouni Malinen PGP id EFC895FA
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mac80211: Allow scan to be requested in AP mode
2009-04-16 16:00 ` Jouni Malinen
@ 2009-04-16 16:03 ` Johannes Berg
0 siblings, 0 replies; 4+ messages in thread
From: Johannes Berg @ 2009-04-16 16:03 UTC (permalink / raw)
To: Jouni Malinen; +Cc: Jouni Malinen, John W. Linville, linux-wireless
[-- Attachment #1: Type: text/plain, Size: 1346 bytes --]
On Thu, 2009-04-16 at 19:00 +0300, Jouni Malinen wrote:
> On Thu, Apr 16, 2009 at 05:51:57PM +0200, Johannes Berg wrote:
> > On Thu, 2009-04-16 at 18:44 +0300, Jouni Malinen wrote:
> > > --- uml.orig/net/mac80211/cfg.c 2009-04-16 18:20:19.000000000 +0300
> > > +++ uml/net/mac80211/cfg.c 2009-04-16 18:33:44.000000000 +0300
> > > @@ -1167,7 +1167,8 @@ static int ieee80211_scan(struct wiphy *
> > >
> > > if (sdata->vif.type != NL80211_IFTYPE_STATION &&
> > > sdata->vif.type != NL80211_IFTYPE_ADHOC &&
> > > - sdata->vif.type != NL80211_IFTYPE_MESH_POINT)
> > > + sdata->vif.type != NL80211_IFTYPE_MESH_POINT &&
> > > + (sdata->vif.type != NL80211_IFTYPE_AP || sdata->u.ap.beacon))
> > > return -EOPNOTSUPP;
> >
> > Should this return a different error code for AP then? Maybe -EBUSY for
> > AP && beacon? Then again, EBUSY is already returned for "already
> > scanning". hmm.
>
> I thought about that for a moment, but did not come up with a good error
> code.. ;-) EBUSY is not a good option here since that could be used by
> applications to decide that they should try again (which would not help
> here at all). If someone has a better one in mind, I would have no
> problems changing this, but I don't see much problems with EOPNOTSUPP
> either.
Ok. Good enough for me :)
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2009-04-16 16:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-16 15:44 [PATCH] mac80211: Allow scan to be requested in AP mode Jouni Malinen
2009-04-16 15:51 ` Johannes Berg
2009-04-16 16:00 ` Jouni Malinen
2009-04-16 16:03 ` Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox