Fix processing of channel list update events

Commit 6bf731e8ce broke handling of
EVENT_CHANNEL_LIST_CHANGED by introducing a cached copy of the driver
channel list that does not get updated even if driver changes its list.
Fix this by synchronizing the cacched wpa_s->hw.modes information
whenever EVENT_CHANNEL_LIST_CHANGED is processed. This fixes P2P channel
list updates based on regulatory domain hints that may trigger driver to
change its supported channel list.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
intended-for: hostap-1
This commit is contained in:
Jouni Malinen 2012-03-01 17:53:53 +02:00 committed by Jouni Malinen
parent ef48ff940b
commit 6979582ca6
3 changed files with 7 additions and 1 deletions

View File

@ -2539,6 +2539,11 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
case EVENT_CHANNEL_LIST_CHANGED:
if (wpa_s->drv_priv == NULL)
break; /* Ignore event during drv initialization */
free_hw_features(wpa_s);
wpa_s->hw.modes = wpa_drv_get_hw_feature_data(
wpa_s, &wpa_s->hw.num_modes, &wpa_s->hw.flags);
#ifdef CONFIG_P2P
wpas_p2p_update_channel_list(wpa_s);
#endif /* CONFIG_P2P */

View File

@ -348,7 +348,7 @@ void wpa_supplicant_set_non_wpa_policy(struct wpa_supplicant *wpa_s,
}
static void free_hw_features(struct wpa_supplicant *wpa_s)
void free_hw_features(struct wpa_supplicant *wpa_s)
{
int i;
if (wpa_s->hw.modes == NULL)

View File

@ -586,6 +586,7 @@ int wpa_supplicant_set_bss_expiration_count(struct wpa_supplicant *wpa_s,
int wpa_supplicant_set_debug_params(struct wpa_global *global,
int debug_level, int debug_timestamp,
int debug_show_keys);
void free_hw_features(struct wpa_supplicant *wpa_s);
void wpa_show_license(void);