summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mediatek/mt76/mt76x02_txrx.c
AgeCommit message (Collapse)AuthorFilesLines
2019-05-01mt76: introduce mt76_tx_info data structureLorenzo Bianconi1-4/+4
Add mt76_tx_info as auxiliary data structure to pass values to tx_prepare_skb pointer. This is a preliminary patch to add support for new chipsets (e.g. mt7615) Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt76: mmio: move mt76_insert_hdr_pad in mt76_dma_tx_queue_skbLorenzo Bianconi1-5/+5
Introduce tx_aligned4_skbs in mt76_driver_ops and move mt76_insert_hdr_pad in mt76_dma_tx_queue_skb. This is a preliminary patch in order to unify tx dma mapping for mt76x02 and new chipsets Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt76: move mt76x02_insert_hdr_pad in mt76-core moduleLorenzo Bianconi1-4/+1
Move mt76x02_insert_hdr_pad in m76-core and rename it in mt76_insert_hdr_pad in order to be used in mt76_dma_tx_queue_skb. This is a preliminary patch in order to properly support tx dma mapping for new chipsets (e.g. mt7615) Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-05-01mt76: remove mt76_queue dependency from tx_prepare_skb function pointerLorenzo Bianconi1-2/+2
Remove mt76_queue dependency from tx_prepare_skb function pointer and rely on mt76_tx_qid instead. This is a preliminary patch to introduce mt76_sw_queue support Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-02-18mt76: fix software encryption issuesFelix Fietkau1-8/+1
Software encrypted packets can be passed not just through the drv_tx callback, but also through the intermediate tx queue. In order to deal with that, move the override to mt76x02_mac_write_txwi and also take care of filling in the per-packet rate information Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-02-18mt76: move mt76_mcu_rx_event in mt76-coreLorenzo Bianconi1-2/+1
Move mt76_mcu_rx_event i mt76-core module and remove duplicated code. mt76_mcu_rx_event 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>
2019-01-17mt76: fix tx status reporting for non-probing framesFelix Fietkau1-1/+1
On MT76x2, the hardware does not report tx status in the FIFO register, if the packet id is 0. Change the allocation of packet IDs to use 0 for no-ack packets, 1 for non-probing packets and 2-255 for packets with tx status requested. Fixes rate control issues Signed-off-by: Felix Fietkau <nbd@nbd.name>
2018-11-30mt76: add support for reporting tx status with skbFelix Fietkau1-18/+7
MT76x2/MT76x0 has somewhat unreliable tx status reporting, and for that reason the driver currently does not report per-skb tx ack status at all. This breaks things like client idle polling, which relies on the tx ack status of a transmitted nullfunc frame. This patch adds code to report skb-attached tx status if requested by mac80211 or the rate control module. Since tx status is polled from a simple FIFO register, the code needs to account for the possibility of tx status events getting lost. The code keeps a list of skbs for which tx status is required and passes them to mac80211 once tx status has been filled in and the DMA queue is done with it. If a tx status event is not received after one second, the status rates are cleared, and a succesful ACK is indicated to avoid spurious disassoc during assoc or client polling. Signed-off-by: Felix Fietkau <nbd@nbd.name>
2018-11-30mt76: mt76x02: only override control->sta on sw-encrypted txFelix Fietkau1-1/+3
control->sta is set to NULL early when encryption is turned on for the station and info->control.hw_key is not set. This code is missing a check for the 802.11 header protected flag, otherwise it resets the station for other frames, e.g. client probing frames. Signed-off-by: Felix Fietkau <nbd@nbd.name>
2018-11-30mt76: clean up unused leftover EXPORT_SYMBOLsFelix Fietkau1-2/+0
Make previously exported functions static where possible Acked-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2018-10-13mt76: use mt76x02_dev instead of mt76_dev in mt76x02_txrx.cLorenzo Bianconi1-12/+10
Use mt76x02_dev data structure as reference in mt76x02_txrx.c instead of mt76_dev Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2018-10-13mt76: use mt76x02_dev instead of mt76_dev in mt76x02_mac.cLorenzo Bianconi1-3/+4
Use mt76x02_dev data structure as reference in mt76x02_mac.c instead of mt76_dev Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2018-10-05mt76: usb: move mt76x02u_tx_complete_skb in mt76x02_usb_core.cLorenzo Bianconi1-18/+0
Move mt76x02u_tx_complete_skb and mt76x02u_remove_dma_hdr since they are used just by usb code Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2018-10-05mt76: move mt76x02_tx_prepare_skb in mt76x02_txrx.cLorenzo Bianconi1-0/+32
Move mt76x02_tx_prepare_skb routine in mt76x02-lib module in order to be reused by mt76x0 driver in tx datapath Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2018-10-05mt76: move tpc routines in mt76x02-lib moduleLorenzo Bianconi1-0/+30
Move mt76x02_tx_get_txpwr_adj and mt76x02_tx_set_txpwr_auto routines in mt76x02-lib module since they are shared between mt76x0 and mt76x2 drivers. Moreover remove get_txpwr_adj function pointer Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2018-10-05mt76: rename mt76x02_util.h in mt76x02.hLorenzo Bianconi1-4/+1
Rename mt76x02_util.h header file in mt76x02.h since now contains all mt76x02 related definitions and not just utility routines declarations Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
2018-10-05mt76: move txrx shared routines in mt76x02_txrx.cLorenzo Bianconi1-0/+162
Add mt76x02_txrx.c source file in order to contain tx/rx shared routines for mt76x0 and mt76x2 drivers Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>