QCA vendor command support to set band to driver

Add vendor command to pass SET setband command to the driver and read
the updated channel list from driver when this notification succeeds.
This allows the driver to update its internal channel lists based on
setband configuration.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Srinivas Dasari 2015-07-27 15:44:22 +05:30 committed by Jouni Malinen
parent 06836013d3
commit 844dfeb804
9 changed files with 109 additions and 9 deletions

View file

@ -286,6 +286,30 @@ static int wpas_ctrl_pno(struct wpa_supplicant *wpa_s, char *cmd)
}
static int wpas_ctrl_set_band(struct wpa_supplicant *wpa_s, char *band)
{
union wpa_event_data event;
if (os_strcmp(band, "AUTO") == 0)
wpa_s->setband = WPA_SETBAND_AUTO;
else if (os_strcmp(band, "5G") == 0)
wpa_s->setband = WPA_SETBAND_5G;
else if (os_strcmp(band, "2G") == 0)
wpa_s->setband = WPA_SETBAND_2G;
else
return -1;
if (wpa_drv_setband(wpa_s, wpa_s->setband) == 0) {
os_memset(&event, 0, sizeof(event));
event.channel_list_changed.initiator = REGDOM_SET_BY_USER;
event.channel_list_changed.type = REGDOM_TYPE_UNKNOWN;
wpa_supplicant_event(wpa_s, EVENT_CHANNEL_LIST_CHANGED, &event);
}
return 0;
}
static int wpa_supplicant_ctrl_iface_set(struct wpa_supplicant *wpa_s,
char *cmd)
{
@ -449,14 +473,7 @@ static int wpa_supplicant_ctrl_iface_set(struct wpa_supplicant *wpa_s,
ret = wpas_ctrl_set_blob(wpa_s, value);
#endif /* CONFIG_NO_CONFIG_BLOBS */
} else if (os_strcasecmp(cmd, "setband") == 0) {
if (os_strcmp(value, "AUTO") == 0)
wpa_s->setband = WPA_SETBAND_AUTO;
else if (os_strcmp(value, "5G") == 0)
wpa_s->setband = WPA_SETBAND_5G;
else if (os_strcmp(value, "2G") == 0)
wpa_s->setband = WPA_SETBAND_2G;
else
ret = -1;
ret = wpas_ctrl_set_band(wpa_s, value);
} else {
value[-1] = '=';
ret = wpa_config_process_global(wpa_s->conf, cmd, -1);

View file

@ -885,4 +885,12 @@ static inline int wpa_drv_disable_transmit_sa(struct wpa_supplicant *wpa_s,
}
#endif /* CONFIG_MACSEC */
static inline int wpa_drv_setband(struct wpa_supplicant *wpa_s,
enum set_band band)
{
if (!wpa_s->driver->set_band)
return -1;
return wpa_s->driver->set_band(wpa_s->drv_priv, band);
}
#endif /* DRIVER_I_H */

View file

@ -482,7 +482,7 @@ struct wpa_supplicant {
struct wpa_ssid_value *disallow_aps_ssid;
size_t disallow_aps_ssid_count;
enum { WPA_SETBAND_AUTO, WPA_SETBAND_5G, WPA_SETBAND_2G } setband;
enum set_band setband;
/* Preferred network for the next connection attempt */
struct wpa_ssid *next_ssid;