aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ralink/rt2x00/rt2800lib.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2017-01-17rt2800: change default retry settingsStanislaw Gruszka1-2/+9
We do not have option to set per frame retry count. We have only global TX_RTY_CFG registers which specify the number or retries. Set setting of that register to value that correspond rate control algorithm number of frame post (number of retries + 1), which is 3 for aggregated frames. This should help with big amount of retries on bad conditions, hence mitigate buffer-bloat like problems. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-12-30rt2800: replace msleep() with usleep_range() on channel switchStanislaw Gruszka1-2/+4
msleep(1) can sleep much more time then requested 1ms, this is not good on channel switch, which we want to be performed fast (i.e. to make scan faster). Replace msleep() with usleep_range(), which has much smaller maximum sleeping time boundary. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-12-30rt2800: replace mdelay by usleep on vco calibration.Stanislaw Gruszka1-1/+1
This procedure can sleep, hence mdelay is not needed. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-12-30rt2800: perform VCO recalibration for RF5592 chipStanislaw Gruszka1-0/+2
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-12-30rt2800: warn if doing VCO recalibration for unknow RF chipStanislaw Gruszka1-0/+2
Since we reset TX_PIN_CFG register, we have to finish recalibration. Warn if this is not possible. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-12-30rt2800: rename adjust_freq_offset functionStanislaw Gruszka1-8/+8
We have different modes of adjusting freq offset on different chips. Call current adjustment similarly like vendor driver - mode1 . 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-3/+42
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-12-30rt2800: set minimum MPDU and PSDU lengths to sane valuesStanislaw Gruszka1-2/+2
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-12-30rt2800: make rx ampdu_factor depend on number of rx chainsStanislaw Gruszka1-1/+1
Initalize max ampdu_factor supported by us based on rx chains, vendor driver do the same. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-11-23rt2800: disable CCK rates on HTStanislaw Gruszka1-1/+0
Sending frames in CCK rates on HT can cause performance problems. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-11-23rt2800: tune *_PROT_CFG parametersStanislaw Gruszka1-8/+8
Use RTS/CTS protection for TXOP on all rates modes as default and disable CCK rates (this cause performance problems). Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-11-23rt2800: use RTS/CTS protection instead of CTS-to-selfStanislaw Gruszka1-3/+3
Change default to RTS/CTS protection. This has a cost of transmitting one more control frame (RTS) however protect us from traffic from hidden node. On station mode will use CTS-to-self if AP will configure that for the network. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-11-23rt2800: correct TX_SW_CFG1 for 5592Stanislaw Gruszka1-2/+5
Those TX_SW_CFG1 values are used in vendor driver. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-11-23rt2800: correct AUTO_RSP_CFGStanislaw Gruszka1-4/+2
Initialize AUTO_RSP_CFG register to similar value as vendor driver does. Do not set BAC_ACK_POLICY based on short preamble setting, those are unrelated. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-11-23rt2800: do not overwrite WPDMA_GLO_CFG_WP_DMA_BURST_SIZEStanislaw Gruszka1-1/+0
We already initlized WPDMA_GLO_CFG_WP_DMA_BURST_SIZE to 3 on rt2800_init_registers() for USB devices. For PCI devices we will use HW default setting, which is 2, so patch does not change behaviour on PCI devices. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-11-23rt2800: OFDM rates are mandatoryStanislaw Gruszka1-1/+1
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-11-23rt2800: correctly report MCS TX parametersStanislaw Gruszka1-10/+13
We should only set IEEE80211_HT_MCS_TX_RX_DIF when TX and RX MCS sets are not equal, i.e. when number of tx streams is different than number of RX streams. Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-11-09rt2x00: add support for mac addr from device treeMathias Kresin1-4/+1
On some devices the EEPROMs of Ralink Wi-Fi chips have a default Ralink MAC address set (RT3062F: 00:0C:43:30:62:00, RT3060F: 00:0C:43:30:60:00). Using multiple of these devices in the same network can cause nasty issues. Allow to override the MAC in the EEPROM with (a known good) one set in the device tree to bypass the issue. Signed-off-by: Mathias Kresin <dev@kresin.me> Acked-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-26rt2800lib: enable MFP if hw crypt is disabledChun-Yeow Yeoh1-0/+4
If rt2800usb is loaded with nohwcrypt=1, mac80211 takes care of the crypto with software encryption/decryption and thus, MFP can be used. Tested for secured mesh using ath9k_htc and ath9k. Signed-off-by: Chun-Yeow Yeoh <yeohchunyeow@gmail.com> Acked-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2016-04-12cfg80211: remove enum ieee80211_bandJohannes Berg1-15/+15
This enum is already perfectly aliased to enum nl80211_band, and the only reason for it is that we get IEEE80211_NUM_BANDS out of it. There's no really good reason to not declare the number of bands in nl80211 though, so do that and remove the cfg80211 one. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2016-03-01Merge tag 'mac80211-next-for-davem-2016-02-26' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-nextDavid S. Miller1-3/+4
Johannes Berg says: ==================== Here's another round of updates for -next: * big A-MSDU RX performance improvement (avoid linearize of paged RX) * rfkill changes: cleanups, documentation, platform properties * basic PBSS support in cfg80211 * MU-MIMO action frame processing support * BlockAck reordering & duplicate detection offload support * various cleanups & little fixes ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2016-01-25rt2x00: fix monitor mode regressionEli Cooper1-1/+2
Since commit df1404650ccb ("mac80211: remove support for IFF_PROMISC") monitor mode for rt2x00 has been made effectively useless because the hardware filter is configured to drop packets whose intended recipient is not the device, regardless of the presence of monitor mode interfaces. This patch fixes this regression by adding explicit monitor mode support, and by configuring the hardware filter accordingly. Signed-off-by: Eli Cooper <elicooper@gmx.com> Acked-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/+4
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/+8021
Part of reorganising wireless drivers directory and Kconfig. Signed-off-by: Kalle Valo <kvalo@codeaurora.org>