Date:2010-05-04 17:36:29 (13 years 7 months ago)
Author:nbd
Commit:5eaa0e53858e7125b7cfb849f6f321747cf0c42e
Message:[backfire] backport mac80211 and hostapd from trunk

git-svn-id: svn://svn.openwrt.org/openwrt/branches/backfire@21354 3c298f89-4303-0410-b956-a3cf2f4a3e73
Files: package/hostapd/Makefile (1 diff)
package/hostapd/files/hostapd.sh (1 diff)
package/hostapd/patches/001-nl80211_sync.patch (1 diff)
package/hostapd/patches/110-countrycode.patch (1 diff)
package/hostapd/patches/130-scan_wait.patch (10 diffs)
package/hostapd/patches/200-multicall.patch (12 diffs)
package/hostapd/patches/310-scan_ssid.patch (2 diffs)
package/hostapd/patches/320-rescan_immediately.patch (1 diff)
package/hostapd/patches/350-wds_fix.patch (2 diffs)
package/hostapd/patches/360-wds_bridge.patch (4 diffs)
package/hostapd/patches/370-basic_rates.patch (1 diff)
package/hostapd/patches/380-ap_isolate.patch (1 diff)
package/hostapd/patches/390-nl80211_fixes.patch (1 diff)
package/hostapd/patches/400-nl80211_sta_auth.patch (1 diff)
package/mac80211/Makefile (5 diffs)
package/mac80211/files/lib/wifi/mac80211.sh (1 diff)
package/mac80211/patches/001-disable_b44.patch (1 diff)
package/mac80211/patches/002-disable_rfkill.patch (1 diff)
package/mac80211/patches/007-remove_misc_drivers.patch (2 diffs)
package/mac80211/patches/010-no_pcmcia.patch (2 diffs)
package/mac80211/patches/011-no_sdio.patch (1 diff)
package/mac80211/patches/013-disable_b43_nphy.patch (1 diff)
package/mac80211/patches/014-add_iw_handler.patch (1 diff)
package/mac80211/patches/015-remove-rt2x00-options.patch (2 diffs)
package/mac80211/patches/120-compat_rcu_dereference.patch (1 diff)
package/mac80211/patches/130-tracepoint_include_linux_version_h.patch (1 diff)
package/mac80211/patches/300-fix-mesh.patch (1 diff)
package/mac80211/patches/403-ath9k-fix-invalid-mac-address-handling.patch (1 diff)
package/mac80211/patches/404-ath_regd_optional.patch (1 diff)
package/mac80211/patches/405-ath9k-read-eeprom-data-from-platform-data-on-pci-bus.patch (1 diff)
package/mac80211/patches/406-ath9k-set-AH_USE_EEPROM-only-if-no-platform-data-present.patch (4 diffs)
package/mac80211/patches/407-ath9k-override-mac-address-from-platform-data.patch (3 diffs)
package/mac80211/patches/408-ath9k_tweak_rx_intr_mitigation.patch (2 diffs)
package/mac80211/patches/409-ath9k-add-wndr3700-antenna-initialization.patch (5 diffs)
package/mac80211/patches/410-ath9k-wndr3700-led-pin-fix.patch (1 diff)
package/mac80211/patches/500-ath9k_debugfs_chainmask.patch (4 diffs)
package/mac80211/patches/510-ath9k_debugfs_regaccess.patch (4 diffs)
package/mac80211/patches/520-cfg80211_get_freq.patch (1 diff)
package/mac80211/patches/530-minstrel_ht.patch (11 diffs)
package/mac80211/patches/540-ath9k_use_minstrel.patch (1 diff)
package/mac80211/patches/550-ath9k_bb_fix.patch (1 diff)
package/mac80211/patches/550-ath9k_no_multi_desc_frames.patch (1 diff)
package/mac80211/patches/600-rt2x00-disable-pci-code-if-CONFIG_PCI-not-defined.patch (2 diffs)
package/mac80211/patches/601-rt2x00-lib-use-rt2x00dev-irq.patch (1 diff)
package/mac80211/patches/602-rt2x00-remove-mcu-requests-for-soc.patch (1 diff)
package/mac80211/patches/700-mwl8k-missing-pci-id-for-WNR854T.patch (1 diff)

Change Details

package/hostapd/Makefile
88include $(TOPDIR)/rules.mk
99
1010PKG_NAME:=hostapd
11PKG_VERSION:=20100309
11PKG_VERSION:=20100418
1212PKG_RELEASE:=1
13PKG_REV:=7b90c16aa9ca377b1a6d160c1ba0f2bd304f7e2f
13PKG_REV:=0b86f67a2970403d1b1b6d34ce49f5485ef5dbb3
1414
1515PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
1616PKG_SOURCE_URL:=git://w1.fi/srv/git/hostap.git
package/hostapd/files/hostapd.sh
55
66    config_get enc "$vif" encryption
77    config_get wpa_group_rekey "$vif" wpa_group_rekey
8    config_get_bool ap_isolate "$vif" isolate 0
9
10    if [ "$ap_isolate" -gt 0 ]; then
11        append "$var" "ap_isolate=$ap_isolate" "$N"
12    fi
813
914    # Examples:
1015    # psk-mixed/tkip => WPA1+2 PSK, TKIP
package/hostapd/patches/001-nl80211_sync.patch
1--- a/src/drivers/nl80211_copy.h
2@@ -709,6 +709,9 @@ enum nl80211_commands {
3  * NL80211_CMD_AUTHENTICATE, NL80211_CMD_DEAUTHENTICATE,
4  * NL80211_CMD_DISASSOCIATE.
5  *
6+ * @NL80211_ATTR_AP_ISOLATE: (AP mode) Do not forward traffic between stations
7+ * connected to this BSS.
8+ *
9  * @NL80211_ATTR_MAX: highest attribute number currently defined
10  * @__NL80211_ATTR_AFTER_LAST: internal use
11  */
12@@ -864,6 +867,8 @@ enum nl80211_attrs {
13
14     NL80211_ATTR_LOCAL_STATE_CHANGE,
15
16+ NL80211_ATTR_AP_ISOLATE,
17+
18     /* add attributes here, update the policy in nl80211.c */
19
20     __NL80211_ATTR_AFTER_LAST,
package/hostapd/patches/110-countrycode.patch
11--- a/src/ap/hostapd.c
22+++ b/src/ap/hostapd.c
3@@ -650,7 +650,6 @@ static int setup_interface(struct hostap
3@@ -659,7 +659,6 @@ static int setup_interface(struct hostap
44         country[3] = '\0';
55         if (hostapd_set_country(hapd, country) < 0) {
66             wpa_printf(MSG_ERROR, "Failed to set country code");
package/hostapd/patches/130-scan_wait.patch
11--- a/src/ap/hostapd.h
22+++ b/src/ap/hostapd.h
3@@ -238,6 +238,7 @@ struct hostapd_iface {
3@@ -245,6 +245,7 @@ struct hostapd_iface {
44     int (*for_each_interface)(struct hapd_interfaces *interfaces,
55                   int (*cb)(struct hostapd_iface *iface,
66                         void *ctx), void *ctx);
...... 
1010 /* hostapd.c */
1111--- a/src/ap/hostapd.c
1212+++ b/src/ap/hostapd.c
13@@ -746,6 +746,9 @@ int hostapd_setup_interface_complete(str
13@@ -754,6 +754,9 @@ int hostapd_setup_interface_complete(str
1414     wpa_printf(MSG_DEBUG, "%s: Setup of interface done.",
1515            iface->bss[0]->conf->iface);
1616
...... 
5555     hapd_iface->reload_config = hostapd_reload_config;
5656     hapd_iface->config_read_cb = hostapd_config_read;
5757     hapd_iface->config_fname = os_strdup(config_file);
58@@ -390,7 +402,7 @@ static int hostapd_global_init(struct ha
58@@ -391,7 +403,7 @@ static int hostapd_global_init(struct ha
5959 }
6060
6161
...... 
6464 {
6565 #ifdef EAP_SERVER_TNC
6666     tncs_global_deinit();
67@@ -408,8 +420,7 @@ static void hostapd_global_deinit(const
67@@ -409,8 +421,7 @@ static void hostapd_global_deinit(const
6868 }
6969
7070
...... 
7474 {
7575 #ifdef EAP_SERVER_TNC
7676     int tnc = 0;
77@@ -430,11 +441,6 @@ static int hostapd_global_run(struct hap
77@@ -431,11 +442,6 @@ static int hostapd_global_run(struct hap
7878     }
7979 #endif /* EAP_SERVER_TNC */
8080
...... 
8686     eloop_run();
8787
8888     return 0;
89@@ -478,8 +484,7 @@ int main(int argc, char *argv[])
89@@ -479,8 +485,7 @@ int main(int argc, char *argv[])
9090     struct hapd_interfaces interfaces;
9191     int ret = 1;
9292     size_t i;
...... 
9696
9797     if (os_program_init())
9898         return -1;
99@@ -544,7 +549,7 @@ int main(int argc, char *argv[])
99@@ -545,7 +550,7 @@ int main(int argc, char *argv[])
100100             goto out;
101101     }
102102
...... 
105105         goto out;
106106
107107     ret = 0;
108@@ -555,7 +560,7 @@ int main(int argc, char *argv[])
108@@ -556,7 +561,7 @@ int main(int argc, char *argv[])
109109         hostapd_interface_deinit_free(interfaces.iface[i]);
110110     os_free(interfaces.iface);
111111
...... 
116116     os_program_deinit();
117117--- a/hostapd/config_file.c
118118+++ b/hostapd/config_file.c
119@@ -1855,6 +1855,8 @@ struct hostapd_config * hostapd_config_r
119@@ -1857,6 +1857,8 @@ struct hostapd_config * hostapd_config_r
120120             }
121121 #endif /* CONFIG_IEEE80211W */
122122 #ifdef CONFIG_IEEE80211N
...... 
127127         } else if (os_strcmp(buf, "ht_capab") == 0) {
128128--- a/src/ap/ap_config.h
129129+++ b/src/ap/ap_config.h
130@@ -366,6 +366,7 @@ struct hostapd_config {
130@@ -369,6 +369,7 @@ struct hostapd_config {
131131
132132     int ht_op_mode_fixed;
133133     u16 ht_capab;
package/hostapd/patches/200-multicall.patch
2626 LIBS += $(DRV_AP_LIBS)
2727
2828 ifdef CONFIG_L2_PACKET
29@@ -738,6 +743,12 @@ install: all
29@@ -739,6 +744,12 @@ install: all
3030
3131 BCHECK=../src/drivers/build.hostapd
3232
...... 
3939 hostapd: $(BCHECK) $(OBJS)
4040     $(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS)
4141
42@@ -776,6 +787,12 @@ HOBJS += ../src/crypto/aes-internal.o
42@@ -777,6 +788,12 @@ HOBJS += ../src/crypto/aes-internal.o
4343 HOBJS += ../src/crypto/aes-internal-enc.o
4444 endif
4545
...... 
8686 endif
8787
8888 ifdef NEED_RSN_AUTHENTICATOR
89@@ -1261,6 +1272,12 @@ BCHECK=../src/drivers/build.wpa_supplica
89@@ -1262,6 +1273,12 @@ BCHECK=../src/drivers/build.wpa_supplica
9090 wpa_priv: $(BCHECK) $(OBJS_priv)
9191     $(LDO) $(LDFLAGS) -o wpa_priv $(OBJS_priv) $(LIBS)
9292
...... 
9999 wpa_supplicant: .config $(BCHECK) $(OBJS) $(EXTRA_progs)
100100     $(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS)
101101
102@@ -1320,6 +1337,12 @@ endif
102@@ -1321,6 +1338,12 @@ endif
103103     $(Q)$(CC) -c -o $@ $(CFLAGS) $<
104104     @$(E) " CC " $<
105105
...... 
114114 wpa_cli.exe: wpa_cli
115115--- a/src/drivers/driver.h
116116+++ b/src/drivers/driver.h
117@@ -2413,8 +2413,8 @@ union wpa_event_data {
117@@ -2449,8 +2449,8 @@ union wpa_event_data {
118118  * Driver wrapper code should call this function whenever an event is received
119119  * from the driver.
120120  */
...... 
127127 /*
128128--- a/src/ap/drv_callbacks.c
129129+++ b/src/ap/drv_callbacks.c
130@@ -337,8 +337,8 @@ static void hostapd_event_eapol_rx(struc
130@@ -375,8 +375,8 @@ static void hostapd_event_eapol_rx(struc
131131 }
132132
133133
...... 
138138 {
139139     struct hostapd_data *hapd = ctx;
140140
141@@ -415,5 +415,6 @@ void wpa_supplicant_event(void *ctx, enu
141@@ -453,5 +453,6 @@ void wpa_supplicant_event(void *ctx, enu
142142         break;
143143     }
144144 }
...... 
169169     for (;;) {
170170--- a/wpa_supplicant/events.c
171171+++ b/wpa_supplicant/events.c
172@@ -1506,8 +1506,8 @@ static void wpa_supplicant_event_ibss_rs
173 #endif /* CONFIG_IBSS_RSN */
172@@ -1577,8 +1577,8 @@ static void ft_rx_action(struct wpa_supp
173 #endif /* CONFIG_IEEE80211R */
174174
175175
176176-void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
...... 
179179+ union wpa_event_data *data)
180180 {
181181     struct wpa_supplicant *wpa_s = ctx;
182
182     u16 reason_code = 0;
183183--- a/wpa_supplicant/wpa_supplicant.c
184184+++ b/wpa_supplicant/wpa_supplicant.c
185@@ -2215,6 +2215,9 @@ struct wpa_supplicant * wpa_supplicant_g
185@@ -2223,6 +2223,9 @@ struct wpa_supplicant * wpa_supplicant_g
186186     return NULL;
187187 }
188188
...... 
192192
193193 /**
194194  * wpa_supplicant_init - Initialize %wpa_supplicant
195@@ -2233,6 +2236,7 @@ struct wpa_global * wpa_supplicant_init(
195@@ -2241,6 +2244,7 @@ struct wpa_global * wpa_supplicant_init(
196196     if (params == NULL)
197197         return NULL;
198198
...... 
202202         wpa_debug_open_syslog();
203203--- a/hostapd/main.c
204204+++ b/hostapd/main.c
205@@ -478,6 +478,9 @@ static void usage(void)
205@@ -479,6 +479,9 @@ static void usage(void)
206206     exit(1);
207207 }
208208
...... 
212212
213213 int main(int argc, char *argv[])
214214 {
215@@ -489,6 +492,7 @@ int main(int argc, char *argv[])
215@@ -490,6 +493,7 @@ int main(int argc, char *argv[])
216216     if (os_program_init())
217217         return -1;
218218
package/hostapd/patches/310-scan_ssid.patch
88     size_t max_ssids;
99     enum wpa_states prev_state;
1010
11@@ -310,6 +311,16 @@ static void wpa_supplicant_scan(void *el
11@@ -311,6 +312,16 @@ static void wpa_supplicant_scan(void *el
1212         wpa_s->wpa_state == WPA_INACTIVE)
1313         wpa_supplicant_set_state(wpa_s, WPA_SCANNING);
1414
...... 
2525     /* Find the starting point from which to continue scanning */
2626     ssid = wpa_s->conf->ssid;
2727     if (wpa_s->prev_scan_ssid != WILDCARD_SSID_SCAN) {
28@@ -371,6 +382,9 @@ static void wpa_supplicant_scan(void *el
28@@ -374,6 +385,9 @@ static void wpa_supplicant_scan(void *el
2929         int_array_sort_unique(params.freqs);
3030     }
3131
package/hostapd/patches/320-rescan_immediately.patch
11--- a/wpa_supplicant/events.c
22+++ b/wpa_supplicant/events.c
3@@ -924,7 +924,7 @@ static void wpa_supplicant_event_scan_re
3@@ -958,7 +958,7 @@ static void wpa_supplicant_event_scan_re
44             wpa_printf(MSG_DEBUG, "Setup a new network");
55             wpa_supplicant_associate(wpa_s, NULL, ssid);
6         } else
7- wpa_supplicant_req_new_scan(wpa_s, 5);
8+ wpa_supplicant_req_new_scan(wpa_s, 0);
9     }
10 }
11 #endif /* CONFIG_NO_SCAN_PROCESSING */
6         } else {
7- int timeout_sec = 5;
8+ int timeout_sec = 0;
9             int timeout_usec = 0;
10             wpa_supplicant_req_new_scan(wpa_s, timeout_sec,
11                             timeout_usec);
package/hostapd/patches/350-wds_fix.patch
11--- a/src/drivers/driver_nl80211.c
22+++ b/src/drivers/driver_nl80211.c
3@@ -4435,9 +4435,11 @@ static int i802_set_wds_sta(void *priv,
3@@ -4576,9 +4576,11 @@ static int i802_set_wds_sta(void *priv,
44     wpa_printf(MSG_DEBUG, "nl80211: Set WDS STA addr=" MACSTR
55            " aid=%d val=%d name=%s", MAC2STR(addr), aid, val, name);
66     if (val) {
...... 
1616     } else {
1717--- a/src/ap/ieee802_11.c
1818+++ b/src/ap/ieee802_11.c
19@@ -1559,6 +1559,9 @@ static void handle_assoc_cb(struct hosta
19@@ -1614,6 +1614,9 @@ static void handle_assoc_cb(struct hosta
2020                    "Could not add STA to kernel driver");
2121     }
2222
package/hostapd/patches/360-wds_bridge.patch
2121             /* clear to get error below if setting is invalid */
2222--- a/src/drivers/driver_nl80211.c
2323+++ b/src/drivers/driver_nl80211.c
24@@ -4425,7 +4425,8 @@ static int i802_set_sta_vlan(void *priv,
24@@ -4566,7 +4566,8 @@ static int i802_set_sta_vlan(void *priv,
2525 }
2626
2727
...... 
3131 {
3232     struct i802_bss *bss = priv;
3333     struct wpa_driver_nl80211_data *drv = bss->drv;
34@@ -4439,6 +4440,10 @@ static int i802_set_wds_sta(void *priv,
34@@ -4580,6 +4581,10 @@ static int i802_set_wds_sta(void *priv,
3535             if (nl80211_create_iface(drv, name, NL80211_IFTYPE_AP_VLAN,
3636                      NULL, 1) < 0)
3737                 return -1;
...... 
4444         return i802_set_sta_vlan(priv, addr, name, 0);
4545--- a/src/ap/ap_drv_ops.c
4646+++ b/src/ap/ap_drv_ops.c
47@@ -253,9 +253,15 @@ static int hostapd_vlan_if_remove(struct
47@@ -265,9 +265,15 @@ static int hostapd_vlan_if_remove(struct
4848 static int hostapd_set_wds_sta(struct hostapd_data *hapd, const u8 *addr,
4949                    int aid, int val)
5050 {
...... 
6363
6464--- a/src/drivers/driver.h
6565+++ b/src/drivers/driver.h
66@@ -1610,7 +1610,8 @@ struct wpa_driver_ops {
66@@ -1622,7 +1622,8 @@ struct wpa_driver_ops {
6767      * @val: 1 = bind to 4-address WDS; 0 = unbind
6868      * Returns: 0 on success, -1 on failure
6969      */
package/hostapd/patches/370-basic_rates.patch
11--- a/src/ap/hostapd.c
22+++ b/src/ap/hostapd.c
3@@ -707,6 +707,16 @@ int hostapd_setup_interface_complete(str
3@@ -715,6 +715,16 @@ int hostapd_setup_interface_complete(str
44         }
55     }
66
package/hostapd/patches/380-ap_isolate.patch
1--- a/hostapd/config_file.c
2@@ -1266,6 +1266,8 @@ struct hostapd_config * hostapd_config_r
3             }
4         } else if (os_strcmp(buf, "wds_sta") == 0) {
5             bss->wds_sta = atoi(pos);
6+ } else if (os_strcmp(buf, "ap_isolate") == 0) {
7+ bss->isolate = atoi(pos);
8         } else if (os_strcmp(buf, "ap_max_inactivity") == 0) {
9             bss->ap_max_inactivity = atoi(pos);
10         } else if (os_strcmp(buf, "country_code") == 0) {
11--- a/src/ap/ap_config.h
12@@ -199,6 +199,7 @@ struct hostapd_bss_config {
13     struct mac_acl_entry *deny_mac;
14     int num_deny_mac;
15     int wds_sta;
16+ int isolate;
17
18     int auth_algs; /* bitfield of allowed IEEE 802.11 authentication
19             * algorithms, WPA_AUTH_ALG_{OPEN,SHARED,LEAP} */
20--- a/src/drivers/driver.h
21@@ -1626,6 +1626,14 @@ struct wpa_driver_ops {
22                        const char *bridge_ifname);
23
24     /**
25+ * set_ap_isolate - Enable/disable AP isolation
26+ * @priv: private driver interface data
27+ * @val: 1 = enabled; 0 = disabled
28+ * Returns: 0 on success, -1 on failure
29+ */
30+ int (*set_ap_isolate)(void *priv, int val);
31+
32+ /**
33      * send_action - Transmit an Action frame
34      * @priv: Private driver interface data
35      * @freq: Frequency (in MHz) of the channel
36--- a/src/drivers/driver_nl80211.c
37@@ -4263,6 +4263,29 @@ static int i802_set_rate_sets(void *priv
38     return -ENOBUFS;
39 }
40
41+static int i802_set_ap_isolate(void *priv, int val)
42+{
43+ struct i802_bss *bss = priv;
44+ struct wpa_driver_nl80211_data *drv = bss->drv;
45+ struct nl_msg *msg;
46+ int i;
47+
48+ msg = nlmsg_alloc();
49+ if (!msg)
50+ return -ENOMEM;
51+
52+ genlmsg_put(msg, 0, 0, genl_family_get_id(drv->nl80211), 0, 0,
53+ NL80211_CMD_SET_BSS, 0);
54+
55+ NLA_PUT_U8(msg, NL80211_ATTR_AP_ISOLATE, !!val);
56+
57+ NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, if_nametoindex(bss->ifname));
58+
59+ return send_and_recv_msgs(drv, msg, NULL, NULL);
60+ nla_put_failure:
61+ return -ENOBUFS;
62+}
63+
64 #endif /* HOSTAPD */
65
66
67@@ -5372,6 +5395,7 @@ const struct wpa_driver_ops wpa_driver_n
68     .set_tx_queue_params = i802_set_tx_queue_params,
69     .set_sta_vlan = i802_set_sta_vlan,
70     .set_wds_sta = i802_set_wds_sta,
71+ .set_ap_isolate = i802_set_ap_isolate,
72 #endif /* HOSTAPD */
73     .set_freq = i802_set_freq,
74     .send_action = wpa_driver_nl80211_send_action,
75--- a/src/ap/ap_drv_ops.c
76@@ -180,6 +180,14 @@ static int hostapd_set_radius_acl_expire
77 }
78
79
80+static int hostapd_set_ap_isolate(struct hostapd_data *hapd, int value)
81+{
82+ if (hapd->driver == NULL || hapd->driver->set_ap_isolate == NULL)
83+ return 0;
84+ hapd->driver->set_ap_isolate(hapd->drv_priv, value);
85+}
86+
87+
88 static int hostapd_set_bss_params(struct hostapd_data *hapd,
89                   int use_protection)
90 {
91@@ -229,6 +237,12 @@ static int hostapd_set_bss_params(struct
92                "driver");
93         ret = -1;
94     }
95+ if (hostapd_set_ap_isolate(hapd, hapd->conf->isolate) &&
96+ !hapd->conf->isolate) {
97+ wpa_printf(MSG_ERROR, "Could not enable AP isolation in "
98+ "kernel driver");
99+ ret = -1;
100+ }
101
102     return ret;
103 }
package/hostapd/patches/390-nl80211_fixes.patch
1--- a/src/drivers/driver_nl80211.c
2@@ -1119,7 +1119,6 @@ nla_put_failure:
3 }
4
5
6-#ifndef HOSTAPD
7 struct wiphy_info_data {
8     int max_scan_ssids;
9     int ap_supported;
10@@ -1231,7 +1230,6 @@ static int wpa_driver_nl80211_capa(struc
11
12     return 0;
13 }
14-#endif /* HOSTAPD */
15
16
17 static int wpa_driver_nl80211_init_nl(struct wpa_driver_nl80211_data *drv,
18@@ -1371,6 +1369,7 @@ static void * wpa_driver_nl80211_init(vo
19     drv->monitor_ifidx = -1;
20     drv->monitor_sock = -1;
21     drv->ioctl_sock = -1;
22+ drv->nlmode = NL80211_IFTYPE_STATION;
23
24     if (wpa_driver_nl80211_init_nl(drv, ctx)) {
25         os_free(drv);
26@@ -1468,24 +1467,23 @@ wpa_driver_nl80211_finish_drv_init(struc
27     drv->ifindex = if_nametoindex(bss->ifname);
28     drv->first_bss.ifindex = drv->ifindex;
29
30-#ifndef HOSTAPD
31- if (wpa_driver_nl80211_set_mode(bss, IEEE80211_MODE_INFRA) < 0) {
32- wpa_printf(MSG_DEBUG, "nl80211: Could not configure driver to "
33- "use managed mode");
34- }
35-
36- if (linux_set_iface_flags(drv->ioctl_sock, bss->ifname, 1)) {
37- wpa_printf(MSG_ERROR, "Could not set interface '%s' UP",
38- bss->ifname);
39- return -1;
40- }
41+ if (drv->nlmode == NL80211_IFTYPE_STATION) {
42+ if (wpa_driver_nl80211_set_mode(bss, IEEE80211_MODE_INFRA) < 0)
43+ wpa_printf(MSG_DEBUG, "nl80211: Could not configure "
44+ "driver to use managed mode");
45+
46+ if (linux_set_iface_flags(drv->ioctl_sock, bss->ifname, 1)) {
47+ wpa_printf(MSG_ERROR, "Could not set interface '%s' UP",
48+ bss->ifname);
49+ return -1;
50+ }
51
52- if (wpa_driver_nl80211_capa(drv))
53- return -1;
54+ if (wpa_driver_nl80211_capa(drv))
55+ return -1;
56
57- netlink_send_oper_ifla(drv->netlink, drv->ifindex,
58- 1, IF_OPER_DORMANT);
59-#endif /* HOSTAPD */
60+ netlink_send_oper_ifla(drv->netlink, drv->ifindex,
61+ 1, IF_OPER_DORMANT);
62+ }
63
64     if (nl80211_register_action_frames(drv) < 0) {
65         wpa_printf(MSG_DEBUG, "nl80211: Failed to register Action "
66@@ -2143,13 +2141,9 @@ static int wpa_driver_nl80211_set_key(co
67      */
68     if (ret || !set_tx || alg == WPA_ALG_NONE)
69         return ret;
70-#ifdef HOSTAPD
71- if (addr)
72- return ret;
73-#else /* HOSTAPD */
74+
75     if (drv->nlmode == NL80211_IFTYPE_AP && addr)
76         return ret;
77-#endif /* HOSTAPD */
78
79     msg = nlmsg_alloc();
80     if (!msg)
81@@ -2990,7 +2984,8 @@ static void nl80211_remove_iface(struct
82
83 #ifdef HOSTAPD
84     /* stop listening for EAPOL on this interface */
85- del_ifidx(drv, ifidx);
86+ if (drv->nlmode == NL80211_IFTYPE_AP)
87+ del_ifidx(drv, ifidx);
88 #endif /* HOSTAPD */
89
90     msg = nlmsg_alloc();
91@@ -3063,7 +3058,8 @@ static int nl80211_create_iface_once(str
92
93 #ifdef HOSTAPD
94     /* start listening for EAPOL on this interface */
95- add_ifidx(drv, ifidx);
96+ if (drv->nlmode == NL80211_IFTYPE_AP)
97+ add_ifidx(drv, ifidx);
98 #endif /* HOSTAPD */
99
100     if (addr && iftype != NL80211_IFTYPE_MONITOR &&
101@@ -4766,6 +4762,7 @@ static void *i802_init(struct hostapd_da
102         return NULL;
103
104     drv = bss->drv;
105+ drv->nlmode = NL80211_IFTYPE_AP;
106     if (linux_br_get(brname, params->ifname) == 0) {
107         wpa_printf(MSG_DEBUG, "nl80211: Interface %s is in bridge %s",
108                params->ifname, brname);
package/hostapd/patches/400-nl80211_sta_auth.patch
1--- a/wpa_supplicant/wpa_supplicant.c
2@@ -543,10 +543,16 @@ void wpa_supplicant_set_state(struct wpa
3         wpa_s->reassociated_connection = 1;
4         wpa_drv_set_operstate(wpa_s, 1);
5         wpa_s->after_wps = 0;
6+#ifndef IEEE8021X_EAPOL
7+ wpa_drv_set_supp_port(wpa_s, 1);
8+#endif
9     } else if (state == WPA_DISCONNECTED || state == WPA_ASSOCIATING ||
10            state == WPA_ASSOCIATED) {
11         wpa_s->new_connection = 1;
12         wpa_drv_set_operstate(wpa_s, 0);
13+#ifndef IEEE8021X_EAPOL
14+ wpa_drv_set_supp_port(wpa_s, 0);
15+#endif
16     }
17     wpa_s->wpa_state = state;
18
package/mac80211/Makefile
1010
1111PKG_NAME:=mac80211
1212
13PKG_VERSION:=2010-03-24
14PKG_RELEASE:=5
13PKG_VERSION:=2010-04-28
14PKG_RELEASE:=1
1515PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources
1616# http://www.orbit-lab.org/kernel/compat-wireless-2.6/2010/11 \
1717# http://wireless.kernel.org/download/compat-wireless-2.6
18PKG_MD5SUM:=73357c52b5d6888ea3228b2ca8aa5eca
18PKG_MD5SUM:=4b8c23ac7f33af7556034635af744c67
1919
2020PKG_SOURCE:=compat-wireless-$(PKG_VERSION).tar.bz2
2121PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/compat-wireless-$(PKG_VERSION)
...... 
425425
426426    config PACKAGE_ATH9K_USE_MINSTREL
427427        bool "use the new minstrel_ht rate control for ath9k"
428        default y
428429
429430    endmenu
430431endef
...... 
531532 - ipw2200
532533endef
533534
535
536define KernelPackage/mwl8k
537  $(call KernelPackage/mac80211/Default)
538  TITLE:=Driver for Marvell TOPDOG 802.11 Wireless cards
539  URL:=http://wireless.kernel.org/en/users/Drivers/mwl8k
540  DEPENDS+= @PCI_SUPPORT +kmod-mac80211
541  FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mwl8k.$(LINUX_KMOD_SUFFIX)
542  AUTOLOAD:=$(call AutoLoad,27,mwl8k)
543endef
544
545define KernelPackage/mwl8k/description
546 Kernel modules for Marvell TOPDOG 802.11 Wireless cards
547endef
548
534549#Broadcom firmware
535550ifneq ($(CONFIG_B43_EXPERIMENTAL),)
536551  PKG_B43_FWV4_NAME:=broadcom-wl
...... 
852867    CONFIG_LIB80211_CRYPT_TKIP= \
853868    CONFIG_IWLWIFI= \
854869    CONFIG_IWLAGN= \
855    CONFIG_MWL8K= \
870    CONFIG_MWL8K=$(if $(CONFIG_PACKAGE_kmod-mwl8k),m) \
856871    CONFIG_ATMEL= \
857872    CONFIG_PCMCIA_ATMEL= \
858873    CONFIG_ADM8211= \
...... 
10511066$(eval $(call KernelPackage,net-libipw))
10521067$(eval $(call KernelPackage,net-ipw2100))
10531068$(eval $(call KernelPackage,net-ipw2200))
1069$(eval $(call KernelPackage,mwl8k))
package/mac80211/files/lib/wifi/mac80211.sh
416416            [ "$(($ht_cap & 1))" -eq 1 ] && append ht_capab "$list LDPC" "$N"
417417            [ "$(($ht_cap & 32))" -eq 32 ] && append ht_capab "$list SHORT-GI-20" "$N"
418418            [ "$(($ht_cap & 64))" -eq 64 ] && append ht_capab "$list SHORT-GI-40" "$N"
419            [ "$(($ht_cap & 128))" -eq 128 ] && append ht_capab "$list TX-STBC" "$N"
420            [ "$(($ht_cap & 768))" -eq 256 ] && append ht_capab "$list RX-STBC1" "$N"
421            [ "$(($ht_cap & 768))" -eq 512 ] && append ht_capab "$list RX-STBC12" "$N"
422            [ "$(($ht_cap & 768))" -eq 768 ] && append ht_capab "$list RX-STBC123" "$N"
419423            [ "$(($ht_cap & 4096))" -eq 4096 ] && append ht_capab "$list DSSS_CCK-40" "$N"
420424        }
421425        iw phy "$dev" info | grep -q '2412 MHz' || { mode_band="a"; channel="36"; }
package/mac80211/patches/001-disable_b44.patch
11--- a/config.mk
22+++ b/config.mk
3@@ -269,8 +269,8 @@ endif
3@@ -256,8 +256,8 @@ endif
44
55 CONFIG_P54_PCI=m
66
package/mac80211/patches/002-disable_rfkill.patch
99
1010 ifeq ($(CONFIG_MAC80211),y)
1111 $(error "ERROR: you have MAC80211 compiled into the kernel, CONFIG_MAC80211=y, as such you cannot replace its mac80211 driver. You need this set to CONFIG_MAC80211=m. If you are using Fedora upgrade your kernel as later version should this set as modular. For further information on Fedora see https://bugzilla.redhat.com/show_bug.cgi?id=470143. If you are using your own kernel recompile it and make mac80211 modular")
12@@ -492,8 +492,8 @@ endif
12@@ -481,8 +481,8 @@ endif
1313 # We need the backported rfkill module on kernel < 2.6.31.
1414 # In more recent kernel versions use the in kernel rfkill module.
1515 ifdef CONFIG_COMPAT_KERNEL_31
package/mac80211/patches/007-remove_misc_drivers.patch
11--- a/config.mk
22+++ b/config.mk
3@@ -299,10 +299,10 @@ endif
3@@ -286,10 +286,10 @@ endif
44 CONFIG_MWL8K=m
55
66 # Ethernet drivers go here
...... 
1515
1616 CONFIG_HERMES=m
1717 CONFIG_HERMES_CACHE_FW_ON_INIT=y
18@@ -355,10 +355,10 @@ CONFIG_USB_NET_COMPAT_RNDIS_HOST=n
18@@ -342,10 +342,10 @@ CONFIG_USB_NET_COMPAT_RNDIS_HOST=n
1919 CONFIG_USB_NET_COMPAT_RNDIS_WLAN=n
2020 CONFIG_USB_NET_COMPAT_CDCETHER=n
2121 else
package/mac80211/patches/010-no_pcmcia.patch
99  CONFIG_SSB=m
1010 else
1111 include $(KLIB_BUILD)/.config
12@@ -194,7 +194,7 @@ CONFIG_B43=m
12@@ -181,7 +181,7 @@ CONFIG_B43=m
1313 CONFIG_B43_HWRNG=y
1414 CONFIG_B43_PCI_AUTOSELECT=y
1515 ifneq ($(CONFIG_PCMCIA),)
...... 
1818 endif
1919 CONFIG_B43_LEDS=y
2020 CONFIG_B43_PHY_LP=y
21@@ -246,7 +246,7 @@ CONFIG_SSB_BLOCKIO=y
21@@ -233,7 +233,7 @@ CONFIG_SSB_BLOCKIO=y
2222 CONFIG_SSB_PCIHOST=y
2323 CONFIG_SSB_B43_PCI_BRIDGE=y
2424 ifneq ($(CONFIG_PCMCIA),)
package/mac80211/patches/011-no_sdio.patch
11--- a/config.mk
22+++ b/config.mk
3@@ -407,8 +407,8 @@ endif # end of SPI driver list
3@@ -396,8 +396,8 @@ endif # end of SPI driver list
44
55 ifneq ($(CONFIG_MMC),)
66
package/mac80211/patches/013-disable_b43_nphy.patch
11--- a/config.mk
22+++ b/config.mk
3@@ -198,7 +198,7 @@ ifneq ($(CONFIG_PCMCIA),)
3@@ -185,7 +185,7 @@ ifneq ($(CONFIG_PCMCIA),)
44 endif
55 CONFIG_B43_LEDS=y
66 CONFIG_B43_PHY_LP=y
package/mac80211/patches/014-add_iw_handler.patch
1commit b7d48ccc687c44213121b1b565dccdc4488f5d9a
2Author: Pavel Roskin <proski@gnu.org>
3Date: Wed Mar 24 17:23:37 2010 -0400
4
5    compat: add compat-2.6.35.h and IW_HANDLER
6
7    Signed-off-by: Pavel Roskin <proski@gnu.org>
8
9+++ b/include/linux/compat-2.6.35.h
10@@ -0,0 +1,13 @@
11+#ifndef LINUX_26_35_COMPAT_H
12+#define LINUX_26_35_COMPAT_H
13+
14+#include <linux/version.h>
15+
16+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35))
17+
18+#define IW_HANDLER(id, func) \
19+ [IW_IOCTL_IDX(id)] = func
20+
21+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)) */
22+
23+#endif /* LINUX_26_35_COMPAT_H */
24+++ b/include/linux/compat-2.6.h
25@@ -27,5 +27,6 @@
26 #include <linux/compat-2.6.32.h>
27 #include <linux/compat-2.6.33.h>
28 #include <linux/compat-2.6.34.h>
29+#include <linux/compat-2.6.35.h>
30
31 #endif /* LINUX_26_COMPAT_H */
package/mac80211/patches/015-remove-rt2x00-options.patch
11--- a/config.mk
22+++ b/config.mk
3@@ -276,12 +276,12 @@ CONFIG_RTL8180=m
3@@ -248,12 +248,12 @@ CONFIG_RTL8180=m
44
55 CONFIG_ADM8211=m
66
...... 
1515 # CONFIG_RT2800PCI_RT30XX=y
1616 # CONFIG_RT2800PCI_RT35XX=y
1717 # CONFIG_RT2800PCI_SOC=y
18@@ -381,7 +381,7 @@ CONFIG_RT2800USB=m
18@@ -355,7 +355,7 @@ CONFIG_RT2800USB=m
1919 # CONFIG_RT2800USB_RT35XX=y
2020 # CONFIG_RT2800USB_UNKNOWN=y
2121 endif
package/mac80211/patches/120-compat_rcu_dereference.patch
1--- a/include/linux/compat-2.6.34.h
2@@ -197,6 +197,8 @@ do { \
3  */
4 #define sysfs_bin_attr_init(bin_attr) sysfs_attr_init(&(bin_attr)->attr)
5
6+#define rcu_dereference_check(p, c) rcu_dereference(p)
7+
8 #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34)) */
9
10 #endif /* LINUX_26_34_COMPAT_H */
package/mac80211/patches/130-tracepoint_include_linux_version_h.patch
1--- a/include/linux/tracepoint.h
2@@ -3,6 +3,8 @@
3
4 #include <linux/version.h>
5
6+#include <linux/version.h>
7+
8 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,27))
9 #include_next <linux/tracepoint.h>
10 #endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,27)) */
package/mac80211/patches/300-fix-mesh.patch
1From 181ce6f71d907f42ab73376ce154015a835a6d8a Mon Sep 17 00:00:00 2001
2From: Javier Cardona <javier@cozybit.com>
3Date: Mon, 29 Mar 2010 11:00:20 -0700
4Subject: [PATCH] mac80211: Handle mesh action frames in ieee80211_rx_h_action
5
6This fixes the problem introduced in commit
78404080568613d93ad7cf0a16dfb68 which broke mesh peer link establishment.
8
9changes:
10v2 Added missing break (Johannes)
11v3 Broke original patch into two (Johannes)
12
13Signed-off-by: Javier Cardona <javier@cozybit.com>
14Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
15 net/mac80211/mesh.c | 3 ---
16 net/mac80211/rx.c | 5 +++++
17 2 files changed, 5 insertions(+), 3 deletions(-)
18
19+++ b/net/mac80211/mesh.c
20@@ -749,9 +749,6 @@ ieee80211_mesh_rx_mgmt(struct ieee80211_
21
22     switch (fc & IEEE80211_FCTL_STYPE) {
23     case IEEE80211_STYPE_ACTION:
24- if (skb->len < IEEE80211_MIN_ACTION_SIZE)
25- return RX_DROP_MONITOR;
26- /* fall through */
27     case IEEE80211_STYPE_PROBE_RESP:
28     case IEEE80211_STYPE_BEACON:
29         skb_queue_tail(&ifmsh->skb_queue, skb);
30+++ b/net/mac80211/rx.c
31@@ -1964,6 +1964,11 @@ ieee80211_rx_h_action(struct ieee80211_r
32             goto handled;
33         }
34         break;
35+ case MESH_PLINK_CATEGORY:
36+ case MESH_PATH_SEL_CATEGORY:
37+ if (ieee80211_vif_is_mesh(&sdata->vif))
38+ return ieee80211_mesh_rx_mgmt(sdata, rx->skb);
39+ break;
40     }
41
42     /*
package/mac80211/patches/403-ath9k-fix-invalid-mac-address-handling.patch
11--- a/drivers/net/wireless/ath/ath9k/hw.c
22+++ b/drivers/net/wireless/ath/ath9k/hw.c
3@@ -15,6 +15,7 @@
4  */
3@@ -16,6 +16,7 @@
54
65 #include <linux/io.h>
6 #include <linux/slab.h>
77+#include <linux/etherdevice.h>
88 #include <asm/unaligned.h>
99
1010 #include "hw.h"
11@@ -441,8 +442,16 @@ static int ath9k_hw_init_macaddr(struct
11@@ -456,8 +457,16 @@ static int ath9k_hw_init_macaddr(struct
1212         common->macaddr[2 * i] = eeval >> 8;
1313         common->macaddr[2 * i + 1] = eeval & 0xff;
1414     }
package/mac80211/patches/404-ath_regd_optional.patch
11--- a/drivers/net/wireless/ath/regd.c
22+++ b/drivers/net/wireless/ath/regd.c
3@@ -19,6 +19,9 @@
3@@ -18,6 +18,9 @@
44 #include <net/cfg80211.h>
55 #include <net/mac80211.h>
66 #include "regd.h"
package/mac80211/patches/405-ath9k-read-eeprom-data-from-platform-data-on-pci-bus.patch
88 #include "ath9k.h"
99
1010 static DEFINE_PCI_DEVICE_TABLE(ath_pci_id_table) = {
11@@ -52,21 +53,36 @@ static void ath_pci_read_cachesize(struc
11@@ -53,21 +54,36 @@ static void ath_pci_read_cachesize(struc
1212
1313 static bool ath_pci_eeprom_read(struct ath_common *common, u32 off, u16 *data)
1414 {
package/mac80211/patches/406-ath9k-set-AH_USE_EEPROM-only-if-no-platform-data-present.patch
1+++ b/drivers/net/wireless/ath/ath9k/hw.c
2@@ -385,11 +385,8 @@ static void ath9k_hw_init_defaults(struc
3     ah->hw_version.magic = AR5416_MAGIC;
4     ah->hw_version.subvendorid = 0;
5
6- ah->ah_flags = 0;
7     if (ah->hw_version.devid == AR5416_AR9100_DEVID)
8         ah->hw_version.macVersion = AR_SREV_VERSION_9100;
9- if (!AR_SREV_9100(ah))
10- ah->ah_flags = AH_USE_EEPROM;
11
12     ah->atim_window = 0;
13     ah->sta_id1_defaults = AR_STA_ID1_CRPT_MIC_ENABLE;
141--- a/drivers/net/wireless/ath/ath9k/main.c
152+++ b/drivers/net/wireless/ath/ath9k/main.c
163@@ -15,6 +15,7 @@
...... 
2410
2511--- a/drivers/net/wireless/ath/ath9k/init.c
2612+++ b/drivers/net/wireless/ath/ath9k/init.c
27@@ -531,6 +531,7 @@ static int ath9k_init_softc(u16 devid, s
13@@ -565,6 +565,7 @@ static int ath9k_init_softc(u16 devid, s
2814 {
2915     struct ath_hw *ah = NULL;
3016     struct ath_common *common;
...... 
3218     int ret = 0, i;
3319     int csz = 0;
3420
35@@ -542,6 +543,10 @@ static int ath9k_init_softc(u16 devid, s
21@@ -576,6 +577,10 @@ static int ath9k_init_softc(u16 devid, s
3622     ah->hw_version.subsysid = subsysid;
3723     sc->sc_ah = ah;
3824
...... 
4329     common = ath9k_hw_common(ah);
4430     common->ops = &ath9k_common_ops;
4531     common->bus_ops = bus_ops;
32--- a/drivers/net/wireless/ath/ath9k/hw.c
33@@ -429,10 +429,6 @@ static void ath9k_hw_init_defaults(struc
34     ah->hw_version.magic = AR5416_MAGIC;
35     ah->hw_version.subvendorid = 0;
36
37- ah->ah_flags = 0;
38- if (!AR_SREV_9100(ah))
39- ah->ah_flags = AH_USE_EEPROM;
40-
41     ah->atim_window = 0;
42     ah->sta_id1_defaults = AR_STA_ID1_CRPT_MIC_ENABLE;
43     ah->beacon_interval = 100;
package/mac80211/patches/407-ath9k-override-mac-address-from-platform-data.patch
11--- a/drivers/net/wireless/ath/ath9k/hw.c
22+++ b/drivers/net/wireless/ath/ath9k/hw.c
3@@ -16,8 +16,10 @@
4
3@@ -17,8 +17,10 @@
54 #include <linux/io.h>
5 #include <linux/slab.h>
66 #include <linux/etherdevice.h>
77+#include <linux/ath9k_platform.h>
88 #include <asm/unaligned.h>
99
1010+#include "ath9k.h"
1111 #include "hw.h"
12 #include "hw-ops.h"
1213 #include "rc.h"
13 #include "initvals.h"
14@@ -428,17 +430,23 @@ static int ath9k_hw_rf_claim(struct ath_
14@@ -441,18 +443,23 @@ static void ath9k_hw_init_defaults(struc
1515 static int ath9k_hw_init_macaddr(struct ath_hw *ah)
1616 {
1717     struct ath_common *common = ath9k_hw_common(ah);
...... 
2020     u32 sum;
2121     int i;
2222     u16 eeval;
23     u32 EEP_MAC[] = { EEP_MAC_LSW, EEP_MAC_MID, EEP_MAC_MSW };
2324
2425     sum = 0;
2526- for (i = 0; i < 3; i++) {
26- eeval = ah->eep_ops->get_eeprom(ah, AR_EEPROM_MAC(i));
27- eeval = ah->eep_ops->get_eeprom(ah, EEP_MAC[i]);
2728- sum += eeval;
2829- common->macaddr[2 * i] = eeval >> 8;
2930- common->macaddr[2 * i + 1] = eeval & 0xff;
...... 
3233+ memcpy(common->macaddr, pdata->macaddr, ETH_ALEN);
3334+ else
3435+ for (i = 0; i < 3; i++) {
35+ eeval = ah->eep_ops->get_eeprom(ah, AR_EEPROM_MAC(i));
36+ eeval = ah->eep_ops->get_eeprom(ah, EEP_MAC[i]);
3637+ sum += eeval;
3738+ common->macaddr[2 * i] = eeval >> 8;
3839+ common->macaddr[2 * i + 1] = eeval & 0xff;
3940+ }
40+
4141     if (!is_valid_ether_addr(common->macaddr)) {
4242         ath_print(common, ATH_DBG_EEPROM,
4343             "eeprom contains invalid mac address: %pM\n",
package/mac80211/patches/408-ath9k_tweak_rx_intr_mitigation.patch
11--- a/drivers/net/wireless/ath/ath9k/hw.c
22+++ b/drivers/net/wireless/ath/ath9k/hw.c
3@@ -2097,7 +2097,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st
3@@ -1380,7 +1380,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st
44
55     if (ah->config.rx_intr_mitigation) {
66         REG_RMW_FIELD(ah, AR_RIMT, AR_RIMT_LAST, 500);
...... 
88+ REG_RMW_FIELD(ah, AR_RIMT, AR_RIMT_FIRST, 500);
99     }
1010
11     ath9k_hw_init_bb(ah, chan);
11     if (ah->config.tx_intr_mitigation) {
package/mac80211/patches/409-ath9k-add-wndr3700-antenna-initialization.patch
11--- a/drivers/net/wireless/ath/ath9k/init.c
22+++ b/drivers/net/wireless/ath/ath9k/init.c
3@@ -14,6 +14,7 @@
4  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
5  */
3@@ -16,6 +16,7 @@
4
5 #include <linux/slab.h>
66
77+#include "linux/ath9k_platform.h"
88 #include "ath9k.h"
99
1010 static char *dev_info = "ath9k";
11@@ -546,6 +547,8 @@ static int ath9k_init_softc(u16 devid, s
11@@ -580,6 +581,8 @@ static int ath9k_init_softc(u16 devid, s
1212     pdata = (struct ath9k_platform_data *) sc->dev->platform_data;
1313     if (!pdata)
1414         ah->ah_flags |= AH_USE_EEPROM;
...... 
1717
1818     common = ath9k_hw_common(ah);
1919     common->ops = &ath9k_common_ops;
20@@ -671,6 +674,24 @@ void ath9k_set_hw_capab(struct ath_softc
20@@ -702,6 +705,24 @@ void ath9k_set_hw_capab(struct ath_softc
2121     SET_IEEE80211_PERM_ADDR(hw, common->macaddr);
2222 }
2323
...... 
4242 int ath9k_init_device(u16 devid, struct ath_softc *sc, u16 subsysid,
4343             const struct ath_bus_ops *bus_ops)
4444 {
45@@ -689,6 +710,9 @@ int ath9k_init_device(u16 devid, struct
45@@ -720,6 +741,9 @@ int ath9k_init_device(u16 devid, struct
4646     common = ath9k_hw_common(ah);
4747     ath9k_set_hw_capab(sc, hw);
4848
...... 
5454                   ath9k_reg_notifier);
5555--- a/drivers/net/wireless/ath/ath9k/ath9k.h
5656+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
57@@ -511,6 +511,8 @@ struct ath_softc {
58     struct ath_beacon_config cur_beacon_conf;
59     struct delayed_work tx_complete_work;
60     struct ath_btcoex btcoex;
61+
62+ unsigned long quirk_wndr3700:1;
63 };
57@@ -517,6 +517,8 @@ struct ath_softc {
6458
65 struct ath_wiphy {
59     int beacon_interval;
60
61+ bool quirk_wndr3700;
62+
63 #ifdef CONFIG_ATH9K_DEBUGFS
64     struct ath9k_debug debug;
65 #endif
6666--- a/include/linux/ath9k_platform.h
6767+++ b/include/linux/ath9k_platform.h
6868@@ -24,6 +24,8 @@
...... 
7070     u16 eeprom_data[ATH9K_PLAT_EEP_MAX_WORDS];
7171     u8 *macaddr;
7272+
73+ unsigned long quirk_wndr3700:1;
73+ bool quirk_wndr3700;
7474 };
7575
7676 #endif /* _LINUX_ATH9K_PLATFORM_H */
package/mac80211/patches/410-ath9k-wndr3700-led-pin-fix.patch
1313         sc->sc_ah->led_pin = ATH_LED_PIN_DEF;
1414--- a/drivers/net/wireless/ath/ath9k/ath9k.h
1515+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
16@@ -379,6 +379,7 @@ void ath9k_btcoex_timer_pause(struct ath
16@@ -392,6 +392,7 @@ void ath9k_btcoex_timer_pause(struct ath
1717
1818 #define ATH_LED_PIN_DEF 1
1919 #define ATH_LED_PIN_9287 8
package/mac80211/patches/500-ath9k_debugfs_chainmask.patch
11--- a/drivers/net/wireless/ath/ath9k/debug.c
22+++ b/drivers/net/wireless/ath/ath9k/debug.c
3@@ -77,6 +77,90 @@ static const struct file_operations fops
3@@ -78,6 +78,90 @@ static const struct file_operations fops
44
55 #define DMA_BUF_LEN 1024
66
...... 
9191 static ssize_t read_file_dma(struct file *file, char __user *user_buf,
9292                  size_t count, loff_t *ppos)
9393 {
94@@ -719,6 +803,16 @@ int ath9k_init_debug(struct ath_hw *ah)
94@@ -731,6 +815,16 @@ int ath9k_init_debug(struct ath_hw *ah)
9595         goto err;
9696 #endif
9797
...... 
108108     sc->debug.debugfs_dma = debugfs_create_file("dma", S_IRUSR,
109109                        sc->debug.debugfs_phy, sc, &fops_dma);
110110     if (!sc->debug.debugfs_dma)
111@@ -769,6 +863,8 @@ void ath9k_exit_debug(struct ath_hw *ah)
111@@ -781,6 +875,8 @@ void ath9k_exit_debug(struct ath_hw *ah)
112112     struct ath_common *common = ath9k_hw_common(ah);
113113     struct ath_softc *sc = (struct ath_softc *) common->priv;
114114
...... 
119119     debugfs_remove(sc->debug.debugfs_wiphy);
120120--- a/drivers/net/wireless/ath/ath9k/debug.h
121121+++ b/drivers/net/wireless/ath/ath9k/debug.h
122@@ -148,6 +148,8 @@ struct ath_stats {
122@@ -152,6 +152,8 @@ struct ath_stats {
123123 };
124124
125125 struct ath9k_debug {
package/mac80211/patches/510-ath9k_debugfs_regaccess.patch
11--- a/drivers/net/wireless/ath/ath9k/debug.c
22+++ b/drivers/net/wireless/ath/ath9k/debug.c
3@@ -783,6 +783,86 @@ static const struct file_operations fops
3@@ -795,6 +795,86 @@ static const struct file_operations fops
44     .owner = THIS_MODULE
55 };
66
...... 
8787 int ath9k_init_debug(struct ath_hw *ah)
8888 {
8989     struct ath_common *common = ath9k_hw_common(ah);
90@@ -852,6 +932,17 @@ int ath9k_init_debug(struct ath_hw *ah)
90@@ -864,6 +944,17 @@ int ath9k_init_debug(struct ath_hw *ah)
9191     if (!sc->debug.debugfs_recv)
9292         goto err;
9393
...... 
105105     return 0;
106106 err:
107107     ath9k_exit_debug(ah);
108@@ -865,6 +956,8 @@ void ath9k_exit_debug(struct ath_hw *ah)
108@@ -877,6 +968,8 @@ void ath9k_exit_debug(struct ath_hw *ah)
109109
110110     debugfs_remove(sc->debug.debugfs_tx_chainmask);
111111     debugfs_remove(sc->debug.debugfs_rx_chainmask);
...... 
116116     debugfs_remove(sc->debug.debugfs_wiphy);
117117--- a/drivers/net/wireless/ath/ath9k/debug.h
118118+++ b/drivers/net/wireless/ath/ath9k/debug.h
119@@ -158,6 +158,9 @@ struct ath9k_debug {
119@@ -162,6 +162,9 @@ struct ath9k_debug {
120120     struct dentry *debugfs_wiphy;
121121     struct dentry *debugfs_xmit;
122122     struct dentry *debugfs_recv;
package/mac80211/patches/520-cfg80211_get_freq.patch
2020 }
2121--- a/net/wireless/nl80211.c
2222+++ b/net/wireless/nl80211.c
23@@ -886,6 +886,11 @@ static int nl80211_send_iface(struct sk_
23@@ -887,6 +887,11 @@ static int nl80211_send_iface(struct sk_
2424     NLA_PUT_U32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx);
2525     NLA_PUT_STRING(msg, NL80211_ATTR_IFNAME, dev->name);
2626     NLA_PUT_U32(msg, NL80211_ATTR_IFTYPE, dev->ieee80211_ptr->iftype);
package/mac80211/patches/530-minstrel_ht.patch
1313 mac80211-$(CONFIG_MAC80211_RC_MINSTREL) += $(rc80211_minstrel-y)
1414--- a/net/mac80211/main.c
1515+++ b/net/mac80211/main.c
16@@ -714,6 +714,10 @@ static int __init ieee80211_init(void)
16@@ -716,6 +716,10 @@ static int __init ieee80211_init(void)
1717     if (ret)
1818         return ret;
1919
...... 
2424     ret = rc80211_pid_init();
2525     if (ret)
2626         goto err_pid;
27@@ -726,6 +730,8 @@ static int __init ieee80211_init(void)
27@@ -728,6 +732,8 @@ static int __init ieee80211_init(void)
2828  err_netdev:
2929     rc80211_pid_exit();
3030  err_pid:
...... 
3333     rc80211_minstrel_exit();
3434
3535     return ret;
36@@ -734,6 +740,7 @@ static int __init ieee80211_init(void)
36@@ -736,6 +742,7 @@ static int __init ieee80211_init(void)
3737 static void __exit ieee80211_exit(void)
3838 {
3939     rc80211_pid_exit();
...... 
6868
6969--- /dev/null
7070+++ b/net/mac80211/rc80211_minstrel_ht.c
71@@ -0,0 +1,815 @@
71@@ -0,0 +1,822 @@
7272+/*
7373+ * Copyright (C) 2010 Felix Fietkau <nbd@openwrt.org>
7474+ *
...... 
389389+ if (!mg->supported)
390390+ continue;
391391+
392+ if (++mg->index > MCS_GROUP_RATES) {
392+ if (++mg->index >= MCS_GROUP_RATES) {
393393+ mg->index = 0;
394+ if (++mg->column > ARRAY_SIZE(sample_table))
394+ if (++mg->column >= ARRAY_SIZE(sample_table))
395395+ mg->column = 0;
396396+ }
397397+ break;
...... 
474474+ mi->ampdu_len += info->status.ampdu_len;
475475+
476476+ if (!mi->sample_wait && !mi->sample_tries && mi->sample_count > 0) {
477+ mi->sample_wait = 4 + MINSTREL_TRUNC(mi->avg_ampdu_len);
477+ mi->sample_wait = 4 + 2 * MINSTREL_TRUNC(mi->avg_ampdu_len);
478478+ mi->sample_tries = 3;
479479+ mi->sample_count--;
480480+ }
...... 
660660+ if (!msp->is_ht)
661661+ return mac80211_minstrel.get_rate(priv, sta, &msp->legacy, txrc);
662662+
663+ info->flags |= mi->tx_flags;
663664+ sample_idx = minstrel_get_sample_rate(mp, mi);
664665+ if (sample_idx >= 0) {
665666+ minstrel_ht_set_rate(mp, mi, &ar[0], sample_idx,
...... 
733734+ }
734735+ mi->sample_tries = 4;
735736+
737+ if (sta_cap & IEEE80211_HT_CAP_TX_STBC)
738+ mi->tx_flags |= IEEE80211_TX_CTL_STBC;
739+
740+ if (sta_cap & IEEE80211_HT_CAP_LDPC_CODING)
741+ mi->tx_flags |= IEEE80211_TX_CTL_LDPC;
742+
736743+ if (oper_chan_type != NL80211_CHAN_HT40MINUS &&
737744+ oper_chan_type != NL80211_CHAN_HT40PLUS)
738745+ sta_cap &= ~IEEE80211_HT_CAP_SUP_WIDTH_20_40;
...... 
886893+}
887894--- /dev/null
888895+++ b/net/mac80211/rc80211_minstrel_ht.h
889@@ -0,0 +1,125 @@
896@@ -0,0 +1,128 @@
890897+/*
891898+ * Copyright (C) 2010 Felix Fietkau <nbd@openwrt.org>
892899+ *
...... 
899906+#define __RC_MINSTREL_HT_H
900907+
901908+/*
902+ * maximum number of spatial streams to make use of
903+ * set this value to 3 once we have drivers that support it
909+ * The number of streams can be changed to 2 to reduce code
910+ * size and memory footprint.
904911+ */
905+#define MINSTREL_MAX_STREAMS 2
912+#define MINSTREL_MAX_STREAMS 3
906913+#define MINSTREL_STREAM_GROUPS 4
907914+
908915+/* scaled fraction values */
...... 
983990+ unsigned int total_packets;
984991+ unsigned int sample_packets;
985992+
993+ /* tx flags to add for frames for this sta */
994+ u32 tx_flags;
995+
986996+ u8 sample_wait;
987997+ u8 sample_tries;
988998+ u8 sample_count;
package/mac80211/patches/540-ath9k_use_minstrel.patch
11--- a/drivers/net/wireless/ath/ath9k/init.c
22+++ b/drivers/net/wireless/ath/ath9k/init.c
3@@ -655,7 +655,11 @@ void ath9k_set_hw_capab(struct ath_softc
3@@ -686,7 +686,11 @@ void ath9k_set_hw_capab(struct ath_softc
44     hw->sta_data_size = sizeof(struct ath_node);
55     hw->vif_data_size = sizeof(struct ath_vif);
66
package/mac80211/patches/550-ath9k_bb_fix.patch
1+++ b/drivers/net/wireless/ath/ath9k/hw.c
2@@ -1911,6 +1911,34 @@ static void ath9k_enable_rfkill(struct a
3     REG_SET_BIT(ah, AR_PHY_TEST, RFSILENT_BB);
4 }
5
6+bool ath9k_hw_check_alive(struct ath_hw *ah)
7+{
8+ int count = 50;
9+ u32 reg;
10+
11+ if (AR_SREV_9285_10_OR_LATER(ah))
12+ return true;
13+
14+ do {
15+ reg = REG_READ(ah, AR_OBS_BUS_1);
16+
17+ if ((reg & 0x7E7FFFEF) == 0x00702400)
18+ continue;
19+
20+ switch (reg & 0x7E000B00) {
21+ case 0x1E000000:
22+ case 0x52000B00:
23+ case 0x18000B00:
24+ continue;
25+ default:
26+ return true;
27+ }
28+ } while (count-- > 0);
29+
30+ return false;
31+}
32+EXPORT_SYMBOL(ath9k_hw_check_alive);
33+
34 int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
35             bool bChannelChange)
36 {
37+++ b/drivers/net/wireless/ath/ath9k/hw.h
38@@ -679,6 +679,7 @@ void ath9k_hw_set11nmac2040(struct ath_h
39 void ath9k_hw_beaconinit(struct ath_hw *ah, u32 next_beacon, u32 beacon_period);
40 void ath9k_hw_set_sta_beacon_timers(struct ath_hw *ah,
41                     const struct ath9k_beacon_state *bs);
42+bool ath9k_hw_check_alive(struct ath_hw *ah);
43
44 bool ath9k_hw_setpower(struct ath_hw *ah, enum ath9k_power_mode mode);
45
46+++ b/drivers/net/wireless/ath/ath9k/main.c
47@@ -405,7 +405,8 @@ void ath9k_tasklet(unsigned long data)
48
49     ath9k_ps_wakeup(sc);
50
51- if (status & ATH9K_INT_FATAL) {
52+ if ((status & ATH9K_INT_FATAL) ||
53+ !ath9k_hw_check_alive(ah)) {
54         ath_reset(sc, false);
55         ath9k_ps_restore(sc);
56         return;
package/mac80211/patches/550-ath9k_no_multi_desc_frames.patch
1--- a/drivers/net/wireless/ath/ath9k/common.c
2@@ -57,13 +57,19 @@ static bool ath9k_rx_accept(struct ath_c
3      * rs_more indicates chained descriptors which can be used
4      * to link buffers together for a sort of scatter-gather
5      * operation.
6- *
7+ * reject the frame, we don't support scatter-gather yet and
8+ * the frame is probably corrupt anyway
9+ */
10+ if (rx_stats->rs_more)
11+ return false;
12+
13+ /*
14      * The rx_stats->rs_status will not be set until the end of the
15      * chained descriptors so it can be ignored if rs_more is set. The
16      * rs_more will be false at the last element of the chained
17      * descriptors.
18      */
19- if (!rx_stats->rs_more && rx_stats->rs_status != 0) {
20+ if (rx_stats->rs_status != 0) {
21         if (rx_stats->rs_status & ATH9K_RXERR_CRC)
22             rxs->flag |= RX_FLAG_FAILED_FCS_CRC;
23         if (rx_stats->rs_status & ATH9K_RXERR_PHY)
package/mac80211/patches/600-rt2x00-disable-pci-code-if-CONFIG_PCI-not-defined.patch
11--- a/drivers/net/wireless/rt2x00/rt2x00pci.c
22+++ b/drivers/net/wireless/rt2x00/rt2x00pci.c
3@@ -223,6 +223,7 @@ void rt2x00pci_uninitialize(struct rt2x0
3@@ -225,6 +225,7 @@ void rt2x00pci_uninitialize(struct rt2x0
44 }
55 EXPORT_SYMBOL_GPL(rt2x00pci_uninitialize);
66
...... 
88 /*
99  * PCI driver handlers.
1010  */
11@@ -397,6 +398,7 @@ int rt2x00pci_resume(struct pci_dev *pci
11@@ -399,6 +400,7 @@ int rt2x00pci_resume(struct pci_dev *pci
1212 }
1313 EXPORT_SYMBOL_GPL(rt2x00pci_resume);
1414 #endif /* CONFIG_PM */
package/mac80211/patches/601-rt2x00-lib-use-rt2x00dev-irq.patch
11--- a/drivers/net/wireless/rt2x00/rt2x00pci.c
22+++ b/drivers/net/wireless/rt2x00/rt2x00pci.c
3@@ -213,7 +213,7 @@ void rt2x00pci_uninitialize(struct rt2x0
3@@ -215,7 +215,7 @@ void rt2x00pci_uninitialize(struct rt2x0
44     /*
55      * Free irq line.
66      */
package/mac80211/patches/602-rt2x00-remove-mcu-requests-for-soc.patch
1From f18d4463d092162f34a8bd226505627ceeac3e8a Mon Sep 17 00:00:00 2001
2From: Luis Correia <luis.f.correia@gmail.com>
3Date: Sat, 3 Apr 2010 12:49:53 +0100
4Subject: [PATCH] rt2x00: remove MCU requests for SoC platforms
5
16The ralink SoC platforms do not have an MCU.
27
38Signed-off-by: Luis Correia <luis.f.correia@gmail.com>
9Acked-by: Ivo van Doorn <IvDoorn@gmail.com>
10Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com>
411---
12 drivers/net/wireless/rt2x00/rt2800pci.c | 6 ++++++
13 1 files changed, 6 insertions(+), 0 deletions(-)
514
6+++ b/drivers/net/wireless/rt2x00/rt2800lib.c
7@@ -221,9 +221,9 @@ void rt2800_mcu_request(struct rt2x00_de
8     u32 reg;
9
10     /*
11- * SOC devices don't support MCU requests.
12+ * some devices don't support MCU requests.
13      */
14- if (rt2x00_is_soc(rt2x00dev))
15+ if (!test_bit(DRIVER_REQUIRE_MCU, &rt2x00dev->flags))
16         return;
17
18     mutex_lock(&rt2x00dev->csr_mutex);
1915--- a/drivers/net/wireless/rt2x00/rt2800pci.c
2016+++ b/drivers/net/wireless/rt2x00/rt2800pci.c
21@@ -60,6 +60,12 @@ static void rt2800pci_mcu_status(struct
22     unsigned int i;
23     u32 reg;
17@@ -66,6 +66,12 @@ static void rt2800pci_mcu_status(struct
18     if (rt2x00_is_soc(rt2x00dev))
19         return;
2420
2521+ /*
26+ * some devices don't support MCU requests.
22+ * SOC devices don't support MCU requests.
2723+ */
28+ if (!test_bit(DRIVER_REQUIRE_MCU, &rt2x00dev->flags))
24+ if (rt2x00_is_soc(rt2x00dev))
2925+ return;
3026+
3127     for (i = 0; i < 200; i++) {
3228         rt2800_register_read(rt2x00dev, H2M_MAILBOX_CID, &reg);
3329
34@@ -1098,10 +1104,12 @@ static int rt2800pci_probe_hw(struct rt2
35     __set_bit(DRIVER_SUPPORT_CONTROL_FILTER_PSPOLL, &rt2x00dev->flags);
36
37     /*
38- * This device requires firmware.
39+ * This device requires firmware and MCU access.
40      */
41- if (!rt2x00_is_soc(rt2x00dev))
42+ if (!rt2x00_is_soc(rt2x00dev)){
43         __set_bit(DRIVER_REQUIRE_FIRMWARE, &rt2x00dev->flags);
44+ __set_bit(DRIVER_REQUIRE_MCU, &rt2x00dev->flags);
45+ }
46     __set_bit(DRIVER_REQUIRE_DMA, &rt2x00dev->flags);
47     __set_bit(DRIVER_REQUIRE_L2PAD, &rt2x00dev->flags);
48     if (!modparam_nohwcrypt)
49+++ b/drivers/net/wireless/rt2x00/rt2x00.h
50@@ -631,6 +631,7 @@ enum rt2x00_flags {
51      * Driver requirements
52      */
53     DRIVER_REQUIRE_FIRMWARE,
54+ DRIVER_REQUIRE_MCU,
55     DRIVER_REQUIRE_BEACON_GUARD,
56     DRIVER_REQUIRE_ATIM_QUEUE,
57     DRIVER_REQUIRE_DMA,
package/mac80211/patches/700-mwl8k-missing-pci-id-for-WNR854T.patch
1--- a/drivers/net/wireless/mwl8k.c
2@@ -3850,6 +3850,7 @@ MODULE_FIRMWARE("mwl8k/helper_8366.fw");
3 MODULE_FIRMWARE("mwl8k/fmimage_8366.fw");
4
5 static DEFINE_PCI_DEVICE_TABLE(mwl8k_pci_id_table) = {
6+ { PCI_VDEVICE(MARVELL, 0x2a02), .driver_data = MWL8363, },
7     { PCI_VDEVICE(MARVELL, 0x2a0a), .driver_data = MWL8363, },
8     { PCI_VDEVICE(MARVELL, 0x2a0c), .driver_data = MWL8363, },
9     { PCI_VDEVICE(MARVELL, 0x2a24), .driver_data = MWL8363, },

Archive Download the corresponding diff file



interactive