[PATCH 04/26] ap: Store computed channel in cs_freq_params

Ilan Peer ilan.peer
Tue Sep 8 02:46:11 PDT 2015


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

When CSA is started, hostapd_change_config_freq computes channel
from provided frequency. Store this channel, and use it to add
CSA IE in beacons, instead of recomputing it each time

Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski at intel.com>
---
 src/ap/beacon.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/src/ap/beacon.c b/src/ap/beacon.c
index 5fe8fd5..cdca8a3 100644
--- a/src/ap/beacon.c
+++ b/src/ap/beacon.c
@@ -297,19 +297,13 @@ static u8 * hostapd_eid_wpa(struct hostapd_data *hapd, u8 *eid, size_t len)
 
 static u8 * hostapd_eid_csa(struct hostapd_data *hapd, u8 *eid)
 {
-	u8 chan;
-
-	if (!hapd->cs_freq_params.freq)
-		return eid;
-
-	if (ieee80211_freq_to_chan(hapd->cs_freq_params.freq, &chan) ==
-	    NUM_HOSTAPD_MODES)
+	if (!hapd->cs_freq_params.channel)
 		return eid;
 
 	*eid++ = WLAN_EID_CHANNEL_SWITCH;
 	*eid++ = 3;
 	*eid++ = hapd->cs_block_tx;
-	*eid++ = chan;
+	*eid++ = hapd->cs_freq_params.channel;
 	*eid++ = hapd->cs_count;
 
 	return eid;
-- 
1.9.1




More information about the Hostap mailing list