Linux wireless drivers development
 help / color / mirror / Atom feed
* Setting negative value in dBm for power output (txpower)
@ 2011-10-21 21:35 Patryk Żółtowski
  2011-10-21 22:00 ` wwguy
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Patryk Żółtowski @ 2011-10-21 21:35 UTC (permalink / raw)
  To: linux-wireless

I'm doing a research and I'm wondering if it's possible to hack
wireless drivers to allow setting  txpower to smaller value than 1mW
(e.g. 0.1mW = -10dBM, or even 0.01mW). I've checked source code and in
net/mac80211/cfg.c there is the following check:

  if (mbm < 0 || (mbm % 100))
                     return -EOPNOTSUPP;

and in  e.g. in drivers/net/wireless/iwlwifi/iwl-4965.h  also the min
power output is limited by this define:

 IWL_TX_POWER_TARGET_POWER_MIN       (0)

Is it possible to modify source to allow negative power output in dBm
that would work? Or is it physical limitation from the hardware? I'm
doing just a research using Intel Corporation PRO/Wireless 4965 AG
card  and right now I don't require to support other hardware. Is
there any way to check minimum power output capability by given
wireless card? I'm not proficient with driver hacking so any hint
where to start (which file to look up, references) would be helpful.

Thanks,
Patryk

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Setting negative value in dBm for power output (txpower)
  2011-10-21 21:35 Setting negative value in dBm for power output (txpower) Patryk Żółtowski
@ 2011-10-21 22:00 ` wwguy
  2011-10-21 22:02 ` Gábor Stefanik
  2011-10-22  1:44 ` Adrian Chadd
  2 siblings, 0 replies; 5+ messages in thread
From: wwguy @ 2011-10-21 22:00 UTC (permalink / raw)
  To: Patryk Żółtowski; +Cc: linux-wireless@vger.kernel.org

On Fri, 2011-10-21 at 14:35 -0700, Patryk Żółtowski wrote:
> I'm doing a research and I'm wondering if it's possible to hack
> wireless drivers to allow setting  txpower to smaller value than 1mW
> (e.g. 0.1mW = -10dBM, or even 0.01mW). I've checked source code and in
> net/mac80211/cfg.c there is the following check:
> 
>   if (mbm < 0 || (mbm % 100))
>                      return -EOPNOTSUPP;
> 
> and in  e.g. in drivers/net/wireless/iwlwifi/iwl-4965.h  also the min
> power output is limited by this define:
> 
>  IWL_TX_POWER_TARGET_POWER_MIN       (0)
> 
> Is it possible to modify source to allow negative power output in dBm
> that would work? Or is it physical limitation from the hardware? I'm
> doing just a research using Intel Corporation PRO/Wireless 4965 AG
> card  and right now I don't require to support other hardware. Is
> there any way to check minimum power output capability by given
> wireless card? I'm not proficient with driver hacking so any hint
> where to start (which file to look up, references) would be helpful.
> 
First, what kernel you are using, the latest iwlegacy driver does not
has IWL_TX_POWER_TARGET_POWER_MIN defined.

Also, for 4965, even the tx power table is filled and send by the
driver, but firmware still has the final call and I do not believe
negative power output is possible. Plus I don't think the tx power HCMD
can support negative value. 

BTW, 4965 is the last Intel WiFi device still has tx power table filled
by the driver, starting from 5000 series, tx power is control by the
firmware.

Thanks
Wey



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Setting negative value in dBm for power output (txpower)
  2011-10-21 21:35 Setting negative value in dBm for power output (txpower) Patryk Żółtowski
  2011-10-21 22:00 ` wwguy
@ 2011-10-21 22:02 ` Gábor Stefanik
  2011-10-22 13:30   ` Johannes Berg
  2011-10-22  1:44 ` Adrian Chadd
  2 siblings, 1 reply; 5+ messages in thread
From: Gábor Stefanik @ 2011-10-21 22:02 UTC (permalink / raw)
  To: Patryk Żółtowski; +Cc: linux-wireless

2011/10/21 Patryk Żółtowski <patryk.zoltowski@gmail.com>:
> I'm doing a research and I'm wondering if it's possible to hack
> wireless drivers to allow setting  txpower to smaller value than 1mW
> (e.g. 0.1mW = -10dBM, or even 0.01mW). I've checked source code and in
> net/mac80211/cfg.c there is the following check:
>
>  if (mbm < 0 || (mbm % 100))
>                     return -EOPNOTSUPP;

The "mbm % 100" part is even weirder; why do we even use millibels if
we only allow whole-decibel values?

>
> and in  e.g. in drivers/net/wireless/iwlwifi/iwl-4965.h  also the min
> power output is limited by this define:
>
>  IWL_TX_POWER_TARGET_POWER_MIN       (0)
>
> Is it possible to modify source to allow negative power output in dBm
> that would work? Or is it physical limitation from the hardware? I'm
> doing just a research using Intel Corporation PRO/Wireless 4965 AG
> card  and right now I don't require to support other hardware. Is
> there any way to check minimum power output capability by given
> wireless card? I'm not proficient with driver hacking so any hint
> where to start (which file to look up, references) would be helpful.
>
> Thanks,
> Patryk
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>



-- 
Vista: [V]iruses, [I]ntruders, [S]pyware, [T]rojans and [A]dware. :-)

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Setting negative value in dBm for power output (txpower)
  2011-10-21 21:35 Setting negative value in dBm for power output (txpower) Patryk Żółtowski
  2011-10-21 22:00 ` wwguy
  2011-10-21 22:02 ` Gábor Stefanik
@ 2011-10-22  1:44 ` Adrian Chadd
  2 siblings, 0 replies; 5+ messages in thread
From: Adrian Chadd @ 2011-10-22  1:44 UTC (permalink / raw)
  To: Patryk Żółtowski; +Cc: linux-wireless

Hi,

The AR9280 and later atheros NICs support a minimum TX power of -5 dBm.
It depends on what the actual NIC manufacturer does (if they glue an
amplifier on the end, then all bets are off) but the chipsets are
capable of it.

It's also possible someone's glued attenuators to pre-AR9280 series
NICs to achieve the same output. Or you could do the same.
But at that point you're not communicating < 0 dBm to the NIC, and I
don't think cfg80211 has the idea of a TX power offset (ie, that the
NIC output is +/- x dBm different to the programmed value.)

HTH,


Adrian

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Setting negative value in dBm for power output (txpower)
  2011-10-21 22:02 ` Gábor Stefanik
@ 2011-10-22 13:30   ` Johannes Berg
  0 siblings, 0 replies; 5+ messages in thread
From: Johannes Berg @ 2011-10-22 13:30 UTC (permalink / raw)
  To: Gábor Stefanik; +Cc: Patryk Żółtowski, linux-wireless

On Sat, 2011-10-22 at 00:02 +0200, Gábor Stefanik wrote:
> 2011/10/21 Patryk Żółtowski <patryk.zoltowski@gmail.com>:
> > I'm doing a research and I'm wondering if it's possible to hack
> > wireless drivers to allow setting  txpower to smaller value than 1mW
> > (e.g. 0.1mW = -10dBM, or even 0.01mW). I've checked source code and in
> > net/mac80211/cfg.c there is the following check:
> >
> >  if (mbm < 0 || (mbm % 100))
> >                     return -EOPNOTSUPP;
> 
> The "mbm % 100" part is even weirder; why do we even use millibels if
> we only allow whole-decibel values?

This is really just historic -- nobody has so far cared about TX power
enough to clean up the APIs for it etc. The distinction between
"automatic", "fixed" and "limited" (auto <= some value) is also not
really done very well here.

johannes


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-10-22 13:30 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-21 21:35 Setting negative value in dBm for power output (txpower) Patryk Żółtowski
2011-10-21 22:00 ` wwguy
2011-10-21 22:02 ` Gábor Stefanik
2011-10-22 13:30   ` Johannes Berg
2011-10-22  1:44 ` Adrian Chadd

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox