From e853591968f578dc8489f163a0027ef047c75ffe Mon Sep 17 00:00:00 2001 From: Amarnath Hullur Subramanyam Date: Tue, 12 May 2015 15:19:07 -0700 Subject: Adding API for setting LCI/LCR information. Change-Id: I69c928e77b367b727ce50bb365754c6abfdb3126 --- include/hardware_legacy/rtt.h | 36 ++++++++++++++++++++++++++++++++++++ include/hardware_legacy/wifi_hal.h | 4 ++++ 2 files changed, 40 insertions(+) diff --git a/include/hardware_legacy/rtt.h b/include/hardware_legacy/rtt.h index f0c5b29..2808723 100644 --- a/include/hardware_legacy/rtt.h +++ b/include/hardware_legacy/rtt.h @@ -234,5 +234,41 @@ wifi_error wifi_rtt_debug_get(wifi_interface_handle h, rtt_debug_t **debugbuf); /* free the debug buffer */ wifi_error wifi_rtt_debug_free(wifi_interface_handle h, rtt_debug_t *debugbuf); +/* API for setting LCI/LCR information to be provided to a requestor */ +typedef enum { + WIFI_MOTION_NOT_EXPECTED = 0, // Not expected to change location + WIFI_MOTION_EXPECTED = 1, // Expected to change location + WIFI_MOTION_UNKNOWN = 2, // Movement pattern unknown +} wifi_motion_pattern; + +typedef struct { + long latitude; // latitude in degrees * 2^25 , 2's complement + long longitude; // latitude in degrees * 2^25 , 2's complement + int altitude; // Altitude in units of 1/256 m + byte latitude_unc; // As defined in Section 2.3.2 of IETF RFC 6225 + byte longitude_unc; // As defined in Section 2.3.2 of IETF RFC 6225 + byte altitude_unc; // As defined in Section 2.4.5 from IETF RFC 6225: + + //Following element for configuring the Z subelement + wifi_motion_pattern motion_pattern; + int floor; // floor in units of 1/16th of floor. 0x80000000 if unknown. + int height_above_floor; // in units of 1/64 m + int height_unc; // in units of 1/64 m. 0 if unknown +} wifi_lci_information; + +typedef struct { + char country_code[2]; // country code + int length; // length of the info field + char civic_info[256]; // Civic info to be copied in FTM frame +} wifi_lcr_information; + +// API to configure the LCI. Used in RTT Responder mode only +wifi_error wifi_set_lci(wifi_request_id id, wifi_interface_handle iface, + wifi_lci_information *lci); + +// API to configure the LCR. Used in RTT Responder mode only. +wifi_error wifi_set_lcr(wifi_request_id id, wifi_interface_handle iface, + wifi_lcr_information *lcr); + #endif diff --git a/include/hardware_legacy/wifi_hal.h b/include/hardware_legacy/wifi_hal.h index 68c80d0..1dc6f76 100644 --- a/include/hardware_legacy/wifi_hal.h +++ b/include/hardware_legacy/wifi_hal.h @@ -234,6 +234,10 @@ typedef struct { wifi_roam_params * params); wifi_error (*wifi_set_ssid_white_list)(wifi_request_id id, wifi_interface_handle iface, int num_networks, wifi_ssid *ssids); + wifi_error (*wifi_set_lci) (wifi_request_id id, wifi_interface_handle iface, + wifi_lci_information *lci); + wifi_error (*wifi_set_lcr) (wifi_request_id id, wifi_interface_handle iface, + wifi_lcr_information *lcr); } wifi_hal_fn; wifi_error init_wifi_vendor_hal_func_table(wifi_hal_fn *fn); -- cgit v1.1 From 90f830793d8f018720b0878024df0455a6427204 Mon Sep 17 00:00:00 2001 From: Prerepa Viswanadham Date: Fri, 22 May 2015 13:28:00 -0700 Subject: wifi hal definitions for keep alive packet offload and rssi monitoring Change-Id: I37caa4696b2aac0f33ea9606eeeba174b6408f02 --- include/hardware_legacy/wifi_hal.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/hardware_legacy/wifi_hal.h b/include/hardware_legacy/wifi_hal.h index 1dc6f76..10234a0 100644 --- a/include/hardware_legacy/wifi_hal.h +++ b/include/hardware_legacy/wifi_hal.h @@ -142,6 +142,10 @@ typedef struct { // More event handlers } wifi_event_handler; +typedef struct { + void (*on_rssi_threshold_breached)(wifi_request_id id, u8 *cur_bssid, s8 cur_rssi); +} wifi_rssi_event_handler; + wifi_error wifi_set_iface_event_handler(wifi_request_id id, wifi_interface_handle iface, wifi_event_handler eh); wifi_error wifi_reset_iface_event_handler(wifi_request_id id, wifi_interface_handle iface); @@ -238,6 +242,14 @@ typedef struct { wifi_lci_information *lci); wifi_error (*wifi_set_lcr) (wifi_request_id id, wifi_interface_handle iface, wifi_lcr_information *lcr); + wifi_error (*wifi_start_sending_offloaded_packet)(wifi_request_id id, + wifi_interface_handle iface, u8 *ip_packet, u16 ip_packet_len, + u8 *src_mac_addr, u8 *dst_mac_addr, u32 period_msec); + wifi_error (*wifi_stop_sending_offloaded_packet)(wifi_request_id id, + wifi_interface_handle iface); + wifi_error (*wifi_start_rssi_monitoring)(wifi_request_id id, wifi_interface_handle + iface, s8 max_rssi, s8 min_rssi, wifi_rssi_event_handler eh); + wifi_error (*wifi_stop_rssi_monitoring)(wifi_request_id id, wifi_interface_handle iface); } wifi_hal_fn; wifi_error init_wifi_vendor_hal_func_table(wifi_hal_fn *fn); -- cgit v1.1