]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
wpa_supplicant: Update channel switch driver interface
authorAndrei Otcheretianski <andrei.otcheretianski@intel.com>
Thu, 14 Nov 2013 10:28:29 +0000 (12:28 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 17 Nov 2013 14:48:33 +0000 (16:48 +0200)
Add csa_settings struct which holds parameters for CSA. Change driver
interface for switch_channel(), so that it will receive this struct and
not only the new frequency as it was before. This allows wpa_supplicant
to provide all the required parameters (beacons, proberesp, assocresp,
CSA IE) which are required by cfg80211 implementation.

Signed-hostap: Andrei Otcheretianski <andrei.otcheretianski@intel.com>

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

index c56af83bce36e814fb6cd277cbc7f88bd500718c..55b344d5782a13fd24820656b934482b47dffa07 100644 (file)
@@ -1163,6 +1163,59 @@ struct wpa_signal_info {
        int center_frq2;
 };
 
+/**
+ * struct beacon_data - Beacon data
+ * @head: Head portion of Beacon frame (before TIM IE)
+ * @tail: Tail portion of Beacon frame (after TIM IE)
+ * @beacon_ies: Extra information element(s) to add into Beacon frames or %NULL
+ * @proberesp_ies: Extra information element(s) to add into Probe Response
+ *     frames or %NULL
+ * @assocresp_ies: Extra information element(s) to add into (Re)Association
+ *     Response frames or %NULL
+ * @probe_resp: Probe Response frame template
+ * @head_len: Length of @head
+ * @tail_len: Length of @tail
+ * @beacon_ies_len: Length of beacon_ies in octets
+ * @proberesp_ies_len: Length of proberesp_ies in octets
+ * @proberesp_ies_len: Length of proberesp_ies in octets
+ * @probe_resp_len: Length of probe response template (@probe_resp)
+ */
+struct beacon_data {
+       u8 *head, *tail;
+       u8 *beacon_ies;
+       u8 *proberesp_ies;
+       u8 *assocresp_ies;
+       u8 *probe_resp;
+
+       size_t head_len, tail_len;
+       size_t beacon_ies_len;
+       size_t proberesp_ies_len;
+       size_t assocresp_ies_len;
+       size_t probe_resp_len;
+};
+
+/**
+ * struct csa_settings - Settings for channel switch command
+ * @cs_count: Count in Beacon frames (TBTT) to perform the switch
+ * @block_tx: 1 - block transmission for CSA period
+ * @freq_params: Next channel frequency parameter
+ * @beacon_csa: Beacon/probe resp/asooc resp info for CSA period
+ * @beacon_after: Next beacon/probe resp/asooc resp info
+ * @counter_offset_beacon: Offset to the count field in beacon's tail
+ * @counter_offset_presp: Offset to the count field in probe resp.
+ */
+struct csa_settings {
+       u8 cs_count;
+       u8 block_tx;
+
+       struct hostapd_freq_params freq_params;
+       struct beacon_data beacon_csa;
+       struct beacon_data beacon_after;
+
+       u16 counter_offset_beacon;
+       u16 counter_offset_presp;
+};
+
 /**
  * struct wpa_driver_ops - Driver interface API definition
  *
@@ -2754,13 +2807,13 @@ struct wpa_driver_ops {
         * switch_channel - Announce channel switch and migrate the GO to the
         * given frequency
         * @priv: Private driver interface data
-        * @freq: Frequency in MHz
+        * @settings: Settings for CSA period and new channel
         * Returns: 0 on success, -1 on failure
         *
         * This function is used to move the GO to the legacy STA channel to
         * avoid frequency conflict in single channel concurrency.
         */
-       int (*switch_channel)(void *priv, unsigned int freq);
+       int (*switch_channel)(void *priv, struct csa_settings *settings);
 
        /**
         * start_dfs_cac - Listen for radar interference on the channel
index 6b5d49a831cb8b4caa7143fb11a202f7cdc039a1..56d652990f96af1363eef7eede162013333cfcfa 100644 (file)
@@ -683,11 +683,11 @@ static inline int wpa_drv_radio_disable(struct wpa_supplicant *wpa_s,
 }
 
 static inline int wpa_drv_switch_channel(struct wpa_supplicant *wpa_s,
-                                        unsigned int freq)
+                                        struct csa_settings *settings)
 {
        if (!wpa_s->driver->switch_channel)
                return -1;
-       return wpa_s->driver->switch_channel(wpa_s->drv_priv, freq);
+       return wpa_s->driver->switch_channel(wpa_s->drv_priv, settings);
 }
 
 static inline int wpa_drv_wnm_oper(struct wpa_supplicant *wpa_s,