Remove unnecessary ifname parameter from sta_add() driver op

This commit is contained in:
Jouni Malinen 2010-03-07 11:42:41 +02:00
parent 8709de1ae8
commit 62847751e4
8 changed files with 13 additions and 17 deletions

View file

@ -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, &params);
return hapd->driver->sta_add(hapd->drv_priv, &params);
}

View file

@ -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,

View file

@ -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,

View file

@ -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)

View file

@ -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;

View file

@ -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,

View file

@ -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);

View file

@ -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;
}