diff options
author | Ahmed ElArabawy <arabawy@google.com> | 2019-12-21 12:56:47 -0800 |
---|---|---|
committer | Ahmed ElArabawy <arabawy@google.com> | 2020-01-09 17:28:41 +0000 |
commit | 0e99148d7aa863be1fe2c15a17cf24bb49bde58c (patch) | |
tree | e32ea7bd1394b91514d0ea04accfcc8d76579654 | |
parent | c8b0cd33b92db195e125171d7a1360af59a3ab8c (diff) |
Wifi: Add frequency list to chanelPrams in hostapd
This commit adds a new parameter to the channel parameters for IHostapd
Hidl interface to handle a list of channel freq in MHz to be used in
ACS. This is needed as part of support of Wifi 6GHz band since 6GHz band
channels use same channel numbers as 2.4/5GHz bands.
Bug: 146186687
Bug: 139354972
Test: Manual
Test: VTS test
Change-Id: I8692f3cd28cfaae1d3b870c9f8dbcdd2ff350ee4
-rw-r--r-- | current.txt | 2 | ||||
-rw-r--r-- | wifi/hostapd/1.2/IHostapd.hal | 37 | ||||
-rw-r--r-- | wifi/hostapd/1.2/vts/functional/hostapd_hidl_test.cpp | 53 |
3 files changed, 61 insertions, 31 deletions
diff --git a/current.txt b/current.txt index 5dc27cd3d7..369b607c2c 100644 --- a/current.txt +++ b/current.txt @@ -650,7 +650,7 @@ a3eddd9bbdc87e8c22764070037dd1154f1cf006e6fba93364c4f85d4c134a19 android.hardwar 94e803236398bed1febb11cc21051bc42ec003700139b099d6c479e02a7ca3c3 android.hardware.neuralnetworks@1.3::IPreparedModelCallback 618a628f8c94d6f6e4cb401b69fa50ccb8b82191ea434e3a071252289b4f312c android.hardware.neuralnetworks@1.3::types 3e01d4446cd69fd1c48f8572efd97487bc179564b32bd795800b97bbe10be37b android.hardware.wifi@1.4::IWifi -7d136c169b62abdee0bb6abafb97638acd792ce2102dfccddaa5df98d4bd3df9 android.hardware.wifi.hostapd@1.2::IHostapd +514dc8b810658c45d7b0d34132b708cee2658ecedd9c7efc57d0d666ef182484 android.hardware.wifi.hostapd@1.2::IHostapd 11f6448d15336361180391c8ebcdfd2d7cf77b3782d577e594d583aadc9c2877 android.hardware.wifi.hostapd@1.2::types a64467bae843569f0d465c5be7f0c7a5b987985b55a3ef4794dd5afc68538650 android.hardware.wifi.supplicant@1.3::ISupplicant c72cb37b3f66ef65aeb5c6438a3fbe17bbe847fdf62d1a76eafd7f3a8a526105 android.hardware.wifi.supplicant@1.3::ISupplicantStaIface diff --git a/wifi/hostapd/1.2/IHostapd.hal b/wifi/hostapd/1.2/IHostapd.hal index b25ea97a87..5e6d80a616 100644 --- a/wifi/hostapd/1.2/IHostapd.hal +++ b/wifi/hostapd/1.2/IHostapd.hal @@ -57,6 +57,7 @@ interface IHostapd extends @1.1::IHostapd { * used with HE. */ bool enable80211AX; + /** * Whether 6GHz band enabled or not on softAp. * Note: hw_mode=a is used to specify that 5 GHz band or 6 GHz band is @@ -96,6 +97,21 @@ interface IHostapd extends @1.1::IHostapd { }; /** + * Parameters to specify the channel frequency range for ACS. + */ + struct AcsFrequencyRange { + /** + * Channel Frequency (in MHz) at the start of the range. + */ + uint32_t start; + + /** + * Channel Frequency (in MHz) at the end of the range. + */ + uint32_t end; + }; + + /** * Parameters to control the channel selection for the interface. */ struct ChannelParams { @@ -103,6 +119,15 @@ interface IHostapd extends @1.1::IHostapd { * Band to use for the SoftAp operations. */ bitfield<BandMask> bandMask; + + /** + * This option can be used to specify the channel frequencies (in MHz) selected by ACS. + * If this is an empty list, all channels allowed in selected HW mode + * are specified implicitly. + * Note: channels may be overridden by firmware. + * Note: this option is ignored if ACS is disabled. + */ + vec<AcsFrequencyRange> acsChannelFreqRangesMhz; }; /** @@ -113,9 +138,15 @@ interface IHostapd extends @1.1::IHostapd { * Baseline information as defined in HAL 1.1. */ @1.1::IHostapd.IfaceParams V1_1; - /** Additional Hw mode params for the interface */ + + /** + * Additional Hw mode params for the interface + */ HwModeParams hwModeParams; - /** Additional Channel params for the interface */ + + /** + * Additional Channel params for the interface + */ ChannelParams channelParams; }; @@ -135,7 +166,7 @@ interface IHostapd extends @1.1::IHostapd { * |HostapdStatusCode.FAILURE_IFACE_EXISTS| */ addAccessPoint_1_2(IfaceParams ifaceParams, NetworkParams nwParams) - generates(HostapdStatus status); + generates (HostapdStatus status); /** * force one of the hotspot clients disconnect.. diff --git a/wifi/hostapd/1.2/vts/functional/hostapd_hidl_test.cpp b/wifi/hostapd/1.2/vts/functional/hostapd_hidl_test.cpp index 8245f8fc50..94cbb424b6 100644 --- a/wifi/hostapd/1.2/vts/functional/hostapd_hidl_test.cpp +++ b/wifi/hostapd/1.2/vts/functional/hostapd_hidl_test.cpp @@ -109,28 +109,26 @@ class HostapdHidlTest return iface_params_1_2; } - IHostapd::IfaceParams getIfaceParamsWithAcsAndChannelRange() { + IHostapd::IfaceParams getIfaceParamsWithAcsAndFreqRange() { IHostapd::IfaceParams iface_params_1_2 = getIfaceParamsWithAcs(); - ::android::hardware::wifi::hostapd::V1_1::IHostapd::ChannelParams - channelParams; - ::android::hardware::wifi::hostapd::V1_1::IHostapd::AcsChannelRange - acsChannelRange; - acsChannelRange.start = 1; - acsChannelRange.end = 11; - std::vector< - ::android::hardware::wifi::hostapd::V1_1::IHostapd::AcsChannelRange> - vec_acsChannelRange; - vec_acsChannelRange.push_back(acsChannelRange); - channelParams.acsChannelRanges = vec_acsChannelRange; - iface_params_1_2.V1_1.channelParams = channelParams; + ::android::hardware::wifi::hostapd::V1_2::IHostapd::AcsFrequencyRange + acsFrequencyRange; + acsFrequencyRange.start = 2412; + acsFrequencyRange.end = 2462; + std::vector<::android::hardware::wifi::hostapd::V1_2::IHostapd:: + AcsFrequencyRange> + vec_acsFrequencyRange; + vec_acsFrequencyRange.push_back(acsFrequencyRange); + iface_params_1_2.channelParams.acsChannelFreqRangesMhz = + vec_acsFrequencyRange; return iface_params_1_2; } - IHostapd::IfaceParams getIfaceParamsWithAcsAndInvalidChannelRange() { + IHostapd::IfaceParams getIfaceParamsWithAcsAndInvalidFreqRange() { IHostapd::IfaceParams iface_params_1_2 = - getIfaceParamsWithAcsAndChannelRange(); - iface_params_1_2.V1_1.channelParams.acsChannelRanges[0].start = 222; - iface_params_1_2.V1_1.channelParams.acsChannelRanges[0].end = 999; + getIfaceParamsWithAcsAndFreqRange(); + iface_params_1_2.channelParams.acsChannelFreqRangesMhz[0].start = 222; + iface_params_1_2.channelParams.acsChannelFreqRangesMhz[0].end = 999; return iface_params_1_2; } @@ -186,13 +184,13 @@ TEST_P(HostapdHidlTest, AddPskAccessPointWithAcs) { } /** - * Adds an access point with PSK network config, ACS enabled & channel Range. + * Adds an access point with PSK network config, ACS enabled & frequency Range. * Access point creation should pass. */ -TEST_P(HostapdHidlTest, AddPskAccessPointWithAcsAndChannelRange) { +TEST_P(HostapdHidlTest, AddPskAccessPointWithAcsAndFreqRange) { auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, - getIfaceParamsWithAcsAndChannelRange(), getPskNwParams()); + getIfaceParamsWithAcsAndFreqRange(), getPskNwParams()); // TODO: b/140172237, fix this in R // EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code); } @@ -201,9 +199,9 @@ TEST_P(HostapdHidlTest, AddPskAccessPointWithAcsAndChannelRange) { * Adds an access point with invalid channel range. * Access point creation should fail. */ -TEST_P(HostapdHidlTest, AddPskAccessPointWithAcsAndInvalidChannelRange) { +TEST_P(HostapdHidlTest, AddPskAccessPointWithAcsAndInvalidFreqRange) { auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, - getIfaceParamsWithAcsAndInvalidChannelRange(), + getIfaceParamsWithAcsAndInvalidFreqRange(), getPskNwParams()); // TODO: b/140172237, fix this in R // EXPECT_NE(HostapdStatusCode::SUCCESS, status.code); @@ -245,14 +243,15 @@ TEST_P(HostapdHidlTest, AddOpenAccessPointWithoutAcs) { * Access point creation & removal should pass. */ TEST_P(HostapdHidlTest, RemoveAccessPointWithAcs) { - auto status = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, - getIfaceParamsWithAcs(), getPskNwParams()); + auto status_1_2 = HIDL_INVOKE(hostapd_, addAccessPoint_1_2, + getIfaceParamsWithAcs(), getPskNwParams()); // TODO: b/140172237, fix this in R /* - EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code); - status = + EXPECT_EQ(HostapdStatusCode::SUCCESS, status_1_2.code); + auto status = HIDL_INVOKE(hostapd_, removeAccessPoint, getPrimaryWlanIfaceName()); - EXPECT_EQ(HostapdStatusCode::SUCCESS, status.code); + EXPECT_EQ(android::hardware::wifi::hostapd::V1_0::HostapdStatusCode::SUCCESS, + status.code); */ } |