summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEtan Cohen <etancohen@google.com>2016-01-27 18:57:51 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-01-27 18:57:51 +0000
commit543ec4c8d5762f7e414b50b4e677cd521790cc35 (patch)
tree9faf3c0c8c897c63616a244089810062ee56780e
parent18fad5ac0fdf7ceac53b05b27b00ed36fac47552 (diff)
parent86ac7fa992544fa8521972fe74add8b97716da81 (diff)
downloadlibhardware_legacy-543ec4c8d5762f7e414b50b4e677cd521790cc35.tar.gz
Merge "Initial proposal of RTT HAL API changes for 11mc responder role." into mm-wireless-dev
am: 86ac7fa992 * commit '86ac7fa992544fa8521972fe74add8b97716da81': Initial proposal of RTT HAL API changes for 11mc responder role.
-rw-r--r--include/hardware_legacy/rtt.h35
-rw-r--r--include/hardware_legacy/wifi_hal.h2
2 files changed, 30 insertions, 7 deletions
diff --git a/include/hardware_legacy/rtt.h b/include/hardware_legacy/rtt.h
index 2808723..67effb1 100644
--- a/include/hardware_legacy/rtt.h
+++ b/include/hardware_legacy/rtt.h
@@ -130,12 +130,12 @@ typedef struct {
// 2-sided RTT: TX rate of initiator's Ack in response to FTM frame.
wifi_rate rx_rate; // 1-sided RTT: TX rate of Ack from other side.
// 2-sided RTT: TX rate of FTM frame coming from responder.
- wifi_timespan rtt; // round trip time in 0.1 nanoseconds
- wifi_timespan rtt_sd; // rtt standard deviation in 0.1 nanoseconds
- wifi_timespan rtt_spread; // difference between max and min rtt times recorded
- int distance; // distance in cm (optional)
- int distance_sd; // standard deviation in cm (optional)
- int distance_spread; // difference between max and min distance recorded (optional)
+ wifi_timespan rtt; // round trip time in picoseconds
+ wifi_timespan rtt_sd; // rtt standard deviation in picoseconds
+ wifi_timespan rtt_spread; // difference between max and min rtt times recorded in picoseconds
+ int distance_mm; // distance in mm (optional)
+ int distance_sd_mm; // standard deviation in mm (optional)
+ int distance_spread_mm; // difference between max and min distance recorded in mm (optional)
wifi_timestamp ts; // time of the measurement (in microseconds since boot)
int burst_duration; // in ms, actual time taken by the FW to finish one burst
// measurement. Applies to 1-sided and 2-sided RTT.
@@ -199,6 +199,9 @@ typedef struct {
byte lcr_support; // if initiator supports LCR request. Applies to 2-sided RTT
byte preamble_support; // bit mask indicates what preamble is supported by initiator
byte bw_support; // bit mask indicates what BW is supported by initiator
+ byte responder_supported; // if 11mc responder mode is supported
+ byte mc_version; // draft 11mc spec version supported by chip. For instance,
+ // version 4.0 should be 40 and version 4.3 should be 43 etc.
} wifi_rtt_capabilities;
/* RTT capabilities of the device */
@@ -270,5 +273,25 @@ wifi_error wifi_set_lci(wifi_request_id id, wifi_interface_handle iface,
wifi_error wifi_set_lcr(wifi_request_id id, wifi_interface_handle iface,
wifi_lcr_information *lcr);
+/**
+ * Get available WiFi channel to enable RTT responder on.
+ */
+wifi_error wifi_rtt_get_available_channnel(wifi_interface_handle iface, wifi_channel_info* channel);
+
+/**
+ * Enable RTT responder mode.
+ * channel_hint - hint of the channel information where RTT responder should be enabled on.
+ * max_duration_seconds - timeout of responder mode.
+ * channel_used - channel used for RTT responder, NULL if responder is not enabled.
+ */
+wifi_error wifi_enable_responder(wifi_request_id id, wifi_interface_handle iface,
+ wifi_channel_info channel_hint, unsigned max_duration_seconds,
+ wifi_channel_info* channel_used);
+
+/**
+ * Disable RTT responder mode.
+ */
+wifi_error wifi_disable_responder(wifi_request_id id, wifi_interface_handle iface);
+
#endif
diff --git a/include/hardware_legacy/wifi_hal.h b/include/hardware_legacy/wifi_hal.h
index cb23a24..1f73074 100644
--- a/include/hardware_legacy/wifi_hal.h
+++ b/include/hardware_legacy/wifi_hal.h
@@ -74,7 +74,7 @@ typedef int wifi_rssi;
typedef byte mac_addr[6];
typedef byte oui[3];
typedef int64_t wifi_timestamp; // In microseconds (us)
-typedef int64_t wifi_timespan; // In nanoseconds (ns)
+typedef int64_t wifi_timespan; // In picoseconds (ps)
typedef struct wifi_info *wifi_handle;
typedef struct wifi_interface_info *wifi_interface_handle;