aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrei Otcheretianski <andrei.otcheretianski@intel.com>2013-11-14 10:28:29 (GMT)
committerJouni Malinen <j@w1.fi>2013-11-17 14:48:33 (GMT)
commitdcca2219aec260fba9d8b1c5eb010fd6bfe64efd (patch)
treead9c0669391f0e58daef07d239784f55fbb10783
parente1925bde366ab076cc2f69e415bf9201d60efdbe (diff)
downloadhostap-dcca2219aec260fba9d8b1c5eb010fd6bfe64efd.zip
hostap-dcca2219aec260fba9d8b1c5eb010fd6bfe64efd.tar.gz
hostap-dcca2219aec260fba9d8b1c5eb010fd6bfe64efd.tar.bz2
wpa_supplicant: Update channel switch driver interface
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>
-rw-r--r--src/drivers/driver.h57
-rw-r--r--wpa_supplicant/driver_i.h4
2 files changed, 57 insertions, 4 deletions
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index c56af83..55b344d 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -1164,6 +1164,59 @@ struct wpa_signal_info {
};
/**
+ * 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
*
* This structure defines the API that each driver interface needs to implement
@@ -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
diff --git a/wpa_supplicant/driver_i.h b/wpa_supplicant/driver_i.h
index 6b5d49a..56d6529 100644
--- a/wpa_supplicant/driver_i.h
+++ b/wpa_supplicant/driver_i.h
@@ -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,