mt76: mt7615: rework rx phy index handling
authorFelix Fietkau <nbd@nbd.name>
Wed, 12 Feb 2020 08:07:49 +0000 (09:07 +0100)
committerFelix Fietkau <nbd@nbd.name>
Fri, 14 Feb 2020 09:06:09 +0000 (10:06 +0100)
commit0e544cb59c9a67d91e5356b0294991948d5ebdbe
tree1cab0aff6ab48c561020ccd9805f46e1c677483e
parent07cda406308b7d11cb77c406044b52752049e78d
mt76: mt7615: rework rx phy index handling

Overwriting the RMAC_CHFREQ register is not reliable enough, as the firmware
could potentially write it again.
Since there is no PHY index indication in the rx info, we need to use another
way:

If both PHYs are using different channels, find the PHY where chfreq matches
the register value.

The only corner case remaining is when both PHYs are using the same channel.
In that case, the per-packet noise value on the primary PHY will have
information belonging to the chains of the secondary PHY from the previous
received packet of that PHY. The secondary PHY will set noise to 0 for extra
chains.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
drivers/net/wireless/mediatek/mt76/mt7615/mac.c
drivers/net/wireless/mediatek/mt76/mt7615/mac.h
drivers/net/wireless/mediatek/mt76/mt7615/main.c
drivers/net/wireless/mediatek/mt76/mt7615/mt7615.h