Commit Graph

810434 Commits

Author SHA1 Message Date
Luca Coelho
1122135df0 iwlwifi: pcie: remove suspend/resume workaround for 9000A devices
We don't support 9000 A-step devices anymore, so we can remove the
suspend/resume workaround.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-01-25 20:57:19 +02:00
Luca Coelho
c688e3964a iwlwifi: pcie: remove unnecessary iwl_pcie_enable_rx_wake() function
This function was only used by 9000 A-step devices, which we don't
support anymore, so it can be removed.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-01-25 20:57:19 +02:00
Luca Coelho
b7226f104c iwlwifi: remove support for 9000 A-step devices
We don't support 9000 A-step devices anymore, so we can remove support
for loading both the a0/a0 and a0/b0 FWs.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-01-25 20:57:19 +02:00
Emmanuel Grumbach
606b9ab677 iwlwifi: mvm: fix firmware statistics usage
The new (CDB) statistics API is used by non-CDB devices
as well. Look at the right TLV flag to know which version
of the statistics notification to use.
To avoid confusion, remove the _cdb suffix from the
structure name.
While at it, remove a structure that was never used.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Fixes: 678d9b6ddd ("iwlwifi: mvm: update rx statistics cmd api")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-01-25 20:57:19 +02:00
Ihab Zhaika
5b74a93689 iwlwifi: add new cards for 22560, 9260 and killer series
add few PCI ID'S for 22560, 9260 and killer series.

Signed-off-by: Ihab Zhaika <ihab.zhaika@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-01-25 20:57:19 +02:00
Ihab Zhaika
a98e2802a6 iwlwifi: correct one of the PCI struct names
One of the cfg struct names is mistakenly "iwl22000", when it should
be "iwl22560".

Chage-Id: If9fbfa4bceef81d028c90c98d47115fbe39da547
Signed-off-by: Ihab Zhaika <ihab.zhaika@intel.com>
Fixes: 2f7a386319 ("iwlwifi: rename the temporary name of A000 to the official 22000")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-01-25 20:57:19 +02:00
Shaul Triebitz
7703238ef7 iwlwifi: mvm: fix wrong DCM TLC config
When configuring TLC DCM flag:
1. check the peer's RX DCM capabilities (since we TX)
2. do not set DCM_NSS_2 since we do not support it

Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com>
Fixes: 423584dd80 ("iwlwifi: rs-fw: support dcm")
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-01-25 20:57:19 +02:00
Luca Coelho
99be6166a4 iwlwifi: pcie: recognize NICs with hw_rev 0x364 correctly
Some devices with PCI ID 0x2723, which is supposed to be 22260, are
actually not.  So we need to differentiate them by checking the hw_rev
and change the cfg accordingly.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-01-25 20:57:18 +02:00
Luca Coelho
8093bb6d4f iwlwifi: add PCI IDs for the 22260 device series
Add new structs and PCI IDs for 22260 devices.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-01-25 20:57:18 +02:00
Emmanuel Grumbach
866a6a85d4 iwlwifi: mvm: rely on mac80211 to configure TWT support
Mac80211 will check both the HE Capability IE and the
Extended Capability IE, so set the TWT support bit when
mac80211 tells us to.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-01-25 20:57:18 +02:00
Emmanuel Grumbach
7360f99e0b iwlwifi: mvm: advertise support for TWT in the Extended Capability IE
We want to advertise support for TWT in the Extended
Capability IE. Since we don't want to set the bits for all
the interface types, define an interface specific
configuration.

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-01-25 20:57:18 +02:00
Shahar S Matityahu
d3561e0ecd iwlwifi: wrt: add to dump number of lmacs, lmac1 and umac error id
Add to the dump the number of lmacs, the error id of the umac
and the error id of lmac1, if supported.
In case the reason for the dump trigger is not an assert
the error id is zero.

Signed-off-by: Shahar S Matityahu <shahar.s.matityahu@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-01-25 20:57:18 +02:00
Colin Ian King
aba1e632c2 iwlwifi: pcie: make array 'prop' static, shrinks object size
Don't populate the array prop on the stack but instead make it static.
Makes the object code smaller by 30 bytes:

Before:
   text	   data	    bss	    dec	    hex	filename
  80138	  15382	    576	  96096	  17760	drivers/net/wireless/intel/iwlwifi/pcie/trans.o

After:
   text	   data	    bss	    dec	    hex	filename
  79948	  15542	    576	  96066	  17742	drivers/net/wireless/intel/iwlwifi/pcie/trans.o

(gcc version 8.2.0 x86_64)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
2019-01-25 20:57:18 +02:00
Felix Fietkau
d225581df3 mt76: avoid scheduling tx queues for powersave stations
In case a tx queue wake call arrives after a client has transitioned to
powersave, make sure that the queue is not kept active until the client
has left powersave mode

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-01-22 16:37:35 +01:00
Felix Fietkau
68f7030f2d mt76: fix per-chain signal strength reporting
Fix an off-by-one error that resulted in not reporting the signal strength
for the first chain

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-01-22 16:37:28 +01:00
Lorenzo Bianconi
f832898dff mt76: do not report out-of-range rx nss
Take into account device rx stream in mt76x02_mac_process_rate
in order to not report wrong number of rx spatial stream to mac80211.
The issue has been reported on mt76x0 device which is 1x1:1 however
the hw sometimes reports rx nss equal to 2

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-01-21 21:47:58 +01:00
Felix Fietkau
e7173858c7 mt76: add channel switch announcement support
Use the appropriate mac80211 callbacks after beacon transmission

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-01-17 14:50:15 +01:00
Felix Fietkau
9cf67ec7fd mt76: fix signedness of rx status signal field
It is usually negative, so it needs to be signed.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-01-17 14:50:15 +01:00
Felix Fietkau
02e5a769c0 mt76: fix rssi ewma tracking
The generic EWMA code cannot deal with negative numbers, so convert signal
to a positive number before adding it
Fixes mt76x2 AGC tuning

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-01-17 14:50:15 +01:00
Felix Fietkau
ef13edc007 mt76: move mt76x02_phy_get_min_avg_rssi to mt76 core
This will be used by mt7603 as well

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-01-17 14:50:15 +01:00
Felix Fietkau
9313faacbb mt76: move mt76x02_get_txpower to mt76 core
It will be reused by mt7603 later

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-01-17 14:50:15 +01:00
Felix Fietkau
f545540d5f mt76: set IEEE80211_HW_NEEDS_UNIQUE_STA_ADDR flag
The hardware does not deal with multiple WCID entries for the same station
properly. Set IEEE80211_HW_NEEDS_UNIQUE_STA_ADDR to avoid those cases

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-01-17 14:45:55 +01:00
Felix Fietkau
013b2dff81 mt76: fix tx status reporting for non-probing frames
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>
2019-01-17 14:44:57 +01:00
Lorenzo Bianconi
5c9decdfbb mt76: add led support to mt76x0e driver
Move mt76x02 led support in mt76x02-lib module in order to
add tpt led trigger to mt76x0e driver

Tested-by: LGA1150 <dqfext@gmail.com>
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-01-11 15:10:19 +01:00
Lorenzo Bianconi
3121742915 mt76: use proper name for __MT76x02_H macro
Use proper name for __MT76x02_H macro in mt76x02.h

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-01-11 15:10:19 +01:00
Lorenzo Bianconi
e76deac6f0 mt76: dma: avoid indirect call in mt76_dma_tx_queue_skb
Call mt76_dma_add_buf routine directly in mt76_dma_tx_queue_skb
and avoid indirect call if not necessary

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-01-11 15:10:19 +01:00
Colin Ian King
32fb47fd9c mt76: make const array 'data' static, shrinks object size
Don't populate the const array 'data' on the stack but instead
make it static. Makes the object code smaller by 78 bytes:

Before:
   text    data     bss     dec     hex filename
   5438    1080       0    6518    1976 mediatek/mt76/mt76x2/usb_mcu.o

After:
   text    data     bss     dec     hex filename
   5296    1144       0    6440    1928 mediatek/mt76/mt76x2/usb_mcu.o

(gcc version 8.2.0 x86_64)

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-01-11 15:10:19 +01:00
Lorenzo Bianconi
c1e0d2be0a mt76: mmio: introduce mt76x02_check_tx_hang watchdog
Port mt76x02_check_tx_hang watchdog from vendor driver in order to
perform a device reset when tx mac/dma logic hangs. Tx mac/dma stuck
has been observed when the device is heavy loaded or in a noisy
environment. Moreover introduce wdt delayed work in order to run
tx_hang watchdog. For the moment run mt76x02_check_tx_hang watchdog
just on mt76x2 devices since the issue has not been observed on mt76x0
driver yet

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-01-11 15:10:19 +01:00
Lorenzo Bianconi
87e86f9019 mt76: dma: do not build skb if reported len does not fit in buf_size
Precompute data length in order to avoid to allocate the related
skb data structure if reported length does not fit in queue buf_size

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-01-11 15:10:18 +01:00
Lorenzo Bianconi
c09f4d0a1f mt76: mac: minor optimizations in mt76x02_mac_tx_rate_val
Do not set bw variable to zero for legacy rates since it is already
initialized to zero. Moreover set nss to 1 just for legacy rates
since nss will be properly set for VHT/HT rates

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-01-11 15:10:18 +01:00
Lorenzo Bianconi
f82ce8d9bd mt76: add energy detect CCA support to mt76x{0,2}e drivers
Ported from the reference driver. Should fix compliance with ETSI
regulatories on preventing transmission while energy detect values
are above the threshold.
The code has been tested using an ath9k device running tx99 as
noise generator

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-01-11 15:10:18 +01:00
Lorenzo Bianconi
3fd612df8a mt76x2: init: set default value for MT_TX_LINK_CFG
Update default value for MT_TX_LINK_CFG according to vendor driver

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-01-11 15:10:18 +01:00
Lorenzo Bianconi
35c572818c mt76: dfs: run mt76x02_dfs_set_domain atomically
Grab mt76_dev mutex in mt76x02_dfs_set_domain since it runs
concurrently with mt76x{0,2}_set_channel routines

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-01-11 15:10:17 +01:00
Lorenzo Bianconi
bf349ce16e mt76x2: add static qualifier to mt76x2_init_hardware
Add static qualifier to mt76x2_init_hardware routine since it is
used just in pci_init.c

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-01-11 15:10:17 +01:00
Stanislaw Gruszka
9bc29420d7 mt76x0: configure MT_VHT_HT_FBK_CFG1
Configure MT_VHT_HT_FBK_CFG1 values similar like vendor driver.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-01-11 15:10:17 +01:00
Stanislaw Gruszka
26a7b54731 mt76x02: set protection according to ht operation element
Configure protection based on information that are provided to
us either by remote AP or by hostapd via HT operation IE.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-01-11 15:10:17 +01:00
Stanislaw Gruszka
493d2dfab3 mt76x02: fixup MT_PROT_RATE_* defines
On new mt76 chips, phy mode is configured by last 3 bits
of rate value. Hence OFDM bit is marked by 0x2000
instead of 0x4000.

Acked-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-01-11 15:10:17 +01:00
Stanislaw Gruszka
20ce270e5a mt76x02: do not set protection on set_rts_threshold callback
Use set_rts_threshold calback to enable/disable threshold only for
legacy traffic.

Protection for HT and VHT traffic is defined by HT operation element
and it's provided by remote AP or by hostapd.

Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-01-11 15:10:16 +01:00
Lorenzo Bianconi
b9f81643b6 mt76x0: pci: fix ACS support
Fix Automatic Channel Selection (ACS) support in mt76x0e driver
configuring properly MT_CH_TIME_CFG register

Fixes: 6250318694 ("mt76x0: pci: add get_survey support")
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-01-11 15:10:16 +01:00
Lorenzo Bianconi
e207afa023 mt76: usb: avoid queue/status spinlocks while passing tx status to mac80211
As already done for pcie code in commit 79d1c94c9c ("mt76: avoid
queue/status spinlocks while passing tx status to mac80211") make sure
that no tx related spinlocks are taken during the ieee80211_tx_status call

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-01-11 15:10:16 +01:00
Lorenzo Bianconi
4989338ed3 mt76: mac: run mt76x02_mac_work routine atomically
Grab mt76_dev mutex in mt76x02_mac_work handler since it runs
concurrently with mt76x{0,2}_set_channel routines

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-01-11 15:10:16 +01:00
Lorenzo Bianconi
374eb1b555 mt76: fix typo in mt76x02_check_mac_err routine
Reconfigure properly MT_MAC_SYS_CTRL register after mac sw-reset
in mt76x02_check_mac_err routine

Fixes: 73556561ab ("mt76x0: use mt76x02_mac_work as stats handler")
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-01-11 15:10:16 +01:00
Hauke Mehrtens
85b7e2acd3 mt76: Add missing include of linux/module.h
MODULE_FIRMWARE() is used in usb_mcu.c and provided by linux/module.h,
but this header file is not directly included. This causes problems in
backports with some kernel versions.

Add the missing include.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-01-11 15:10:15 +01:00
Lorenzo Bianconi
0ecf94dc36 mt76: usb: do not build the skb if reported len does not fit in buf_size
Precompute data length in order to avoid to allocate the related
skb data structure if reported length does not fit in queue buf_size

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-01-11 15:10:15 +01:00
Lorenzo Bianconi
4d4b12bc56 mt76: dma: remove napi from mt76_dma_rx_fill signature
Remove napi from mt76_dma_rx_fill routine signature since
it is a leftover of a previous implementation and it is no
longer used

Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-01-11 15:10:15 +01:00
Felix Fietkau
7267a7965d mt76: request tx status for powersave released EOSP packet
Allows mac80211 to keep track of the service period

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-01-11 15:10:15 +01:00
Felix Fietkau
cbbfd73767 mt76: throttle transmission of buffered multicast packets
Avoids drowning out regular transmissions

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-01-11 15:10:14 +01:00
Felix Fietkau
9fe3105465 mt76: add size check for additional rx fragments
So far the code only validates the buffer size of the first skb.
Extend this check to cover additional fragments as well, in case the size
is corrupted during a DMA reset.

Signed-off-by: Felix Fietkau <nbd@nbd.name>
2019-01-11 15:10:14 +01:00
Hans de Goede
4ad0be1605 brcmfmac: Use firmware_request_nowarn for the clm_blob
The linux-firmware brcmfmac firmware files contain an embedded table with
per country allowed channels and strength info.

For recent hardware these versions of the firmware are specially build for
linux-firmware, the firmware files directly available from Cypress rely on
a separate clm_blob file for this info.

For some unknown reason Cypress refuses to provide the standard firmware
files + clm_blob files it uses elsewhere for inclusion into linux-firmware,
instead relying on these special builds with the clm_blob info embedded.
This means that the linux-firmware firmware versions often lag behind,
but I digress.

The brcmfmac driver does support the separate clm_blob file and always
tries to load this. Currently we use request_firmware for this. This means
that on any standard install, using the standard combo of linux-kernel +
linux-firmware, we will get a warning:
"Direct firmware load for ... failed with error -2"

On top of this, brcmfmac itself prints: "no clm_blob available (err=-2),
device may have limited channels available".

This commit switches to firmware_request_nowarn, fixing almost any brcmfmac
device logging the warning (it leaves the brcmfmac info message in place).

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-01-10 13:41:03 +02:00
Lo-Hsiang Lo
3a33bd8405 brcmfmac: fix system warning message during wowl suspend
There is a system warning message, warn_slowpath-fmt, during suspend
while using supplicant join AP and enable wowl feature by IW command.
It's caused by brcmf_pno_remove_request path can't find the reqid.
This fix will not go to remove pno request function if there is no
pno scan.

Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
Signed-off-by: Lo-Hsiang Lo <double.lo@cypress.com>
Signed-off-by: Chi-Hsien Lin <chi-hsien.lin@cypress.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2019-01-10 13:40:29 +02:00