summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/ti/wlcore/scan.c
AgeCommit message (Collapse)Author
2022-04-23wl12xx: scan: use pm_runtime_resume_and_get() instead of pm_runtime_get_sync()Minghao Chi
Using pm_runtime_resume_and_get() to replace pm_runtime_get_sync and pm_runtime_put_noidle. This change is just to simplify the code, no actual functional changes. Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn> Signed-off-by: Kalle Valo <kvalo@kernel.org> Link: https://lore.kernel.org/r/20220420090247.2588680-1-chi.minghao@zte.com.cn
2019-06-05treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 336Thomas Gleixner
Based on 1 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 version 2 as published by the free software foundation 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 write to the free software foundation inc 51 franklin st fifth floor boston ma 02110 1301 usa extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 246 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Alexios Zavras <alexios.zavras@intel.com> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190530000436.674189849@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-06-27wlcore: Enable runtime PM autosuspend supportTony Lindgren
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>
2018-06-27wlcore: Fix misplaced PM call for scan_complete_work()Tony Lindgren
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>
2018-06-27wlcore: Add support for runtime PMTony Lindgren
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>
2016-07-06mac80211: Add support for beacon report radio measurementAvraham Stern
Add the following to support beacon report radio measurement with the measurement mode field set to passive or active: 1. Propagate the required scan duration to the device 2. Report the scan start time (in terms of TSF) 3. Report each BSS's detection time (also in terms of TSF) TSF times refer to the BSS that the interface that requested the scan is connected to. Signed-off-by: Assaf Krauss <assaf.krauss@intel.com> Signed-off-by: Avraham Stern <avraham.stern@intel.com> [changed ath9k/10k, at76c59x-usb, iwlegacy, wl1251 and wlcore to match the new API] Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2016-04-12cfg80211: remove enum ieee80211_bandJohannes Berg
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-04-07wlcore: use to_delayed_work()Geliang Tang
Use to_delayed_work() instead of open-coding it. Signed-off-by: Geliang Tang <geliangtang@163.com> [Update commit message] Signed-off-by: Julian Calaby <julian.calaby@gmail.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
2013-11-25cfg80211: consolidate passive-scan and no-ibss flagsLuis R. Rodriguez
These two flags are used for the same purpose, just combine them into a no-ir flag to annotate no initiating radiation is allowed. Old userspace sending either flag will have it treated as the no-ir flag. To be considerate to older userspace we also send both the no-ir flag and the old no-ibss flags. Newer userspace will have to be aware of older kernels. Update all places in the tree using these flags with the following semantic patch: @@ @@ -NL80211_RRF_PASSIVE_SCAN +NL80211_RRF_NO_IR @@ @@ -NL80211_RRF_NO_IBSS +NL80211_RRF_NO_IR @@ @@ -IEEE80211_CHAN_PASSIVE_SCAN +IEEE80211_CHAN_NO_IR @@ @@ -IEEE80211_CHAN_NO_IBSS +IEEE80211_CHAN_NO_IR @@ @@ -NL80211_RRF_NO_IR | NL80211_RRF_NO_IR +NL80211_RRF_NO_IR @@ @@ -IEEE80211_CHAN_NO_IR | IEEE80211_CHAN_NO_IR +IEEE80211_CHAN_NO_IR @@ @@ -(NL80211_RRF_NO_IR) +NL80211_RRF_NO_IR @@ @@ -(IEEE80211_CHAN_NO_IR) +IEEE80211_CHAN_NO_IR Along with some hand-optimisations in documentation, to remove duplicates and to fix some indentation. Signed-off-by: Luis R. Rodriguez <mcgrof@do-not-panic.com> [do all the driver updates in one go] Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2013-10-23wlcore: fix started_vifs calculationEliad Peller
wlcore configures different dwell times according to number of active interfaces (in order to prevent hurting VO during scan). However, determining active vif only according to bss_conf->idle is not explicit enough, and might result in non-started vifs being counted as started as well (e.g. unassociated sta during sta). Fix it by checking for explicit conditions according to the vif type. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
2013-09-30wlcore: cleanup scan debug printsVictor Goldenshtein
Remove scan debug dumps which are rarely used. Make scan debug prints more clear and short. Signed-off-by: Victor Goldenshtein <victorg@ti.com> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <luciano.coelho@intel.com>
2012-12-11wlcore: support scan reports during periodic scanEyal Shapira
FW API changed and now PERIODIC_SCAN_REPORT_EVENT is sent in case results were found at the end of each sched scan cycle. Previous FW was missing that and broke sched scan. This API change is available from 18xx FW 8.5.0.0.27 [Arik - move changes to 18xx specific files, align FW structures to latest for scan command] Signed-off-by: Eyal Shapira <eyal@wizery.com> Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-12-11wlcore: increase scan dwell times if no activityEyal Shapira
There's a limit on scan dwell times of max 30ms in order to avoid degrading voip traffic which could be going on while scanning. However these dwell times increase the chance of missing out on nearby APs leading to partial scan results. Allow configuration of longer dwell times in case there no active interface (i.e. no STA associated or AP up). [Arik - count started vifs using an in-driver function] [Fixed some new checkpatch warnings regarding comments in the networking subsystem. -- Luca] Signed-off-by: Eyal Shapira <eyal@wizery.com> Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-28wlcore: configure dwell times according to scan typeEliad Peller
Allow configuring different dwell times to the different scan types (regular and scheduled). Add new configuration entry (dwell_time_dfs) to conf_scan_settings, in order to allow setting different values for normal scan and scheduled scan. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-28wlcore: add new reg-domain configuration commandVictor Goldenshtein
In 18xx the calibration process of the PHY Cortex domain requires to perform an active calibration of the channel before it can be used for transmission. To fulfill world wide regulatory restrictions, fw should be always synchronized/updated with current CRDA configuration. Add a new "CMD_DFS_CHANNEL_CONFIG" command to update the fw with current reg-domain, this command passes a bit map of channels that are allowed to be used for transmission. The driver shall update the fw during initialization and after each change in the current reg-domain configuration. The driver will save the channel number of incoming beacons during the scan process, as they might be a result of the passive scan on "IEEE80211_CHAN_PASSIVE_SCAN" channel and will update the fw accordingly once the scan is finished, the purpose of this is to be ready in case of the authentication request on one of these disabled (uncalibrated) channels. The new command requires to wait for the fw completion event "DFS_CHANNELS_CONFIG_COMPLETE_EVENT". No scan commands (including the sched scan) can be executed concurrently with the "CMD_DFS_CHANNEL_CONFIG", wl->mutex ensures that. [Arik - move reset of reg_ch_conf_last to safe place inside op_stop_locked] [Eliad - adjust to new event waiting api] Signed-off-by: Victor Goldenshtein <victorg@ti.com> Signed-off-by: Arik Nemtsov <arik@wizery.com> Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-27wlcore: update events enum/struct to new fw apiEliad Peller
The event mailbox in wl18xx has a different (non-compatible) structure. Create common functions in wlcore to handle the events, and call them from the chip-specific event mailbox parsers. This way, each driver (wl12xx/wl18xx) extracts the event mailbox by itself according to its own structure, and then calls the common wlcore functions to handle it. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-27wl18xx: increase MAX_CHANNELS_5GHZEliad Peller
Some regdomains have more than 23 valid 5ghz channels, so 18xx's MAX_CHANNELS_5GHZ was increased to 32. Since now we have different max 5ghz channels values for wl12xx and wl18xx, add a new wl->max_channels_5ghz field, and use it for scan channels configuration. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-27wlcore: split 18xx and 12xx scan mechanismEliad Peller
The scan APIs of 12xx and 18xx are totally different. Use some common functions as much as possible (e.g. for setting scan channels), but split scan.c into chip-specific scan.c files, each implementing its own scan mechanism. (in other words - move most of the current wlcore's scan.c into wl12xx, and implement a similar mechanism in 18xx, according to the new api) New wlcore ops are introduced in order to call the chip-specific scan functions. The template indices used for each scan (regular/scheduled) are also different between the chips, so set the correct indices used for each scan type after identifying the chip. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-11-27wlcore: make scan scan configuration functions more genericEliad Peller
18xx and 12xx have different scan APIs. In 18xx, the scan and the sched scan use the same struct. Prepare the scan configuration functions to it, by taking more generic params (e.g. ieee80211_channel) instead of specific structs/requests. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-09-27wlcore: always use wlvif->role_id for scansEliad Peller
enabled (but not-started) sta role should be good enough for scanning (both normal and scheduled), so use it instead of the device_role. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>
2012-09-27wlcore: Prevent interaction with HW after recovery is queuedIdo Yariv
When a function requests to recover, it would normally abort and will not send any additional commands to the HW. However, other threads may not be aware of the failure and could try to communicate with the HW after a recovery was queued, but before the recovery work began. Fix this by introducing an intermediate state which is set when recovery is queued, and modify all state checks accordingly. Signed-off-by: Ido Yariv <ido@wizery.com> Signed-off-by: Luciano Coelho <luca@coelho.fi>
2012-07-10wlcore: check ssid length against the correct elementEliad Peller
commit 587cc28 ("wlcore: compare ssid_len before comparing ssids") introduced a new bug - the ssid length from the request struct was compared against the ssid length of another request, instead the one of the cmd. This might cause the sched scan request to fail (with -EINVAL) in many cases. Signed-off-by: Eliad Peller <eliad@wizery.com>
2012-07-10wlcore: add probe request templates for sched and one-shot scansYoni Divinsky
The driver configures the firmware template for probe requests during the scan process. If the same template is used for one-shot and sched scans they will override each other when running scans simultaneously. This fix works only on firmwares later than X.3.9.2.112 for single role and X.3.9.2.23 for multi-role. [Some cleaning-up and renaming of the quirk to something smaller -- Luca.] Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-07-10wlcore: enable sched scan while connectedVictor Goldenshtein
New wl12xx firmware supports scheduled scans also while connected. Stop blocking sched scan requests when connected and add a quirk to block in hardware that don't support it (currently wl18xx doesn't). This requires FW version 6/7.3.10.2.112 for single-role and 6/7.5.6.0.25 for multi-role. Signed-off-by: Victor Goldenshtein <victorg@ti.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-06wlcore: set channels 12-14 as pactive for sched scanVictor Goldenshtein
Introduce “pactive” scan mode – which instructs the fw to perform a passive scan until an activity/energy is detected on these channels, once energy detected the channel becomes active. Signed-off-by: Victor Goldenshtein <victorg@ti.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-06wlcore: compare ssid_len before comparing ssidsEliad Peller
When comparing 2 ssids the ssid_len must be taken into account. Otherwise, a substring will be treated as equal. This bug might cause ssids to get scanned as public ssids (rather than hidden), resulting in broadcast probe request (instead of ssid-specific ones) Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-06-06wlcore: add role_id to all the sched_scan commandsYoni Divinsky
Due to a need by the firmware when working in multirole the role id needs to be added to the structs of the following commands: CMD_CONNECTION_SCAN_CFG, CMD_CONNECTION_SCAN_SSID_CFG, CMD_START_PERIODIC_SCAN, CMD_STOP_PERIODIC_SCAN Signed-off-by: Yoni Divinsky <yoni.divinsky@ti.com> Signed-off-by: Igal Chernobelsky <igalc@ti.com> Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-04-12wl12xx/wlcore: move wl1271 struct to wlcore and add opsLuciano Coelho
In order to add chip-specific operations and prepare for future elements that need to be set by the lower driver, move the wl1271 structure to the wlcore.h file and add an empty placeholder for the operations structure. Signed-off-by: Luciano Coelho <coelho@ti.com>
2012-04-12wl12xx/wlcore: rename wl12xx to wlcoreLuciano Coelho
Rename the wl12xx driver directory to wlcore as an initial step towards the split of the driver into wlcore and wl12xx. We just rename the directory first to keep git blame happy. Signed-off-by: Luciano Coelho <coelho@ti.com>