The API wlan_cfg80211_scan_done() abstracts the kernel
API cfg80211_scan_done().This should be made accessible
throughout the driver by making it non-static.
Change-Id: Ic1a882a115d11339909e62e53f040774d5370981
Currently, list empty checks for scan_req_q is done outside the lock.
This is causing synchronization issue during scan and SSR/vdev delete
in parallel.
To avoid this, check for scan_req_q empty inside the lock.
This change also updates the return type of
wlan_schedule_scan_start_request to QDF_STATUS, which is expected by
caller API.
Change-Id: I8b6febdd98af7856fb047b1c9d852e4944a137b5
CRs-Fixed: 2763173
The mac address is tried to be logged from a NULL
bss data pointer, which leads to unwanted behavior.
Remove the logging of mac address from the NULL
bss data pointer.
Change-Id: I83a9e8b1dac0bd4983bf074863987d39187f9db9
CRs-Fixed: 2761731
Currently, vendor scan request is enqueued in the scan queue first and
then posted into the scheduler queue. Now if there is an SSR in between,
then scan request will be freed twice. Once in SSR context and again
in the caller context because scan scheduling fails due to user disabled
the scan.
To resolve this, post the scan request in scheduler queue first. Once
scan request scheduling is success, then enqueue the scan request in
scan queue. This approach can lead to a race condition like after
scheduling scan request, host may get scan response from firmware even
before the scan request is queued. To avoid this race, scan request
scheduling and enqueue should be protected by scan_req_q_lock.
Change-Id: Ic26da0181fb9a902a8a4abb8f68d9fc668f1b3f2
CRs-Fixed: 2714495
The roam sequence in LFR-3.0 is roam scan start notification
from firmware followed by roam start indication and then
roam synch,roam synch frame events. Roam start is sent
after candidate selection and host driver will disable
queues when roam start is received.
But for emergency roam trigger, firmware sends roam start
indication directly without notifying roam scan start to disable
data path queues immediately after deauth received from the AP.
So roam start is received before roam scan is started at firmware
and before candidate selection is done.
After roam start notification, host sends scan abort for all scan
on vdev by setting scan command request type to
WMI_SCN_STOP_VAP_ALL. This results in roam scan getting aborted at
firmare in emergency deauth roaming case and roaming fails.
Introduce new vdev id value based on which the scan module will
abort only host triggered scans setting the flag
WMI_SCN_STOP_HOST_VAP_ALL in the scan request.
Change-Id: I3a162c55d4a008ff986fd957bed395b39c060bb5
CRs-Fixed: 2636410
Enhance logs for PNO scan to remove duplicate
or unwanted prints and keep only useful logs to debug.
Change-Id: Ibe24714e925a00933911c801685528849e160480
CRs-Fixed: 2636641
According to new changes in kernel 5.2 version onwards, driver has to
provide the policy for a NL command to be verified against while
registering wiphy to the kernel.
To accommodate these changes, add policy to the following vendor
command that is being registered in the driver.
QCA_NL80211_VENDOR_SUBCMD_ABORT_SCAN
Change-Id: I7cd4e6c50a48580a124e36c32b9cbebe557c04bf
CRs-Fixed: 2621311
During scan request from framework wlan_cfg80211_scan gets
invoked. If the cfg80211_scan_request parameter has number
of ssids set to zero then driver will set the scan mode to
passive mode. This will result in fw doing passive scan
instead of active scan. Probe request will not be sent to
discover the peer. This will sometimes result in failure
to discover P2P GO peer.
Set the scan mode to active mode in scan request message to FW.
Change-Id: Ic28757cb69ec62e554ac8baccce17cac504a0bef
CRs-Fixed: 2606614
Add active and passive scan dwell time parameters to cfg80211 scan
request API.
Change-Id: I39f479d7b941e4671f1ad4495ab48031153dd5e7
CRs-Fixed: 2598504
Replace channel ID with channel frequency in
wlan_cfg80211_is_chan_ok_for_dnbs.
Change-Id: I0e275da65258f87abfc36d6c9148f9f4437a4389
CRs-Fixed: 2552022
Due to channel number ambiguity with introduction of 6Ghz operation
policy manager APIs are updated to use frequency values instead
of channel number. Update corresponding caller functions to
adapt for frequency usage.
Change-Id: Icc882d28d73d55fce5abaedbdff5f90bec095b61
CRs-fixed: 2550069
As a part of 802.11ax amendment, 6GHz band operation is added.
Since the 6 GHz channel numbers are overlapping with existing 2.4GHz
and 5GHz channel numbers, use frequency to identify unique channel
operation instead of channel number. Channel frequency is unique across
bands.
As part of above requirement add logic to process rx mgmt
packets based on the frequencies instead of channel numbers.
Change-Id: I33e31fa124cedfab31dd1827721a420ad6cdba07
CRs-Fixed: 2519512
Currently in the scan path frequencies received
in the scan request are getting converted to channel
number and again converted to frequncies.
For 6GHz support in the scan path do not convert
frequency to channel number, instead use frequncies
received in scan request to send the scan command to
FW, remove the dummy conversion from chan to freq and
freq to chan.
Change-Id: Ieab7dded0678fac54796bba3b1b210c910f6173e
CRs-fixed: 2534897
Kernel maintains a list of bss and it adds/updates the bss
entries whenever driver informs it. When driver receives
beacon or probe response from any ap it informs kernel to
update the bss list and whenever it disconnects with the
AP driver unlink the bss in the kernel.
If the AP is hidden, when driver gets beacon from this
hidden AP it informs the kernel to update the bss list.
kernel add this entry to it's bss list with NULL SSID.
Now when driver receives probe response from this hidden
AP it again informs the kernel to update the bss list,
as this is probe response and ssid is not hidden,
kernel treats this entry as new entry and adds it to
its bss list and links this entry to the older hidden
AP entry (But still these are two entries for hidden AP).
When driver gets disconnect from the AP it unlink the
bss entry corresponding to this AP from kernel's bss
list, but since there are two entries for the same AP
as the AP is a hidden AP, driver should clear hidden AP
entry (Which was added as part of beacon) which is
not happening currently.
Now when AP moves from hidden to broadcasting SSID
in it's beacon, kernel drops this beacon entry as its
confusing because there is already a beacon entry with
hidden bss for this AP. During connection driver tries
to update the entry in the kernel and it fails as kernel
drops the beacon resulting into the connection failure.
To resolve this issue, whenever driver unlink the bss
entries from the kernel bss list unlink the hidden bss
entries also from the kernel's bss list.
Change-Id: I629475db8e8f10a6bc403314a984939e38d0a4da
CRs-Fixed: 2488955
Currently the drivers blocks every simultaneous scan
that comes to the driver, and returns BUSY.
here if the STA SCAN which is low priority after connection
comes, and at the same time ACS has completed and the hostapd
tries to do a HT scan, it would get error as BUSY, and it
will try to scan again and again until successful or the timeout
happens. This will in turn delay the hotspot bringup as start
ap does not come until the hostapd does a OBSS scan.
Fix is to skip the check of simultaneous scan for SAP, and make
the priority of scan request high for SAP scan.
Change-Id: I163dbb2fdca1245742cca049de47478117197412
CRs-Fixed: 2471897
The current OSIF logging macros use a "cfg80211" prefix. This is
confusing because that prefix should only be used by the Linux
cfg80211 module. To avoid confusion rename the macros to use an
"osif" prefix.
Change-Id: Id3273498f623d04beec879aa9d77c1d33986357a
CRs-Fixed: 2469485
Currently dwell time is determined by scan policy flags from kernel.
Sometimes when we suspect the scan result is not full enough, we need
to set dwell time by force through ini.
Add ini to decide whether to honour NL80211 scan policy flags, so that
we can disable dwell time changed by scan policy flag from kernel.
Change-Id: Ia0b9f957a7de901513479522e008e4bcbd6b2c0e
CRs-Fixed: 2428630
For enhanced repeater independent mode scan request
from wpa_supplicant needs to be set in high priority scan.
Change-Id: I4f95d0e7b2f1d9eb68ed14efd4ee3932ced5af61
CRs-Fixed: 2432916
Currently in the case of concurrent sessions running,
the driver updates the active dwell time for the scan
request to the default value, overwriting the already
filled active dwell time which the DUT got from the
AP as part of RRM request, which results in violation
of protocol.
Fix is to not update the concurrency params if the scan
request is of type RRM.
Change-Id: Ifbb4b45fc111851f544fd39187e4113bda5f7348
CRs-Fixed: 2436893
Currently, the vdev connection status is checked by getting
the bss peer of that vdev, and if the bss peer is in associated
state then vdev connected status is sent as true. It can happen
vdev is present and bss peer is deleted after getting the bss peer
from vdev pointer. Then bss peer can not be dereferenced to get the
its status.
Instead remove all the duplicate api's tdls_is_vdev_connected,
pmo_core_is_vdev_connected, and wlan_vdev_is_connected with
wlan_vdev_is_up. wlan_vdev_is_up gives success status
if associated.
Change-Id: I863c3c0689f329870bd08c813813c16956135209
CRs-Fixed: 2426092
Per the Linux Kernel coding style, as enforced by the kernel
checkpatch script, pointers should not be explicitly compared to
NULL. Therefore within os_if replace any such comparisons with logical
operations performed on the pointer itself.
Change-Id: I1cf6f897d1d2722d112dd3f802d789652373eaed
CRs-Fixed: 2418254
In wlan_cfg80211_scan(), when "DNBS check fails", mem free of scan req is
done. Mem free of scan req is done again at the label "err" which would
end up in a double free.
Change-Id: Ib757832c1bd54372fba45cbc5ee306d0d7b233b0
CRs-Fixed: 2408703
When user sets the vendor ie for probe request frame, it is not
included in the broadcast probe request sent by FW.
Add support to send vendor ie info in scan start command to FW. Therefore,
FW can include this vendor ie in the broadcast probe request frame.
Change-Id: Ie5fc0c074bd7543568a135d3ef4662bf09b274f6
CRs-Fixed: 2400265
Currently the driver returns EINVAL, instead of EBUSY if
the driver encounters a case of simlutaneuos scan, and
DBS scan is disabled for user space, and thus it may lead
to failure of OBSS scan, which can further lead to SAP
fail.
Fix is to return EBUSY intead of EINVAL, so that hostapd
can try to get the scan module perform a scan, which can
increase the probablity of SAP bringup.
Change-Id: I798e3d1ad0f62a5240603b4344963cb3ee637c13
CRs-Fixed: 2403499
If AP change its status from hidden to broadcasting SSID in its beacon
kernel drop the beacon entry as its confusing. Now during connection
driver try to update the entry in kernel and it fails and as kernel drop
the beacon the connection fails.
To fix this detect if AP changed its ssid type from hidden to
broadcasting and unlink the old bss from kernel in that case.
Change-Id: I10ec42749ebcd2ddea23f7f3a94d862124df156d
CRs-Fixed: 2410430
Move all the PNO related structures and CFG items under
compile time flag "FEATURE_WLAN_SCAN_PNO"
Change-Id: I0decb3e0a7cf009ce18ef08eae05734962f6f8c7
CRs-Fixed: 2382997
Currently the driver enques any number of scans it receives
from the NL, or vendor scan path, which can lead to lower
throughputs of the connected profile ( any vdev ), as
antennas would be used by the MAC for scanning, and if
the number of scans are too much, this will lead to a
bad user experience.
Fix is to have a max check of number of scans, and then only
enque a particular scan request.
Change-Id: Iacdb1294ff5e7e20cd30dd328c6ea2b6f7899cda
CRs-Fixed: 2392883
Refactor the following scan related ini items to scan module:
CFG_ENABLE_MAC_ADDR_SPOOFING - ini to enable/disable scan mac
randomization
CFG_SCAN_AGING_TIME - configure scan entries aging time.
Previously these values are populated in hdd and passed to
scan module through ucfg_scan_update_user_config() function.
With new cfg infra, the scan module can directly get these
values from cfg component.
Change-Id: I0dcbd8253ae46387dd44e68c86f0622f279ba501
CRs-Fixed: 2378985
There are couple of instances in driver where variable sized arrays
are getting used which are giving compilation issues on kernel-4.19.
To resolve this issue, replace static array with dynamic memory
allocation.
Change-Id: Idb12386265d03db5c857039b692a82ccdf227836
CRs-fixed: 2386880
Currently the driver allows simultaneous scan irrespective
of the dual mac feature ini config, which can cause
connect latency.
Fix is to disable the simultaneous scan if the dual
mac config ini is configured to disable DBS scan.
Change-Id: I332284880c04955a8ae2ff19eae10313f240d9ae
CRs-Fixed: 2385027
Acquire wakelock to handle the case where APP's send
scan to connect. If suspend is received during scan, scan will be
aborted and APP will not get scan result and will not connect.
eg if PNO is implemented in framework.
Fix is to avoid the system suspend by taking the wake-lock
during scan. Added INI wake_lock_in_user_scan to control this.
The INI is disabled by default.
Change-Id: I62fdbbcbc6f049cb4e36e774d5a417600a2dfa86
CRs-Fixed: 2381622
In wlan_cfg80211_sched_scan_start() in the case where
wlan_cfg80211_is_chan_ok_for_dnbs() returns failure,
"req" is freed both at the point where the test occurs
as well as at label "error". Since label error provides
centralized cleanup for all of the error cases,
remove the free at the point where the test occurs.
Change-Id: Ibde90c58d76d1db48ee3f12c251be5eaa2b68c7b
CRs-Fixed: 2372789
Refactor the prints for rx management frames. Do not print beacon,
probe resp and probe req frames in txrx module.
Also remove the beacon print from wlan_cfg80211_inform_bss_frame.
Change-Id: I1dbfcec1614b9465d97c010fa4c386f3a1612f5f
CRs-Fixed: 2381796
In wlan_cfg80211_scan the number of ssid, ssid length and number of
channels are not checked for max size of array and thus can lead to
Out of bound access of memories.
Fix is to add bound check before copying the params.
Change-Id: Ie6d4e546fb9c884d5988493b611ef7b217f0a95c
CRs-Fixed: 2375217
Add host support for db2dbm RSSI changes. Firmware
indicates this capability when underlying hardware
has RSSI reporting feature. Based on this capability
host will know if firmware sends SNR or RSSI. If no
capablity is present then host will convert SNR to
rssi using a fixed offset of -96. If capability is
present host will directly use the rssi as it is.
Change-Id: I9058f16c6280d466feb96cf88a8a0d8cd7b02032
CRs-Fixed: 2364025
If Vdev id is not present driver tries to get vdev with vdev id 0
from pdev. Vdev with vdev_id 0 might not be present on pdev so use
objmgr API wlan_objmgr_pdev_get_first_vdev to get the first vdev.
Change-Id: I2ae0d6056709339a8167582ec327269aa84c93f4
CRs-Fixed: 2349699
For the case that there is leakage of vdev due to incorrect reference
count usage, and another vdev for the adapter is created, get ref of
vdev by mac address might get the incorrect vdev object since both vdevs
will have the same mac address and the leak one will be first matched
since it is created first.
To address this issue, use vdev pointer in adapter instead of pdev as
input parameter of related functions.
Change-Id: I855497358b5dabf3fc5c0f71a859dd7cae1b450a
CRs-Fixed: 2312155
In a scenario wherein after the sched_scan_start there is a system
recovery and previous pending sched_scan request is lost and during
the sched_scan_stop driver is returning error.
Because of which __cfg80211_stop_sched_scan will not
clear “rdev->sched_scan_req” blocking further sched_scan requests.
Return success in the event that the driver does not have any pending
sched scan to flush.
Change-Id: I6aba88ce033c59ebae54ca792e241a17b649ad73
CRs-Fixed: 2340653
In success scenarios wlan_cfg80211_scan return the qdf status without
converting it to os return status.
Convert the qdf status to os return status before returning in
wlan_cfg80211_scan.
Change-Id: Iee0503191aca371634c9dae9daf15f5aadfe7e2e
CRs-Fixed: 2334591
We are transitioning to new logging infrastructure
by using existing mtrace functionality.
Add new logging for complete scan request and response path.
Change-Id: Iac644a78ef521721d33ce7568be56b47c55fed6b
CRs-Fixed: 2308272
Normally probe request is sent in a passive channel if the
beacon received from the AP. With the strict passive scan
feature, STA doesnot send the probe request even if it
receives beacon from AP.
This can be enabled by using below command.
iwpriv /cfg80211 wifix pas_scanen 1/0
Added a support to send strict passive scan flag to FW in
cfg80211 framework during scan start command.
Change-Id: Ia2c069872541dba64c3d11fc0b533c2d202ee898
CRs-Fixed: 2280181