summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mediatek/mt76/usb.c
Commit message (Collapse)AuthorAgeFilesLines
* mt76: usb: remove WARN_ON in mt76u_get_rx_entry_lenLorenzo Bianconi2018-10-011-3/+3
| | | | | | | | Remove not useful WARN_ON macros in mt76u_get_rx_entry_len routine since corrupted frames should just be silently discarded Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: use a per rx queue page fragment cacheFelix Fietkau2018-09-191-1/+10
| | | | | | | | | | | | | | | | Using the NAPI or netdev frag cache along with other drivers can lead to 32 KiB pages being held for a long time, despite only being used for very few page fragments. This can happen if the driver grabs one or two fragments for rx ring refill, while other drivers use (and free up) the remaining fragments. The 32 KiB higher-order page can only be freed once all users have freed their fragments. Depending on the traffic patterns, this can waste a lot of memory and look a lot like a memory leak. Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: usb: move mt76u_skb_dma_info in mt76x02_usb_core.cLorenzo Bianconi2018-09-191-34/+0Star
| | | | | | | | | | | | Move mt76u_skb_dma_info routine in mt76x02-usb module and rename it in mt76x02u_skb_dma_info. Moreover move mt76x02u_set_txinfo in mt76x02_usb_core.c. This is a preliminary patch to move MT_TXD_INFO, MT_MCU_MSG and MT_RX_FCE_INFO defs in mt76x02-lib module since other chipsets (e.g. mt7603) use different dma definitions Acked-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: usb: move mt76x02 mcu code in mt76x02-usb moduleLorenzo Bianconi2018-09-191-1/+2
| | | | | | | | | | | | Introduce mt76x02_usb_mcu.c in order to contain mt76x02u mcu related code. Add mt76x02-usb module as a container for mt76x02 usb code. This is a preliminary patch to move MT_TXD_INFO, MT_MCU_MSG and MT_RX_FCE_INFO defs in mt76x02-lib module since other chipsets (e.g. mt7603) use different dma definitions Acked-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: usb: use common helpers for mcu_alloc_msg()/mcu_send_msg()Lorenzo Bianconi2018-09-191-8/+8
| | | | | | | | | | | | | | | | | | Use mcu common helpers instead of usb specific routines. Add static qualifier to the following functions: - mt76u_mcu_msg_alloc - __mt76u_mcu_send_msg - mt76u_mcu_send_msg - mt76u_mcu_wr_rp - mt76u_mcu_rd_rp - mt76u_wr_rp - mt76u_rd_rp This is a preliminary patch to move mt76x02 usb mcu code in mt76x02-usb module Acked-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: add rd_rp and wr_rp to bus_ops/mcu_opsStanislaw Gruszka2018-09-191-0/+2
| | | | | | | | Add callbacks for reading and writing reg pairs tables. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: add usb implementation of {wr,rd}_rpStanislaw Gruszka2018-09-191-0/+54
| | | | | | | | | | Add USB implementation for read and write reg pair routines. The actual implementation can use mcu related routines according to MCU state Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: add mt76_mcu_ops data structure for mcu related pointersLorenzo Bianconi2018-09-191-0/+1
| | | | | | | | | | Introduce mt76_mcu_ops data structure to contain mcu related function pointers. This is a preliminary patch to move mt76x02 usb mcu code in mt76x02-usb module Acked-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: unify AC to hw queue mappingStanislaw Gruszka2018-09-191-1/+1
| | | | | | | | Use the same AC to hardware queue mappings for all subdrivers. Note: this change BK and BE mappings for USB drivers. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: add usb support to mt76 layerLorenzo Bianconi2018-08-021-0/+845
This will be used by drivers for MT76x2u based devices Tested-by: <cug_yangyuancong@hotmail.com> Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>