From 8dd5b9a9edcf52fc7cbc6cb6b7899adbde9843b9 Mon Sep 17 00:00:00 2001 From: Veerendranath Jakkam Date: Thu, 8 Sep 2022 20:14:19 +0530 Subject: [PATCH] nl80211: Send bssid info as parameter to nl80211_get_link_signal() Add bssid as parameter to nl80211_get_link_signal() instead of using bssid from driver structure. This is useful for calling the function per-MLO link. Signed-off-by: Veerendranath Jakkam --- src/drivers/driver_nl80211.c | 6 +++--- src/drivers/driver_nl80211.h | 2 +- src/drivers/driver_nl80211_event.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 5765c626e..00879abea 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -1699,7 +1699,7 @@ static int get_link_signal(struct nl_msg *msg, void *arg) int nl80211_get_link_signal(struct wpa_driver_nl80211_data *drv, - struct wpa_signal_info *sig) + const u8 *bssid, struct wpa_signal_info *sig) { struct nl_msg *msg; @@ -1707,7 +1707,7 @@ int nl80211_get_link_signal(struct wpa_driver_nl80211_data *drv, sig->current_txrate = 0; if (!(msg = nl80211_drv_msg(drv, 0, NL80211_CMD_GET_STATION)) || - nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, drv->bssid)) { + nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, bssid)) { nlmsg_free(msg); return -ENOBUFS; } @@ -8759,7 +8759,7 @@ static int nl80211_signal_poll(void *priv, struct wpa_signal_info *si) int res; os_memset(si, 0, sizeof(*si)); - res = nl80211_get_link_signal(drv, si); + res = nl80211_get_link_signal(drv, drv->bssid, si); if (res) { if (drv->nlmode != NL80211_IFTYPE_ADHOC && drv->nlmode != NL80211_IFTYPE_MESH_POINT) diff --git a/src/drivers/driver_nl80211.h b/src/drivers/driver_nl80211.h index c84b21974..3eb2a74ab 100644 --- a/src/drivers/driver_nl80211.h +++ b/src/drivers/driver_nl80211.h @@ -269,7 +269,7 @@ int is_ap_interface(enum nl80211_iftype nlmode); int is_sta_interface(enum nl80211_iftype nlmode); int wpa_driver_nl80211_authenticate_retry(struct wpa_driver_nl80211_data *drv); int nl80211_get_link_signal(struct wpa_driver_nl80211_data *drv, - struct wpa_signal_info *sig); + const u8 *bssid, struct wpa_signal_info *sig); int nl80211_get_link_noise(struct wpa_driver_nl80211_data *drv, struct wpa_signal_info *sig_change); int nl80211_get_wiphy_index(struct i802_bss *bss); diff --git a/src/drivers/driver_nl80211_event.c b/src/drivers/driver_nl80211_event.c index a7fc4b355..60f1accaa 100644 --- a/src/drivers/driver_nl80211_event.c +++ b/src/drivers/driver_nl80211_event.c @@ -1606,7 +1606,7 @@ static void nl80211_cqm_event(struct wpa_driver_nl80211_data *drv, * nl80211_get_link_signal() and nl80211_get_link_noise() set default * values in case querying the driver fails. */ - res = nl80211_get_link_signal(drv, &ed.signal_change); + res = nl80211_get_link_signal(drv, drv->bssid, &ed.signal_change); if (res == 0) { wpa_printf(MSG_DEBUG, "nl80211: Signal: %d dBm txrate: %d", ed.signal_change.current_signal,