summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/mediatek
AgeCommit message (Collapse)Author
2020-03-24Merge tag 'wireless-drivers-next-2020-03-24' of ↵David S. Miller
git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next Kalle Valo says: ==================== wireless-drivers-next patches for v5.7 Second set of patches for v5.7. Lots of cleanup patches this time, but of course various new features as well fixes. When merging with wireless-drivers this pull request has a conflict in: drivers/net/wireless/intel/iwlwifi/pcie/drv.c To solve that just drop the changes from commit cf52c8a776d1 in wireless-drivers and take the hunk from wireless-drivers-next as is. The list of specific subsystem device IDs are not necessary after commit d6f2134a3831 (in wireless-drivers-next) anymore, the detection is based on other characteristics of the devices. Major changes: qtnfmac * support WPA3 SAE and OWE in AP mode ath10k * support for getting btcoex settings from Device Tree * support QCA9377 SDIO device ath11k * add HE rate accounting * add thermal sensor and cooling devices mt76 * MT7663 support for the MT7615 driver ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2020-03-23mt76: mt7615: add missing declaration in mt7615.hLorenzo Bianconi
Add mt7615_mcu_wait_response declaration in mt7615.h since it will be reused adding usb support to mt7615 driver Reported-by: kbuild test robot <lkp@intel.com> Fixes: 044a43256a35 ("mt76: mt7615: introduce mt7615_mcu_wait_response") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/d341335a636b6ccd088dd2cfeec2d296eb4dc8c7.1584534454.git.lorenzo@kernel.org
2020-03-23mt76: mt7615: fix endianness in unified commandLorenzo Bianconi
Fix cid field endianness in unified mt7615_uni_txd header Reported-by: kbuild test robot <lkp@intel.com> Fixes: 323d7daad363 ("mt76: mt7615: introduce uni cmd command types") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/2447b399d3c63885d43f65ba988c057fa96f5236.1584534454.git.lorenzo@kernel.org
2020-03-23mt76: mt7615: fix mt7663e firmware struct endiannessLorenzo Bianconi
Convert fields in mt7663_fw_trailer and mt7663_fw_buf to little-endian Reported-by: kbuild test robot <lkp@intel.com> Fixes: f40ac0f3d3c0 ("mt76: mt7615: introduce mt7663e support") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Link: https://lore.kernel.org/r/d14dfd7cd91a4dda8c5dcd03e8a70ff11314182e.1584534454.git.lorenzo@kernel.org
2020-03-17mt76: mt7615: introduce mt7663e supportLorenzo Bianconi
Introduce support for mt7663e 802.11ac 2x2:2 chipset to mt7615 driver. Co-developed-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Co-developed-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-03-17mt76: mt7615: get rid of sta_rec_wtbl data structureLorenzo Bianconi
Sobstitute sta_rec_wtbl data structure with tlv one Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-03-17mt76: mt7615: introduce set_ba uni commandLorenzo Bianconi
Introduce mt7615_mcu_uni_set_ba routine in order to add support for mt7663e driver Co-developed-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-03-17mt76: mt7615: add more uni mcu commandsSean Wang
Introduce mt7615_mcu_uni_set_bss, mt7615_mcu_uni_set_dev and mt7615_mcu_uni_set_beacon_offload uni mcu commands. This is a preliminary patch to add mt7663e support Signed-off-by: Sean Wang <sean.wang@mediatek.com> Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-03-17mt76: mt7615: introduce set_bmc and st_sta for uni commandsLorenzo Bianconi
Introduce mt7615_mcu_uni_set_bmc and mt7615_mcu_uni_set_sta routines for mt7663e commands. Co-developed-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-03-17mt76: mt7615: introduce uni cmd command typesLorenzo Bianconi
Introduce mcu uni command type. Uni commands rely on a stripped verions of mt7615_mcu_txd data strutture. Split mt7615_mcu_txd_common and mt7615_mcu_txd. Uni commands will be use by mt7663e driver Co-developed-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-03-17mt76: mt7615: introduce mt7615_init_mac_chain routineLorenzo Bianconi
Introduce mt7615_init_mac_chain routine to configure per band mac register since new devices (e.g. mt7663e) do not support dbdc Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-03-17mt76: mt7615: introduce mt7615_eeprom_parse_hw_band_cap routineLorenzo Bianconi
Introduce mt7615_eeprom_parse_hw_band_cap routine in order to configure supported band for mt7663e and mt7622 devices since they do not rely on eeprom data to enable 2GHz/5GHz bands Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-03-17mt76: mt7615: add mt7663e support to mt7615_mcu_set_eepromLorenzo Bianconi
Extend mt7615_mcu_set_eeprom routine in order to be reused adding mt7663e support to mt7615 driver Co-developed-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Co-developed-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-03-17mt76: mt7615: add mt7663e support to mt7615_{driver,firmware}_ownLorenzo Bianconi
Extend mt7615_driver_own and mt7615_firmware_own in order to reuse them adding mt7663e support to mt7615 driver Co-developed-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Co-developed-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-03-17mt76: mt7615: add mt7663e support to mt7615_reg_mapLorenzo Bianconi
Introduce mt7663e support to mt7615_reg_map routine in order to reuse it adding support for mt7663e driver Co-developed-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Co-developed-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-03-17mt76: mt7615: introduce mt7615_register_mapLorenzo Bianconi
In order to reuse mt7615 code adding support for mt7663e driver, introduce mt7615e_reg_map since mt7663e and mt7615 rely on a different base registers definitions. Co-developed-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Co-developed-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-03-17mt76: mt7615: introduce MCU_FW_PREFIX for fw mcu commandsLorenzo Bianconi
Currently fw commands rely on negative cmds since they need different mcu msg metadata. Extend this approach introducing MCU_FW_PREFIX. This is a preliminary patch to support new mt7663e firmware commands Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-03-17mt76: mt7615: move more mcu commands in mt7615_mcu_ops data structureLorenzo Bianconi
Move mt7615_mcu_set_beacon_offload, mt7615_mcu_set_dev and mt7615_mcu_set_bss routine in mt7615_mcu_ops data structure. This is a preliminary patch to support mt7663 firmware Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-03-17mt76: mt7615: rework mt7615_mcu_set_bss_info using skb APIsLorenzo Bianconi
Simplify mt7615_mcu_set_bss_info relying on mcu tlv helpers Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-03-17mt76: mt7615: rely on skb API for mt7615_mcu_set_eepromLorenzo Bianconi
Rely on skb API and avoid kmalloc the buffer in mt7615_mcu_set_eeprom routine Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-03-17mt76: mt7615: move mt7615_mcu_set_sta in mt7615_mcu_opsLorenzo Bianconi
Move mt7615_mcu_set_sta for fw version 1 and version 2 in mt7615_mcu_ops data structure. This is a preliminary patch to properly support mt7663e firmware. Rework utility routines to rely on skb APIs for msg parsing Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-03-17mt76: mt7615: move mt7615_mcu_set_bmc to mt7615_mcu_opsLorenzo Bianconi
Move mt7615_mcu_set_bmc for fw version 1 and version 2 in mt7615_mcu_ops data structure. This is a preliminary patch to properly support mt7663e firmware. Rework utility routines to rely on skb APIs for msg parsing Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-03-17mt76: mt7615: add mt7615_mcu_ops data structureLorenzo Bianconi
Introduce mt7615_mcu_ops data structure in order to support multiple mcu ops API. Move mt7615_mcu_set_{tx,rx}_ba to mt7615_mcu_ops differentiating between fw v1 and v2. This is a preliminary patch to properly support mt7663e firmware. Rework utility routines to rely on skb APIs for msg parsing Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-03-17mt76: mt7615: introduce mt7615_mcu_send_message routineLorenzo Bianconi
Introduce mt7615_mcu_send_message routine in order to allocate mcu skb out of mcu sending routine. This approach is useful when the mcu message is complicated and it is convenient to rely on skb buffer API Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-03-17mt76: always init to 0 mcu messagesLorenzo Bianconi
Always initialize to 0 mcu messages since if they are not propely configured they could hang the firmware. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-03-17mt76: mt7615: introduce mt7615_init_device routineLorenzo Bianconi
Add mt7615_init_device routine in order to be reused adding support for mt7663 in mt7615 driver Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-03-17mt76: mt7615: cleanup fw queue just for mmio devicesLorenzo Bianconi
In order to reuse mt7615_mcu_send_firmware routine adding support for usb devices, clean fw hw queue just for mmio devices Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-03-17mt76: mt7615: introduce mt7615_mcu_wait_responseLorenzo Bianconi
Introduce mt7615_mcu_wait_response in order to be reused parsing mt7663u mcu messages Co-developed-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-03-17mt76: mt7615: introduce mt7615_mcu_fill_msgLorenzo Bianconi
Introduce mt7615_mcu_fill_msg routine to initialize mcu messages. mt7615_mcu_fill_msg will be reused adding mt7663u support Co-developed-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Sean Wang <sean.wang@mediatek.com> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-03-17mt76: remove variable 'val' set but not usedChen Wandun
Fixes gcc '-Wunused-but-set-variable' warning: drivers/net/wireless/mediatek/mt76/mt76x0/phy.c: In function mt76x0_phy_rf_init: drivers/net/wireless/mediatek/mt76/mt76x0/phy.c:1158:5: warning: variable val set but not used [-Wunused-but-set-variable] Fixes: 10de7a8b4ab9 ("mt76x0: phy files") Signed-off-by: Chen Wandun <chenwandun@huawei.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-03-17mt76: mt7615: remove a stray if statementDan Carpenter
This if statement was supposed to be deleted, but it wasn't. It means that we sometimes don't set the sensitivity correctly. Fixes: 2cad515ece8a ("mt76: mt7615: add missing settings for simultaneous dual-band support") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-03-17mt76: mt76x02: reset MCU timeout counter earlier in watchdog resetFelix Fietkau
Ensure that MCU commands issued right after hardware reset are not dropped and treated as failed. Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-03-17mt76: mt7615: fix monitor injection of beacon framesFelix Fietkau
When injecting beacon frames via monitor interface, they must not be sent to the beacon hardware queue, because they don't follow normal hardware beacon tx rules. Fix sending them by adding a flag to mt7615_mac_write_txwi that selects the beacon queue for tx, and use it only from mt7615_mcu_set_bcn. Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-03-17mt76: mt7603: make dynamic sensitivity adjustment configurable via debugfsFelix Fietkau
In some cases it may be useful for debugging to disable this feature Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-03-17mt76: mt7603: add upper limit for dynamic sensitivity minimum receive powerFelix Fietkau
If the minimum power is raised too much, it can make it impossible for weaker clients to connect, and there are some scenarios where the false detects will not go down no matter how much the sensitivity is adjusted. Fixes connectivity issues in some rare cases Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-03-17mt76: mt7615: fix antenna mask initialization in DBDC modeFelix Fietkau
Update wiphy available antenna mask, and fix chainmask setting on 3x3 hardware Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-03-17mt76: mt76u: rely only on data buffer for usb control messaggesLorenzo Bianconi
Starting from commit 'a6bfb6d13f33 ("mt76: usb: use max packet length for m76u_copy")' reg_val does not share memory with usb data buffer. On non-coherent devices this approach can corrupt data pointer since data and reg_val share the same cache-line, resulting in the following crash: [ 371.544901] CPU 0 Unable to handle kernel paging request at virtual address 00000000, epc == 8042fbb0 [ 371.558521] CPU: 0 PID: 11 Comm: kworker/u2:2 Not tainted 4.14.160 #0 [ 371.565204] Workqueue: mt76u mt76u_deinit [mt76_usb] [ 371.570331] task: 83823ac0 task.stack: 8386c000 [ 371.575004] $ 0 : 00000000 80590000 00000000 00000000 [ 371.580407] $ 4 : 82edaad0 00000002 83823ac0 fffffff8 [ 371.585810] $ 8 : fffffffd 0000fc00 8052da00 00000000 [ 371.591212] $12 : 000b2285 ae53a1a9 00108845 89da44c4 [ 371.596615] $16 : 82edaad0 82ed9d20 00001798 832edf00 [ 371.602019] $20 : 00000000 8386dda8 80530000 fffffffe [ 371.607421] $24 : 8051d040 76274d1b [ 371.612824] $28 : 8386c000 8386dd88 82edaad4 830d4d50 [ 371.618228] Hi : 000000f7 [ 371.621203] Lo : 33333371 [ 371.624196] epc : 8042fbb0 __mutex_lock.isra.2+0x134/0x378 [ 371.630043] ra : 830d4d50 mt76u_deinit+0x418/0xa6c [mt76_usb] [ 371.636237] Status: 1000fc03KERNEL EXL IE [ 371.640557] Cause : 0080000c (ExcCode 03) [ 371.644696] BadVA : 00000000 [ 371.647671] PrId : 00019374 (MIPS 24Kc) [ 371.726123] usbcore nls_base usb_common [ 371.730180] Process kworker/u2:2 (pid: 11, threadinfo=8386c000, task=83823ac0, tls=00000000) [ 371.738884] Stack : 833d009c 83210b4c 82ed8bc0 8386ddac 000001ff 8008ac50 8386ddac 83b74b00 [ 371.747519] 82edaad4 00000000 83b74b48 83210c38 82edaad0 82ed9d20 00001798 832edf00 [ 371.756157] 00000000 00000000 80530000 fffffffe 80530000 830d4d50 00000040 8389d850 [ 371.764794] 8052d9d8 8389d850 8386de30 82ed9d20 8386de5f 831c27bc 833d48ec 8052d9d8 [ 371.773431] 83823ac0 83823af0 82edab00 82ed9d20 8386de5f 831c5c30 00000000 8052d9a8 [ 371.782069] ... [ 371.784598] Call Trace: [ 371.787130] [<8042fbb0>] __mutex_lock.isra.2+0x134/0x378 [ 371.792622] [<830d4d50>] mt76u_deinit+0x418/0xa6c [mt76_usb] [ 371.808546] [ 371.810920] ---[ end trace c62f0601f6730eb0 ]--- [ 371.818101] Kernel panic - not syncing: Fatal exception [ 371.824420] Rebooting in 3 seconds.. Fix the issue relying only on data buffer to send/receive usb control messages Fixes: a6bfb6d13f33 ("mt76: usb: use max packet length for m76u_copy") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-03-17mt76: mt76u: fix a possible memory leak in mt76u_initLorenzo Bianconi
Remove usb workqueue if mt76u_set_endpoints fails. Fixes: 284efb473ef5 ("mt76: mt76u: rely on a dedicated stats workqueue") Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-03-17mt76: mt76u: loop over all possible rx queues in mt76u_rx_taskletLorenzo Bianconi
Loop over all possible hw rx queues in mt76u_rx_tasklet since new devices will report mcu events through mcu hw queue Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-03-12Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/netDavid S. Miller
Minor overlapping changes, nothing serious. Signed-off-by: David S. Miller <davem@davemloft.net>
2020-03-03mt76: fix array overflow on receiving too many fragments for a packetFelix Fietkau
If the hardware receives an oversized packet with too many rx fragments, skb_shinfo(skb)->frags can overflow and corrupt memory of adjacent pages. This becomes especially visible if it corrupts the freelist pointer of a slab page. Cc: stable@vger.kernel.org Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2020-02-14mt76: Introduce mt76_mcu data structureLorenzo Bianconi
Introduce mt76_mcu data structure to contain common fields between mt76u_mcu and mt76e_mcu. Initialize mcu common fields in mt76_alloc_device(). Rely on mt76_mcu in mt76_mcu_rx_event and in mt76_mcu_get_response in order to reuse them in usb code Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-02-14mt76: mt7615: remove rx_mask in mt7615_eeprom_parse_hw_capLorenzo Bianconi
Get rid of rx_mask in mt7615_eeprom_parse_hw_cap routine since it is not actually used Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-02-14mt76: mt76u: rename stat_wq in wqLorenzo Bianconi
Rename usb stat_wq in wq in order to be reused not just for gathering hw tx statistics Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-02-14mt76: mt76u: extend RX scatter gather numberSean Wang
Set RX scatter gather number to 4 in order to extend the maximum AMSDU size to 11,454. Signed-off-by: Sean Wang <sean.wang@mediatek.com> Co-developed-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-02-14mt76: mt7615: rely on mt76_queues_read for mt7622Lorenzo Bianconi
As previous devices, mt7622 relies on multiple hw queues while for mt7615 we have just on per band hw queue and the mcu demux the traffic according to the packet AC. In order to dump all configured hw queues, rely on mt76_queues_read for mt7622 in mt7615 debugfs Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-02-14mt76: do not set HOST_BROADCAST_PS_BUFFERING for mt7615Felix Fietkau
mt7615 handles powersave buffering in firmware Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-02-14mt76: mt7615: rework rx phy index handlingFelix Fietkau
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>
2020-02-14mt76: fix rounding issues on converting per-chain and combined txpowerFelix Fietkau
Unify code converting between the different txpower values. Always add/remove the combined txpower delta before dividing half-dB values. Also fix the combined txpower delta values. The correct half-dB delta for 3 chains is 9, not 8. Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-02-14mt76: mt76x2: avoid starting the MAC too earlyFelix Fietkau
Do not set the tx/rx start bits in MT_MAC_SYS_CTRL from within initvals. The driver sets these later when the hardware is ready Signed-off-by: Felix Fietkau <nbd@nbd.name>