Send frequency changed event to framework
When supplicant receives the channel change event
(NL80211_CMD_CH_SWITCH_NOTIFY) from driver, send
the new operating frequency information to framework.
Bug: 202758240
Test: Manually triggered channel switch through hostapd command
and verified the new frequency in p2p group info logs
Change-Id: I05f10077ac497b934eb2c0560e179cdf4ed1497f
This commit is contained in:
@@ -921,3 +921,18 @@ void wpas_aidl_notify_network_not_found(struct wpa_supplicant *wpa_s)
|
|||||||
|
|
||||||
aidl_manager->notifyNetworkNotFound(wpa_s);
|
aidl_manager->notifyNetworkNotFound(wpa_s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void wpas_aidl_notify_bss_freq_changed(struct wpa_supplicant *wpa_s)
|
||||||
|
{
|
||||||
|
if (!wpa_s)
|
||||||
|
return;
|
||||||
|
|
||||||
|
AidlManager *aidl_manager = AidlManager::getInstance();
|
||||||
|
if (!aidl_manager)
|
||||||
|
return;
|
||||||
|
|
||||||
|
wpa_printf(MSG_DEBUG, "Notify %s frequency changed to %d",
|
||||||
|
wpa_s->ifname, wpa_s->assoc_freq);
|
||||||
|
|
||||||
|
aidl_manager->notifyBssFreqChanged(wpa_s);
|
||||||
|
}
|
||||||
|
|||||||
@@ -126,6 +126,7 @@ extern "C"
|
|||||||
void wpas_aidl_notify_transition_disable(
|
void wpas_aidl_notify_transition_disable(
|
||||||
struct wpa_supplicant *wpa_s, struct wpa_ssid *ssid, u8 bitmap);
|
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_network_not_found(struct wpa_supplicant *wpa_s);
|
||||||
|
void wpas_aidl_notify_bss_freq_changed(struct wpa_supplicant *wpa_s);
|
||||||
#else // CONFIG_CTRL_IFACE_AIDL
|
#else // CONFIG_CTRL_IFACE_AIDL
|
||||||
static inline int wpas_aidl_register_interface(struct wpa_supplicant *wpa_s)
|
static inline int wpas_aidl_register_interface(struct wpa_supplicant *wpa_s)
|
||||||
{
|
{
|
||||||
@@ -277,6 +278,8 @@ 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)
|
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)
|
||||||
|
{}
|
||||||
#endif // CONFIG_CTRL_IFACE_AIDL
|
#endif // CONFIG_CTRL_IFACE_AIDL
|
||||||
|
|
||||||
#ifdef _cplusplus
|
#ifdef _cplusplus
|
||||||
|
|||||||
@@ -1892,6 +1892,29 @@ void AidlManager::notifyNetworkNotFound(struct wpa_supplicant *wpa_s)
|
|||||||
callWithEachStaIfaceCallback(misc_utils::charBufToString(wpa_s->ifname), func);
|
callWithEachStaIfaceCallback(misc_utils::charBufToString(wpa_s->ifname), func);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AidlManager::notifyBssFreqChanged(struct wpa_supplicant *wpa_group_s)
|
||||||
|
{
|
||||||
|
if (!wpa_group_s || !wpa_group_s->parent)
|
||||||
|
return;
|
||||||
|
|
||||||
|
// 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");
|
||||||
|
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);
|
||||||
|
callWithEachP2pIfaceCallback(misc_utils::charBufToString(wpa_s->ifname), func);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieve the |ISupplicantP2pIface| aidl object reference using the provided
|
* Retrieve the |ISupplicantP2pIface| aidl object reference using the provided
|
||||||
* ifname.
|
* ifname.
|
||||||
|
|||||||
@@ -143,6 +143,7 @@ public:
|
|||||||
struct wpa_ssid *ssid,
|
struct wpa_ssid *ssid,
|
||||||
u8 bitmap);
|
u8 bitmap);
|
||||||
void notifyNetworkNotFound(struct wpa_supplicant *wpa_s);
|
void notifyNetworkNotFound(struct wpa_supplicant *wpa_s);
|
||||||
|
void notifyBssFreqChanged(struct wpa_supplicant *wpa_s);
|
||||||
|
|
||||||
// Methods called from aidl objects.
|
// Methods called from aidl objects.
|
||||||
void notifyExtRadioWorkStart(struct wpa_supplicant *wpa_s, uint32_t id);
|
void notifyExtRadioWorkStart(struct wpa_supplicant *wpa_s, uint32_t id);
|
||||||
|
|||||||
@@ -467,6 +467,8 @@ void wpas_notify_bss_freq_changed(struct wpa_supplicant *wpa_s,
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
wpas_dbus_bss_signal_prop_changed(wpa_s, WPAS_DBUS_BSS_PROP_FREQ, id);
|
wpas_dbus_bss_signal_prop_changed(wpa_s, WPAS_DBUS_BSS_PROP_FREQ, id);
|
||||||
|
|
||||||
|
wpas_aidl_notify_bss_freq_changed(wpa_s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user