summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ralink/rt2x00/rt2800lib.h
AgeCommit message (Collapse)AuthorFilesLines
2022-10-21wifi: rt2x00: use explicitly signed or unsigned typesJason A. Donenfeld1-4/+4
On some platforms, `char` is unsigned, but this driver, for the most part, assumed it was signed. In other places, it uses `char` to mean an unsigned number, but only in cases when the values are small. And in still other places, `char` is used as a boolean. Put an end to this confusion by declaring explicit types, depending on the context. Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Cc: Stanislaw Gruszka <stf_xl@wp.pl> Cc: Helmut Schaa <helmut.schaa@googlemail.com> Cc: Kalle Valo <kvalo@kernel.org> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com> Acked-by: Stanislaw Gruszka <stf_xl@wp.pl> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20221019155541.3410813-1-Jason@zx2c4.com
2022-09-24wifi: rt2x00: add TX LOFT calibration for MT7620Tomislav Požega1-0/+10
Add TX LOFT calibration from mtk driver. Signed-off-by: Tomislav Požega <pozega.tomislav@gmail.com> Signed-off-by: Daniel Golle <daniel@makrotopia.org> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/d9295a9138a1f552b648aacb84e1419d38f5c896.1663445157.git.daniel@makrotopia.org
2022-07-15wifi: mac80211: change QoS settings API to take link into accountJohannes Berg1-1/+2
Take the link into account in the QoS settings (EDCA parameters) APIs. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2019-06-25rt2800: add pre_reset_hw callbackStanislaw Gruszka1-0/+1
Add routine to cleanup interfaces data before hw reset as ieee80211_restart_hw() will do setup interfaces again. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-06-25rt2800: initial watchdog implementationStanislaw Gruszka1-0/+2
Add watchdog for rt2800 devices. For now it only detect hung and print error. [Note: I verified that printing messages from process context is fine on MT7620 (WT3020) platform that have problem when printk is called from interrupt context]. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-06-25rt2800: add helpers for reading dma done indexStanislaw Gruszka1-0/+8
For mmio we do not properlly trace dma done Q_INDEX_DMA_DONE index for TX queues. That would require implementing INT_SOURCE_CSR_*_DMA_DONE interrupts, what is rather not worth to do due to adding extra CPU load (small but still somewhat not necessary otherwise). We can just read TX DMA done indexes from registers directly. What will be used by watchdog. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-05-21treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 13Thomas Gleixner1-12/+1
Based on 2 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this program if not see http www gnu org licenses this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details [based] [from] [clk] [highbank] [c] you should have received a copy of the gnu general public license along with this program if not see http www gnu org licenses extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 355 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Jilayne Lovejoy <opensource@jilayne.com> Reviewed-by: Steve Winslow <swinslow@gmail.com> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190519154041.837383322@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-04-25rt2800: move txstatus pending routineStanislaw Gruszka1-0/+1
Move rt2800usb_txstatus_pending routine to rt2800lib. It will be reused by rt2800mmio code. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-04-25rt2800: partially restore old mmio txstatus behaviourStanislaw Gruszka1-1/+1
Do not disable txstatus interrupt and add quota of processed tx statuses in one tasklet. Quota is needed to allow to fed device with new frames during processing of tx statuses. Patch fixes about 15% performance degradation on some scenarios caused by 0b0d556e0ebb ("rt2800mmio: use txdone/txstatus routines from lib"). Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-10-01rt2800: move usb specific txdone/txstatus routines to rt2800libStanislaw Gruszka1-0/+3
In order to reuse usb txdone/txstatus routines for mmio, move them to common rt2800lib.c file. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2018-05-04rt2x00: call sta_add/remove directly in rt2800Stanislaw Gruszka1-2/+3
Only rt2800 subdriver of rt2x00 implement sta_add() and sta_remove(), we do not need generic version of those. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-05-24rt2x00: convert rt2800_register_read return typeArnd Bergmann1-16/+6
This is a semi-automated conversion to change rt2800_register_read to return the register contents instead of passing them by value, resulting in much better object code. The majority of the patch was done using: sed -i 's:\(rt2800_register_read(.*, .*\), &\(.*\));:\2 = \1);:' \ 's:\(rt2800_register_read_lock(.*, .*\), &\(.*\));:\2 = \1);:' \ drivers/net/wireless/ralink/rt2x00/rt2800lib.c The function itself was modified manually along with the one remaining multi-line caller that was not covered automatically and the indirect reference. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-05-24rt2x00: change function pointers for register accessorsArnd Bergmann1-6/+14
This prepares the driver for changing all the 'read' register accessors to return the value instead of passing it by reference. Since a lot of them are used in callbacks, this takes care of the callbacks first, adding a couple of helpers that will be removed again one at a time. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-03-22rt2x00: add support for MT7620Roman Yeryomin1-0/+4
Basic support for MT7620 built-in wireless radio was added to OpenWrt in r41441. It has seen some heavy cleaning and refactoring since in order to match the Kernel's code quality standards. Signed-off-by: Roman Yeryomin <roman@advem.lv> Signed-off-by: Daniel Golle <daniel@makrotopia.org> Acked-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-03-08rt2x00: use txdone_nomatch on rt2800usbStanislaw Gruszka1-1/+2
If we do not match skb entry, provide tx status via nomatch procedure. Currently in that case we do rt2x00lib_txdone_noinfo(TXDONE_NOINFO), which actually assume that entry->skb was posted without retries and provide rate saved in skb desc as successful. Patch changed that to rate read from TX_STAT_FIFO, however still do not provide correct number of retries. On SoC/PCI devices we keep providing status via standard txdone procedure, no change in those devices, though we should thing about it. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-03-08rt2800: identify station based on status WCIDStanislaw Gruszka1-0/+1
Add framework to identify sta based on tx status WCID. This is currently not used, will start be utilized in the future patch. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2017-03-08rt2x00: rt2800lib: move rt2800_drv_data declaration into rt2800lib.hGabor Juhos1-0/+23
The rt2800_drv_data structure contains driver specific information. Move the declaration into the rt2800lib.h header which is a more logical place for it. Also fix the comment style to avoid checkpatch warning. The patch contains no functional changes, it is in preparation for the next patch. Signed-off-by: Gabor Juhos <juhosg@openwrt.org> Signed-off-by: Daniel Golle <daniel@makrotopia.org> Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-12-30rt2800: set MAX_PSDU len according to remote STAs capabilitiesStanislaw Gruszka1-1/+1
MAX_LEN_CFG_MAX_PSDU specify maximum transmitted by HW AMPDU length (0 - 8kB, 1 - 16kB, 2 - 32kB, 3 - 64kB). Set this option according to remote stations capabilities (based on HT ampdu_factor). However limit the value based our hardware TX capabilities as some chips can not send more than 16kB (factor 1). Limit for all chips is currently 32kB (factor 2), but perhaps for some chips this could be increased to 64kB by setting drv_data->max_psdu to 3. Since MAX_LEN_CFG_MAX_PSDU is global setting, on multi stations modes (AP, IBSS, mesh) we limit according to less capable remote STA. We can not set bigger value to speed up communication with some stations and do not break communication with slow stations. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-01-14mac80211: pass block ack session timeout to to driverSara Sharon1-3/+1
Currently mac80211 does not inform the driver of the session block ack timeout when starting a rx aggregation session. Drivers that manage the reorder buffer need to know this parameter. Seeing that there are now too many arguments for the drv_ampdu_action() function, wrap them inside a structure. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2015-11-18rt2x00: move under ralink vendor directoryKalle Valo1-0/+232
Part of reorganising wireless drivers directory and Kconfig. Signed-off-by: Kalle Valo <kvalo@codeaurora.org>