aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSunil Ravi <sunilravi@google.com>2022-05-26 03:24:26 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2022-05-26 03:24:26 +0000
commit8fc512fa81d19ee120cb47c7495925dc0d798965 (patch)
tree984d003b46a442fdfcd1c08312ba20c6397cda7f
parentaf231dafd7da77952a4f1d901577b73b071453a2 (diff)
parentc36b8e676f9169013018f252039d7d23f4e5fb59 (diff)
downloadwpa_supplicant_8-8fc512fa81d19ee120cb47c7495925dc0d798965.tar.gz
Modified frequency changed event to framework am: 65a724befe am: c36b8e676f
Original change: https://googleplex-android-review.googlesource.com/c/platform/external/wpa_supplicant_8/+/18583204 Change-Id: Ic97219202ab35a95592b849f5b0658099c3cdbf9 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--wpa_supplicant/aidl/aidl.cpp8
-rw-r--r--wpa_supplicant/aidl/aidl.h4
-rw-r--r--wpa_supplicant/aidl/aidl_manager.cpp11
-rw-r--r--wpa_supplicant/aidl/aidl_manager.h2
-rw-r--r--wpa_supplicant/events.c4
-rw-r--r--wpa_supplicant/notify.c10
-rw-r--r--wpa_supplicant/notify.h1
7 files changed, 24 insertions, 16 deletions
diff --git a/wpa_supplicant/aidl/aidl.cpp b/wpa_supplicant/aidl/aidl.cpp
index 1add3df4..a7945cc6 100644
--- a/wpa_supplicant/aidl/aidl.cpp
+++ b/wpa_supplicant/aidl/aidl.cpp
@@ -923,7 +923,7 @@ void wpas_aidl_notify_network_not_found(struct wpa_supplicant *wpa_s)
aidl_manager->notifyNetworkNotFound(wpa_s);
}
-void wpas_aidl_notify_bss_freq_changed(struct wpa_supplicant *wpa_s)
+void wpas_aidl_notify_frequency_changed(struct wpa_supplicant *wpa_s, int frequency)
{
if (!wpa_s)
return;
@@ -932,10 +932,10 @@ void wpas_aidl_notify_bss_freq_changed(struct wpa_supplicant *wpa_s)
if (!aidl_manager)
return;
- wpa_printf(MSG_DEBUG, "Notify %s frequency changed to %d",
- wpa_s->ifname, wpa_s->assoc_freq);
+ wpa_printf(MSG_INFO, "Notify %s frequency changed to %d",
+ wpa_s->ifname, frequency);
- aidl_manager->notifyBssFreqChanged(wpa_s);
+ aidl_manager->notifyFrequencyChanged(wpa_s, frequency);
}
void wpas_aidl_notify_ceritification(struct wpa_supplicant *wpa_s,
diff --git a/wpa_supplicant/aidl/aidl.h b/wpa_supplicant/aidl/aidl.h
index d9ab7bd2..2f3c7a05 100644
--- a/wpa_supplicant/aidl/aidl.h
+++ b/wpa_supplicant/aidl/aidl.h
@@ -126,7 +126,7 @@ extern "C"
void wpas_aidl_notify_transition_disable(
struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid, u8 bitmap);
void wpas_aidl_notify_network_not_found(struct wpa_supplicant *wpa_s);
- void wpas_aidl_notify_bss_freq_changed(struct wpa_supplicant *wpa_s);
+ void wpas_aidl_notify_frequency_changed(struct wpa_supplicant *wpa_s, int frequency);
void wpas_aidl_notify_ceritification(struct wpa_supplicant *wpa_s,
int depth, const char *subject,
const char *altsubject[],
@@ -293,7 +293,7 @@ static void wpas_aidl_notify_transition_disable(struct wpa_supplicant *wpa_s,
{}
static void wpas_aidl_notify_network_not_found(struct wpa_supplicant *wpa_s)
{}
-void wpas_aidl_notify_bss_freq_changed(struct wpa_supplicant *wpa_s)
+void wpas_aidl_notify_frequency_changed(struct wpa_supplicant *wpa_s, int frequency)
{}
void wpas_aidl_notify_ceritification(struct wpa_supplicant *wpa_s,
int depth, const char *subject,
diff --git a/wpa_supplicant/aidl/aidl_manager.cpp b/wpa_supplicant/aidl/aidl_manager.cpp
index ac7b8e84..da90c389 100644
--- a/wpa_supplicant/aidl/aidl_manager.cpp
+++ b/wpa_supplicant/aidl/aidl_manager.cpp
@@ -1905,7 +1905,7 @@ void AidlManager::notifyNetworkNotFound(struct wpa_supplicant *wpa_s)
callWithEachStaIfaceCallback(misc_utils::charBufToString(wpa_s->ifname), func);
}
-void AidlManager::notifyBssFreqChanged(struct wpa_supplicant *wpa_group_s)
+void AidlManager::notifyFrequencyChanged(struct wpa_supplicant *wpa_group_s, int frequency)
{
if (!wpa_group_s || !wpa_group_s->parent)
return;
@@ -1913,18 +1913,15 @@ void AidlManager::notifyBssFreqChanged(struct wpa_supplicant *wpa_group_s)
// For group notifications, need to use the parent iface for callbacks.
struct wpa_supplicant *wpa_s = getTargetP2pIfaceForGroup(wpa_group_s);
if (!wpa_s) {
- wpa_printf(MSG_INFO, "Drop BSS frequency changed event");
+ wpa_printf(MSG_INFO, "Drop frequency changed event");
return;
}
- uint32_t aidl_freq = wpa_group_s->current_bss
- ? wpa_group_s->current_bss->freq
- : wpa_group_s->assoc_freq;
-
const std::function<
ndk::ScopedAStatus(std::shared_ptr<ISupplicantP2pIfaceCallback>)>
func = std::bind(&ISupplicantP2pIfaceCallback::onGroupFrequencyChanged,
- std::placeholders::_1, misc_utils::charBufToString(wpa_group_s->ifname), aidl_freq);
+ std::placeholders::_1, misc_utils::charBufToString(wpa_group_s->ifname),
+ frequency);
callWithEachP2pIfaceCallback(misc_utils::charBufToString(wpa_s->ifname), func);
}
diff --git a/wpa_supplicant/aidl/aidl_manager.h b/wpa_supplicant/aidl/aidl_manager.h
index 6acacf56..1ed6899c 100644
--- a/wpa_supplicant/aidl/aidl_manager.h
+++ b/wpa_supplicant/aidl/aidl_manager.h
@@ -143,7 +143,7 @@ public:
struct wpa_ssid *ssid,
u8 bitmap);
void notifyNetworkNotFound(struct wpa_supplicant *wpa_s);
- void notifyBssFreqChanged(struct wpa_supplicant *wpa_s);
+ void notifyFrequencyChanged(struct wpa_supplicant *wpa_s, int frequency);
void notifyCertification(struct wpa_supplicant *wpa_s,
int depth, const char *subject,
const char *altsubject[],
diff --git a/wpa_supplicant/events.c b/wpa_supplicant/events.c
index 35467ce9..30a7eb0f 100644
--- a/wpa_supplicant/events.c
+++ b/wpa_supplicant/events.c
@@ -5347,6 +5347,10 @@ void wpa_supplicant_event(void *ctx, enum wpa_event_type event,
if (event == EVENT_CH_SWITCH_STARTED)
break;
+ if (wpa_s->assoc_freq && data->ch_switch.freq &&
+ (int) wpa_s->assoc_freq != data->ch_switch.freq) {
+ wpas_notify_frequency_changed(wpa_s, data->ch_switch.freq);
+ }
wpa_s->assoc_freq = data->ch_switch.freq;
wpa_s->current_ssid->frequency = data->ch_switch.freq;
if (wpa_s->current_bss &&
diff --git a/wpa_supplicant/notify.c b/wpa_supplicant/notify.c
index 4c305186..c52e88fd 100644
--- a/wpa_supplicant/notify.c
+++ b/wpa_supplicant/notify.c
@@ -472,8 +472,6 @@ void wpas_notify_bss_freq_changed(struct wpa_supplicant *wpa_s,
return;
wpas_dbus_bss_signal_prop_changed(wpa_s, WPAS_DBUS_BSS_PROP_FREQ, id);
-
- wpas_aidl_notify_bss_freq_changed(wpa_s);
}
@@ -1321,3 +1319,11 @@ void wpas_notify_qos_policy_request(struct wpa_supplicant *wpa_s,
wpas_aidl_notify_qos_policy_request(wpa_s, policies, num_policies);
}
+
+void wpas_notify_frequency_changed(struct wpa_supplicant *wpa_s, int frequency)
+{
+ if (!wpa_s)
+ return;
+
+ wpas_aidl_notify_frequency_changed(wpa_s, frequency);
+}
diff --git a/wpa_supplicant/notify.h b/wpa_supplicant/notify.h
index f7000171..996be846 100644
--- a/wpa_supplicant/notify.h
+++ b/wpa_supplicant/notify.h
@@ -217,5 +217,6 @@ void wpas_notify_open_ssl_failure(struct wpa_supplicant *wpa_s,
void wpas_notify_qos_policy_reset(struct wpa_supplicant *wpa_s);
void wpas_notify_qos_policy_request(struct wpa_supplicant *wpa_s,
struct dscp_policy_data *policies, int num_policies);
+void wpas_notify_frequency_changed(struct wpa_supplicant *wpa_s, int frequency);
#endif /* NOTIFY_H */