summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mediatek/mt76/mt76x02_usb_mcu.c
AgeCommit message (Collapse)Author
2020-12-04mt76: implement .mcu_parse_response in struct mt76_mcu_opsFelix Fietkau
Do not free skb inside that function Preparation for further cleanup Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-07-21mt76: mt76u: add missing release on skb in __mt76x02u_mcu_send_msgNavid Emamdoost
In the implementation of __mt76x02u_mcu_send_msg() the skb is consumed all execution paths except one. Release skb before returning if test_bit() fails. Signed-off-by: Navid Emamdoost <navid.emamdoost@gmail.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2020-05-12mt76: add headroom and tailroom to mt76_mcu_ops data structureLorenzo Bianconi
Introduce headroom and tailroom to mt76_mcu_ops data structure in order to unify the routine used for mcu message allocation. This is a preliminary patch to add mt7663u support Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
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: mt76u: add endpoint to mt76u_bulk_msg signatureLorenzo Bianconi
This is a preliminary patch to support mt7663u usb dongles 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-02-14mt76: move state from struct mt76_dev to mt76_phyFelix Fietkau
Allows keeping per-wiphy state separate Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-09-05mt76: switch to SPDX tag instead of verbose boilerplate textRyder Lee
No functional change intended. Add SPDX identifiers to all remaining files in /mt76. Signed-off-by: Ryder Lee <ryder.lee@mediatek.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-02-26mt76usb: use synchronous msg for mcu command responsesStanislaw Gruszka
Use usb_bulk_msg for reading MCU command responses. This simplify code a lot. Together with 97a3005759c ("mt76usb: allow mt76u_bulk_msg be used for reads") it also fix possible problems with rx data buffers not being aligned and contained within single page. After doing page_frag_alloc(1024) consecutive page_frag_alloc(PAGE_SIZE) will alloc PAGE_SIZE buffer at PAGE_SIZE - 1024 offset. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-02-26mt76usb: allow mt76u_bulk_msg be used for readsStanislaw Gruszka
Extend mt76u_bulk_msg() such it can be used for synchronous bulk reads. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-02-18mt76: usb: do not use sg buffers for mcu messagesLorenzo Bianconi
Do not use scatter-gather buffers for mcu commands. Introduce mt76u_buf_alloc and mt76u_buf_alloc_sg routines. Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-02-18mt76x02u: use usb_bulk_msg to upload firmwareStanislaw Gruszka
We don't need to send firmware data asynchronously, much simpler is just use synchronous usb_bulk_msg(). Tested-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-02-18mt76: move mt76_mcu_msg_alloc in mt76-coreLorenzo Bianconi
Move mt76_mcu_msg_alloc in mt76-core module and remove duplicated code. mt76_mcu_msg_alloc will be reused adding support for mt7603 driver Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2018-11-30mt76: remove mcu_msg_allocStanislaw Gruszka
We almost always use patter like this: skb = mt76_mcu_msg_alloc(dev, &msg, sizeof(msg)); return mt76_mcu_send_msg(dev, skb, CMD_FUN_SET_OP, wait_resp); This is not needed, we can allocate skb in mcu_send_msg routine. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2018-10-13mt76: use mt76x02_dev instead of mt76_dev in mt76x02_usb_mcu.cLorenzo Bianconi
Use mt76x02_dev data structure as reference in mt76x02_usb_mcu.c instead of mt76_dev Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2018-10-01mt76: include linux/module.h in files using MODULE_*Felix Fietkau
Fix source files using MODULE_* macros without including linux/module.h Signed-off-by: Felix Fietkau <nbd@nbd.name>
2018-09-19mt76x02: move TXD/RXD/MCU definitions in mt76x02_dma.hLorenzo Bianconi
Introduce mt76x02_dma.h header file to contain mt76x02 dma related definitions Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2018-09-19mt76: usb: move mt76u_skb_dma_info in mt76x02_usb_core.cLorenzo Bianconi
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>
2018-09-19mt76: usb: move mt76x02 mcu code in mt76x02-usb moduleLorenzo Bianconi
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>