From 1f909ca20a542b757cb0275ac85a5ffbcc68d2f8 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Wed, 4 Aug 2021 12:48:07 +0900 Subject: [PATCH 01/10] Remove ndk_platform backend. Use the ndk backend. The ndk_platform backend will soon be deprecated because the ndk backend can serve the same purpose. This is to eliminate the confusion about having two variants (ndk and ndk_platform) for the same ndk backend. Bug: 161456198 Test: m Change-Id: Ifadc89ec1cdb32dc39d5639665167c7bae336836 --- Android.bp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Android.bp b/Android.bp index c91ac35..74b9060 100644 --- a/Android.bp +++ b/Android.bp @@ -40,7 +40,7 @@ cc_library { defaults: ["libpower_defaults"], srcs: ["power.cpp"], export_include_dirs: ["include"], - shared_libs: ["android.system.suspend-V1-ndk_platform"], + shared_libs: ["android.system.suspend-V1-ndk"], vendor_available: true, vndk: { enabled: true, @@ -54,7 +54,7 @@ cc_test { static_libs: ["libpower"], shared_libs: [ "android.system.suspend.control.internal-cpp", - "android.system.suspend-V1-ndk_platform", + "android.system.suspend-V1-ndk", ], test_suites: ["device-tests"], require_root: true, @@ -69,7 +69,7 @@ cc_library_shared { }, shared_libs: [ - "android.system.suspend-V1-ndk_platform", + "android.system.suspend-V1-ndk", "libdl", ], @@ -98,7 +98,7 @@ cc_test { srcs: ["block_suspend.cpp"], static_libs: ["libpower"], shared_libs: [ - "android.system.suspend-V1-ndk_platform", + "android.system.suspend-V1-ndk", ], gtest: false, } From 7813a70208305737e9dd497d877e2aecf4c0f57d Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Thu, 19 Aug 2021 11:38:31 -0700 Subject: [PATCH 02/10] uwb: Allow uwb apex to include libpower Bug: 188911079 Test: Compiles Change-Id: Ia04e09f1f589dd49534bffe2878ef84e32434a7d --- Android.bp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Android.bp b/Android.bp index 74b9060..728346c 100644 --- a/Android.bp +++ b/Android.bp @@ -45,6 +45,11 @@ cc_library { vndk: { enabled: true, }, + apex_available: [ + "//apex_available:platform", + "com.android.uwb", + ], + min_sdk_version: "current", // TODO: Move to 32 once SDK is finalized } cc_test { From 6a489c0360761224df8b68fe6ebd0a89eeb1ad9f Mon Sep 17 00:00:00 2001 From: Veerendranath Jakkam Date: Fri, 8 Oct 2021 02:42:30 +0530 Subject: [PATCH 03/10] wifi: Add feature flag to indicate support for set MAC without iface reset This commit adds the enum to indicate driver support for MAC address change without iface reset. Bug: 202424223 Test: atest VtsHalWifiV1_5TargetTest Test: Manual - Connect STA to AP and check random mac is set Change-Id: I29662153d83eedf9986142f8371f3a7251b625dc --- include/hardware_legacy/wifi_hal.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/hardware_legacy/wifi_hal.h b/include/hardware_legacy/wifi_hal.h index 6adefdb..7605796 100644 --- a/include/hardware_legacy/wifi_hal.h +++ b/include/hardware_legacy/wifi_hal.h @@ -267,6 +267,7 @@ void wifi_get_error_info(wifi_error err, const char **msg); // return a pointer #define WIFI_FEATURE_SCAN_RAND (uint64_t)0x2000000 // Support MAC & Probe Sequence Number randomization #define WIFI_FEATURE_SET_TX_POWER_LIMIT (uint64_t)0x4000000 // Support Tx Power Limit setting #define WIFI_FEATURE_USE_BODY_HEAD_SAR (uint64_t)0x8000000 // Support Using Body/Head Proximity for SAR +#define WIFI_FEATURE_DYNAMIC_SET_MAC (uint64_t)0x10000000 // Support changing MAC address without iface reset(down and up) #define WIFI_FEATURE_SET_LATENCY_MODE (uint64_t)0x40000000 // Support Latency mode setting #define WIFI_FEATURE_P2P_RAND_MAC (uint64_t)0x80000000 // Support P2P MAC randomization #define WIFI_FEATURE_INFRA_60G (uint64_t)0x100000000 // Support for 60GHz Band From 4dac6dcef8cc80887120e9a5587963944e12d05b Mon Sep 17 00:00:00 2001 From: Nate Jiang Date: Fri, 15 Oct 2021 11:51:51 -0700 Subject: [PATCH 04/10] Add wifi-aware 3.1 support Add instant communication mode and NCS-PK support Bug: 203220137 Test: build Change-Id: I46fd18d1e1780b76c40f59ed05503e39b71e3aa6 --- include/hardware_legacy/wifi_hal.h | 8 ++++ include/hardware_legacy/wifi_nan.h | 68 ++++++++++++++++++++++++++++-- 2 files changed, 72 insertions(+), 4 deletions(-) diff --git a/include/hardware_legacy/wifi_hal.h b/include/hardware_legacy/wifi_hal.h index 6adefdb..cd8e0a3 100644 --- a/include/hardware_legacy/wifi_hal.h +++ b/include/hardware_legacy/wifi_hal.h @@ -192,6 +192,14 @@ typedef enum { * P2P GO may be supported by some vendors on the same STA channel. */ WIFI_USABLE_CHANNEL_FILTER_CONCURRENCY = 1 << 1, + /* This Filter queries Wifi channels and bands that are supported for + * NAN3.1 Instant communication mode. This filter should only be applied to NAN interface. + * If 5G is supported default discovery channel 149/44 is considered, + * If 5G is not supported then channel 6 has to be considered. + * Based on regulatory domain if channel 149 and 44 are restricted, channel 6 should + * be considered for instant communication channel + */ + WIFI_USABLE_CHANNEL_FILTER_NAN_INSTANT_MODE = 1 << 2, } wifi_usable_channel_filter; typedef enum { diff --git a/include/hardware_legacy/wifi_nan.h b/include/hardware_legacy/wifi_nan.h index 1fb7138..8437a1d 100644 --- a/include/hardware_legacy/wifi_nan.h +++ b/include/hardware_legacy/wifi_nan.h @@ -305,10 +305,12 @@ typedef struct { } body; } NanSecurityKeyInfo; -/* NAN Shared Key Security Cipher Suites Mask */ -#define NAN_CIPHER_SUITE_SHARED_KEY_NONE 0x00 -#define NAN_CIPHER_SUITE_SHARED_KEY_128_MASK 0x01 -#define NAN_CIPHER_SUITE_SHARED_KEY_256_MASK 0x02 +/* NAN Security Cipher Suites Mask */ +#define NAN_CIPHER_SUITE_SHARED_KEY_NONE 0x00 +#define NAN_CIPHER_SUITE_SHARED_KEY_128_MASK 0x01 +#define NAN_CIPHER_SUITE_SHARED_KEY_256_MASK 0x02 +#define NAN_CIPHER_SUITE_PUBLIC_KEY_2WDH_128_MASK 0x04 +#define NAN_CIPHER_SUITE_PUBLIC_KEY_2WDH_256_MASK 0x08 /* NAN ranging indication condition MASKS */ #define NAN_RANGING_INDICATE_CONTINUOUS_MASK 0x01 @@ -1041,6 +1043,17 @@ typedef struct { */ u8 config_enable_instant_mode; u32 enable_instant_mode; + /* + Config NAN v3.1 instant communication channel frequency selected over NFC/OOB method. + If dual band is supported default channel is 149 or 44 as per regulatory domain, + else channel 6 (send frequency in MHz). + Sometimes depending on country code retrictions, even 149/44 may be restricted + in those cases instant channel will be operational only in 2.4GHz. + Use wifi_get_usable_channels() API to get supported bands/channels before + Instant mode NFC handshake is triggered + */ + u8 config_instant_mode_channel; + wifi_channel instant_mode_channel; } NanEnableRequest; /* @@ -1533,6 +1546,17 @@ typedef struct { */ u8 config_enable_instant_mode; u32 enable_instant_mode; + /* + Config NAN v3.1 instant communication channel selected over NFC/OOB method. + If dual band is supported default channel is 149 or 44 as per regulatory domain, + else channel 6 (send frequency in MHz). + Sometimes depending on country code retrictions, even 149/44 may be restricted + in those cases instant channel will be operational only in 2.4GHz. + Use wifi_get_usable_channels() API to get supported bands/channels before + Instant mode NFC handshake is triggered + */ + u8 config_instant_mode_channel; + wifi_channel instant_mode_channel; } NanConfigRequest; /* @@ -2223,6 +2247,18 @@ typedef struct { is not associated with the NDP (out-of-band discovery). */ u8 service_name[NAN_MAX_SERVICE_NAME_LEN]; + + /* Security Context Identifiers length */ + u32 scid_len; + /* + Security Context Identifier attribute contains PMKID + shall be included in NDP setup and response messages. + Security Context Identifier, Identifies the Security + Context. For NAN Shared Key Cipher Suite, this field + contains the 16 octet PMKID identifying the PMK used + for setting up the Secure Data Path. + */ + u8 scid[NAN_MAX_SCID_BUF_LEN]; } NanDataPathInitiatorRequest; /* @@ -2263,6 +2299,18 @@ typedef struct { is not associated with the NDP (out-of-band discovery). */ u8 service_name[NAN_MAX_SERVICE_NAME_LEN]; + + /* Security Context Identifiers length */ + u32 scid_len; + /* + Security Context Identifier attribute contains PMKID + shall be included in NDP setup and response messages. + Security Context Identifier, Identifies the Security + Context. For NAN Shared Key Cipher Suite, this field + contains the 16 octet PMKID identifying the PMK used + for setting up the Secure Data Path. + */ + u8 scid[NAN_MAX_SCID_BUF_LEN]; } NanDataPathIndicationResponse; /* NDP termination info */ @@ -2298,6 +2346,18 @@ typedef struct { NanDataPathCfg ndp_cfg; /* App/Service information of the initiator */ NanDataPathAppInfo app_info; + + /* Security Context Identifiers length */ + u32 scid_len; + /* + Security Context Identifier attribute contains PMKID + shall be included in NDP setup and response messages. + Security Context Identifier, Identifies the Security + Context. For NAN Shared Key Cipher Suite, this field + contains the 16 octet PMKID identifying the PMK used + for setting up the Secure Data Path. + */ + u8 scid[NAN_MAX_SCID_BUF_LEN]; } NanDataPathRequestInd; /* From 10c3ee551c8e04be651a07f5dab5d56203b7988c Mon Sep 17 00:00:00 2001 From: Roshan Pius Date: Thu, 20 Jan 2022 18:40:20 +0000 Subject: [PATCH 05/10] libpower: Set uwb apex sdk to Tiramisu Bug: 215526504 Test: Compiles Change-Id: I7da60eaa71cecbf96e7d4cfa235a16f947d5a416 --- Android.bp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Android.bp b/Android.bp index 728346c..7be18c7 100644 --- a/Android.bp +++ b/Android.bp @@ -49,7 +49,7 @@ cc_library { "//apex_available:platform", "com.android.uwb", ], - min_sdk_version: "current", // TODO: Move to 32 once SDK is finalized + min_sdk_version: "Tiramisu", } cc_test { From 60d787cd159a27ecc63bb5a1846faf63e4c45475 Mon Sep 17 00:00:00 2001 From: Ahmed ElArabawy Date: Wed, 19 Jan 2022 15:59:37 -0800 Subject: [PATCH 06/10] Wifi: Add needed definitions for 11be support This commit adds the necessary defines for 11be(WiFi-7) support Bug: 198746544 Test: Builds Successfully Change-Id: I5be07dac3f5eb196717474ac8a1f2e3b1e2556d5 --- include/hardware_legacy/link_layer_stats.h | 8 ++++---- include/hardware_legacy/rtt.h | 8 ++++++-- include/hardware_legacy/wifi_hal.h | 3 ++- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/include/hardware_legacy/link_layer_stats.h b/include/hardware_legacy/link_layer_stats.h index 9b67f6d..bac84e1 100644 --- a/include/hardware_legacy/link_layer_stats.h +++ b/include/hardware_legacy/link_layer_stats.h @@ -61,7 +61,7 @@ typedef struct { /* channel information */ typedef struct { - wifi_channel_width width; // channel width (20, 40, 80, 80+80, 160) + wifi_channel_width width; // channel width (20, 40, 80, 80+80, 160, 320) wifi_channel center_freq; // primary 20 MHz channel wifi_channel center_freq0; // center frequency (MHz) first segment wifi_channel center_freq1; // center frequency (MHz) second segment @@ -69,11 +69,11 @@ typedef struct { /* wifi rate */ typedef struct { - u32 preamble :3; // 0: OFDM, 1:CCK, 2:HT 3:VHT 4:HE 5..7 reserved + u32 preamble :3; // 0: OFDM, 1:CCK, 2:HT 3:VHT 4:HE 5:EHT 6..7 reserved u32 nss :2; // 0:1x1, 1:2x2, 3:3x3, 4:4x4 - u32 bw :3; // 0:20MHz, 1:40Mhz, 2:80Mhz, 3:160Mhz + u32 bw :3; // 0:20MHz, 1:40Mhz, 2:80Mhz, 3:160Mhz 4:320Mhz u32 rateMcsIdx :8; // OFDM/CCK rate code would be as per ieee std in the units of 0.5mbps - // HT/VHT/HE it would be mcs index + // HT/VHT/HE/EHT it would be mcs index u32 reserved :16; // reserved u32 bitrate; // units of 100 Kbps } wifi_rate; diff --git a/include/hardware_legacy/rtt.h b/include/hardware_legacy/rtt.h index 5084bec..4ef7770 100644 --- a/include/hardware_legacy/rtt.h +++ b/include/hardware_legacy/rtt.h @@ -43,7 +43,8 @@ typedef enum { WIFI_RTT_BW_20 = 0x04, WIFI_RTT_BW_40 = 0x08, WIFI_RTT_BW_80 = 0x10, - WIFI_RTT_BW_160 = 0x20 + WIFI_RTT_BW_160 = 0x20, + WIFI_RTT_BW_320 = 0x40 } wifi_rtt_bw; /* RTT Measurement Preamble */ @@ -51,7 +52,8 @@ typedef enum { WIFI_RTT_PREAMBLE_LEGACY = 0x1, WIFI_RTT_PREAMBLE_HT = 0x2, WIFI_RTT_PREAMBLE_VHT = 0x4, - WIFI_RTT_PREAMBLE_HE = 0x8 + WIFI_RTT_PREAMBLE_HE = 0x8, + WIFI_RTT_PREAMBLE_EHT = 0x10, } wifi_rtt_preamble; /* RTT Type */ @@ -186,6 +188,7 @@ wifi_error wifi_rtt_channel_map_clear(wifi_request_id id, wifi_interface_handle #define PREAMBLE_HT 0x2 #define PREAMBLE_VHT 0x4 #define PREAMBLE_HE 0x8 +#define PREAMBLE_EHT 0x10 // BW definition for bit mask used in wifi_rtt_capabilities #define BW_5_SUPPORT 0x1 @@ -194,6 +197,7 @@ wifi_error wifi_rtt_channel_map_clear(wifi_request_id id, wifi_interface_handle #define BW_40_SUPPORT 0x8 #define BW_80_SUPPORT 0x10 #define BW_160_SUPPORT 0x20 +#define BW_320_SUPPORT 0x40 /* RTT Capabilities */ typedef struct { diff --git a/include/hardware_legacy/wifi_hal.h b/include/hardware_legacy/wifi_hal.h index b91dae3..6b8f5f6 100644 --- a/include/hardware_legacy/wifi_hal.h +++ b/include/hardware_legacy/wifi_hal.h @@ -60,6 +60,7 @@ typedef enum { WIFI_CHAN_WIDTH_80P80 = 4, WIFI_CHAN_WIDTH_5 = 5, WIFI_CHAN_WIDTH_10 = 6, + WIFI_CHAN_WIDTH_320 = 7, WIFI_CHAN_WIDTH_INVALID = -1 } wifi_channel_width; @@ -154,7 +155,7 @@ typedef struct { typedef struct { /* Channel frequency in MHz */ wifi_channel freq; - /* Channel operating width (20, 40, 80, 160 etc.) */ + /* Channel operating width (20, 40, 80, 160, 320 etc.) */ wifi_channel_width width; /* BIT MASK of BIT(WIFI_INTERFACE_*) represented by |wifi_interface_mode| * Bitmask does not represent concurrency. From 8ec08d0216fdd3d07aafcd1906d0b03d4155e77e Mon Sep 17 00:00:00 2001 From: Sunil Ravi Date: Mon, 24 Jan 2022 18:04:04 -0800 Subject: [PATCH 07/10] Wifi: API to set the indoor state of device If set, it indicates that the device is operating in an indoor environment. When driver receives this indication, it can safely enable WFD GO operation on indoor channels. Bug: 207671411 Test: Manual basic wifi tests Change-Id: I970dd54f538ee85d76d702b1ce36432bad901602 --- include/hardware_legacy/wifi_hal.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/hardware_legacy/wifi_hal.h b/include/hardware_legacy/wifi_hal.h index 6b8f5f6..4b4a525 100644 --- a/include/hardware_legacy/wifi_hal.h +++ b/include/hardware_legacy/wifi_hal.h @@ -909,6 +909,16 @@ typedef struct { * Trigger wifi subsystem restart to reload firmware */ wifi_error (*wifi_trigger_subsystem_restart)(wifi_handle handle); + + /** + * Invoked to set that the device is operating in an indoor environment. + * @param handle global wifi_handle + * @param isIndoor: true if the device is operating in an indoor + * environment, false otherwise. + * @return Synchronous wifi_error + */ + wifi_error (*wifi_set_indoor_state)(wifi_handle handle, bool isIndoor); + /* * when adding new functions make sure to add stubs in * hal_tool.cpp::init_wifi_stub_hal_func_table From 3f3737abcd3d1ec216146ae6bf0d3db35e225126 Mon Sep 17 00:00:00 2001 From: Sunil Ravi Date: Wed, 12 Jan 2022 08:22:02 -0800 Subject: [PATCH 08/10] wifi: Get the supported radio combinations matrix Added API to get the supported radio combinations of the chip. This is mainly to check if the chip is capable of multi band simultaneous operation. For Example in case of a chip which has two radios, where one radio is capable of 2.4GHz 2X2 only and another radio which is capable of either 5GHz or 6GHz 2X2, number of possible radio combinations in this case are 5 and possible combinations are {{{2G 2X2}}, //Standalone 2G {{5G 2X2}}, //Standalone 5G {{6G 2X2}}, //Standalone 6G {{2G 2X2}, {5G 2X2}}, //2G+5G DBS {{2G 2X2}, {6G 2X2}}} //2G+6G DBS Bug: 208877624 Test: unit test Change-Id: I4c90f80002ca138133a575bca80dfdef2a593ab2 --- include/hardware_legacy/wifi_hal.h | 57 ++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/include/hardware_legacy/wifi_hal.h b/include/hardware_legacy/wifi_hal.h index 4b4a525..533b97b 100644 --- a/include/hardware_legacy/wifi_hal.h +++ b/include/hardware_legacy/wifi_hal.h @@ -225,6 +225,50 @@ typedef enum { WIFI_ACCESS_CATEGORY_VOICE = 3 } wifi_access_category; +/* Antenna configuration */ +typedef enum { + WIFI_ANTENNA_UNSPECIFIED = 0, + WIFI_ANTENNA_1X1 = 1, + WIFI_ANTENNA_2X2 = 2, + WIFI_ANTENNA_3X3 = 3, + WIFI_ANTENNA_4X4 = 4, +} wifi_antenna_configuration; + +/* Wifi Radio configuration */ +typedef struct { + /* Operating band */ + wlan_mac_band band; + /* Antenna configuration */ + wifi_antenna_configuration antenna_cfg; +} wifi_radio_configuration; + +/* WiFi Radio Combination */ +typedef struct { + u32 num_radio_configurations; + wifi_radio_configuration radio_configurations[]; +} wifi_radio_combination; + +/* WiFi Radio combinations matrix */ +/* For Example in case of a chip which has two radios, where one radio is + * capable of 2.4GHz 2X2 only and another radio which is capable of either + * 5GHz or 6GHz 2X2, number of possible radio combinations in this case + * are 5 and possible combinations are + * {{{2G 2X2}}, //Standalone 2G + * {{5G 2X2}}, //Standalone 5G + * {{6G 2X2}}, //Standalone 6G + * {{2G 2X2}, {5G 2X2}}, //2G+5G DBS + * {{2G 2X2}, {6G 2X2}}} //2G+6G DBS + * Note: Since this chip doesn’t support 5G+6G simultaneous operation + * as there is only one radio which can support both, So it can only + * do MCC 5G+6G. This table should not get populated with possible MCC + * configurations. This is only for simultaneous radio configurations + * (such as Standalone, multi band simultaneous or single band simultaneous). + */ +typedef struct { + u32 num_radio_combinations; + /* Each row represents possible radio combinations */ + wifi_radio_combination radio_combinations[]; +} wifi_radio_combination_matrix; /* Initialize/Cleanup */ @@ -919,6 +963,19 @@ typedef struct { */ wifi_error (*wifi_set_indoor_state)(wifi_handle handle, bool isIndoor); + /**@brief wifi_get_supported_radio_combinations_matrix + * Request all the possible radio combinations this device can offer. + * @param handle global wifi_handle + * @param max_size maximum size allocated for filling the wifi_radio_combination_matrix + * @param wifi_radio_combination_matrix to return all the possible radio + * combinations. + * @param size actual size of wifi_radio_combination_matrix returned from + * lower layer + * + */ + wifi_error (*wifi_get_supported_radio_combinations_matrix)( + wifi_handle handle, u32 max_size, u32 *size, + wifi_radio_combination_matrix *radio_combination_matrix); /* * when adding new functions make sure to add stubs in * hal_tool.cpp::init_wifi_stub_hal_func_table From e1aad8d6ec74040117d88a8ceb0c33b427c3af5b Mon Sep 17 00:00:00 2001 From: Isaac Chiou Date: Mon, 3 Jan 2022 17:55:24 +0800 Subject: [PATCH 09/10] Add HAL APIs and configurations for CHRE NAN RTT Add HAL APIs and configuration in wifi_hal.h. Test: Build pass Test: New APIs work fine. Bug: 206614765 Change-Id: I30681a580f1751518a30c258524a9b6216aab705 --- include/hardware_legacy/wifi_hal.h | 40 ++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/include/hardware_legacy/wifi_hal.h b/include/hardware_legacy/wifi_hal.h index 533b97b..45b9fa1 100644 --- a/include/hardware_legacy/wifi_hal.h +++ b/include/hardware_legacy/wifi_hal.h @@ -141,6 +141,13 @@ typedef enum { WLAN_MAC_60_0_BAND = 1 << 3, } wlan_mac_band; +/* List of chre nan rtt state */ +typedef enum { + CHRE_PREEMPTED = 0, + CHRE_UNAVAILABLE = 1, + CHRE_AVAILABLE = 2, +} chre_nan_rtt_state; + typedef struct { wifi_channel_width width; int center_frequency0; @@ -445,6 +452,10 @@ typedef struct { void (*on_subsystem_restart)(const char* error); } wifi_subsystem_restart_handler; +typedef struct { + void (*on_chre_nan_rtt_change)(chre_nan_rtt_state state); +} wifi_chre_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); @@ -976,6 +987,35 @@ typedef struct { wifi_error (*wifi_get_supported_radio_combinations_matrix)( wifi_handle handle, u32 max_size, u32 *size, wifi_radio_combination_matrix *radio_combination_matrix); + + /**@brief wifi_nan_rtt_chre_enable_request + * Request to enable CHRE NAN RTT + * @param transaction_id: NAN transaction id + * @param wifi_interface_handle + * @param NanEnableRequest request message + * @return Synchronous wifi_error + */ + wifi_error (*wifi_nan_rtt_chre_enable_request)(transaction_id id, + wifi_interface_handle iface, + NanEnableRequest* msg); + + /**@brief wifi_nan_rtt_chre_disable_request + * Request to disable CHRE NAN RTT + * @param transaction_id: NAN transaction id + * @param wifi_interface_handle + * @return Synchronous wifi_error + */ + wifi_error (*wifi_nan_rtt_chre_disable_request)(transaction_id id, wifi_interface_handle iface); + + /**@brief wifi_chre_register_handler + * register a handler to get the state of CHR + * @param wifi_interface_handle + * @param wifi_chre_handler: callback function pointer + * @return Synchronous wifi_error + */ + wifi_error (*wifi_chre_register_handler)(wifi_interface_handle iface, + wifi_chre_handler handler); + /* * when adding new functions make sure to add stubs in * hal_tool.cpp::init_wifi_stub_hal_func_table From 4172a388c763bdad38c0223caefa416230860adc Mon Sep 17 00:00:00 2001 From: Isaac Chiou Date: Wed, 16 Mar 2022 18:50:49 +0800 Subject: [PATCH 10/10] Add HAL APIs and configurations for Tx power limits To lower the instantaneous battery current draw of WiFi, we provide a way to allow PowerManager to enable/disable Tx power limits. In this CL, we define an API in WiFi HAL, and can be referenced by Broadcom HAL. Bug: 215193418 Test: New APIs work fine Change-Id: I907687a4d71f48869617edc6e013639dfbccb851 --- include/hardware_legacy/wifi_hal.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/hardware_legacy/wifi_hal.h b/include/hardware_legacy/wifi_hal.h index 45b9fa1..952e894 100644 --- a/include/hardware_legacy/wifi_hal.h +++ b/include/hardware_legacy/wifi_hal.h @@ -1016,6 +1016,16 @@ typedef struct { wifi_error (*wifi_chre_register_handler)(wifi_interface_handle iface, wifi_chre_handler handler); + /**@brief wifi_enable_tx_power_limits + * Enable WiFi Tx power limis + * @param wifi_interface_handle + * @param isEnable : If enable TX limit or not + * @return Synchronous wifi_error + */ + wifi_error (*wifi_enable_tx_power_limits) (wifi_interface_handle iface, + bool isEnable); + + /* * when adding new functions make sure to add stubs in * hal_tool.cpp::init_wifi_stub_hal_func_table