linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Christian Lamparter <chunkeey@googlemail.com>
To: Harshal Chhaya <harshal@gmail.com>
Cc: "linux-wireless" <linux-wireless@vger.kernel.org>
Subject: Re: carl9170: How to control transmit power?
Date: Thu, 12 Jan 2012 00:41:35 +0100	[thread overview]
Message-ID: <201201120041.35506.chunkeey@googlemail.com> (raw)
In-Reply-To: <CAJ8GFOgazS1MWk+vaNHd=SCtenO+6fYty-_JqZVGX5+xa04dDg@mail.gmail.com>

On Thursday, January 12, 2012 12:07:54 AM Harshal Chhaya wrote:
> Does the carl9170 driver/firmware allow real-time updates to the tx
> power parameter?

No. not yet. 
 
> On my AR9170-based AP, I can't set the tx power using either 'iw' or 'iwconfig'.
> 
> 'iw' fails with an error message:
> 
> root@OpenWrt:/etc/hostapd# iw wlan0 set txpower fixed 10
> command failed: Operation not supported (-95)

iw uses mBm (millibels referenced to 1 milliwatt) rather than the more familiar dBm.
try: iw wlan0 set txpower fixed 1000
 
> 'iwconfig' seems to update the information that's displayed but it
> doesn't affect the actual tx power
> 
> root@OpenWrt:/# iwconfig wlan0
> wlan0     IEEE 802.11bgn  Mode:Master  Frequency:2.412 GHz  Tx-Power=7 dBm
>           RTS thr:off   Fragment thr:off
>           Power Management:off
> 
> root@OpenWrt:/# iwconfig wlan0 txpower 11
> 
> root@OpenWrt:/# iwconfig wlan0
> wlan0     IEEE 802.11bgn  Mode:Master  Frequency:2.412 GHz  Tx-Power=11 dBm
>           RTS thr:off   Fragment thr:off
>           Power Management:off
> 
> Is there another way to set the tx power? I want to reduce the range
> of my AP and am trying to lower the tx power.

see attached patch. But I have to add that it won't change the
txpower of frames which are generated by the MAC [like RTS/CTS and
(B)ACKS].

Best Regards and good night.
---
diff --git a/drivers/net/wireless/ath/carl9170/tx.c b/drivers/net/wireless/ath/carl9170/tx.c
index d19a9ee..771e1a9 100644
--- a/drivers/net/wireless/ath/carl9170/tx.c
+++ b/drivers/net/wireless/ath/carl9170/tx.c
@@ -719,6 +719,8 @@ static void carl9170_tx_rate_tpc_chains(struct ar9170 *ar,
 		else
 			*chains = AR9170_TX_PHY_TXCHAIN_2;
 	}
+
+	*tpc = min_t(unsigned int, *tpc, ar->hw->conf.power_level * 2);
 }
 
 static __le32 carl9170_tx_physet(struct ar9170 *ar,

  reply	other threads:[~2012-01-11 23:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-11 23:07 carl9170: How to control transmit power? Harshal Chhaya
2012-01-11 23:41 ` Christian Lamparter [this message]
2012-01-18  1:10   ` Harshal Chhaya

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=201201120041.35506.chunkeey@googlemail.com \
    --to=chunkeey@googlemail.com \
    --cc=harshal@gmail.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;
as well as URLs for NNTP newsgroup(s).