| 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/130-scan_wait.patch |
| 1 | 1 | --- a/src/ap/hostapd.h |
| 2 | 2 | +++ b/src/ap/hostapd.h |
| 3 | | @@ -238,6 +238,7 @@ struct hostapd_iface { |
| 3 | @@ -245,6 +245,7 @@ struct hostapd_iface { |
| 4 | 4 | int (*for_each_interface)(struct hapd_interfaces *interfaces, |
| 5 | 5 | int (*cb)(struct hostapd_iface *iface, |
| 6 | 6 | void *ctx), void *ctx); |
| ... | ... | |
| 10 | 10 | /* hostapd.c */ |
| 11 | 11 | --- a/src/ap/hostapd.c |
| 12 | 12 | +++ 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 |
| 14 | 14 | wpa_printf(MSG_DEBUG, "%s: Setup of interface done.", |
| 15 | 15 | iface->bss[0]->conf->iface); |
| 16 | 16 | |
| ... | ... | |
| 55 | 55 | hapd_iface->reload_config = hostapd_reload_config; |
| 56 | 56 | hapd_iface->config_read_cb = hostapd_config_read; |
| 57 | 57 | 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 |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | |
| ... | ... | |
| 64 | 64 | { |
| 65 | 65 | #ifdef EAP_SERVER_TNC |
| 66 | 66 | 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 |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | |
| ... | ... | |
| 74 | 74 | { |
| 75 | 75 | #ifdef EAP_SERVER_TNC |
| 76 | 76 | 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 |
| 78 | 78 | } |
| 79 | 79 | #endif /* EAP_SERVER_TNC */ |
| 80 | 80 | |
| ... | ... | |
| 86 | 86 | eloop_run(); |
| 87 | 87 | |
| 88 | 88 | return 0; |
| 89 | | @@ -478,8 +484,7 @@ int main(int argc, char *argv[]) |
| 89 | @@ -479,8 +485,7 @@ int main(int argc, char *argv[]) |
| 90 | 90 | struct hapd_interfaces interfaces; |
| 91 | 91 | int ret = 1; |
| 92 | 92 | size_t i; |
| ... | ... | |
| 96 | 96 | |
| 97 | 97 | if (os_program_init()) |
| 98 | 98 | return -1; |
| 99 | | @@ -544,7 +549,7 @@ int main(int argc, char *argv[]) |
| 99 | @@ -545,7 +550,7 @@ int main(int argc, char *argv[]) |
| 100 | 100 | goto out; |
| 101 | 101 | } |
| 102 | 102 | |
| ... | ... | |
| 105 | 105 | goto out; |
| 106 | 106 | |
| 107 | 107 | ret = 0; |
| 108 | | @@ -555,7 +560,7 @@ int main(int argc, char *argv[]) |
| 108 | @@ -556,7 +561,7 @@ int main(int argc, char *argv[]) |
| 109 | 109 | hostapd_interface_deinit_free(interfaces.iface[i]); |
| 110 | 110 | os_free(interfaces.iface); |
| 111 | 111 | |
| ... | ... | |
| 116 | 116 | os_program_deinit(); |
| 117 | 117 | --- a/hostapd/config_file.c |
| 118 | 118 | +++ 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 |
| 120 | 120 | } |
| 121 | 121 | #endif /* CONFIG_IEEE80211W */ |
| 122 | 122 | #ifdef CONFIG_IEEE80211N |
| ... | ... | |
| 127 | 127 | } else if (os_strcmp(buf, "ht_capab") == 0) { |
| 128 | 128 | --- a/src/ap/ap_config.h |
| 129 | 129 | +++ b/src/ap/ap_config.h |
| 130 | | @@ -366,6 +366,7 @@ struct hostapd_config { |
| 130 | @@ -369,6 +369,7 @@ struct hostapd_config { |
| 131 | 131 | |
| 132 | 132 | int ht_op_mode_fixed; |
| 133 | 133 | u16 ht_capab; |
| package/hostapd/patches/200-multicall.patch |
| 26 | 26 | LIBS += $(DRV_AP_LIBS) |
| 27 | 27 | |
| 28 | 28 | ifdef CONFIG_L2_PACKET |
| 29 | | @@ -738,6 +743,12 @@ install: all |
| 29 | @@ -739,6 +744,12 @@ install: all |
| 30 | 30 | |
| 31 | 31 | BCHECK=../src/drivers/build.hostapd |
| 32 | 32 | |
| ... | ... | |
| 39 | 39 | hostapd: $(BCHECK) $(OBJS) |
| 40 | 40 | $(CC) $(LDFLAGS) -o hostapd $(OBJS) $(LIBS) |
| 41 | 41 | |
| 42 | | @@ -776,6 +787,12 @@ HOBJS += ../src/crypto/aes-internal.o |
| 42 | @@ -777,6 +788,12 @@ HOBJS += ../src/crypto/aes-internal.o |
| 43 | 43 | HOBJS += ../src/crypto/aes-internal-enc.o |
| 44 | 44 | endif |
| 45 | 45 | |
| ... | ... | |
| 86 | 86 | endif |
| 87 | 87 | |
| 88 | 88 | 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 |
| 90 | 90 | wpa_priv: $(BCHECK) $(OBJS_priv) |
| 91 | 91 | $(LDO) $(LDFLAGS) -o wpa_priv $(OBJS_priv) $(LIBS) |
| 92 | 92 | |
| ... | ... | |
| 99 | 99 | wpa_supplicant: .config $(BCHECK) $(OBJS) $(EXTRA_progs) |
| 100 | 100 | $(LDO) $(LDFLAGS) -o wpa_supplicant $(OBJS) $(LIBS) $(EXTRALIBS) |
| 101 | 101 | |
| 102 | | @@ -1320,6 +1337,12 @@ endif |
| 102 | @@ -1321,6 +1338,12 @@ endif |
| 103 | 103 | $(Q)$(CC) -c -o $@ $(CFLAGS) $< |
| 104 | 104 | @$(E) " CC " $< |
| 105 | 105 | |
| ... | ... | |
| 114 | 114 | wpa_cli.exe: wpa_cli |
| 115 | 115 | --- a/src/drivers/driver.h |
| 116 | 116 | +++ b/src/drivers/driver.h |
| 117 | | @@ -2413,8 +2413,8 @@ union wpa_event_data { |
| 117 | @@ -2449,8 +2449,8 @@ union wpa_event_data { |
| 118 | 118 | * Driver wrapper code should call this function whenever an event is received |
| 119 | 119 | * from the driver. |
| 120 | 120 | */ |
| ... | ... | |
| 127 | 127 | /* |
| 128 | 128 | --- a/src/ap/drv_callbacks.c |
| 129 | 129 | +++ 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 |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | |
| ... | ... | |
| 138 | 138 | { |
| 139 | 139 | struct hostapd_data *hapd = ctx; |
| 140 | 140 | |
| 141 | | @@ -415,5 +415,6 @@ void wpa_supplicant_event(void *ctx, enu |
| 141 | @@ -453,5 +453,6 @@ void wpa_supplicant_event(void *ctx, enu |
| 142 | 142 | break; |
| 143 | 143 | } |
| 144 | 144 | } |
| ... | ... | |
| 169 | 169 | for (;;) { |
| 170 | 170 | --- a/wpa_supplicant/events.c |
| 171 | 171 | +++ 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 */ |
| 174 | 174 | |
| 175 | 175 | |
| 176 | 176 | -void wpa_supplicant_event(void *ctx, enum wpa_event_type event, |
| ... | ... | |
| 179 | 179 | + union wpa_event_data *data) |
| 180 | 180 | { |
| 181 | 181 | struct wpa_supplicant *wpa_s = ctx; |
| 182 | | |
| 182 | u16 reason_code = 0; |
| 183 | 183 | --- a/wpa_supplicant/wpa_supplicant.c |
| 184 | 184 | +++ 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 |
| 186 | 186 | return NULL; |
| 187 | 187 | } |
| 188 | 188 | |
| ... | ... | |
| 192 | 192 | |
| 193 | 193 | /** |
| 194 | 194 | * 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( |
| 196 | 196 | if (params == NULL) |
| 197 | 197 | return NULL; |
| 198 | 198 | |
| ... | ... | |
| 202 | 202 | wpa_debug_open_syslog(); |
| 203 | 203 | --- a/hostapd/main.c |
| 204 | 204 | +++ b/hostapd/main.c |
| 205 | | @@ -478,6 +478,9 @@ static void usage(void) |
| 205 | @@ -479,6 +479,9 @@ static void usage(void) |
| 206 | 206 | exit(1); |
| 207 | 207 | } |
| 208 | 208 | |
| ... | ... | |
| 212 | 212 | |
| 213 | 213 | int main(int argc, char *argv[]) |
| 214 | 214 | { |
| 215 | | @@ -489,6 +492,7 @@ int main(int argc, char *argv[]) |
| 215 | @@ -490,6 +493,7 @@ int main(int argc, char *argv[]) |
| 216 | 216 | if (os_program_init()) |
| 217 | 217 | return -1; |
| 218 | 218 | |
| package/hostapd/patches/310-scan_ssid.patch |
| 8 | 8 | size_t max_ssids; |
| 9 | 9 | enum wpa_states prev_state; |
| 10 | 10 | |
| 11 | | @@ -310,6 +311,16 @@ static void wpa_supplicant_scan(void *el |
| 11 | @@ -311,6 +312,16 @@ static void wpa_supplicant_scan(void *el |
| 12 | 12 | wpa_s->wpa_state == WPA_INACTIVE) |
| 13 | 13 | wpa_supplicant_set_state(wpa_s, WPA_SCANNING); |
| 14 | 14 | |
| ... | ... | |
| 25 | 25 | /* Find the starting point from which to continue scanning */ |
| 26 | 26 | ssid = wpa_s->conf->ssid; |
| 27 | 27 | 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 |
| 29 | 29 | int_array_sort_unique(params.freqs); |
| 30 | 30 | } |
| 31 | 31 | |
| package/hostapd/patches/350-wds_fix.patch |
| 1 | 1 | --- a/src/drivers/driver_nl80211.c |
| 2 | 2 | +++ 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, |
| 4 | 4 | wpa_printf(MSG_DEBUG, "nl80211: Set WDS STA addr=" MACSTR |
| 5 | 5 | " aid=%d val=%d name=%s", MAC2STR(addr), aid, val, name); |
| 6 | 6 | if (val) { |
| ... | ... | |
| 16 | 16 | } else { |
| 17 | 17 | --- a/src/ap/ieee802_11.c |
| 18 | 18 | +++ 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 |
| 20 | 20 | "Could not add STA to kernel driver"); |
| 21 | 21 | } |
| 22 | 22 | |
| package/hostapd/patches/360-wds_bridge.patch |
| 21 | 21 | /* clear to get error below if setting is invalid */ |
| 22 | 22 | --- a/src/drivers/driver_nl80211.c |
| 23 | 23 | +++ 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, |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | |
| ... | ... | |
| 31 | 31 | { |
| 32 | 32 | struct i802_bss *bss = priv; |
| 33 | 33 | 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, |
| 35 | 35 | if (nl80211_create_iface(drv, name, NL80211_IFTYPE_AP_VLAN, |
| 36 | 36 | NULL, 1) < 0) |
| 37 | 37 | return -1; |
| ... | ... | |
| 44 | 44 | return i802_set_sta_vlan(priv, addr, name, 0); |
| 45 | 45 | --- a/src/ap/ap_drv_ops.c |
| 46 | 46 | +++ 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 |
| 48 | 48 | static int hostapd_set_wds_sta(struct hostapd_data *hapd, const u8 *addr, |
| 49 | 49 | int aid, int val) |
| 50 | 50 | { |
| ... | ... | |
| 63 | 63 | |
| 64 | 64 | --- a/src/drivers/driver.h |
| 65 | 65 | +++ b/src/drivers/driver.h |
| 66 | | @@ -1610,7 +1610,8 @@ struct wpa_driver_ops { |
| 66 | @@ -1622,7 +1622,8 @@ struct wpa_driver_ops { |
| 67 | 67 | * @val: 1 = bind to 4-address WDS; 0 = unbind |
| 68 | 68 | * Returns: 0 on success, -1 on failure |
| 69 | 69 | */ |
| 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/mac80211/Makefile |
| 10 | 10 | |
| 11 | 11 | PKG_NAME:=mac80211 |
| 12 | 12 | |
| 13 | | PKG_VERSION:=2010-03-24 |
| 14 | | PKG_RELEASE:=5 |
| 13 | PKG_VERSION:=2010-04-28 |
| 14 | PKG_RELEASE:=1 |
| 15 | 15 | PKG_SOURCE_URL:=http://mirror2.openwrt.org/sources |
| 16 | 16 | # http://www.orbit-lab.org/kernel/compat-wireless-2.6/2010/11 \ |
| 17 | 17 | # http://wireless.kernel.org/download/compat-wireless-2.6 |
| 18 | | PKG_MD5SUM:=73357c52b5d6888ea3228b2ca8aa5eca |
| 18 | PKG_MD5SUM:=4b8c23ac7f33af7556034635af744c67 |
| 19 | 19 | |
| 20 | 20 | PKG_SOURCE:=compat-wireless-$(PKG_VERSION).tar.bz2 |
| 21 | 21 | PKG_BUILD_DIR:=$(KERNEL_BUILD_DIR)/compat-wireless-$(PKG_VERSION) |
| ... | ... | |
| 425 | 425 | |
| 426 | 426 | config PACKAGE_ATH9K_USE_MINSTREL |
| 427 | 427 | bool "use the new minstrel_ht rate control for ath9k" |
| 428 | default y |
| 428 | 429 | |
| 429 | 430 | endmenu |
| 430 | 431 | endef |
| ... | ... | |
| 531 | 532 | - ipw2200 |
| 532 | 533 | endef |
| 533 | 534 | |
| 535 | |
| 536 | define 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) |
| 543 | endef |
| 544 | |
| 545 | define KernelPackage/mwl8k/description |
| 546 | Kernel modules for Marvell TOPDOG 802.11 Wireless cards |
| 547 | endef |
| 548 | |
| 534 | 549 | #Broadcom firmware |
| 535 | 550 | ifneq ($(CONFIG_B43_EXPERIMENTAL),) |
| 536 | 551 | PKG_B43_FWV4_NAME:=broadcom-wl |
| ... | ... | |
| 852 | 867 | CONFIG_LIB80211_CRYPT_TKIP= \ |
| 853 | 868 | CONFIG_IWLWIFI= \ |
| 854 | 869 | CONFIG_IWLAGN= \ |
| 855 | | CONFIG_MWL8K= \ |
| 870 | CONFIG_MWL8K=$(if $(CONFIG_PACKAGE_kmod-mwl8k),m) \ |
| 856 | 871 | CONFIG_ATMEL= \ |
| 857 | 872 | CONFIG_PCMCIA_ATMEL= \ |
| 858 | 873 | CONFIG_ADM8211= \ |
| ... | ... | |
| 1051 | 1066 | $(eval $(call KernelPackage,net-libipw)) |
| 1052 | 1067 | $(eval $(call KernelPackage,net-ipw2100)) |
| 1053 | 1068 | $(eval $(call KernelPackage,net-ipw2200)) |
| 1069 | $(eval $(call KernelPackage,mwl8k)) |
| package/mac80211/patches/014-add_iw_handler.patch |
| 1 | | commit b7d48ccc687c44213121b1b565dccdc4488f5d9a |
| 2 | | Author: Pavel Roskin <proski@gnu.org> |
| 3 | | Date: 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/300-fix-mesh.patch |
| 1 | | From 181ce6f71d907f42ab73376ce154015a835a6d8a Mon Sep 17 00:00:00 2001 |
| 2 | | From: Javier Cardona <javier@cozybit.com> |
| 3 | | Date: Mon, 29 Mar 2010 11:00:20 -0700 |
| 4 | | Subject: [PATCH] mac80211: Handle mesh action frames in ieee80211_rx_h_action |
| 5 | | |
| 6 | | This fixes the problem introduced in commit |
| 7 | | 8404080568613d93ad7cf0a16dfb68 which broke mesh peer link establishment. |
| 8 | | |
| 9 | | changes: |
| 10 | | v2 Added missing break (Johannes) |
| 11 | | v3 Broke original patch into two (Johannes) |
| 12 | | |
| 13 | | Signed-off-by: Javier Cardona <javier@cozybit.com> |
| 14 | | Signed-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/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; |
| 14 | 1 | --- a/drivers/net/wireless/ath/ath9k/main.c |
| 15 | 2 | +++ b/drivers/net/wireless/ath/ath9k/main.c |
| 16 | 3 | @@ -15,6 +15,7 @@ |
| ... | ... | |
| 24 | 10 | |
| 25 | 11 | --- a/drivers/net/wireless/ath/ath9k/init.c |
| 26 | 12 | +++ 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 |
| 28 | 14 | { |
| 29 | 15 | struct ath_hw *ah = NULL; |
| 30 | 16 | struct ath_common *common; |
| ... | ... | |
| 32 | 18 | int ret = 0, i; |
| 33 | 19 | int csz = 0; |
| 34 | 20 | |
| 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 |
| 36 | 22 | ah->hw_version.subsysid = subsysid; |
| 37 | 23 | sc->sc_ah = ah; |
| 38 | 24 | |
| ... | ... | |
| 43 | 29 | common = ath9k_hw_common(ah); |
| 44 | 30 | common->ops = &ath9k_common_ops; |
| 45 | 31 | 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 |
| 1 | 1 | --- a/drivers/net/wireless/ath/ath9k/hw.c |
| 2 | 2 | +++ b/drivers/net/wireless/ath/ath9k/hw.c |
| 3 | | @@ -16,8 +16,10 @@ |
| 4 | | |
| 3 | @@ -17,8 +17,10 @@ |
| 5 | 4 | #include <linux/io.h> |
| 5 | #include <linux/slab.h> |
| 6 | 6 | #include <linux/etherdevice.h> |
| 7 | 7 | +#include <linux/ath9k_platform.h> |
| 8 | 8 | #include <asm/unaligned.h> |
| 9 | 9 | |
| 10 | 10 | +#include "ath9k.h" |
| 11 | 11 | #include "hw.h" |
| 12 | #include "hw-ops.h" |
| 12 | 13 | #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 |
| 15 | 15 | static int ath9k_hw_init_macaddr(struct ath_hw *ah) |
| 16 | 16 | { |
| 17 | 17 | struct ath_common *common = ath9k_hw_common(ah); |
| ... | ... | |
| 20 | 20 | u32 sum; |
| 21 | 21 | int i; |
| 22 | 22 | u16 eeval; |
| 23 | u32 EEP_MAC[] = { EEP_MAC_LSW, EEP_MAC_MID, EEP_MAC_MSW }; |
| 23 | 24 | |
| 24 | 25 | sum = 0; |
| 25 | 26 | - 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]); |
| 27 | 28 | - sum += eeval; |
| 28 | 29 | - common->macaddr[2 * i] = eeval >> 8; |
| 29 | 30 | - common->macaddr[2 * i + 1] = eeval & 0xff; |
| ... | ... | |
| 32 | 33 | + memcpy(common->macaddr, pdata->macaddr, ETH_ALEN); |
| 33 | 34 | + else |
| 34 | 35 | + 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]); |
| 36 | 37 | + sum += eeval; |
| 37 | 38 | + common->macaddr[2 * i] = eeval >> 8; |
| 38 | 39 | + common->macaddr[2 * i + 1] = eeval & 0xff; |
| 39 | 40 | + } |
| 40 | | + |
| 41 | 41 | if (!is_valid_ether_addr(common->macaddr)) { |
| 42 | 42 | ath_print(common, ATH_DBG_EEPROM, |
| 43 | 43 | "eeprom contains invalid mac address: %pM\n", |
| package/mac80211/patches/409-ath9k-add-wndr3700-antenna-initialization.patch |
| 1 | 1 | --- a/drivers/net/wireless/ath/ath9k/init.c |
| 2 | 2 | +++ 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> |
| 6 | 6 | |
| 7 | 7 | +#include "linux/ath9k_platform.h" |
| 8 | 8 | #include "ath9k.h" |
| 9 | 9 | |
| 10 | 10 | 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 |
| 12 | 12 | pdata = (struct ath9k_platform_data *) sc->dev->platform_data; |
| 13 | 13 | if (!pdata) |
| 14 | 14 | ah->ah_flags |= AH_USE_EEPROM; |
| ... | ... | |
| 17 | 17 | |
| 18 | 18 | common = ath9k_hw_common(ah); |
| 19 | 19 | 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 |
| 21 | 21 | SET_IEEE80211_PERM_ADDR(hw, common->macaddr); |
| 22 | 22 | } |
| 23 | 23 | |
| ... | ... | |
| 42 | 42 | int ath9k_init_device(u16 devid, struct ath_softc *sc, u16 subsysid, |
| 43 | 43 | const struct ath_bus_ops *bus_ops) |
| 44 | 44 | { |
| 45 | | @@ -689,6 +710,9 @@ int ath9k_init_device(u16 devid, struct |
| 45 | @@ -720,6 +741,9 @@ int ath9k_init_device(u16 devid, struct |
| 46 | 46 | common = ath9k_hw_common(ah); |
| 47 | 47 | ath9k_set_hw_capab(sc, hw); |
| 48 | 48 | |
| ... | ... | |
| 54 | 54 | ath9k_reg_notifier); |
| 55 | 55 | --- a/drivers/net/wireless/ath/ath9k/ath9k.h |
| 56 | 56 | +++ 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 { |
| 64 | 58 | |
| 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 |
| 66 | 66 | --- a/include/linux/ath9k_platform.h |
| 67 | 67 | +++ b/include/linux/ath9k_platform.h |
| 68 | 68 | @@ -24,6 +24,8 @@ |
| ... | ... | |
| 70 | 70 | u16 eeprom_data[ATH9K_PLAT_EEP_MAX_WORDS]; |
| 71 | 71 | u8 *macaddr; |
| 72 | 72 | + |
| 73 | | + unsigned long quirk_wndr3700:1; |
| 73 | + bool quirk_wndr3700; |
| 74 | 74 | }; |
| 75 | 75 | |
| 76 | 76 | #endif /* _LINUX_ATH9K_PLATFORM_H */ |
| package/mac80211/patches/500-ath9k_debugfs_chainmask.patch |
| 1 | 1 | --- a/drivers/net/wireless/ath/ath9k/debug.c |
| 2 | 2 | +++ 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 |
| 4 | 4 | |
| 5 | 5 | #define DMA_BUF_LEN 1024 |
| 6 | 6 | |
| ... | ... | |
| 91 | 91 | static ssize_t read_file_dma(struct file *file, char __user *user_buf, |
| 92 | 92 | size_t count, loff_t *ppos) |
| 93 | 93 | { |
| 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) |
| 95 | 95 | goto err; |
| 96 | 96 | #endif |
| 97 | 97 | |
| ... | ... | |
| 108 | 108 | sc->debug.debugfs_dma = debugfs_create_file("dma", S_IRUSR, |
| 109 | 109 | sc->debug.debugfs_phy, sc, &fops_dma); |
| 110 | 110 | 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) |
| 112 | 112 | struct ath_common *common = ath9k_hw_common(ah); |
| 113 | 113 | struct ath_softc *sc = (struct ath_softc *) common->priv; |
| 114 | 114 | |
| ... | ... | |
| 119 | 119 | debugfs_remove(sc->debug.debugfs_wiphy); |
| 120 | 120 | --- a/drivers/net/wireless/ath/ath9k/debug.h |
| 121 | 121 | +++ b/drivers/net/wireless/ath/ath9k/debug.h |
| 122 | | @@ -148,6 +148,8 @@ struct ath_stats { |
| 122 | @@ -152,6 +152,8 @@ struct ath_stats { |
| 123 | 123 | }; |
| 124 | 124 | |
| 125 | 125 | struct ath9k_debug { |
| package/mac80211/patches/510-ath9k_debugfs_regaccess.patch |
| 1 | 1 | --- a/drivers/net/wireless/ath/ath9k/debug.c |
| 2 | 2 | +++ 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 |
| 4 | 4 | .owner = THIS_MODULE |
| 5 | 5 | }; |
| 6 | 6 | |
| ... | ... | |
| 87 | 87 | int ath9k_init_debug(struct ath_hw *ah) |
| 88 | 88 | { |
| 89 | 89 | 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) |
| 91 | 91 | if (!sc->debug.debugfs_recv) |
| 92 | 92 | goto err; |
| 93 | 93 | |
| ... | ... | |
| 105 | 105 | return 0; |
| 106 | 106 | err: |
| 107 | 107 | 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) |
| 109 | 109 | |
| 110 | 110 | debugfs_remove(sc->debug.debugfs_tx_chainmask); |
| 111 | 111 | debugfs_remove(sc->debug.debugfs_rx_chainmask); |
| ... | ... | |
| 116 | 116 | debugfs_remove(sc->debug.debugfs_wiphy); |
| 117 | 117 | --- a/drivers/net/wireless/ath/ath9k/debug.h |
| 118 | 118 | +++ b/drivers/net/wireless/ath/ath9k/debug.h |
| 119 | | @@ -158,6 +158,9 @@ struct ath9k_debug { |
| 119 | @@ -162,6 +162,9 @@ struct ath9k_debug { |
| 120 | 120 | struct dentry *debugfs_wiphy; |
| 121 | 121 | struct dentry *debugfs_xmit; |
| 122 | 122 | struct dentry *debugfs_recv; |
| package/mac80211/patches/530-minstrel_ht.patch |
| 13 | 13 | mac80211-$(CONFIG_MAC80211_RC_MINSTREL) += $(rc80211_minstrel-y) |
| 14 | 14 | --- a/net/mac80211/main.c |
| 15 | 15 | +++ 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) |
| 17 | 17 | if (ret) |
| 18 | 18 | return ret; |
| 19 | 19 | |
| ... | ... | |
| 24 | 24 | ret = rc80211_pid_init(); |
| 25 | 25 | if (ret) |
| 26 | 26 | 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) |
| 28 | 28 | err_netdev: |
| 29 | 29 | rc80211_pid_exit(); |
| 30 | 30 | err_pid: |
| ... | ... | |
| 33 | 33 | rc80211_minstrel_exit(); |
| 34 | 34 | |
| 35 | 35 | return ret; |
| 36 | | @@ -734,6 +740,7 @@ static int __init ieee80211_init(void) |
| 36 | @@ -736,6 +742,7 @@ static int __init ieee80211_init(void) |
| 37 | 37 | static void __exit ieee80211_exit(void) |
| 38 | 38 | { |
| 39 | 39 | rc80211_pid_exit(); |
| ... | ... | |
| 68 | 68 | |
| 69 | 69 | --- /dev/null |
| 70 | 70 | +++ b/net/mac80211/rc80211_minstrel_ht.c |
| 71 | | @@ -0,0 +1,815 @@ |
| 71 | @@ -0,0 +1,822 @@ |
| 72 | 72 | +/* |
| 73 | 73 | + * Copyright (C) 2010 Felix Fietkau <nbd@openwrt.org> |
| 74 | 74 | + * |
| ... | ... | |
| 389 | 389 | + if (!mg->supported) |
| 390 | 390 | + continue; |
| 391 | 391 | + |
| 392 | | + if (++mg->index > MCS_GROUP_RATES) { |
| 392 | + if (++mg->index >= MCS_GROUP_RATES) { |
| 393 | 393 | + mg->index = 0; |
| 394 | | + if (++mg->column > ARRAY_SIZE(sample_table)) |
| 394 | + if (++mg->column >= ARRAY_SIZE(sample_table)) |
| 395 | 395 | + mg->column = 0; |
| 396 | 396 | + } |
| 397 | 397 | + break; |
| ... | ... | |
| 474 | 474 | + mi->ampdu_len += info->status.ampdu_len; |
| 475 | 475 | + |
| 476 | 476 | + 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); |
| 478 | 478 | + mi->sample_tries = 3; |
| 479 | 479 | + mi->sample_count--; |
| 480 | 480 | + } |
| ... | ... | |
| 660 | 660 | + if (!msp->is_ht) |
| 661 | 661 | + return mac80211_minstrel.get_rate(priv, sta, &msp->legacy, txrc); |
| 662 | 662 | + |
| 663 | + info->flags |= mi->tx_flags; |
| 663 | 664 | + sample_idx = minstrel_get_sample_rate(mp, mi); |
| 664 | 665 | + if (sample_idx >= 0) { |
| 665 | 666 | + minstrel_ht_set_rate(mp, mi, &ar[0], sample_idx, |
| ... | ... | |
| 733 | 734 | + } |
| 734 | 735 | + mi->sample_tries = 4; |
| 735 | 736 | + |
| 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 | + |
| 736 | 743 | + if (oper_chan_type != NL80211_CHAN_HT40MINUS && |
| 737 | 744 | + oper_chan_type != NL80211_CHAN_HT40PLUS) |
| 738 | 745 | + sta_cap &= ~IEEE80211_HT_CAP_SUP_WIDTH_20_40; |
| ... | ... | |
| 886 | 893 | +} |
| 887 | 894 | --- /dev/null |
| 888 | 895 | +++ b/net/mac80211/rc80211_minstrel_ht.h |
| 889 | | @@ -0,0 +1,125 @@ |
| 896 | @@ -0,0 +1,128 @@ |
| 890 | 897 | +/* |
| 891 | 898 | + * Copyright (C) 2010 Felix Fietkau <nbd@openwrt.org> |
| 892 | 899 | + * |
| ... | ... | |
| 899 | 906 | +#define __RC_MINSTREL_HT_H |
| 900 | 907 | + |
| 901 | 908 | +/* |
| 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. |
| 904 | 911 | + */ |
| 905 | | +#define MINSTREL_MAX_STREAMS 2 |
| 912 | +#define MINSTREL_MAX_STREAMS 3 |
| 906 | 913 | +#define MINSTREL_STREAM_GROUPS 4 |
| 907 | 914 | + |
| 908 | 915 | +/* scaled fraction values */ |
| ... | ... | |
| 983 | 990 | + unsigned int total_packets; |
| 984 | 991 | + unsigned int sample_packets; |
| 985 | 992 | + |
| 993 | + /* tx flags to add for frames for this sta */ |
| 994 | + u32 tx_flags; |
| 995 | + |
| 986 | 996 | + u8 sample_wait; |
| 987 | 997 | + u8 sample_tries; |
| 988 | 998 | + u8 sample_count; |
| 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/602-rt2x00-remove-mcu-requests-for-soc.patch |
| 1 | From f18d4463d092162f34a8bd226505627ceeac3e8a Mon Sep 17 00:00:00 2001 |
| 2 | From: Luis Correia <luis.f.correia@gmail.com> |
| 3 | Date: Sat, 3 Apr 2010 12:49:53 +0100 |
| 4 | Subject: [PATCH] rt2x00: remove MCU requests for SoC platforms |
| 5 | |
| 1 | 6 | The ralink SoC platforms do not have an MCU. |
| 2 | 7 | |
| 3 | 8 | Signed-off-by: Luis Correia <luis.f.correia@gmail.com> |
| 9 | Acked-by: Ivo van Doorn <IvDoorn@gmail.com> |
| 10 | Signed-off-by: Gertjan van Wingerde <gwingerde@gmail.com> |
| 4 | 11 | --- |
| 12 | drivers/net/wireless/rt2x00/rt2800pci.c | 6 ++++++ |
| 13 | 1 files changed, 6 insertions(+), 0 deletions(-) |
| 5 | 14 | |
| 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); |
| 19 | 15 | --- a/drivers/net/wireless/rt2x00/rt2800pci.c |
| 20 | 16 | +++ 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; |
| 24 | 20 | |
| 25 | 21 | + /* |
| 26 | | + * some devices don't support MCU requests. |
| 22 | + * SOC devices don't support MCU requests. |
| 27 | 23 | + */ |
| 28 | | + if (!test_bit(DRIVER_REQUIRE_MCU, &rt2x00dev->flags)) |
| 24 | + if (rt2x00_is_soc(rt2x00dev)) |
| 29 | 25 | + return; |
| 30 | 26 | + |
| 31 | 27 | for (i = 0; i < 200; i++) { |
| 32 | 28 | rt2800_register_read(rt2x00dev, H2M_MAILBOX_CID, ®); |
| 33 | 29 | |
| 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, }, |