2008-10-30 17:51:43

by Jouni Malinen

[permalink] [raw]
Subject: [PATCH] mac80211: Allow AP mode to be enabled

With the addition of basic rate set and TX queue parameter
configuration and confirmation that power save buffering is
working again, mac80211 is now in state that allows AP mode to be
used without major problems. Consequently, it is time to allow this
mode to be enabled without having to patch the kernel.

AP mode requires hostapd for management frame processing and as such,
configuring this mode is only allowed through cfg80211 (not with
iwconfig and WEXT).

Signed-off-by: Jouni Malinen <[email protected]>

Index: wireless-testing/net/mac80211/cfg.c
===================================================================
--- wireless-testing.orig/net/mac80211/cfg.c 2008-10-28 10:32:35.000000000 +0200
+++ wireless-testing/net/mac80211/cfg.c 2008-10-28 10:32:40.000000000 +0200
@@ -26,6 +26,8 @@
#ifdef CONFIG_MAC80211_MESH
case NL80211_IFTYPE_MESH_POINT:
#endif
+ case NL80211_IFTYPE_AP:
+ case NL80211_IFTYPE_AP_VLAN:
case NL80211_IFTYPE_WDS:
return true;
default:

--
Jouni Malinen PGP id EFC895FA


2008-10-30 17:54:14

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] mac80211: Allow AP mode to be enabled

On Thu, 2008-10-30 at 19:50 +0200, Jouni Malinen wrote:
> With the addition of basic rate set and TX queue parameter
> configuration and confirmation that power save buffering is
> working again, mac80211 is now in state that allows AP mode to be
> used without major problems. Consequently, it is time to allow this
> mode to be enabled without having to patch the kernel.
>
> AP mode requires hostapd for management frame processing and as such,
> configuring this mode is only allowed through cfg80211 (not with
> iwconfig and WEXT).

Good stuff. Finally :) Now we just need all drivers to support it too ;)

> Signed-off-by: Jouni Malinen <[email protected]>

Acked-by: Johannes Berg <[email protected]>

> Index: wireless-testing/net/mac80211/cfg.c
> ===================================================================
> --- wireless-testing.orig/net/mac80211/cfg.c 2008-10-28 10:32:35.000000000 +0200
> +++ wireless-testing/net/mac80211/cfg.c 2008-10-28 10:32:40.000000000 +0200
> @@ -26,6 +26,8 @@
> #ifdef CONFIG_MAC80211_MESH
> case NL80211_IFTYPE_MESH_POINT:
> #endif
> + case NL80211_IFTYPE_AP:
> + case NL80211_IFTYPE_AP_VLAN:
> case NL80211_IFTYPE_WDS:
> return true;
> default:
>


Attachments:
signature.asc (836.00 B)
This is a digitally signed message part

2008-11-01 14:54:21

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] mac80211: Allow AP mode to be enabled

On Sat, 2008-11-01 at 16:51 +0200, Kalle Valo wrote:
> Johannes Berg <[email protected]> writes:
>
> >> Thanks a lot, I updated to hostap commit 4aac554c and it works now
> >> with b43. I was able to associate with N810 and ping worked. Even PSM
> >> seems to work, but I haven't made any power consumption measurements
> >> yet.
> >
> > I'd be interested in power consumption measurements, but it should work
> > fine.
>
> I did some quick measurements with N810 and, like you mentioned,
> hostapd/mac80211/b43 combination seems to work just fine. Tried with
> DTIM 1 and 10 with beacon period of 100 ms and power consumption of
> N810 is just like what I was expecting.
>
> I have seen a lot of APs with buggy PSM implementation and this setup
> isn't one of them :)

:)

> > There might be a slight bug in b43 wrt. the beacon timestamp offset
> > though.
>
> If there's a bug in b43 I cannot see it from my measurements. Usually
> I have seen any problems with the TBTT right away.

Great, thanks for doing the measurements.

johannes


Attachments:
signature.asc (836.00 B)
This is a digitally signed message part

2008-11-01 11:31:56

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH] mac80211: Allow AP mode to be enabled

Terve Jouni,

Jouni Malinen <[email protected]> writes:

> With the addition of basic rate set and TX queue parameter
> configuration and confirmation that power save buffering is
> working again, mac80211 is now in state that allows AP mode to be
> used without major problems. Consequently, it is time to allow this
> mode to be enabled without having to patch the kernel.
>
> AP mode requires hostapd for management frame processing and as such,
> configuring this mode is only allowed through cfg80211 (not with
> iwconfig and WEXT).

I'm very happy to see this, I have been eagerly waiting for the
official AP support in mac80211.

I tried to test this with latest hostapd (commit b6a55236) and
wireless-testing (commit d80fe0040), but unfortunately I wasn't
succesful. Here's the output from hostapd with b43:

$ sudo ./hostapd -dd wlan1.conf
Configuration file: wlan1.conf
ctrl_interface_group=0
Opening raw packet socket for ifindex 0
BSS count 1, BSSID mask ff:ff:ff:ff:ff:ff (0 bits)
SIOCGIWRANGE: WE(compiled)=22 WE(source)=21 enc_capa=0xf
Failed to update rate sets in kernel module
RATE[0] rate=10 flags=0x2
RATE[1] rate=20 flags=0x6
RATE[2] rate=55 flags=0x6
RATE[3] rate=110 flags=0x6
RATE[4] rate=60 flags=0x0
RATE[5] rate=90 flags=0x0
RATE[6] rate=120 flags=0x0
RATE[7] rate=180 flags=0x0
RATE[8] rate=240 flags=0x0
RATE[9] rate=360 flags=0x0
RATE[10] rate=480 flags=0x0
RATE[11] rate=540 flags=0x0
Could not set passive scanning: Unknown error 4294967295
Flushing old station entries
Deauthenticate all stations
Mode: IEEE 802.11g Channel: 5 Frequency: 2432 MHz
Failed to set CTS protect in kernel driver
Failed to set Short Slot Time option in kernel driver
Could not set preamble for kernel driver
Using interface wlan1 with hwaddr 00:11:50:f4:c2:42 and ssid 'test'
ioctl[SIOCSIWESSID]: Operation not supported
len=4
Could not set SSID for kernel driver
wlan1: Unable to setup interface.
Flushing old station entries
Deauthenticate all stations

With ath5k I had to add BIT(NL80211_IFTYPE_AP) to
wiphy->interface_modes and the output is similar:

$ sudo ./hostapd -dd wlan1.conf
Configuration file: wlan1.conf
ctrl_interface_group=0
Opening raw packet socket for ifindex 0
BSS count 1, BSSID mask ff:ff:ff:ff:ff:ff (0 bits)
SIOCGIWRANGE: WE(compiled)=22 WE(source)=21 enc_capa=0xf
Failed to update rate sets in kernel module
RATE[0] rate=10 flags=0x2
RATE[1] rate=20 flags=0x6
RATE[2] rate=55 flags=0x6
RATE[3] rate=110 flags=0x6
RATE[4] rate=60 flags=0x0
RATE[5] rate=90 flags=0x0
RATE[6] rate=120 flags=0x0
RATE[7] rate=180 flags=0x0
RATE[8] rate=240 flags=0x0
RATE[9] rate=360 flags=0x0
RATE[10] rate=480 flags=0x0
RATE[11] rate=540 flags=0x0
Could not set passive scanning: Unknown error 4294967295
Flushing old station entries
Deauthenticate all stations
Mode: IEEE 802.11g Channel: 5 Frequency: 2432 MHz
Failed to set CTS protect in kernel driver
Failed to set Short Slot Time option in kernel driver
Could not set preamble for kernel driver
Using interface wlan1 with hwaddr 00:0f:3d:a9:7d:82 and ssid 'test'
ioctl[SIOCSIWESSID]: Operation not supported
len=4
Could not set SSID for kernel driver
wlan1: Unable to setup interface.
Flushing old station entries
Deauthenticate all stations
rmdir[ctrl_interface]: No such file or directory

Especially I'm worried about "SIOCSIWESSID: operation not supported"
messages. I'm sure I'm just doing something wrong, but what?

I tested this on Lenovo X60s laptop running debian unstable in 32 bit
environment. These are the changes between hostapd.conf and my
wlan1.conf:

--- hostapd.conf 2008-10-20 09:58:10.000000000 +0300
+++ wlan1.conf 2008-11-01 13:17:52.000000000 +0200
@@ -3,7 +3,7 @@

# AP netdevice name (without 'ap' postfix, i.e., wlan0 uses wlan0ap for
# management frames); ath0 for madwifi
-interface=wlan0
+interface=wlan1

# In case of madwifi and nl80211 driver interfaces, an additional configuration
# parameter, bridge, must be used to notify hostapd if the interface is
@@ -14,7 +14,7 @@
# default: hostap)
# Use driver=none if building hostapd as a standalone RADIUS server that does
# not control any wireless/wired driver.
-# driver=hostap
+driver=nl80211

# hostapd event logger configuration
#
@@ -105,14 +105,14 @@

# Operation mode (a = IEEE 802.11a, b = IEEE 802.11b, g = IEEE 802.11g,
# Default: IEEE 802.11b
-hw_mode=a
+hw_mode=g

# Channel number (IEEE 802.11)
# (default: 0, i.e., not set)
# Please note that some drivers (e.g., madwifi) do not use this value from
# hostapd and the channel will need to be configuration separately with
# iwconfig.
-channel=60
+channel=5

# Beacon interval in kus (1.024 ms) (default: 100; range 15..65535)
beacon_int=100


--
Kalle Valo


2008-11-01 14:32:41

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] mac80211: Allow AP mode to be enabled

On Sat, 2008-11-01 at 16:23 +0200, Kalle Valo wrote:
> Jouni Malinen <[email protected]> writes:
>
> > On Sat, Nov 01, 2008 at 01:31:30PM +0200, Kalle Valo wrote:
> >
> >> I tried to test this with latest hostapd (commit b6a55236) and
> >> wireless-testing (commit d80fe0040), but unfortunately I wasn't
> >> succesful. Here's the output from hostapd with b43:
> >
> >> ioctl[SIOCSIWESSID]: Operation not supported
> >> len=4
> >> Could not set SSID for kernel driver
> >
> > Thanks for reporting this. I fixed it now in hostap.git. Johannes
> > removed SSID configuration from AP mode and I was just waiting for this
> > to hit wireless-testing before committing the change into hostapd.
>
> Thanks a lot, I updated to hostap commit 4aac554c and it works now
> with b43. I was able to associate with N810 and ping worked. Even PSM
> seems to work, but I haven't made any power consumption measurements
> yet.

I'd be interested in power consumption measurements, but it should work
fine. There might be a slight bug in b43 wrt. the beacon timestamp
offset though.

> I'm very happy now, thank you Johannes and Jouni! :D

:)

johannes


Attachments:
signature.asc (836.00 B)
This is a digitally signed message part

2008-11-01 14:51:12

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH] mac80211: Allow AP mode to be enabled

Johannes Berg <[email protected]> writes:

>> Thanks a lot, I updated to hostap commit 4aac554c and it works now
>> with b43. I was able to associate with N810 and ping worked. Even PSM
>> seems to work, but I haven't made any power consumption measurements
>> yet.
>
> I'd be interested in power consumption measurements, but it should work
> fine.

I did some quick measurements with N810 and, like you mentioned,
hostapd/mac80211/b43 combination seems to work just fine. Tried with
DTIM 1 and 10 with beacon period of 100 ms and power consumption of
N810 is just like what I was expecting.

I have seen a lot of APs with buggy PSM implementation and this setup
isn't one of them :)

> There might be a slight bug in b43 wrt. the beacon timestamp offset
> though.

If there's a bug in b43 I cannot see it from my measurements. Usually
I have seen any problems with the TBTT right away.

--
Kalle Valo

2008-11-01 11:35:01

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] mac80211: Allow AP mode to be enabled


> I tried to test this with latest hostapd (commit b6a55236) and
> wireless-testing (commit d80fe0040), but unfortunately I wasn't
> succesful. Here's the output from hostapd with b43:
>
> $ sudo ./hostapd -dd wlan1.conf
> Configuration file: wlan1.conf
> ctrl_interface_group=0
> Opening raw packet socket for ifindex 0
> BSS count 1, BSSID mask ff:ff:ff:ff:ff:ff (0 bits)
> SIOCGIWRANGE: WE(compiled)=22 WE(source)=21 enc_capa=0xf
> Failed to update rate sets in kernel module
> RATE[0] rate=10 flags=0x2
> RATE[1] rate=20 flags=0x6
> RATE[2] rate=55 flags=0x6
> RATE[3] rate=110 flags=0x6
> RATE[4] rate=60 flags=0x0
> RATE[5] rate=90 flags=0x0
> RATE[6] rate=120 flags=0x0
> RATE[7] rate=180 flags=0x0
> RATE[8] rate=240 flags=0x0
> RATE[9] rate=360 flags=0x0
> RATE[10] rate=480 flags=0x0
> RATE[11] rate=540 flags=0x0
> Could not set passive scanning: Unknown error 4294967295
> Flushing old station entries
> Deauthenticate all stations
> Mode: IEEE 802.11g Channel: 5 Frequency: 2432 MHz
> Failed to set CTS protect in kernel driver
> Failed to set Short Slot Time option in kernel driver
> Could not set preamble for kernel driver
> Using interface wlan1 with hwaddr 00:11:50:f4:c2:42 and ssid 'test'
> ioctl[SIOCSIWESSID]: Operation not supported
> len=4
> Could not set SSID for kernel driver

John merged all my stuff, and that included removing the SSID, you need
this hostapd patch:

--- a/hostapd/driver_nl80211.c
+++ b/hostapd/driver_nl80211.c
@@ -386,28 +386,6 @@ static int i802_set_rate_sets(void *priv, int *supp_rates, int *basic_rates,
}


-static int i802_set_ssid(const char *ifname, void *priv, const u8 *buf,
- int len)
-{
- struct i802_driver_data *drv = priv;
- struct iwreq iwr;
-
- memset(&iwr, 0, sizeof(iwr));
- os_strlcpy(iwr.ifr_name, ifname, IFNAMSIZ);
- iwr.u.essid.flags = 1; /* SSID active */
- iwr.u.essid.pointer = (caddr_t) buf;
- iwr.u.essid.length = len;
-
- if (ioctl(drv->ioctl_sock, SIOCSIWESSID, &iwr) < 0) {
- perror("ioctl[SIOCSIWESSID]");
- printf("len=%d\n", len);
- return -1;
- }
-
- return 0;
-}
-
-
static int i802_send_frame(void *priv, const void *data, size_t len,
int encrypt, int flags)
{
@@ -2315,7 +2293,6 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
.sta_deauth = i802_sta_deauth,
.sta_disassoc = i802_sta_disassoc,
.sta_remove = i802_sta_remove,
- .set_ssid = i802_set_ssid,
.send_mgmt_frame = i802_send_mgmt_frame,
.sta_add2 = i802_sta_add2,
.get_inact_sec = i802_get_inact_sec,




2008-11-01 11:49:06

by Jouni Malinen

[permalink] [raw]
Subject: Re: [PATCH] mac80211: Allow AP mode to be enabled

On Sat, Nov 01, 2008 at 01:31:30PM +0200, Kalle Valo wrote:

> I tried to test this with latest hostapd (commit b6a55236) and
> wireless-testing (commit d80fe0040), but unfortunately I wasn't
> succesful. Here's the output from hostapd with b43:

> ioctl[SIOCSIWESSID]: Operation not supported
> len=4
> Could not set SSID for kernel driver

Thanks for reporting this. I fixed it now in hostap.git. Johannes
removed SSID configuration from AP mode and I was just waiting for this
to hit wireless-testing before committing the change into hostapd.

--
Jouni Malinen PGP id EFC895FA

2008-11-01 14:24:40

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH] mac80211: Allow AP mode to be enabled

Jouni Malinen <[email protected]> writes:

> On Sat, Nov 01, 2008 at 01:31:30PM +0200, Kalle Valo wrote:
>
>> I tried to test this with latest hostapd (commit b6a55236) and
>> wireless-testing (commit d80fe0040), but unfortunately I wasn't
>> succesful. Here's the output from hostapd with b43:
>
>> ioctl[SIOCSIWESSID]: Operation not supported
>> len=4
>> Could not set SSID for kernel driver
>
> Thanks for reporting this. I fixed it now in hostap.git. Johannes
> removed SSID configuration from AP mode and I was just waiting for this
> to hit wireless-testing before committing the change into hostapd.

Thanks a lot, I updated to hostap commit 4aac554c and it works now
with b43. I was able to associate with N810 and ping worked. Even PSM
seems to work, but I haven't made any power consumption measurements
yet.

I'm very happy now, thank you Johannes and Jouni! :D

--
Kalle Valo