summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mediatek/mt76/mt76x0/tx.c
Commit message (Collapse)AuthorAgeFilesLines
* mt76: move mt76x02_tx in mt76x02-lib moduleLorenzo Bianconi2018-10-051-47/+0
| | | | | | | | | Move mt76x02_tx shared routine in mt76x02-lib module and remove duplicated code. Moreover remove mt76x0/tx.c since it is an empty file Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: unify rxwi parsing between mt76x2 and mt76x0 driversLorenzo Bianconi2018-10-051-16/+0
| | | | | | | | | | | | | Unify rxwi parsing between mt76x2 and mt76x0. Remove the following routines: - mt76x0_phy_get_rssi - mt76x0_queue_rx_skb - mt76x0_mac_process_rx Moreover remove mt76x2/common.c and mt76x0/mac.h since are empty files Enable CCMP PN sw validation Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76x0: merge mt76x0_dev in mt76x02_devLorenzo Bianconi2018-10-051-2/+2
| | | | | | | | | | Merge mt76x0_dev data structure in mt76x02_dev one and remove duplicated code. Remove unused definition in mt76x0.h. Moreover merge mt76x0_caldata and mt76x02_rx_freq_cal data structures. This is a preliminary patch for rxwi unification. Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76x0: mac: use sta ewma estimation for rssi trackingLorenzo Bianconi2018-10-051-1/+1
| | | | | | | | | | | | | Use shared mt76x02 utility routines for rssi tracking. Moreover remove no longer used con_mon_lock spinlock and following variable: - ap_bssid - bcn_freq_off - bcn_phy_mode - avg_rssi Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: usb: use mt76x02u_tx_prepare_skb to fill txwiLorenzo Bianconi2018-10-051-38/+0
| | | | | | | | | | Use mt76x02u_tx_prepare_skb routine to fill txwi in mt76x2u and mt76x0u driver and remove duplicated code. Moreover add static qualifier to mt76x02_mac_tx_rate_val and mt76x02_mac_fill_txwi routines Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76x0: usb: move mt76x0u_tx_prepare_skb in usb.cLorenzo Bianconi2018-10-011-19/+4
| | | | | | | | Move mt76x0u_tx_prepare_skb routine in usb module in order to remove leftover usb dependency from generic code Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76x0: add ieee80211_ops ops pointer to mt76x0_alloc_device signatureLorenzo Bianconi2018-10-011-0/+1
| | | | | | | | | | | | Add ieee80211_ops ops pointer to mt76x0_alloc_device routine signature in order to specify mac80211 callbacks and remove usb dependency from mt76x0 generic code. Move mt76x0_ops callbacks in usb module in order to remove leftover usb dependency in mt76x0 generic code. Introduce mt76x0e_ops mac80211 callbacks for pci code Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: usb: move mt76u_skb_dma_info in mt76x02_usb_core.cLorenzo Bianconi2018-09-191-1/+2
| | | | | | | | | | | | 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>
* mt76x0: make device allocation bus neutralStanislaw Gruszka2018-09-191-1/+2
| | | | | | | Remove some USB specific code form mt76x0_alloc_device. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76x0: remove unused mt76x0_tx_status routineLorenzo Bianconi2018-09-191-15/+0
| | | | | | | | | Remove no longer used mt76x0_tx_status routine since mt76x0 driver uses mt76-usb utility routines to report tx-feedbacks Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76x0: remove unused stat work_queueLorenzo Bianconi2018-09-191-30/+0
| | | | | | | | | Remove unused tx_status workqueue since now tx feedbacks are processed by mt76-usb layer Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76x0: unify tx/rx datapath with mt76x2u driverLorenzo Bianconi2018-09-191-33/+13
| | | | | | | | | | | | Use mt76/mt76-usb shared routine for tx/rx datapath. Initialize mt76-usb tx/rx queues in mt76x0_init_hardware and deallocate them in mt76x0_cleanup routine. Moreover remove data padding in mt76_mac_process_rx routine. Furthermore remove unused skb2q routine Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76x0: add mt76x0_queue_rx_skb routineLorenzo Bianconi2018-09-191-0/+15
| | | | | | | | | | Introduce mt76x0_queue_rx_skb routine as mt76x0 driver frame rx handler. mt76x0_queue_rx_skb will be run by mt76-usb layer rx datapath Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76x0: introduce mt76x0_tx_prepare_skb routineLorenzo Bianconi2018-09-191-0/+15
| | | | | | | | | Add mt76x0_tx_prepare_skb routine as tx txwi handler. mt76x0_tx_prepare_skb will be used by mt76-usb layer Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: move mt76x2u_remove_dma_hdr in mt76x02-lib moduleLorenzo Bianconi2018-09-191-13/+1
| | | | | | | | | | | Move mt76x2u_remove_dma_hdr in mt76x02-lib module and rename it in mt76x02_remove_dma_hdr. Moreover use mt76x02_remove_hdr_pad routine in mt76x02_remove_dma_hdr function. Furthermore remove mt76x0_tx_skb_remove_dma_overhead routine Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: partially unify filling txwi fieldsStanislaw Gruszka2018-09-191-41/+3
| | | | | | | Merge code filing txwi fields the same way on mt76x0 and mt76x2. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: unify {insert/remove}_hdr_padStanislaw Gruszka2018-09-191-2/+3
| | | | | | | Merge insert/remove _hdr_pad from mt76x0 and mt76x2. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76x0: reserve enough space in mac80211Stanislaw Gruszka2018-09-191-16/+1
| | | | | | | | Allocate skg with enough headroom by mac80211 , this eliminate need to add extra skb headroom by the mt76x0 driver. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: unify send_tx_status and related helpersStanislaw Gruszka2018-09-191-1/+1
| | | | | | | Merge send_tx_status and helper functions from mt76x0 and mt76x2. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: unify load_tx_statusStanislaw Gruszka2018-09-191-2/+1
| | | | | | | Unify load/fetch tx status from mt76x0 and mt76x2 Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: unify txwi and rxwi structuresStanislaw Gruszka2018-09-191-9/+9
| | | | | | | txwi and rxwi are the same for mt76x0 and mt76x2. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: unify sta_rate_tbl_update and related helpersStanislaw Gruszka2018-09-191-1/+1
| | | | | | | | | Use common sta_rate_tbl_update on mt76x0 and mt76x2. mt76x0 do not have support TPC (transmision power control) implmented, msta->wcid.max_txpwr_adj is only set for mt76x2. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: unify conf_txStanislaw Gruszka2018-09-191-57/+0
| | | | | | | | Use one conf_tx implementation in mt76x0 and mt76x2. Note this change conf_tx for mt76x0, but it should work with mt76x2 version. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76: unify AC to hw queue mappingStanislaw Gruszka2018-09-191-2/+2
| | | | | | | | 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: move wcid fields to common mt76_dev structStanislaw Gruszka2018-09-191-1/+1
| | | | | | | | All current MT devices including new MT7603 type chips support 128 WCIDs, we can unify wcid data in common mt76_dev structure. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
* mt76x0: use mt76x02_sta and mt76x02_tx_statusStanislaw Gruszka2018-09-041-3/+3
| | | | | | | Use common mt76x02_sta and mt76x02_tx_status structures in mt76x0 sub-driver. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mt76: unify mt76x02_vif structStanislaw Gruszka2018-09-041-1/+1
| | | | | | | Private vif structures definitions are the same for mt76x2 and mt76x0. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mt76: Fix comparisons with invalid hardware key indexGeert Uytterhoeven2018-08-311-1/+1
| | | | | | | | | | | | | | | | | | With gcc 4.1.2: drivers/net/wireless/mediatek/mt76/mt76x0/tx.c: In function ‘mt76x0_tx’: drivers/net/wireless/mediatek/mt76/mt76x0/tx.c:169: warning: comparison is always true due to limited range of data type drivers/net/wireless/mediatek/mt76/mt76x2_tx_common.c: In function ‘mt76x2_tx’: drivers/net/wireless/mediatek/mt76/mt76x2_tx_common.c:35: warning: comparison is always true due to limited range of data type While assigning -1 to a u8 works fine, comparing with -1 does not work as expected. Fix this by comparing with 0xff, like is already done in some other places. Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mt76x0: rename trace symbolsStanislaw Gruszka2018-08-041-2/+2
| | | | | | | | | | | | | Rename trace symbols that conflict with mt7601u and remove some definitions that are not used. Patch fixes build errors like this: ld: drivers/net/wireless/mediatek/mt76/mt76x0/trace.o:(__tracepoints+0x0): multiple definition of `__tracepoint_set_shared_key'; drivers/net/wireless/mediatek/mt7601u/trace.o:(__tracepoints+0x0): first defined here Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Fixes: 7b4859026ccd ("mt76x0: core files") Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mt76x0: rename mt76_* functionsStanislaw Gruszka2018-08-041-4/+4
| | | | | | | | | | | | | mt76_* functions conflicts with mt7601u driver what prevents to build those drivers in the kernel or use both drivers modules at once. Patch fixes build errors like this: ld: drivers/net/wireless/mediatek/mt76/mt76x0/mac.o:(.opd+0x30): multiple definition of `mt76_mac_tx_rate_val'; drivers/net/wireless/mediatek/mt7601u/mac.o:(.opd+0x30): first defined here Reported-by: Stephen Rothwell <sfr@canb.auug.org.au> Fixes: 7b4859026ccd ("mt76x0: core files") Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
* mt76x0: dma and tx filesStanislaw Gruszka2018-08-021-0/+270
Add dma and tx files of mt76x0 driver. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>