提交 c4b50cd3 编写于 作者: V Venkateswara Naralasetty 提交者: Johannes Berg

cfg80211: send ack_signal to user in probe client response

This patch provides support to get ack signal in probe client response
and in station info from user.
Signed-off-by: NVenkateswara Naralasetty <vnaralas@codeaurora.org>
[squash in compilation fixes]
Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
上级 11b05ba3
...@@ -1599,7 +1599,8 @@ static void wil_probe_client_handle(struct wil6210_priv *wil, ...@@ -1599,7 +1599,8 @@ static void wil_probe_client_handle(struct wil6210_priv *wil,
*/ */
bool alive = (sta->status == wil_sta_connected); bool alive = (sta->status == wil_sta_connected);
cfg80211_probe_status(ndev, sta->addr, req->cookie, alive, GFP_KERNEL); cfg80211_probe_status(ndev, sta->addr, req->cookie, alive,
0, false, GFP_KERNEL);
} }
static struct list_head *next_probe_client(struct wil6210_priv *wil) static struct list_head *next_probe_client(struct wil6210_priv *wil)
......
...@@ -1147,6 +1147,7 @@ struct cfg80211_tid_stats { ...@@ -1147,6 +1147,7 @@ struct cfg80211_tid_stats {
* @rx_duration: aggregate PPDU duration(usecs) for all the frames from a peer * @rx_duration: aggregate PPDU duration(usecs) for all the frames from a peer
* @pertid: per-TID statistics, see &struct cfg80211_tid_stats, using the last * @pertid: per-TID statistics, see &struct cfg80211_tid_stats, using the last
* (IEEE80211_NUM_TIDS) index for MSDUs not encapsulated in QoS-MPDUs. * (IEEE80211_NUM_TIDS) index for MSDUs not encapsulated in QoS-MPDUs.
* @ack_signal: signal strength (in dBm) of the last ACK frame.
*/ */
struct station_info { struct station_info {
u64 filled; u64 filled;
...@@ -1191,6 +1192,7 @@ struct station_info { ...@@ -1191,6 +1192,7 @@ struct station_info {
u64 rx_duration; u64 rx_duration;
u8 rx_beacon_signal_avg; u8 rx_beacon_signal_avg;
struct cfg80211_tid_stats pertid[IEEE80211_NUM_TIDS + 1]; struct cfg80211_tid_stats pertid[IEEE80211_NUM_TIDS + 1];
s8 ack_signal;
}; };
#if IS_ENABLED(CONFIG_CFG80211) #if IS_ENABLED(CONFIG_CFG80211)
...@@ -5838,10 +5840,13 @@ bool cfg80211_rx_unexpected_4addr_frame(struct net_device *dev, ...@@ -5838,10 +5840,13 @@ bool cfg80211_rx_unexpected_4addr_frame(struct net_device *dev,
* @addr: the address of the peer * @addr: the address of the peer
* @cookie: the cookie filled in @probe_client previously * @cookie: the cookie filled in @probe_client previously
* @acked: indicates whether probe was acked or not * @acked: indicates whether probe was acked or not
* @ack_signal: signal strength (in dBm) of the ACK frame.
* @is_valid_ack_signal: indicates the ack_signal is valid or not.
* @gfp: allocation flags * @gfp: allocation flags
*/ */
void cfg80211_probe_status(struct net_device *dev, const u8 *addr, void cfg80211_probe_status(struct net_device *dev, const u8 *addr,
u64 cookie, bool acked, gfp_t gfp); u64 cookie, bool acked, s32 ack_signal,
bool is_valid_ack_signal, gfp_t gfp);
/** /**
* cfg80211_report_obss_beacon - report beacon from other APs * cfg80211_report_obss_beacon - report beacon from other APs
......
...@@ -2626,6 +2626,7 @@ enum nl80211_attrs { ...@@ -2626,6 +2626,7 @@ enum nl80211_attrs {
NL80211_ATTR_EXTERNAL_AUTH_SUPPORT, NL80211_ATTR_EXTERNAL_AUTH_SUPPORT,
NL80211_ATTR_NSS, NL80211_ATTR_NSS,
NL80211_ATTR_ACK_SIGNAL,
/* add attributes here, update the policy in nl80211.c */ /* add attributes here, update the policy in nl80211.c */
...@@ -2947,6 +2948,7 @@ enum nl80211_sta_bss_param { ...@@ -2947,6 +2948,7 @@ enum nl80211_sta_bss_param {
* @NL80211_STA_INFO_RX_DURATION: aggregate PPDU duration for all frames * @NL80211_STA_INFO_RX_DURATION: aggregate PPDU duration for all frames
* received from the station (u64, usec) * received from the station (u64, usec)
* @NL80211_STA_INFO_PAD: attribute used for padding for 64-bit alignment * @NL80211_STA_INFO_PAD: attribute used for padding for 64-bit alignment
* @NL80211_STA_INFO_ACK_SIGNAL: signal strength of the last ACK frame(u8, dBm)
* @__NL80211_STA_INFO_AFTER_LAST: internal * @__NL80211_STA_INFO_AFTER_LAST: internal
* @NL80211_STA_INFO_MAX: highest possible station info attribute * @NL80211_STA_INFO_MAX: highest possible station info attribute
*/ */
...@@ -2985,6 +2987,7 @@ enum nl80211_sta_info { ...@@ -2985,6 +2987,7 @@ enum nl80211_sta_info {
NL80211_STA_INFO_TID_STATS, NL80211_STA_INFO_TID_STATS,
NL80211_STA_INFO_RX_DURATION, NL80211_STA_INFO_RX_DURATION,
NL80211_STA_INFO_PAD, NL80211_STA_INFO_PAD,
NL80211_STA_INFO_ACK_SIGNAL,
/* keep last */ /* keep last */
__NL80211_STA_INFO_AFTER_LAST, __NL80211_STA_INFO_AFTER_LAST,
......
...@@ -486,7 +486,7 @@ static void ieee80211_report_ack_skb(struct ieee80211_local *local, ...@@ -486,7 +486,7 @@ static void ieee80211_report_ack_skb(struct ieee80211_local *local,
if (ieee80211_is_nullfunc(hdr->frame_control) || if (ieee80211_is_nullfunc(hdr->frame_control) ||
ieee80211_is_qos_nullfunc(hdr->frame_control)) ieee80211_is_qos_nullfunc(hdr->frame_control))
cfg80211_probe_status(sdata->dev, hdr->addr1, cfg80211_probe_status(sdata->dev, hdr->addr1,
cookie, acked, cookie, acked, 0, false,
GFP_ATOMIC); GFP_ATOMIC);
else else
cfg80211_mgmt_tx_status(&sdata->wdev, cookie, cfg80211_mgmt_tx_status(&sdata->wdev, cookie,
......
...@@ -4486,6 +4486,7 @@ static int nl80211_send_station(struct sk_buff *msg, u32 cmd, u32 portid, ...@@ -4486,6 +4486,7 @@ static int nl80211_send_station(struct sk_buff *msg, u32 cmd, u32 portid,
PUT_SINFO_U64(RX_DROP_MISC, rx_dropped_misc); PUT_SINFO_U64(RX_DROP_MISC, rx_dropped_misc);
PUT_SINFO_U64(BEACON_RX, rx_beacon); PUT_SINFO_U64(BEACON_RX, rx_beacon);
PUT_SINFO(BEACON_SIGNAL_AVG, rx_beacon_signal_avg, u8); PUT_SINFO(BEACON_SIGNAL_AVG, rx_beacon_signal_avg, u8);
PUT_SINFO(ACK_SIGNAL, ack_signal, u8);
#undef PUT_SINFO #undef PUT_SINFO
#undef PUT_SINFO_U64 #undef PUT_SINFO_U64
...@@ -14984,7 +14985,8 @@ void cfg80211_sta_opmode_change_notify(struct net_device *dev, const u8 *mac, ...@@ -14984,7 +14985,8 @@ void cfg80211_sta_opmode_change_notify(struct net_device *dev, const u8 *mac,
EXPORT_SYMBOL(cfg80211_sta_opmode_change_notify); EXPORT_SYMBOL(cfg80211_sta_opmode_change_notify);
void cfg80211_probe_status(struct net_device *dev, const u8 *addr, void cfg80211_probe_status(struct net_device *dev, const u8 *addr,
u64 cookie, bool acked, gfp_t gfp) u64 cookie, bool acked, s32 ack_signal,
bool is_valid_ack_signal, gfp_t gfp)
{ {
struct wireless_dev *wdev = dev->ieee80211_ptr; struct wireless_dev *wdev = dev->ieee80211_ptr;
struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy); struct cfg80211_registered_device *rdev = wiphy_to_rdev(wdev->wiphy);
...@@ -15009,7 +15011,9 @@ void cfg80211_probe_status(struct net_device *dev, const u8 *addr, ...@@ -15009,7 +15011,9 @@ void cfg80211_probe_status(struct net_device *dev, const u8 *addr,
nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, addr) || nla_put(msg, NL80211_ATTR_MAC, ETH_ALEN, addr) ||
nla_put_u64_64bit(msg, NL80211_ATTR_COOKIE, cookie, nla_put_u64_64bit(msg, NL80211_ATTR_COOKIE, cookie,
NL80211_ATTR_PAD) || NL80211_ATTR_PAD) ||
(acked && nla_put_flag(msg, NL80211_ATTR_ACK))) (acked && nla_put_flag(msg, NL80211_ATTR_ACK)) ||
(is_valid_ack_signal && nla_put_s32(msg, NL80211_ATTR_ACK_SIGNAL,
ack_signal)))
goto nla_put_failure; goto nla_put_failure;
genlmsg_end(msg, hdr); genlmsg_end(msg, hdr);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册