From 62847751e4d7e478198424767944ce79a464fecd Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sun, 7 Mar 2010 11:42:41 +0200 Subject: [PATCH] Remove unnecessary ifname parameter from sta_add() driver op --- src/ap/ap_drv_ops.c | 4 ++-- src/ap/hostapd.h | 2 +- src/ap/ieee802_11.c | 6 +++--- src/drivers/driver.h | 4 +--- src/drivers/driver_hostap.c | 3 +-- src/drivers/driver_nl80211.c | 4 ++-- src/drivers/driver_test.c | 4 ++-- wpa_supplicant/driver_i.h | 3 +-- 8 files changed, 13 insertions(+), 17 deletions(-) diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c index b392ebd82..2261cdf21 100644 --- a/src/ap/ap_drv_ops.c +++ b/src/ap/ap_drv_ops.c @@ -299,7 +299,7 @@ static int hostapd_sta_disassoc(struct hostapd_data *hapd, const u8 *addr, } -static int hostapd_sta_add(const char *ifname, struct hostapd_data *hapd, +static int hostapd_sta_add(struct hostapd_data *hapd, const u8 *addr, u16 aid, u16 capability, const u8 *supp_rates, size_t supp_rates_len, u16 listen_interval, @@ -320,7 +320,7 @@ static int hostapd_sta_add(const char *ifname, struct hostapd_data *hapd, params.supp_rates_len = supp_rates_len; params.listen_interval = listen_interval; params.ht_capabilities = ht_capab; - return hapd->driver->sta_add(ifname, hapd->drv_priv, ¶ms); + return hapd->driver->sta_add(hapd->drv_priv, ¶ms); } diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h index 13b6722b0..61956f8e4 100644 --- a/src/ap/hostapd.h +++ b/src/ap/hostapd.h @@ -89,7 +89,7 @@ struct hostapd_driver_ops { int reason); int (*sta_disassoc)(struct hostapd_data *hapd, const u8 *addr, int reason); - int (*sta_add)(const char *ifname, struct hostapd_data *hapd, + int (*sta_add)(struct hostapd_data *hapd, const u8 *addr, u16 aid, u16 capability, const u8 *supp_rates, size_t supp_rates_len, u16 listen_interval, diff --git a/src/ap/ieee802_11.c b/src/ap/ieee802_11.c index 80815ac03..b6ac50b25 100644 --- a/src/ap/ieee802_11.c +++ b/src/ap/ieee802_11.c @@ -1550,9 +1550,9 @@ static void handle_assoc_cb(struct hostapd_data *hapd, hostapd_get_ht_capab(hapd, sta->ht_capabilities, &ht_cap); #endif /* CONFIG_IEEE80211N */ - if (hapd->drv.sta_add(hapd->conf->iface, hapd, sta->addr, sta->aid, - sta->capability, sta->supported_rates, - sta->supported_rates_len, sta->listen_interval, + if (hapd->drv.sta_add(hapd, sta->addr, sta->aid, sta->capability, + sta->supported_rates, sta->supported_rates_len, + sta->listen_interval, sta->flags & WLAN_STA_HT ? &ht_cap : NULL)) { hostapd_logger(hapd, sta->addr, HOSTAPD_MODULE_IEEE80211, HOSTAPD_LEVEL_NOTICE, diff --git a/src/drivers/driver.h b/src/drivers/driver.h index d3b8e8545..c146bf05c 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -1359,7 +1359,6 @@ struct wpa_driver_ops { /** * sta_add - Add a station entry - * @ifname: Interface (master or virtual) * @priv: Private driver interface data * @params: Station parameters * Returns: 0 on success, -1 on failure @@ -1368,8 +1367,7 @@ struct wpa_driver_ops { * station has completed association. This is only used if the driver * does not take care of association processing. */ - int (*sta_add)(const char *ifname, void *priv, - struct hostapd_sta_add_params *params); + int (*sta_add)(void *priv, struct hostapd_sta_add_params *params); /** * get_inact_sec - Get station inactivity duration (AP only) diff --git a/src/drivers/driver_hostap.c b/src/drivers/driver_hostap.c index a0cd13248..476cba5f9 100644 --- a/src/drivers/driver_hostap.c +++ b/src/drivers/driver_hostap.c @@ -624,8 +624,7 @@ static int hostap_read_sta_data(void *priv, } -static int hostap_sta_add(const char *ifname, void *priv, - struct hostapd_sta_add_params *params) +static int hostap_sta_add(void *priv, struct hostapd_sta_add_params *params) { struct hostap_driver_data *drv = priv; struct prism2_hostapd_param param; diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 2841ffcd3..e56670372 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -2771,7 +2771,7 @@ nla_put_failure: } -static int wpa_driver_nl80211_sta_add(const char *ifname, void *priv, +static int wpa_driver_nl80211_sta_add(void *priv, struct hostapd_sta_add_params *params) { struct i802_bss *bss = priv; @@ -2786,7 +2786,7 @@ static int wpa_driver_nl80211_sta_add(const char *ifname, void *priv, genlmsg_put(msg, 0, 0, genl_family_get_id(drv->nl80211), 0, 0, NL80211_CMD_NEW_STATION, 0); - NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, if_nametoindex(ifname)); + NLA_PUT_U32(msg, NL80211_ATTR_IFINDEX, if_nametoindex(bss->ifname)); NLA_PUT(msg, NL80211_ATTR_MAC, ETH_ALEN, params->addr); NLA_PUT_U16(msg, NL80211_ATTR_STA_AID, params->aid); NLA_PUT(msg, NL80211_ATTR_STA_SUPPORTED_RATES, params->supp_rates_len, diff --git a/src/drivers/driver_test.c b/src/drivers/driver_test.c index e6b1f1f82..9cd36ba53 100644 --- a/src/drivers/driver_test.c +++ b/src/drivers/driver_test.c @@ -1080,7 +1080,7 @@ static int test_driver_set_sta_vlan(void *priv, const u8 *addr, } -static int test_driver_sta_add(const char *ifname, void *priv, +static int test_driver_sta_add(void *priv, struct hostapd_sta_add_params *params) { struct test_driver_bss *bss = priv; @@ -1089,7 +1089,7 @@ static int test_driver_sta_add(const char *ifname, void *priv, wpa_printf(MSG_DEBUG, "%s(ifname=%s addr=" MACSTR " aid=%d " "capability=0x%x listen_interval=%d)", - __func__, ifname, MAC2STR(params->addr), params->aid, + __func__, bss->ifname, MAC2STR(params->addr), params->aid, params->capability, params->listen_interval); wpa_hexdump(MSG_DEBUG, "test_driver_sta_add - supp_rates", params->supp_rates, params->supp_rates_len); diff --git a/wpa_supplicant/driver_i.h b/wpa_supplicant/driver_i.h index 51c5afd86..d92a73417 100644 --- a/wpa_supplicant/driver_i.h +++ b/wpa_supplicant/driver_i.h @@ -336,8 +336,7 @@ static inline int wpa_drv_sta_add(struct wpa_supplicant *wpa_s, struct hostapd_sta_add_params *params) { if (wpa_s->driver->sta_add) - return wpa_s->driver->sta_add(wpa_s->ifname, wpa_s->drv_priv, - params); + return wpa_s->driver->sta_add(wpa_s->drv_priv, params); return -1; }