diff --git a/include/hardware_legacy/wifi_hal.h b/include/hardware_legacy/wifi_hal.h index 7605796..b91dae3 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; /*