TDLS: Provide external control to specify the peers for setup

There are use cases requesting the host driver to initiate the TDLS
setup with the peer only when configured by the external applications.
Thus, enable this control by tdls_external_control=1 and pass the
requisite information for the specific TDLS operation to the driver
on the request from such use cases.

This operation mode expects the driver to initiate TDLS link
automatically based on signal strength and traffic to a peer and tear
down links whenever they are not used or suitable due to signal strength
etc. The list of peers with which such operations are to be performed
are provided with the TDLS driver operations.

Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Sunil Dutt 2013-11-13 17:05:44 +05:30 committed by Jouni Malinen
parent 795baf773f
commit 800d58721c
4 changed files with 23 additions and 0 deletions

View file

@ -3358,6 +3358,7 @@ static const struct global_parse_data global_fields[] = {
{ FUNC(freq_list), 0 }, { FUNC(freq_list), 0 },
{ INT(scan_cur_freq), 0 }, { INT(scan_cur_freq), 0 },
{ INT(sched_scan_interval), 0 }, { INT(sched_scan_interval), 0 },
{ INT(tdls_external_control), 0},
}; };
#undef FUNC #undef FUNC

View file

@ -933,6 +933,16 @@ struct wpa_config {
* sched_scan_interval - schedule scan interval * sched_scan_interval - schedule scan interval
*/ */
unsigned int sched_scan_interval; unsigned int sched_scan_interval;
/**
* tdls_external_control - External control for TDLS setup requests
*
* Enable TDLS mode where external programs are given the control
* to specify the TDLS link to get established to the driver. The
* driver requests the TDLS setup to the supplicant only for the
* specified TDLS peers.
*/
int tdls_external_control;
}; };

View file

@ -1079,6 +1079,10 @@ static void wpa_config_write_global(FILE *f, struct wpa_config *config)
if (config->external_sim) if (config->external_sim)
fprintf(f, "external_sim=%d\n", config->external_sim); fprintf(f, "external_sim=%d\n", config->external_sim);
if (config->tdls_external_control)
fprintf(f, "tdls_external_control=%d\n",
config->tdls_external_control);
} }
#endif /* CONFIG_NO_CONFIG_WRITE */ #endif /* CONFIG_NO_CONFIG_WRITE */

View file

@ -571,6 +571,10 @@ static int wpa_supplicant_ctrl_iface_tdls_setup(
wpa_printf(MSG_DEBUG, "CTRL_IFACE TDLS_SETUP " MACSTR, wpa_printf(MSG_DEBUG, "CTRL_IFACE TDLS_SETUP " MACSTR,
MAC2STR(peer)); MAC2STR(peer));
if ((wpa_s->conf->tdls_external_control) &&
wpa_tdls_is_external_setup(wpa_s->wpa))
return wpa_drv_tdls_oper(wpa_s, TDLS_SETUP, peer);
wpa_tdls_remove(wpa_s->wpa, peer); wpa_tdls_remove(wpa_s->wpa, peer);
if (wpa_tdls_is_external_setup(wpa_s->wpa)) if (wpa_tdls_is_external_setup(wpa_s->wpa))
@ -597,6 +601,10 @@ static int wpa_supplicant_ctrl_iface_tdls_teardown(
wpa_printf(MSG_DEBUG, "CTRL_IFACE TDLS_TEARDOWN " MACSTR, wpa_printf(MSG_DEBUG, "CTRL_IFACE TDLS_TEARDOWN " MACSTR,
MAC2STR(peer)); MAC2STR(peer));
if ((wpa_s->conf->tdls_external_control) &&
wpa_tdls_is_external_setup(wpa_s->wpa))
return wpa_drv_tdls_oper(wpa_s, TDLS_TEARDOWN, peer);
if (wpa_tdls_is_external_setup(wpa_s->wpa)) if (wpa_tdls_is_external_setup(wpa_s->wpa))
ret = wpa_tdls_teardown_link( ret = wpa_tdls_teardown_link(
wpa_s->wpa, peer, wpa_s->wpa, peer,