From: Arend van Spriel <arend@broadcom.com>
To: "Rafał Miłecki" <zajec5@gmail.com>,
"Johannes Berg" <johannes@sipsolutions.net>
Cc: <linux-wireless@vger.kernel.org>
Subject: Re: [PATCH] nl80211: put current TX power in interface info
Date: Tue, 1 Sep 2015 09:48:33 +0200 [thread overview]
Message-ID: <55E55851.1090004@broadcom.com> (raw)
In-Reply-To: <1441054778-22499-1-git-send-email-zajec5@gmail.com>
On 08/31/2015 10:59 PM, Rafał Miłecki wrote:
> Many drivers implement reading current TX power (using either cfg80211
> or ieee80211 op) but userspace can't get it using nl80211. Right now the
> only way to access it is to call some wext ioctl.
> Let's put TX power in interface info reply (callback is wdev specific)
> just like we do with current channel.
> To be consistent (e.g. NL80211_CMD_SET_WIPHY) let's use mBm as na unit.
An iw patch would be nice as well ;-)
Regards,
Arend
> Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
> ---
> net/wireless/nl80211.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
> index 5d8748b..a5d4e6f 100644
> --- a/net/wireless/nl80211.c
> +++ b/net/wireless/nl80211.c
> @@ -2403,6 +2403,17 @@ static int nl80211_send_iface(struct sk_buff *msg, u32 portid, u32 seq, int flag
> }
> }
>
> + if (rdev->ops->get_tx_power) {
> + int dbm, ret;
> +
> + ret = rdev_get_tx_power(rdev, wdev, &dbm);
> + if (ret == 0) {
> + if (nla_put_u32(msg, NL80211_ATTR_WIPHY_TX_POWER_LEVEL,
> + DBM_TO_MBM(dbm)))
> + goto nla_put_failure;
> + }
> + }
> +
> if (wdev->ssid_len) {
> if (nla_put(msg, NL80211_ATTR_SSID, wdev->ssid_len, wdev->ssid))
> goto nla_put_failure;
>
prev parent reply other threads:[~2015-09-01 7:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-31 20:59 [PATCH] nl80211: put current TX power in interface info Rafał Miłecki
2015-09-01 7:48 ` Arend van Spriel [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55E55851.1090004@broadcom.com \
--to=arend@broadcom.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=zajec5@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).