From: Ben Greear <greearb@candelatech.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org, Johannes Berg <johannes.berg@intel.com>
Subject: Re: [PATCH 2/4] cfg80211: make TX power setting per interface
Date: Wed, 24 Oct 2012 09:27:53 -0700 [thread overview]
Message-ID: <50881709.4050405@candelatech.com> (raw)
In-Reply-To: <1351073603-11616-3-git-send-email-johannes@sipsolutions.net>
On 10/24/2012 03:13 AM, Johannes Berg wrote:
> From: Johannes Berg <johannes.berg@intel.com>
>
> The TX power setting is currently per wiphy (hardware
> device) but with multi-channel capabilities that doesn't
> make much sense any more.
>
> Unfortunately, by making it per interface, we loose some
> backward compatibility with userspace, but that isn't a
> big issue since userspace must already accept that not
> all drivers support TX power setting, and mostly uses a
> netdev to identify the hardware anyway.
>
> @@ -1971,6 +1971,7 @@ static int ieee80211_set_wiphy_params(struct wiphy *wiphy, u32 changed)
> }
>
> static int ieee80211_set_tx_power(struct wiphy *wiphy,
> + struct wireless_dev *wdev,
> enum nl80211_tx_power_setting type, int mbm)
> {
> struct ieee80211_local *local = wiphy_priv(wiphy);
> @@ -2005,7 +2006,9 @@ static int ieee80211_set_tx_power(struct wiphy *wiphy,
> return 0;
> }
>
> -static int ieee80211_get_tx_power(struct wiphy *wiphy, int *dbm)
> +static int ieee80211_get_tx_power(struct wiphy *wiphy,
> + struct wireless_dev *wdev,
> + int *dbm)
> {
> struct ieee80211_local *local = wiphy_priv(wiphy);
Do we really set mbm and read back dbm?
>
> diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
> index 879ca62..24175e2 100644
> --- a/net/wireless/nl80211.c
> +++ b/net/wireless/nl80211.c
> @@ -1588,6 +1588,11 @@ static int nl80211_set_wiphy(struct sk_buff *skb, struct genl_info *info)
> enum nl80211_tx_power_setting type;
> int idx, mbm = 0;
>
> + if (!wdev) {
> + result = -EOPNOTSUPP;
> + goto bad_res;
> + }
I guess this is the part that breaks backwards compat when trying to set wiphy?
If it does stay like this, maybe add a WARN_ON_ONCE that tells users to fix their
user-space?
Too bad there is not an -EUSEVIFINSTEAD :P
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
next prev parent reply other threads:[~2012-10-24 16:27 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-24 10:13 [PATCH 0/4] multi-channel/interface TX power handling Johannes Berg
2012-10-24 10:13 ` [PATCH 1/4] nl80211: move "can set channel" check Johannes Berg
2012-10-24 10:13 ` [PATCH 2/4] cfg80211: make TX power setting per interface Johannes Berg
2012-10-24 16:27 ` Ben Greear [this message]
2012-10-24 17:31 ` Johannes Berg
2012-10-24 17:38 ` Ben Greear
2012-10-24 10:13 ` [PATCH 3/4] mac80211: handle TX power per virtual interface Johannes Berg
2012-10-24 10:13 ` [PATCH 4/4] mac80211_hwsim: print per interface TX power Johannes Berg
2012-10-24 15:40 ` [PATCH 0/4] multi-channel/interface TX power handling Ben Greear
2012-10-24 15:42 ` Johannes Berg
2012-10-24 16:31 ` Ben Greear
2012-10-24 17:30 ` Johannes Berg
2012-10-24 17:39 ` Ben Greear
2012-10-24 23:05 ` Is Multi-Vif (vaps) Different Channel Operation Supported? Kelly Hogan
2012-10-24 23:56 ` Ben Greear
2012-10-27 8:19 ` Adrian Chadd
2012-10-27 18:19 ` Arend van Spriel
2012-10-28 22:06 ` Adrian Chadd
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=50881709.4050405@candelatech.com \
--to=greearb@candelatech.com \
--cc=johannes.berg@intel.com \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
/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).