From e882899981cf031156d25c2f9ad778734bf03266 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Sat, 16 Jan 2010 12:16:20 +0200 Subject: [PATCH] Add BSSID to TX/RX Action frame driver ops This meets better the needs for various Public Action frame use cases. --- src/drivers/driver.h | 17 ++++++++++++++--- src/drivers/driver_test.c | 3 ++- wpa_supplicant/driver_i.h | 13 ++++++++++++- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/src/drivers/driver.h b/src/drivers/driver.h index 68b3358c2..60304a181 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -1594,8 +1594,9 @@ struct wpa_driver_ops { * send_action - Transmit an Action frame * @priv: Private driver interface data * @freq: Frequency (in MHz) of the channel - * @dst: Destination MAC address - * @src: Source MAC address + * @dst: Destination MAC address (Address 1) + * @src: Source MAC address (Address 2) + * @bssid: BSSID (Address 3) * @data: Frame body * @data_len: data length in octets * Returns: 0 on success, -1 on failure @@ -1608,7 +1609,7 @@ struct wpa_driver_ops { * of these conditions is in effect, send_action() cannot be used. */ int (*send_action)(void *priv, unsigned int freq, - const u8 *dst, const u8 *src, + const u8 *dst, const u8 *src, const u8 *bssid, const u8 *data, size_t data_len); /** @@ -2235,11 +2236,21 @@ union wpa_event_data { * struct rx_action - Data for EVENT_RX_ACTION events */ struct rx_action { + /** + * da - Destination address of the received Action frame + */ + const u8 *da; + /** * sa - Source address of the received Action frame */ const u8 *sa; + /** + * bssid - Address 3 of the received Action frame + */ + const u8 *bssid; + /** * category - Action frame category */ diff --git a/src/drivers/driver_test.c b/src/drivers/driver_test.c index 51443172a..1760372bd 100644 --- a/src/drivers/driver_test.c +++ b/src/drivers/driver_test.c @@ -2548,6 +2548,7 @@ static int wpa_driver_test_set_freq(void *priv, static int wpa_driver_test_send_action(void *priv, unsigned int freq, const u8 *dst, const u8 *src, + const u8 *bssid, const u8 *data, size_t data_len) { struct wpa_driver_test_data *drv = priv; @@ -2578,7 +2579,7 @@ static int wpa_driver_test_send_action(void *priv, unsigned int freq, IEEE80211_FC(WLAN_FC_TYPE_MGMT, WLAN_FC_STYPE_ACTION); os_memcpy(hdr->addr1, dst, ETH_ALEN); os_memcpy(hdr->addr2, src, ETH_ALEN); - os_memcpy(hdr->addr3, "\xff\xff\xff\xff\xff\xff", ETH_ALEN); + os_memcpy(hdr->addr3, bssid, ETH_ALEN); ret = wpa_driver_test_send_mlme(priv, buf, 24 + data_len); os_free(buf); diff --git a/wpa_supplicant/driver_i.h b/wpa_supplicant/driver_i.h index 2f5b134ec..5f3e1496b 100644 --- a/wpa_supplicant/driver_i.h +++ b/wpa_supplicant/driver_i.h @@ -386,11 +386,13 @@ static inline int wpa_drv_set_supp_port(struct wpa_supplicant *wpa_s, static inline int wpa_drv_send_action(struct wpa_supplicant *wpa_s, unsigned int freq, const u8 *dst, const u8 *src, + const u8 *bssid, const u8 *data, size_t data_len) { if (wpa_s->driver->send_action) return wpa_s->driver->send_action(wpa_s->drv_priv, freq, - dst, src, data, data_len); + dst, src, bssid, data, + data_len); return -1; } @@ -438,4 +440,13 @@ static inline int wpa_drv_probe_req_report(struct wpa_supplicant *wpa_s, return -1; } +static inline int wpa_drv_disable_11b_rates(struct wpa_supplicant *wpa_s, + int disabled) +{ + if (wpa_s->driver->disable_11b_rates) + return wpa_s->driver->disable_11b_rates(wpa_s->drv_priv, + disabled); + return -1; +} + #endif /* DRIVER_I_H */