Replace send_ft_action() driver_op with send_action()
This reduced number of unnecessarily duplicated driver interface callback functions for sending Action frames by using the more generic send_action() instead of FT specific send_ft_action(). Signed-off-by: Jouni Malinen <j@w1.fi>
This commit is contained in:
parent
477af8f869
commit
8105821b39
4 changed files with 38 additions and 75 deletions
|
@ -1818,22 +1818,6 @@ struct wpa_driver_ops {
|
|||
int (*update_ft_ies)(void *priv, const u8 *md, const u8 *ies,
|
||||
size_t ies_len);
|
||||
|
||||
/**
|
||||
* send_ft_action - Send FT Action frame (IEEE 802.11r)
|
||||
* @priv: Private driver interface data
|
||||
* @action: Action field value
|
||||
* @target_ap: Target AP address
|
||||
* @ies: FT IEs (MDIE, FTIE, ...) (FT Request action frame body)
|
||||
* @ies_len: Length of FT IEs in bytes
|
||||
* Returns: 0 on success, -1 on failure
|
||||
*
|
||||
* The supplicant uses this callback to request the driver to transmit
|
||||
* an FT Action frame (action category 6) for over-the-DS fast BSS
|
||||
* transition.
|
||||
*/
|
||||
int (*send_ft_action)(void *priv, u8 action, const u8 *target_ap,
|
||||
const u8 *ies, size_t ies_len);
|
||||
|
||||
/**
|
||||
* get_scan_results2 - Fetch the latest scan results
|
||||
* @priv: private driver interface data
|
||||
|
|
|
@ -6209,53 +6209,6 @@ static void wpa_driver_nl80211_resume(void *priv)
|
|||
}
|
||||
|
||||
|
||||
static int nl80211_send_ft_action(void *priv, u8 action, const u8 *target_ap,
|
||||
const u8 *ies, size_t ies_len)
|
||||
{
|
||||
struct i802_bss *bss = priv;
|
||||
struct wpa_driver_nl80211_data *drv = bss->drv;
|
||||
int ret;
|
||||
u8 *data, *pos;
|
||||
size_t data_len;
|
||||
const u8 *own_addr = bss->addr;
|
||||
|
||||
if (action != 1) {
|
||||
wpa_printf(MSG_ERROR, "nl80211: Unsupported send_ft_action "
|
||||
"action %d", action);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Action frame payload:
|
||||
* Category[1] = 6 (Fast BSS Transition)
|
||||
* Action[1] = 1 (Fast BSS Transition Request)
|
||||
* STA Address
|
||||
* Target AP Address
|
||||
* FT IEs
|
||||
*/
|
||||
|
||||
data_len = 2 + 2 * ETH_ALEN + ies_len;
|
||||
data = os_malloc(data_len);
|
||||
if (data == NULL)
|
||||
return -1;
|
||||
pos = data;
|
||||
*pos++ = 0x06; /* FT Action category */
|
||||
*pos++ = action;
|
||||
os_memcpy(pos, own_addr, ETH_ALEN);
|
||||
pos += ETH_ALEN;
|
||||
os_memcpy(pos, target_ap, ETH_ALEN);
|
||||
pos += ETH_ALEN;
|
||||
os_memcpy(pos, ies, ies_len);
|
||||
|
||||
ret = wpa_driver_nl80211_send_action(bss, drv->assoc_freq, 0,
|
||||
drv->bssid, own_addr, drv->bssid,
|
||||
data, data_len, 0);
|
||||
os_free(data);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
static int nl80211_signal_monitor(void *priv, int threshold, int hysteresis)
|
||||
{
|
||||
struct i802_bss *bss = priv;
|
||||
|
@ -8225,7 +8178,6 @@ const struct wpa_driver_ops wpa_driver_nl80211_ops = {
|
|||
.deinit_ap = wpa_driver_nl80211_deinit_ap,
|
||||
.deinit_p2p_cli = wpa_driver_nl80211_deinit_p2p_cli,
|
||||
.resume = wpa_driver_nl80211_resume,
|
||||
.send_ft_action = nl80211_send_ft_action,
|
||||
.signal_monitor = nl80211_signal_monitor,
|
||||
.signal_poll = nl80211_signal_poll,
|
||||
.send_frame = nl80211_send_frame,
|
||||
|
|
|
@ -310,16 +310,6 @@ static inline int wpa_drv_update_ft_ies(struct wpa_supplicant *wpa_s,
|
|||
return -1;
|
||||
}
|
||||
|
||||
static inline int wpa_drv_send_ft_action(struct wpa_supplicant *wpa_s,
|
||||
u8 action, const u8 *target_ap,
|
||||
const u8 *ies, size_t ies_len)
|
||||
{
|
||||
if (wpa_s->driver->send_ft_action)
|
||||
return wpa_s->driver->send_ft_action(wpa_s->drv_priv, action,
|
||||
target_ap, ies, ies_len);
|
||||
return -1;
|
||||
}
|
||||
|
||||
static inline int wpa_drv_set_ap(struct wpa_supplicant *wpa_s,
|
||||
struct wpa_driver_ap_params *params)
|
||||
{
|
||||
|
|
|
@ -543,7 +543,44 @@ static int wpa_supplicant_send_ft_action(void *ctx, u8 action,
|
|||
const u8 *ies, size_t ies_len)
|
||||
{
|
||||
struct wpa_supplicant *wpa_s = ctx;
|
||||
return wpa_drv_send_ft_action(wpa_s, action, target_ap, ies, ies_len);
|
||||
int ret;
|
||||
u8 *data, *pos;
|
||||
size_t data_len;
|
||||
|
||||
if (action != 1) {
|
||||
wpa_printf(MSG_ERROR, "Unsupported send_ft_action action %d",
|
||||
action);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Action frame payload:
|
||||
* Category[1] = 6 (Fast BSS Transition)
|
||||
* Action[1] = 1 (Fast BSS Transition Request)
|
||||
* STA Address
|
||||
* Target AP Address
|
||||
* FT IEs
|
||||
*/
|
||||
|
||||
data_len = 2 + 2 * ETH_ALEN + ies_len;
|
||||
data = os_malloc(data_len);
|
||||
if (data == NULL)
|
||||
return -1;
|
||||
pos = data;
|
||||
*pos++ = 0x06; /* FT Action category */
|
||||
*pos++ = action;
|
||||
os_memcpy(pos, wpa_s->own_addr, ETH_ALEN);
|
||||
pos += ETH_ALEN;
|
||||
os_memcpy(pos, target_ap, ETH_ALEN);
|
||||
pos += ETH_ALEN;
|
||||
os_memcpy(pos, ies, ies_len);
|
||||
|
||||
ret = wpa_drv_send_action(wpa_s, wpa_s->assoc_freq, 0,
|
||||
wpa_s->bssid, wpa_s->own_addr, wpa_s->bssid,
|
||||
data, data_len, 0);
|
||||
os_free(data);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue