summaryrefslogtreecommitdiffstats
path: root/drivers/net (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
| * iwlwifi: make sure cur_fw_img is valid before accessing imgLuca Coelho2019-01-291-0/+1
| | | | | | | | | | | | | | Harden the fwrt->fw->img array access by making sure the cur_fw_img value doesn't go out of bounds. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: calculate pointers from out_cmd instead of out_cmd->hdrLuca Coelho2019-01-291-2/+2
| | | | | | | | | | | | | | | | | | The out_cmd structure starts with a header, so there's no need to use &out_cmd->hdr, out_cmd alone is enough. We use this when calculating other addresses and klocwork gets confused with that because it thinks we are trying to access hdr (as an array) beyond its size. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: mvm: pre-initialize alive_data in wait_alive()Luca Coelho2019-01-291-1/+1
| | | | | | | | | | | | | | | | | | The function we pass to the wait alive notification procedure may may not even get called if the timeout occurs before the function is called. To prevent accessing unitialized data in alive_data, pre-set it to zero in the declaration. Found by static analyzers. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: move iwl_enable_{rx,tx}_ampdu to iwl-modparams.hJohannes Berg2019-01-293-40/+23
| | | | | | | | | | | | | | | | These inlines just check the module parameters, so they don't need a configuration parameter and can move to a better place. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: make iwl_fw_dbg_start_stop_hcmd() inlineLuca Coelho2019-01-291-1/+2
| | | | | | | | | | | | | | This function is supposed to be used as an inline function and is in a header file, so make it inline. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: mvm: save and export regdb blob from the NVMLuca Coelho2019-01-293-0/+9
| | | | | | | | | | | | | | | | Sometimes we want to debug issues related to the regulatory blob in the NVM. To make that easier, add a debugfs entry to export it together with the other nvm blobs we export. Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: mvm: clean up LDBG config command usageJohannes Berg2019-01-295-75/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clean up the LDBG config command to not be called "continuous recording", and while at it actually remove the continuous recording implementation completely since it was only used for store & forward architectures. This also fixes a bug at least in iwl_fw_dbg_buffer_allocation() because what's now "__le32 type" (matching the firmware) used to be "__le16 enable_recording", so the buffer allocation config sub-struct would erroneously have started at the wrong offset. In the other cases this didn't actually lead to a bug as other bytes in pad[] were all zeroes, so accessing the 16-bit value as a 32-bit value wouldn't make a difference (in little endian.) Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: pcie: align licensing to dual GPL/BSDJohannes Berg2019-01-295-19/+192
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These files have a long history of code changes, but analysing the remaining code leads to having only a few changes that are not already owned by Intel, notably from - Andy Lutomirski <luto@amacapital.net> - Joonwoo Park <joonwpark81@gmail.com> - Kirtika Ruchandani <kirtika@chromium.org> - Rajat Jain <rajatja@google.com> - Stanislaw Gruszka <sgruszka@redhat.com> remaining in the code today. Note that - I myself was working for Intel and for any possibly code that might be before my employment there give permission - Wizery employees were working for Intel More specifically, we identified the following commits that (partially may) remain today: 25c03d8e8c13 Joonwoo Park <joonwpark81@gmail.com> ("iwlwifi: do not schedule tasklet when rcv unused irq") f36d04abe684 Stanislaw Gruszka <sgruszka@redhat.com> ("iwlwifi: use dma_alloc_coherent") 387f3381f732 Stanislaw Gruszka <sgruszka@redhat.com> ("iwlwifi: fix dma mappings and skbs leak") 2624e96ce16b Stanislaw Gruszka <sgruszka@redhat.com> ("iwlwifi: fix possible data overwrite in hcmd callback") bfe4b80e9f73 Stanislaw Gruszka <sgruszka@redhat.com> ("iwlwifi: always check if got h/w access before write") d536c32b45d2 Andy Lutomirski <luto@amacapital.net> ("iwlwifi: pcie: log when waking the NIC for hcmd submission fails") a6d24fad00d9 Rajat Jain <rajatja@google.com> ("iwlwifi: pcie: dump registers when HW becomes inaccessible") fb12777ab59b Kirtika Ruchandani <kirtika@chromium.org> ("iwlwifi: Add more call-sites for pcie reg dumper") 3a73a30049f2 Stanislaw Gruszka <sgruszka@redhat.com> ("iwlwifi: cleanup/fix memory barriers") aa5affbacb24 Stanislaw Gruszka <sgruszka@redhat.com> ("iwlwifi: dump stack when fail to gain access to the device") Align the licenses with their permission to clean up and to make it all identical. CC: Joonwoo Park <joonwpark81@gmail.com> CC: Stanislaw Gruszka <sgruszka@redhat.com> CC: Andy Lutomirski <luto@amacapital.net> CC: Rajat Jain <rajatja@google.com> CC: Kirtika Ruchandani <kirtika@chromium.org> Acked-by: Johannes Berg <johannes@sipsolutions.net> Acked-by: Kirtika Ruchandani <kirtika@chromium.org> Acked-by: Stanislaw Gruszka <sgruszka@redhat.com> Acked-by: Joonwoo Park <joonwpark81@gmail.com> Acked-by: Rajat Jain <rajatja@google.com> Acked-by: Andy Lutomirski <luto@kernel.org> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: mvm: read IWL_RX_MPDU_PHY_SHORT_PREAMBLE only for CCKJohannes Berg2019-01-291-1/+2
| | | | | | | | | | | | | | | | | | Due to a general shortage of RX API bits, the firmware is going to reuse this bit on non-CCK frames to mean something else. Use it only on CCK frames to prepare for that change. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: mvm: fix %16 to %016 print formatJohannes Berg2019-01-292-2/+2
| | | | | | | | | | | | | | | | | | With just %16, it means 16 characters padding, but we really don't want to print "0x 1F4547B", but instead want to have this filled with zeroes, so we need the 0. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: pcie: add prints to track virtual IDSara Sharon2019-01-291-1/+7
| | | | | | | | | | | | | | | | In case there are bugs in this area, this data can help with debugging. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: iwlmvm: in monitor NDP notif take the NSS from rx_vecShaul Triebitz2019-01-292-5/+17
| | | | | | | | | | | | | | | | | | | | | | Take the NSS value from 'rx_vec' rather than from 'rate_n_flags'. The rate_n_flags has only 2 bits for the NSS giving a max of 4SS (0 = 1SS etc.). Since there may be up to 8SS use the rx_vec which has 3 bits for the NSS. While at it, fix the rx_vec array to length of 2. Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: iwlmvm: ignore HE PPDU type regarding EOFShaul Triebitz2019-01-291-11/+7
| | | | | | | | | | | | | | | | | | When setting the EOF bit in Rx flags (propagated to radiotap) do not depend it on the PPDU type (SU/MU/TB) since it doesn't. Signed-off-by: Shaul Triebitz <shaul.triebitz@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
| * iwlwifi: pcie: fix the use of a wrong defineSara Sharon2019-01-291-1/+1
| | | | | | | | | | | | | | | | The code checks that we haven't exceeded the maximum number of TBs by comparing to a define of gen1 instead of gen2, fix it. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
* | Merge tag 'mt76-for-kvalo-2019-01-22' of https://github.com/nbd168/wirelessKalle Valo2019-01-3032-241/+664
|\ \ | |/ |/| | | | | | | | | | | | | | | first batch of mt76 patches for 5.1 * fixes for mt76x0/mt76x2 * energy detect regulatory compliance fixes * tx status handling fixes * preparation for MT7603 support * channel switch announcement support
| * mt76: avoid scheduling tx queues for powersave stationsFelix Fietkau2019-01-221-0/+5
| | | | | | | | | | | | | | | | 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>
| * mt76: fix per-chain signal strength reportingFelix Fietkau2019-01-221-1/+1
| | | | | | | | | | | | | | 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>
| * mt76: do not report out-of-range rx nssLorenzo Bianconi2019-01-211-4/+10
| | | | | | | | | | | | | | | | | | | | 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>
| * mt76: add channel switch announcement supportFelix Fietkau2019-01-174-2/+57
| | | | | | | | | | | | Use the appropriate mac80211 callbacks after beacon transmission Signed-off-by: Felix Fietkau <nbd@nbd.name>
| * mt76: fix signedness of rx status signal fieldFelix Fietkau2019-01-171-1/+1
| | | | | | | | | | | | It is usually negative, so it needs to be signed. Signed-off-by: Felix Fietkau <nbd@nbd.name>
| * mt76: fix rssi ewma trackingFelix Fietkau2019-01-172-2/+4
| | | | | | | | | | | | | | | | 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>
| * mt76: move mt76x02_phy_get_min_avg_rssi to mt76 coreFelix Fietkau2019-01-1710-65/+62
| | | | | | | | | | | | This will be used by mt7603 as well Signed-off-by: Felix Fietkau <nbd@nbd.name>
| * mt76: move mt76x02_get_txpower to mt76 coreFelix Fietkau2019-01-178-24/+25
| | | | | | | | | | | | It will be reused by mt7603 later Signed-off-by: Felix Fietkau <nbd@nbd.name>
| * mt76: set IEEE80211_HW_NEEDS_UNIQUE_STA_ADDR flagFelix Fietkau2019-01-171-0/+1
| | | | | | | | | | | | | | 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>
| * mt76: fix tx status reporting for non-probing framesFelix Fietkau2019-01-175-9/+11
| | | | | | | | | | | | | | | | | | | | 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>
| * mt76: add led support to mt76x0e driverLorenzo Bianconi2019-01-114-77/+82
| | | | | | | | | | | | | | | | | | 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>
| * mt76: use proper name for __MT76x02_H macroLorenzo Bianconi2019-01-111-3/+3
| | | | | | | | | | | | | | 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>
| * mt76: dma: avoid indirect call in mt76_dma_tx_queue_skbLorenzo Bianconi2019-01-111-1/+1
| | | | | | | | | | | | | | | | 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>
| * mt76: make const array 'data' static, shrinks object sizeColin Ian King2019-01-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * mt76: mmio: introduce mt76x02_check_tx_hang watchdogLorenzo Bianconi2019-01-118-1/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * mt76: dma: do not build skb if reported len does not fit in buf_sizeLorenzo Bianconi2019-01-111-8/+7
| | | | | | | | | | | | | | | | 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>
| * mt76: mac: minor optimizations in mt76x02_mac_tx_rate_valLorenzo Bianconi2019-01-111-4/+2
| | | | | | | | | | | | | | | | | | 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>
| * mt76: add energy detect CCA support to mt76x{0,2}e driversLorenzo Bianconi2019-01-119-0/+111
| | | | | | | | | | | | | | | | | | | | | | 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>
| * mt76x2: init: set default value for MT_TX_LINK_CFGLorenzo Bianconi2019-01-111-0/+1
| | | | | | | | | | | | | | 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>
| * mt76: dfs: run mt76x02_dfs_set_domain atomicallyLorenzo Bianconi2019-01-111-0/+2
| | | | | | | | | | | | | | | | 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>
| * mt76x2: add static qualifier to mt76x2_init_hardwareLorenzo Bianconi2019-01-112-2/+1
| | | | | | | | | | | | | | | | 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>
| * mt76x0: configure MT_VHT_HT_FBK_CFG1Stanislaw Gruszka2019-01-111-0/+1
| | | | | | | | | | | | | | 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>
| * mt76x02: set protection according to ht operation elementStanislaw Gruszka2019-01-114-0/+90
| | | | | | | | | | | | | | | | 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>
| * mt76x02: fixup MT_PROT_RATE_* definesStanislaw Gruszka2019-01-111-3/+3
| | | | | | | | | | | | | | | | | | | | 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>
| * mt76x02: do not set protection on set_rts_threshold callbackStanislaw Gruszka2019-01-113-17/+3
| | | | | | | | | | | | | | | | | | | | | | 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>
| * mt76x0: pci: fix ACS supportLorenzo Bianconi2019-01-111-0/+8
| | | | | | | | | | | | | | | | | | Fix Automatic Channel Selection (ACS) support in mt76x0e driver configuring properly MT_CH_TIME_CFG register Fixes: 6250318694ca ("mt76x0: pci: add get_survey support") Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Felix Fietkau <nbd@nbd.name>
| * mt76: usb: avoid queue/status spinlocks while passing tx status to mac80211Lorenzo Bianconi2019-01-111-4/+6
| | | | | | | | | | | | | | | | | | As already done for pcie code in commit 79d1c94c9c78 ("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>
| * mt76: mac: run mt76x02_mac_work routine atomicallyLorenzo Bianconi2019-01-111-0/+4
| | | | | | | | | | | | | | | | 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>
| * mt76: fix typo in mt76x02_check_mac_err routineLorenzo Bianconi2019-01-111-2/+2
| | | | | | | | | | | | | | | | | | Reconfigure properly MT_MAC_SYS_CTRL register after mac sw-reset in mt76x02_check_mac_err routine Fixes: 73556561ab9f ("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>
| * mt76: Add missing include of linux/module.hHauke Mehrtens2019-01-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | 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>
| * mt76: usb: do not build the skb if reported len does not fit in buf_sizeLorenzo Bianconi2019-01-111-6/+4
| | | | | | | | | | | | | | | | 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>
| * mt76: dma: remove napi from mt76_dma_rx_fill signatureLorenzo Bianconi2019-01-111-4/+4
| | | | | | | | | | | | | | | | | | 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>
| * mt76: request tx status for powersave released EOSP packetFelix Fietkau2019-01-111-1/+2
| | | | | | | | | | | | Allows mac80211 to keep track of the service period Signed-off-by: Felix Fietkau <nbd@nbd.name>
| * mt76: throttle transmission of buffered multicast packetsFelix Fietkau2019-01-111-2/+3
| | | | | | | | | | | | Avoids drowning out regular transmissions Signed-off-by: Felix Fietkau <nbd@nbd.name>
| * mt76: add size check for additional rx fragmentsFelix Fietkau2019-01-111-0/+8
| | | | | | | | | | | | | | | | 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>