summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorPrerepa Viswanadham <dham@google.com>2015-03-24 14:47:37 -0700
committerPrerepa Viswanadham <dham@google.com>2015-03-24 14:47:37 -0700
commitc7e2d9db534fc54e0de566f0a14676e25a6b2d92 (patch)
treeb4e04c2a7d453d33b69ca43b8ac3e46ebd2fa767 /include
parent08ab34364c299414453ae198cd52e32d39024139 (diff)
parent5e7b7e506d54a2d4cf9a5e12bde61db985f130bc (diff)
downloadhardware_libhardware_legacy-c7e2d9db534fc54e0de566f0a14676e25a6b2d92.zip
hardware_libhardware_legacy-c7e2d9db534fc54e0de566f0a14676e25a6b2d92.tar.gz
hardware_libhardware_legacy-c7e2d9db534fc54e0de566f0a14676e25a6b2d92.tar.bz2
Merge remote-tracking branch 'goog/mirror-m-wireless-internal-release' into master_merge
Change-Id: I836d0614625d2b311131cbbf1943087dc4c9bb7e
Diffstat (limited to 'include')
-rw-r--r--include/hardware_legacy/gscan.h54
-rw-r--r--include/hardware_legacy/rtt.h36
-rw-r--r--include/hardware_legacy/wifi_hal.h21
-rw-r--r--include/hardware_legacy/wifi_logger.h47
4 files changed, 87 insertions, 71 deletions
diff --git a/include/hardware_legacy/gscan.h b/include/hardware_legacy/gscan.h
index ea0afc4..9dfceb1 100644
--- a/include/hardware_legacy/gscan.h
+++ b/include/hardware_legacy/gscan.h
@@ -16,12 +16,13 @@ typedef enum {
WIFI_BAND_ABG_WITH_DFS = 7, // 2.4 GHz + 5 GHz with DFS
} wifi_band;
-#define MAX_CHANNELS 16
-#define MAX_BUCKETS 16
-#define MAX_HOTLIST_APS 128
-#define MAX_SIGNIFICANT_CHANGE_APS 64
-#define MAX_PNO_SSID 128;
-#define MAX_HOTLIST_SSID 8;
+const unsigned MAX_CHANNELS = 16;
+const unsigned MAX_BUCKETS = 16;
+const unsigned MAX_HOTLIST_APS = 128;
+const unsigned MAX_SIGNIFICANT_CHANGE_APS = 64;
+const unsigned MAX_PNO_SSID = 128;
+const unsigned MAX_HOTLIST_SSID = 8;
+const unsigned MAX_BLACKLIST_BSSID = 16;
wifi_error wifi_get_valid_channels(wifi_interface_handle handle,
int band, int max_channels, wifi_channel *channels, int *num_channels);
@@ -33,10 +34,16 @@ typedef struct {
int max_rssi_sample_size; // number of RSSI samples used for averaging RSSI
int max_scan_reporting_threshold; // max possible report_threshold as described
// in wifi_scan_cmd_params
- int max_hotlist_aps; // maximum number of entries for hotlist APs
+ int max_hotlist_bssids; // maximum number of entries for hotlist BSSIDs
+ int max_hotlist_ssids; // maximum number of entries for hotlist SSIDs
int max_significant_wifi_change_aps; // maximum number of entries for
// significant wifi change APs
int max_bssid_history_entries; // number of BSSID/RSSI entries that device can hold
+ int max_number_epno_networks; // max number of epno entries
+ int max_number_epno_networks_by_ssid; // max number of epno entries if ssid is specified,
+ // that is, epno entries for which an exact match is
+ // required, or entries corresponding to hidden ssids
+ int max_number_of_white_listed_ssid; // max number of white listed SSIDs, M target is 2 to 4
} wifi_gscan_capabilities;
wifi_error wifi_get_gscan_capabilities(wifi_interface_handle handle,
@@ -172,7 +179,7 @@ typedef struct {
typedef struct {
int lost_ap_sample_size;
- int num_ap; // number of hotlist APs
+ int num_bssid; // number of hotlist APs
ap_threshold_param ap[MAX_HOTLIST_APS]; // hotlist APs
} wifi_bssid_hotlist_params;
@@ -200,8 +207,8 @@ typedef struct {
typedef struct {
int lost_ssid_sample_size;
- int num_ap; // number of hotlist APs
- ssid_threshold_param ssid[MAX_HOTLIST_APS]; // hotlist APs
+ int num_ssid; // number of hotlist SSIDs
+ ssid_threshold_param ssid[MAX_HOTLIST_SSID]; // hotlist SSIDs
} wifi_ssid_hotlist_params;
@@ -212,6 +219,18 @@ wifi_error wifi_set_ssid_hotlist(wifi_request_id id, wifi_interface_handle iface
/* Clear the SSID Hotlist */
wifi_error wifi_reset_ssid_hotlist(wifi_request_id id, wifi_interface_handle iface);
+
+/* BSSID blacklist */
+typedef struct {
+ int num_bssid; // number of blacklisted BSSIDs
+ mac_addr bssids[MAX_BLACKLIST_BSSID]; // blacklisted BSSIDs
+} wifi_bssid_params;
+
+/* Set the BSSID blacklist */
+wifi_error wifi_set_bssid_blacklist(wifi_request_id id, wifi_interface_handle iface,
+ wifi_bssid_params params);
+
+
/* Significant wifi change */
typedef struct {
mac_addr bssid; // BSSID
@@ -234,7 +253,7 @@ typedef struct {
int rssi_sample_size; // number of samples for averaging RSSI
int lost_ap_sample_size; // number of samples to confirm AP loss
int min_breaching; // number of APs breaching threshold
- int num_ap; // max 64
+ int num_bssid; // max 64
ap_threshold_param ap[MAX_SIGNIFICANT_CHANGE_APS];
} wifi_significant_change_params;
@@ -377,7 +396,7 @@ typedef struct {
// Hysteresis: ensuring the currently associated BSSID is favored
// so as to prevent ping-pong situations
- int lazy_roam_histeresys; // boost applied to current BSSID
+ int lazy_roam_hysteresis; // boost applied to current BSSID
// Alert mode enable, i.e. configuring when firmware enters alert mode
int alert_roam_rssi_trigger; // RSSI below which "Alert" roam is enabled
@@ -395,7 +414,7 @@ wifi_error wifi_enable_lazy_roam(wifi_request_id id, wifi_interface_handle iface
* Per BSSID preference
*/
typedef struct {
- char bssid[6];
+ mac_addr bssid;
int rssi_modifier; // modifier applied to the RSSI of the BSSID for the purpose of comparing
// it with other roam candidate
} wifi_bssid_preference;
@@ -403,14 +422,5 @@ typedef struct {
wifi_error wifi_set_bssid_preference(wifi_request_id id, wifi_interface_handle iface,
int num_bssid, wifi_bssid_preference *prefs);
-typedef struct {
- int max_number_epno_networks; // max number of epno entries, M target is 64
- int max_number_of_white_listed_ssid; // max number of white listed SSIDs, M target is 2 to 4
- int max_number_of_hotlist_ssid; // max number of hotlist SSIDs, M target is 4
-} wifi_roam_autojoin_offload_capabilities;
-
-wifi_error wifi_get_roam_autojoin_offload_capabilities(wifi_interface_handle handle,
- wifi_roam_autojoin_offload_capabilities *capabilities);
-
#endif
diff --git a/include/hardware_legacy/rtt.h b/include/hardware_legacy/rtt.h
index d2c548c..45937fc 100644
--- a/include/hardware_legacy/rtt.h
+++ b/include/hardware_legacy/rtt.h
@@ -20,7 +20,7 @@ typedef enum {
RTT_STATUS_FAIL_TM_TIMEOUT,
RTT_STATUS_FAIL_AP_ON_DIFF_CHANNEL,
RTT_STATUS_FAIL_NO_CAPABILITY,
- RTT_STATUS_FAIL_BUSY_TRY_LATER, //2 side RTT if other side temporarily busy
+ RTT_STATUS_FAIL_BUSY_TRY_LATER,
RTT_STATUS_ABORTED
} wifi_rtt_status;
@@ -37,15 +37,15 @@ typedef enum {
typedef struct {
mac_addr addr; // peer device mac address
wifi_rtt_type type; // optional - rtt type hint.
- // RTT_TYPE_AUTO implies best effort
+ // RTT_TYPE_AUTO implies best effort
wifi_peer_type peer; // optional - peer device hint (STA, P2P, AP)
wifi_channel_info channel; // Required for STA-AP mode, optional for P2P, NBD etc.
unsigned interval; // interval between RTT burst (unit ms).
- // Only valid when multi_burst = 1
+ // Only valid when multi_burst = 1
unsigned num_burst; // total number of RTT bursts, 1 means single shot
unsigned num_frames_per_burst; // num of frames in each RTT burst
- // for single side, measurement result num = frame number
- // for 2 side RTT, measurement result num = frame number - 1
+ // for single side, measurement result num = frame number
+ // for 2 side RTT, measurement result num = frame number - 1
unsigned num_retries_per_measurement_frame; // retry time for RTT MEASUREMENT frame
//following fields are only valid for 2 side RTT
@@ -64,7 +64,7 @@ typedef struct {
unsigned measurement_number; // total RTT measurement Frames
unsigned success_number; // total successful RTT measurement Frames
byte number_per_burst_peer; //Max number of FTM numbers per burst the other side support,
- //11mc only
+ //11mc only
wifi_rtt_status status; // ranging status
byte retry_after_duration; // in s , 11mc only, only for RTT_STATUS_FAIL_BUSY_TRY_LATER, 1-31s
wifi_rtt_type type; // RTT type
@@ -80,13 +80,13 @@ typedef struct {
int distance_spread; // difference between max and min distance recorded (optional)
wifi_timestamp ts; // time of the measurement (in microseconds since boot)
int burst_duration; // in ms, How long the FW time is to finish one burst measurement
- wifi_information_element LCI; // for 11mc only, optional
- wifi_information_element LCR; // for 11mc only, optional
+ wifi_information_element *LCI; // for 11mc only
+ wifi_information_element *LCR; // for 11mc only
} wifi_rtt_result;
/* RTT result callback */
typedef struct {
- void (*on_rtt_results) (wifi_request_id id, unsigned num_results, wifi_rtt_result rtt_result[]);
+ void (*on_rtt_results) (wifi_request_id id, unsigned num_results, wifi_rtt_result *rtt_result[]);
} wifi_rtt_event_handler;
/* API to request RTT measurement */
@@ -100,8 +100,8 @@ wifi_error wifi_rtt_range_cancel(wifi_request_id id, wifi_interface_handle ifac
/* NBD ranging channel map */
typedef struct {
wifi_channel availablity[32]; // specifies the channel map for each of the 16 TU windows
- // frequency of 0 => unspecified; which means firmware is
- // free to do whatever it wants in this window.
+ // frequency of 0 => unspecified; which means firmware is
+ // free to do whatever it wants in this window.
} wifi_channel_map;
/* API to start publishing the channel map on responder device in a NBD cluster.
@@ -130,12 +130,12 @@ wifi_error wifi_rtt_channel_map_clear(wifi_request_id id, wifi_interface_handle
/* RTT Capabilities */
typedef struct {
- byte rtt_one_sided_supported; // if 1-sided rtt data collection is supported
- byte rtt_ftm_supported; // if ftm rtt data collection is supported
- byte lci_support;
- byte lcr_support;
- byte preamble_support; //bit mask indicate what preamble is supported
- byte bw_support; //bit mask indicate what BW is supported
+ byte rtt_one_sided_supported; // if 1-sided rtt data collection is supported
+ byte rtt_ftm_supported; // if ftm rtt data collection is supported
+ byte lci_support;
+ byte lcr_support;
+ byte preamble_support; //bit mask indicate what preamble is supported
+ byte bw_support; //bit mask indicate what BW is supported
} wifi_rtt_capabilities;
/* RTT capabilities of the device */
@@ -165,7 +165,7 @@ typedef struct rtt_debug {
} rtt_debug_t;
/* set configuration for debug */
-wifi_error wifi_rtt_debug_cfg(wifi_interface_handle h, unsigned rtt_dbg_type, char *cfgbuf, u32 cfg_buf_size);
+wifi_error wifi_rtt_debug_cfg(wifi_interface_handle h, unsigned rtt_dbg_type, char *cfgbuf, unsigned cfg_buf_size);
/* get the debug information */
wifi_error wifi_rtt_debug_get(wifi_interface_handle h, rtt_debug_t **debugbuf);
/* free the debug buffer */
diff --git a/include/hardware_legacy/wifi_hal.h b/include/hardware_legacy/wifi_hal.h
index 9653719..4098cd4 100644
--- a/include/hardware_legacy/wifi_hal.h
+++ b/include/hardware_legacy/wifi_hal.h
@@ -26,14 +26,14 @@ extern "C"
/* WiFi Common definitions */
/* channel operating width */
typedef enum {
- WIFI_CHAN_WIDTH_20 = 0,
- WIFI_CHAN_WIDTH_40 = 1,
- WIFI_CHAN_WIDTH_80 = 2,
- WIFI_CHAN_WIDTH_160 = 3,
- WIFI_CHAN_WIDTH_80P80 = 4,
- WIFI_CHAN_WIDTH_5 = 5,
- WIFI_CHAN_WIDTH_10 = 6,
- WIFI_CHAN_WIDTH_INVALID = -1
+ WIFI_CHAN_WIDTH_20 = 0,
+ WIFI_CHAN_WIDTH_40 = 1,
+ WIFI_CHAN_WIDTH_80 = 2,
+ WIFI_CHAN_WIDTH_160 = 3,
+ WIFI_CHAN_WIDTH_80P80 = 4,
+ WIFI_CHAN_WIDTH_5 = 5,
+ WIFI_CHAN_WIDTH_10 = 6,
+ WIFI_CHAN_WIDTH_INVALID = -1
} wifi_channel_width;
typedef int wifi_radio;
@@ -65,7 +65,9 @@ typedef unsigned char u8;
typedef signed char s8;
typedef uint16_t u16;
typedef uint32_t u32;
+typedef int32_t s32;
typedef uint64_t u64;
+typedef int64_t s64;
typedef int wifi_request_id;
typedef int wifi_channel; // indicates channel frequency in MHz
typedef int wifi_rssi;
@@ -110,6 +112,7 @@ void wifi_get_error_info(wifi_error err, const char **msg); // return a pointer
// Add more features here
+
typedef int feature_set;
#define IS_MASK_SET(mask, flags) ((flags & mask) == mask)
@@ -126,7 +129,7 @@ wifi_error wifi_get_supported_feature_set(wifi_interface_handle handle, feature_
* all other combinations are invalid!
*/
wifi_error wifi_get_concurrency_matrix(wifi_interface_handle handle, int set_size_max,
- feature_set set[], int *set_size);
+ feature_set set[], int *set_size);
/* multiple interface support */
diff --git a/include/hardware_legacy/wifi_logger.h b/include/hardware_legacy/wifi_logger.h
index 8a6c51b..089f138 100644
--- a/include/hardware_legacy/wifi_logger.h
+++ b/include/hardware_legacy/wifi_logger.h
@@ -36,13 +36,15 @@ extern "C"
typedef int wifi_radio;
typedef int wifi_ring_buffer_id;
+#define PER_PACKET_ENTRY_FLAGS_DIRECTION_TX 1 // 0: TX, 1: RX
+#define PER_PACKET_ENTRY_FLAGS_TX_SUCCESS 2 // whether packet was transmitted or received/decrypted successfully
+#define PER_PACKET_ENTRY_FLAGS_80211_HEADER 4 // has full 802.11 header, else has 802.3 header
+#define PER_PACKET_ENTRY_FLAGS_PROTECTED 8 // whether packet was encrypted
+
typedef struct {
- u8 direction:1; // 0: TX, 1: RX
- u8 success:1; // whether packet was transmitted or received/decrypted successfully
- u8 has_80211_header:1; // has full 802.11 header, else has 802.3 header
- u8 protected_packet:1; // whether packet was encrypted
- u8 tid:4; // transmit or received tid
- u8 MCS; // modulation and bandwidth
+ u8 flags;
+ u8 tid; // transmit or received tid
+ u16 MCS; // modulation and bandwidth
u8 rssi; // TX: RSSI of ACK for that packet
// RX: RSSI of packet
u8 num_retries; // number of attempted retries
@@ -60,7 +62,7 @@ typedef struct {
u8 data[0]; // packet data. The length of packet data is determined by the entry_size field of
// the wifi_ring_buffer_entry structure. It is expected that first bytes of the
// packet, or packet headers only (up to TCP or RTP/UDP headers) will be copied into the ring
-} wifi_ring_per_packet_status_entry;
+} __attribute__((packed)) wifi_ring_per_packet_status_entry;
static char per_packet_status_ring_name[] = "wifi_per_packet_status"; // Ring buffer name for per-packet status ring
@@ -134,7 +136,7 @@ typedef struct {
u16 tag;
u16 length; // length of value
u8 value[0];
-} tlv_log;
+} __attribute__((packed)) tlv_log;
typedef struct {
u16 event;
@@ -143,7 +145,7 @@ typedef struct {
// parameter as transmit rate, num retries, num scan result found etc...
// as well, event_data can include a vendor proprietary part which is
// understood by the developer only.
-} wifi_ring_buffer_driver_connectivity_event;
+} __attribute__((packed)) wifi_ring_buffer_driver_connectivity_event;
// Ring buffer name for connectivity events ring
static char connectivity_event_ring_name[] = "wifi_connectivity_events";
@@ -155,16 +157,15 @@ typedef struct {
int status; // 0 taken, 1 released
int reason; // reason why this wake lock is taken
char name[0]; // null terminated
-} wake_lock_event;
+} __attribute__((packed)) wake_lock_event;
typedef struct {
u16 event;
tlv_log tlvs[0];
-} wifi_power_event;
+} wifi_power_event __attribute__((packed));
static char power_event_ring_name[] = "wifi_power_events";
-
/**
* This structure represent a logger entry within a ring buffer.
* Wifi driver are responsible to manage the ring buffer and write the debug
@@ -180,23 +181,25 @@ static char power_event_ring_name[] = "wifi_power_events";
* data logged by drivers into their ring buffer, store the data into log files and include
* the logs into android bugreports.
*/
+
+#define RING_BUFFER_ENTRY_FLAGS_HAS_BINARY 1 // set for binary entries
+#define RING_BUFFER_ENTRY_FLAGS_HAS_TIMESTAMP 2 // set if 64 bits timestamp is present
+
typedef struct {
- u16 entry_size:13;
- u16 binary:1; //set for binary entries
- u16 has_timestamp:1; //set if 64 bits timestamp is present
- u16 reserved:1;
+ u16 entry_size;
+ u8 flags;
u8 type; // Per ring specific
- u8 resvd;
u64 timestamp; //present if has_timestamp bit is set.
union {
u8 data[0];
wifi_ring_buffer_driver_connectivity_event connectivity_event;
wifi_ring_per_packet_status_entry packet_status;
+ wifi_power_event power_event;
};
-} wifi_ring_buffer_entry;
+} __attribute__((packed)) wifi_ring_buffer_entry;
#define WIFI_RING_BUFFER_FLAG_HAS_BINARY_ENTRIES 0x00000001 // set if binary entries are present
-#define WIFI_RING_BUFFER_FLAG_HAS_ASCII_ENTRI 0x00000002 // set if ascii entries are present
+#define WIFI_RING_BUFFER_FLAG_HAS_ASCII_ENTRIES 0x00000002 // set if ascii entries are present
/* ring buffer params */
/**
@@ -268,15 +271,15 @@ wifi_error wifi_get_ring_buffers_status(wifi_request_id id,
/* api to collect a firmware memory dump for a given iface */
wifi_error wifi_get_firmware_memory_dump(wifi_request_id id,
- wifi_interface_handle iface, char * buffer, int buffer_size);
+ wifi_interface_handle iface, char ** buffer, int *buffer_size);
/* api to collect a firmware version string */
wifi_error wifi_get_firmware_version(wifi_request_id id,
- wifi_interface_handle iface, char * buffer, int buffer_size);
+ wifi_interface_handle iface, char *buffer, int buffer_size);
/* api to collect a driver version string */
wifi_error wifi_get_driver_version(wifi_request_id id,
- wifi_interface_handle iface, char * buffer, int buffer_size);
+ wifi_interface_handle iface, char *buffer, int buffer_size);
/* api to collect driver records */