Merge Android Pie into master

Bug: 112104996
Change-Id: I01c750e0e3a33a582b0800f7a3dd6f806a1b11e1
This commit is contained in:
Xin Li 2018-08-06 16:51:06 -07:00
commit acd6440af2
4 changed files with 180 additions and 10 deletions

View file

@ -25,7 +25,6 @@
#include <utils/String16.h>
#include <utils/String8.h>
#include <media/IAudioFlinger.h>
#include <hardware_legacy/AudioSystemLegacy.h>
#include <system/audio.h>

View file

@ -22,7 +22,9 @@ typedef enum {
RTT_STATUS_FAIL_BUSY_TRY_LATER = 12, // responder cannot collaborate at time of request
RTT_STATUS_INVALID_REQ = 13, // bad request args
RTT_STATUS_NO_WIFI = 14, // WiFi not enabled
RTT_STATUS_FAIL_FTM_PARAM_OVERRIDE = 15 // Responder overrides param info, cannot range with new params
RTT_STATUS_FAIL_FTM_PARAM_OVERRIDE = 15, // Responder overrides param info, cannot range with new params
RTT_STATUS_NAN_RANGING_PROTOCOL_FAILURE =16, //Negotiation failure
RTT_STATUS_NAN_RANGING_CONCURRENCY_NOT_SUPPORTED=17, //concurrency not supported (NDP+RTT)
} wifi_rtt_status;
/* RTT peer type */

View file

@ -23,6 +23,8 @@ extern "C"
#endif
#include <stdint.h>
#define IFNAMSIZ 16
/* WiFi Common definitions */
/* channel operating width */
typedef enum {
@ -38,9 +40,23 @@ typedef enum {
/* Pre selected Power scenarios to be applied from BDF file */
typedef enum {
WIFI_POWER_SCENARIO_VOICE_CALL = 0,
WIFI_POWER_SCENARIO_VOICE_CALL = 0,
WIFI_POWER_SCENARIO_ON_HEAD_CELL_OFF = 1,
WIFI_POWER_SCENARIO_ON_HEAD_CELL_ON = 2,
WIFI_POWER_SCENARIO_ON_BODY_CELL_OFF = 3,
WIFI_POWER_SCENARIO_ON_BODY_CELL_ON = 4,
} wifi_power_scenario;
/*
* enum wlan_mac_band - Band information corresponding to the WLAN MAC.
*/
typedef enum {
/* WLAN MAC Operates in 2.4 GHz Band */
WLAN_MAC_2_4_BAND = 1 << 0,
/* WLAN MAC Operates in 5 GHz Band */
WLAN_MAC_5_0_BAND = 1 << 1
} wlan_mac_band;
typedef int wifi_radio;
typedef int wifi_channel;
@ -90,6 +106,17 @@ typedef struct wifi_interface_info *wifi_interface_handle;
/* Initialize/Cleanup */
wifi_error wifi_initialize(wifi_handle *handle);
/**
* wifi_wait_for_driver
* Function should block until the driver is ready to proceed.
* Any errors from this function is considered fatal & will fail the HAL startup sequence.
*
* on success returns WIFI_SUCCESS
* on failure returns WIFI_ERROR_TIMED_OUT
*/
wifi_error wifi_wait_for_driver_ready(void);
typedef void (*wifi_cleaned_up_handler) (wifi_handle handle);
void wifi_cleanup(wifi_handle handle, wifi_cleaned_up_handler handler);
void wifi_event_loop(wifi_handle handle);
@ -125,6 +152,7 @@ void wifi_get_error_info(wifi_error err, const char **msg); // return a pointer
#define WIFI_FEATURE_IE_WHITELIST 0x1000000 // Support Probe IE white listing
#define WIFI_FEATURE_SCAN_RAND 0x2000000 // Support MAC & Probe Sequence Number randomization
#define WIFI_FEATURE_SET_TX_POWER_LIMIT 0x4000000 // Support Tx Power Limit setting
#define WIFI_FEATURE_USE_BODY_HEAD_SAR 0x8000000 // Support Using Body/Head Proximity for SAR
// Add more features here
@ -158,6 +186,25 @@ typedef struct {
// More event handlers
} wifi_event_handler;
typedef struct {
char iface_name[IFNAMSIZ + 1];
wifi_channel channel;
} wifi_iface_info;
typedef struct {
u32 wlan_mac_id;
/* BIT MASK of BIT(WLAN_MAC*) as represented by wlan_mac_band */
u32 mac_band;
/* Represents the connected Wi-Fi interfaces associated with each MAC */
int num_iface;
wifi_iface_info *iface_info;
} wifi_mac_info;
typedef struct {
void (*on_radio_mode_change)(wifi_request_id id, unsigned num_mac,
wifi_mac_info *mac_info);
} wifi_radio_mode_change_handler;
typedef struct {
void (*on_rssi_threshold_breached)(wifi_request_id id, u8 *cur_bssid, s8 cur_rssi);
} wifi_rssi_event_handler;
@ -231,6 +278,7 @@ typedef struct wlan_driver_wake_reason_cnt_t {
//wifi HAL function pointer table
typedef struct {
wifi_error (* wifi_initialize) (wifi_handle *);
wifi_error (* wifi_wait_for_driver_ready) (void);
void (* wifi_cleanup) (wifi_handle, wifi_cleaned_up_handler);
void (*wifi_event_loop)(wifi_handle);
void (* wifi_get_error_info) (wifi_error , const char **);
@ -405,12 +453,17 @@ typedef struct {
    */
wifi_error (*wifi_set_packet_filter)(wifi_interface_handle handle,
const u8 *program, u32 len);
wifi_error (*wifi_read_packet_filter)(wifi_interface_handle handle,
u32 src_offset, u8 *host_dst,
u32 length);
wifi_error (*wifi_get_roaming_capabilities)(wifi_interface_handle handle,
wifi_roaming_capabilities *caps);
wifi_error (*wifi_enable_firmware_roaming)(wifi_interface_handle handle,
fw_roaming_state_t state);
wifi_error (*wifi_configure_roaming)(wifi_interface_handle handle,
wifi_roaming_config *roaming_config);
wifi_error (*wifi_set_radio_mode_change_handler)(wifi_request_id id, wifi_interface_handle
iface, wifi_radio_mode_change_handler eh);
} wifi_hal_fn;
wifi_error init_wifi_vendor_hal_func_table(wifi_hal_fn *fn);
#ifdef __cplusplus

View file

@ -64,7 +64,7 @@ typedef u32 NanDataPathId;
#define NAN_MAX_SDEA_SERVICE_SPECIFIC_INFO_LEN 1024
#define NAN_SECURITY_MIN_PASSPHRASE_LEN 8
#define NAN_SECURITY_MAX_PASSPHRASE_LEN 63
#define NAN_MAX_CHANNEL_INFO_SUPPORTED 4
/*
Definition of various NanResponseType
@ -137,6 +137,13 @@ typedef enum {
NAN_TCA_ID_CLUSTER_SIZE = 0
} NanTcaType;
/* NAN Channel Info */
typedef struct {
u32 channel;
u32 bandwidth;
u32 nss;
} NanChannelInfo;
/*
Various NAN Protocol Response code
*/
@ -224,6 +231,12 @@ typedef enum {
NAN_DP_CONFIG_SECURITY
} NanDataPathSecurityCfgStatus;
typedef enum {
NAN_QOS_NOT_REQUIRED = 0,
NAN_QOS_REQUIRED
} NanQosCfgStatus;
/* Data request Responder's response */
typedef enum {
NAN_DP_REQUEST_ACCEPT = 0,
@ -302,6 +315,10 @@ typedef struct {
#define NAN_RANGING_INDICATE_INGRESS_MET_MASK 0x02
#define NAN_RANGING_INDICATE_EGRESS_MET_MASK 0x04
/* NAN schedule update reason MASKS */
#define NAN_SCHEDULE_UPDATE_NSS_MASK 0x01
#define NAN_SCHEDULE_UPDATE_CHANNEL_MASK 0x02
/*
Structure to set the Service Descriptor Extension
Attribute (SDEA) passed as part of NanPublishRequest/
@ -330,6 +347,11 @@ typedef struct {
when configured NanRangeReportInd received
*/
NanRangeReport range_report;
/*
NAN QOS required flag to indicate
if QOS is required or not.
*/
NanQosCfgStatus qos_cfg;
} NanSdeaCtrlParams;
/*
@ -340,7 +362,7 @@ typedef struct {
Distance to the NAN device with the MAC address indicated
with ranged mac address.
*/
u32 range_measurement_cm;
u32 range_measurement_mm;
/* Ranging event matching the configuration of continuous/ingress/egress. */
u32 ranging_event_type;
} NanRangeInfo;
@ -632,10 +654,10 @@ typedef struct {
BIT2 - Egress distance is >=.
*/
u32 config_ranging_indications;
/* Ingress distance in centimeters (optional) */
u32 distance_ingress_cm;
/* Egress distance in centimeters (optional) */
u32 distance_egress_cm;
/* Ingress distance in millimeters (optional) */
u32 distance_ingress_mm;
/* Egress distance in millmilliimeters (optional) */
u32 distance_egress_mm;
} NanRangingCfg;
/* NAN Ranging request's response */
@ -973,6 +995,34 @@ typedef struct {
*/
u8 config_subscribe_sid_beacon;
u32 subscribe_sid_beacon_val; // default value 0x0
/*
Discovery Beacon Interval config.
Default value is 128 msec in 2G DW and 176 msec in 2G/5G DW.
When 0 value is passed it is reset to default value of 128 or 176 msec.
*/
u8 config_discovery_beacon_int;
u32 discovery_beacon_interval;
/*
Enable Number of Spatial Streams.
This is NAN Power Optimization feature for NAN discovery.
*/
u8 config_nss;
// default value is implementation specific and passing 0 sets it to default
u32 nss;
/*
Enable device level NAN Ranging feature.
0 - Disable
1 - Enable
*/
u8 config_enable_ranging;
u32 enable_ranging;
/*
Enable/Disable DW Early termination.
0 - Disable
1 - Enable
*/
u8 config_dw_early_termination;
u32 enable_dw_termination;
} NanEnableRequest;
/*
@ -1421,6 +1471,34 @@ typedef struct {
*/
u8 config_subscribe_sid_beacon;
u32 subscribe_sid_beacon_val; // default value 0x0
/*
Discovery Beacon Interval config.
Default value is 128 msec in 2G DW and 176 msec in 2G/5G DW.
When 0 value is passed it is reset to default value of 128 or 176 msec.
*/
u8 config_discovery_beacon_int;
u32 discovery_beacon_interval;
/*
Enable Number of Spatial Streams.
This is NAN Power Optimization feature for NAN discovery.
*/
u8 config_nss;
// default value is implementation specific and passing 0 sets it to default
u32 nss;
/*
Enable device level NAN Ranging feature.
0 - Disable
1 - Enable
*/
u8 config_enable_ranging;
u32 enable_ranging;
/*
Enable/Disable DW Early termination.
0 - Disable
1 - Enable
*/
u8 config_dw_early_termination;
u32 enable_dw_termination;
} NanConfigRequest;
/*
@ -1612,6 +1690,7 @@ typedef struct
u32 amHopCountExpireCount;
u32 ndpChannelFreq;
u32 ndpChannelFreq2;
u32 schedUpdateChannelFreq;
} NanSyncStats;
/* NAN Misc DE Statistics */
@ -2212,8 +2291,44 @@ typedef struct {
expected reason codes.
*/
NanStatusType reason_code;
/* Number of channels for which info is indicated */
u32 num_channels;
/*
Data indicating the Channel list and BW of the channel.
*/
NanChannelInfo channel_info[NAN_MAX_CHANNEL_INFO_SUPPORTED];
} NanDataPathConfirmInd;
/*
Event indication of schedule update is received on both
initiator and responder when a schedule change occurs
*/
typedef struct {
/*
NMI mac address
*/
u8 peer_mac_addr[NAN_MAC_ADDR_LEN];
/*
Reason code indicating the cause of schedule update.
BIT_0 NSS Update
BIT_1 Channel list update
*/
u32 schedule_update_reason_code;
/* Number of channels for which info is indicated */
u32 num_channels;
/*
Data indicating the Channel list and BW of the channel.
*/
NanChannelInfo channel_info[NAN_MAX_CHANNEL_INFO_SUPPORTED];
/* Number of NDP instance Ids */
u8 num_ndp_instances;
/*
Unique token Id generated on the initiator/responder side
used for a NDP session between two NAN devices
*/
NanDataPathId ndp_instance_id[];
} NanDataPathScheduleUpdateInd;
/*
Event indication received on the
initiator/responder side terminating
@ -2250,7 +2365,7 @@ typedef struct {
Distance to the NAN device with the MAC address indicated
with ranged mac address.
*/
u32 range_measurement_cm;
u32 range_measurement_mm;
} NanRangeReportInd;
/* Response and Event Callbacks */
@ -2274,6 +2389,7 @@ typedef struct {
void (*EventTransmitFollowup) (NanTransmitFollowupInd* event);
void (*EventRangeRequest) (NanRangeRequestInd* event);
void (*EventRangeReport) (NanRangeReportInd* event);
void (*EventScheduleUpdate)(NanDataPathScheduleUpdateInd* event);
} NanCallbackHandler;
/**@brief nan_enable_request