Skip to contentSkip to conversation

mac80211: Allow AP mode to be enabled

PATCH In review Jouni Malinen 3 participants 9 messages Oct 30, 2008 – Nov 1, 2008 mac80211

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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).

net/mac80211/cfg.c +2 -0
Index: wireless-testing/net/mac80211/cfg.c
===================================================================
@@ -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:
Signature · 1 line
Jouni Malinen                                            PGP id EFC895FA
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Jouni Malinen

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

Quoted 1 line
Quoted 14 lines

Index: wireless-testing/net/mac80211/cfg.c
===================================================================

net/mac80211/cfg.c +2 -0
@@ -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:
#2 lore raw
In reply to Jouni Malinen

Terve Jouni,

Quoted 9 lines · Jouni Malinen

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:

wlan1.conf 2008-11-01 13:17:52.000000000 +0200 renamed from hostapd.conf 2008-10-20 09:58:10.000000000 +0300 +4 -4
@@ -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
Signature · 1 line
Kalle Valo
maintainer
#3 lore raw
Quoted 27 lines

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
Quoted 8 lines
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:

hostapd/driver_nl80211.c +0 -23
@@ -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,
#4 lore raw
In reply to Kalle Valo
Quoted 7 lines · Kalle Valo

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.

Signature · 1 line
Jouni Malinen                                            PGP id EFC895FA
#5 lore raw
Quoted 6 lines · Jouni Malinen
Quoted 3 lines · Kalle Valo

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:

Quoted 7 lines
Quoted 3 lines

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

Signature · 1 line
Kalle Valo
maintainer
#6 lore raw
Quoted 12 lines · Kalle Valo
Quoted 10 lines · Jouni Malinen
Quoted 7 lines · Kalle Valo

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

Quoted 8 lines
Quoted 3 lines

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.

Quoted 1 line

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

:)

johannes

#7 lore raw
Quoted 7 lines · Johannes Berg
Quoted 4 lines

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

Quoted 2 lines

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.

Signature · 1 line
Kalle Valo
maintainer
#8 lore raw
Quoted 10 lines · Kalle Valo
Quoted 7 lines · Johannes Berg
Quoted 4 lines

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.

Quoted 7 lines

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

:)

Quoted 5 lines
Quoted 2 lines

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