From ef35f5a0fd2c41f92a3ecc29995c5de1f407d2af Mon Sep 17 00:00:00 2001 From: Jithu Jance Date: Sun, 10 Jun 2012 20:54:31 +0300 Subject: [PATCH] P2P: Add driver op for requesting GO/AP channel switch Signed-hostap: Jithu Jance --- src/drivers/driver.h | 12 ++++++++++++ wpa_supplicant/driver_i.h | 8 ++++++++ 2 files changed, 20 insertions(+) diff --git a/src/drivers/driver.h b/src/drivers/driver.h index f7fb2efb2..102ea46d5 100644 --- a/src/drivers/driver.h +++ b/src/drivers/driver.h @@ -2536,6 +2536,18 @@ struct wpa_driver_ops { * conditions. */ int (*radio_disable)(void *priv, int disabled); + + /** + * switch_channel - Announce channel switch and migrate the GO to the + * given frequency + * @priv: Private driver interface data + * @freq: Frequency in MHz + * 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); }; diff --git a/wpa_supplicant/driver_i.h b/wpa_supplicant/driver_i.h index e1e921d2a..2ab455beb 100644 --- a/wpa_supplicant/driver_i.h +++ b/wpa_supplicant/driver_i.h @@ -672,4 +672,12 @@ static inline int wpa_drv_radio_disable(struct wpa_supplicant *wpa_s, return wpa_s->driver->radio_disable(wpa_s->drv_priv, disabled); } +static inline int wpa_drv_switch_channel(struct wpa_supplicant *wpa_s, + unsigned int freq) +{ + if (!wpa_s->driver->switch_channel) + return -1; + return wpa_s->driver->switch_channel(wpa_s->drv_priv, freq); +} + #endif /* DRIVER_I_H */