public inbox for linux-wireless@vger.kernel.org
 help / color / mirror / Atom feed
* nl80211: missing minimum TX power attribute causes misleading userspace behavior
@ 2026-04-09  8:05 Steffen May
  2026-04-09 15:27 ` Ben Greear
  0 siblings, 1 reply; 3+ messages in thread
From: Steffen May @ 2026-04-09  8:05 UTC (permalink / raw)
  To: linux-wireless


This issue was discovered during the analysis of two documented OpenWrt 
bugs. Bug 1 is a type comparison error in LuCI wireless.js that causes 0 
dBm to be displayed incorrectly. Bug 2 is in ucode mac80211.sh where the 
value 0 is treated as falsy, causing the router to transmit at maximum 
power instead. Both bugs are proven and reported.

During verification of Bug 2 on five devices with three different 
chipsets, it became apparent that the hardware floor is device-dependent 
and completely unknown to the stack. This is not a bug but a missing 
feature.

Because the floor is unknown, iwinfo generates selection lists 
containing values that have no real effect on the actual output power. 
Userspace accepts configurations such as 0 dBm even though the hardware 
cannot apply them. The system reports success while the hardware remains 
at its minimum supported level. This creates false assumptions.

Measurements

The deviation between the requested transmit power and the actual 
hardware floor is not constant but depends on the hardware:

Device                Chipset            Requested     Actual floor   
Difference
Buffalo WZR-600DHP    Atheros AR7161     1 dBm         3 dBm          +2 
dB
TP-Link Archer C7     Qualcomm QCA9558   1 dBm         5 dBm          +4 
dB
OpenWrt One           MTK Filogic        1 dBm         1 dBm           0 
dB
Cudy WR3000           MTK Filogic        1 dBm         1 dBm           0 
dB
GL.iNet GL-MT6000     MTK Filogic        1 dBm         1 dBm           0 
dB

Concrete example: Buffalo WZR-600DHP with Atheros AR7161

Because the system does not know the actual floor, the list generated by 
iwinfo contains values with no real effect:

0 dBm (1 mW)  reported, hardware remains at floor
1 dBm (1 mW)  reported, no actual reduction
2 dBm (1 mW)  reported, no actual reduction
3 dBm (1 mW)  actual hardware floor
4 dBm (2 mW)  first real power step above the floor

Proposed solution

Introduction of a new nl80211 attribute NL80211_ATTR_WIPHY_TX_POWER_MIN. 
nl80211 already exposes the maximum transmit power. Minimum and maximum 
are both fixed hardware properties -- it is inconsistent that only one 
of the two values is available.

No patch is provided. This mail is intended to describe the problem and 
to encourage interest in an implementation.

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

* Re: nl80211: missing minimum TX power attribute causes misleading userspace behavior
  2026-04-09  8:05 nl80211: missing minimum TX power attribute causes misleading userspace behavior Steffen May
@ 2026-04-09 15:27 ` Ben Greear
  0 siblings, 0 replies; 3+ messages in thread
From: Ben Greear @ 2026-04-09 15:27 UTC (permalink / raw)
  To: Steffen May, linux-wireless

On 4/9/26 01:05, Steffen May wrote:
> 
> This issue was discovered during the analysis of two documented OpenWrt bugs. Bug 1 is a type comparison error in LuCI wireless.js that causes 0 dBm to be 
> displayed incorrectly. Bug 2 is in ucode mac80211.sh where the value 0 is treated as falsy, causing the router to transmit at maximum power instead. Both bugs 
> are proven and reported.
> 
> During verification of Bug 2 on five devices with three different chipsets, it became apparent that the hardware floor is device-dependent and completely 
> unknown to the stack. This is not a bug but a missing feature.
> 
> Because the floor is unknown, iwinfo generates selection lists containing values that have no real effect on the actual output power. Userspace accepts 
> configurations such as 0 dBm even though the hardware cannot apply them. The system reports success while the hardware remains at its minimum supported level. 
> This creates false assumptions.
> 
> Measurements
> 
> The deviation between the requested transmit power and the actual hardware floor is not constant but depends on the hardware:
> 
> Device                Chipset            Requested     Actual floor Difference
> Buffalo WZR-600DHP    Atheros AR7161     1 dBm         3 dBm          +2 dB
> TP-Link Archer C7     Qualcomm QCA9558   1 dBm         5 dBm          +4 dB
> OpenWrt One           MTK Filogic        1 dBm         1 dBm           0 dB
> Cudy WR3000           MTK Filogic        1 dBm         1 dBm           0 dB
> GL.iNet GL-MT6000     MTK Filogic        1 dBm         1 dBm           0 dB

If you set that tplink to 1dbm, and then read the reported power, does it properly show 5dbm?

If so, that seems good enough?

If not, then we should fix the reporting, but having a floor reported doesn't seem helpful
to me.  There are lots of things that can affect actual txpower.  User-space can at best
offer its suggestion of preferred txpower.  Kernel/driver/firmware/hardware then makes final
decision.

Thanks,
Ben

-- 
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com



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

* Re: nl80211: missing minimum TX power attribute causes misleading userspace behavior
@ 2026-04-10  6:55 May
  0 siblings, 0 replies; 3+ messages in thread
From: May @ 2026-04-10  6:55 UTC (permalink / raw)
  To: Ben Greear; +Cc: linux-wireless


Confirmed on two devices:

TP-Link Archer C7 v2 (QCA9558): txpower=1, iwinfo reports 5 dBm
Buffalo WZR-600DHP (AR7161): txpower=1, iwinfo reports 3 dBm

Reporting is accurate -- iwinfo reflects the actual hardware floor, not the requested value.

To clarify: this was never intended as a bug report but a feature request. The hardware floor is device-dependent and cannot be queried by userspace. It would be useful if this minimum were made available, so that LuCI can offer only values the hardware can actually deliver.

Steffen


Am 09.04.2026 um 17:27 schrieb Ben Greear <greearb@candelatech.com>:

On 4/9/26 01:05, Steffen May wrote:
> This issue was discovered during the analysis of two documented OpenWrt bugs. Bug 1 is a type comparison error in LuCI wireless.js that causes 0 dBm to be displayed incorrectly. Bug 2 is in ucode mac80211.sh where the value 0 is treated as falsy, causing the router to transmit at maximum power instead. Both bugs are proven and reported.
> During verification of Bug 2 on five devices with three different chipsets, it became apparent that the hardware floor is device-dependent and completely unknown to the stack. This is not a bug but a missing feature.
> Because the floor is unknown, iwinfo generates selection lists containing values that have no real effect on the actual output power. Userspace accepts configurations such as 0 dBm even though the hardware cannot apply them. The system reports success while the hardware remains at its minimum supported level. This creates false assumptions.
> Measurements
> The deviation between the requested transmit power and the actual hardware floor is not constant but depends on the hardware:
> Device                Chipset            Requested     Actual floor Difference
> Buffalo WZR-600DHP    Atheros AR7161     1 dBm         3 dBm          +2 dB
> TP-Link Archer C7     Qualcomm QCA9558   1 dBm         5 dBm          +4 dB
> OpenWrt One           MTK Filogic        1 dBm         1 dBm           0 dB
> Cudy WR3000           MTK Filogic        1 dBm         1 dBm           0 dB
> GL.iNet GL-MT6000     MTK Filogic        1 dBm         1 dBm           0 dB

If you set that tplink to 1dbm, and then read the reported power, does it properly show 5dbm?

If so, that seems good enough?

If not, then we should fix the reporting, but having a floor reported doesn't seem helpful
to me.  There are lots of things that can affect actual txpower.  User-space can at best
offer its suggestion of preferred txpower.  Kernel/driver/firmware/hardware then makes final
decision.

Thanks,
Ben

--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc  http://www.candelatech.com




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

end of thread, other threads:[~2026-04-10  6:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-09  8:05 nl80211: missing minimum TX power attribute causes misleading userspace behavior Steffen May
2026-04-09 15:27 ` Ben Greear
  -- strict thread matches above, loose matches on Subject: below --
2026-04-10  6:55 May

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