[PATCH] nl80211 driver: fix beacon interval setting

Johannes Berg johannes at sipsolutions.net
Tue Apr 8 09:16:19 EDT 2008


This removes the hard-coded beacon interval setting.

Signed-off-by: Johannes Berg <johannes at sipsolutions.net>
---
To implement multi-BSS support again I really need per-BSS data in the
nl80211 driver. I can make it work by introducing a per-VLAN/per-BSS
data hash that hashes from the interface name, but I'd like to avoid
that. If I were to post a patch for the driver interface that does what
I need, would you help me adjust all the other drivers?

 hostapd/driver_nl80211.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

--- hostap.orig/hostapd/driver_nl80211.c	2008-04-02 11:10:20.000000000 +0200
+++ hostap/hostapd/driver_nl80211.c	2008-04-08 15:12:55.000000000 +0200
@@ -65,7 +65,7 @@ struct i802_driver_data {
 	struct nl_handle *nl_handle;
 	struct nl_cache *nl_cache;
 	struct genl_family *nl80211;
-	int dtim_period;
+	int dtim_period, beacon_int;
 	unsigned int beacon_set:1;
 	unsigned int ieee802_1x_active:1;
 };
@@ -1056,7 +1056,7 @@ static int i802_set_beacon(const char *i
 	NLA_PUT(msg, NL80211_ATTR_BEACON_HEAD, head_len, head);
 	NLA_PUT(msg, NL80211_ATTR_BEACON_TAIL, tail_len, tail);
 	NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, if_nametoindex(iface));
-	NLA_PUT_U32(msg, NL80211_ATTR_BEACON_INTERVAL, 1000);
+	NLA_PUT_U32(msg, NL80211_ATTR_BEACON_INTERVAL, drv->beacon_int);
 
 	if (!drv->dtim_period)
 		drv->dtim_period = 2;
@@ -1145,6 +1145,8 @@ static int i802_set_beacon_int(void *pri
 	struct nl_msg *msg;
 	int ret = -1;
 
+	drv->beacon_int = value;
+
 	msg = nlmsg_alloc();
 	if (!msg)
 		goto out;

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 828 bytes
Desc: This is a digitally signed message part
Url : http://lists.shmoo.com/pipermail/hostap/attachments/20080408/7ff2325c/attachment-0001.pgp 


More information about the HostAP mailing list