Skip to contentSkip to conversation

mt76: add 3dBm for reporting txpower also for 1x1

RFC In review Stanislaw Gruszka 3 participants 5 messages Mar 13, 2019 – Mar 14, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC 1/1 mt76: add 3dBm for reporting txpower also for 1x1

It's not clear for my why we should add 3dBm for 2x2 devices and not for 1x1. 3dBm looks rater like minimal txpower and hardware transmit at 3dBm + dev->txpower_cur / 2 .

With the change reported txpower value are closer to regulatory values, but honestly I have no idea what should be reported.

Perhaps also some better comment should be added.

---
 drivers/net/wireless/mediatek/mt76/mac80211.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/net/wireless/mediatek/mt76/mac80211.c +1 -7
index 851caabbecda..b04652729112 100644
@@ -733,15 +733,9 @@ int mt76_get_txpower(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
 		     int *dbm)
 {
 	struct mt76_dev *dev = hw->priv;
-	int n_chains = hweight8(dev->antenna_mask);
 
 	*dbm = dev->txpower_cur / 2;
-
-	/* convert from per-chain power to combined
-	 * output on 2x2 devices
-	 */
-	if (n_chains > 1)
-		*dbm += 3;
+	*dbm += 3;
 
 	return 0;
 }
Signature · 1 line
1.9.3
maintainer
#1 lore raw
Quoted 10 lines · Stanislaw Gruszka

It's not clear for my why we should add 3dBm for 2x2 devices and not for 1x1. 3dBm looks rater like minimal txpower and hardware transmit at 3dBm + dev->txpower_cur / 2 .

With the change reported txpower value are closer to regulatory values, but honestly I have no idea what should be reported.

Perhaps also some better comment should be added.

The reason why we add 3dBm is because using two chains to transmit in the worst case (from regulatory point of view) doubles the transmit power (= +3dBm). There's no reason to do the same for 1x1.

- Felix

#2 lore raw
Quoted 3 lines · Felix Fietkau

The reason why we add 3dBm is because using two chains to transmit in the worst case (from regulatory point of view) doubles the transmit power (= +3dBm).

An absurd idea that probably came from some misinformed regulatory boys. There is no way to have 3dBm higher output power just because an additional antenna exist. Even with 3x3 case it already proves as inconsistent since there is no 6dB decrease but 5dB.
If this were to continue it would render 8x8 wifi AP useless.

maintainer
#3 lore raw
Quoted 10 lines · Tom Psyborg
Quoted 3 lines · Felix Fietkau

The reason why we add 3dBm is because using two chains to transmit in the worst case (from regulatory point of view) doubles the transmit power (= +3dBm).

An absurd idea that probably came from some misinformed regulatory boys. There is no way to have 3dBm higher output power just because an additional antenna exist. Even with 3x3 case it already proves as inconsistent since there is no 6dB decrease but 5dB.

Why would it be 6dB for 3x3? It's logarithmic:
2x2: 3dB
3x3: ~4.5dB
4x4: ~6dB
8x8: ~9dB

You may not get +3dB actual output, but you do get some boost from the extra chain.

- Felix

#4 lore raw
In reply to Felix Fietkau
Quoted 8 lines · Felix Fietkau
Quoted 7 lines · Stanislaw Gruszka

It's not clear for my why we should add 3dBm for 2x2 devices and not for 1x1. 3dBm looks rater like minimal txpower and hardware transmit at 3dBm + dev->txpower_cur / 2 .

With the change reported txpower value are closer to regulatory values, but honestly I have no idea what should be reported.

Quoted 6 lines
Quoted 3 lines

Perhaps also some better comment should be added.

The reason why we add 3dBm is because using two chains to transmit in the worst case (from regulatory point of view) doubles the transmit power (= +3dBm). There's no reason to do the same for 1x1.

Do we calculate and show correct txpower for mt76x0 then?

I have mt76x0u 50:3e:aa:a6:5d:32 and iwlmvm 1c:1b:b5:23:cf:58 devices on one laptop at the same location connected to AP. RSSI values of both stations are quite similar:

Station 50:3e:aa:a6:5d:32 (on wlan0)

        inactive time:  4971 ms
        rx bytes:       11383
        rx packets:     97
        tx bytes:       2764
        tx packets:     17
        tx retries:     3
        tx failed:      1
        signal:         -55 [-65, -55] dBm
        signal avg:     -57 [-65, -57] dBm
        tx bitrate:     65.0 MBit/s MCS 6 short GI
        rx bitrate:     6.0 MBit/s
        authorized:     yes
        authenticated:  yes
        preamble:       long
        WMM/WME:        yes
        MFP:            no
        TDLS peer:      no
Station 1c:1b:b5:23:cf:58 (on wlan0)
        inactive time:  24261 ms
        rx bytes:       11320
        rx packets:     121
        tx bytes:       2274
        tx packets:     11
        tx retries:     0
        tx failed:      1
        signal:         -52 [-60, -52] dBm
        signal avg:     -54 [-59, -55] dBm
        tx bitrate:     6.5 MBit/s MCS 0
        rx bitrate:     6.0 MBit/s
        authorized:     yes
        authenticated:  yes
        preamble:       long
        WMM/WME:        yes
        MFP:            no
        TDLS peer:      no

On laptop txpower showed by iw for mt76x0u is 17 dBm , for iwlmvm is 22 dBm (this is value from mac80211, iwlwifi does not implement .get_txpower() callback).

I do not consider this as big issue though, but can confuse some users. Apparently confuses me.

Stanislaw