cfg80211/nl80211: Add support for NL80211_STA_INFO_RX_DURATION
PATCH v4 1/1 cfg80211/nl80211: Add support for NL80211_STA_INFO_RX_DURATION
From: Mohammed Shafi Shajakhan <[email protected]>
Add support for new netlink attribute 'NL80211_STA_INFO_RX_DURATION'. 'NL80211_STA_INFO_RX_DURATION' accounts for aggregate PPDU duration in microseconds for all the frames from a peer. Drivers can fill 'rx_duration' field and set the flag 'NL80211_STA_INFO_RX_DURATION'. 'rx_duration' will give an idea about the total time spent by our peer with each of its connected peers.
Also extend 'PUT_SINFO' for supporting rx_duration field
--- include/net/cfg80211.h | 4 +++- include/uapi/linux/nl80211.h | 3 +++ net/wireless/nl80211.c | 3 ++- 3 files changed, 8 insertions(+), 2 deletions(-)
include/net/cfg80211.h +3 -1
@@ -1063,11 +1063,12 @@ struct cfg80211_tid_stats {* @rx_beacon: number of beacons received from this peer * @rx_beacon_signal_avg: signal strength average (in dBm) for beacons received * from this 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 * (IEEE80211_NUM_TIDS) index for MSDUs not encapsulated in QoS-MPDUs. */ struct station_info { -u32 filled; +u64 filled;u32 connected_time;u32 inactive_time;u64 rx_bytes;
@@ -1106,6 +1107,7 @@ struct station_info {u32 expected_throughput;u64 rx_beacon; +u64 rx_duration;u8 rx_beacon_signal_avg;struct cfg80211_tid_stats pertid[IEEE80211_NUM_TIDS +1 ]; };
include/uapi/linux/nl80211.h +3 -0
@@ -2482,6 +2482,8 @@ enum nl80211_sta_bss_param {* TID+1 and the special TID 16 (i.e. value 17) is used for non-QoS frames; * each one of those is again nested with &enum nl80211_tid_stats * attributes carrying the actual values. +* @NL80211_STA_INFO_RX_DURATION: aggregate PPDU duration(usecs) for all the +* frames from a peer * @__NL80211_STA_INFO_AFTER_LAST: internal * @NL80211_STA_INFO_MAX: highest possible station info attribute */
@@ -2518,6 +2520,7 @@ enum nl80211_sta_info {NL80211_STA_INFO_BEACON_RX ,NL80211_STA_INFO_BEACON_SIGNAL_AVG ,NL80211_STA_INFO_TID_STATS , +NL80211_STA_INFO_RX_DURATION ,/* keep last */ __NL80211_STA_INFO_AFTER_LAST,
net/wireless/nl80211.c +2 -1
@@ -3753,7 +3753,7 @@ static int nl80211_send_station(struct sk_buff *msg, u32 cmd, u32 portid, goto nla_put_failure;#define PUT_SINFO (attr, memb, type) do { \ - if (sinfo->filled & BIT(NL80211_STA_INFO_ ## attr) && \ + if (sinfo->filled & (1ULL << NL80211_STA_INFO_ ## attr) && \ nla_put_ ## type(msg, NL80211_STA_INFO_ ## attr, \ sinfo->memb)) \ goto nla_put_failure; \
@@ -3779,6 +3779,7 @@ static int nl80211_send_station(struct sk_buff *msg, u32 cmd, u32 portid,PUT_SINFO (LLID , llid, u16);PUT_SINFO (PLID , plid, u16);PUT_SINFO (PLINK_STATE , plink_state, u8); +PUT_SINFO (RX_DURATION , rx_duration, u64);switch (rdev->wiphy.signal_type) {case CFG80211_SIGNAL_TYPE_MBM :
Signature · 1 line
1.7.9.5
Quoted 10 lines · Mohammed Shafi Shajakhan
From: Mohammed Shafi Shajakhan <[email protected]>
Add support for new netlink attribute '
NL80211_STA_INFO_RX_DURATION'. 'NL80211_STA_INFO_RX_DURATION' accounts for aggregate PPDU duration in microseconds for all the frames from a peer. Drivers can fill 'rx_duration' field and set the flag 'NL80211_STA_INFO_RX_DURATION'. 'rx_duration' will give an idea about the total time spent by our peer
with each of its connected peers.
Quoted 2 lines
Also extend '
PUT_SINFO' for supportingrx_durationfield
Applied, with some minor changes.
johannes
Quoted 11 lines · Johannes Berg
Quoted 10 lines · Mohammed Shafi Shajakhan
From: Mohammed Shafi Shajakhan <[email protected]>
Add support for new netlink attribute '
NL80211_STA_INFO_RX_DURATION'. 'NL80211_STA_INFO_RX_DURATION' accounts for aggregate PPDU duration in microseconds for all the frames from a peer. Drivers can fill 'rx_duration' field and set the flag 'NL80211_STA_INFO_RX_DURATION'. 'rx_duration' will give an idea about the total time spent by our peer
with each of its connected peers.
Quoted 4 lines
Quoted 2 lines
Also extend '
PUT_SINFO' for supportingrx_durationfieldApplied, with some minor changes.
[shafi] thank you for accepting this change Johannes.
regards,
shafi