Date:2011-04-23 23:34:35 (2 years 24 days ago)
Author:nbd
Commit:454a4d2fee1cef9b1ea0b774fd871aac2f3624d3
Message:hostapd: update to 2011-04-21

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@26749 3c298f89-4303-0410-b956-a3cf2f4a3e73
Files: package/hostapd/Makefile (1 diff)
package/hostapd/patches/330-multicall_bridge_fix.patch (1 diff)
package/hostapd/patches/510-multicall.patch (5 diffs)
package/hostapd/patches/530-rescan_immediately.patch (1 diff)
package/hostapd/patches/540-optional_rfkill.patch (1 diff)
package/hostapd/patches/551-nl80211_del_beacon_bss.patch (2 diffs)
package/hostapd/patches/553-ap_sta_support.patch (1 diff)
package/hostapd/patches/560-disable_ctrl_iface_mib.patch (6 diffs)
package/hostapd/patches/710-bring_down_interface.patch (2 diffs)
package/hostapd/patches/730-fix_wds_bridge_handling.patch (2 diffs)
package/hostapd/patches/800-dynamic_20_40_mhz.patch (1 diff)

Change Details

package/hostapd/Makefile
88include $(TOPDIR)/rules.mk
99
1010PKG_NAME:=hostapd
11PKG_VERSION:=20110402
11PKG_VERSION:=20110421
1212PKG_RELEASE:=1
13PKG_REV:=4378fc14ebfb355705e7674bf347ea659bcd77bc
13PKG_REV:=0725cc7b7efc434910e89865c42eda7ce61bbf08
1414
1515PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
1616PKG_SOURCE_URL:=git://w1.fi/srv/git/hostap.git
1717PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
1818PKG_SOURCE_VERSION:=$(PKG_REV)
1919PKG_SOURCE_PROTO:=git
20PKG_MIRROR_MD5SUM:=fd5e29bbfcb89a4e60fef633bd4efa94
20PKG_MIRROR_MD5SUM:=fa3f3182dc82f40c88398822ebfe693e
2121
2222PKG_BUILD_DEPENDS:= \
2323    PACKAGE_kmod-madwifi:madwifi \
package/hostapd/patches/330-multicall_bridge_fix.patch
3434     return 0;
3535 }
3636
37@@ -5623,8 +5636,6 @@ static void *i802_init(struct hostapd_da
37@@ -5638,8 +5651,6 @@ static void *i802_init(struct hostapd_da
3838         br_ifindex = 0;
3939     }
4040
package/hostapd/patches/510-multicall.patch
132132 wpa_cli.exe: wpa_cli
133133--- a/src/drivers/driver.h
134134+++ b/src/drivers/driver.h
135@@ -3186,8 +3186,8 @@ union wpa_event_data {
135@@ -3187,8 +3187,8 @@ union wpa_event_data {
136136  * Driver wrapper code should call this function whenever an event is received
137137  * from the driver.
138138  */
...... 
145145 /*
146146--- a/src/ap/drv_callbacks.c
147147+++ b/src/ap/drv_callbacks.c
148@@ -443,8 +443,8 @@ static void hostapd_event_eapol_rx(struc
148@@ -448,8 +448,8 @@ static void hostapd_event_eapol_rx(struc
149149 }
150150
151151
...... 
179179     for (;;) {
180180--- a/wpa_supplicant/events.c
181181+++ b/wpa_supplicant/events.c
182@@ -1734,8 +1734,8 @@ static void wpa_supplicant_event_unprot_
182@@ -1741,8 +1741,8 @@ static void wpa_supplicant_event_unprot_
183183 }
184184
185185
...... 
192192     u16 reason_code = 0;
193193--- a/wpa_supplicant/wpa_supplicant.c
194194+++ b/wpa_supplicant/wpa_supplicant.c
195@@ -2311,6 +2311,9 @@ static void wpa_supplicant_deinit_iface(
195@@ -2314,6 +2314,9 @@ static void wpa_supplicant_deinit_iface(
196196         wpa_drv_deinit(wpa_s);
197197 }
198198
...... 
202202
203203 /**
204204  * wpa_supplicant_add_iface - Add a new network interface
205@@ -2494,6 +2497,7 @@ struct wpa_global * wpa_supplicant_init(
205@@ -2497,6 +2500,7 @@ struct wpa_global * wpa_supplicant_init(
206206     wpa_msg_register_ifname_cb(wpa_supplicant_msg_ifname_cb);
207207 #endif /* CONFIG_NO_WPA_MSG */
208208
package/hostapd/patches/530-rescan_immediately.patch
1+++ b/wpa_supplicant/events.c
2@@ -958,7 +958,7 @@ static int _wpa_supplicant_event_scan_re
3             wpa_dbg(wpa_s, MSG_DEBUG, "Setup a new network");
4             wpa_supplicant_associate(wpa_s, NULL, ssid);
5         } else {
6- int timeout_sec = 5;
7+ int timeout_sec = 0;
8             int timeout_usec = 0;
9 #ifdef CONFIG_P2P
10             if (wpa_s->p2p_in_provisioning) {
1--- a/wpa_supplicant/wpa_supplicant.c
2@@ -2070,7 +2070,7 @@ static struct wpa_supplicant * wpa_suppl
3     if (wpa_s == NULL)
4         return NULL;
5     wpa_s->scan_req = 1;
6- wpa_s->scan_interval = 5;
7+ wpa_s->scan_interval = 0;
8     wpa_s->new_connection = 1;
9     wpa_s->parent = wpa_s;
10
package/hostapd/patches/540-optional_rfkill.patch
115115
116116     eloop_cancel_timeout(wpa_driver_nl80211_scan_timeout, drv, drv->ctx);
117117
118@@ -5693,7 +5711,9 @@ static void *i802_init(struct hostapd_da
118@@ -5708,7 +5726,9 @@ static void *i802_init(struct hostapd_da
119119
120120 failed:
121121     nl80211_remove_monitor_interface(drv);
package/hostapd/patches/551-nl80211_del_beacon_bss.patch
4444
4545 /**
4646  * wpa_driver_nl80211_deinit - Deinitialize nl80211 driver interface
47@@ -6566,4 +6584,5 @@ const struct wpa_driver_ops wpa_driver_n
47@@ -6581,4 +6599,5 @@ const struct wpa_driver_ops wpa_driver_n
4848     .set_intra_bss = nl80211_set_intra_bss,
4949     .set_param = nl80211_set_param,
5050     .get_radio_name = nl80211_get_radio_name,
...... 
5252 };
5353--- a/src/drivers/driver.h
5454+++ b/src/drivers/driver.h
55@@ -2240,6 +2240,8 @@ struct wpa_driver_ops {
55@@ -2241,6 +2241,8 @@ struct wpa_driver_ops {
5656      * @signal_info: Connection info structure
5757          */
5858     int (*signal_poll)(void *priv, struct wpa_signal_info *signal_info);
package/hostapd/patches/553-ap_sta_support.patch
107107         wpa_s->new_connection = 1;
108108         wpa_drv_set_operstate(wpa_s, 0);
109109 #ifndef IEEE8021X_EAPOL
110@@ -2154,6 +2211,21 @@ static int wpa_supplicant_init_iface(str
110@@ -2157,6 +2214,21 @@ static int wpa_supplicant_init_iface(str
111111         os_strlcpy(wpa_s->bridge_ifname, iface->bridge_ifname,
112112                sizeof(wpa_s->bridge_ifname));
113113     }
package/hostapd/patches/560-disable_ctrl_iface_mib.patch
5555
5656--- a/wpa_supplicant/ctrl_iface.c
5757+++ b/wpa_supplicant/ctrl_iface.c
58@@ -2896,6 +2896,7 @@ char * wpa_supplicant_ctrl_iface_process
58@@ -2927,6 +2927,7 @@ char * wpa_supplicant_ctrl_iface_process
5959             reply_len = -1;
6060     } else if (os_strncmp(buf, "NOTE ", 5) == 0) {
6161         wpa_printf(MSG_INFO, "NOTE: %s", buf + 5);
...... 
6363     } else if (os_strcmp(buf, "MIB") == 0) {
6464         reply_len = wpa_sm_get_mib(wpa_s->wpa, reply, reply_size);
6565         if (reply_len >= 0) {
66@@ -2907,6 +2908,7 @@ char * wpa_supplicant_ctrl_iface_process
66@@ -2938,6 +2939,7 @@ char * wpa_supplicant_ctrl_iface_process
6767             else
6868                 reply_len += res;
6969         }
...... 
7171     } else if (os_strncmp(buf, "STATUS", 6) == 0) {
7272         reply_len = wpa_supplicant_ctrl_iface_status(
7373             wpa_s, buf + 6, reply, reply_size);
74@@ -3200,6 +3202,7 @@ char * wpa_supplicant_ctrl_iface_process
74@@ -3243,6 +3245,7 @@ char * wpa_supplicant_ctrl_iface_process
7575         reply_len = wpa_supplicant_ctrl_iface_bss(
7676             wpa_s, buf + 4, reply, reply_size);
7777 #ifdef CONFIG_AP
...... 
7979     } else if (os_strcmp(buf, "STA-FIRST") == 0) {
8080         reply_len = ap_ctrl_iface_sta_first(wpa_s, reply, reply_size);
8181     } else if (os_strncmp(buf, "STA ", 4) == 0) {
82@@ -3208,6 +3211,7 @@ char * wpa_supplicant_ctrl_iface_process
82@@ -3251,6 +3254,7 @@ char * wpa_supplicant_ctrl_iface_process
8383     } else if (os_strncmp(buf, "STA-NEXT ", 9) == 0) {
8484         reply_len = ap_ctrl_iface_sta_next(wpa_s, buf + 9, reply,
8585                            reply_size);
...... 
105105+#endif
106106--- a/src/ap/ieee802_1x.c
107107+++ b/src/ap/ieee802_1x.c
108@@ -1876,6 +1876,7 @@ static const char * bool_txt(Boolean boo
108@@ -1895,6 +1895,7 @@ static const char * bool_txt(Boolean boo
109109     return bool ? "TRUE" : "FALSE";
110110 }
111111
...... 
113113
114114 int ieee802_1x_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen)
115115 {
116@@ -2027,6 +2028,7 @@ int ieee802_1x_get_mib_sta(struct hostap
116@@ -2046,6 +2047,7 @@ int ieee802_1x_get_mib_sta(struct hostap
117117     return len;
118118 }
119119
package/hostapd/patches/710-bring_down_interface.patch
11--- a/src/drivers/driver_nl80211.c
22+++ b/src/drivers/driver_nl80211.c
3@@ -4904,9 +4904,6 @@ static int wpa_driver_nl80211_set_mode(v
3@@ -4919,9 +4919,6 @@ static int wpa_driver_nl80211_set_mode(v
44             /* Try to set the mode again while the interface is
55              * down */
66             ret = nl80211_set_mode(drv, drv->ifindex, nlmode);
...... 
1010             if (!ret)
1111                 break;
1212         } else
13@@ -4919,6 +4916,8 @@ static int wpa_driver_nl80211_set_mode(v
13@@ -4934,6 +4931,8 @@ static int wpa_driver_nl80211_set_mode(v
1414         wpa_printf(MSG_DEBUG, "nl80211: Mode change succeeded while "
1515                "interface is down");
1616         drv->nlmode = nlmode;
package/hostapd/patches/730-fix_wds_bridge_handling.patch
11--- a/src/drivers/driver_nl80211.c
22+++ b/src/drivers/driver_nl80211.c
3@@ -5487,6 +5487,9 @@ static int i802_set_wds_sta(void *priv,
3@@ -5502,6 +5502,9 @@ static int i802_set_wds_sta(void *priv,
44         linux_set_iface_flags(drv->ioctl_sock, name, 1);
55         return i802_set_sta_vlan(priv, addr, name, 0);
66     } else {
...... 
1010         i802_set_sta_vlan(priv, addr, bss->ifname, 0);
1111         return wpa_driver_nl80211_if_remove(priv, WPA_IF_AP_VLAN,
1212                             name);
13@@ -5927,14 +5930,14 @@ static int wpa_driver_nl80211_if_remove(
13@@ -5942,14 +5945,14 @@ static int wpa_driver_nl80211_if_remove(
1414         return -1;
1515
1616 #ifdef HOSTAPD
package/hostapd/patches/800-dynamic_20_40_mhz.patch
1--- a/hostapd/config_file.c
2@@ -1901,6 +1901,10 @@ struct hostapd_config * hostapd_config_r
3                        "ht_capab", line);
4                 errors++;
5             }
6+ } else if (os_strcmp(buf, "dynamic_ht40") == 0) {
7+ conf->dynamic_ht40 = atoi(pos);
8+ if (conf->dynamic_ht40 == 1)
9+ conf->dynamic_ht40 = 1500;
10         } else if (os_strcmp(buf, "require_ht") == 0) {
11             conf->require_ht = atoi(pos);
12 #endif /* CONFIG_IEEE80211N */
13--- a/src/ap/ap_config.h
14@@ -393,6 +393,7 @@ struct hostapd_config {
15     int ieee80211n;
16     int secondary_channel;
17     int require_ht;
18+ int dynamic_ht40;
19 };
20
21
22--- a/src/ap/hostapd.c
23@@ -285,6 +285,7 @@ static void hostapd_cleanup_iface_pre(st
24  */
25 static void hostapd_cleanup_iface(struct hostapd_iface *iface)
26 {
27+ hostapd_deinit_ht(iface);
28     hostapd_free_hw_features(iface->hw_features, iface->num_hw_features);
29     iface->hw_features = NULL;
30     os_free(iface->current_rates);
31--- a/src/ap/hostapd.h
32@@ -220,6 +220,9 @@ struct hostapd_iface {
33     /* Overlapping BSS information */
34     int olbc_ht;
35
36+ int force_20mhz;
37+ struct os_time last_20mhz_trigger;
38+
39     u16 ht_op_mode;
40     void (*scan_cb)(struct hostapd_iface *iface);
41
42--- a/src/ap/ieee802_11.c
43@@ -1242,6 +1242,9 @@ static void handle_beacon(struct hostapd
44                          sizeof(mgmt->u.beacon)), &elems,
45                       0);
46
47+ if (!elems.ht_capabilities)
48+ hostapd_trigger_20mhz(hapd->iface);
49+
50     ap_list_process_beacon(hapd->iface, mgmt, &elems, fi);
51 }
52
53--- a/src/ap/ieee802_11.h
54@@ -65,4 +65,17 @@ void hostapd_tx_status(struct hostapd_da
55 void ieee802_11_rx_from_unknown(struct hostapd_data *hapd, const u8 *src,
56                 int wds);
57
58+#ifdef CONFIG_IEEE80211N
59+void hostapd_trigger_20mhz(struct hostapd_iface *iface);
60+void hostapd_deinit_ht(struct hostapd_iface *iface);
61+
62+#else
63+static inline void hostapd_deinit_ht(struct hostapd_iface *iface)
64+{
65+}
66+static inline void hostapd_trigger_20mhz(struct hostapd_iface *iface)
67+{
68+}
69+#endif /* CONFIG_IEEE80211N */
70+
71 #endif /* IEEE802_11_H */
72--- a/src/ap/ieee802_11_ht.c
73@@ -70,12 +70,15 @@ u8 * hostapd_eid_ht_operation(struct hos
74
75     oper->control_chan = hapd->iconf->channel;
76     oper->operation_mode = host_to_le16(hapd->iface->ht_op_mode);
77- if (hapd->iconf->secondary_channel == 1)
78- oper->ht_param |= HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE |
79- HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH;
80- if (hapd->iconf->secondary_channel == -1)
81- oper->ht_param |= HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW |
82- HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH;
83+
84+ if (!hapd->iface->force_20mhz) {
85+ if (hapd->iconf->secondary_channel == 1)
86+ oper->ht_param |= HT_INFO_HT_PARAM_SECONDARY_CHNL_ABOVE |
87+ HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH;
88+ if (hapd->iconf->secondary_channel == -1)
89+ oper->ht_param |= HT_INFO_HT_PARAM_SECONDARY_CHNL_BELOW |
90+ HT_INFO_HT_PARAM_REC_TRANS_CHNL_WIDTH;
91+ }
92
93     pos += sizeof(*oper);
94
95@@ -265,3 +268,80 @@ void hostapd_get_ht_capab(struct hostapd
96
97     neg_ht_cap->ht_capabilities_info = host_to_le16(cap);
98 }
99+
100+static int hostapd_set_force_20mhz(struct hostapd_iface *iface);
101+
102+static int hostapd_restore_40mhz(void *eloop_data, void *user_ctx)
103+{
104+ struct hostapd_iface *iface = eloop_data;
105+ struct os_time time;
106+ int timeout;
107+
108+ if (!iface->last_20mhz_trigger.sec)
109+ return;
110+
111+ os_get_time(&time);
112+ timeout = iface->last_20mhz_trigger.sec + iface->conf->dynamic_ht40 -
113+ time.sec;
114+
115+ if (timeout > 0) {
116+ eloop_register_timeout(timeout, 0, hostapd_restore_40mhz,
117+ iface, NULL);
118+ return;
119+ }
120+
121+ iface->last_20mhz_trigger.sec = 0;
122+ iface->last_20mhz_trigger.usec = 0;
123+
124+ iface->force_20mhz = 0;
125+ hostapd_set_force_20mhz(iface);
126+}
127+
128+static int hostapd_set_force_20mhz(struct hostapd_iface *iface)
129+{
130+ int secondary_channel;
131+ int i;
132+
133+ ieee802_11_set_beacons(iface);
134+
135+ for (i = 0; i < iface->num_bss; i++) {
136+ struct hostapd_data *hapd = iface->bss[i];
137+
138+ if (iface->force_20mhz)
139+ secondary_channel = 0;
140+ else
141+ secondary_channel = hapd->iconf->secondary_channel;
142+
143+ if (hostapd_set_freq(hapd, hapd->iconf->hw_mode, iface->freq,
144+ hapd->iconf->channel,
145+ hapd->iconf->ieee80211n,
146+ secondary_channel)) {
147+ wpa_printf(MSG_ERROR, "Could not set channel for "
148+ "kernel driver");
149+ }
150+ }
151+}
152+
153+void hostapd_deinit_ht(struct hostapd_iface *iface)
154+{
155+ eloop_cancel_timeout(hostapd_restore_40mhz, iface, NULL);
156+}
157+
158+void hostapd_trigger_20mhz(struct hostapd_iface *iface)
159+{
160+ if (!iface->conf->dynamic_ht40)
161+ return;
162+
163+ if (!iface->force_20mhz) {
164+ iface->force_20mhz = 1;
165+ hostapd_set_force_20mhz(iface);
166+ }
167+
168+ if (!iface->last_20mhz_trigger.sec) {
169+ eloop_cancel_timeout(hostapd_restore_40mhz, iface, NULL);
170+ eloop_register_timeout(iface->conf->dynamic_ht40, 0,
171+ hostapd_restore_40mhz, iface, NULL);
172+ }
173+
174+ os_get_time(&iface->last_20mhz_trigger);
175+}

Archive Download the corresponding diff file



interactive