linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Felix Fietkau <nbd@openwrt.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH] mac80211: add support for driver tx power reporting
Date: Sun, 26 Oct 2014 00:29:58 +0200	[thread overview]
Message-ID: <544C2466.1030709@openwrt.org> (raw)
In-Reply-To: <1414161186.2326.1.camel@jlt4.sipsolutions.net>

On 2014-10-24 16:33, Johannes Berg wrote:
> On Wed, 2014-10-22 at 17:57 +0200, Felix Fietkau wrote:
>> The configured tx power is often limited by hardware capabilities,
>> channel settings, antenna configuration, etc.
>> 
>> Signed-off-by: Felix Fietkau <nbd@openwrt.org>
>> ---
>>  include/net/mac80211.h | 5 +++++
>>  net/mac80211/cfg.c     | 3 +++
>>  2 files changed, 8 insertions(+)
>> 
>> diff --git a/include/net/mac80211.h b/include/net/mac80211.h
>> index 0ad1f47..41b0e60 100644
>> --- a/include/net/mac80211.h
>> +++ b/include/net/mac80211.h
>> @@ -2838,6 +2838,9 @@ enum ieee80211_roc_type {
>>   * @get_expected_throughput: extract the expected throughput towards the
>>   *	specified station. The returned value is expressed in Kbps. It returns 0
>>   *	if the RC algorithm does not have proper data to provide.
>> + *
>> + * @get_txpower: get current maximum tx power (in dBm) based on configuration
>> + *	and hardware limits.
>>   */
>>  struct ieee80211_ops {
>>  	void (*tx)(struct ieee80211_hw *hw,
>> @@ -3039,6 +3042,8 @@ struct ieee80211_ops {
>>  	int (*join_ibss)(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
>>  	void (*leave_ibss)(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
>>  	u32 (*get_expected_throughput)(struct ieee80211_sta *sta);
>> +	int (*get_txpower)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
>> +			   int *dbm);
>>  };
>>  
>>  /**
>> diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
>> index fb6a150..7cb31a8 100644
>> --- a/net/mac80211/cfg.c
>> +++ b/net/mac80211/cfg.c
>> @@ -2081,6 +2081,9 @@ static int ieee80211_get_tx_power(struct wiphy *wiphy,
>>  	struct ieee80211_local *local = wiphy_priv(wiphy);
>>  	struct ieee80211_sub_if_data *sdata = IEEE80211_WDEV_TO_SUB_IF(wdev);
>>  
>> +	if (local->ops->get_txpower)
>> +		return local->ops->get_txpower(&local->hw, &sdata->vif, dbm);
> 
> Might be good to have tracing?
Sending v2.

> And when this is supported, maybe there should be a cop-out for the
> driver to say "please use your value"? OTOH it can access the data that
> mac80211 currently reports so that's probably not needed?
I don't see the point in having that, since the driver can just take it
from the hw/bss conf directly.

- Felix

      reply	other threads:[~2014-10-25 22:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-22 15:57 [PATCH] mac80211: add support for driver tx power reporting Felix Fietkau
2014-10-24 14:33 ` Johannes Berg
2014-10-25 22:29   ` Felix Fietkau [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=544C2466.1030709@openwrt.org \
    --to=nbd@openwrt.org \
    --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).