aboutsummaryrefslogtreecommitdiff
path: root/drivers/net
AgeCommit message (Collapse)AuthorFilesLines
2023-02-03wifi: mt76: add EHT phy typeShayne Chen2-2/+9
Extend phy type and phymode bitfields for EHT support. This is the preliminary patch to add EHT support for mt7996. Signed-off-by: Shayne Chen <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: remove __mt76_mcu_restart macroLorenzo Bianconi1-1/+0
__mt76_mcu_restart is no longer used Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: mt7996: avoid mcu_restart function pointerLorenzo Bianconi1-23/+22
Run mt7996_mcu_restart routine directly and avoid mcu_restart function pointer whenever it is possible. Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: mt7996: rely on mt76_connac_tx_complete_skbLorenzo Bianconi4-36/+1
Drop mt7996_tx_complete_skb routine since it is equivalent to mt76_connac_tx_complete_skb(). Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: mt7996: rely on mt76_connac_txp_skb_unmapLorenzo Bianconi1-13/+1
Drop mt7996_txp_skb_unmap routine since it is equivalent to mt76_connac_txp_skb_unmap(). Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: mt7996: rely on mt76_connac_txp_common structureLorenzo Bianconi3-33/+22
mt7996_txp structure is equal to mt76_connac_fw_txp one. Drop mt7996_txp and rely on mt76_connac_txp_common. Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: mt7996: rely on mt76_connac2_mac_tx_rate_valLorenzo Bianconi3-49/+9
In order to fix a possible NULL pointer dereference in mt7996_mac_write_txwi() of vif pointer, export mt76_connac2_mac_tx_rate_val utility routine and reuse it in mt7996 driver. Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices") Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: mt7921: fix error code of return in mt7921_acpi_readAaron Ma1-2/+5
Kernel NULL pointer dereference when ACPI SAR table isn't implemented well. Fix the error code of return to mark the ACPI SAR table as invalid. [ 5.077128] mt7921e 0000:06:00.0: sar cnt = 0 [ 5.077381] BUG: kernel NULL pointer dereference, address: 0000000000000004 [ 5.077630] #PF: supervisor read access in kernel mode [ 5.077883] #PF: error_code(0x0000) - not-present page [ 5.078138] PGD 0 P4D 0 [ 5.078398] Oops: 0000 [#1] PREEMPT SMP NOPTI [ 5.079202] RIP: 0010:mt7921_init_acpi_sar+0x106/0x220 [mt7921_common] ... [ 5.080786] Call Trace: [ 5.080786] <TASK> [ 5.080786] mt7921_register_device+0x37d/0x490 [mt7921_common] [ 5.080786] mt7921_pci_probe.part.0+0x2ee/0x310 [mt7921e] [ 5.080786] mt7921_pci_probe+0x52/0x70 [mt7921e] [ 5.080786] local_pci_probe+0x47/0x90 [ 5.080786] pci_call_probe+0x55/0x190 [ 5.080786] pci_device_probe+0x84/0x120 Fixes: f965333e491e ("mt76: mt7921: introduce ACPI SAR support") Signed-off-by: Aaron Ma <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: mt7915: release rxwi in mt7915_wed_release_rx_bufSujuan Chen3-1/+5
Free rxwi cache releasing WED rx buffers in mt7915_wed_release_rx_buf routine Tested-by: Daniel Golle <[email protected]> Co-developed-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Sujuan Chen <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: enable page_pool statsLorenzo Bianconi4-14/+59
Enable page_pool ethtool statistics for mt7915 and mt7921 chipsets. Tested-by: Felix Fietkau <[email protected]> Tested-by: Deren Wu <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: switch to page_pool allocatorLorenzo Bianconi6-94/+139
In order to reduce possible memory allocation failures due to memory fragmentation caused by page_frag_cache allocator, switch to page_pool allocator for dma and usb mt76 drivers. Remove per rx-queue page_frag_cache Co-developed-by: Felix Fietkau <[email protected]> Tested-by: Deren Wu <[email protected]> Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: mt7915: fix memory leak in mt7915_mmio_wed_init_rx_bufLorenzo Bianconi1-1/+8
Free mt76_txwi_cache pointer in mt7915_mmio_wed_init_rx_buf routine in case of failure. Fixes: 4f831d18d12d ("wifi: mt76: mt7915: enable WED RX support") Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: mt7921: fix rx filter incorrect by drv/fw inconsistentNeil Chen6-50/+40
The rx filter, in mt7921 series, may be changed in fw operation. There is a racing problem if rx filter controlled by both driver and firmware at the same time. To avoid this issue, let mt7921 driver set rx filter by new command MCU_CE_CMD_SET_RX_FILTER and allow the firmware controlling it only. Reviewed-by: Lorenzo Bianconi <[email protected]> Co-developed-by: Deren Wu <[email protected]> Signed-off-by: Deren Wu <[email protected]> Signed-off-by: Neil Chen <[email protected]> Tested-by: AngeloGioacchino Del Regno <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: add memory barrier to SDIO queue kickDeren Wu1-0/+4
Ensure the entry has been fully updated before SDIO bus worker access it. This patch would fix potential memory risk in both mt7663s and mt7921s. Fixes: 764dee47e2c1 ("mt76: sdio: move common code in mt76_sdio module") Signed-off-by: Deren Wu <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: mt7921: reduce polling time in pmctrlDeren Wu1-4/+4
Due to the polling tick is 10ms, the wake up flow in the status waiting would cause more 10~20ms than the real HW response time. Reduce tick-interval from 10ms to 1ms to get better network performance, such as ping latency, in low power mode. Reviewed-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Deren Wu <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: add flexible polling wait-interval supportDeren Wu2-9/+10
The default waiting unit is 10ms and the value is too much for data path related control. Provide a new API mt76_poll_msec_tick() to support different cases, such as 1ms polling waiting kick. Reviewed-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Deren Wu <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: mt7915: fix WED TxS reportingRyder Lee1-3/+0
The previous commit forgot to remove a leftover check. Fixes: 43eaa3689507 ("wifi: mt76: add PPDU based TxS support for WED device") Reported-By: Sujuan Chen <[email protected]> Signed-off-by: Ryder Lee <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: mt7915: wed: enable red per-band token dropPeter Chiu5-3/+52
Enable RED to limit the number of token used by each band. If single band uses too many tokens, it would hurt the throughput of the other bands.The software path can solve this problem by AQL so enable RED for HW path only. Reviewed-by: Shayne Chen <[email protected]> Signed-off-by: Peter Chiu <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: mt7915: set sku initial value to zeroPeter Chiu1-0/+2
Set sku initial value before mcu starts to prevent mcu from getting an invalid value. Signed-off-by: Peter Chiu <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: mt7921u: add support for Comfast CF-952AXChuanhong Guo1-0/+3
Comfast CF-952AX is a MT7921 based USB WiFi dongle with custom VID/PID. Add an entry for it. Signed-off-by: Chuanhong Guo <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: fix switch default case in mt7996_reverse_frag0_hdr_transLorenzo Bianconi1-1/+1
The switch default case for frame_contorl is invalid. Return -EINVAL error for it. Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices") Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: mt7921: avoid mcu_restart function pointerLorenzo Bianconi2-2/+0
Avoid mcu_restart function pointer whenever it is possible. Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: mt7615: avoid mcu_restart function pointerLorenzo Bianconi3-4/+1
Run mt7615_mcu_restart routine directly and avoid mcu_restart function pointer whenever it is possible. Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: mt7603: avoid mcu_restart function pointerLorenzo Bianconi1-2/+1
Run mt7603_mcu_restart routine directly and avoid mcu_restart function pointer whenever it is possible. Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: mt7915: avoid mcu_restart function pointerLorenzo Bianconi1-3/+2
Run mt76_connac_mcu_restart routine directly and avoid mcu_restart function pointer whenever it is possible. Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: dma: fix memory leak running mt76_dma_tx_cleanupLorenzo Bianconi1-2/+1
Fix device unregister memory leak and alway cleanup all configured rx queues in mt76_dma_tx_cleanup routine. Fixes: 52546e27787e ("wifi: mt76: add WED RX support to dma queue alloc") Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: dma: free rx_head in mt76_dma_rx_cleanupLorenzo Bianconi1-6/+7
Free rx_head skb in mt76_dma_rx_cleanup routine in order to avoid possible memory leak at module unload. Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: mt7996: fix memory leak in mt7996_mcu_exitLorenzo Bianconi1-1/+2
Always purge mcu skb queues in mt7996_mcu_exit routine even if mt7996_firmware_state fails. Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices") Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: mt7915: fix memory leak in mt7915_mcu_exitLorenzo Bianconi1-1/+2
Always purge mcu skb queues in mt7915_mcu_exit routine even if mt7915_firmware_state fails. Fixes: e57b7901469f ("mt76: add mac80211 driver for MT7915 PCIe-based chipsets") Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: introduce mt76_queue_is_wed_rx utility routineLorenzo Bianconi3-6/+9
This patch does not change any logic, just improve code readability. Signed-off-by: Lorenzo Bianconi <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: mt7921: fix invalid remain_on_channel durationDeren Wu1-1/+1
round_jiffies_up() may change the duration reported from chip. We should take the real timeout for current channel privilege. Fixes: 034ae28b56f1 ("wifi: mt76: mt7921: introduce remain_on_channel support") Signed-off-by: Deren Wu <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: mt7915: remove BW160 and BW80+80 supportMeiChia Chiu1-29/+9
Remove BW160 and BW80+80 capability in mt7915. Tested-by: AngeloGioacchino Del Regno <[email protected]> Reviewed-by: Ryder Lee <[email protected]> Reviewed-by: Shayne Chen <[email protected]> Signed-off-by: Money Wang<[email protected]> Signed-off-by: MeiChia Chiu <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: connac: fix POWER_CTRL command name typoShayne Chen2-2/+2
Fix typo MCU_UNI_CMD_POWER_CREL to MCU_UNI_CMD_POWER_CTRL. Fixes: 779d34de055e ("wifi: mt76: connac: add more unified command IDs") Signed-off-by: Shayne Chen <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: mt7996: do not hardcode vht beamform capShayne Chen1-1/+1
Use the sts variable when setting vht beamform sts cap. Signed-off-by: Shayne Chen <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: mt7996: update register for CFEND_RATEShayne Chen3-8/+10
In newer chipsets, CFEND_RATE setting has been moved to different hw module. Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices") Signed-off-by: Shayne Chen <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: mt7996: fix chainmask calculation in mt7996_set_antenna()Shayne Chen1-1/+4
Fix per-band chainmask when restoring from the dev chainmask. Fixes: 98686cd21624 ("wifi: mt76: mt7996: add driver for MediaTek Wi-Fi 7 (802.11be) devices") Signed-off-by: Shayne Chen <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: mt7921: add ack signal supportDeren Wu5-0/+45
This reports signal strength of ACK packets from the peer as measured at each interface. Reviewed-by: Ryder Lee <[email protected]> Signed-off-by: Deren Wu <[email protected]> Reviewed-by: AngeloGioacchino Del Regno <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: mt7921: fix channel switch fail in monitor modeDeren Wu3-1/+74
When the chanctx enabled, IEEE80211_CONF_CHANGE_CHANNEL in .config() would not be called anymore. mt76 cannot control RF channel for monitor. Add monitor type set-channel flow in .change_chanctx(). Fixes: 41ac53c899bd ("wifi: mt76: mt7921: introduce chanctx support") Reviewed-by: Sean Wang <[email protected]> Signed-off-by: Deren Wu <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: mt7915: add chip id condition in mt7915_check_eeprom()Shayne Chen1-1/+4
When flash mode is enabled, and the eeprom data in the flash is not for the current chipset, it'll still be checked valid, and the default eeprom bin won't be loaded. (e.g., mt7915 NIC inserted with mt7916 eeprom data in the flash.) Fix this kind of case by adding chip id into consideration in mt7915_check_eeprom(). Reported-by: Cheng-Ji Li <[email protected]> Signed-off-by: Shayne Chen <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: mt7915: add error message in mt7915_thermal_set_cur_throttle_state()Howard Hsu2-5/+9
Add dev_err so that it is easier to see invalid setting while looking at dmesg. Co-developed-by: Ryder Lee <[email protected]> Signed-off-by: Ryder Lee <[email protected]> Signed-off-by: Howard Hsu <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: mt7915: rework mt7915_thermal_temp_store()Howard Hsu2-2/+19
Call mt7915_mcu_set_thermal_protect() through mt7915_thermal_temp_store() to update firmware trigger/restore temp directly. Fixes: 02ee68b95d81 ("mt76: mt7915: add control knobs for thermal throttling") Reviewed-by: Ryder Lee <[email protected]> Signed-off-by: Howard Hsu <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: mt7915: rework mt7915_mcu_set_thermal_throttlingHoward Hsu4-26/+37
This patch includes 2 changes: 1. Firmware expects to disable thermal protect first before reconfiguring. 2. Separate setting thermal_protect and setting thermal_tx_duty into different functions. These two firmware commands do not need to send together. Fixes: 34b877d972be ("mt76: mt7915: add thermal cooling device support") Reviewed-by: Ryder Lee <[email protected]> Signed-off-by: Howard Hsu <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: mt7915: call mt7915_mcu_set_thermal_throttling() only after ↵Howard Hsu2-2/+7
init_work Enable thermal management by default shall not be executed during mcu init. This causes thermal configuration being reset to the firmware default settings. Fixes: 0063b86c9120 ("mt76: mt7915e: Enable thermal management by default") Reviewed-by: Ryder Lee <[email protected]> Signed-off-by: Howard Hsu <[email protected]> Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03wifi: mt76: mt7921: fix deadlock in mt7921_abort_rocFelix Fietkau1-15/+7
When mt7921_abort_roc is called with dev->mutex held, it can deadlock while calling cancel_work_sync(&phy->roc_work), because the work function could be waiting to acquire the mutex. Fix this by flushing the work before taking the mutex Reported-by: Mikhail Gavrilov <[email protected]> Fixes: 034ae28b56f1 ("wifi: mt76: mt7921: introduce remain_on_channel support") Fixes: 41ac53c899bd ("wifi: mt76: mt7921: introduce chanctx support") Signed-off-by: Felix Fietkau <[email protected]>
2023-02-03net: phy: Add driver for Motorcomm yt8531 gigabit ethernet phyFrank Sae2-3/+207
Add a driver for the motorcomm yt8531 gigabit ethernet phy. We have verified the driver on AM335x platform with yt8531 board. On the board, yt8531 gigabit ethernet phy works in utp mode, RGMII interface, supports 1000M/100M/10M speeds, and wol(magic package). Signed-off-by: Frank Sae <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2023-02-03net: phy: Add dts support for Motorcomm yt8531s gigabit ethernet phyFrank Sae1-24/+27
Add dts support for Motorcomm yt8531s gigabit ethernet phy. Change yt8521_probe to support clk config of yt8531s. Becase yt8521_probe does the things which yt8531s is needed, so removed yt8531s function. This patch has been verified on AM335x platform with yt8531s board. Signed-off-by: Frank Sae <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2023-02-03net: phy: Add dts support for Motorcomm yt8521 gigabit ethernet phyFrank Sae1-54/+199
Add dts support for Motorcomm yt8521 gigabit ethernet phy. Add ytphy_rgmii_clk_delay_config function to support dst config for the delay of rgmii clk. This funciont is common for yt8521, yt8531s and yt8531. This patch has been verified on AM335x platform. Signed-off-by: Frank Sae <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2023-02-03net: phy: Add BIT macro for Motorcomm yt8521/yt8531 gigabit ethernet phyFrank Sae1-4/+51
Add BIT macro for Motorcomm yt8521/yt8531 gigabit ethernet phy. This is a preparatory patch. Add BIT macro for 0xA012 reg, and supplement for 0xA001 and 0xA003 reg. These will be used to support dts. Signed-off-by: Frank Sae <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2023-02-03net: flow_offload: provision conntrack info in ct_metadataVlad Buslov2-0/+28
In order to offload connections in other states besides "established" the driver offload callbacks need to have access to connection conntrack info. Flow offload intermediate representation data structure already contains that data encoded in 'cookie' field, so just reuse it in the drivers. Reject offloading IP_CT_NEW connections for now by returning an error in relevant driver callbacks based on value of ctinfo. Support for offloading such connections will need to be added to the drivers afterwards. Signed-off-by: Vlad Buslov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
2023-02-03net: lan966x: Add VCAP debugFS supportHoratiu Vultur5-16/+136
Enable debugfs for vcap for lan966x. This will allow to print all the entries in the VCAP and also the port information regarding which keys are configured. Signed-off-by: Horatiu Vultur <[email protected]> Signed-off-by: David S. Miller <[email protected]>