From: Johannes Berg <johannes@sipsolutions.net>
To: Juuso Oikarinen <juuso.oikarinen@nokia.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [RFC PATCH] nl80211/cfg80211/mac80211: Add support for setting transmit power
Date: Tue, 15 Jun 2010 11:29:55 +0200 [thread overview]
Message-ID: <1276594195.3648.54.camel@jlt3.sipsolutions.net> (raw)
In-Reply-To: <1276593453-27818-1-git-send-email-juuso.oikarinen@nokia.com>
On Tue, 2010-06-15 at 12:17 +0300, Juuso Oikarinen wrote:
> + * @NL80211_CMD_SET_TX_POWER: Set the used transmit power level (using
> + * %NL80211_ATTR_TX_POWER_SETTING and %NL80211_ATTR_TX_POWER_LEVEL).
We have a lot of such settings (RTS threshold, coverage class, ...) done
with SET_WIPHY, shouldn't this also be done there?
> + /*
> + * Though the nl80211 supports negative mBm values, the interface
> + * below it does not, for now.
> + */
> + if (mbm < 0) {
> + err = -EOPNOTSUPP;
> + goto out;
> + }
> +
> + rtnl_lock();
> +
> + err = get_rdev_dev_by_info_ifindex(info, &rdev, &dev);
> + if (err)
> + goto unlock_rdev;
> +
> + wdev = dev->ieee80211_ptr;
> +
> + if (!rdev->ops->set_tx_power) {
> + return -EOPNOTSUPP;
> + goto unlock_rdev;
> + }
> +
> + err = rdev->ops->set_tx_power(wdev->wiphy, type, MBM_TO_DBM(mbm));
I think the API mismatch should be handled in mac80211 rather than
cfg80211, that goes for both the negative values (actually, shouldn't
that be non-positive for mac80211?) and mBm vs. dBm -- and mac80211
should probably reject fractional dBm values for now.
johannes
next prev parent reply other threads:[~2010-06-15 9:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-15 9:17 [RFC PATCH] nl80211/cfg80211/mac80211: Add support for setting transmit power Juuso Oikarinen
2010-06-15 9:29 ` Johannes Berg [this message]
2010-06-15 9:46 ` Juuso Oikarinen
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=1276594195.3648.54.camel@jlt3.sipsolutions.net \
--to=johannes@sipsolutions.net \
--cc=juuso.oikarinen@nokia.com \
--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