OSDN Git Service

TDLS enhancement HAL interface update
authorxinhe <xinhe@google.com>
Tue, 14 Apr 2015 19:57:58 +0000 (12:57 -0700)
committerxinhe <xinhe@google.com>
Wed, 22 Apr 2015 17:48:20 +0000 (10:48 -0700)
Bug:15152152
Change-Id: I8432177ac457c6559cf2c0d2a8bbc8ea8773a2a9

include/hardware_legacy/tdls.h
include/hardware_legacy/wifi_hal.h

index c1cd33e..9ac225a 100644 (file)
@@ -5,13 +5,14 @@
 #define _TDLS_H_
 
 typedef enum {
-    WIFI_TDLS_DISABLED,                 /* TDLS is not enabled, or is disabled now */
-    WIFI_TDLS_ENABLED,                  /* TDLS is enabled, but not yet tried */
-    WIFI_TDLS_TRYING,                   /* Direct link is being attempted (optional) */
-    WIFI_TDLS_ESTABLISHED,              /* Direct link is established */
-    WIFI_TDLS_ESTABLISHED_OFF_CHANNEL,  /* Direct link is established using MCC */
-    WIFI_TDLS_DROPPED,                  /* Direct link was established, but is now dropped */
-    WIFI_TDLS_FAILED                    /* Direct link failed */
+    WIFI_TDLS_DISABLED = 1,                 /* TDLS is not enabled, default status for all STAs */
+    WIFI_TDLS_ENABLED,                      /* TDLS is enabled, but not yet tried */
+    WIFI_TDLS_ESTABLISHED,                  /* Direct link is established */
+    WIFI_TDLS_ESTABLISHED_OFF_CHANNEL,      /* Direct link is established using MCC */
+    WIFI_TDLS_DROPPED,                      /* Direct link was established,
+                                             * but is temporarily dropped now */
+    WIFI_TDLS_FAILED                        /* TDLS permanent failed. Inform error to upper layer
+                                             * and go back to WIFI_TDLS_DISABLED */
 } wifi_tdls_state;
 
 typedef enum {
@@ -38,7 +39,15 @@ typedef struct {
 } wifi_tdls_status;
 
 typedef struct {
-    /* on_tdls_state_changed - reports state to TDLS link
+    int max_concurrent_tdls_session_num;      /* Maximum TDLS session number can be supported by the
+                                              * Firmware and hardware*/
+    int is_global_tdls_supported;            /* 1 -- support,  0 -- not support */
+    int is_per_mac_tdls_supported;           /* 1 -- support,  0 -- not support */
+    int is_off_channel_tdls_supported;       /* 1 -- support,  0 -- not support */
+} wifi_tdls_capabilities;
+
+typedef struct {
+    /* on_tdls_state_changed - reports state of TDLS link to framework
      * Report this event when the state of TDLS link changes */
     void (*on_tdls_state_changed)(mac_addr addr, wifi_tdls_status status);
 } wifi_tdls_handler;
@@ -49,12 +58,12 @@ typedef struct {
  * params specifies hints, which provide more information about
  * why TDLS is being sought. The firmware should do its best to
  * honor the hints before downgrading regular AP link
+ * If upper layer has no specific values, this should be NULL
  *
- * On successful completion, must fire on_tdls_state_changed event
- * to indicate the status of TDLS operation.
+ * handler is used to inform the upper layer about the status change and the corresponding reason
  */
 wifi_error wifi_enable_tdls(wifi_interface_handle iface, mac_addr addr,
-        wifi_tdls_params params, wifi_tdls_handler handler);
+        wifi_tdls_params *params, wifi_tdls_handler handler);
 
 /* wifi_disable_tdls - disables TDLS-auto mode for a specific route
  *
@@ -70,4 +79,7 @@ wifi_error wifi_disable_tdls(wifi_interface_handle iface, mac_addr addr);
 wifi_error wifi_get_tdls_status(wifi_interface_handle iface, mac_addr addr,
         wifi_tdls_status *status);
 
-#endif
\ No newline at end of file
+/* return the current HW + Firmware combination's TDLS capabilities */
+wifi_error wifi_get_tdls_capabilities(wifi_interface_handle iface,
+        wifi_tdls_capabilities *capabilities);
+#endif
index 4a290d9..0755834 100644 (file)
@@ -200,6 +200,12 @@ typedef struct {
     wifi_error (* wifi_set_epno_list)(int, wifi_interface_info *, int, wifi_epno_network *,
             wifi_epno_handler);
     wifi_error (* wifi_set_country_code)(wifi_interface_handle, const char *);
+    wifi_error (* wifi_enable_tdls)(wifi_interface_handle, mac_addr, wifi_tdls_params *,
+            wifi_tdls_handler);
+    wifi_error (* wifi_disable_tdls)(wifi_interface_handle, mac_addr);
+    wifi_error (*wifi_get_tdls_status) (wifi_interface_handle, mac_addr, wifi_tdls_status *);
+    wifi_error (*wifi_get_tdls_capabilities)(wifi_interface_handle iface,
+            wifi_tdls_capabilities *capabilities);
 } wifi_hal_fn;
 wifi_error init_wifi_vendor_hal_func_table(wifi_hal_fn *fn);