Commit Graph

8349 Commits

Author SHA1 Message Date
Srinivas Pitla
4f48adea18 qcacmn: Fix EAPOL frames issue in Tx capture
This change fixes issue with EAPOL frames in Tx capture
EAPOL frames completions are received with ACK completion.
For ACK completion, ba_size, ba_bitmap, ba_seqno are not updated earlier.
it was leading to dropping the frames in driver.

This fix updates ba_size, ba_bitmap, ba_seqno for QOS TID frames in ACK
completion handler

Change-Id: I58308a13c1b6addb95f424aa7ad45fe64e93b532
CRs-Fixed: 2620890
2020-03-04 22:59:15 -08:00
Naman Padhiar
f675e5c4f4 qcacmn: Set DMA mask as 37 for WCN6750
Set DMA coherent mask as 37 for WCN6750.

Change-Id: I1fdd98a9c221d2e8ee1ff730e37bd0adaed54dd6
2020-03-04 22:58:59 -08:00
Mohit Khanna
b34654bd55 qcacmn: Callback to get current bandwidth level
Add HIF callbacks to get current bandwidth level from upper layers.

Change-Id: I18524558296f4b7d684f18b0e6615b2a0516b6d2
CRs-Fixed: 2602029
2020-03-04 21:19:30 -08:00
Liangwei Dong
bdd5fcef82 qcacmn: Clear lock->lock.dev to NULL after wake lock destroyed
In kernel 5.4, Wake lock API wakeup_source_register requires
"struct device *" parameter, and it can be NULL value. If it is
NULL, the wakeup_source_register will create a "device" node and return
it by wakeup_source struct.
In qcacld driver, the qdf_wake_lock_create will save the "wakeup_source"
to cld's private struct qdf_wake_lock->lock.
When the cld driver destroy os wake lock by wakeup_source_unregister,
"dev" will also be invalid in kernel, we need to clear the "dev"
field in local copy of wakeup_source in qdf_wake_lock->lock.
This will fix the potential reuse of qdf_wake_lock->lock.dev after it has
been destroyed.

Change-Id: I1de6e95c64b35929bef8be2cdeeb86422bc38515
CRs-Fixed: 2634032
2020-03-04 11:17:25 -08:00
Jinwei Chen
356c6b714e qcacmn: fix null skb accessing due to incomplete scattered msdu
If RX packets reaped from REO2SW ring hit rx_reap_loop_pkt_limit,
REO2SW ring reaping will break and stop, but for scattered msdu case,
all related buffer should be received one time for further processing,
otherwise dp_rx_sg_create can not handle correctly.

(1) make sure all buffers for scattered msdu is received then allow
break when rx_reap_loop_pkt_limit hit.
(2) refine skb unmap location in case msdu_scatter_wait_break logic is
hit, then may double unmap for same skb(not for current issue).

Change-Id: I85d385ee9c3b1a5ed56ae5e5b68636d04968553f
CRs-Fixed: 2632082
2020-03-04 09:56:49 -08:00
Alok Kumar
32de2fe166 qcacmn: Fix compilation and update SHADOW REG OFFSET for qca6750
For qca6750, update the SHADOW REGISTER OFFSET value and
fix the compilation issue.

Change-Id: Ic4b44c1c40e62ddcc50c0a66d37c0663a70b5c54
CRs-Fixed: 2633044
2020-03-04 07:30:44 -08:00
Hariharan Basuthkar
ee4dcfe6d7 qcacmn: Add the API wlan_reg_get_band_cap_from_op_class
Add the API wlan_reg_get_band_cap_from_op_class to get the supported
band capability from an list of operating class as input.

Change-Id: I58dc0bbe7c5436b889c12ac2d68bd769a3c702cf
CRs-fixed: 2617526
2020-03-04 01:27:27 -08:00
Debasis Das
eb601eca1e qcacmn: Fix DSCP to tid mapping for Tx packets
Write TID-no correctly for DSCP-value if
2 consecutive registers are needed to configure
the mapping.

Change-Id: I857f95e2d1bda0214a32b2802f1dcc460be87085
2020-03-03 23:54:10 -08:00
Liangwei Dong
54be27be16 qcacmn: Add an API to get frequency from country,chan,opclass
Add wlan regulatory API reg_country_chan_opclass_to_freq
to calculate channel frequency given country, opclass and channel
number. The API gets channel frequency from country's operating
class table by opclass and channel number pair. If the driver
can not find the pair, then try to find the frequency (MHz) by
channel number only.

Change-Id: I6a23a53e2e53e0b7c81b36f9f5c7794e9749c734
CRs-Fixed: 2605920
2020-03-03 22:20:37 -08:00
Abhishek Singh
5b92984b0b qcacmn: Optimize cp stats prints
Optimize cp stats prints

Change-Id: Idbaa19cc22e2ebcefdbae08169071203cd6ccc49
CRs-Fixed: 2633501
2020-03-03 18:55:32 -08:00
Pankaj Singh
ab8d9337ce qcacmn: Clean up logs in Tdls path
Clean up redundant logs in tdls path.

Change-Id: Ibb47110b82ffc6ddd37442f5a058746d4350cfe3
CRs-Fixed: 2625103
2020-03-03 18:55:25 -08:00
Rakesh Pillai
7a26da4e7e qcacmn: Validate the rx descriptor before dereferencing
The rx descriptor obtained using the cookie
can be NULL if the cookie is invalid. Hence
dereferencing the rx descriptor without any
validation can cause invalid address access.

Fix this by validating the rx descriptor
which has been obtained using the cookie from
the hal ring descriptor.

Change-Id: Ib584f0d8175b581d15b0e1c67d2f6ed9119ecbfc
CRs-Fixed: 2629254
2020-03-03 18:55:00 -08:00
Amir Patel
605e44bf31 qcacmn: Move dp monitor inline APIs to header file
Move dp monitor inline APIs to header file from dp_rx_mon_dest.c
to dp_rx_mon.h to use it in component dev

CRs-Fixed: 2626054
Change-Id: I3a31dacd7d7e817f144708f9bda5536808080864
2020-03-03 18:54:37 -08:00
Paul Zhang
e54fd8b367 qcacmn: enable/disable detecting interop issues ap
Per flag detect_enable to enable/disable detecting
interop issues ap function in firmware.

Change-Id: I52617e3700a3c79fc5b72c53af6d4b8db5e97879
CRs-Fixed: 2602001
2020-03-03 14:18:20 -08:00
Amar Singhal
12105f94d1 qcacmn: Fix auto BW calculation
Auto BW computes new bandwidth for adjacent regulatory rules. But this
combined bandwidth can be more than the bandwidth allowed for a
particular reg-domain. So relax the check for combined BW for
adjacent regulatory rules.

Change-Id: I1486988c114f0348f7228b91aeadc5c027c6a510
CRs-Fixed: 2626165
2020-03-03 14:18:03 -08:00
aloksing
8bfa58f189 qcacmn: spin-lock init before get ref while peer attach
spin lock is called without init while peer attach
move spin-lock init before get ref

Change-Id: Ibf21ac6a7b06c62f2e64a2d89154b21183b9c472
CRs-Fixed: 2628750
2020-03-03 14:17:46 -08:00
Amir Patel
31bfe1fb2c qcacmn: Replenish last entry in monitor status ring
In current monitor status ring implementation,
on pdev_attach, (srng->num_entires – 1) entries
(to keep one entry slot between hp and tp)
are replenished and last entry is not replenished to HW.

With qcn9000 monitor mode HW enhancements, status and destination ring
can be made lock-stepped.
for qcn9000 lock step is achieved by making monitor status ring
follow the monitor destination reap for a PPDU

However in existing flow during attach monitor status replenish logic
do not fill last entry but is filled up during first subsequent reap.
for first ppdu, i.e. after reaping destination ring,
when status ring is reaped, as first entry (hp = srng->num_entires – 1)
in status ring is NULL, so lock-stepping is not achieved.

To address this issue for qcn9000 as well as HK:
	a. Replenish last entry in monitor status ring during attach
	b. Modify src srng peek API to peek it from hp+1 entry
	c. Introduce new HAL API get cur desc and move next

CRs-Fixed: 2626049
Change-Id: I7da6cd6006243cbca2151da22a31a6f5ed0015f3
2020-03-03 12:37:37 -08:00
Pragaspathi Thilagaraj
7a60a81d3a qcacmn: Use enum roam_trigger_reason for fw bitmap conversion
From upper layers the vendor specific control roam bitmap is
converted to unified enum roam_trigger reason. From this bitmap,
deriver the fw trigger reason bitmap at
convert_control_roam_trigger_reason_bitmap.

Depreciate the roam_control_trigger_reason enum.

Change-Id: I64ac273d88b696c32c5b72462454a8983774ef90
CRs-Fixed: 2631968
2020-03-03 04:02:29 -08:00
Yu Tian
42e17e09b4 qcacmn: refine dp_set_key_sec_type_wifi3
Peer key security type is set in cdp_set_pn_check,
this API is called in key install step, but only
update Ucast field even if in Mcast key install.
This may be set wrongly if Ucast and Mcast security
modes are different. Add a new API to set
security modes of differ key types separately.
This change should be reviewd in associate with
review #3036742

Change-Id: Ib9723416fbedbe3dce61224928d51ef203cf7068
CRs-Fixed: 2623114
2020-03-02 19:13:17 -08:00
Mohit Khanna
e05c287f31 qcacmn: Add high priority ordered workqueue APIs
Add APIs to support creation of a high priority, ordered, unbound
workqueue.

Change-Id: Ib7e39a7ca3fcc9ee1ed8886ca62c312a3e3e46a2
CRs-Fixed: 2602029
2020-03-02 17:46:21 -08:00
aloksing
2877d23b09 qcacmn: Add dbg id to string_from_dbgid
Array strings of size 73 may use index value(s) 73..74
Adding dbg ids to strings same as wlan_objmgr_ref_dbgid

CRs-Fixed: 2632424
Change-Id: I8eac1c4f015d54c626c2e74891d8c86ccfb962e4
2020-03-02 16:02:02 -08:00
Sourav Mohapatra
f14a0edd8e qcacmn: Add dummy NLA parsing in driver for kernel >= 5.2
According to new changes in kernel 5.2 version onwards, kernel takes
care of validating the NLA policies as provided by the driver. In this
case there is no need to re-validate the same in the driver.

Add a stub to return true for NLA parse in case the kernel version is
greater than equal to 5.2

Change-Id: Iea1fdcac3000ede2f8b9398cb85443e545cdd3f0
CRs-Fixed: 2632534
2020-03-02 14:31:31 -08:00
Alan Chen
a29108516f qcacmn: Define VENDOR_NLA_POLICY_NESTED macro to support policy check
According to new changes in kernel 5.2 version onwards, driver has to
provide the policy for each NL command to be verified against while
registering wiphy to the kernel.

To enable support for this, define a new macro VENDOR_NLA_POLICY_NESTED
taking care of the version compatibility.

Change-Id: I6aec53e94c57434f8e68b936ad5422248c3fa167
CRs-Fixed: 2632081
2020-03-02 14:31:09 -08:00
Rajeev Kumar
b112466b8d qcacmn: Define vendor_command_policy macro to support policy check
According to new changes in kernel 5.2 version onwards, driver has to
provide the policy for each NL command to be verified against while
registering wiphy to the kernel.

To enable support for this, define a new macro taking care of the version
compatibility.

Change-Id: I0bf7153d1889e5b31c07d6bf4c7a95f5e72dd93c
CRs-Fixed: 2632019
2020-03-02 14:30:48 -08:00
Lihua Liu
a2d35b81ac qcacmn: Enable interrupt mode for CE4 of Genoa
Currently, Genoa CE4 is using interrupt mode. Host will not require
IRQ base on current CE configuration and change below:
"Change-Id: Icabe68298737dc412949484f6d3fdcd8c05910d5", which cause
no IRQ handle of tx completion and source ring full, blocking
TX finally. To unblock TX, correct configuration of CE4.

At the meanwhile, this issue expose another problem that the polling
mode seems doesn't work. Will scope it on another thread.

Change-Id: I31eed8806b939a12503bb4ddd8b9dec85f3c3540
CRs-Fixed: 2602888
2020-03-01 19:45:23 -08:00
Ankit Kumar
2bf9b7a18a qcacmn: Initialize command/credit ring for qca8074 & qcn9000
Initialize command/credit ring for qca8074 & qcn9000.

Change-Id: I28087dd4d8f4afddd954c764c2e85da43eaf78f1
CRs-fixed: 2562649
2020-03-01 05:25:24 -08:00
Ankit Kumar
7e0bf6da72 qcacmn: Corrects function scope typo in function definition
This patch corrects function scope typo in function definition.

Change-Id: I51abda732173a26751fcc68a125cdd04367d0e87
CRs-Fixed: 2620147
2020-03-01 02:07:04 -08:00
Gururaj Pandurangi
2d774f1374 qcacmn: Fix array index overrun in roam scan API
Fix array index overrun by changing index size
WLAN_MAX_ROAM_CANDIDATE_AP from 8 to 9 in a roam
scan API
Also, replace local macro WLAN_MAC_ADDR_SIZE with
global macro QDF_MAC_ADDR_SIZE to avoid issues in
future

Change-Id: Ib546d18e1d85e87064eb5b78c08168db583acf2d
CRs-Fixed: 2621600
2020-02-28 16:32:03 -08:00
Vignesh U
0c37ce5603 qcacmn: Add chirp radar detection support for MKKN
So far, only MKK4 and FCC DFS domains supported Chirp RADAR. But with new
Japan regulation, JP country which is mapped to MKKN DFS domain should
also detect the MKK4 DFS domain's Chirp RADAR.

Add Chirp RADAR detection support for MKKN DFS domain.

Change-Id: Iafd952d70726c9a9b85e73607d4a23c5022b8a46
CRs-Fixed: 2630894
2020-02-28 13:39:25 -08:00
Jinwei Chen
610ed92400 qcacmn: enlarge htt_htc misclist trim threshold
Macro ATH_11AC_TXCOMPACT is defined, so CE4 sending completion will
not free the related htt_htc packets. Currently it depends on
htt_soc->htt_htc_pkt_misclist to free them once this kind of htt_htc
is no longer sitting in CE4 source ring which means CE sending
completion is done already. misclist will free the old/tail of
htt_htc packets if there is > 256 htt_htc packet is pending in list,
but CE4 source ring has 2048 entries, for extreme case, if CE4 sending
is blocking and > 256  htt_htc packets is pending in CE4,
misclist will free the tail htt_htc packet, but later CE4 sending
completion is coming, invalid access to htt_htc packets will happen.
  Enlarge misclist trim threshold > 2048 to ensure that when free
htt_htc packet in misclist, the htt_htc packets has done sending
completion already.

Change-Id: I2d86f68485b1d45a5ea4edb6b952f746700df54f
CRs-Fixed: 2609903
2020-02-28 02:59:54 -08:00
Adwait Nayak
48d23f29a1 qcacmn: CFR: Update RCC specific debug statistics
Move RCC specific debug statistics to Data path
to avoid allocating nbuf for the PPDUs for which
MAC has not sent a Freeze TLV. Instead just update the
debug statistics at an earlier point irrespective of
MAC sending Freeze to PHY, to gather below information:
Status of number of PPDUs being captured by PHY
Status of MAC sending freeze TLV for the PPDUs
Update freeze reason for the number of PPDUs received

Add support to clear debug statistics at user's will.

Change-Id: I8def3ce1f3ecc0b169030704db3fb1fb1c0a20ee
CRs-Fixed: 2609604
2020-02-28 00:20:49 -08:00
Amit Shukla
fc8337d5de qcacmn: Add support for noACK frames
Intercept monitor destination path for NDPA frames,
use it to generate noack frames for tx capture.

Change-Id: Ia54196bd84729a7863954b6deec7e02b52f23556
CRs-Fixed: 2605672
2020-02-28 00:20:34 -08:00
hqu
fe04486a96 qcacmn: Define WLAN_DCS_MAX_PDEVS for dcs use
For MCL side, WLAN_UMAC_MAX_PDEVS is always 1 from current design,
so it's wrong to use WLAN_UMAC_MAX_PDEVS define array dcs_pdev_priv,
since dcs_pdev_priv includes firmware indicated pdev dcs information,
define WLAN_DCS_MAX_PDEVS to 3 for dcs use, this will be compatible
for both MCL and WIN side.

Change-Id: I3bac35f561c49e9959645e85774662ff48d7903d
CRs-Fixed: 2627683
2020-02-27 14:52:33 -08:00
Adwait Nayak
99a4329e07 qcacmn: CFR: code clean up
Remove unnecessary inclusion of cfr_api.h
and fix the return types

Change-Id: I85fb45777e527b46ad086a3d3211cdf6019312ec
CRs-Fixed: 2609610
2020-02-27 14:52:15 -08:00
Ananya Gupta
9b146aa11a qcacmn: Iterate over all vdev ids to check if peer exists
Currently when checking for duplicate peer, only the vdev
id on which peer is going to be created is checked and not
on other vdev ids. So correct it by iterating over all
vdev ids.

Change-Id: Ie05ecc125d3285a522021b630fc7244501b6a797
CRs-Fixed: 2629146
2020-02-27 13:16:57 -08:00
Vulupala Shashank Reddy
616976e2ce qcacmn: Add support to include ACK status and tx retry count
Extend radiotap header to append ACK status and tx retry count
for packets sent to virtual mon interface.

Change-Id: I51037ffd11dfdee49278d43643fb7861a514ee18
CRs-Fixed: 2627710
2020-02-26 22:39:17 -08:00
Nirav Shah
5ad9b66679 qcacmn: Disallow TKIP/WEP with HT supported client
As softap, send assoc failure if HT supported client try to associate
as WEP/TKIP pairwise key.

Change-Id: Ie33e5d83ec18e10aae51a4cc3515f754bd24774e
CRs-Fixed: 2623660
2020-02-26 20:47:06 -08:00
Amar Singhal
c0de18fdc6 qcacmn: Fix maximum bandwidth in regulatory rules
Regulatory rules cannot have maximum bandwidth more than the
width of the rule. Fix this logic for six ghz regulatory rules.

Change-Id: Icbd4eb95d4de54acaef0aa635c293451ba4e1987
CRs-Fixed: 2620699
2020-02-26 14:57:06 -08:00
Yeshwanth Sriram Guntuka
e71aeae1bd qcacmn: Set FIXUP_NBUF flag only on successful nbuf map
In the scenario where nbuf_map fails during packet
send in htc_issue_packets, restore_tx_packet done
as part of cleanup, does nbuf unmap even though map
failed.

Fix is to set the fixup_netbuf flag only if nbuf map
is successful.

Change-Id: I642eff15792a7e374434e5a7a05ad546af376b3a
CRs-Fixed: 2625765
2020-02-26 13:31:07 -08:00
hqu
e6d0730c6b qcacmn: Rename is_target_pdev_id to is_host_pdev_id
It's more suitable that rename is_target_pdev_id to is_host_pdev_id.

Change-Id: I5ec8971ac564e1a26f1b544f9bc2cc08e29f949d
CRs-Fixed: 2627802
2020-02-26 11:40:32 -08:00
Sumedh Baikady
d188789876 qcacmn: Enhancement in Minidump feature
Handle minidump logging using dynamic
configurablity options. Data structures
to be logged in minidump can be configured
using internal INI file.

Change-Id: I99f12b3f98c4a9c0e15c3e5d611019e6b8d0909a
2020-02-26 08:35:46 -08:00
Liangwei Dong
5d64a83690 qcacmn: Add pmksa based on SSID and cache id
For FILS pmksa cache, the pmksa add/del/query is based on SSID
and cache id. The current crypto pmksa cache API dosn't support
SSID and cache ID.

1. Add SSID/Cache ID support to pmksa API
2. Add RSN IE pmkid field based on SSID/cache ID

Change-Id: I1577c6293b75d6f8e6210f314dd83462e06d8190
CRs-Fixed: 2621860
2020-02-26 06:42:56 -08:00
Abhinav Kumar
edda5aa847 qcacmn: Send WMI_ROAM_OFFLOAD_FLAG_SAE_SAME_PMKID flag to FW
Send new flag WMI_ROAM_OFFLOAD_FLAG_SAE_SAME_PMKID through
11i offload param to indicate fw whether WLAN_SAE_SINGLE_PMK
feature is enable or not.

If flag is set, fw should use single PMKID for SAE roaming
between VSIE AP(s), else fw should complete roaming by
doing full SAE authentication.

Change-Id: I9c88772c9571230c38e2cfa41c8a0c79663572ab
CRs-Fixed: 2616046
2020-02-26 06:42:37 -08:00
Ananya Barat
cbee232e21 qcacmn: Do not allocate memory of size zero
In a few scenarios, the number of reg rules can be 0.  For example,
for  a  2Ghz-only radio  there are no 5Ghz reg rules.  In such cases,
if we try to allocate memory (0 bytes) the allocation function prints
an error message. Also, the allocation is not required. Therefore, avoid
the allocation when the number of rules is zero.

Change-Id: Ic9caf578541970e9cf12cdde181f23762f137db8
CRs-Fixed: 2622109
2020-02-26 04:54:08 -08:00
nobelj
d3a6d13d9f qcacmn: Fix to support ack ba status tlv comes twice
Sometimes ack ba status tlv comes twice which cause ppdu desc to be hold
as waiting for some more tlv as mpdu ack ba tlv is not matching with
completion common tlv mpdu count.

Change-Id: Id946ecd53018ee7abe93aa6c5f62e69d41b750e8
2020-02-25 21:59:08 -08:00
Liangwei Dong
4f2b0feab6 qcacmn: Fix memory leak in get_station_stats_cb
There is memory leak in get_station_stats_cb:
priv->vdev_summary_stats, priv->vdev_chain_rssi,
priv->peer_adv_stats. But the “request” is not leaked,
that means the “.dealloc” should be called.
The suspect is the get_station_stats_cb was called two
times with same cookie (request) before the "request"
was freed, that caused the priv->vdev_summary_stats
and the others two member of "priv" were overwritten,
and then memory leaks.

From the cp stats components there are multiple places
to call ucfg_mc_cp_stats_reset_pending_req to reset the
unused pending.req(has a cookie) to zero.  The zero
cookie may be used in again.

Change the ucfg_mc_cp_stats_reset_pending_req API to do
atomic operation of "reset" and "get" last pending
request.

Change-Id: I5efb7efec4da1edc0aab33b940dc126012a3f12e
CRs-Fixed: 2622444
2020-02-25 21:58:50 -08:00
Amit Shukla
28432f1195 qcacmn: Fix crash in frag path by using correct API to obtain PDEV
PDEV was being obtained using lmac_id by directly indexing the
pdev_list array. Instead, we need to use dp_get_pdev_for_lmac_id.

Change-Id: I1c4a0f3df5db59390e17666a5f712c5412e22bb1
CRs-Fixed: 2627909
2020-02-25 20:26:22 -08:00
Amar Singhal
c749787a01 qcacmn: Fix definition of function reg_freq_width_to_chan_op_class_auto
Fix definition of function reg_freq_width_to_chan_op_class_auto

Change-Id: I92504d992153f6ee2dd6d31b2d2976822505856a
CRs-Fixed: 2626433
2020-02-25 15:32:54 -08:00
Abhinav Kumar
0cb7296478 qcacmn: Optimize logs for roaming and tdls
Optimize logs for roaming and tdls

Change-Id: I55d3f1242c240064fe34dbfe6552ee5bae6522f6
CRs-Fixed: 2627699
2020-02-25 15:32:37 -08:00
Chaoli Zhou
588021e773 qcacmn: Pass shadow register address for IPA
Since it support PCIe shadow register for QCN7605,
and these shadow register also falls below 512K,
which can be used for IPA write directly without
windowing. So don't use the temporary PCIE_PCIE_SCRATCH_2
for IPA GSI write now, insteadly, passing the correct shadow
register of copy engine 5 to IPA.

Change-Id: Ica3a502b96e98ee6c07c1032760b5dcb512957d8
2020-02-25 14:03:43 -08:00