]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
TDLS: Provide external control to specify the peers for setup
authorSunil Dutt <usdutt@qti.qualcomm.com>
Wed, 13 Nov 2013 11:35:44 +0000 (17:05 +0530)
committerJouni Malinen <j@w1.fi>
Fri, 15 Nov 2013 01:02:08 +0000 (03:02 +0200)
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>

wpa_supplicant/config.c
wpa_supplicant/config.h
wpa_supplicant/config_file.c
wpa_supplicant/ctrl_iface.c

index 180827367c3f8d5f0de97cf119e67d0409233ee8..9ceaaf85cb1ca4ef4a0b6e5bb54a7d73cb88794d 100644 (file)
@@ -3358,6 +3358,7 @@ static const struct global_parse_data global_fields[] = {
        { FUNC(freq_list), 0 },
        { INT(scan_cur_freq), 0 },
        { INT(sched_scan_interval), 0 },
+       { INT(tdls_external_control), 0},
 };
 
 #undef FUNC
index 55a2d62ede56e16b01ae5069d91c66fa00f0aa5c..068679e566641559aa6c37a609dd614bfcc706c9 100644 (file)
@@ -933,6 +933,16 @@ struct wpa_config {
         * sched_scan_interval -  schedule 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;
 };
 
 
index ed5cdfffcd3c2c4ef7fd0e6e122610c5a00f8d97..7d328673c9653206c0da4a32ad7a17ab706a4bd0 100644 (file)
@@ -1079,6 +1079,10 @@ static void wpa_config_write_global(FILE *f, struct wpa_config *config)
 
        if (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 */
index ebe08b37aee6340e4bab2571dc5459e9aea5fac6..615a972bff21be60af3255c36071edee10dca642 100644 (file)
@@ -571,6 +571,10 @@ static int wpa_supplicant_ctrl_iface_tdls_setup(
        wpa_printf(MSG_DEBUG, "CTRL_IFACE TDLS_SETUP " MACSTR,
                   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);
 
        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,
                   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))
                ret = wpa_tdls_teardown_link(
                        wpa_s->wpa, peer,