aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVictor Goldenshtein <victorg@ti.com>2011-11-21 17:02:52 +0200
committerArik Nemtsov <arik@wizery.com>2012-09-13 14:53:28 +0300
commit7b65de18e8276ed3b5d2cbb64dc06c347f3b0e78 (patch)
tree7f5bc133d990acb5e39e64f0894ee66cff5b8c58
parent7973c9ed86ff9694d4cb4fa81eeb5b6bf7267e64 (diff)
downloadexternal_wpa_supplicant_8_ti-7b65de18e8276ed3b5d2cbb64dc06c347f3b0e78.zip
external_wpa_supplicant_8_ti-7b65de18e8276ed3b5d2cbb64dc06c347f3b0e78.tar.gz
external_wpa_supplicant_8_ti-7b65de18e8276ed3b5d2cbb64dc06c347f3b0e78.tar.bz2
hostapd: implement channel switch request drv ops (INTERNAL)
New hostapd_channel_switch – to handle channel switch request. Signed-hostap: Victor Goldenshtein <victorg@ti.com>
-rw-r--r--src/ap/ap_config.h3
-rw-r--r--src/ap/ap_drv_ops.c31
-rw-r--r--src/ap/ap_drv_ops.h2
-rw-r--r--src/drivers/driver.h19
4 files changed, 55 insertions, 0 deletions
diff --git a/src/ap/ap_config.h b/src/ap/ap_config.h
index 4e10a0f..d6b67fe 100644
--- a/src/ap/ap_config.h
+++ b/src/ap/ap_config.h
@@ -432,6 +432,9 @@ struct hostapd_config {
int ieee80211d;
+ /* AP/GO channel switch count */
+ int channel_switch_count;
+
struct hostapd_tx_queue_params tx_queue[NUM_TX_QUEUES];
/*
diff --git a/src/ap/ap_drv_ops.c b/src/ap/ap_drv_ops.c
index 859b529..fbeaf9c 100644
--- a/src/ap/ap_drv_ops.c
+++ b/src/ap/ap_drv_ops.c
@@ -596,3 +596,34 @@ int hostapd_drv_send_action(struct hostapd_data *hapd, unsigned int freq,
hapd->own_addr, hapd->own_addr, data,
len, 0);
}
+
+
+int hostapd_channel_switch(struct hostapd_data *hapd, int freq, int flags,
+ u8 tx_block, u8 post_switch_block_tx)
+{
+ struct hostapd_channel_switch params;
+
+ if (!hapd->driver || !hapd->driver->hapd_channel_switch)
+ return 0;
+
+ if (flags & HOSTAPD_CHAN_RADAR) {
+ wpa_printf(MSG_ERROR, "Can't switch to radar channel, "
+ "DFS functionality is not supported");
+ return -1;
+ }
+
+ if (hapd->iface->conf->secondary_channel) {
+ wpa_printf(MSG_ERROR, "Channel switch is not supported "
+ "with HT40");
+ return -1;
+ }
+
+ params.freq = freq;
+ params.tx_block = tx_block;
+ params.post_switch_block_tx = post_switch_block_tx;
+ params.ch_switch_count =
+ (hapd->iconf->channel_switch_count > hapd->conf->dtim_period) ?
+ hapd->iconf->channel_switch_count : hapd->conf->dtim_period * 2;
+
+ return hapd->driver->hapd_channel_switch(hapd->drv_priv, &params);
+}
diff --git a/src/ap/ap_drv_ops.h b/src/ap/ap_drv_ops.h
index e3b15c0..6305050 100644
--- a/src/ap/ap_drv_ops.h
+++ b/src/ap/ap_drv_ops.h
@@ -97,6 +97,8 @@ int hostapd_sta_assoc(struct hostapd_data *hapd, const u8 *addr,
int reassoc, u16 status, const u8 *ie, size_t len);
int hostapd_add_tspec(struct hostapd_data *hapd, const u8 *addr,
u8 *tspec_ie, size_t tspec_ielen);
+int hostapd_channel_switch(struct hostapd_data *hapd, int freq, int flags,
+ u8 tx_block, u8 post_switch_block_tx);
#include "drivers/driver.h"
diff --git a/src/drivers/driver.h b/src/drivers/driver.h
index 7afbda1..b25b4b9 100644
--- a/src/drivers/driver.h
+++ b/src/drivers/driver.h
@@ -898,6 +898,16 @@ struct hostapd_freq_params {
* enabled, secondary channel above primary */
};
+struct hostapd_channel_switch {
+ int freq;
+ int tx_block; /* immediately block the tx on the
+ * operational channel
+ * (prior channel switch) */
+ int post_switch_block_tx; /* block tx on the target ch (after
+ * channel switch) */
+ int ch_switch_count;
+};
+
enum wpa_driver_if_type {
/**
* WPA_IF_STATION - Station mode interface
@@ -2587,6 +2597,15 @@ struct wpa_driver_ops {
* Returns: 0 on success, -1 on failure
*/
int (*driver_cmd)(void *priv, char *cmd, char *buf, size_t buf_len);
+
+ /**
+ * hapd_channel_switch - Perform an AP channel switch
+ * @priv: Private driver interface data
+ * @params: Channels switch parameters
+ * Returns: 0 on success, -1 on failure
+ */
+ int (*hapd_channel_switch)(void *priv,
+ struct hostapd_channel_switch *params);
};