Add BSSID to TX/RX Action frame driver ops
authorJouni Malinen <jouni.malinen@atheros.com>
Sat, 16 Jan 2010 10:16:20 +0000 (12:16 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 16 Jan 2010 10:16:20 +0000 (12:16 +0200)
This meets better the needs for various Public Action frame use cases.

src/drivers/driver.h
src/drivers/driver_test.c
wpa_supplicant/driver_i.h

index 68b3358..60304a1 100644 (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);
 
        /**
@@ -2236,11 +2237,21 @@ union wpa_event_data {
         */
        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
                 */
                u8 category;
index 5144317..1760372 100644 (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);
index 2f5b134..5f3e149 100644 (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 */