[v3,2/4] cfg80211: export expected throughput via nl80211 (GET_STATION)
Commit Message
From: Antonio Quartulli <antonio@open-mesh.com>
Send the expected throughput when replying to a GET_STATION
command via nl80211.
Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
---
include/uapi/linux/nl80211.h | 3 +++
net/wireless/nl80211.c | 4 ++++
2 files changed, 7 insertions(+)
Comments
On Sat, 2014-05-17 at 18:41 +0200, Antonio Quartulli wrote:
> From: Antonio Quartulli <antonio@open-mesh.com>
>
> Send the expected throughput when replying to a GET_STATION
> command via nl80211.
>
> Signed-off-by: Antonio Quartulli <antonio@open-mesh.com>
> ---
> include/uapi/linux/nl80211.h | 3 +++
> net/wireless/nl80211.c | 4 ++++
> 2 files changed, 7 insertions(+)
>
> diff --git a/include/uapi/linux/nl80211.h b/include/uapi/linux/nl80211.h
> index 0cfa827..2964948 100644
> --- a/include/uapi/linux/nl80211.h
> +++ b/include/uapi/linux/nl80211.h
> @@ -2199,6 +2199,8 @@ enum nl80211_sta_bss_param {
> * Contains a nested array of signal strength attributes (u8, dBm)
> * @NL80211_STA_INFO_CHAIN_SIGNAL_AVG: per-chain signal strength average
> * Same format as NL80211_STA_INFO_CHAIN_SIGNAL.
> + * @NL80211_STA_EXPECTED_THROUGHPUT: expected throughput (considering also the
> + * 802.11 header) expressed in kbps
This should say it's a u32.
johannes
On Sat, 2014-05-17 at 18:41 +0200, Antonio Quartulli wrote:
> From: Antonio Quartulli <antonio@open-mesh.com>
>
> Send the expected throughput when replying to a GET_STATION
> command via nl80211.
Since both are pretty short I think you might also just squash patches 1
and 2.
johannes
On 19/05/14 17:00, Johannes Berg wrote:
> On Sat, 2014-05-17 at 18:41 +0200, Antonio Quartulli wrote:
>> From: Antonio Quartulli <antonio@open-mesh.com>
>>
>> Send the expected throughput when replying to a GET_STATION
>> command via nl80211.
>
> Since both are pretty short I think you might also just squash patches 1
> and 2.
Ok, will resend with 1/4 and 2/4 squashed and I'll add the u32 spec.
Thanks!
@@ -2199,6 +2199,8 @@ enum nl80211_sta_bss_param {
* Contains a nested array of signal strength attributes (u8, dBm)
* @NL80211_STA_INFO_CHAIN_SIGNAL_AVG: per-chain signal strength average
* Same format as NL80211_STA_INFO_CHAIN_SIGNAL.
+ * @NL80211_STA_EXPECTED_THROUGHPUT: expected throughput (considering also the
+ * 802.11 header) expressed in kbps
* @__NL80211_STA_INFO_AFTER_LAST: internal
* @NL80211_STA_INFO_MAX: highest possible station info attribute
*/
@@ -2230,6 +2232,7 @@ enum nl80211_sta_info {
NL80211_STA_INFO_TX_BYTES64,
NL80211_STA_INFO_CHAIN_SIGNAL,
NL80211_STA_INFO_CHAIN_SIGNAL_AVG,
+ NL80211_STA_INFO_EXPECTED_THROUGHPUT,
/* keep last */
__NL80211_STA_INFO_AFTER_LAST,
@@ -3650,6 +3650,10 @@ static int nl80211_send_station(struct sk_buff *msg, u32 portid, u32 seq,
nla_put_u32(msg, NL80211_STA_INFO_TX_FAILED,
sinfo->tx_failed))
goto nla_put_failure;
+ if ((sinfo->filled & STATION_INFO_EXPECTED_THROUGHPUT) &&
+ nla_put_u32(msg, NL80211_STA_INFO_EXPECTED_THROUGHPUT,
+ sinfo->expected_throughput))
+ goto nla_put_failure;
if ((sinfo->filled & STATION_INFO_BEACON_LOSS_COUNT) &&
nla_put_u32(msg, NL80211_STA_INFO_BEACON_LOSS,
sinfo->beacon_loss_count))