summaryrefslogtreecommitdiffstats
path: root/drivers (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'mac80211-next-for-davem-2018-07-24' of ↵David S. Miller2018-07-241-0/+123
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next Johannes Berg says: ==================== Only a few things: * HE (802.11ax) support in HWSIM * bypass TXQ with NDP frames as they're special * convert ahash -> shash in lib80211 TKIP * avoid playing with tailroom counter defer unless needed to avoid issues in some cases ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
| * mac80211_hwsim: Add support for HEIlan Peer2018-07-091-0/+123
| | | | | | | | | | | | | | | | | | Add support for HE in mac8011_hwsim, conforming with P802.11ax_D2.0. Signed-off-by: Liad Kaufman <liad.kaufman@intel.com> Signed-off-by: Ilan Peer <ilan.peer@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
* | Merge tag 'wireless-drivers-next-for-davem-2018-07-23' of ↵David S. Miller2018-07-2475-701/+1607
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/wireless-drivers-next Kalle Valo says: ==================== wireless-drivers-next patches for 4.19 The first set of patches for 4.19. Only smaller features and bug fixes, not really anything major. Also included are changes to include/linux/bitfield.h, we agreed with Johannes that it makes sense to apply them via wireless-drivers-next. Major changes: ath10k * support channel 173 * fix spectral scan for QCA9984 and QCA9888 chipsets ath6kl * add support for Dell Wireless 1537 ti wlcore * add support for runtime PM * enable runtime PM autosuspend support qtnfmac * support changing MAC address * enable source MAC address randomization support libertas * fix suspend and resume for SDIO cards mt76 * add software DFS radar pattern detector for mt76x2 based devices ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
| * | mt76x2: debugfs: add sw pulse statistics to dfs debugfsLorenzo Bianconi2018-07-043-1/+25
| | | | | | | | | | | | | | | | | | | | | | | | Add sw pattern detector statistics to mt76x2 debugfs. Moreover track down number of allocated sequence by the detector Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | mt76x2: dfs: add sw pattern detectorLorenzo Bianconi2018-07-042-1/+260
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add sw DFS pattern detector support for mt76x2 based devices. Dfs pattern supported: - short pulse radar patterns - staggered radar patterns Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | mt76x2: dfs: add sw event ring bufferLorenzo Bianconi2018-07-042-3/+163
| | | | | | | | | | | | | | | | | | | | | | | | Introduce sw event ring buffer to queue DFS pulses loaded from the hw. Radar pulses will be used in DFS sw detector Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | mt76: introduce mt76_{incr,decr} utility routinesLorenzo Bianconi2018-07-041-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | Add mt76_{incr,decr} utility routines to increment/decrement a value with wrap-around (they will be used by mt76x2 DFS sw detector) Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | atmel: using strlcpy() to avoid possible buffer overflowsYueHaibing2018-07-041-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | 'firmware' is a module param which may been longer than firmware_id, so using strlcpy() to guard against overflows. Also priv is allocated with zeroed memory,no need to set firmware_id[0] to '\0'. Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | wlcore: Fix memory leak in wlcore_cmd_wait_for_event_or_timeoutGustavo A. R. Silva2018-07-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In case memory resources for *events_vector* were allocated, release them before return. Addresses-Coverity-ID: 1470194 ("Resource leak") Fixes: 4ec7cece87b3 ("wlcore: Add missing PM call for wlcore_cmd_wait_for_event_or_timeout()") Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | libertas: fix suspend and resume for SDIO connected cardsDaniel Mack2018-07-042-6/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to commit 573185cc7e64 ("mmc: core: Invoke sdio func driver's PM callbacks from the sdio bus"), the MMC core used to call into the power management functions of SDIO clients itself and removed the card if the return code was non-zero. IOW, the mmc handled errors gracefully and didn't upchain them to the pm core. Since this change, the mmc core relies on generic power management functions which treat all errors as a reason to cancel the suspend immediately. This causes suspend attempts to fail when the libertas driver is loaded. To fix this, power down the card explicitly in if_sdio_suspend() when we know we're about to lose power and return success. Also set a flag in these cases, and power up the card again in if_sdio_resume(). Fixes: 573185cc7e64 ("mmc: core: Invoke sdio func driver's PM callbacks from the sdio bus") Cc: <stable@vger.kernel.org> Signed-off-by: Daniel Mack <daniel@zonque.org> Reviewed-by: Chris Ball <chris@printf.net> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | brcmfmac: update STA info struct to the v5Rafał Miłecki2018-07-041-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | That struct is used when querying firmware for the STA. It seem is has been changing during the time. Luckily its format seems to be backward compatible starting with v2 (the only breakage was v1 -> v2). The version that was supported by brcmfmac so far was v4. It was what 43602a1 and 4366b1 firmwares (7.35.177.56 and 10.10.69.3309 accordingly) were using. It also seems to be used by early 4366c0 firmwares (10.10.69.6908 and 10.10.69.69017). The problem appears when switching to the 10.10.122.20 firmware. It uses v5 and instead of falling back to v4 when submitted buffer isn't big enough it fallbacks to the v3. To receive all v4 specific info with the newest firmware we have to submit a struct (buffer) that matches v5. Signed-off-by: Rafał Miłecki <rafal@milecki.pl> Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | brcmfmac: define more bits for the flags of struct brcmf_sta_info_leRafał Miłecki2018-07-041-5/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | That struct is passed by a firmware when querying for STA info. Flags are used to indicate what info could be obtained. These new defines may allow passing more info to the cfg80211 in the future. They had been obtained from Broadcom's SDK file wlioctl_defs.h used by DD-WRT. Signed-off-by: Rafał Miłecki <rafal@milecki.pl> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | brcmfmac: handle msgbuf packets marked with monitor mode flagRafał Miłecki2018-07-043-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New Broadcom firmwares mark monitor mode packets using a newly defined bit in the flags field. Use it to filter them out and pass to the monitor interface. These defines were found in bcmmsgbuf.h from SDK. As not every firmware generates radiotap header this commit introduces BRCMF_FEAT_MONITOR_FMT_RADIOTAP flag. It has to be has based on firmware capabilities. If not present brcmf_netif_mon_rx() will assume packet is a raw 802.11 frame and will prepend it with an empty radiotap header. This new code is limited to the msgbuf protocol at this point. Adding support for SDIO/USB devices will require some extra work (possibly a new firmware release). Signed-off-by: Rafał Miłecki <rafal@milecki.pl> Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | brcmfmac: detect firmware support for radiotap monitor framesRafał Miłecki2018-07-042-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Depending on used build-time options some firmwares may already include radiotap header in passed monitor frames. Add a new feature flag to store info about it. It's needed for proper handling of received frames before passing them up. Signed-off-by: Rafał Miłecki <rafal@milecki.pl> Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | brcmfmac: detect firmware support for monitor interfaceRafał Miłecki2018-07-042-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many/most of firmwares support creating monitor interface but only the most recent ones explicitly /announce/ it using a "monitor" entry in the list of capabilities. Check for that entry and store internally info about monitor mode support using a new feature flag. Once we sort out all details of handling monitor interface it will be used when reporting available interfaces to the cfg80211. Later some fallback detecion method may be added for older firmwares. For now just stick to the "monitor" capability which should be 100% reliable. Signed-off-by: Rafał Miłecki <rafal@milecki.pl> Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | mt76: improve gain adjustment in noisy environmentsFelix Fietkau2018-06-271-10/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When switching between low gain (high RSSI) and high gain settings, it can take a few seconds to adjust to the current environment. This can lead to short periods of time with extreme packet loss. When switching from low_gain=1 to low_gain=2, start with the same gain adjustment value instead of the lowest to avoid spikes of huge numbers of false CCA events Also avoid resetting adjustment values on switching between low_gain values 0 and 1, since it affects only the upper limit of vga adjustment Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | mt76: track ewma rssi for gain adjustment per stationFelix Fietkau2018-06-274-20/+83
| | | | | | | | | | | | | | | | | | | | | | | | This preserves more sensitivity when weak stations are active and avoids counting signal measurements from other unrelated networks Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | mt76: add a debugfs file to dump agc calibration informationFelix Fietkau2018-06-273-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | Useful for debugging gain adjustment issues triggered by signal strength changes. Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | mt76: fix variable gain adjustment rangeFelix Fietkau2018-06-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The range should only be limited to 4 for really weak signals, for all other gain settings the range is 16. Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | mt76: clear false CCA counters after changing gain settingsFelix Fietkau2018-06-271-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | They will be read on the next calibration step without gain change and must not count earlier events Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | mt76: adjust AGC control register 26 based on gain for VHT80Felix Fietkau2018-06-271-2/+9
| | | | | | | | | | | | | | | | | | | | | Use values based on the vendor driver Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | mt76: fix swapped values for RXO-18 in gain controlFelix Fietkau2018-06-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | The lowest bit should be set to 0 only for strong links, not for weak ones. Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | mt76: fix threshold for gain adjustmentFelix Fietkau2018-06-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | The gain should be reduced only for very strong connections, not for mid range. Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | mt76: fix beacon timer driftFelix Fietkau2018-06-273-2/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The beacon timer drifts by 1 microsecond every TBTT. After 20 minutes with a beacon interval of 100, the drift will be almost 12 ms, enough to cause weird issues for devices in powersave mode. Since the beacon timer is configured in units of 1/16 TU (64 us), we need to adjust it once every 64 beacons and only for one beacon. Signed-off-by: Felix Fietkau <nbd@nbd.name> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | zd1211rw: use irqsave() in USB's complete callbackSebastian Andrzej Siewior2018-06-271-9/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. Cc: Daniel Drake <dsd@gentoo.org> Cc: Ulrich Kunitz <kune@deine-taler.de> Cc: Kalle Valo <kvalo@codeaurora.org> Cc: "David S. Miller" <davem@davemloft.net> Cc: linux-wireless@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | libertas: use irqsave() in USB's complete callbackSebastian Andrzej Siewior2018-06-271-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. I am removing the BUG_ON(!in_interrupt()); check because it serves no purpose. Running the completion callback in BH context makes in_interrupt() still return true but the interrupts could be enabled. The important part is that ->driver_lock is acquired with disabled interrupts which is the case now. Cc: Kalle Valo <kvalo@codeaurora.org> Cc: "David S. Miller" <davem@davemloft.net> Cc: libertas-dev@lists.infradead.org Cc: linux-wireless@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | libertas_tf: use irqsave() in USB's complete callbackSebastian Andrzej Siewior2018-06-271-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The USB completion callback does not disable interrupts while acquiring the lock. We want to remove the local_irq_disable() invocation from __usb_hcd_giveback_urb() and therefore it is required for the callback handler to disable the interrupts while acquiring the lock. The callback may be invoked either in IRQ or BH context depending on the USB host controller. Use the _irqsave() variant of the locking primitives. I am removing the BUG_ON(!in_interrupt()); check because it serves no purpose. Running the completion callback in BH context makes in_interrupt() still return true but the interrupts could be enabled. The important part is that ->driver_lock is acquired with disabled interrupts which is the case now. Cc: Kalle Valo <kvalo@codeaurora.org> Cc: "David S. Miller" <davem@davemloft.net> Cc: linux-wireless@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | ipw2x00: track time using boottimeArnd Bergmann2018-06-274-20/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The ipw2x00 driver family uses get_seconds() to read the current time for various purposes. This function is deprecated because of the 32-bit time_t overflow, and it can cause unexpected behavior when the time changes due to settimeofday() calls or leap second updates. In many cases, we want to use monotonic time instead, however ipw2x00 explicitly tracks the time spent in suspend, so this changes the driver over to use ktime_get_boottime_seconds(), which is slightly slower, but not used in a fastpath here. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Stanislav Yakovlev <stas.yakovlev@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | zd1211rw: stop using deprecated get_seconds()Arnd Bergmann2018-06-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The get_seconds() function is deprecated because of the y2038 overflow. In zd1211rw we don't even care about the absolute value, so this is not a problem, but it's equally trivial to change to the non-deprecated ktime_get_seconds(). Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | wireless-drivers: use BIT_ULL for NL80211_STA_INFO_ attribute typesOmer Efrat2018-06-2710-73/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The BIT macro uses unsigned long which some architectures handle as 32 bit and therefore might cause macro's shift to overflow when used on a value equals or larger than 32 (NL80211_STA_INFO_RX_DURATION and afterwards). Since 'filled' member in station_info changed to u64, BIT_ULL macro should be used with all NL80211_STA_INFO_* attribute types instead of BIT to prevent future possible bugs when one will use BIT macro for higher attributes by mistake. This commit cleans up all usages of BIT macro with the above field in wireless-drivers by changing it to BIT_ULL instead. In addition, there are some places which don't use BIT nor BIT_ULL macros so align those as well. Signed-off-by: Omer Efrat <omer.efrat@tandemg.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | rndis_wlan: potential buffer overflow in rndis_wlan_auth_indication()Dan Carpenter2018-06-271-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a static checker fix, not something I have tested. The issue is that on the second iteration through the loop, we jump forward by le32_to_cpu(auth_req->length) bytes. The problem is that if the length is more than "buflen" then we end up with a negative "buflen". A negative buflen is type promoted to a high positive value and the loop continues but it's accessing beyond the end of the buffer. I believe the "auth_req->length" comes from the firmware and if the firmware is malicious or buggy, you're already toasted so the impact of this bug is probably not very severe. Fixes: 030645aceb3d ("rndis_wlan: handle 802.11 indications from device") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | atmel: use memdup_user to simplify the codeYueHaibing2018-06-271-8/+3
| | | | | | | | | | | | | | | | | | | | | use existing memdup_user() helper function instead of open-coding Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | mt76x2: fix mrr idx/count estimation in mt76x2_mac_fill_tx_status()Lorenzo Bianconi2018-06-271-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix mcs and attempt count estimation in mt76x2_mac_fill_tx_status routine if the number of tx retries reported by the hw is grater than IEEE80211_TX_MAX_RATES Fixes: 7bc04215a66b ("mt76: add driver code for MT76x2e") Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | net: ipw2x00: Replace NULL comparison with !privVarsha Rao2018-06-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove extra parentheses and replace NULL comparison with !priv, to fix clang warning of extraneous parentheses and check patch issue. Following coccinelle script is used to fix it. @disable is_null,paren@ expression e; statement s; @@ if ( - (e==NULL) +!e ) s Signed-off-by: Varsha Rao <rvarsha016@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | mwifiex: uap: do not chok ethernet header in bridge pathXinming Hu2018-06-271-26/+26
| | | | | | | | | | | | | | | | | | | | | | | | Do not chock ethernet header for uap bridge data path, as it is still needed to send skb to dest station. Signed-off-by: Xinming Hu <huxm@marvell.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | brcmsmac: make function wlc_phy_workarounds_nphy_rev1 staticColin Ian King2018-06-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The function wlc_phy_workarounds_nphy_rev1 is local to the source and does not need to be in global scope, so make it static. Cleans up sparse warning: symbol 'wlc_phy_workarounds_nphy_rev1' was not declared. Should it be static? Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | brcmsmac: fix wrap around in conversion from constant to s16Stefan Agner2018-06-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The last value in the log_table wraps around to a negative value since s16 has a value range of -32768 to 32767. This is not what the table intends to represent. Use the closest positive value 32767. This fixes a warning seen with clang: drivers/net/wireless/broadcom/brcm80211/brcmsmac/phy/phy_qmath.c:216:2: warning: implicit conversion from 'int' to 's16' (aka 'short') changes value from 32768 to -32768 [-Wconstant-conversion] 32768 ^~~~~ 1 warning generated. Fixes: 4c0bfeaae9f9 ("brcmsmac: fix array out-of-bounds access in qm_log10") Cc: Tobias Regnery <tobias.regnery@gmail.com> Signed-off-by: Stefan Agner <stefan@agner.ch> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | brcmsmac: Remove unnecessary parenthesesVarsha Rao2018-06-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fixes the clang warning of extraneous parentheses, with the following coccinelle script. @@ identifier i; expression e; statement s; @@ if ( -(i == e) +i == e ) s Suggested-by: Lukas Bulwahn <lukas.bulwahn@gmail.com> Signed-off-by: Varsha Rao <rvarsha016@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | qtnfmac: enable source MAC address randomization supportAndrey Shevchenko2018-06-273-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | Enable support for source MAC address randomization of probe request frames. Pass addr/mask randomization parameters to firmware. Signed-off-by: Andrey Shevchenko <ashevchenko@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | qtnfmac: implement net_device_ops callback to set MAC addressIgor Mitsyanko2018-06-271-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | Implement net_device_ops::ndo_set_mac_address callback to allow for setting interface MAC address. Implementation is done through existing CHANGE_INTF firmware command. All validation is to be done by firmware. Signed-off-by: Igor Mitsyanko <igor.mitsyanko.os@quantenna.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | wlcore: Enable runtime PM autosuspend supportTony Lindgren2018-06-279-59/+121
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With runtime PM tested working for wlcore with no autosuspend, we can now enable autosuspend to cut down on enable/disable for interrupts. Basically we just replace pm_runtime_put() with the autosuspend variants. Let's use autosuspend delay of 50ms that MMC drivers typically use. Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | wlcore: Make sure firmware is initialized in wl1271_op_add_interface()Tony Lindgren2018-06-271-13/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have wl12xx_boot() call wl12xx_enable_interrupts() and if we have wl1271_op_add_interface() call pm_runtime_get_sync() before the interrupts are enabled. And then we get the following error during boot: wlcore: ERROR ELP wakeup timeout! Let's fix this by first checking if we need to boot the firmware. And only after that call pm_runtime_get_sync() when interrupts are enabled. And only after that do the check for wl12xx_need_fw_change(). Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | wlcore: Use generic runtime pm calls for wowlan elp configurationEyal Reizer2018-06-271-38/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With runtime PM enabled, we can now use calls to pm_runtime_force_suspend and pm_runtime_force_resume for enabling elp during suspend when wowlan is enabled and waking the chip from elp on resume. Remove the custom API that was used to ensure that the command that is used to allow ELP during suspend is completed before the system suspend. Signed-off-by: Eyal Reizer <eyalr@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | wlcore: Fix timout errors after recoveryTony Lindgren2018-06-271-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After enabling runtime PM, if we force hardware reset multiple times with: # echo 1 > /sys/kernel/debug/ieee80211/phy0/wlcore/start_recovery We will after few tries get the following error: wlcore: ERROR timeout waiting for the hardware to complete initialization And then wlcore is unable to reconnect until after the wlcore related modules are reloaded. Let's fix this by moving pm_runtime_put() earlier before we restart the hardware. And let's use the sync version to make sure we're done before we restart. Note that we still will get -EBUSY warning from wl12xx_sdio_set_power() but let's fix that separately once we know exactly why we get the warning. Reported-by: Eyal Reizer <eyalr@ti.com> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | wlcore: Fix misplaced PM call for scan_complete_work()Tony Lindgren2018-06-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With runtime PM enabled, we now need to have wlcore enabled longer until after we're done calling wlcore_cmd_regdomain_config_locked(): scan_complete_work() wlcore_cmd_regdomain_config_locked() wlcore_cmd_send_failsafe() wl12xx_sdio_raw_read() Note that this is not needed before runtime PM support as the custom PM code had it's own timer. We have not yet enabled runtime PM autosuspend for wlcore and this is why this issue now shows up. Let's fix the issues first before we enable runtime PM autosuspend. Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | wlcore: Add support for runtime PMTony Lindgren2018-06-2714-338/+416
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can update wlcore to use PM runtime by adding functions for wlcore_runtime_suspend() and wlcore_runtime_resume() and replacing calls to wl1271_ps_elp_wakeup() and wl1271_ps_elp_sleep() with calls to pm_runtime_get_sync() and pm_runtime_put(). Note that the new wlcore_runtime_suspend() and wlcore_runtime_resume() functions are based on simplified versions of wl1271_ps_elp_sleep() and wl1271_ps_elp_wakeup(). We don't want to use the old functions as we can now take advantage of the runtime PM usage count. And we don't need the old elp_work at all. And we can also remove WL1271_FLAG_ELP_REQUESTED that is no longer needed. Pretty much the only place where we are not just converting the existing functions is wl1271_op_suspend() where we add pm_runtime_put_noidle() to keep the calls paired. As the next step is to implement runtime PM autosuspend, let's not add wrapper functions for the generic runtime PM calls. We would be getting rid of any wrapper functions anyways. After autoidle we should be able to start using Linux generic wakeirqs for the padconf interrupt. Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | wlcore: Make sure PM calls are pairedTony Lindgren2018-06-271-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | The call to wl1271_ps_elp_wakeup() in wl12xx_queue_recovery_work() is unpaired. Let's remove it and add paired calls to wl1271_recovery_work() instead in preparation for changing things to use runtime PM. Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | wlcore: Add missing PM call for wlcore_cmd_wait_for_event_or_timeout()Tony Lindgren2018-06-271-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise we can get: WARNING: CPU: 0 PID: 55 at drivers/net/wireless/ti/wlcore/io.h:84 I've only seen this few times with the runtime PM patches enabled so this one is probably not needed before that. This seems to work currently based on the current PM implementation timer. Let's apply this separately though in case others are hitting this issue. Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
| * | Merge ath-next from git://git.kernel.org/pub/scm/linux/kernel/git/kvalo/ath.gitKalle Valo2018-06-1821-112/+126
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ath.git patches for 4.19. Major changes: ath10k * support channel 173 * fix spectral scan for QCA9984 and QCA9888 chipsets ath6kl * add support for Dell Wireless 1537
| | * | ath9k: debug: fix spelling mistake "WATHDOG" -> "WATCHDOG"Colin Ian King2018-06-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Trivial fix to spelling mistake in PR_IS message text. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>