Commit Graph

1016 Commits

Author SHA1 Message Date
Orhan K AKYILDIZ
547ec52872 qcacmn: fix a potential access after free
Once the wmi command is send to the FW, a sequence of events
(deletion of peer and sending of unmap messages to host) happens
on FW. This could potentially make a subsequent access to peer_addr
an access after the object is freed. Indeed a crash instance of
such a case has been reported.
Fix this by moving the print command before the actual wmi command
send.

Change-Id: I5a0d19b9b4a09687d5513acc52139a73b8490512
CRs-Fixed: 1108700
2017-01-17 18:58:38 -08:00
Sandeep Puligilla
45c0daed19 qcacmn: Move defination of WMI_DBG_PARAM to host wmi file
Defination of enum WMI_DBG_PARAM is used only in host
so moved to host private wmi file.

Change-Id: I42a529b343e4e6e81b570c505385cfc8dbf9f017
CRs-Fixed: 1107600
2017-01-17 16:29:59 -08:00
Pratik Gandhi
7af44280a7 qcacmn: Convert wireless modes to host internal values
Convert the wireless_modes HALPHY capability from FW defined REGDMN_MODE
values to host internal WMI_HOST_REGDMN_MODE values. This will help make
host code independent of target specific definitions.

Change-Id: I6d325f76959b35a3f854ade680f4d058c9d4bfcb
CRs-Fixed: 1061096
2017-01-17 10:38:14 -08:00
Pratik Gandhi
6d2e13bb26 qcacmn: Fix for write operations in wmi_recording
Change incorrect extraction of wmi_handle from file handler
reference during write operations, performed on debugfs files
in wmi_recording/wmi logging.

IR-Fixed: 189093
CRs-Fixed: 1111722

Change-Id: I0603efe8f8e2530950f845f9ef9419b6784c626f
2017-01-16 12:57:32 -08:00
Sarada Prasanna Garnayak
6249b4350a qcacmn: Runtime PM packets tagging after wow suspend
qcacld-2.0 to qcacmn propagation.

Don't Tag Non-WoW packets as Runtime PM packets after
wow suspend. Some WMI Commands can be send in Runtime
PM context and MC thread context. Packets coming via
MC Thread Context can be tagged as Runtime PM packets
when runtime pm in progress.

Packets should be tagged in the same caller context to
avoid any race condition. Being stability issue, addressing
this issue by not tagging any non-wow commands as runtime pm
after wow suspend. This will ensure all the non-wow packets
coming after wow_suspend flag is set as non runtime pm packets
and will trigger a runtime resume.

Git-commit: 4a396d80c5cc2ded75098c61426521b9b2762c17
Git-commit: 2ee4bf4791cc5db30ec03eceaf591367deffe39a

CRs-Fixed: 1106496
Change-Id: I4e55733ad8403581aca0b49ce9442fc5591335c0
2017-01-12 05:26:11 -08:00
Sathish Kumar
3148cb077a qcacmn: Fix issue in extraction API for peer and vdev extd stats
wmi_stats_event structure is defined in FW header wmi_unified.h with
variable length data as A_UINT8 data[0]. KW tool perceives this
as a single uint8 and throws zero sized array when we try to access buffer
following data.

A uint8 pointer is assigned to data for this purpose in order to fake
the tool and resolve the issue.

Change-Id: I998f80c84554bc5bf4d0b2df1dae85352d72cb21
CRs-Fixed: 1106787
2017-01-09 02:41:10 -08:00
Sathish Kumar
07918bf4b7 qcacmn: Fix CTL power configuration issued through acfg tool
When CTL array is configured using acfg_tool, the CTL values are not
impacting powers due to incorrect band value passed to the FW. It is
found that the memory copy for band and CTL array are done together
in a single operation.

However, with convergence, both acfg_tool and wifitool will call the same
underlying WMI API to set the CTL table. In order for concurrent working,
we need to copy the band value separately for acfg_tool, before copying
the CTL array. This fixes memory corruption that is currently seen
as evident from the garbage value for CTL band.

CRs-Fixed: 1087168
Change-Id: I42f6bc39eb3930e8c995ff76294b7d77676f2299
2017-01-05 04:09:37 -08:00
Paul Zhang
c028941135 qcacmn: Drop Action frame in FW config by host
Propagation from qcacld-2.0 to qcacmn.

Several Action frame categories are not processed in host and they
are not forwarded to supplicant either, but they are dropped in host.
These unprocessed action frames are forwarded to host by FW and
wake up host unnecessarily which leads to battery drain. With this fix,
host conveys FW the disallowed action frames list at HDD startup
so that the remaining frames can be dropped in FW itself thereafter
when under WoW mode.

Change-Id: I40b49d42df94085784c8f1d8321de0ee61473ae0
CRs-Fixed: 999114
2017-01-04 18:09:31 -08:00
Kiran Venkatappa
edeb20382f qcacmn: Add cal data version check status enums in host
Add WMI host defines to check cal data status and use appropriate copy
macros to take care of big-endian conversion.

Change-Id: I4358761e807ac584c638b6e36229dbbbb85bf651
CRs-Fixed: 1105756
2017-01-02 14:58:58 +05:30
Nandha Kishore Easwaran
a1e3bcfaf0 qcacmn: Handle multiple keyix cases for WEP
Add a check to see if the key index is more than 4.
Assign default key_id of 0 if an invalid index is provided.

Change-Id: Ic3a4230360f1fa4e05dfd3ba4f558ff0fb074aef
CRs-fixed: 1103920
2016-12-28 03:19:36 -08:00
Nishank Aggarwal
9a5fc62db2 qcacmn: CL 1683879 - update fw common interface files
WMI message to allow Specific Absorbtion Rate / tx power
limits to be set per band, chain, or modulation class.

Change-Id: Iece786a4e731462fd282e3eb3107541338a3af30
CRs-Fixed: 865207
2016-12-27 23:33:28 -08:00
Sandeep Puligilla
33689f5f4a qcacmn: CL 1685950 - update fw common interface files
WMI defs for DFS offload

Change-Id: Ief6ea8771ec130a94f19c7296930534364bdd2fb
CRs-Fixed: 865207
2016-12-27 23:33:26 -08:00
Kiran Venkatappa
9d22322f94 qcacmn: Fix compilation for 64-bit platform in non-tlv.c
Remove SUPPORT_64BIT_CHANGES compiler flag to make code common for both
64-bit and 32-bit platform.

Change-Id: I47e43c39e7f58cd04cbc3fb21d348af6b094e006
CRs-Fixed: 1105174
2016-12-27 03:39:38 -08:00
Soumya Bhat
b141f8dcac qcacmn: Add wrapper for WMI event registration
Add wrapper to make WMI layer agnostic to the context in
which the WMI registered event handler should execute.

Change-Id: I3b8b4621cfa8d816188fdc5c688bce94528eca59
CRs-Fixed: 1096016
2016-12-22 15:26:30 -08:00
Kiran Venkatappa
5861c299d3 qcacmn: Add beacon burst,tx_power and tx rate ids for TLV
Defines for Beacon burst mode, management tx power and beacon tx rate
are added recently for TLV targets. Add these defines to the supported
list of pdev and vdev param ids used by host.

Change-Id: Ifa5d17211943eff3f2d9422f7898a00c3d794a39
CRs-Fixed: 1100734
2016-12-20 01:01:18 -08:00
Manikandan Mohan
360f646c3b qcacmn: Add SAR power limit configuration
There is a regulatory requirement for Specific Absorption
Rate (SAR) whereby the phone transmit power is reduced
when it is determined that the phone is in close
proximity to the body.
Implement a vendor command interface to set SAR power
limts dynamically.

Change-Id: I0a214a2af780e9dd8c381c4e9eaa7d8cab6ef853
CRs-Fixed: 1098102
2016-12-16 16:44:57 -08:00
Kiran Venkatappa
88a68589e2 qcacmn: Add proper scan req flags and bssid in scan request
scan req flags for FW should be set based on the flags in request.
scan request is assuming num_bssid as one and copying single
mac_address but it should support more bssid and hence change this
to add multiple bssids.

Change-Id: I3fbad3353c1a9904847e09c527254e104cb6db71
CRs-Fixed: 1099421
2016-12-12 12:58:13 -08:00
Kiran Venkatappa
66080493b0 qcacmn: Use correct flag to set DFS in vdev start request
Currently, WMI is using dfs flag offset that needs to be set from upper
layers. But these offset is defined by wmi and it is correct to set it
from WMI itself.

Change-Id: Ib9ff2122ed5b92fb21b01a87f0e99c3a54d1a83c
CRs-Fixed: 1099416
2016-12-12 12:58:12 -08:00
Srinivas Girigowda
9a88de77d7 qcacmn: Fix incorrect data type assignment
In function wma_get_buf_extscan_change_monitor_cmd() and
wma_get_buf_iextscan_hotlist_cmd(), numAp is of type uint32_t
but it is assigned to variable numap of type int.

Fix this by making 'numap' also of same type 'uint32_t'.

Change-Id: I02502f05d2305f62cbde47db2893770673d19fc3
CRs-Fixed: 1096384
2016-12-09 17:51:53 -08:00
Srinivas Girigowda
089c33e336 qcacmn: Add boundary check for number of APs
Add boundary check for number of APs.

Change-Id: I41e36d11bc3e71928866a27afc2fbf046b59f0f5
CRs-Fixed: 1095770
2016-12-09 17:51:51 -08:00
Pamidipati, Vijay
5ca52020ae qcacmn: Fix mac address value sent in peer assoc WMI command
Copy MAC Address in 2 word format in WMI message from char array input

CRs-Fixed: 1088985
Change-Id: I36e4e806b9c027ee824c77ca692239c7752b8036
2016-12-06 13:18:21 -08:00
Naveen Rawat
8fb94f6847 qcacmn: Populate qos_enabled in roam_scan_offload_cmd
In function send_roam_scan_offload_mode_cmd_tlv, assign qos_qnabled
parameter being sent to firmware. Otherwise firmware will not be able
to get correct qos_caps value.

Change-Id: I3bdf43594f68cb0780f2947fff9db723644b5dac
CRs-Fixed: 1092258
2016-12-01 16:09:40 -08:00
Nandha Kishore Easwaran
b423f1f3f8 qcacmn: change name for ZeroCACDFS
The term "agile" is used by hardware for swift/fast channel change.
Use precac for the zeroCACDFS instead.

Change-Id: I35f4d61cc93b3542feb8b286cbdf3a4474df5a75
Crs-fixed: 1073945
2016-11-30 12:40:45 -08:00
Sathish Kumar
92c7904b41 qcacmn: Add wmi support for btcoex duty cycle command
A new iwpriv command has been added to configure the period
and wlan duration for a btcoex duty cycle.

As a part of this registring the wmi_service_btcoex_duty_cycle
for WMI_SERVICE_BTCOEX_DUTY_CYCLE.

Also send_btcoex_wlan_priority_cmd registrtaion for btcoex
duty cycle command in non_tlv_ops.

Change-Id: I7f3bfdfd9804566d6d0b7cce7025e99db57d0e23
Acked-by: Basamma Yakkanahalli <ybasamma@qti.qualcomm.com>
CRs-Fixed: 1064437
2016-11-30 12:40:43 -08:00
Nandha Kishore Easwaran
b408ac4481 qcacmn: Change DFS agile flag
Agile flag WMI_CHAN_FLAG_AGILE_MODE added. When this flag is set,
the primary VHT80 will not be affected when channel change is done.

Change-Id: Ie6bce12ec955c0c8a79246dda57092808611803d
CRs-Fixed: 1072504
2016-11-30 12:40:41 -08:00
Sathish Kumar
4f30c00e1c qcacmn: Add non-tlv APIs for new WMI commands and support for old commands
Implement following WMI commands and corresponding event extraction
APIs added for WIN release-
WMI_PEER_GID_USERPOS_LIST_CMDID
WMI_PEER_TX_MU_TXMIT_RSTCNT_CMDID
WMI_PEER_TX_MU_TXMIT_COUNT_CMDID
WMI_PDEV_CHECK_CAL_VERSION_CMDID
WMI_BTCOEX_CFG_CMDID

Additions to following existing WMI commands-
WMI_MU_CAL_START_CMDID
WMI_SET_LTEU_CONFIG_CMDID
WMI_PDEV_GET_TPC_CONFIG_CMDID
WMI_START_SCAN_CMDID

Change-Id: Ifd43addf196f2bc3cbff33671ef66202b8b0b487
CRs-Fixed: 1059400
2016-11-30 12:40:40 -08:00
Dustin Brown
72e658b87a qcacmn: Pass WOW enable flags to FW
For WOW Enable, firmware accepts a bitmap of flags, but passing them
to firmware is not exposed by WMI. Modify WMI to allow passing WOW
Enable flags to firmware.

Change-Id: I458b01bc6a4e5b14b2a1dfee928136daeb70ebe9
CRs-Fixed: 1092068
2016-11-28 11:42:58 -08:00
Kiran Venkatappa
1f27ef32c5 qcacmn: Fix implicit declaration error for TLV helper APIs
Include TLV helper header file to fix implict function decration warning
treated as error. These APIs are required only for TLV target, hence
put it under TLV compilation flag.

Change-Id: I50f3629b3f69c3cdb46e2384e47d2559c803cd4c
CRs-Fixed: 1090087
2016-11-23 23:14:29 -08:00
Jeff Johnson
589ca0919d qcacmn: Fix -Wmissing-prototypes in WMI
We want to enable the compiler's -Wmissing-prototypes switch, but
there is existing code that is generating warnings. Fix all warnings
in wmi.

Change-Id: I2452ffa4e9fa1de8a7bd75d04dd4a0f94d7cf55c
CRs-Fixed: 1093298
2016-11-23 14:44:54 -08:00
Sathish Kumar
7423df4905 qcacmn: Add channel noise floor and rx cycle count to DCS IM stats
Add additional stats namely channel noise floor and rx cycle count
to DCS interference stats structure maintained by WMI.

Change-Id: I0e6245c1888b5028daaa94e309ca7cc49073edc9
CRs-Fixed: 1087114
2016-11-17 20:57:42 -08:00
Dustin Brown
d2a62b50ec qcacmn: Fix use-after-freed when sending WMI command to FW
Using a buffer after passing it to wmi_unified_cmd_send() induces a
race condition that may result in a use-after-freed situation. Fix
several potential use-after-freed situations when calling
wmi_unified_cmd_send() by ensuring all access to a buffer is done
before the call to wmi_unified_cmd_send().

Change-Id: I985aad6e49daf1d823e3751a9cb0a293a298323c
CRs-Fixed: 1089713
2016-11-16 01:59:30 -08:00
Kiran Venkatappa
3a4153318c qcacmn: Add extract routines for WMI ext service ready event
Add helper routines to extract TLV params in WMI EXT service ready
event. These helper routines abstracts all TLV related information
providing APIs to extract ext serivce ready params.

Change-Id: Ic989331856ed2f9376965bdec4b658328f9e470b
CRs-Fixed: 1079237
2016-11-09 22:57:44 -08:00
Mukul Sharma
5984d920a0 qcacmn: Change WMI command limit to 256 from 1024
qcacld-2.0 to qcacmn propagation

To debug the fwr stuck issue as early as possibile,
reduce the wmi max pending command threshold to 256
from 1024.

Change-Id: Ic3cbe26cca979dcaa68fca03e6fe1af397cf0c4f
CRs-FIXED: 1080761
2016-11-08 02:36:59 -08:00
Leo Chang
e34fbde3bd qcacmn: add lithium rx queue setup wmi messages
WMI changes for rx reorder queue setup.

Change-Id: I4c8b1a5b8fd50cceaf754bdfdecada695871fe96
CRs-fixed: 1080338
2016-11-02 12:02:09 -07:00
Selvaraj, Sridhar
c871917062 qcacmn: Add wmi_roam_scan_mode_fixed_param TLV alone for RSO Stop command
Add only wmi_roam_scan_mode_fixed_param TLV for ROAM_SCAN_MODE disable
command[i.e. mode is set with WMI_ROAM_SCAN_MODE_NONE |
WMI_ROAM_SCAN_MODE_ROAMOFFLOAD]. This is to retain the scan params
[n_probes, dwell time] so that it can be used if ROAM_INVOKE command
follows ROAM_SCAN_MODE disable.

Change-Id: Iafe31850872cac3eaff35eeb57ab271b4409ef18
CRs-Fixed: 1084912
2016-11-02 08:46:49 -07:00
Nandha Kishore Easwaran
f43bcd23ec qcacmn: Update scan_ctrl_flags when strict passive scan enabled
Analysis: strict passive scan is not working as the scan_ctrl_flags
check is missed when strict passive scan enabled

Change-Details : Added a support in ol_ath_scan_start_send() and
send_scan_start_cmd_non_tlv() to update the scan_ctrl_flags with
WMI_SCAN_FLAG_STRICT_PASSIVE_ON_PCHN when strict_pscan_enabled

Change-Id: If6713e340841d4947ef9042421dabec35f7bfbae
CRs-fixed: 1069383
2016-10-30 05:29:10 -07:00
Nandha Kishore Easwaran
9d81d219e2 qcacmn: CTL changes for Beeliner family
For Beeliner family of chipsets, the number of values expected is 688
for 2G and 1540 for 5G

Change-Id: I2c47ed98f639c09453687fce7f713946304a7036
CRs-fixed: 1071083
2016-10-30 05:29:09 -07:00
Govind Singh
0f785150ba qcacmn: Clear WMI cmd buffer after TX completion
WMI command buffer is not cleared after WMI command TX completion.
For DISA certification TK and GTK should not remain in the memory
area after disconnection. Since WMI command buffer is not cleared,
hence content of TK and GTK is still in host memory region.
Clear WMI cmd buffer after TX completion.

Propagation from qcacld-2.0 to qcacmn.

Change-Id: Ib09a77b630c932409645b7a989bd959f0ed4f514
CRs-Fixed: 1060982
2016-10-27 05:48:35 -07:00
Sarada Prasanna Garnayak
8f62b99c33 qcacmn: Log Transport Layer Tag for debugging purposes
Log Transport Layer Tag for debugging. The tag differs for
normal command and the runtime pm commands.

CRs-Fixed: 1072520
Change-Id: I7ec085410aaa429cfeb8cc09729e62deee9c7d95
2016-10-26 21:34:31 -07:00
Sathish Kumar
c4218f3dea qcacmn: Adapt WIN driver with FW abstraction changes
Recently added changes for coexistence of WIN/MCL TLV implementation
through CL I6868c288a43fd3afb19c84b8a9d4ef0dfbee5c94 require
adaptations in QCA WIN driver to successfully compile.

Add required definitions in WMI layer to adapt WIN driver to
changes made for coexistence.

Change-Id: I99550ca10553d8096b8967249c006bac4e0c62df
2016-10-26 11:19:00 -07:00
Sathish Kumar
62e0928848 qcacmn: Abstract RTT related operations out of WMI layer
Currently, RTT related operations to change report type and number
of measurements are done in the WMI layer.

Abstract these operations out of WMI layer and keep it in the WIN
host API layer to make the RTT WMI API generic.

Change-Id: I9b73830912c6c2b3d0908788f1f6a77b7f43dcaa
2016-10-25 22:29:32 -07:00
Sathish Kumar
532efd251f qcacmn: Set txrx chainmask to 0 for non CFR RTT report type
TxRx chainmask is populated by the FW only in the case when report
type is WMI_RTT_REPORT_CFR.

Populate txrx chainmask to 0 when RTT report type is non-CFR to avoid
corruption.

Change-Id: Ie728656efe2f608e90a15b6fc94be3159db0f635
CRs-Fixed: 1080686
2016-10-23 21:05:29 -07:00
Sathish Kumar
3fc96f7b25 qcacmn: Add LOWI messages to be sent to FW
LOWI messages to register, set capability
and send RTT measurement request are not sent assuming only
LCI and LCR messages are sent out to the FW using ol_ath_lowi_data_req_to_fw.

Add code to send messages other than LCI and LCR through the API in
ol_if_lowi.c when msg subtype is not one of LCI or LCR.

Change-Id: I2deedaa6e03e769bf802337b2ec93d9573eb1b5a
CRs-Fixed: 1079169
2016-10-23 21:05:28 -07:00
Houston Hoffman
ebc2bbce56 qcacmn: Free pkt in wmi_unified_cmd_send error path
The packet is allocated in wmi_unified_cmd_send so if it doesn't
get sent or added to a queue it needs to be freed.

Change-Id: I763824812d3c0510c53a70caf063568385b9bfc2
CRs-Fixed: 1079509
2016-10-20 15:12:28 -07:00
Pratik Gandhi
381fd122d7 qcacmn: Revert back implementation of wmi_mgmt_command_record
WMI_RECORDING:Fix implementation of WMI_MGMT_COMMAND_RECORD to
be compatible to WIN.
Current implemantation uses variables not applicable to
WIN.

CRs-Fixed: 1067944
Change-Id: I65b2415e40bd888d3b94ef5f04ec6d53b4d50da2
2016-10-19 21:58:02 -07:00
Sathish Kumar
bd6de98526 qcacmn: Fix compilation error when peerflow control for mode 0 is enabled
Change-Id: I5c6bd2668861119f9d61a2895a93deb6f7e7832b
CRs-Fixed: 1066302
Acked-by: Sahoo, Amarendra Kumar <c_aksah@qti.qualcomm.com>
2016-10-17 21:59:24 -07:00
Sathish Kumar
a511f97d8a qcacmn: Support for Tx data capture WMI command
Tx data capture feature needs a new WMI command.
The fw common file is already reflecting this new
command.

New enum is added to WMI_HOST_PKTLOG_EVENT for this
feature.

Change-Id: I7b8535a311033debbbee5f56c87ac4858a0aa8e1
CRs-Fixed: 1068402
Acked-by: Debasis Das <ddas@codeaurora.org>
2016-10-17 06:22:50 -07:00
Mukul Sharma
019562cd1f qcacmn: Enhance EPNO feature
qcacld-2.0 to qcacmn propagation

Make the following enhancements to the EPNO feature:
1) Implement the reset EPNO command handler
2) Add new parameters for candidate score calculation.

Change-Id: Iad1ff9c2b003c9e3ddbc3373366686040ccb55ca
CRs-Fixed: 1075380
2016-10-13 11:47:07 -07:00
Sathish Kumar
bdabc6cbda qcacmn: Populate RSSI information during single phyerr WMI event extraction
Extraction API for phy error event handling does not populate single phyerr
RSSI info for DFS radar event, but was populating the value in case of
spectral event. Single phyerr RSSI info is required for both DFS and Spectral
operations. As a result of this change, single phyerr RSSI info is updated
on receiving DFS event as well.

Change-Id: Idca3e4075e1869eda0d200a102e2ca2b7d33bf70
CRs-Fixed: 1076872
2016-10-13 00:32:49 -07:00
Govind Singh
a348a1ae37 qcacmn: Register tlv ops for WMI POWER DBG command
Add WMI POWER DBG tlv ops to enable power debug command
feature.

Change-Id: I2a4e79624fae656bfdb0a442a9a22b4e96de4896
CRs-Fixed: 1065551
2016-10-12 08:47:24 -07:00