mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 11:36:00 +00:00
Modify based on the vendor feedback
- Add end pairing request method - Handle bootstrapping comeback event - Add cipher type in the pairing request Bug: 265075699 Test: cts sinlgeDeviceTest Change-Id: Ic744b0a1098e258b68caba5a9a33b2bef3226b40
This commit is contained in:
@@ -56,6 +56,7 @@ interface IWifiNanIface {
|
||||
void respondToPairingIndicationRequest(in char cmdId, in android.hardware.wifi.NanRespondToPairingIndicationRequest msg);
|
||||
void initiateBootstrappingRequest(in char cmdId, in android.hardware.wifi.NanBootstrappingRequest msg);
|
||||
void respondToBootstrappingIndicationRequest(in char cmdId, in android.hardware.wifi.NanBootstrappingResponse msg);
|
||||
void terminatePairingRequest(in char cmdId, in int pairingInstanceId);
|
||||
const int MIN_DATA_PATH_CONFIG_PASSPHRASE_LENGTH = 8;
|
||||
const int MAX_DATA_PATH_CONFIG_PASSPHRASE_LENGTH = 63;
|
||||
}
|
||||
|
||||
@@ -70,4 +70,5 @@ interface IWifiNanIfaceEventCallback {
|
||||
oneway void eventBootstrappingConfirm(in android.hardware.wifi.NanBootstrappingConfirmInd event);
|
||||
oneway void notifyInitiateBootstrappingResponse(in char id, in android.hardware.wifi.NanStatus status, in int bootstrappingInstanceId);
|
||||
oneway void notifyRespondToBootstrappingIndicationResponse(in char id, in android.hardware.wifi.NanStatus status);
|
||||
oneway void notifyTerminatePairingResponse(in char id, in android.hardware.wifi.NanStatus status);
|
||||
}
|
||||
|
||||
@@ -64,20 +64,20 @@ interface IWifiStaIface {
|
||||
void setDtimMultiplier(in int multiplier);
|
||||
@Backing(type="int") @VintfStability
|
||||
enum StaIfaceCapabilityMask {
|
||||
APF = (1 << 0),
|
||||
BACKGROUND_SCAN = (1 << 1),
|
||||
LINK_LAYER_STATS = (1 << 2),
|
||||
RSSI_MONITOR = (1 << 3),
|
||||
CONTROL_ROAMING = (1 << 4),
|
||||
PROBE_IE_ALLOWLIST = (1 << 5),
|
||||
SCAN_RAND = (1 << 6),
|
||||
STA_5G = (1 << 7),
|
||||
HOTSPOT = (1 << 8),
|
||||
PNO = (1 << 9),
|
||||
TDLS = (1 << 10),
|
||||
TDLS_OFFCHANNEL = (1 << 11),
|
||||
ND_OFFLOAD = (1 << 12),
|
||||
KEEP_ALIVE = (1 << 13),
|
||||
DEBUG_PACKET_FATE = (1 << 14),
|
||||
APF = (1 << 0) /* 1 */,
|
||||
BACKGROUND_SCAN = (1 << 1) /* 2 */,
|
||||
LINK_LAYER_STATS = (1 << 2) /* 4 */,
|
||||
RSSI_MONITOR = (1 << 3) /* 8 */,
|
||||
CONTROL_ROAMING = (1 << 4) /* 16 */,
|
||||
PROBE_IE_ALLOWLIST = (1 << 5) /* 32 */,
|
||||
SCAN_RAND = (1 << 6) /* 64 */,
|
||||
STA_5G = (1 << 7) /* 128 */,
|
||||
HOTSPOT = (1 << 8) /* 256 */,
|
||||
PNO = (1 << 9) /* 512 */,
|
||||
TDLS = (1 << 10) /* 1024 */,
|
||||
TDLS_OFFCHANNEL = (1 << 11) /* 2048 */,
|
||||
ND_OFFLOAD = (1 << 12) /* 4096 */,
|
||||
KEEP_ALIVE = (1 << 13) /* 8192 */,
|
||||
DEBUG_PACKET_FATE = (1 << 14) /* 16384 */,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,6 +35,8 @@ package android.hardware.wifi;
|
||||
@VintfStability
|
||||
parcelable NanBootstrappingConfirmInd {
|
||||
int bootstrappingInstanceId;
|
||||
boolean acceptRequest;
|
||||
android.hardware.wifi.NanBootstrappingResponseCode responseCode;
|
||||
android.hardware.wifi.NanStatus reasonCode;
|
||||
int comeBackDelay;
|
||||
byte[] cookie;
|
||||
}
|
||||
|
||||
@@ -34,15 +34,15 @@
|
||||
package android.hardware.wifi;
|
||||
@Backing(type="int") @VintfStability
|
||||
enum NanBootstrappingMethod {
|
||||
BOOTSTRAPPING_OPPORTUNISTIC_MASK = (1 << 0),
|
||||
BOOTSTRAPPING_PIN_CODE_DISPLAY_MASK = (1 << 1),
|
||||
BOOTSTRAPPING_PASSPHRASE_DISPLAY_MASK = (1 << 2),
|
||||
BOOTSTRAPPING_QR_DISPLAY_MASK = (1 << 3),
|
||||
BOOTSTRAPPING_NFC_TAG_MASK = (1 << 4),
|
||||
BOOTSTRAPPING_PIN_CODE_KEYPAD_MASK = (1 << 5),
|
||||
BOOTSTRAPPING_PASSPHRASE_KEYPAD_MASK = (1 << 6),
|
||||
BOOTSTRAPPING_QR_SCAN_MASK = (1 << 7),
|
||||
BOOTSTRAPPING_NFC_READER_MASK = (1 << 8),
|
||||
BOOTSTRAPPING_SERVICE_MANAGED_MASK = (1 << 14),
|
||||
BOOTSTRAPPING_HANDSHAKE_SHIP_MASK = (1 << 15),
|
||||
BOOTSTRAPPING_OPPORTUNISTIC_MASK = (1 << 0) /* 1 */,
|
||||
BOOTSTRAPPING_PIN_CODE_DISPLAY_MASK = (1 << 1) /* 2 */,
|
||||
BOOTSTRAPPING_PASSPHRASE_DISPLAY_MASK = (1 << 2) /* 4 */,
|
||||
BOOTSTRAPPING_QR_DISPLAY_MASK = (1 << 3) /* 8 */,
|
||||
BOOTSTRAPPING_NFC_TAG_MASK = (1 << 4) /* 16 */,
|
||||
BOOTSTRAPPING_PIN_CODE_KEYPAD_MASK = (1 << 5) /* 32 */,
|
||||
BOOTSTRAPPING_PASSPHRASE_KEYPAD_MASK = (1 << 6) /* 64 */,
|
||||
BOOTSTRAPPING_QR_SCAN_MASK = (1 << 7) /* 128 */,
|
||||
BOOTSTRAPPING_NFC_READER_MASK = (1 << 8) /* 256 */,
|
||||
BOOTSTRAPPING_SERVICE_MANAGED_MASK = (1 << 14) /* 16384 */,
|
||||
BOOTSTRAPPING_HANDSHAKE_SHIP_MASK = (1 << 15) /* 32768 */,
|
||||
}
|
||||
|
||||
@@ -37,4 +37,5 @@ parcelable NanBootstrappingRequest {
|
||||
int peerId;
|
||||
byte[6] peerDiscMacAddr;
|
||||
android.hardware.wifi.NanBootstrappingMethod requestBootstrappingMethod;
|
||||
byte[] cookie;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
* Copyright (C) 2023 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// This file is a snapshot of an AIDL file. Do not edit it manually. There are
|
||||
// two cases:
|
||||
// 1). this is a frozen version file - do not edit this in any case.
|
||||
// 2). this is a 'current' file. If you make a backwards compatible change to
|
||||
// the interface (from the latest frozen version), the build system will
|
||||
// prompt you to update this file with `m <name>-update-api`.
|
||||
//
|
||||
// You must not make a backward incompatible change to any AIDL file built
|
||||
// with the aidl_interface module type with versions property set. The module
|
||||
// type is used to build AIDL files in a way that they can be used across
|
||||
// independently updatable components of the system. If a device is shipped
|
||||
// with such a backward incompatible change, it has a high risk of breaking
|
||||
// later when a module using the interface is updated, e.g., Mainline modules.
|
||||
|
||||
package android.hardware.wifi;
|
||||
@Backing(type="int") @VintfStability
|
||||
enum NanBootstrappingResponseCode {
|
||||
NAN_BOOTSTRAPPING_REQUEST_ACCEPT = 0,
|
||||
NAN_BOOTSTRAPPING_REQUEST_REJECT,
|
||||
NAN_BOOTSTRAPPING_REQUEST_COMEBACK,
|
||||
}
|
||||
@@ -35,8 +35,10 @@ package android.hardware.wifi;
|
||||
@Backing(type="int") @VintfStability
|
||||
enum NanCipherSuiteType {
|
||||
NONE = 0,
|
||||
SHARED_KEY_128_MASK = (1 << 0),
|
||||
SHARED_KEY_256_MASK = (1 << 1),
|
||||
PUBLIC_KEY_128_MASK = (1 << 2),
|
||||
PUBLIC_KEY_256_MASK = (1 << 3),
|
||||
SHARED_KEY_128_MASK = (1 << 0) /* 1 */,
|
||||
SHARED_KEY_256_MASK = (1 << 1) /* 2 */,
|
||||
PUBLIC_KEY_2WDH_128_MASK = (1 << 2) /* 4 */,
|
||||
PUBLIC_KEY_2WDH_256_MASK = (1 << 3) /* 8 */,
|
||||
PUBLIC_KEY_PASN_128_MASK = (1 << 4) /* 16 */,
|
||||
PUBLIC_KEY_PASN_256_MASK = (1 << 5) /* 32 */,
|
||||
}
|
||||
|
||||
@@ -38,4 +38,5 @@ parcelable NanPairingSecurityConfig {
|
||||
byte[32] pmk;
|
||||
byte[] passphrase;
|
||||
android.hardware.wifi.NanPairingAkm akm;
|
||||
android.hardware.wifi.NanCipherSuiteType cipherType;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
package android.hardware.wifi;
|
||||
@Backing(type="int") @VintfStability
|
||||
enum NanRangingIndication {
|
||||
CONTINUOUS_INDICATION_MASK = (1 << 0),
|
||||
INGRESS_MET_MASK = (1 << 1),
|
||||
EGRESS_MET_MASK = (1 << 2),
|
||||
CONTINUOUS_INDICATION_MASK = (1 << 0) /* 1 */,
|
||||
INGRESS_MET_MASK = (1 << 1) /* 2 */,
|
||||
EGRESS_MET_MASK = (1 << 2) /* 4 */,
|
||||
}
|
||||
|
||||
@@ -38,4 +38,5 @@ parcelable NpkSecurityAssociation {
|
||||
byte[16] localNanIdentityKey;
|
||||
byte[32] npk;
|
||||
android.hardware.wifi.NanPairingAkm akm;
|
||||
android.hardware.wifi.NanCipherSuiteType cipherType;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
package android.hardware.wifi;
|
||||
@Backing(type="int") @VintfStability
|
||||
enum StaBackgroundScanBucketEventReportSchemeMask {
|
||||
EACH_SCAN = (1 << 0),
|
||||
FULL_RESULTS = (1 << 1),
|
||||
NO_BATCH = (1 << 2),
|
||||
EACH_SCAN = (1 << 0) /* 1 */,
|
||||
FULL_RESULTS = (1 << 1) /* 2 */,
|
||||
NO_BATCH = (1 << 2) /* 4 */,
|
||||
}
|
||||
|
||||
@@ -34,5 +34,5 @@
|
||||
package android.hardware.wifi;
|
||||
@Backing(type="int") @VintfStability
|
||||
enum StaScanDataFlagMask {
|
||||
INTERRUPTED = (1 << 0),
|
||||
INTERRUPTED = (1 << 0) /* 1 */,
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
package android.hardware.wifi;
|
||||
@Backing(type="int") @VintfStability
|
||||
enum WifiChannelWidthInMhz {
|
||||
WIDTH_INVALID = (-1),
|
||||
WIDTH_INVALID = (-1) /* -1 */,
|
||||
WIDTH_20 = 0,
|
||||
WIDTH_40 = 1,
|
||||
WIDTH_80 = 2,
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
package android.hardware.wifi;
|
||||
@Backing(type="int") @VintfStability
|
||||
enum WifiDebugRingBufferFlags {
|
||||
HAS_BINARY_ENTRIES = (1 << 0),
|
||||
HAS_ASCII_ENTRIES = (1 << 1),
|
||||
HAS_PER_PACKET_ENTRIES = (1 << 2),
|
||||
HAS_BINARY_ENTRIES = (1 << 0) /* 1 */,
|
||||
HAS_ASCII_ENTRIES = (1 << 1) /* 2 */,
|
||||
HAS_PER_PACKET_ENTRIES = (1 << 2) /* 4 */,
|
||||
}
|
||||
|
||||
@@ -34,12 +34,12 @@
|
||||
package android.hardware.wifi;
|
||||
@Backing(type="int") @VintfStability
|
||||
enum WifiIfaceMode {
|
||||
IFACE_MODE_STA = (1 << 0),
|
||||
IFACE_MODE_SOFTAP = (1 << 1),
|
||||
IFACE_MODE_IBSS = (1 << 2),
|
||||
IFACE_MODE_P2P_CLIENT = (1 << 3),
|
||||
IFACE_MODE_P2P_GO = (1 << 4),
|
||||
IFACE_MODE_NAN = (1 << 5),
|
||||
IFACE_MODE_MESH = (1 << 6),
|
||||
IFACE_MODE_TDLS = (1 << 7),
|
||||
IFACE_MODE_STA = (1 << 0) /* 1 */,
|
||||
IFACE_MODE_SOFTAP = (1 << 1) /* 2 */,
|
||||
IFACE_MODE_IBSS = (1 << 2) /* 4 */,
|
||||
IFACE_MODE_P2P_CLIENT = (1 << 3) /* 8 */,
|
||||
IFACE_MODE_P2P_GO = (1 << 4) /* 16 */,
|
||||
IFACE_MODE_NAN = (1 << 5) /* 32 */,
|
||||
IFACE_MODE_MESH = (1 << 6) /* 64 */,
|
||||
IFACE_MODE_TDLS = (1 << 7) /* 128 */,
|
||||
}
|
||||
|
||||
@@ -336,4 +336,16 @@ interface IWifiNanIface {
|
||||
* |WifiStatusCode.ERROR_UNKNOWN|
|
||||
*/
|
||||
void respondToBootstrappingIndicationRequest(in char cmdId, in NanBootstrappingResponse msg);
|
||||
|
||||
/**
|
||||
* Aware pairing termination request. Executed by either the Initiator or Responder.
|
||||
* Asynchronous response is with |IWifiNanIfaceEventCallback.notifyTerminatePairingResponse|.
|
||||
*
|
||||
* @param cmdId Command Id to use for this invocation.
|
||||
* @param pairingInstanceId Pairing instance ID to be terminated.
|
||||
* @throws ServiceSpecificException with one of the following values:
|
||||
* |WifiStatusCode.ERROR_WIFI_IFACE_INVALID|,
|
||||
* |WifiStatusCode.ERROR_UNKNOWN|
|
||||
*/
|
||||
void terminatePairingRequest(in char cmdId, in int pairingInstanceId);
|
||||
}
|
||||
|
||||
@@ -440,4 +440,18 @@ oneway interface IWifiNanIfaceEventCallback {
|
||||
* |NanStatusCode.INVALID_NDP_ID|
|
||||
*/
|
||||
void notifyRespondToBootstrappingIndicationResponse(in char id, in NanStatus status);
|
||||
|
||||
/**
|
||||
* Callback invoked in response to a terminate pairing request
|
||||
* |IWifiNanIface.terminatePairingRequest|.
|
||||
*
|
||||
* @param id Command Id corresponding to the original request.
|
||||
* @param status NanStatus of the operation. Possible status codes are:
|
||||
* |NanStatusCode.SUCCESS|
|
||||
* |NanStatusCode.INVALID_ARGS|
|
||||
* |NanStatusCode.INTERNAL_FAILURE|
|
||||
* |NanStatusCode.PROTOCOL_FAILURE|
|
||||
* |NanStatusCode.INVALID_PAIRING_ID|
|
||||
*/
|
||||
void notifyTerminatePairingResponse(in char id, in NanStatus status);
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
package android.hardware.wifi;
|
||||
|
||||
import android.hardware.wifi.NanBootstrappingMethod;
|
||||
import android.hardware.wifi.NanBootstrappingResponseCode;
|
||||
import android.hardware.wifi.NanStatus;
|
||||
|
||||
@VintfStability
|
||||
@@ -30,10 +31,20 @@ parcelable NanBootstrappingConfirmInd {
|
||||
/**
|
||||
* Indicate whether the bootstrapping method negotiation accept or not
|
||||
*/
|
||||
boolean acceptRequest;
|
||||
NanBootstrappingResponseCode responseCode;
|
||||
|
||||
/**
|
||||
* Failure reason if |acceptRequest| is false.
|
||||
*/
|
||||
NanStatus reasonCode;
|
||||
|
||||
/**
|
||||
* The delay of bootstrapping in seconds for the follow up request.
|
||||
*/
|
||||
int comeBackDelay;
|
||||
|
||||
/**
|
||||
* Cookie received from the comeback response.
|
||||
*/
|
||||
byte[] cookie;
|
||||
}
|
||||
|
||||
@@ -37,4 +37,9 @@ parcelable NanBootstrappingRequest {
|
||||
* Bootstrapping method in the request, one of the |NanBootstrappingMethod|
|
||||
*/
|
||||
NanBootstrappingMethod requestBootstrappingMethod;
|
||||
|
||||
/**
|
||||
* Cookie for the follow up request
|
||||
*/
|
||||
byte[] cookie;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright (C) 2023 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package android.hardware.wifi;
|
||||
|
||||
/**
|
||||
* Response code from peer NAN Bootstrapping request
|
||||
*/
|
||||
@VintfStability
|
||||
@Backing(type="int")
|
||||
enum NanBootstrappingResponseCode {
|
||||
NAN_BOOTSTRAPPING_REQUEST_ACCEPT = 0,
|
||||
NAN_BOOTSTRAPPING_REQUEST_REJECT,
|
||||
NAN_BOOTSTRAPPING_REQUEST_COMEBACK,
|
||||
}
|
||||
@@ -17,7 +17,7 @@
|
||||
package android.hardware.wifi;
|
||||
|
||||
/**
|
||||
* Cipher suite flags.
|
||||
* Cipher suite flags. Wi-Fi Aware Specification 4.0 section 7.1.2
|
||||
*/
|
||||
@VintfStability
|
||||
@Backing(type="int")
|
||||
@@ -26,11 +26,19 @@ enum NanCipherSuiteType {
|
||||
SHARED_KEY_128_MASK = 1 << 0,
|
||||
SHARED_KEY_256_MASK = 1 << 1,
|
||||
/**
|
||||
* NCS-PK-128
|
||||
* NCS-PK-2WDH-128
|
||||
*/
|
||||
PUBLIC_KEY_128_MASK = 1 << 2,
|
||||
PUBLIC_KEY_2WDH_128_MASK = 1 << 2,
|
||||
/**
|
||||
* NCS-PK-256
|
||||
* NCS-PK-2WDH-256
|
||||
*/
|
||||
PUBLIC_KEY_256_MASK = 1 << 3,
|
||||
PUBLIC_KEY_2WDH_256_MASK = 1 << 3,
|
||||
/**
|
||||
* NCS-PK-PASN-128
|
||||
*/
|
||||
PUBLIC_KEY_PASN_128_MASK = 1 << 4,
|
||||
/**
|
||||
* NCS-PK-PASN-256
|
||||
*/
|
||||
PUBLIC_KEY_PASN_256_MASK = 1 << 5,
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package android.hardware.wifi;
|
||||
|
||||
import android.hardware.wifi.NanCipherSuiteType;
|
||||
import android.hardware.wifi.NanPairingAkm;
|
||||
import android.hardware.wifi.NanPairingSecurityType;
|
||||
|
||||
@@ -47,4 +48,9 @@ parcelable NanPairingSecurityConfig {
|
||||
* The AKM for key exchange
|
||||
*/
|
||||
NanPairingAkm akm;
|
||||
/**
|
||||
* Cipher type for pairing. Need to be one of the |NanCipherSuiteType.PUBLIC_KEY_PASN_128_MASK|
|
||||
* or |NanCipherSuiteType.PUBLIC_KEY_PASN_256_MASK|
|
||||
*/
|
||||
NanCipherSuiteType cipherType;
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package android.hardware.wifi;
|
||||
|
||||
import android.hardware.wifi.NanCipherSuiteType;
|
||||
import android.hardware.wifi.NanPairingAkm;
|
||||
|
||||
/**
|
||||
@@ -39,4 +40,9 @@ parcelable NpkSecurityAssociation {
|
||||
* The AKM is used for key exchange in this security sssociation
|
||||
*/
|
||||
NanPairingAkm akm;
|
||||
/**
|
||||
* Cipher type for pairing. Need to one of the |NanCipherSuiteType.PUBLIC_KEY_PASN_128_MASK| or
|
||||
* |NanCipherSuiteType.PUBLIC_KEY_PASN_256_MASK|
|
||||
*/
|
||||
NanCipherSuiteType cipherType;
|
||||
}
|
||||
|
||||
@@ -1250,7 +1250,7 @@ NanPairingRequestType convertLegacyNanPairingRequestTypeToAidl(
|
||||
LOG(FATAL);
|
||||
}
|
||||
|
||||
legacy_hal::Akm convertAidlAkmTypeToLegacy(NanPairingAkm type) {
|
||||
legacy_hal::NanAkm convertAidlAkmTypeToLegacy(NanPairingAkm type) {
|
||||
switch (type) {
|
||||
case NanPairingAkm::SAE:
|
||||
return legacy_hal::SAE;
|
||||
@@ -1260,7 +1260,7 @@ legacy_hal::Akm convertAidlAkmTypeToLegacy(NanPairingAkm type) {
|
||||
LOG(FATAL);
|
||||
}
|
||||
|
||||
NanPairingAkm convertLegacyAkmTypeToAidl(legacy_hal::Akm type) {
|
||||
NanPairingAkm convertLegacyAkmTypeToAidl(legacy_hal::NanAkm type) {
|
||||
switch (type) {
|
||||
case legacy_hal::SAE:
|
||||
return NanPairingAkm::SAE;
|
||||
@@ -1384,6 +1384,7 @@ bool convertLegacyNpsaToAidl(const legacy_hal::NpkSecurityAssociation& legacy_np
|
||||
aidl_npsa->npk = std::array<uint8_t, 32>();
|
||||
std::copy(legacy_npsa.npk.pmk, legacy_npsa.npk.pmk + 32, std::begin(aidl_npsa->npk));
|
||||
aidl_npsa->akm = convertLegacyAkmTypeToAidl(legacy_npsa.akm);
|
||||
aidl_npsa->cipherType = (NanCipherSuiteType)legacy_npsa.cipher_type;
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -3070,6 +3071,7 @@ bool convertAidlNanPairingInitiatorRequestToLegacy(const NanPairingRequest& aidl
|
||||
aidl_request.securityConfig.securityType == NanPairingSecurityType::OPPORTUNISTIC ? 1
|
||||
: 0;
|
||||
legacy_request->akm = convertAidlAkmTypeToLegacy(aidl_request.securityConfig.akm);
|
||||
legacy_request->cipher_type = (unsigned int)aidl_request.securityConfig.cipherType;
|
||||
if (aidl_request.securityConfig.securityType == NanPairingSecurityType::PMK) {
|
||||
legacy_request->key_info.key_type = legacy_hal::NAN_SECURITY_KEY_INPUT_PMK;
|
||||
legacy_request->key_info.body.pmk_info.pmk_len = aidl_request.securityConfig.pmk.size();
|
||||
@@ -3127,6 +3129,7 @@ bool convertAidlNanPairingIndicationResponseToLegacy(
|
||||
aidl_request.securityConfig.securityType == NanPairingSecurityType::OPPORTUNISTIC ? 1
|
||||
: 0;
|
||||
legacy_request->akm = convertAidlAkmTypeToLegacy(aidl_request.securityConfig.akm);
|
||||
legacy_request->cipher_type = (unsigned int)aidl_request.securityConfig.cipherType;
|
||||
legacy_request->rsp_code =
|
||||
aidl_request.acceptRequest ? NAN_PAIRING_REQUEST_ACCEPT : NAN_PAIRING_REQUEST_REJECT;
|
||||
if (aidl_request.securityConfig.securityType == NanPairingSecurityType::PMK) {
|
||||
@@ -3178,6 +3181,9 @@ bool convertAidlNanBootstrappingInitiatorRequestToLegacy(
|
||||
memcpy(legacy_request->peer_disc_mac_addr, aidl_request.peerDiscMacAddr.data(), 6);
|
||||
legacy_request->request_bootstrapping_method =
|
||||
convertAidlBootstrappingMethodToLegacy(aidl_request.requestBootstrappingMethod);
|
||||
legacy_request->cookie_length = aidl_request.cookie.size();
|
||||
|
||||
memcpy(legacy_request->cookie, aidl_request.cookie.data(), legacy_request->cookie_length);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -3272,8 +3278,11 @@ bool convertLegacyNanBootstrappingConfirmIndToAidl(
|
||||
*aidl_ind = {};
|
||||
|
||||
aidl_ind->bootstrappingInstanceId = legacy_ind.bootstrapping_instance_id;
|
||||
aidl_ind->acceptRequest = legacy_ind.rsp_code == NAN_BOOTSTRAPPING_REQUEST_ACCEPT;
|
||||
aidl_ind->responseCode = static_cast<NanBootstrappingResponseCode>(legacy_ind.rsp_code);
|
||||
aidl_ind->reasonCode.status = convertLegacyNanStatusTypeToAidl(legacy_ind.reason_code);
|
||||
aidl_ind->comeBackDelay = legacy_ind.come_back_delay;
|
||||
aidl_ind->cookie =
|
||||
std::vector<uint8_t>(legacy_ind.cookie, legacy_ind.cookie + legacy_ind.cookie_length);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -136,6 +136,7 @@ class MockNanIfaceEventCallback : public IWifiNanIfaceEventCallback {
|
||||
ndk::ScopedAStatus(char16_t, const NanStatus&));
|
||||
MOCK_METHOD2(notifySuspendResponse, ndk::ScopedAStatus(char16_t, const NanStatus&));
|
||||
MOCK_METHOD2(notifyResumeResponse, ndk::ScopedAStatus(char16_t, const NanStatus&));
|
||||
MOCK_METHOD2(notifyTerminatePairingResponse, ndk::ScopedAStatus(char16_t, const NanStatus&));
|
||||
};
|
||||
|
||||
class WifiNanIfaceTest : public Test {
|
||||
|
||||
@@ -1559,6 +1559,15 @@ wifi_error WifiLegacyHal::nanDataEnd(const std::string& iface_name, transaction_
|
||||
return status;
|
||||
}
|
||||
|
||||
wifi_error WifiLegacyHal::nanPairingEnd(const std::string& iface_name, transaction_id id,
|
||||
uint32_t pairingId) {
|
||||
NanPairingEndRequest msg;
|
||||
msg.pairing_instance_id = pairingId;
|
||||
wifi_error status =
|
||||
global_func_table_.wifi_nan_pairing_end(id, getIfaceHandle(iface_name), &msg);
|
||||
return status;
|
||||
}
|
||||
|
||||
wifi_error WifiLegacyHal::nanSuspendRequest(const std::string& iface_name, transaction_id id,
|
||||
const NanSuspendRequest& msg) {
|
||||
NanSuspendRequest msg_internal(msg);
|
||||
|
||||
@@ -36,7 +36,6 @@ namespace wifi {
|
||||
namespace legacy_hal {
|
||||
// Import all the types defined inside the legacy HAL header files into this
|
||||
// namespace.
|
||||
using ::Akm;
|
||||
using ::chre_nan_rtt_state;
|
||||
using ::frame_info;
|
||||
using ::frame_type;
|
||||
@@ -68,6 +67,7 @@ using ::NAN_GET_CAPABILITIES;
|
||||
using ::NAN_MATCH_ALG_MATCH_CONTINUOUS;
|
||||
using ::NAN_MATCH_ALG_MATCH_NEVER;
|
||||
using ::NAN_MATCH_ALG_MATCH_ONCE;
|
||||
using ::NAN_PAIRING_END;
|
||||
using ::NAN_PAIRING_INITIATOR_RESPONSE;
|
||||
using ::NAN_PAIRING_RESPONDER_RESPONSE;
|
||||
using ::NAN_PAIRING_SETUP;
|
||||
@@ -125,6 +125,7 @@ using ::NAN_TX_PRIORITY_NORMAL;
|
||||
using ::NAN_TX_TYPE_BROADCAST;
|
||||
using ::NAN_TX_TYPE_UNICAST;
|
||||
using ::NAN_USE_SRF;
|
||||
using ::NanAkm;
|
||||
using ::NanBeaconSdfPayloadInd;
|
||||
using ::NanBootstrappingConfirmInd;
|
||||
using ::NanBootstrappingIndicationResponse;
|
||||
@@ -152,6 +153,7 @@ using ::NanMatchExpiredInd;
|
||||
using ::NanMatchInd;
|
||||
using ::NanPairingConfig;
|
||||
using ::NanPairingConfirmInd;
|
||||
using ::NanPairingEndRequest;
|
||||
using ::NanPairingIndicationResponse;
|
||||
using ::NanPairingRequest;
|
||||
using ::NanPairingRequestInd;
|
||||
@@ -703,6 +705,7 @@ class WifiLegacyHal {
|
||||
wifi_error nanBootstrappingIndicationResponse(const std::string& iface_name, transaction_id id,
|
||||
const NanBootstrappingIndicationResponse& msg);
|
||||
wifi_error nanDataEnd(const std::string& iface_name, transaction_id id, uint32_t ndpInstanceId);
|
||||
wifi_error nanPairingEnd(const std::string& iface_name, transaction_id id, uint32_t pairingId);
|
||||
wifi_error nanSuspendRequest(const std::string& iface_name, transaction_id id,
|
||||
const NanSuspendRequest& msg);
|
||||
wifi_error nanResumeRequest(const std::string& iface_name, transaction_id id,
|
||||
|
||||
@@ -131,6 +131,7 @@ bool initHalFuncTableWithStubs(wifi_hal_fn* hal_fn) {
|
||||
populateStubFor(&hal_fn->wifi_nan_bootstrapping_request);
|
||||
populateStubFor(&hal_fn->wifi_nan_bootstrapping_indication_response);
|
||||
populateStubFor(&hal_fn->wifi_nan_data_end);
|
||||
populateStubFor(&hal_fn->wifi_nan_pairing_end);
|
||||
populateStubFor(&hal_fn->wifi_get_packet_filter_capabilities);
|
||||
populateStubFor(&hal_fn->wifi_set_packet_filter);
|
||||
populateStubFor(&hal_fn->wifi_read_packet_filter);
|
||||
|
||||
@@ -224,6 +224,14 @@ void WifiNanIface::registerCallbackHandlers() {
|
||||
}
|
||||
break;
|
||||
}
|
||||
case legacy_hal::NAN_PAIRING_END: {
|
||||
for (const auto& callback : shared_ptr_this->getEventCallbacks()) {
|
||||
if (!callback->notifyTerminatePairingResponse(id, nanStatus).isOk()) {
|
||||
LOG(ERROR) << "Failed to invoke the callback";
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case legacy_hal::NAN_BOOTSTRAPPING_INITIATOR_RESPONSE: {
|
||||
for (const auto& callback : shared_ptr_this->getEventCallbacks()) {
|
||||
if (!callback->notifyInitiateBootstrappingResponse(
|
||||
@@ -743,6 +751,13 @@ ndk::ScopedAStatus WifiNanIface::respondToPairingIndicationRequest(
|
||||
in_msg);
|
||||
}
|
||||
|
||||
ndk::ScopedAStatus WifiNanIface::terminatePairingRequest(char16_t in_cmdId,
|
||||
int32_t in_ndpInstanceId) {
|
||||
return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
|
||||
&WifiNanIface::terminatePairingRequestInternal, in_cmdId,
|
||||
in_ndpInstanceId);
|
||||
}
|
||||
|
||||
ndk::ScopedAStatus WifiNanIface::initiateBootstrappingRequest(
|
||||
char16_t in_cmdId, const NanBootstrappingRequest& in_msg) {
|
||||
return validateAndCall(this, WifiStatusCode::ERROR_WIFI_IFACE_INVALID,
|
||||
@@ -919,6 +934,12 @@ ndk::ScopedAStatus WifiNanIface::respondToPairingIndicationRequestInternal(
|
||||
legacy_hal_.lock()->nanPairingIndicationResponse(ifname_, cmd_id, legacy_msg);
|
||||
return createWifiStatusFromLegacyError(legacy_status);
|
||||
}
|
||||
ndk::ScopedAStatus WifiNanIface::terminatePairingRequestInternal(char16_t cmd_id,
|
||||
int32_t ndpInstanceId) {
|
||||
legacy_hal::wifi_error legacy_status =
|
||||
legacy_hal_.lock()->nanPairingEnd(ifname_, cmd_id, ndpInstanceId);
|
||||
return createWifiStatusFromLegacyError(legacy_status);
|
||||
}
|
||||
ndk::ScopedAStatus WifiNanIface::initiateBootstrappingRequestInternal(
|
||||
char16_t cmd_id, const NanBootstrappingRequest& msg) {
|
||||
legacy_hal::NanBootstrappingRequest legacy_msg;
|
||||
|
||||
@@ -82,6 +82,7 @@ class WifiNanIface : public BnWifiNanIface {
|
||||
const NanPairingRequest& in_msg) override;
|
||||
ndk::ScopedAStatus respondToPairingIndicationRequest(
|
||||
char16_t in_cmdId, const NanRespondToPairingIndicationRequest& in_msg) override;
|
||||
ndk::ScopedAStatus terminatePairingRequest(char16_t in_cmdId, int32_t in_pairingId) override;
|
||||
ndk::ScopedAStatus initiateBootstrappingRequest(char16_t in_cmdId,
|
||||
const NanBootstrappingRequest& in_msg) override;
|
||||
ndk::ScopedAStatus respondToBootstrappingIndicationRequest(
|
||||
@@ -125,6 +126,7 @@ class WifiNanIface : public BnWifiNanIface {
|
||||
const NanPairingRequest& msg);
|
||||
ndk::ScopedAStatus respondToPairingIndicationRequestInternal(
|
||||
char16_t cmd_id, const NanRespondToPairingIndicationRequest& msg);
|
||||
ndk::ScopedAStatus terminatePairingRequestInternal(char16_t cmd_id, int32_t pairingId);
|
||||
ndk::ScopedAStatus initiateBootstrappingRequestInternal(char16_t cmd_id,
|
||||
const NanBootstrappingRequest& msg);
|
||||
ndk::ScopedAStatus respondToBootstrappingIndicationRequestInternal(
|
||||
|
||||
@@ -106,6 +106,7 @@ class WifiNanIfaceAidlTest : public testing::TestWithParam<std::string> {
|
||||
NOTIFY_RESPOND_TO_BOOTSTRAPPING_INDICATION_RESPONSE,
|
||||
NOTIFY_SUSPEND_RESPONSE,
|
||||
NOTIFY_RESUME_RESPONSE,
|
||||
NOTIFY_TERMINATE_PAIRING_RESPONSE,
|
||||
|
||||
EVENT_CLUSTER_EVENT,
|
||||
EVENT_DISABLED,
|
||||
@@ -416,6 +417,14 @@ class WifiNanIfaceAidlTest : public testing::TestWithParam<std::string> {
|
||||
parent_.notify();
|
||||
return ndk::ScopedAStatus::ok();
|
||||
}
|
||||
::ndk::ScopedAStatus notifyTerminatePairingResponse(char16_t id,
|
||||
const NanStatus& status) override {
|
||||
parent_.callback_type_ = NOTIFY_TERMINATE_PAIRING_RESPONSE;
|
||||
parent_.id_ = id;
|
||||
parent_.status_ = status;
|
||||
parent_.notify();
|
||||
return ndk::ScopedAStatus::ok();
|
||||
}
|
||||
|
||||
private:
|
||||
WifiNanIfaceAidlTest& parent_;
|
||||
|
||||
Reference in New Issue
Block a user