Merge "Allow compilation without HS20/INTERWORKING" am: 3c7a7cde4b

Original change: https://android-review.googlesource.com/c/platform/external/wpa_supplicant_8/+/2494216

Change-Id: I1cb3a5118293cf558887c7af62a346ecec292834
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot
2023-05-11 18:45:35 +00:00
committed by Automerger Merge Worker
4 changed files with 35 additions and 0 deletions

View File

@@ -757,6 +757,7 @@ int AidlManager::notifyNetworkRequest(
return 1;
}
#ifdef CONFIG_INTERWORKING
/**
* Notify all listeners about the end of an ANQP query.
*
@@ -803,6 +804,7 @@ void AidlManager::notifyAnqpQueryDone(
}
}
#ifdef CONFIG_HS20
aidl_hs20_anqp_data.operatorFriendlyName =
misc_utils::convertWpaBufToVector(
anqp->hs20_operator_friendly_name);
@@ -814,6 +816,16 @@ void AidlManager::notifyAnqpQueryDone(
aidl_hs20_anqp_data.osuProvidersList =
misc_utils::convertWpaBufToVector(
anqp->hs20_osu_providers_list);
#else
aidl_hs20_anqp_data.operatorFriendlyName =
misc_utils::convertWpaBufToVector(NULL);
aidl_hs20_anqp_data.wanMetrics =
misc_utils::convertWpaBufToVector(NULL);
aidl_hs20_anqp_data.connectionCapability =
misc_utils::convertWpaBufToVector(NULL);
aidl_hs20_anqp_data.osuProvidersList =
misc_utils::convertWpaBufToVector(NULL);
#endif /* CONFIG_HS20 */
}
callWithEachStaIfaceCallback(
@@ -822,6 +834,7 @@ void AidlManager::notifyAnqpQueryDone(
std::placeholders::_1, macAddrToVec(bssid), aidl_anqp_data,
aidl_hs20_anqp_data));
}
#endif /* CONFIG_INTERWORKING */
/**
* Notify all listeners about the end of an HS20 icon query.

View File

@@ -1054,6 +1054,7 @@ ndk::ScopedAStatus StaIface::initiateAnqpQueryInternal(
if (info_elements.size() > kMaxAnqpElems) {
return createStatus(SupplicantStatusCode::FAILURE_ARGS_INVALID);
}
#ifdef CONFIG_INTERWORKING
uint16_t info_elems_buf[kMaxAnqpElems];
uint32_t num_info_elems = 0;
for (const auto &info_element : info_elements) {
@@ -1077,11 +1078,15 @@ ndk::ScopedAStatus StaIface::initiateAnqpQueryInternal(
return createStatus(SupplicantStatusCode::FAILURE_UNKNOWN);
}
return ndk::ScopedAStatus::ok();
#else
return createStatus(SupplicantStatusCode::FAILURE_UNSUPPORTED);
#endif /* CONFIG_INTERWORKING */
}
ndk::ScopedAStatus StaIface::initiateVenueUrlAnqpQueryInternal(
const std::vector<uint8_t> &mac_address)
{
#ifdef CONFIG_INTERWORKING
struct wpa_supplicant *wpa_s = retrieveIfacePtr();
uint16_t info_elems_buf[1] = {ANQP_VENUE_URL};
if (mac_address.size() != ETH_ALEN) {
@@ -1093,11 +1098,15 @@ ndk::ScopedAStatus StaIface::initiateVenueUrlAnqpQueryInternal(
return createStatus(SupplicantStatusCode::FAILURE_UNKNOWN);
}
return ndk::ScopedAStatus::ok();
#else
return createStatus(SupplicantStatusCode::FAILURE_UNSUPPORTED);
#endif /* CONFIG_INTERWORKING */
}
ndk::ScopedAStatus StaIface::initiateHs20IconQueryInternal(
const std::vector<uint8_t> &mac_address, const std::string &file_name)
{
#ifdef CONFIG_HS20
struct wpa_supplicant *wpa_s = retrieveIfacePtr();
if (mac_address.size() != ETH_ALEN) {
return createStatus(SupplicantStatusCode::FAILURE_UNKNOWN);
@@ -1110,6 +1119,9 @@ ndk::ScopedAStatus StaIface::initiateHs20IconQueryInternal(
return createStatus(SupplicantStatusCode::FAILURE_UNKNOWN);
}
return ndk::ScopedAStatus::ok();
#else
return createStatus(SupplicantStatusCode::FAILURE_UNSUPPORTED);
#endif /* CONFIG_HS20 */
}
std::pair<std::vector<uint8_t>, ndk::ScopedAStatus>

View File

@@ -1393,12 +1393,16 @@ ndk::ScopedAStatus StaNetwork::setIdStrInternal(const std::string &id_str)
ndk::ScopedAStatus StaNetwork::setUpdateIdentifierInternal(uint32_t id)
{
#ifdef CONFIG_HS20
struct wpa_ssid *wpa_ssid = retrieveNetworkPtr();
wpa_ssid->update_identifier = id;
wpa_printf(
MSG_MSGDUMP, "update_identifier: %d", wpa_ssid->update_identifier);
resetInternalStateAfterParamsUpdate();
return ndk::ScopedAStatus::ok();
#else
return createStatusWithMsg(SupplicantStatusCode::FAILURE_UNKNOWN, "Not implemented");
#endif /* CONFIG_HS20 */
}
ndk::ScopedAStatus StaNetwork::setWapiCertSuiteInternal(const std::string &suite)
@@ -2252,6 +2256,7 @@ StaNetwork::getPairwiseCipherInternal()
ndk::ScopedAStatus StaNetwork::setRoamingConsortiumSelectionInternal(
const std::vector<uint8_t> &selectedRcoi)
{
#ifdef CONFIG_HS20
struct wpa_ssid *wpa_ssid = retrieveNetworkPtr();
if (wpa_ssid == NULL) {
return createStatus(SupplicantStatusCode::FAILURE_NETWORK_INVALID);
@@ -2267,6 +2272,9 @@ ndk::ScopedAStatus StaNetwork::setRoamingConsortiumSelectionInternal(
resetInternalStateAfterParamsUpdate();
return ndk::ScopedAStatus::ok();
#else
return createStatusWithMsg(SupplicantStatusCode::FAILURE_UNKNOWN, "Not implemented");
#endif /* CONFIG_HS20 */
}
/**

View File

@@ -1627,6 +1627,7 @@ static int interworking_connect_roaming_consortium(
if (interworking_set_hs20_params(wpa_s, ssid) < 0)
goto fail;
#ifdef CONFIG_HS20
ie = wpa_bss_get_ie(bss, WLAN_EID_ROAMING_CONSORTIUM);
anqp = bss->anqp ? bss->anqp->roaming_consortium : NULL;
for (i = 0; (ie || anqp) && i < cred->num_roaming_consortiums; i++) {
@@ -1646,6 +1647,7 @@ static int interworking_connect_roaming_consortium(
cred->roaming_consortiums_len[i];
break;
}
#endif /* CONFIG_HS20 */
if (cred->eap_method == NULL) {
wpa_msg(wpa_s, MSG_DEBUG,