drivers: Add freq parameter to send_mlme() function

Change send_mlme() API to allow sending management frames on a specific
channel, overriding the internal driver decision.

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com>
Reviewed-by: Ilan Peer <ilan.peer@intel.com>
This commit is contained in:
Andrei Otcheretianski 2015-06-10 11:43:34 +03:00 committed by Jouni Malinen
parent 5143e7ee6e
commit 5d180a7739
6 changed files with 11 additions and 7 deletions

View file

@ -633,7 +633,7 @@ int hostapd_drv_send_mlme(struct hostapd_data *hapd,
{ {
if (hapd->driver == NULL || hapd->driver->send_mlme == NULL) if (hapd->driver == NULL || hapd->driver->send_mlme == NULL)
return 0; return 0;
return hapd->driver->send_mlme(hapd->drv_priv, msg, len, noack); return hapd->driver->send_mlme(hapd->drv_priv, msg, len, noack, 0);
} }

View file

@ -1940,10 +1940,12 @@ struct wpa_driver_ops {
* @data: IEEE 802.11 management frame with IEEE 802.11 header * @data: IEEE 802.11 management frame with IEEE 802.11 header
* @data_len: Size of the management frame * @data_len: Size of the management frame
* @noack: Do not wait for this frame to be acked (disable retries) * @noack: Do not wait for this frame to be acked (disable retries)
* @freq: Frequency (in MHz) to send the frame on, or 0 to let the
* driver decide
* Returns: 0 on success, -1 on failure * Returns: 0 on success, -1 on failure
*/ */
int (*send_mlme)(void *priv, const u8 *data, size_t data_len, int (*send_mlme)(void *priv, const u8 *data, size_t data_len,
int noack); int noack, unsigned int freq);
/** /**
* update_ft_ies - Update FT (IEEE 802.11r) IEs * update_ft_ies - Update FT (IEEE 802.11r) IEs

View file

@ -1840,7 +1840,7 @@ static int atheros_set_ap(void *priv, struct wpa_driver_ap_params *params)
#ifdef CONFIG_IEEE80211R #ifdef CONFIG_IEEE80211R
static int atheros_send_mgmt(void *priv, const u8 *frm, size_t data_len, static int atheros_send_mgmt(void *priv, const u8 *frm, size_t data_len,
int noack) int noack, unsigned int freq)
{ {
struct atheros_driver_data *drv = priv; struct atheros_driver_data *drv = priv;
u8 buf[1510]; u8 buf[1510];

View file

@ -266,7 +266,8 @@ static int hostap_init_sockets(struct hostap_driver_data *drv, u8 *own_addr)
} }
static int hostap_send_mlme(void *priv, const u8 *msg, size_t len, int noack) static int hostap_send_mlme(void *priv, const u8 *msg, size_t len, int noack,
unsigned int freq)
{ {
struct hostap_driver_data *drv = priv; struct hostap_driver_data *drv = priv;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) msg; struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) msg;

View file

@ -7245,11 +7245,12 @@ static int driver_nl80211_if_remove(void *priv, enum wpa_driver_if_type type,
static int driver_nl80211_send_mlme(void *priv, const u8 *data, static int driver_nl80211_send_mlme(void *priv, const u8 *data,
size_t data_len, int noack) size_t data_len, int noack,
unsigned int freq)
{ {
struct i802_bss *bss = priv; struct i802_bss *bss = priv;
return wpa_driver_nl80211_send_mlme(bss, data, data_len, noack, return wpa_driver_nl80211_send_mlme(bss, data, data_len, noack,
0, 0, 0, 0); freq, 0, 0, 0);
} }

View file

@ -290,7 +290,7 @@ static inline int wpa_drv_send_mlme(struct wpa_supplicant *wpa_s,
{ {
if (wpa_s->driver->send_mlme) if (wpa_s->driver->send_mlme)
return wpa_s->driver->send_mlme(wpa_s->drv_priv, return wpa_s->driver->send_mlme(wpa_s->drv_priv,
data, data_len, noack); data, data_len, noack, 0);
return -1; return -1;
} }