Add BSSID to TX/RX Action frame driver ops

This meets better the needs for various Public Action frame use cases.
This commit is contained in:
Jouni Malinen 2010-01-16 12:16:20 +02:00 committed by Jouni Malinen
parent 4e5cb1a366
commit e882899981
3 changed files with 28 additions and 5 deletions

View file

@ -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
*/

View file

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

View file

@ -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 */