Fix typo in 5GHz power vs channel eeprom parsing
Fixes: 7bc04215a66b ("mt76: add driver code for MT76x2e")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Initialize mt76_txq pointer after ieee80211_txq pointer check.
Remove space after the pointer cast
Fixes: 7bc04215a66b ("mt76: add driver code for MT76x2e")
Signed-off-by: Lorenzo Bianconi <[email protected]>
Currently if the allocation of skb fails and returns NULL then the
call to skb_put will cause a null pointer dereference. Fix this by
checking for a null skb and returning NULL. Note that calls to
function mt76x2_mcu_msg_alloc don't directly check the null return
but instead pass the NULL pointer to mt76x2_mcu_msg_send which
checks for the NULL and returns ENOMEM in this case.
Detected by CoverityScan, CID#1462624 ("Dereference null return value")
Fixes: 7bc04215a66b ("mt76: add driver code for MT76x2e")
Signed-off-by: Colin Ian King <[email protected]>
mt76x2_mac_start writes dev->rxfilter to the hardware. It also happens
during init, before dev->rxfilter is filled with the initval register
value, leading to issues like promisc mode being enabled
unconditionally.
Fix this by reading the default value into dev->rxfilter earlier
Signed-off-by: Lorenzo Bianconi <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>
Due to an unrelated issue, the MT_RX_FILTR_CFG_PROMISC flag is currently
unset, which means that monitor mode is unconditionally enabled.
Toggle this flag based on the mac80211 monitor mode setting instead
Signed-off-by: Felix Fietkau <[email protected]>
It can happen during normal operation and it confuses users more than it
actually helps. workaround trigger counts are still available via
debugfs
Signed-off-by: Felix Fietkau <[email protected]>
Hardware encryption seems to break encrypted unicast mgmt tx.
Unfortunately the hardware TXWI header does not have a bit to indicate
that a frame is software encrypted, so sw-encrypted frames need to use a
different WCID. For that to work, the CCMP PN needs to be generated in
software, which makes things a bit slower, so only do it for keys that
also need to tx management frames.
Signed-off-by: Felix Fietkau <[email protected]>
The rx WCID lookup table and the per-WCID rate table only have 128
entries. All further WCID entries are tx-only.
Signed-off-by: Felix Fietkau <[email protected]>
On some routers, the manufacturer has made a mistake and left the chip
ID part of the EEPROM empty (it is set to 0x0000). One such router is
the ZBT-WE1026-5G (equipped with MT7612), and the consequence is that
the EEPROM check fails and the 5GHz wifi does not work at all. When
setting the chip ID to 0x7612 manually, the 5GHz wifi works fine.
When looking at EEPROM of the WE1026 (and other devices equipped with
mt76x2), I see that the PCI ID is always set to a valid value (7612 or
7662). This PR works around the issue of an empty chip ID by using the
PCI ID, if chip ID is 0. After applying this PR/patch manually to mt76,
the 5GHz on the WE1026 works out of the box. Since the PCI ID is only
used if chip ID is empty, devices with correct EEPROMs are not affected.
Signed-off-by: Kristian Evensen <[email protected]>