From 39551082d50520fb9cbdf74aaf3dddf38071b175 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Tue, 4 May 2010 15:36:29 +0000 Subject: [PATCH] [backfire] backport mac80211 and hostapd from trunk SVN-Revision: 21354 --- package/hostapd/Makefile | 4 +- package/hostapd/files/hostapd.sh | 5 + .../hostapd/patches/001-nl80211_sync.patch | 21 ++++ package/hostapd/patches/110-countrycode.patch | 2 +- package/hostapd/patches/130-scan_wait.patch | 20 ++-- package/hostapd/patches/200-multicall.patch | 28 ++--- package/hostapd/patches/310-scan_ssid.patch | 4 +- .../patches/320-rescan_immediately.patch | 14 +-- package/hostapd/patches/350-wds_fix.patch | 4 +- package/hostapd/patches/360-wds_bridge.patch | 8 +- package/hostapd/patches/370-basic_rates.patch | 2 +- package/hostapd/patches/380-ap_isolate.patch | 108 +++++++++++++++++ .../hostapd/patches/390-nl80211_fixes.patch | 109 ++++++++++++++++++ .../patches/400-nl80211_sta_auth.patch | 19 +++ package/mac80211/Makefile | 24 +++- package/mac80211/files/lib/wifi/mac80211.sh | 4 + .../mac80211/patches/001-disable_b44.patch | 2 +- .../mac80211/patches/002-disable_rfkill.patch | 2 +- .../patches/007-remove_misc_drivers.patch | 4 +- package/mac80211/patches/010-no_pcmcia.patch | 4 +- package/mac80211/patches/011-no_sdio.patch | 2 +- .../patches/013-disable_b43_nphy.patch | 2 +- .../mac80211/patches/014-add_iw_handler.patch | 33 ------ .../patches/015-remove-rt2x00-options.patch | 4 +- .../patches/120-compat_rcu_dereference.patch | 11 ++ ...0-tracepoint_include_linux_version_h.patch | 11 ++ package/mac80211/patches/300-fix-mesh.patch | 45 -------- ...h9k-fix-invalid-mac-address-handling.patch | 6 +- .../patches/404-ath_regd_optional.patch | 2 +- ...m-data-from-platform-data-on-pci-bus.patch | 2 +- ...ROM-only-if-no-platform-data-present.patch | 31 +++-- ...rride-mac-address-from-platform-data.patch | 14 +-- .../408-ath9k_tweak_rx_intr_mitigation.patch | 4 +- ...-add-wndr3700-antenna-initialization.patch | 30 ++--- .../410-ath9k-wndr3700-led-pin-fix.patch | 2 +- .../patches/500-ath9k_debugfs_chainmask.patch | 8 +- .../patches/510-ath9k_debugfs_regaccess.patch | 8 +- .../patches/520-cfg80211_get_freq.patch | 2 +- .../mac80211/patches/530-minstrel_ht.patch | 32 +++-- .../patches/540-ath9k_use_minstrel.patch | 2 +- .../mac80211/patches/550-ath9k_bb_fix.patch | 59 ---------- .../550-ath9k_no_multi_desc_frames.patch | 24 ++++ ...e-pci-code-if-CONFIG_PCI-not-defined.patch | 4 +- .../601-rt2x00-lib-use-rt2x00dev-irq.patch | 2 +- ...2-rt2x00-remove-mcu-requests-for-soc.patch | 58 +++------- ...700-mwl8k-missing-pci-id-for-WNR854T.patch | 10 ++ 46 files changed, 488 insertions(+), 308 deletions(-) create mode 100644 package/hostapd/patches/001-nl80211_sync.patch create mode 100644 package/hostapd/patches/380-ap_isolate.patch create mode 100644 package/hostapd/patches/390-nl80211_fixes.patch create mode 100644 package/hostapd/patches/400-nl80211_sta_auth.patch delete mode 100644 package/mac80211/patches/014-add_iw_handler.patch create mode 100644 package/mac80211/patches/120-compat_rcu_dereference.patch create mode 100644 package/mac80211/patches/130-tracepoint_include_linux_version_h.patch delete mode 100644 package/mac80211/patches/300-fix-mesh.patch delete mode 100644 package/mac80211/patches/550-ath9k_bb_fix.patch create mode 100644 package/mac80211/patches/550-ath9k_no_multi_desc_frames.patch create mode 100644 package/mac80211/patches/700-mwl8k-missing-pci-id-for-WNR854T.patch diff --git a/package/hostapd/Makefile b/package/hostapd/Makefile index 0ccba9ad99..72a7205dd1 100644 --- a/package/hostapd/Makefile +++ b/package/hostapd/Makefile @@ -8,9 +8,9 @@ include $(TOPDIR)/rules.mk PKG_NAME:=hostapd -PKG_VERSION:=20100309 +PKG_VERSION:=20100418 PKG_RELEASE:=1 -PKG_REV:=7b90c16aa9ca377b1a6d160c1ba0f2bd304f7e2f +PKG_REV:=0b86f67a2970403d1b1b6d34ce49f5485ef5dbb3 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2 PKG_SOURCE_URL:=git://w1.fi/srv/git/hostap.git diff --git a/package/hostapd/files/hostapd.sh b/package/hostapd/files/hostapd.sh index 9dc18366d9..a41c7678a7 100644 --- a/package/hostapd/files/hostapd.sh +++ b/package/hostapd/files/hostapd.sh @@ -5,6 +5,11 @@ hostapd_set_bss_options() { config_get enc "$vif" encryption config_get wpa_group_rekey "$vif" wpa_group_rekey + config_get_bool ap_isolate "$vif" isolate 0 + + if [ "$ap_isolate" -gt 0 ]; then + append "$var" "ap_isolate=$ap_isolate" "$N" + fi # Examples: # psk-mixed/tkip => WPA1+2 PSK, TKIP diff --git a/package/hostapd/patches/001-nl80211_sync.patch b/package/hostapd/patches/001-nl80211_sync.patch new file mode 100644 index 0000000000..a9310c7044 --- /dev/null +++ b/package/hostapd/patches/001-nl80211_sync.patch @@ -0,0 +1,21 @@ +--- a/src/drivers/nl80211_copy.h ++++ b/src/drivers/nl80211_copy.h +@@ -709,6 +709,9 @@ enum nl80211_commands { + * NL80211_CMD_AUTHENTICATE, NL80211_CMD_DEAUTHENTICATE, + * NL80211_CMD_DISASSOCIATE. + * ++ * @NL80211_ATTR_AP_ISOLATE: (AP mode) Do not forward traffic between stations ++ * connected to this BSS. ++ * + * @NL80211_ATTR_MAX: highest attribute number currently defined + * @__NL80211_ATTR_AFTER_LAST: internal use + */ +@@ -864,6 +867,8 @@ enum nl80211_attrs { + + NL80211_ATTR_LOCAL_STATE_CHANGE, + ++ NL80211_ATTR_AP_ISOLATE, ++ + /* add attributes here, update the policy in nl80211.c */ + + __NL80211_ATTR_AFTER_LAST, diff --git a/package/hostapd/patches/110-countrycode.patch b/package/hostapd/patches/110-countrycode.patch index 083de89c14..88dd1e92eb 100644 --- a/package/hostapd/patches/110-countrycode.patch +++ b/package/hostapd/patches/110-countrycode.patch @@ -1,6 +1,6 @@ --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -650,7 +650,6 @@ static int setup_interface(struct hostap +@@ -659,7 +659,6 @@ static int setup_interface(struct hostap country[3] = '\0'; if (hostapd_set_country(hapd, country) < 0) { wpa_printf(MSG_ERROR, "Failed to set country code"); diff --git a/package/hostapd/patches/130-scan_wait.patch b/package/hostapd/patches/130-scan_wait.patch index 1e29a41ca0..5e8d1e72e2 100644 --- a/package/hostapd/patches/130-scan_wait.patch +++ b/package/hostapd/patches/130-scan_wait.patch @@ -1,6 +1,6 @@ --- a/src/ap/hostapd.h +++ b/src/ap/hostapd.h -@@ -238,6 +238,7 @@ struct hostapd_iface { +@@ -245,6 +245,7 @@ struct hostapd_iface { int (*for_each_interface)(struct hapd_interfaces *interfaces, int (*cb)(struct hostapd_iface *iface, void *ctx), void *ctx); @@ -10,7 +10,7 @@ /* hostapd.c */ --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -746,6 +746,9 @@ int hostapd_setup_interface_complete(str +@@ -754,6 +754,9 @@ int hostapd_setup_interface_complete(str wpa_printf(MSG_DEBUG, "%s: Setup of interface done.", iface->bss[0]->conf->iface); @@ -55,7 +55,7 @@ hapd_iface->reload_config = hostapd_reload_config; hapd_iface->config_read_cb = hostapd_config_read; hapd_iface->config_fname = os_strdup(config_file); -@@ -390,7 +402,7 @@ static int hostapd_global_init(struct ha +@@ -391,7 +403,7 @@ static int hostapd_global_init(struct ha } @@ -64,7 +64,7 @@ { #ifdef EAP_SERVER_TNC tncs_global_deinit(); -@@ -408,8 +420,7 @@ static void hostapd_global_deinit(const +@@ -409,8 +421,7 @@ static void hostapd_global_deinit(const } @@ -74,7 +74,7 @@ { #ifdef EAP_SERVER_TNC int tnc = 0; -@@ -430,11 +441,6 @@ static int hostapd_global_run(struct hap +@@ -431,11 +442,6 @@ static int hostapd_global_run(struct hap } #endif /* EAP_SERVER_TNC */ @@ -86,7 +86,7 @@ eloop_run(); return 0; -@@ -478,8 +484,7 @@ int main(int argc, char *argv[]) +@@ -479,8 +485,7 @@ int main(int argc, char *argv[]) struct hapd_interfaces interfaces; int ret = 1; size_t i; @@ -96,7 +96,7 @@ if (os_program_init()) return -1; -@@ -544,7 +549,7 @@ int main(int argc, char *argv[]) +@@ -545,7 +550,7 @@ int main(int argc, char *argv[]) goto out; } @@ -105,7 +105,7 @@ goto out; ret = 0; -@@ -555,7 +560,7 @@ int main(int argc, char *argv[]) +@@ -556,7 +561,7 @@ int main(int argc, char *argv[]) hostapd_interface_deinit_free(interfaces.iface[i]); os_free(interfaces.iface); @@ -116,7 +116,7 @@ os_program_deinit(); --- a/hostapd/config_file.c +++ b/hostapd/config_file.c -@@ -1855,6 +1855,8 @@ struct hostapd_config * hostapd_config_r +@@ -1857,6 +1857,8 @@ struct hostapd_config * hostapd_config_r } #endif /* CONFIG_IEEE80211W */ #ifdef CONFIG_IEEE80211N @@ -127,7 +127,7 @@ } else if (os_strcmp(buf, "ht_capab") == 0) { --- a/src/ap/ap_config.h +++ b/src/ap/ap_config.h -@@ -366,6 +366,7 @@ struct hostapd_config { +@@ -369,6 +369,7 @@ struct hostapd_config { int ht_op_mode_fixed; u16 ht_capab; diff --git a/package/hostapd/patches/200-multicall.patch b/package/hostapd/patches/200-multicall.patch index 4ba9301a39..006e26a94a 100644 --- a/package/hostapd/patches/200-multicall.patch +++ b/package/hostapd/patches/200-multicall.patch @@ -26,7 +26,7 @@ LIBS += $(DRV_AP_LIBS) ifdef CONFIG_L2_PACKET -@@ -738,6 +743,12 @@ install: all +@@ -739,6 +744,12 @@ install: all BCHECK=../src/drivers/build.hostapd @@ -39,7 +39,7 @@ hostapd: $(BCHECK) $(OBJS) $(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS) -@@ -776,6 +787,12 @@ HOBJS += ../src/crypto/aes-internal.o +@@ -777,6 +788,12 @@ HOBJS += ../src/crypto/aes-internal.o HOBJS += ../src/crypto/aes-internal-enc.o endif @@ -86,7 +86,7 @@ endif ifdef NEED_RSN_AUTHENTICATOR -@@ -1261,6 +1272,12 @@ BCHECK=../src/drivers/build.wpa_supplica +@@ -1262,6 +1273,12 @@ BCHECK=../src/drivers/build.wpa_supplica wpa_priv: $(BCHECK) $(OBJS_priv) $(LDO) $(LDFLAGS) -o wpa_priv $(OBJS_priv) $(LIBS) @@ -99,7 +99,7 @@ wpa_supplicant: .config $(BCHECK) $(OBJS) $(EXTRA_progs) $(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS) -@@ -1320,6 +1337,12 @@ endif +@@ -1321,6 +1338,12 @@ endif $(Q)$(CC) -c -o $@ $(CFLAGS) $< @$(E) " CC " $< @@ -114,7 +114,7 @@ wpa_cli.exe: wpa_cli --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -2413,8 +2413,8 @@ union wpa_event_data { +@@ -2449,8 +2449,8 @@ union wpa_event_data { * Driver wrapper code should call this function whenever an event is received * from the driver. */ @@ -127,7 +127,7 @@ /* --- a/src/ap/drv_callbacks.c +++ b/src/ap/drv_callbacks.c -@@ -337,8 +337,8 @@ static void hostapd_event_eapol_rx(struc +@@ -375,8 +375,8 @@ static void hostapd_event_eapol_rx(struc } @@ -138,7 +138,7 @@ { struct hostapd_data *hapd = ctx; -@@ -415,5 +415,6 @@ void wpa_supplicant_event(void *ctx, enu +@@ -453,5 +453,6 @@ void wpa_supplicant_event(void *ctx, enu break; } } @@ -169,8 +169,8 @@ for (;;) { --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c -@@ -1506,8 +1506,8 @@ static void wpa_supplicant_event_ibss_rs - #endif /* CONFIG_IBSS_RSN */ +@@ -1577,8 +1577,8 @@ static void ft_rx_action(struct wpa_supp + #endif /* CONFIG_IEEE80211R */ -void wpa_supplicant_event(void *ctx, enum wpa_event_type event, @@ -179,10 +179,10 @@ + union wpa_event_data *data) { struct wpa_supplicant *wpa_s = ctx; - + u16 reason_code = 0; --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -2215,6 +2215,9 @@ struct wpa_supplicant * wpa_supplicant_g +@@ -2223,6 +2223,9 @@ struct wpa_supplicant * wpa_supplicant_g return NULL; } @@ -192,7 +192,7 @@ /** * wpa_supplicant_init - Initialize %wpa_supplicant -@@ -2233,6 +2236,7 @@ struct wpa_global * wpa_supplicant_init( +@@ -2241,6 +2244,7 @@ struct wpa_global * wpa_supplicant_init( if (params == NULL) return NULL; @@ -202,7 +202,7 @@ wpa_debug_open_syslog(); --- a/hostapd/main.c +++ b/hostapd/main.c -@@ -478,6 +478,9 @@ static void usage(void) +@@ -479,6 +479,9 @@ static void usage(void) exit(1); } @@ -212,7 +212,7 @@ int main(int argc, char *argv[]) { -@@ -489,6 +492,7 @@ int main(int argc, char *argv[]) +@@ -490,6 +493,7 @@ int main(int argc, char *argv[]) if (os_program_init()) return -1; diff --git a/package/hostapd/patches/310-scan_ssid.patch b/package/hostapd/patches/310-scan_ssid.patch index 1572098200..60babf474d 100644 --- a/package/hostapd/patches/310-scan_ssid.patch +++ b/package/hostapd/patches/310-scan_ssid.patch @@ -8,7 +8,7 @@ size_t max_ssids; enum wpa_states prev_state; -@@ -310,6 +311,16 @@ static void wpa_supplicant_scan(void *el +@@ -311,6 +312,16 @@ static void wpa_supplicant_scan(void *el wpa_s->wpa_state == WPA_INACTIVE) wpa_supplicant_set_state(wpa_s, WPA_SCANNING); @@ -25,7 +25,7 @@ /* Find the starting point from which to continue scanning */ ssid = wpa_s->conf->ssid; if (wpa_s->prev_scan_ssid != WILDCARD_SSID_SCAN) { -@@ -371,6 +382,9 @@ static void wpa_supplicant_scan(void *el +@@ -374,6 +385,9 @@ static void wpa_supplicant_scan(void *el int_array_sort_unique(params.freqs); } diff --git a/package/hostapd/patches/320-rescan_immediately.patch b/package/hostapd/patches/320-rescan_immediately.patch index f486baf645..1a0eb58a72 100644 --- a/package/hostapd/patches/320-rescan_immediately.patch +++ b/package/hostapd/patches/320-rescan_immediately.patch @@ -1,11 +1,11 @@ --- a/wpa_supplicant/events.c +++ b/wpa_supplicant/events.c -@@ -924,7 +924,7 @@ static void wpa_supplicant_event_scan_re +@@ -958,7 +958,7 @@ static void wpa_supplicant_event_scan_re wpa_printf(MSG_DEBUG, "Setup a new network"); wpa_supplicant_associate(wpa_s, NULL, ssid); - } else -- wpa_supplicant_req_new_scan(wpa_s, 5); -+ wpa_supplicant_req_new_scan(wpa_s, 0); - } - } - #endif /* CONFIG_NO_SCAN_PROCESSING */ + } else { +- int timeout_sec = 5; ++ int timeout_sec = 0; + int timeout_usec = 0; + wpa_supplicant_req_new_scan(wpa_s, timeout_sec, + timeout_usec); diff --git a/package/hostapd/patches/350-wds_fix.patch b/package/hostapd/patches/350-wds_fix.patch index 57bbafb88a..7bcf410a98 100644 --- a/package/hostapd/patches/350-wds_fix.patch +++ b/package/hostapd/patches/350-wds_fix.patch @@ -1,6 +1,6 @@ --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -4435,9 +4435,11 @@ static int i802_set_wds_sta(void *priv, +@@ -4576,9 +4576,11 @@ static int i802_set_wds_sta(void *priv, wpa_printf(MSG_DEBUG, "nl80211: Set WDS STA addr=" MACSTR " aid=%d val=%d name=%s", MAC2STR(addr), aid, val, name); if (val) { @@ -16,7 +16,7 @@ } else { --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c -@@ -1559,6 +1559,9 @@ static void handle_assoc_cb(struct hosta +@@ -1614,6 +1614,9 @@ static void handle_assoc_cb(struct hosta "Could not add STA to kernel driver"); } diff --git a/package/hostapd/patches/360-wds_bridge.patch b/package/hostapd/patches/360-wds_bridge.patch index d563bdbd82..48867922b1 100644 --- a/package/hostapd/patches/360-wds_bridge.patch +++ b/package/hostapd/patches/360-wds_bridge.patch @@ -21,7 +21,7 @@ /* clear to get error below if setting is invalid */ --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -4425,7 +4425,8 @@ static int i802_set_sta_vlan(void *priv, +@@ -4566,7 +4566,8 @@ static int i802_set_sta_vlan(void *priv, } @@ -31,7 +31,7 @@ { struct i802_bss *bss = priv; struct wpa_driver_nl80211_data *drv = bss->drv; -@@ -4439,6 +4440,10 @@ static int i802_set_wds_sta(void *priv, +@@ -4580,6 +4581,10 @@ static int i802_set_wds_sta(void *priv, if (nl80211_create_iface(drv, name, NL80211_IFTYPE_AP_VLAN, NULL, 1) < 0) return -1; @@ -44,7 +44,7 @@ return i802_set_sta_vlan(priv, addr, name, 0); --- a/src/ap/ap_drv_ops.c +++ b/src/ap/ap_drv_ops.c -@@ -253,9 +253,15 @@ static int hostapd_vlan_if_remove(struct +@@ -265,9 +265,15 @@ static int hostapd_vlan_if_remove(struct static int hostapd_set_wds_sta(struct hostapd_data *hapd, const u8 *addr, int aid, int val) { @@ -63,7 +63,7 @@ --- a/src/drivers/driver.h +++ b/src/drivers/driver.h -@@ -1610,7 +1610,8 @@ struct wpa_driver_ops { +@@ -1622,7 +1622,8 @@ struct wpa_driver_ops { * @val: 1 = bind to 4-address WDS; 0 = unbind * Returns: 0 on success, -1 on failure */ diff --git a/package/hostapd/patches/370-basic_rates.patch b/package/hostapd/patches/370-basic_rates.patch index ef4691bbd6..98420c01fa 100644 --- a/package/hostapd/patches/370-basic_rates.patch +++ b/package/hostapd/patches/370-basic_rates.patch @@ -1,6 +1,6 @@ --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -707,6 +707,16 @@ int hostapd_setup_interface_complete(str +@@ -715,6 +715,16 @@ int hostapd_setup_interface_complete(str } } diff --git a/package/hostapd/patches/380-ap_isolate.patch b/package/hostapd/patches/380-ap_isolate.patch new file mode 100644 index 0000000000..92ac6ded8f --- /dev/null +++ b/package/hostapd/patches/380-ap_isolate.patch @@ -0,0 +1,108 @@ +--- a/hostapd/config_file.c ++++ b/hostapd/config_file.c +@@ -1266,6 +1266,8 @@ struct hostapd_config * hostapd_config_r + } + } else if (os_strcmp(buf, "wds_sta") == 0) { + bss->wds_sta = atoi(pos); ++ } else if (os_strcmp(buf, "ap_isolate") == 0) { ++ bss->isolate = atoi(pos); + } else if (os_strcmp(buf, "ap_max_inactivity") == 0) { + bss->ap_max_inactivity = atoi(pos); + } else if (os_strcmp(buf, "country_code") == 0) { +--- a/src/ap/ap_config.h ++++ b/src/ap/ap_config.h +@@ -199,6 +199,7 @@ struct hostapd_bss_config { + struct mac_acl_entry *deny_mac; + int num_deny_mac; + int wds_sta; ++ int isolate; + + int auth_algs; /* bitfield of allowed IEEE 802.11 authentication + * algorithms, WPA_AUTH_ALG_{OPEN,SHARED,LEAP} */ +--- a/src/drivers/driver.h ++++ b/src/drivers/driver.h +@@ -1626,6 +1626,14 @@ struct wpa_driver_ops { + const char *bridge_ifname); + + /** ++ * set_ap_isolate - Enable/disable AP isolation ++ * @priv: private driver interface data ++ * @val: 1 = enabled; 0 = disabled ++ * Returns: 0 on success, -1 on failure ++ */ ++ int (*set_ap_isolate)(void *priv, int val); ++ ++ /** + * send_action - Transmit an Action frame + * @priv: Private driver interface data + * @freq: Frequency (in MHz) of the channel +--- a/src/drivers/driver_nl80211.c ++++ b/src/drivers/driver_nl80211.c +@@ -4263,6 +4263,29 @@ static int i802_set_rate_sets(void *priv + return -ENOBUFS; + } + ++static int i802_set_ap_isolate(void *priv, int val) ++{ ++ struct i802_bss *bss = priv; ++ struct wpa_driver_nl80211_data *drv = bss->drv; ++ struct nl_msg *msg; ++ int i; ++ ++ msg = nlmsg_alloc(); ++ if (!msg) ++ return -ENOMEM; ++ ++ genlmsg_put(msg, 0, 0, genl_family_get_id(drv->nl80211), 0, 0, ++ NL80211_CMD_SET_BSS, 0); ++ ++ NLA_PUT_U8(msg, NL80211_ATTR_AP_ISOLATE, !!val); ++ ++ NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, if_nametoindex(bss->ifname)); ++ ++ return send_and_recv_msgs(drv, msg, NULL, NULL); ++ nla_put_failure: ++ return -ENOBUFS; ++} ++ + #endif /* HOSTAPD */ + + +@@ -5372,6 +5395,7 @@ const struct wpa_driver_ops wpa_driver_n + .set_tx_queue_params = i802_set_tx_queue_params, + .set_sta_vlan = i802_set_sta_vlan, + .set_wds_sta = i802_set_wds_sta, ++ .set_ap_isolate = i802_set_ap_isolate, + #endif /* HOSTAPD */ + .set_freq = i802_set_freq, + .send_action = wpa_driver_nl80211_send_action, +--- a/src/ap/ap_drv_ops.c ++++ b/src/ap/ap_drv_ops.c +@@ -180,6 +180,14 @@ static int hostapd_set_radius_acl_expire + } + + ++static int hostapd_set_ap_isolate(struct hostapd_data *hapd, int value) ++{ ++ if (hapd->driver == NULL || hapd->driver->set_ap_isolate == NULL) ++ return 0; ++ hapd->driver->set_ap_isolate(hapd->drv_priv, value); ++} ++ ++ + static int hostapd_set_bss_params(struct hostapd_data *hapd, + int use_protection) + { +@@ -229,6 +237,12 @@ static int hostapd_set_bss_params(struct + "driver"); + ret = -1; + } ++ if (hostapd_set_ap_isolate(hapd, hapd->conf->isolate) && ++ !hapd->conf->isolate) { ++ wpa_printf(MSG_ERROR, "Could not enable AP isolation in " ++ "kernel driver"); ++ ret = -1; ++ } + + return ret; + } diff --git a/package/hostapd/patches/390-nl80211_fixes.patch b/package/hostapd/patches/390-nl80211_fixes.patch new file mode 100644 index 0000000000..fdac284b64 --- /dev/null +++ b/package/hostapd/patches/390-nl80211_fixes.patch @@ -0,0 +1,109 @@ +--- a/src/drivers/driver_nl80211.c ++++ b/src/drivers/driver_nl80211.c +@@ -1119,7 +1119,6 @@ nla_put_failure: + } + + +-#ifndef HOSTAPD + struct wiphy_info_data { + int max_scan_ssids; + int ap_supported; +@@ -1231,7 +1230,6 @@ static int wpa_driver_nl80211_capa(struc + + return 0; + } +-#endif /* HOSTAPD */ + + + static int wpa_driver_nl80211_init_nl(struct wpa_driver_nl80211_data *drv, +@@ -1371,6 +1369,7 @@ static void * wpa_driver_nl80211_init(vo + drv->monitor_ifidx = -1; + drv->monitor_sock = -1; + drv->ioctl_sock = -1; ++ drv->nlmode = NL80211_IFTYPE_STATION; + + if (wpa_driver_nl80211_init_nl(drv, ctx)) { + os_free(drv); +@@ -1468,24 +1467,23 @@ wpa_driver_nl80211_finish_drv_init(struc + drv->ifindex = if_nametoindex(bss->ifname); + drv->first_bss.ifindex = drv->ifindex; + +-#ifndef HOSTAPD +- if (wpa_driver_nl80211_set_mode(bss, IEEE80211_MODE_INFRA) < 0) { +- wpa_printf(MSG_DEBUG, "nl80211: Could not configure driver to " +- "use managed mode"); +- } +- +- if (linux_set_iface_flags(drv->ioctl_sock, bss->ifname, 1)) { +- wpa_printf(MSG_ERROR, "Could not set interface '%s' UP", +- bss->ifname); +- return -1; +- } ++ if (drv->nlmode == NL80211_IFTYPE_STATION) { ++ if (wpa_driver_nl80211_set_mode(bss, IEEE80211_MODE_INFRA) < 0) ++ wpa_printf(MSG_DEBUG, "nl80211: Could not configure " ++ "driver to use managed mode"); ++ ++ if (linux_set_iface_flags(drv->ioctl_sock, bss->ifname, 1)) { ++ wpa_printf(MSG_ERROR, "Could not set interface '%s' UP", ++ bss->ifname); ++ return -1; ++ } + +- if (wpa_driver_nl80211_capa(drv)) +- return -1; ++ if (wpa_driver_nl80211_capa(drv)) ++ return -1; + +- netlink_send_oper_ifla(drv->netlink, drv->ifindex, +- 1, IF_OPER_DORMANT); +-#endif /* HOSTAPD */ ++ netlink_send_oper_ifla(drv->netlink, drv->ifindex, ++ 1, IF_OPER_DORMANT); ++ } + + if (nl80211_register_action_frames(drv) < 0) { + wpa_printf(MSG_DEBUG, "nl80211: Failed to register Action " +@@ -2143,13 +2141,9 @@ static int wpa_driver_nl80211_set_key(co + */ + if (ret || !set_tx || alg == WPA_ALG_NONE) + return ret; +-#ifdef HOSTAPD +- if (addr) +- return ret; +-#else /* HOSTAPD */ ++ + if (drv->nlmode == NL80211_IFTYPE_AP && addr) + return ret; +-#endif /* HOSTAPD */ + + msg = nlmsg_alloc(); + if (!msg) +@@ -2990,7 +2984,8 @@ static void nl80211_remove_iface(struct + + #ifdef HOSTAPD + /* stop listening for EAPOL on this interface */ +- del_ifidx(drv, ifidx); ++ if (drv->nlmode == NL80211_IFTYPE_AP) ++ del_ifidx(drv, ifidx); + #endif /* HOSTAPD */ + + msg = nlmsg_alloc(); +@@ -3063,7 +3058,8 @@ static int nl80211_create_iface_once(str + + #ifdef HOSTAPD + /* start listening for EAPOL on this interface */ +- add_ifidx(drv, ifidx); ++ if (drv->nlmode == NL80211_IFTYPE_AP) ++ add_ifidx(drv, ifidx); + #endif /* HOSTAPD */ + + if (addr && iftype != NL80211_IFTYPE_MONITOR && +@@ -4766,6 +4762,7 @@ static void *i802_init(struct hostapd_da + return NULL; + + drv = bss->drv; ++ drv->nlmode = NL80211_IFTYPE_AP; + if (linux_br_get(brname, params->ifname) == 0) { + wpa_printf(MSG_DEBUG, "nl80211: Interface %s is in bridge %s", + params->ifname, brname); diff --git a/package/hostapd/patches/400-nl80211_sta_auth.patch b/package/hostapd/patches/400-nl80211_sta_auth.patch new file mode 100644 index 0000000000..8c959062dc --- /dev/null +++ b/package/hostapd/patches/400-nl80211_sta_auth.patch @@ -0,0 +1,19 @@ +--- a/wpa_supplicant/wpa_supplicant.c ++++ b/wpa_supplicant/wpa_supplicant.c +@@ -543,10 +543,16 @@ void wpa_supplicant_set_state(struct wpa + wpa_s->reassociated_connection = 1; + wpa_drv_set_operstate(wpa_s, 1); + wpa_s->after_wps = 0; ++#ifndef IEEE8021X_EAPOL ++ wpa_drv_set_supp_port(wpa_s, 1); ++#endif + } else if (state == WPA_DISCONNECTED || state == WPA_ASSOCIATING || + state == WPA_ASSOCIATED) { + wpa_s->new_connection = 1; + wpa_drv_set_operstate(wpa_s, 0); ++#ifndef IEEE8021X_EAPOL ++ wpa_drv_set_supp_port(wpa_s, 0); ++#endif + } + wpa_s->wpa_state = state; + diff --git a/package/mac80211/Makefile b/package/mac80211/Makefile index ba4cda5dfa..78c8aa37d1 100644 --- a/package/mac80211/Makefile +++ b/package/mac80211/Makefile @@ -10,12 +10,12 @@ include $(INCLUDE_DIR)/kernel.mk PKG_NAME:=mac80211 -PKG_VERSION:=2010-03-24 -PKG_RELEASE:=5 +PKG_VERSION:=2010-04-28 +PKG_RELEASE:=1 PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources # http://www.orbit-lab.org/kernel/compat-wireless-2.6/2010/11 \ # http://wireless.kernel.org/download/compat-wireless-2.6 -PKG_MD5SUM:=73357c52b5d6888ea3228b2ca8aa5eca +PKG_MD5SUM:=4b8c23ac7f33af7556034635af744c67 PKG_SOURCE:=compat-wireless-$(PKG_VERSION).tar.bz2 PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/compat-wireless-$(PKG_VERSION) @@ -425,6 +425,7 @@ define KernelPackage/ath9k/config config PACKAGE_ATH9K_USE_MINSTREL bool "use the new minstrel_ht rate control for ath9k" + default y endmenu endef @@ -531,6 +532,20 @@ define KernelPackage/net-ipw2200/description - ipw2200 endef + +define KernelPackage/mwl8k + $(call KernelPackage/mac80211/Default) + TITLE:=Driver for Marvell TOPDOG 802.11 Wireless cards + URL:=http://wireless.kernel.org/en/users/Drivers/mwl8k + DEPENDS+= @PCI_SUPPORT +kmod-mac80211 + FILES:=$(PKG_BUILD_DIR)/drivers/net/wireless/mwl8k.$(LINUX_KMOD_SUFFIX) + AUTOLOAD:=$(call AutoLoad,27,mwl8k) +endef + +define KernelPackage/mwl8k/description + Kernel modules for Marvell TOPDOG 802.11 Wireless cards +endef + #Broadcom firmware ifneq ($(CONFIG_B43_EXPERIMENTAL),) PKG_B43_FWV4_NAME:=broadcom-wl @@ -852,7 +867,7 @@ MAKE_OPTS:= \ CONFIG_LIB80211_CRYPT_TKIP= \ CONFIG_IWLWIFI= \ CONFIG_IWLAGN= \ - CONFIG_MWL8K= \ + CONFIG_MWL8K=$(if $(CONFIG_PACKAGE_kmod-mwl8k),m) \ CONFIG_ATMEL= \ CONFIG_PCMCIA_ATMEL= \ CONFIG_ADM8211= \ @@ -1051,3 +1066,4 @@ $(eval $(call KernelPackage,b43legacy)) $(eval $(call KernelPackage,net-libipw)) $(eval $(call KernelPackage,net-ipw2100)) $(eval $(call KernelPackage,net-ipw2200)) +$(eval $(call KernelPackage,mwl8k)) diff --git a/package/mac80211/files/lib/wifi/mac80211.sh b/package/mac80211/files/lib/wifi/mac80211.sh index 5991b4c16a..c871cbe732 100644 --- a/package/mac80211/files/lib/wifi/mac80211.sh +++ b/package/mac80211/files/lib/wifi/mac80211.sh @@ -416,6 +416,10 @@ detect_mac80211() { [ "$(($ht_cap & 1))" -eq 1 ] && append ht_capab "$list LDPC" "$N" [ "$(($ht_cap & 32))" -eq 32 ] && append ht_capab "$list SHORT-GI-20" "$N" [ "$(($ht_cap & 64))" -eq 64 ] && append ht_capab "$list SHORT-GI-40" "$N" + [ "$(($ht_cap & 128))" -eq 128 ] && append ht_capab "$list TX-STBC" "$N" + [ "$(($ht_cap & 768))" -eq 256 ] && append ht_capab "$list RX-STBC1" "$N" + [ "$(($ht_cap & 768))" -eq 512 ] && append ht_capab "$list RX-STBC12" "$N" + [ "$(($ht_cap & 768))" -eq 768 ] && append ht_capab "$list RX-STBC123" "$N" [ "$(($ht_cap & 4096))" -eq 4096 ] && append ht_capab "$list DSSS_CCK-40" "$N" } iw phy "$dev" info | grep -q '2412 MHz' || { mode_band="a"; channel="36"; } diff --git a/package/mac80211/patches/001-disable_b44.patch b/package/mac80211/patches/001-disable_b44.patch index ce10e71bbe..1869a5915c 100644 --- a/package/mac80211/patches/001-disable_b44.patch +++ b/package/mac80211/patches/001-disable_b44.patch @@ -1,6 +1,6 @@ --- a/config.mk +++ b/config.mk -@@ -269,8 +269,8 @@ endif +@@ -256,8 +256,8 @@ endif CONFIG_P54_PCI=m diff --git a/package/mac80211/patches/002-disable_rfkill.patch b/package/mac80211/patches/002-disable_rfkill.patch index 2599dbb841..9c6338a9a9 100644 --- a/package/mac80211/patches/002-disable_rfkill.patch +++ b/package/mac80211/patches/002-disable_rfkill.patch @@ -9,7 +9,7 @@ ifeq ($(CONFIG_MAC80211),y) $(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") -@@ -492,8 +492,8 @@ endif +@@ -481,8 +481,8 @@ endif # We need the backported rfkill module on kernel < 2.6.31. # In more recent kernel versions use the in kernel rfkill module. ifdef CONFIG_COMPAT_KERNEL_31 diff --git a/package/mac80211/patches/007-remove_misc_drivers.patch b/package/mac80211/patches/007-remove_misc_drivers.patch index a51a4b36e8..e0b007fa4f 100644 --- a/package/mac80211/patches/007-remove_misc_drivers.patch +++ b/package/mac80211/patches/007-remove_misc_drivers.patch @@ -1,6 +1,6 @@ --- a/config.mk +++ b/config.mk -@@ -299,10 +299,10 @@ endif +@@ -286,10 +286,10 @@ endif CONFIG_MWL8K=m # Ethernet drivers go here @@ -15,7 +15,7 @@ CONFIG_HERMES=m CONFIG_HERMES_CACHE_FW_ON_INIT=y -@@ -355,10 +355,10 @@ CONFIG_USB_NET_COMPAT_RNDIS_HOST=n +@@ -342,10 +342,10 @@ CONFIG_USB_NET_COMPAT_RNDIS_HOST=n CONFIG_USB_NET_COMPAT_RNDIS_WLAN=n CONFIG_USB_NET_COMPAT_CDCETHER=n else diff --git a/package/mac80211/patches/010-no_pcmcia.patch b/package/mac80211/patches/010-no_pcmcia.patch index a9437ce8ea..0826df4f39 100644 --- a/package/mac80211/patches/010-no_pcmcia.patch +++ b/package/mac80211/patches/010-no_pcmcia.patch @@ -9,7 +9,7 @@ CONFIG_SSB=m else include $(KLIB_BUILD)/.config -@@ -194,7 +194,7 @@ CONFIG_B43=m +@@ -181,7 +181,7 @@ CONFIG_B43=m CONFIG_B43_HWRNG=y CONFIG_B43_PCI_AUTOSELECT=y ifneq ($(CONFIG_PCMCIA),) @@ -18,7 +18,7 @@ endif CONFIG_B43_LEDS=y CONFIG_B43_PHY_LP=y -@@ -246,7 +246,7 @@ CONFIG_SSB_BLOCKIO=y +@@ -233,7 +233,7 @@ CONFIG_SSB_BLOCKIO=y CONFIG_SSB_PCIHOST=y CONFIG_SSB_B43_PCI_BRIDGE=y ifneq ($(CONFIG_PCMCIA),) diff --git a/package/mac80211/patches/011-no_sdio.patch b/package/mac80211/patches/011-no_sdio.patch index bd6bdfe78f..04a8029c36 100644 --- a/package/mac80211/patches/011-no_sdio.patch +++ b/package/mac80211/patches/011-no_sdio.patch @@ -1,6 +1,6 @@ --- a/config.mk +++ b/config.mk -@@ -407,8 +407,8 @@ endif # end of SPI driver list +@@ -396,8 +396,8 @@ endif # end of SPI driver list ifneq ($(CONFIG_MMC),) diff --git a/package/mac80211/patches/013-disable_b43_nphy.patch b/package/mac80211/patches/013-disable_b43_nphy.patch index 747c52ab04..efdfb149a1 100644 --- a/package/mac80211/patches/013-disable_b43_nphy.patch +++ b/package/mac80211/patches/013-disable_b43_nphy.patch @@ -1,6 +1,6 @@ --- a/config.mk +++ b/config.mk -@@ -198,7 +198,7 @@ ifneq ($(CONFIG_PCMCIA),) +@@ -185,7 +185,7 @@ ifneq ($(CONFIG_PCMCIA),) endif CONFIG_B43_LEDS=y CONFIG_B43_PHY_LP=y diff --git a/package/mac80211/patches/014-add_iw_handler.patch b/package/mac80211/patches/014-add_iw_handler.patch deleted file mode 100644 index 5119b35fbe..0000000000 --- a/package/mac80211/patches/014-add_iw_handler.patch +++ /dev/null @@ -1,33 +0,0 @@ -commit b7d48ccc687c44213121b1b565dccdc4488f5d9a -Author: Pavel Roskin -Date: Wed Mar 24 17:23:37 2010 -0400 - - compat: add compat-2.6.35.h and IW_HANDLER - - Signed-off-by: Pavel Roskin - ---- /dev/null -+++ b/include/linux/compat-2.6.35.h -@@ -0,0 +1,13 @@ -+#ifndef LINUX_26_35_COMPAT_H -+#define LINUX_26_35_COMPAT_H -+ -+#include -+ -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)) -+ -+#define IW_HANDLER(id, func) \ -+ [IW_IOCTL_IDX(id)] = func -+ -+#endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35)) */ -+ -+#endif /* LINUX_26_35_COMPAT_H */ ---- a/include/linux/compat-2.6.h -+++ b/include/linux/compat-2.6.h -@@ -27,5 +27,6 @@ - #include - #include - #include -+#include - - #endif /* LINUX_26_COMPAT_H */ diff --git a/package/mac80211/patches/015-remove-rt2x00-options.patch b/package/mac80211/patches/015-remove-rt2x00-options.patch index f980979cc5..e62192bdfa 100644 --- a/package/mac80211/patches/015-remove-rt2x00-options.patch +++ b/package/mac80211/patches/015-remove-rt2x00-options.patch @@ -1,6 +1,6 @@ --- a/config.mk +++ b/config.mk -@@ -276,12 +276,12 @@ CONFIG_RTL8180=m +@@ -248,12 +248,12 @@ CONFIG_RTL8180=m CONFIG_ADM8211=m @@ -15,7 +15,7 @@ # CONFIG_RT2800PCI_RT30XX=y # CONFIG_RT2800PCI_RT35XX=y # CONFIG_RT2800PCI_SOC=y -@@ -381,7 +381,7 @@ CONFIG_RT2800USB=m +@@ -355,7 +355,7 @@ CONFIG_RT2800USB=m # CONFIG_RT2800USB_RT35XX=y # CONFIG_RT2800USB_UNKNOWN=y endif diff --git a/package/mac80211/patches/120-compat_rcu_dereference.patch b/package/mac80211/patches/120-compat_rcu_dereference.patch new file mode 100644 index 0000000000..f14a8ddbd4 --- /dev/null +++ b/package/mac80211/patches/120-compat_rcu_dereference.patch @@ -0,0 +1,11 @@ +--- a/include/linux/compat-2.6.34.h ++++ b/include/linux/compat-2.6.34.h +@@ -197,6 +197,8 @@ do { \ + */ + #define sysfs_bin_attr_init(bin_attr) sysfs_attr_init(&(bin_attr)->attr) + ++#define rcu_dereference_check(p, c) rcu_dereference(p) ++ + #endif /* (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34)) */ + + #endif /* LINUX_26_34_COMPAT_H */ diff --git a/package/mac80211/patches/130-tracepoint_include_linux_version_h.patch b/package/mac80211/patches/130-tracepoint_include_linux_version_h.patch new file mode 100644 index 0000000000..034f00cd91 --- /dev/null +++ b/package/mac80211/patches/130-tracepoint_include_linux_version_h.patch @@ -0,0 +1,11 @@ +--- a/include/linux/tracepoint.h ++++ b/include/linux/tracepoint.h +@@ -3,6 +3,8 @@ + + #include + ++#include ++ + #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,27)) + #include_next + #endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,27)) */ diff --git a/package/mac80211/patches/300-fix-mesh.patch b/package/mac80211/patches/300-fix-mesh.patch deleted file mode 100644 index 554565615e..0000000000 --- a/package/mac80211/patches/300-fix-mesh.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 181ce6f71d907f42ab73376ce154015a835a6d8a Mon Sep 17 00:00:00 2001 -From: Javier Cardona -Date: Mon, 29 Mar 2010 11:00:20 -0700 -Subject: [PATCH] mac80211: Handle mesh action frames in ieee80211_rx_h_action - -This fixes the problem introduced in commit -8404080568613d93ad7cf0a16dfb68 which broke mesh peer link establishment. - -changes: -v2 Added missing break (Johannes) -v3 Broke original patch into two (Johannes) - -Signed-off-by: Javier Cardona -Signed-off-by: Hauke Mehrtens ---- - net/mac80211/mesh.c | 3 --- - net/mac80211/rx.c | 5 +++++ - 2 files changed, 5 insertions(+), 3 deletions(-) - ---- a/net/mac80211/mesh.c -+++ b/net/mac80211/mesh.c -@@ -749,9 +749,6 @@ ieee80211_mesh_rx_mgmt(struct ieee80211_ - - switch (fc & IEEE80211_FCTL_STYPE) { - case IEEE80211_STYPE_ACTION: -- if (skb->len < IEEE80211_MIN_ACTION_SIZE) -- return RX_DROP_MONITOR; -- /* fall through */ - case IEEE80211_STYPE_PROBE_RESP: - case IEEE80211_STYPE_BEACON: - skb_queue_tail(&ifmsh->skb_queue, skb); ---- a/net/mac80211/rx.c -+++ b/net/mac80211/rx.c -@@ -1964,6 +1964,11 @@ ieee80211_rx_h_action(struct ieee80211_r - goto handled; - } - break; -+ case MESH_PLINK_CATEGORY: -+ case MESH_PATH_SEL_CATEGORY: -+ if (ieee80211_vif_is_mesh(&sdata->vif)) -+ return ieee80211_mesh_rx_mgmt(sdata, rx->skb); -+ break; - } - - /* diff --git a/package/mac80211/patches/403-ath9k-fix-invalid-mac-address-handling.patch b/package/mac80211/patches/403-ath9k-fix-invalid-mac-address-handling.patch index e42be951c2..946dda567e 100644 --- a/package/mac80211/patches/403-ath9k-fix-invalid-mac-address-handling.patch +++ b/package/mac80211/patches/403-ath9k-fix-invalid-mac-address-handling.patch @@ -1,14 +1,14 @@ --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c -@@ -15,6 +15,7 @@ - */ +@@ -16,6 +16,7 @@ #include + #include +#include #include #include "hw.h" -@@ -441,8 +442,16 @@ static int ath9k_hw_init_macaddr(struct +@@ -456,8 +457,16 @@ static int ath9k_hw_init_macaddr(struct common->macaddr[2 * i] = eeval >> 8; common->macaddr[2 * i + 1] = eeval & 0xff; } diff --git a/package/mac80211/patches/404-ath_regd_optional.patch b/package/mac80211/patches/404-ath_regd_optional.patch index 58ed4bdbeb..5d4251c356 100644 --- a/package/mac80211/patches/404-ath_regd_optional.patch +++ b/package/mac80211/patches/404-ath_regd_optional.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/regd.c +++ b/drivers/net/wireless/ath/regd.c -@@ -19,6 +19,9 @@ +@@ -18,6 +18,9 @@ #include #include #include "regd.h" diff --git a/package/mac80211/patches/405-ath9k-read-eeprom-data-from-platform-data-on-pci-bus.patch b/package/mac80211/patches/405-ath9k-read-eeprom-data-from-platform-data-on-pci-bus.patch index 560f8d42de..bbf46a0d22 100644 --- a/package/mac80211/patches/405-ath9k-read-eeprom-data-from-platform-data-on-pci-bus.patch +++ b/package/mac80211/patches/405-ath9k-read-eeprom-data-from-platform-data-on-pci-bus.patch @@ -8,7 +8,7 @@ #include "ath9k.h" static DEFINE_PCI_DEVICE_TABLE(ath_pci_id_table) = { -@@ -52,21 +53,36 @@ static void ath_pci_read_cachesize(struc +@@ -53,21 +54,36 @@ static void ath_pci_read_cachesize(struc static bool ath_pci_eeprom_read(struct ath_common *common, u32 off, u16 *data) { diff --git a/package/mac80211/patches/406-ath9k-set-AH_USE_EEPROM-only-if-no-platform-data-present.patch b/package/mac80211/patches/406-ath9k-set-AH_USE_EEPROM-only-if-no-platform-data-present.patch index 799c1186f8..58728c554f 100644 --- a/package/mac80211/patches/406-ath9k-set-AH_USE_EEPROM-only-if-no-platform-data-present.patch +++ b/package/mac80211/patches/406-ath9k-set-AH_USE_EEPROM-only-if-no-platform-data-present.patch @@ -1,17 +1,3 @@ ---- a/drivers/net/wireless/ath/ath9k/hw.c -+++ b/drivers/net/wireless/ath/ath9k/hw.c -@@ -385,11 +385,8 @@ static void ath9k_hw_init_defaults(struc - ah->hw_version.magic = AR5416_MAGIC; - ah->hw_version.subvendorid = 0; - -- ah->ah_flags = 0; - if (ah->hw_version.devid == AR5416_AR9100_DEVID) - ah->hw_version.macVersion = AR_SREV_VERSION_9100; -- if (!AR_SREV_9100(ah)) -- ah->ah_flags = AH_USE_EEPROM; - - ah->atim_window = 0; - ah->sta_id1_defaults = AR_STA_ID1_CRPT_MIC_ENABLE; --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c @@ -15,6 +15,7 @@ @@ -24,7 +10,7 @@ --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c -@@ -531,6 +531,7 @@ static int ath9k_init_softc(u16 devid, s +@@ -565,6 +565,7 @@ static int ath9k_init_softc(u16 devid, s { struct ath_hw *ah = NULL; struct ath_common *common; @@ -32,7 +18,7 @@ int ret = 0, i; int csz = 0; -@@ -542,6 +543,10 @@ static int ath9k_init_softc(u16 devid, s +@@ -576,6 +577,10 @@ static int ath9k_init_softc(u16 devid, s ah->hw_version.subsysid = subsysid; sc->sc_ah = ah; @@ -43,3 +29,16 @@ common = ath9k_hw_common(ah); common->ops = &ath9k_common_ops; common->bus_ops = bus_ops; +--- a/drivers/net/wireless/ath/ath9k/hw.c ++++ b/drivers/net/wireless/ath/ath9k/hw.c +@@ -429,10 +429,6 @@ static void ath9k_hw_init_defaults(struc + ah->hw_version.magic = AR5416_MAGIC; + ah->hw_version.subvendorid = 0; + +- ah->ah_flags = 0; +- if (!AR_SREV_9100(ah)) +- ah->ah_flags = AH_USE_EEPROM; +- + ah->atim_window = 0; + ah->sta_id1_defaults = AR_STA_ID1_CRPT_MIC_ENABLE; + ah->beacon_interval = 100; diff --git a/package/mac80211/patches/407-ath9k-override-mac-address-from-platform-data.patch b/package/mac80211/patches/407-ath9k-override-mac-address-from-platform-data.patch index 93ad941b7e..20a33bbdbc 100644 --- a/package/mac80211/patches/407-ath9k-override-mac-address-from-platform-data.patch +++ b/package/mac80211/patches/407-ath9k-override-mac-address-from-platform-data.patch @@ -1,17 +1,17 @@ --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c -@@ -16,8 +16,10 @@ - +@@ -17,8 +17,10 @@ #include + #include #include +#include #include +#include "ath9k.h" #include "hw.h" + #include "hw-ops.h" #include "rc.h" - #include "initvals.h" -@@ -428,17 +430,23 @@ static int ath9k_hw_rf_claim(struct ath_ +@@ -441,18 +443,23 @@ static void ath9k_hw_init_defaults(struc static int ath9k_hw_init_macaddr(struct ath_hw *ah) { struct ath_common *common = ath9k_hw_common(ah); @@ -20,10 +20,11 @@ u32 sum; int i; u16 eeval; + u32 EEP_MAC[] = { EEP_MAC_LSW, EEP_MAC_MID, EEP_MAC_MSW }; sum = 0; - for (i = 0; i < 3; i++) { -- eeval = ah->eep_ops->get_eeprom(ah, AR_EEPROM_MAC(i)); +- eeval = ah->eep_ops->get_eeprom(ah, EEP_MAC[i]); - sum += eeval; - common->macaddr[2 * i] = eeval >> 8; - common->macaddr[2 * i + 1] = eeval & 0xff; @@ -32,12 +33,11 @@ + memcpy(common->macaddr, pdata->macaddr, ETH_ALEN); + else + for (i = 0; i < 3; i++) { -+ eeval = ah->eep_ops->get_eeprom(ah, AR_EEPROM_MAC(i)); ++ eeval = ah->eep_ops->get_eeprom(ah, EEP_MAC[i]); + sum += eeval; + common->macaddr[2 * i] = eeval >> 8; + common->macaddr[2 * i + 1] = eeval & 0xff; + } -+ if (!is_valid_ether_addr(common->macaddr)) { ath_print(common, ATH_DBG_EEPROM, "eeprom contains invalid mac address: %pM\n", diff --git a/package/mac80211/patches/408-ath9k_tweak_rx_intr_mitigation.patch b/package/mac80211/patches/408-ath9k_tweak_rx_intr_mitigation.patch index 9d8ce1a330..f7e7742e1c 100644 --- a/package/mac80211/patches/408-ath9k_tweak_rx_intr_mitigation.patch +++ b/package/mac80211/patches/408-ath9k_tweak_rx_intr_mitigation.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c -@@ -2097,7 +2097,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st +@@ -1380,7 +1380,7 @@ int ath9k_hw_reset(struct ath_hw *ah, st if (ah->config.rx_intr_mitigation) { REG_RMW_FIELD(ah, AR_RIMT, AR_RIMT_LAST, 500); @@ -8,4 +8,4 @@ + REG_RMW_FIELD(ah, AR_RIMT, AR_RIMT_FIRST, 500); } - ath9k_hw_init_bb(ah, chan); + if (ah->config.tx_intr_mitigation) { diff --git a/package/mac80211/patches/409-ath9k-add-wndr3700-antenna-initialization.patch b/package/mac80211/patches/409-ath9k-add-wndr3700-antenna-initialization.patch index 83eabaf09d..57a5678f81 100644 --- a/package/mac80211/patches/409-ath9k-add-wndr3700-antenna-initialization.patch +++ b/package/mac80211/patches/409-ath9k-add-wndr3700-antenna-initialization.patch @@ -1,14 +1,14 @@ --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c -@@ -14,6 +14,7 @@ - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ +@@ -16,6 +16,7 @@ + + #include +#include "linux/ath9k_platform.h" #include "ath9k.h" static char *dev_info = "ath9k"; -@@ -546,6 +547,8 @@ static int ath9k_init_softc(u16 devid, s +@@ -580,6 +581,8 @@ static int ath9k_init_softc(u16 devid, s pdata = (struct ath9k_platform_data *) sc->dev->platform_data; if (!pdata) ah->ah_flags |= AH_USE_EEPROM; @@ -17,7 +17,7 @@ common = ath9k_hw_common(ah); common->ops = &ath9k_common_ops; -@@ -671,6 +674,24 @@ void ath9k_set_hw_capab(struct ath_softc +@@ -702,6 +705,24 @@ void ath9k_set_hw_capab(struct ath_softc SET_IEEE80211_PERM_ADDR(hw, common->macaddr); } @@ -42,7 +42,7 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc, u16 subsysid, const struct ath_bus_ops *bus_ops) { -@@ -689,6 +710,9 @@ int ath9k_init_device(u16 devid, struct +@@ -720,6 +741,9 @@ int ath9k_init_device(u16 devid, struct common = ath9k_hw_common(ah); ath9k_set_hw_capab(sc, hw); @@ -54,15 +54,15 @@ ath9k_reg_notifier); --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h -@@ -511,6 +511,8 @@ struct ath_softc { - struct ath_beacon_config cur_beacon_conf; - struct delayed_work tx_complete_work; - struct ath_btcoex btcoex; -+ -+ unsigned long quirk_wndr3700:1; - }; +@@ -517,6 +517,8 @@ struct ath_softc { - struct ath_wiphy { + int beacon_interval; + ++ bool quirk_wndr3700; ++ + #ifdef CONFIG_ATH9K_DEBUGFS + struct ath9k_debug debug; + #endif --- a/include/linux/ath9k_platform.h +++ b/include/linux/ath9k_platform.h @@ -24,6 +24,8 @@ @@ -70,7 +70,7 @@ u16 eeprom_data[ATH9K_PLAT_EEP_MAX_WORDS]; u8 *macaddr; + -+ unsigned long quirk_wndr3700:1; ++ bool quirk_wndr3700; }; #endif /* _LINUX_ATH9K_PLATFORM_H */ diff --git a/package/mac80211/patches/410-ath9k-wndr3700-led-pin-fix.patch b/package/mac80211/patches/410-ath9k-wndr3700-led-pin-fix.patch index c5cc6b7e1b..c0e1e7f2e3 100644 --- a/package/mac80211/patches/410-ath9k-wndr3700-led-pin-fix.patch +++ b/package/mac80211/patches/410-ath9k-wndr3700-led-pin-fix.patch @@ -13,7 +13,7 @@ sc->sc_ah->led_pin = ATH_LED_PIN_DEF; --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h -@@ -379,6 +379,7 @@ void ath9k_btcoex_timer_pause(struct ath +@@ -392,6 +392,7 @@ void ath9k_btcoex_timer_pause(struct ath #define ATH_LED_PIN_DEF 1 #define ATH_LED_PIN_9287 8 diff --git a/package/mac80211/patches/500-ath9k_debugfs_chainmask.patch b/package/mac80211/patches/500-ath9k_debugfs_chainmask.patch index eaed500919..b5f035af75 100644 --- a/package/mac80211/patches/500-ath9k_debugfs_chainmask.patch +++ b/package/mac80211/patches/500-ath9k_debugfs_chainmask.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c -@@ -77,6 +77,90 @@ static const struct file_operations fops +@@ -78,6 +78,90 @@ static const struct file_operations fops #define DMA_BUF_LEN 1024 @@ -91,7 +91,7 @@ static ssize_t read_file_dma(struct file *file, char __user *user_buf, size_t count, loff_t *ppos) { -@@ -719,6 +803,16 @@ int ath9k_init_debug(struct ath_hw *ah) +@@ -731,6 +815,16 @@ int ath9k_init_debug(struct ath_hw *ah) goto err; #endif @@ -108,7 +108,7 @@ sc->debug.debugfs_dma = debugfs_create_file("dma", S_IRUSR, sc->debug.debugfs_phy, sc, &fops_dma); if (!sc->debug.debugfs_dma) -@@ -769,6 +863,8 @@ void ath9k_exit_debug(struct ath_hw *ah) +@@ -781,6 +875,8 @@ void ath9k_exit_debug(struct ath_hw *ah) struct ath_common *common = ath9k_hw_common(ah); struct ath_softc *sc = (struct ath_softc *) common->priv; @@ -119,7 +119,7 @@ debugfs_remove(sc->debug.debugfs_wiphy); --- a/drivers/net/wireless/ath/ath9k/debug.h +++ b/drivers/net/wireless/ath/ath9k/debug.h -@@ -148,6 +148,8 @@ struct ath_stats { +@@ -152,6 +152,8 @@ struct ath_stats { }; struct ath9k_debug { diff --git a/package/mac80211/patches/510-ath9k_debugfs_regaccess.patch b/package/mac80211/patches/510-ath9k_debugfs_regaccess.patch index dda4b88e8c..3827ed9c21 100644 --- a/package/mac80211/patches/510-ath9k_debugfs_regaccess.patch +++ b/package/mac80211/patches/510-ath9k_debugfs_regaccess.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c -@@ -783,6 +783,86 @@ static const struct file_operations fops +@@ -795,6 +795,86 @@ static const struct file_operations fops .owner = THIS_MODULE }; @@ -87,7 +87,7 @@ int ath9k_init_debug(struct ath_hw *ah) { struct ath_common *common = ath9k_hw_common(ah); -@@ -852,6 +932,17 @@ int ath9k_init_debug(struct ath_hw *ah) +@@ -864,6 +944,17 @@ int ath9k_init_debug(struct ath_hw *ah) if (!sc->debug.debugfs_recv) goto err; @@ -105,7 +105,7 @@ return 0; err: ath9k_exit_debug(ah); -@@ -865,6 +956,8 @@ void ath9k_exit_debug(struct ath_hw *ah) +@@ -877,6 +968,8 @@ void ath9k_exit_debug(struct ath_hw *ah) debugfs_remove(sc->debug.debugfs_tx_chainmask); debugfs_remove(sc->debug.debugfs_rx_chainmask); @@ -116,7 +116,7 @@ debugfs_remove(sc->debug.debugfs_wiphy); --- a/drivers/net/wireless/ath/ath9k/debug.h +++ b/drivers/net/wireless/ath/ath9k/debug.h -@@ -158,6 +158,9 @@ struct ath9k_debug { +@@ -162,6 +162,9 @@ struct ath9k_debug { struct dentry *debugfs_wiphy; struct dentry *debugfs_xmit; struct dentry *debugfs_recv; diff --git a/package/mac80211/patches/520-cfg80211_get_freq.patch b/package/mac80211/patches/520-cfg80211_get_freq.patch index f7e478f294..26190c63b6 100644 --- a/package/mac80211/patches/520-cfg80211_get_freq.patch +++ b/package/mac80211/patches/520-cfg80211_get_freq.patch @@ -20,7 +20,7 @@ } --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c -@@ -886,6 +886,11 @@ static int nl80211_send_iface(struct sk_ +@@ -887,6 +887,11 @@ static int nl80211_send_iface(struct sk_ NLA_PUT_U32(msg, NL80211_ATTR_WIPHY, rdev->wiphy_idx); NLA_PUT_STRING(msg, NL80211_ATTR_IFNAME, dev->name); NLA_PUT_U32(msg, NL80211_ATTR_IFTYPE, dev->ieee80211_ptr->iftype); diff --git a/package/mac80211/patches/530-minstrel_ht.patch b/package/mac80211/patches/530-minstrel_ht.patch index c51d541fbb..046e91b8cd 100644 --- a/package/mac80211/patches/530-minstrel_ht.patch +++ b/package/mac80211/patches/530-minstrel_ht.patch @@ -13,7 +13,7 @@ mac80211-$(CONFIG_MAC80211_RC_MINSTREL) += $(rc80211_minstrel-y) --- a/net/mac80211/main.c +++ b/net/mac80211/main.c -@@ -714,6 +714,10 @@ static int __init ieee80211_init(void) +@@ -716,6 +716,10 @@ static int __init ieee80211_init(void) if (ret) return ret; @@ -24,7 +24,7 @@ ret = rc80211_pid_init(); if (ret) goto err_pid; -@@ -726,6 +730,8 @@ static int __init ieee80211_init(void) +@@ -728,6 +732,8 @@ static int __init ieee80211_init(void) err_netdev: rc80211_pid_exit(); err_pid: @@ -33,7 +33,7 @@ rc80211_minstrel_exit(); return ret; -@@ -734,6 +740,7 @@ static int __init ieee80211_init(void) +@@ -736,6 +742,7 @@ static int __init ieee80211_init(void) static void __exit ieee80211_exit(void) { rc80211_pid_exit(); @@ -68,7 +68,7 @@ --- /dev/null +++ b/net/mac80211/rc80211_minstrel_ht.c -@@ -0,0 +1,815 @@ +@@ -0,0 +1,822 @@ +/* + * Copyright (C) 2010 Felix Fietkau + * @@ -389,9 +389,9 @@ + if (!mg->supported) + continue; + -+ if (++mg->index > MCS_GROUP_RATES) { ++ if (++mg->index >= MCS_GROUP_RATES) { + mg->index = 0; -+ if (++mg->column > ARRAY_SIZE(sample_table)) ++ if (++mg->column >= ARRAY_SIZE(sample_table)) + mg->column = 0; + } + break; @@ -474,7 +474,7 @@ + mi->ampdu_len += info->status.ampdu_len; + + if (!mi->sample_wait && !mi->sample_tries && mi->sample_count > 0) { -+ mi->sample_wait = 4 + MINSTREL_TRUNC(mi->avg_ampdu_len); ++ mi->sample_wait = 4 + 2 * MINSTREL_TRUNC(mi->avg_ampdu_len); + mi->sample_tries = 3; + mi->sample_count--; + } @@ -660,6 +660,7 @@ + if (!msp->is_ht) + return mac80211_minstrel.get_rate(priv, sta, &msp->legacy, txrc); + ++ info->flags |= mi->tx_flags; + sample_idx = minstrel_get_sample_rate(mp, mi); + if (sample_idx >= 0) { + minstrel_ht_set_rate(mp, mi, &ar[0], sample_idx, @@ -733,6 +734,12 @@ + } + mi->sample_tries = 4; + ++ if (sta_cap & IEEE80211_HT_CAP_TX_STBC) ++ mi->tx_flags |= IEEE80211_TX_CTL_STBC; ++ ++ if (sta_cap & IEEE80211_HT_CAP_LDPC_CODING) ++ mi->tx_flags |= IEEE80211_TX_CTL_LDPC; ++ + if (oper_chan_type != NL80211_CHAN_HT40MINUS && + oper_chan_type != NL80211_CHAN_HT40PLUS) + sta_cap &= ~IEEE80211_HT_CAP_SUP_WIDTH_20_40; @@ -886,7 +893,7 @@ +} --- /dev/null +++ b/net/mac80211/rc80211_minstrel_ht.h -@@ -0,0 +1,125 @@ +@@ -0,0 +1,128 @@ +/* + * Copyright (C) 2010 Felix Fietkau + * @@ -899,10 +906,10 @@ +#define __RC_MINSTREL_HT_H + +/* -+ * maximum number of spatial streams to make use of -+ * set this value to 3 once we have drivers that support it ++ * The number of streams can be changed to 2 to reduce code ++ * size and memory footprint. + */ -+#define MINSTREL_MAX_STREAMS 2 ++#define MINSTREL_MAX_STREAMS 3 +#define MINSTREL_STREAM_GROUPS 4 + +/* scaled fraction values */ @@ -983,6 +990,9 @@ + unsigned int total_packets; + unsigned int sample_packets; + ++ /* tx flags to add for frames for this sta */ ++ u32 tx_flags; ++ + u8 sample_wait; + u8 sample_tries; + u8 sample_count; diff --git a/package/mac80211/patches/540-ath9k_use_minstrel.patch b/package/mac80211/patches/540-ath9k_use_minstrel.patch index 0983abf335..6f1877f161 100644 --- a/package/mac80211/patches/540-ath9k_use_minstrel.patch +++ b/package/mac80211/patches/540-ath9k_use_minstrel.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c -@@ -655,7 +655,11 @@ void ath9k_set_hw_capab(struct ath_softc +@@ -686,7 +686,11 @@ void ath9k_set_hw_capab(struct ath_softc hw->sta_data_size = sizeof(struct ath_node); hw->vif_data_size = sizeof(struct ath_vif); diff --git a/package/mac80211/patches/550-ath9k_bb_fix.patch b/package/mac80211/patches/550-ath9k_bb_fix.patch deleted file mode 100644 index d09114c898..0000000000 --- a/package/mac80211/patches/550-ath9k_bb_fix.patch +++ /dev/null @@ -1,59 +0,0 @@ ---- a/drivers/net/wireless/ath/ath9k/hw.c -+++ b/drivers/net/wireless/ath/ath9k/hw.c -@@ -1911,6 +1911,34 @@ static void ath9k_enable_rfkill(struct a - REG_SET_BIT(ah, AR_PHY_TEST, RFSILENT_BB); - } - -+bool ath9k_hw_check_alive(struct ath_hw *ah) -+{ -+ int count = 50; -+ u32 reg; -+ -+ if (AR_SREV_9285_10_OR_LATER(ah)) -+ return true; -+ -+ do { -+ reg = REG_READ(ah, AR_OBS_BUS_1); -+ -+ if ((reg & 0x7E7FFFEF) == 0x00702400) -+ continue; -+ -+ switch (reg & 0x7E000B00) { -+ case 0x1E000000: -+ case 0x52000B00: -+ case 0x18000B00: -+ continue; -+ default: -+ return true; -+ } -+ } while (count-- > 0); -+ -+ return false; -+} -+EXPORT_SYMBOL(ath9k_hw_check_alive); -+ - int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan, - bool bChannelChange) - { ---- a/drivers/net/wireless/ath/ath9k/hw.h -+++ b/drivers/net/wireless/ath/ath9k/hw.h -@@ -679,6 +679,7 @@ void ath9k_hw_set11nmac2040(struct ath_h - void ath9k_hw_beaconinit(struct ath_hw *ah, u32 next_beacon, u32 beacon_period); - void ath9k_hw_set_sta_beacon_timers(struct ath_hw *ah, - const struct ath9k_beacon_state *bs); -+bool ath9k_hw_check_alive(struct ath_hw *ah); - - bool ath9k_hw_setpower(struct ath_hw *ah, enum ath9k_power_mode mode); - ---- a/drivers/net/wireless/ath/ath9k/main.c -+++ b/drivers/net/wireless/ath/ath9k/main.c -@@ -405,7 +405,8 @@ void ath9k_tasklet(unsigned long data) - - ath9k_ps_wakeup(sc); - -- if (status & ATH9K_INT_FATAL) { -+ if ((status & ATH9K_INT_FATAL) || -+ !ath9k_hw_check_alive(ah)) { - ath_reset(sc, false); - ath9k_ps_restore(sc); - return; diff --git a/package/mac80211/patches/550-ath9k_no_multi_desc_frames.patch b/package/mac80211/patches/550-ath9k_no_multi_desc_frames.patch new file mode 100644 index 0000000000..3bc730e32e --- /dev/null +++ b/package/mac80211/patches/550-ath9k_no_multi_desc_frames.patch @@ -0,0 +1,24 @@ +--- a/drivers/net/wireless/ath/ath9k/common.c ++++ b/drivers/net/wireless/ath/ath9k/common.c +@@ -57,13 +57,19 @@ static bool ath9k_rx_accept(struct ath_c + * rs_more indicates chained descriptors which can be used + * to link buffers together for a sort of scatter-gather + * operation. +- * ++ * reject the frame, we don't support scatter-gather yet and ++ * the frame is probably corrupt anyway ++ */ ++ if (rx_stats->rs_more) ++ return false; ++ ++ /* + * The rx_stats->rs_status will not be set until the end of the + * chained descriptors so it can be ignored if rs_more is set. The + * rs_more will be false at the last element of the chained + * descriptors. + */ +- if (!rx_stats->rs_more && rx_stats->rs_status != 0) { ++ if (rx_stats->rs_status != 0) { + if (rx_stats->rs_status & ATH9K_RXERR_CRC) + rxs->flag |= RX_FLAG_FAILED_FCS_CRC; + if (rx_stats->rs_status & ATH9K_RXERR_PHY) diff --git a/package/mac80211/patches/600-rt2x00-disable-pci-code-if-CONFIG_PCI-not-defined.patch b/package/mac80211/patches/600-rt2x00-disable-pci-code-if-CONFIG_PCI-not-defined.patch index 3971413b0d..8da8cb5da7 100644 --- a/package/mac80211/patches/600-rt2x00-disable-pci-code-if-CONFIG_PCI-not-defined.patch +++ b/package/mac80211/patches/600-rt2x00-disable-pci-code-if-CONFIG_PCI-not-defined.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/rt2x00/rt2x00pci.c +++ b/drivers/net/wireless/rt2x00/rt2x00pci.c -@@ -223,6 +223,7 @@ void rt2x00pci_uninitialize(struct rt2x0 +@@ -225,6 +225,7 @@ void rt2x00pci_uninitialize(struct rt2x0 } EXPORT_SYMBOL_GPL(rt2x00pci_uninitialize); @@ -8,7 +8,7 @@ /* * PCI driver handlers. */ -@@ -397,6 +398,7 @@ int rt2x00pci_resume(struct pci_dev *pci +@@ -399,6 +400,7 @@ int rt2x00pci_resume(struct pci_dev *pci } EXPORT_SYMBOL_GPL(rt2x00pci_resume); #endif /* CONFIG_PM */ diff --git a/package/mac80211/patches/601-rt2x00-lib-use-rt2x00dev-irq.patch b/package/mac80211/patches/601-rt2x00-lib-use-rt2x00dev-irq.patch index 22bfc2ebe5..c04bb2d88c 100644 --- a/package/mac80211/patches/601-rt2x00-lib-use-rt2x00dev-irq.patch +++ b/package/mac80211/patches/601-rt2x00-lib-use-rt2x00dev-irq.patch @@ -1,6 +1,6 @@ --- a/drivers/net/wireless/rt2x00/rt2x00pci.c +++ b/drivers/net/wireless/rt2x00/rt2x00pci.c -@@ -213,7 +213,7 @@ void rt2x00pci_uninitialize(struct rt2x0 +@@ -215,7 +215,7 @@ void rt2x00pci_uninitialize(struct rt2x0 /* * Free irq line. */ diff --git a/package/mac80211/patches/602-rt2x00-remove-mcu-requests-for-soc.patch b/package/mac80211/patches/602-rt2x00-remove-mcu-requests-for-soc.patch index 9cecf3a034..e743af3d30 100644 --- a/package/mac80211/patches/602-rt2x00-remove-mcu-requests-for-soc.patch +++ b/package/mac80211/patches/602-rt2x00-remove-mcu-requests-for-soc.patch @@ -1,59 +1,29 @@ +From f18d4463d092162f34a8bd226505627ceeac3e8a Mon Sep 17 00:00:00 2001 +From: Luis Correia +Date: Sat, 3 Apr 2010 12:49:53 +0100 +Subject: [PATCH] rt2x00: remove MCU requests for SoC platforms + The ralink SoC platforms do not have an MCU. Signed-off-by: Luis Correia +Acked-by: Ivo van Doorn +Signed-off-by: Gertjan van Wingerde --- + drivers/net/wireless/rt2x00/rt2800pci.c | 6 ++++++ + 1 files changed, 6 insertions(+), 0 deletions(-) ---- a/drivers/net/wireless/rt2x00/rt2800lib.c -+++ b/drivers/net/wireless/rt2x00/rt2800lib.c -@@ -221,9 +221,9 @@ void rt2800_mcu_request(struct rt2x00_de - u32 reg; - - /* -- * SOC devices don't support MCU requests. -+ * some devices don't support MCU requests. - */ -- if (rt2x00_is_soc(rt2x00dev)) -+ if (!test_bit(DRIVER_REQUIRE_MCU, &rt2x00dev->flags)) - return; - - mutex_lock(&rt2x00dev->csr_mutex); --- a/drivers/net/wireless/rt2x00/rt2800pci.c +++ b/drivers/net/wireless/rt2x00/rt2800pci.c -@@ -60,6 +60,12 @@ static void rt2800pci_mcu_status(struct - unsigned int i; - u32 reg; +@@ -66,6 +66,12 @@ static void rt2800pci_mcu_status(struct + if (rt2x00_is_soc(rt2x00dev)) + return; + /* -+ * some devices don't support MCU requests. ++ * SOC devices don't support MCU requests. + */ -+ if (!test_bit(DRIVER_REQUIRE_MCU, &rt2x00dev->flags)) ++ if (rt2x00_is_soc(rt2x00dev)) + return; + for (i = 0; i < 200; i++) { rt2800_register_read(rt2x00dev, H2M_MAILBOX_CID, ®); -@@ -1098,10 +1104,12 @@ static int rt2800pci_probe_hw(struct rt2 - __set_bit(DRIVER_SUPPORT_CONTROL_FILTER_PSPOLL, &rt2x00dev->flags); - - /* -- * This device requires firmware. -+ * This device requires firmware and MCU access. - */ -- if (!rt2x00_is_soc(rt2x00dev)) -+ if (!rt2x00_is_soc(rt2x00dev)){ - __set_bit(DRIVER_REQUIRE_FIRMWARE, &rt2x00dev->flags); -+ __set_bit(DRIVER_REQUIRE_MCU, &rt2x00dev->flags); -+ } - __set_bit(DRIVER_REQUIRE_DMA, &rt2x00dev->flags); - __set_bit(DRIVER_REQUIRE_L2PAD, &rt2x00dev->flags); - if (!modparam_nohwcrypt) ---- a/drivers/net/wireless/rt2x00/rt2x00.h -+++ b/drivers/net/wireless/rt2x00/rt2x00.h -@@ -631,6 +631,7 @@ enum rt2x00_flags { - * Driver requirements - */ - DRIVER_REQUIRE_FIRMWARE, -+ DRIVER_REQUIRE_MCU, - DRIVER_REQUIRE_BEACON_GUARD, - DRIVER_REQUIRE_ATIM_QUEUE, - DRIVER_REQUIRE_DMA, diff --git a/package/mac80211/patches/700-mwl8k-missing-pci-id-for-WNR854T.patch b/package/mac80211/patches/700-mwl8k-missing-pci-id-for-WNR854T.patch new file mode 100644 index 0000000000..744581167c --- /dev/null +++ b/package/mac80211/patches/700-mwl8k-missing-pci-id-for-WNR854T.patch @@ -0,0 +1,10 @@ +--- a/drivers/net/wireless/mwl8k.c ++++ b/drivers/net/wireless/mwl8k.c +@@ -3850,6 +3850,7 @@ MODULE_FIRMWARE("mwl8k/helper_8366.fw"); + MODULE_FIRMWARE("mwl8k/fmimage_8366.fw"); + + static DEFINE_PCI_DEVICE_TABLE(mwl8k_pci_id_table) = { ++ { PCI_VDEVICE(MARVELL, 0x2a02), .driver_data = MWL8363, }, + { PCI_VDEVICE(MARVELL, 0x2a0a), .driver_data = MWL8363, }, + { PCI_VDEVICE(MARVELL, 0x2a0c), .driver_data = MWL8363, }, + { PCI_VDEVICE(MARVELL, 0x2a24), .driver_data = MWL8363, }, -- 2.30.2