summaryrefslogtreecommitdiffstats
path: root/include/hardware_legacy/rtt.h
diff options
context:
space:
mode:
authorVinit Deshapnde <vinitd@google.com>2014-04-08 17:05:19 -0700
committerVinit Deshapnde <vinitd@google.com>2014-05-07 18:51:12 -0700
commitb80d32d2a1ba28f2b5dda7315e136a9ea14eda26 (patch)
treed7ccf45197082ec1246290dcd2bcc40e57d0345e /include/hardware_legacy/rtt.h
parent6616643121adbc00ea08d2f9ec0cb89e58cbea40 (diff)
downloadhardware_libhardware_legacy-b80d32d2a1ba28f2b5dda7315e136a9ea14eda26.zip
hardware_libhardware_legacy-b80d32d2a1ba28f2b5dda7315e136a9ea14eda26.tar.gz
hardware_libhardware_legacy-b80d32d2a1ba28f2b5dda7315e136a9ea14eda26.tar.bz2
Moving Wifi HAL to hardware
This change moves all Wifi HAL headers to libhardware_legacy; and moves hal implementation under hardware/<vendor>/wlan. This way different vendors will be able to tailor implementation to their drivers. Change-Id: I55789bb6788ab694f4896aa36d76f7887b32dad6
Diffstat (limited to 'include/hardware_legacy/rtt.h')
-rw-r--r--include/hardware_legacy/rtt.h64
1 files changed, 64 insertions, 0 deletions
diff --git a/include/hardware_legacy/rtt.h b/include/hardware_legacy/rtt.h
new file mode 100644
index 0000000..143b2dd
--- /dev/null
+++ b/include/hardware_legacy/rtt.h
@@ -0,0 +1,64 @@
+
+#include "wifi_hal.h"
+
+#ifndef __WIFI_HAL_RTT_H__
+#define __WIFI_HAL_RTT_H__
+
+/* RTT */
+
+/* Type */
+
+#define RTT_TYPE_RTS_CTS 1
+#define RTT_TYPE_NULL_ACK 2
+#define RTT_TYPE_3 3 // This is required for D2D RTT
+
+typedef struct {
+ int type; // One of RTT_TYPE_ values
+ byte token[16]; // Local token to be published in rtt service info
+ wifi_channel primary; // Use primary when it doesn't conflict with infra
+ wifi_channel secondary; // Use secondary when primary conflicts with infra
+ wifi_timespan offset_from_dw_timestamp; // Time offset to go to primary or secondary channel
+ char rtt_service_name[32]; // Service name to use
+ byte rtt_servic_info[256]; // Blob to publish in service info
+} RttConfig;
+
+typedef struct {
+ void (*on_device_ranged)(wifi_request_id id, mac_addr addr, byte token[16], wifi_timespan ts);
+ void (*on_failed)(wifi_request_id id, wifi_error reason);
+} wifi_rtt_event_handler;
+
+/* Enable rtt - publishes a service advertising RTT; and starts playing
+ * two phase nXn RTT protocol. To stop it, use wifi_disable_rtt */
+
+wifi_error wifi_enable_rtt(wifi_request_id id, wifi_interface_handle iface, RttConfig config,
+ wifi_rtt_event_handler handler);
+wifi_error wifi_disable_rtt(wifi_request_id id);
+
+/* RTT Hotlist */
+
+typedef struct {
+ byte token[16];
+ int64_t max_rtt_timespan;
+} wifi_rtt_hotlist_criterion;
+
+typedef struct {
+ void (*on_token_found)(wifi_request_id id, byte token[16], wifi_timespan ts);
+} wifi_rtt_hotlist_event_handler;
+
+wifi_error wifi_set_rtt_hotlist(wifi_request_id id, wifi_interface_handle iface, int num_criteria,
+ wifi_rtt_hotlist_criterion *criteria, wifi_rtt_hotlist_event_handler handler);
+wifi_error wifi_reset_rtt_hotlist(wifi_request_id id);
+
+/* single shot RTT (Device to AP??) */
+
+typedef struct {
+ void (*on_succeeded) (wifi_request_id id, wifi_timestamp ts);
+ void (*on_failed) (wifi_request_id id, wifi_error reason);
+} IRttEventHandler;
+
+wifi_error wifi_rtt_request_range(wifi_request_id id, wifi_interface_handle iface, mac_addr addr,
+ RttConfig config, int continuous, IRttEventHandler *handler);
+void wifi_rtt_cancel_range_request(wifi_request_id id);
+
+#endif
+