[PATCH 2/3] wpa_supplicant: Store entire CS freq_params and not only freq

Ilan Peer ilan.peer
Sun Dec 15 00:47:41 PST 2013


From: Andrei Otcheretianski <andrei.otcheretianski at intel.com>

When CSA flow starts store the entire struct
hostapd_freq_params and not only CS frequency as it was
before.
The additional freq_params are required to advertise
CS supplementary IEs such as secondary channel,
wide bandwidth CS, etc.

Signed-hostap: Andrei Otcheretianski <andrei.otcheretianski at intel.com>
---
 src/ap/beacon.c        |    4 ++--
 src/ap/drv_callbacks.c |    3 ++-
 src/ap/hostapd.c       |    5 +++--
 src/ap/hostapd.h       |    2 +-
 4 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/ap/beacon.c b/src/ap/beacon.c
index cdee579..ca5f90e 100644
--- a/src/ap/beacon.c
+++ b/src/ap/beacon.c
@@ -206,10 +206,10 @@ static u8 * hostapd_eid_csa(struct hostapd_data *hapd, u8 *eid)
 {
 	u8 chan;
 
-	if (!hapd->iface->cs_freq)
+	if (!hapd->iface->cs_freq_params.freq)
 		return eid;
 
-	if (ieee80211_freq_to_chan(hapd->iface->cs_freq, &chan) ==
+	if (ieee80211_freq_to_chan(hapd->iface->cs_freq_params.freq, &chan) ==
 	    NUM_HOSTAPD_MODES)
 		return eid;
 
diff --git a/src/ap/drv_callbacks.c b/src/ap/drv_callbacks.c
index b066bff..d0b2c1f 100644
--- a/src/ap/drv_callbacks.c
+++ b/src/ap/drv_callbacks.c
@@ -439,7 +439,8 @@ void hostapd_event_ch_switch(struct hostapd_data *hapd, int freq, int ht,
 	hapd->iconf->vht_oper_centr_freq_seg0_idx = seg0_idx;
 	hapd->iconf->vht_oper_centr_freq_seg1_idx = seg1_idx;
 
-	if (hapd->iface->csa_in_progress && freq == hapd->iface->cs_freq) {
+	if (hapd->iface->csa_in_progress &&
+	    freq == hapd->iface->cs_freq_params.freq) {
 		hostapd_cleanup_cs_params(hapd);
 
 		wpa_msg(hapd->msg_ctx, MSG_INFO, AP_CSA_FINISHED "freq=%d",
diff --git a/src/ap/hostapd.c b/src/ap/hostapd.c
index 74dd24a..47ea825 100644
--- a/src/ap/hostapd.c
+++ b/src/ap/hostapd.c
@@ -2198,7 +2198,7 @@ static int hostapd_fill_csa_settings(struct hostapd_iface *iface,
 		return ret;
 
 	/* set channel switch parameters for csa ie */
-	iface->cs_freq = settings->freq_params.freq;
+	iface->cs_freq_params = settings->freq_params;
 	iface->cs_count = settings->cs_count;
 	iface->cs_block_tx = settings->block_tx;
 
@@ -2217,7 +2217,8 @@ static int hostapd_fill_csa_settings(struct hostapd_iface *iface,
 
 void hostapd_cleanup_cs_params(struct hostapd_data *hapd)
 {
-	hapd->iface->cs_freq = 0;
+	os_memset(&hapd->iface->cs_freq_params, 0,
+		  sizeof(hapd->iface->cs_freq_params));
 	hapd->iface->cs_count = 0;
 	hapd->iface->cs_block_tx = 0;
 	hapd->iface->cs_c_off_beacon = 0;
diff --git a/src/ap/hostapd.h b/src/ap/hostapd.h
index b9693e9..0b8e934 100644
--- a/src/ap/hostapd.h
+++ b/src/ap/hostapd.h
@@ -334,7 +334,7 @@ struct hostapd_iface {
 	s8 lowest_nf;
 
 	/* channel switch parameters */
-	int cs_freq;
+	struct hostapd_freq_params cs_freq_params;
 	u8 cs_count;
 	int cs_block_tx;
 	unsigned int cs_c_off_beacon;
-- 
1.7.10.4




More information about the Hostap mailing list