SVN-Revision: 9564
lede-17.01
Felix Fietkau 2007-11-16 03:24:01 +00:00
parent 5a543584b8
commit 42d7efd083
7 changed files with 75 additions and 57 deletions

View File

@ -10,8 +10,8 @@
hostapd/wme.c | 6 ++++-- hostapd/wme.c | 6 ++++--
9 files changed, 23 insertions(+), 18 deletions(-) 9 files changed, 23 insertions(+), 18 deletions(-)
--- hostap.orig/hostapd/driver.h 2007-11-09 13:41:07.000000000 +0100 --- hostap.orig/hostapd/driver.h 2007-11-14 17:30:38.000000000 +0100
+++ hostap/hostapd/driver.h 2007-11-09 13:41:15.000000000 +0100 +++ hostap/hostapd/driver.h 2007-11-14 17:30:47.000000000 +0100
@@ -92,7 +92,7 @@ struct wpa_driver_ops { @@ -92,7 +92,7 @@ struct wpa_driver_ops {
int (*get_retry)(void *priv, int *short_retry, int *long_retry); int (*get_retry)(void *priv, int *short_retry, int *long_retry);
@ -37,8 +37,8 @@
} }
static inline int static inline int
--- hostap.orig/hostapd/driver_bsd.c 2007-11-09 13:41:07.000000000 +0100 --- hostap.orig/hostapd/driver_bsd.c 2007-11-14 17:30:38.000000000 +0100
+++ hostap/hostapd/driver_bsd.c 2007-11-09 13:41:15.000000000 +0100 +++ hostap/hostapd/driver_bsd.c 2007-11-14 17:30:47.000000000 +0100
@@ -322,7 +322,8 @@ bsd_set_sta_authorized(void *priv, const @@ -322,7 +322,8 @@ bsd_set_sta_authorized(void *priv, const
} }
@ -49,9 +49,9 @@
{ {
/* For now, only support setting Authorized flag */ /* For now, only support setting Authorized flag */
if (flags_or & WLAN_STA_AUTHORIZED) if (flags_or & WLAN_STA_AUTHORIZED)
--- hostap.orig/hostapd/driver_devicescape.c 2007-11-09 13:41:14.000000000 +0100 --- hostap.orig/hostapd/driver_devicescape.c 2007-11-14 17:30:39.000000000 +0100
+++ hostap/hostapd/driver_devicescape.c 2007-11-09 13:41:15.000000000 +0100 +++ hostap/hostapd/driver_devicescape.c 2007-11-14 17:30:47.000000000 +0100
@@ -76,7 +76,7 @@ struct i802_driver_data { @@ -74,7 +74,7 @@ struct i802_driver_data {
#define HAPD_DECL struct hostapd_data *hapd = iface->bss[0] #define HAPD_DECL struct hostapd_data *hapd = iface->bss[0]
static int i802_sta_set_flags(void *priv, const u8 *addr, static int i802_sta_set_flags(void *priv, const u8 *addr,
@ -60,7 +60,7 @@
static int hostapd_set_iface_flags(struct i802_driver_data *drv, int dev_up) static int hostapd_set_iface_flags(struct i802_driver_data *drv, int dev_up)
@@ -765,7 +765,7 @@ static int i802_sta_remove(void *priv, c @@ -666,7 +666,7 @@ static int i802_sta_remove(void *priv, c
struct i802_driver_data *drv = priv; struct i802_driver_data *drv = priv;
struct prism2_hostapd_param param; struct prism2_hostapd_param param;
@ -69,7 +69,7 @@
memset(&param, 0, sizeof(param)); memset(&param, 0, sizeof(param));
param.cmd = PRISM2_HOSTAPD_REMOVE_STA; param.cmd = PRISM2_HOSTAPD_REMOVE_STA;
@@ -777,7 +777,7 @@ static int i802_sta_remove(void *priv, c @@ -678,7 +678,7 @@ static int i802_sta_remove(void *priv, c
static int i802_sta_set_flags(void *priv, const u8 *addr, static int i802_sta_set_flags(void *priv, const u8 *addr,
@ -78,8 +78,8 @@
{ {
struct i802_driver_data *drv = priv; struct i802_driver_data *drv = priv;
struct prism2_hostapd_param param; struct prism2_hostapd_param param;
--- hostap.orig/hostapd/driver_hostap.c 2007-11-09 13:41:07.000000000 +0100 --- hostap.orig/hostapd/driver_hostap.c 2007-11-14 17:30:38.000000000 +0100
+++ hostap/hostapd/driver_hostap.c 2007-11-09 13:41:15.000000000 +0100 +++ hostap/hostapd/driver_hostap.c 2007-11-14 17:30:47.000000000 +0100
@@ -374,7 +374,7 @@ static int hostap_send_eapol(void *priv, @@ -374,7 +374,7 @@ static int hostap_send_eapol(void *priv,
@ -98,8 +98,8 @@
memset(&param, 0, sizeof(param)); memset(&param, 0, sizeof(param));
param.cmd = PRISM2_HOSTAPD_REMOVE_STA; param.cmd = PRISM2_HOSTAPD_REMOVE_STA;
--- hostap.orig/hostapd/driver_madwifi.c 2007-11-09 13:41:07.000000000 +0100 --- hostap.orig/hostapd/driver_madwifi.c 2007-11-14 17:30:38.000000000 +0100
+++ hostap/hostapd/driver_madwifi.c 2007-11-09 13:41:15.000000000 +0100 +++ hostap/hostapd/driver_madwifi.c 2007-11-14 17:30:47.000000000 +0100
@@ -410,7 +410,8 @@ madwifi_set_sta_authorized(void *priv, c @@ -410,7 +410,8 @@ madwifi_set_sta_authorized(void *priv, c
} }
@ -110,8 +110,8 @@
{ {
/* For now, only support setting Authorized flag */ /* For now, only support setting Authorized flag */
if (flags_or & WLAN_STA_AUTHORIZED) if (flags_or & WLAN_STA_AUTHORIZED)
--- hostap.orig/hostapd/driver_prism54.c 2007-11-09 13:41:07.000000000 +0100 --- hostap.orig/hostapd/driver_prism54.c 2007-11-14 17:30:38.000000000 +0100
+++ hostap/hostapd/driver_prism54.c 2007-11-09 13:41:15.000000000 +0100 +++ hostap/hostapd/driver_prism54.c 2007-11-14 17:30:47.000000000 +0100
@@ -187,7 +187,8 @@ static int prism54_set_sta_authorized(vo @@ -187,7 +187,8 @@ static int prism54_set_sta_authorized(vo
@ -122,8 +122,8 @@
{ {
/* For now, only support setting Authorized flag */ /* For now, only support setting Authorized flag */
if (flags_or & WLAN_STA_AUTHORIZED) if (flags_or & WLAN_STA_AUTHORIZED)
--- hostap.orig/hostapd/ieee802_11.c 2007-11-09 13:41:07.000000000 +0100 --- hostap.orig/hostapd/ieee802_11.c 2007-11-14 17:30:37.000000000 +0100
+++ hostap/hostapd/ieee802_11.c 2007-11-09 13:41:15.000000000 +0100 +++ hostap/hostapd/ieee802_11.c 2007-11-14 17:30:47.000000000 +0100
@@ -1625,10 +1625,10 @@ static void handle_assoc_cb(struct hosta @@ -1625,10 +1625,10 @@ static void handle_assoc_cb(struct hosta
ap_sta_bind_vlan(hapd, sta, 0); ap_sta_bind_vlan(hapd, sta, 0);
} }
@ -137,8 +137,8 @@
0, ~WLAN_STA_SHORT_PREAMBLE); 0, ~WLAN_STA_SHORT_PREAMBLE);
} }
--- hostap.orig/hostapd/ieee802_1x.c 2007-11-09 13:41:07.000000000 +0100 --- hostap.orig/hostapd/ieee802_1x.c 2007-11-14 17:30:37.000000000 +0100
+++ hostap/hostapd/ieee802_1x.c 2007-11-09 13:41:15.000000000 +0100 +++ hostap/hostapd/ieee802_1x.c 2007-11-14 17:30:47.000000000 +0100
@@ -94,13 +94,13 @@ void ieee802_1x_set_sta_authorized(struc @@ -94,13 +94,13 @@ void ieee802_1x_set_sta_authorized(struc
if (authorized) { if (authorized) {
@ -155,8 +155,8 @@
0, ~WLAN_STA_AUTHORIZED); 0, ~WLAN_STA_AUTHORIZED);
hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X, hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE8021X,
HOSTAPD_LEVEL_DEBUG, "unauthorizing port"); HOSTAPD_LEVEL_DEBUG, "unauthorizing port");
--- hostap.orig/hostapd/wme.c 2007-11-09 13:41:07.000000000 +0100 --- hostap.orig/hostapd/wme.c 2007-11-14 17:30:38.000000000 +0100
+++ hostap/hostapd/wme.c 2007-11-09 13:41:15.000000000 +0100 +++ hostap/hostapd/wme.c 2007-11-14 17:30:47.000000000 +0100
@@ -110,9 +110,11 @@ int hostapd_wme_sta_config(struct hostap @@ -110,9 +110,11 @@ int hostapd_wme_sta_config(struct hostap
{ {
/* update kernel STA data for WME related items (WLAN_STA_WPA flag) */ /* update kernel STA data for WME related items (WLAN_STA_WPA flag) */

View File

@ -1,18 +0,0 @@
---
hostapd/driver_devicescape.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- hostap.orig/hostapd/driver_devicescape.c 2007-11-09 13:41:08.000000000 +0100
+++ hostap/hostapd/driver_devicescape.c 2007-11-09 13:41:12.000000000 +0100
@@ -1386,10 +1386,10 @@ static void handle_frame(struct hostapd_
case ieee80211_msg_wep_frame_unknown_key:
ieee802_11_rx_unknown_key(hapd, buf, data_len);
return;
- */
case ieee80211_msg_michael_mic_failure:
hostapd_michael_mic_failure(hapd, buf, data_len);
return;
+ */
/*
* TODO
* We should be telling them to go away. But we don't support that now.

View File

@ -0,0 +1,34 @@
---
hostapd/driver_devicescape.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- hostap.orig/hostapd/driver_devicescape.c 2007-11-14 17:30:47.000000000 +0100
+++ hostap/hostapd/driver_devicescape.c 2007-11-14 17:31:07.000000000 +0100
@@ -1264,6 +1264,7 @@ static void dump_frame_info(struct ieee8
}
+/*
static void hostapd_michael_mic_failure(struct hostapd_data *hapd, u8 *buf,
size_t len)
{
@@ -1278,6 +1279,7 @@ static void hostapd_michael_mic_failure(
mlme_michaelmicfailure_indication(hapd, hdr->addr2);
}
+*/
static void handle_frame(struct hostapd_iface *iface, u8 *buf, size_t len,
@@ -1386,10 +1388,10 @@ static void handle_frame(struct hostapd_
case ieee80211_msg_wep_frame_unknown_key:
ieee802_11_rx_unknown_key(hapd, buf, data_len);
return;
- */
case ieee80211_msg_michael_mic_failure:
hostapd_michael_mic_failure(hapd, buf, data_len);
return;
+ */
/*
* TODO
* We should be telling them to go away. But we don't support that now.

View File

@ -1,9 +1,9 @@
--- ---
hostapd/driver_devicescape.c | 330 ++++++++++++++++++++++++++++++++----------- hostapd/driver_devicescape.c | 332 ++++++++++++++++++++++++++++++++-----------
1 file changed, 249 insertions(+), 81 deletions(-) 1 file changed, 251 insertions(+), 81 deletions(-)
--- hostap.orig/hostapd/driver_devicescape.c 2007-11-09 13:41:15.000000000 +0100 --- hostap.orig/hostapd/driver_devicescape.c 2007-11-14 17:31:15.000000000 +0100
+++ hostap/hostapd/driver_devicescape.c 2007-11-09 13:41:16.000000000 +0100 +++ hostap/hostapd/driver_devicescape.c 2007-11-14 17:31:16.000000000 +0100
@@ -75,8 +75,14 @@ struct i802_driver_data { @@ -75,8 +75,14 @@ struct i802_driver_data {
#define HAPD_DECL struct hostapd_data *hapd = iface->bss[0] #define HAPD_DECL struct hostapd_data *hapd = iface->bss[0]
@ -128,12 +128,15 @@
+ int ret = -1; + int ret = -1;
+ int err = 0; + int err = 0;
+ int finished = 0; + int finished = 0;
+
- memset(data, 0, sizeof(*data));
+ msg = nlmsg_alloc(); + msg = nlmsg_alloc();
+ if (!msg) + if (!msg)
+ goto out; + goto out;
- memset(data, 0, sizeof(*data));
+ genlmsg_put(msg, 0, 0, genl_family_get_id(drv->nl80211), 0,
+ 0, NL80211_CMD_GET_STATION, 0);
- memset(&param, 0, sizeof(param)); - memset(&param, 0, sizeof(param));
- param.cmd = PRISM2_HOSTAPD_GET_INFO_STA; - param.cmd = PRISM2_HOSTAPD_GET_INFO_STA;
- memcpy(param.sta_addr, addr, ETH_ALEN); - memcpy(param.sta_addr, addr, ETH_ALEN);
@ -141,9 +144,6 @@
- printf(" Could not get station info from kernel driver.\n"); - printf(" Could not get station info from kernel driver.\n");
- return -1; - return -1;
- } - }
+ genlmsg_put(msg, 0, 0, genl_family_get_id(drv->nl80211), 0,
+ 0, NL80211_CMD_GET_STATION, 0);
+
+ NLA_PUT(msg, NL80211_ATTR_MAC, ETH_ALEN, addr); + NLA_PUT(msg, NL80211_ATTR_MAC, ETH_ALEN, addr);
+ NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, if_nametoindex(drv->iface)); + NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, if_nametoindex(drv->iface));
+ +
@ -189,7 +189,7 @@
} }
@@ -744,35 +825,68 @@ static int i802_sta_add(const char *ifna @@ -744,35 +825,70 @@ static int i802_sta_add(const char *ifna
size_t supp_rates_len, int flags) size_t supp_rates_len, int flags)
{ {
struct i802_driver_data *drv = priv; struct i802_driver_data *drv = priv;
@ -223,12 +223,14 @@
+ supp_rates); + supp_rates);
+ NLA_PUT_U16(msg, NL80211_ATTR_STA_LISTEN_INTERVAL, 0); + NLA_PUT_U16(msg, NL80211_ATTR_STA_LISTEN_INTERVAL, 0);
+ +
+ ret = 0; + ret = nl_send_auto_complete(drv->nl_handle, msg);
+ if (ret < 0)
+ goto nla_put_failure;
+ +
+ if (nl_send_auto_complete(drv->nl_handle, msg) < 0 || + ret = nl_wait_for_ack(drv->nl_handle);
+ nl_wait_for_ack(drv->nl_handle) < 0) { + /* ignore EEXIST, this happens if a STA associates while associated */
+ ret = -1; + if (ret == -EEXIST || ret >= 0)
+ } + ret = 0;
+ +
+ nla_put_failure: + nla_put_failure:
+ nlmsg_free(msg); + nlmsg_free(msg);
@ -278,7 +280,7 @@
} }
@@ -780,14 +894,51 @@ static int i802_sta_set_flags(void *priv @@ -780,14 +896,51 @@ static int i802_sta_set_flags(void *priv
int total_flags, int flags_or, int flags_and) int total_flags, int flags_or, int flags_and)
{ {
struct i802_driver_data *drv = priv; struct i802_driver_data *drv = priv;
@ -337,7 +339,7 @@
} }
@@ -1257,18 +1408,38 @@ static struct hostapd_hw_modes * i802_ge @@ -1257,18 +1410,38 @@ static struct hostapd_hw_modes * i802_ge
} }
@ -385,7 +387,7 @@
} }
@@ -1750,17 +1921,14 @@ static int i802_init_sockets(struct i802 @@ -1752,17 +1925,14 @@ static int i802_init_sockets(struct i802
static int i802_get_inact_sec(void *priv, const u8 *addr) static int i802_get_inact_sec(void *priv, const u8 *addr)
{ {