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>
This commit is contained in:
Andrei Otcheretianski 2013-11-14 12:28:29 +02:00 committed by Jouni Malinen
parent e1925bde36
commit dcca2219ae
2 changed files with 57 additions and 4 deletions

View file

@ -1163,6 +1163,59 @@ struct wpa_signal_info {
int center_frq2; int center_frq2;
}; };
/**
* 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 * struct wpa_driver_ops - Driver interface API definition
* *
@ -2754,13 +2807,13 @@ struct wpa_driver_ops {
* switch_channel - Announce channel switch and migrate the GO to the * switch_channel - Announce channel switch and migrate the GO to the
* given frequency * given frequency
* @priv: Private driver interface data * @priv: Private driver interface data
* @freq: Frequency in MHz * @settings: Settings for CSA period and new channel
* Returns: 0 on success, -1 on failure * Returns: 0 on success, -1 on failure
* *
* This function is used to move the GO to the legacy STA channel to * This function is used to move the GO to the legacy STA channel to
* avoid frequency conflict in single channel concurrency. * 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 * start_dfs_cac - Listen for radar interference on the channel

View file

@ -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, 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) if (!wpa_s->driver->switch_channel)
return -1; 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, static inline int wpa_drv_wnm_oper(struct wpa_supplicant *wpa_s,