From 088a126240afe031df25a5589f6f1f6c5a6a7d8c Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Wed, 29 Aug 2012 16:06:24 +0000 Subject: [PATCH] hostapd: fix ap+sta issues SVN-Revision: 33311 --- .../patches/450-reload_freq_change.patch | 14 +++++++++++-- .../patches/452-ctrl_iface_reload.patch | 2 +- .../480-terminate_on_setup_failure.patch | 14 ++++++------- .../patches/540-dynamic_20_40_mhz.patch | 2 +- ...dd-new-config-params-to-be-used-with.patch | 17 +++------------ ...-use-new-parameters-during-ibss-join.patch | 7 +------ .../604-wpa_s-support-htmode-param.patch | 21 ++++--------------- 7 files changed, 29 insertions(+), 48 deletions(-) diff --git a/package/hostapd/patches/450-reload_freq_change.patch b/package/hostapd/patches/450-reload_freq_change.patch index b83410be3a..9245860d1e 100644 --- a/package/hostapd/patches/450-reload_freq_change.patch +++ b/package/hostapd/patches/450-reload_freq_change.patch @@ -1,10 +1,20 @@ --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -137,6 +137,10 @@ int hostapd_reload_config(struct hostapd +@@ -137,6 +137,20 @@ int hostapd_reload_config(struct hostapd oldconf = hapd->iconf; iface->conf = newconf; -+ iface->freq = hostapd_hw_get_freq(hapd, hapd->iconf->channel); ++ hostapd_select_hw_mode(iface); ++ iface->freq = hostapd_hw_get_freq(hapd, newconf->channel); ++ ++ if (hostapd_set_freq(hapd, newconf->hw_mode, iface->freq, ++ newconf->channel, ++ newconf->ieee80211n, ++ newconf->secondary_channel)) { ++ wpa_printf(MSG_ERROR, "Could not set channel for " ++ "kernel driver"); ++ } ++ + if (iface->current_mode) + hostapd_prepare_rates(iface, iface->current_mode); + diff --git a/package/hostapd/patches/452-ctrl_iface_reload.patch b/package/hostapd/patches/452-ctrl_iface_reload.patch index cf972fe8ee..c0617eb75f 100644 --- a/package/hostapd/patches/452-ctrl_iface_reload.patch +++ b/package/hostapd/patches/452-ctrl_iface_reload.patch @@ -58,7 +58,7 @@ + conf->ht_capab &= atoi(val); + else if ((val = get_option(opt, "sec_chan="))) + conf->secondary_channel = atoi(val); -+ else if ((val = get_option(opt, "hwmode="))) ++ else if ((val = get_option(opt, "hw_mode="))) + conf->hw_mode = atoi(val); + else if ((val = get_option(opt, "ieee80211n="))) + conf->ieee80211n = atoi(val); diff --git a/package/hostapd/patches/480-terminate_on_setup_failure.patch b/package/hostapd/patches/480-terminate_on_setup_failure.patch index 13a7cdb80f..31ce3eb929 100644 --- a/package/hostapd/patches/480-terminate_on_setup_failure.patch +++ b/package/hostapd/patches/480-terminate_on_setup_failure.patch @@ -1,6 +1,6 @@ --- a/src/ap/hostapd.c +++ b/src/ap/hostapd.c -@@ -768,11 +768,8 @@ int hostapd_setup_interface_complete(str +@@ -778,11 +778,8 @@ int hostapd_setup_interface_complete(str size_t j; u8 *prev_addr; @@ -14,7 +14,7 @@ wpa_printf(MSG_DEBUG, "Completing interface initialization"); if (hapd->iconf->channel) { -@@ -788,7 +785,7 @@ int hostapd_setup_interface_complete(str +@@ -798,7 +795,7 @@ int hostapd_setup_interface_complete(str hapd->iconf->secondary_channel)) { wpa_printf(MSG_ERROR, "Could not set channel for " "kernel driver"); @@ -23,7 +23,7 @@ } } -@@ -799,7 +796,7 @@ int hostapd_setup_interface_complete(str +@@ -809,7 +806,7 @@ int hostapd_setup_interface_complete(str hostapd_logger(hapd, NULL, HOSTAPD_MODULE_IEEE80211, HOSTAPD_LEVEL_WARNING, "Failed to prepare rates table."); @@ -32,7 +32,7 @@ } } -@@ -807,14 +804,14 @@ int hostapd_setup_interface_complete(str +@@ -817,14 +814,14 @@ int hostapd_setup_interface_complete(str hostapd_set_rts(hapd, hapd->iconf->rts_threshold)) { wpa_printf(MSG_ERROR, "Could not set RTS threshold for " "kernel driver"); @@ -49,7 +49,7 @@ } prev_addr = hapd->own_addr; -@@ -824,7 +821,7 @@ int hostapd_setup_interface_complete(str +@@ -834,7 +831,7 @@ int hostapd_setup_interface_complete(str if (j) os_memcpy(hapd->own_addr, prev_addr, ETH_ALEN); if (hostapd_setup_bss(hapd, j == 0)) @@ -58,7 +58,7 @@ if (hostapd_mac_comp_empty(hapd->conf->bssid) == 0) prev_addr = hapd->own_addr; } -@@ -836,7 +833,7 @@ int hostapd_setup_interface_complete(str +@@ -846,7 +843,7 @@ int hostapd_setup_interface_complete(str if (hostapd_driver_commit(hapd) < 0) { wpa_printf(MSG_ERROR, "%s: Failed to commit driver " "configuration", __func__); @@ -67,7 +67,7 @@ } /* -@@ -860,6 +857,11 @@ int hostapd_setup_interface_complete(str +@@ -870,6 +867,11 @@ int hostapd_setup_interface_complete(str iface->init_complete(iface); return 0; diff --git a/package/hostapd/patches/540-dynamic_20_40_mhz.patch b/package/hostapd/patches/540-dynamic_20_40_mhz.patch index 08750b0158..420fcc6bf6 100644 --- a/package/hostapd/patches/540-dynamic_20_40_mhz.patch +++ b/package/hostapd/patches/540-dynamic_20_40_mhz.patch @@ -31,7 +31,7 @@ #include "ieee802_11_auth.h" #include "vlan_init.h" #include "wpa_auth.h" -@@ -307,6 +308,7 @@ static void hostapd_cleanup_iface_pre(st +@@ -317,6 +318,7 @@ static void hostapd_cleanup_iface_pre(st static void hostapd_cleanup_iface_partial(struct hostapd_iface *iface) { diff --git a/package/hostapd/patches/601-wpa_supplicant-add-new-config-params-to-be-used-with.patch b/package/hostapd/patches/601-wpa_supplicant-add-new-config-params-to-be-used-with.patch index a1fde052f9..447f480d1f 100644 --- a/package/hostapd/patches/601-wpa_supplicant-add-new-config-params-to-be-used-with.patch +++ b/package/hostapd/patches/601-wpa_supplicant-add-new-config-params-to-be-used-with.patch @@ -12,8 +12,6 @@ Signed-hostap: Antonio Quartulli wpa_supplicant/wpa_supplicant.c | 23 +++++++--- 4 files changed, 124 insertions(+), 7 deletions(-) -diff --git a/src/drivers/driver.h b/src/drivers/driver.h -index 5ee92f7..d204148 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -19,6 +19,7 @@ @@ -36,8 +34,6 @@ index 5ee92f7..d204148 100644 /** * bg_scan_period - Background scan period in seconds, 0 to disable * background scan, or -1 to indicate no change to default driver -diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c -index c423bc3..be566ee 100644 --- a/wpa_supplicant/config.c +++ b/wpa_supplicant/config.c @@ -14,6 +14,7 @@ @@ -48,7 +44,7 @@ index c423bc3..be566ee 100644 #include "config.h" -@@ -1431,6 +1432,97 @@ static char * wpa_config_write_p2p_client_list(const struct parse_data *data, +@@ -1431,6 +1432,97 @@ static char * wpa_config_write_p2p_clien #endif /* CONFIG_P2P */ @@ -146,7 +142,7 @@ index c423bc3..be566ee 100644 /* Helper macros for network block parser */ #ifdef OFFSET -@@ -1605,6 +1697,10 @@ static const struct parse_data ssid_fields[] = { +@@ -1605,6 +1697,10 @@ static const struct parse_data ssid_fiel { STR(ht_mcs) }, #endif /* CONFIG_HT_OVERRIDES */ { INT(ap_max_inactivity) }, @@ -157,8 +153,6 @@ index c423bc3..be566ee 100644 }; #undef OFFSET -diff --git a/wpa_supplicant/config_ssid.h b/wpa_supplicant/config_ssid.h -index 80d4382..8d152a4 100644 --- a/wpa_supplicant/config_ssid.h +++ b/wpa_supplicant/config_ssid.h @@ -11,6 +11,7 @@ @@ -181,11 +175,9 @@ index 80d4382..8d152a4 100644 }; #endif /* CONFIG_SSID_H */ -diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c -index cc85f1e..1473d91 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -1395,15 +1395,24 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s, +@@ -1395,15 +1395,24 @@ void wpa_supplicant_associate(struct wpa params.ssid_len = ssid->ssid_len; } @@ -217,6 +209,3 @@ index cc85f1e..1473d91 100644 params.wpa_ie = wpa_ie; params.wpa_ie_len = wpa_ie_len; params.pairwise_suite = cipher_pairwise; --- -1.7.9.4 - diff --git a/package/hostapd/patches/602-driver_nl80211-use-new-parameters-during-ibss-join.patch b/package/hostapd/patches/602-driver_nl80211-use-new-parameters-during-ibss-join.patch index 5f4df23ebe..28eba21d95 100644 --- a/package/hostapd/patches/602-driver_nl80211-use-new-parameters-during-ibss-join.patch +++ b/package/hostapd/patches/602-driver_nl80211-use-new-parameters-during-ibss-join.patch @@ -8,11 +8,9 @@ Signed-hostap: Antonio Quartulli src/drivers/driver_nl80211.c | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) -diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c -index 22e7075..f510d18 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -6481,7 +6481,7 @@ static int wpa_driver_nl80211_ibss(struct wpa_driver_nl80211_data *drv, +@@ -6481,7 +6481,7 @@ static int wpa_driver_nl80211_ibss(struc struct wpa_driver_associate_params *params) { struct nl_msg *msg; @@ -59,6 +57,3 @@ index 22e7075..f510d18 100644 ret = nl80211_set_conn_keys(params, msg); if (ret) goto nla_put_failure; --- -1.7.9.4 - diff --git a/package/hostapd/patches/604-wpa_s-support-htmode-param.patch b/package/hostapd/patches/604-wpa_s-support-htmode-param.patch index 7e1a7a072f..e540d45334 100644 --- a/package/hostapd/patches/604-wpa_s-support-htmode-param.patch +++ b/package/hostapd/patches/604-wpa_s-support-htmode-param.patch @@ -14,8 +14,6 @@ Signed-off-by: Antonio Quartulli wpa_supplicant/wpa_supplicant.c | 2 ++ 5 files changed, 88 insertions(+) -diff --git a/src/drivers/driver.h b/src/drivers/driver.h -index dda2fbc..28bd181 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -337,6 +337,8 @@ struct wpa_driver_associate_params { @@ -27,11 +25,9 @@ index dda2fbc..28bd181 100644 /** * bg_scan_period - Background scan period in seconds, 0 to disable -diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c -index 9783c96..d1257a7 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c -@@ -6493,6 +6493,22 @@ retry: +@@ -6545,6 +6545,22 @@ retry: NLA_PUT_U32(msg, NL80211_ATTR_MCAST_RATE, params->mcast_rate); } @@ -54,11 +50,9 @@ index 9783c96..d1257a7 100644 ret = nl80211_set_conn_keys(params, msg); if (ret) goto nla_put_failure; -diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c -index 3d6c0e6..d96b2ea 100644 --- a/wpa_supplicant/config.c +++ b/wpa_supplicant/config.c -@@ -1468,6 +1468,71 @@ static char * wpa_config_write_mcast_rate(const struct parse_data *data, +@@ -1463,6 +1463,71 @@ static char * wpa_config_write_mcast_rat } #endif /* NO_CONFIG_WRITE */ @@ -130,7 +124,7 @@ index 3d6c0e6..d96b2ea 100644 static int wpa_config_parse_rates(const struct parse_data *data, struct wpa_ssid *ssid, int line, const char *value) -@@ -1706,6 +1771,7 @@ static const struct parse_data ssid_fields[] = { +@@ -1701,6 +1766,7 @@ static const struct parse_data ssid_fiel { INT_RANGE(beacon_interval, 0, 1000) }, { FUNC(rates) }, { FUNC(mcast_rate) }, @@ -138,8 +132,6 @@ index 3d6c0e6..d96b2ea 100644 }; #undef OFFSET -diff --git a/wpa_supplicant/config_ssid.h b/wpa_supplicant/config_ssid.h -index 8d152a4..7143277 100644 --- a/wpa_supplicant/config_ssid.h +++ b/wpa_supplicant/config_ssid.h @@ -505,6 +505,8 @@ struct wpa_ssid { @@ -151,11 +143,9 @@ index 8d152a4..7143277 100644 }; #endif /* CONFIG_SSID_H */ -diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c -index 59efa16..fc8762f 100644 --- a/wpa_supplicant/wpa_supplicant.c +++ b/wpa_supplicant/wpa_supplicant.c -@@ -1379,6 +1379,8 @@ void wpa_supplicant_associate(struct wpa_supplicant *wpa_s, +@@ -1411,6 +1411,8 @@ void wpa_supplicant_associate(struct wpa i++; } params.mcast_rate = ssid->mcast_rate; @@ -164,6 +154,3 @@ index 59efa16..fc8762f 100644 } params.wpa_ie = wpa_ie; --- -1.7.9.4 - -- 2.25.1