Commit Graph

882 Commits

Author SHA1 Message Date
Krunal Soni
50a0554d12 qcacld-3.0: Do boundary check on num_vdev_mac_entries param
Current doesn't perform boundary check on num_vdev_mac_entries param
which coming from firmware. Without boundary check, driver may be
exposed to buffer overflow.

Check against the boundary limit before using it.

CRs-Fixed: 2119430
Change-Id: I502926a7f783acc7b73a3fbbbd70386a099b48b3
2017-10-06 14:18:12 -07:00
Vignesh Viswanathan
adb1b654b7 qcacld-3.0: Add check for if_id in wma_tbttoffset_update_event_handler
Currently if_id used in the for loop is incremented based on vdev_map != 0
and vdev_map is a uint_32, received from FW, and is right shifted by one bit
for each iteration. This could result in if_id going upto max of 31 and cause
OOB read.

Add sanity check to make sure if_id is less than max_bssid.

Change-Id: I7e0c4e9a26cb67f41e35c60c2756d7ad02cf43ea
CRs-Fixed: 2119443
2017-10-06 14:18:10 -07:00
Himanshu Agarwal
847dd5d509 qcacld-3.0: Add sanity check for vdev id to prevent OOB access
Add sanity check for vdev id in wma_roam_event_callback() to prevent
out of bound access of memory in wma_roam_better_ap_handler().

Change-Id: If3cf06a8eca767201fdd8b056bee6d773938a2a6
CRs-Fixed: 2119400
2017-10-06 14:18:08 -07:00
Poddar, Siddarth
c2c0814c7a qcacld-3.0: Add support to capture data stall event from FW
Add support in wma_flush_complete_evt_handler to capture
data stall event from Firmware and post the message to
sys queue.

CRs-Fixed: 2086176
Change-Id: I4e819b1ae711b3867fa46ff638d4bfd2054519ed
2017-10-06 12:27:36 -07:00
Krunal Soni
a5ccb8007f qcacld-3.0: Keep wake lock while mac config is getting changed
Host should keep the wake lock from the time it sends
WMI_PDEV_SET_MAC_CONFIG_CMDID to FW till it receives the
WMI_PDEV_SET_MAC_CONFIG_RESP_EVENTID. This will avoid any fatal
crash condition.

Change-Id: Id16a1957b38acee6cf45c123ea9dbab25aae9b39
CRs-Fixed: 2070779
2017-10-06 12:27:26 -07:00
Anurag Chouhan
4085ff7e51 qcacld-3.0: Add vendor event to get the driver hang reason
Add Vendor Event to get the driver hang reason indicating to the
user space that the driver has detected an internal failure.
This event carries the information indicating the reason that triggered
this detection.

Change-Id: I3934f2a18c796ed3b53175dcbe7efd7f4d1409b9
CRs-fixed: 2098498
2017-10-06 07:58:08 -07:00
Varun Reddy Yeturu
4353e4f156 qcacld-3.0: Check for valid vdev ID in SWBA event handler
After deriving the vdev_id from the vdev map in
wma_beacon_swba_handler check for the validity
of the vdev_id

Change-Id: Ifc4577d8a00f447e2bcfa4e01fce5ac2dbe96a4d
CRs-Fixed: 2120751
2017-10-06 00:12:59 -07:00
Dustin Brown
3561949b4d qcacld-3.0: Migrate to stats_request_params
There are currently two ways to get vdev stats from firmware. As such,
the redundant pe_stats_req is being removed. Migrate existing consumers
to stats_request_params instead.

Change-Id: I3426b43a6202bb59ceef13cf8d4528700c7f3983
CRs-Fixed: 2120637
2017-10-05 20:00:04 -07:00
Vignesh Viswanathan
53d69c9b7f qcacld-3.0: Fix integer overflow in wma_unified_link_peer_stats_event_handler
Currently in wma_unified_link_peer_stats_event_handler, the check to validate
if peer_stats->num_rates is less than WMA_SVC_MSG_MAX_SIZE is done only for
the first member of the peer_stats array. This can lead to integer overflow
as num_rates is calculated as sum of peer_stats->num_rates for each of the
peer_stats in the array.

Add code changes to loop and calculate total_num_rates for all the peer_stats
and then validate total_num_rates with WMA_SVC_MSG_MAX_SIZE.

Change-Id: Ic934934a990bd55fce70a0eaffa2812bc34b0ddd
CRs-Fixed: 2113758
2017-10-05 16:59:49 -07:00
Naveen Rawat
60f39da929 qcacld-3.0: Check vdev_id against wma->max_bssid
Check vdev_id against wma->max_bssid in wma_mcc_vdev_tx_pause_evt_handler to
avoid bufer overflow.

Change-Id: Ie47a0ed2f7f27f13a01e1b2cb365fae66b41b1df
CRs-Fixed: 2120677
2017-10-04 21:52:29 -07:00
Nachiket Kukade
aaf8a71ef5 qcacld-3.0: Implementation to change BmissFinalBcnt dynamically
Implementation to change BmissFinalBcnt dynamically.
User can set totalBcnt using the new command
QCA_WLAN_VENDOR_ATTR_CONFIG_TOTAL_BMISS_CNT.
BmissFirstBcnt will retain its default value or from ini.
BmissFinalBcnt will be configured as (totalBcnt - BmissFirstBcnt).

Change-Id: Ie3c3895d48248d349400e755f07edc807e335b44
CRs-Fixed: 2081906
2017-10-04 08:41:24 -07:00
Krunal Soni
332f4afc05 qcacld-3.0: For host-invoked roaming to same AP, don't to send null frm
During host invoked roaming, set WMI_ROAM_INVOKE_FLAG_NO_NULL_FRAME_TO_AP
flag so that FW will not send NULL data frame while doing transition to
same bssid.

CRs-Fixed: 2046964
Change-Id: I043c3d2431e4da5af36fb710bd36a520550abbd3
2017-10-03 16:02:56 -07:00
Krunal Soni
e6a1cda95e qcacld-3.0: Bring back changes of Antenna sharing for STA
Change-id Iafd5666179d079c7bcc950277092cef3046356bf was added to remove
antenna sharing support from SAP and STA case but customer needs those
changes for SAP case only.
So bringing back changes for STA case.

CRs-Fixed: 2117829
Change-Id: I79f7c5ae1fd642f0b26170f066a5409638cdd873
2017-10-03 03:30:44 -07:00
Vignesh Viswanathan
f8800692cd qcacld-3.0: Fix potential buffer overwrite in wma_roam_synch_event_handler
In the function wma_roam_synch_event_handler, vdev_id is received from
the fw and is used to access member of the array wma->interfaces without
validating the max of the vdev_id received from the fw

Add check to make sure vdev_id is less than max_bssid before using it

Change-Id: I3b940e183ab66680891cb7351af4537b50afce1d
CRs-Fixed: 2114187
2017-10-03 03:30:42 -07:00
Vignesh Viswanathan
677e3ec4b7 qcacld-3.0: Avoid integer overflow in wma_rx_aggr_failure_event_handler
Add sanity check to ensure num_failure_info from FW does not cause
integer overflow while calculating alloc_len, as alloc_len is in
turn used to malloc which can lead to less than required memory
allocated in case of integer overflow of alloc_len

Change-Id: Iea93e879196e9cd43856a7dcc9204d2304f76c78
CRs-Fixed: 2114789
2017-10-03 03:30:41 -07:00
Naveen Rawat
903accac1f qcacld-3.0: Remove LTE ant sharing dependency on HT connection's NSS
While DUT is in SAP or GO mode, due to LTE antenna sharing mechanism,
DUT is associating in 2x1 chains to HT clients.

As per new requirement, remove dependency of number of chains on antenna
sharing. If HT client supports 2 chains, and due to DBS/LTE antenna
sharing SAP/GO drops down a chain then rate adaptation at peer takes
care of dropping down chains at peer side

Change-Id: Iafd5666179d079c7bcc950277092cef3046356bf
CRs-Fixed: 2108484
2017-10-03 03:30:29 -07:00
Vignesh Viswanathan
9f090ad8f9 qcacld-3.0: Avoid integer overflow in wma_get_ll_stats_ext_buf
Check multiple variables received from firmware used to calculate
buf_len to make sure that it does not exceed the max msg size, as
this buf_len is in turn used in malloc and can lead to less than
required memory allocated in case of integer overflow of buf_len

Change-Id: I2689873c2c5e63c83e5059563662c0c69dc659fc
CRs-Fixed: 2115112
2017-10-03 02:38:54 -07:00
Varun Reddy Yeturu
0a2c310e29 qcacld-3.0: Check for the max number of P2P NOA descriptors
Check for the maximum number of P2P NOA descriptors in
wma_send_bcn_buf_ll.

Change-Id: If7e5b3c53309412dc7d3cd748c2f5581898fbbfe
CRs-Fixed: 2114323
2017-10-01 13:35:16 -07:00
Varun Reddy Yeturu
c31391065e qcacld-3.0: Avoid int overflow in wma_unified_link_radio_stats_event_handler
Check for the validity of the number of channels passed in the
radio stats event received from firmware to ensure an integer
overflow does not happen.

Change-Id: Idf5738a40139aafad4de422965dc4ff3d0e53a32
CRs-Fixed: 2114426
2017-10-01 09:31:33 -07:00
Varun Reddy Yeturu
e4e2f29d4b qcacld-3.0: Avoid integer overflow in wma_peer_info_event_handler
Check for the num_peers received from firmware and ensure an
integer overflow does not happen in wma_peer_info_event_handler.

Change-Id: I08cc98fc425d9905d0ca090cd42b73227e594772
CRs-Fixed: 2115366
2017-09-29 16:29:21 -07:00
Varun Reddy Yeturu
d4c523d673 qcacld-3.0: Avoid possible buffer overwrite in wma_process_utf_event
Check for the maximum allowed data that can be written into
the buffer utf_event_info.data in the function
wma_process_utf_event.

Change-Id: I9ee37470b7a3e7016941f871d3cf73eb12718758
CRs-Fixed: 2115375
2017-09-29 15:39:58 -07:00
Varun Reddy Yeturu
74c87c915f qcacld-3.0: Check for upper bound in P2P NOA event
Check for the upper bounds for number of NOA descriptors
received in the P2P NOA event.

Change-Id: Id7ecf064f2c25f378f76d795902713da8520507f
CRs-Fixed: 2113072
2017-09-29 15:39:56 -07:00
Naveen Rawat
684e8b1eb0 qcacld-3.0: Improve tx status logging for mgmt packets
Change status logging in mgmt tx completion to string format.

Change-Id: I84c99e3c928a8a5c17048f20e1d9b3e990b911ad
CRs-Fixed: 2113615
2017-09-28 16:11:28 -07:00
Frank Liu
d1a2846324 qcacld-3.0: TDLS: remove legacy core functions
Clear up the tdls legacy functions which handle add/delete
tdls peer, tdls mgmt frame process and tdls_oper callback.

Change-Id: I8ba344ce5593df44bd15527e2ff68e872b6d23b8
CRs-Fixed: 2105075
2017-09-28 09:39:43 -07:00
Frank Liu
1a912b2f05 qcacld-3.0: TDLS: remove legacy connection tracker
Clear up the legacy tdls connection tracker function

Change-Id: I9163e8ec7a41750085d8673b25cf4797d1b84714
CRs-Fixed: 2105075
2017-09-28 09:39:39 -07:00
jiad
080abce12e qcacld-3.0: Add RX LDPC support for legacy platforms
wma_get_caps_for_phyidx_hwmode() does not check legacy chips like Rome,
which leads to wrong HT/VHT caps being populated.

Fix is to check legacy chips in wma_get_caps_for_phyidx_hwmode() and
populate HT/VHT caps accordingly including RX LDPC capability.

Change-Id: I496191636f0f21ef3399c24fbfb43a562ca2debc
CRs-Fixed: 2061889
2017-09-28 05:40:01 -07:00
Manjeet Singh
70d3d931d9 qcacld-3.0: Check FW support for FW mem dump
Currently HDD sends a FW memory dump request to firmware without
checking support for this feature. This can lead to a crash as firmware
doesn't send the command response if feature is not supported.
Add a check in HDD so that the request is only sent when FW memory dump
capability is advertised by the firmware.

Change-Id: I73b980f50910e13aa5f2d2434f07b6f985dd5010
CRs-fixed: 1090806
2017-09-28 05:39:58 -07:00
Kabilan Kannan
edff06d0a1 qcacld-3.0: Pass correct phymode to FW for a TDLS peer as per its capability
When AP is in 11b-only mode then for a TDLS peer, in the peer_assoc
command to FW, pass phymode as per capability of the TDLS peer.

Change-Id: If1a84b35c2e755aad8b6b67536cbbcc49d378fda
CRs-Fixed: 2093277
2017-09-28 04:48:16 -07:00
Naveen Rawat
296a51846f qcacld-3.0: Add support to send rate information for mgmt frames
Add support to send rate information for mgmt frames.

Currently default rates are used by target for the mgmt frames before
association. If the AP does not support the default rates (1 Mbps for
2.4G and 6Mbps for 5G), STA would still send AUTH, ASSOC frames with
the default rates. Add support to send the minimum rate supported by
the AP as part of the MGMT Tx WMI command.

Change-Id: I38d832818bbbd5fe3dec5660bd01dd08798bf0be
CRs-Fixed: 2085006
2017-09-27 20:57:56 -07:00
Mukul Sharma
6398b253fb qcacld-3.0: Add support for changing LISTEN interval dynamically
Current method for calculating LISTEN INTERVAL are static
configuration a.ka. ini based. Now OEM / USER want to take
control of setting LISTEN INTERVAL as per their applications
need. Once if USER configure the LISTEN INTERVAL value using
vendor command then host should avoid changing the LI value
during each suspend/resume. User LI value will be override
configuration. Once USER will Disable the LI using vendor
command then host can fallback to current default method.

Change-Id: Ia9b412b073c059df0cdff7bcda8198f7581e796d
CRs-Fixed: 2040298
2017-09-27 20:57:54 -07:00
Ashish Kumar Dhanotiya
bfee5898b7 qcacld-3.0: Update driver according to latest reg domain info
Update driver for the latest reg domain info according to
Regdomain_23 and Regdomain_24 excel sheets.

Change-Id: I6b259be20de650886a16c32b69f8ed82b96dbcd8
CRs-Fixed: 2112485
2017-09-27 20:09:01 -07:00
Abhishek Singh
0d74f9e664 qcacld-3.0: Fix double free del_sta_session_req
iface->del_staself_req is used to check if del sta self was defered
and if it is set vdev detatch is called. iface->del_staself_req is
also set in case  del sta self was not defered and thus del sta self
resp may get called twice, assuming it was differed and this result
in double free of del_sta_session_req.

To fix this added a bool to check if the del sta self was defered.

Change-Id: If4c2bc2a5bb6b8761f4130119a96602055d45b77
CRs-Fixed: 2116888
2017-09-27 19:24:02 -07:00
Yu Wang
46082dc0a6 qcacld-3.0: inject fw crash in crash-shutdown
When kernel panic happen, if WiFi FW is still active,
it may cause NOC errors/memory corruption, to avoid
this, inject a fw crash first.

Propagated from qcacld-2.0

Change-Id: I97a696a02dfd73aaca212ef1bca9f3597df1e382
CRs-Fixed: 2052332
2017-09-26 22:20:06 -07:00
Ganesh Kondabattini
3573957abf qcacld-3.0: set the limit off-channel command parameters
Set the limit off-channel command parameters and conc_system_pref
according to active tos indication from application.

CRs-Fixed: 2066088
Change-Id: I896999adb59aa468daf33364c708d95ef3062018
2017-09-26 17:53:00 -07:00
Ganesh Kondabattini
dadf1fb155 qcacld-3.0: Set DFS flag for DFS channels
Driver is updating WMI_CHAN_FLAG_PASSIVE flag for DFS channels
while sending 'WMI_SCAN_CHAN_LIST_CMDID' command to firmware.

Driver should also update the WMI_CHAN_FLAG_DFS flag for
DFS channels. Otherwise functionality like skipping DFS channels
as part of scan request may not work.

CRs-Fixed: 2103636
Change-Id: Ia146eaad93deab778d5ce7a8647f5c0ba7068ead
2017-09-26 17:52:57 -07:00
Jeff Johnson
adba396c07 qcacld-3.0: wma: Replace instances of unadorned %p
Replace instances of unadorned %p in core/wma.

Change-Id: I44a975caa73f0837274536babf1902bef06c591a
CRs-Fixed: 2100997
2017-09-25 21:56:49 -07:00
Vignesh Viswanathan
56f262563b qcacld-3.0: Add sanity check to limit mgmt frames data len
Currently the mpdu_data_len in Rx pkt meta is not checked for
upper bound in wma_form_rx_packet.

Add sanity check to drop the packet if mpdu_data_len is
greater than 2000 bytes. Also add upper bound check for
frame_len in lim_process_auth_frame function.

Change-Id: I7ab454045e2f6d278351dcabde6da556f9f741e0
CRs-Fixed: 2093392
2017-09-25 05:43:05 -07:00
Ganesh Kondabattini
3bf9efe42a qcacld-3.0: Make sure that peer exists before updating peer state
Before sending tdls peer state update command to FW make sure
that tdls peer exists.

Change-Id: I26b5daf9896b0f57fbcfedadcabd67ddd000b257
CRs-Fixed: 2032770
2017-09-23 05:21:26 -07:00
Vignesh Viswanathan
c018e98d72 qcacld-3.0: Add new ini for bad RSSI 2G to 5G roam offset
Add new WCNSS_qcom_cfg.ini item to configure offset from bad RSSI
threshold ini for 2G to 5G band roam. This offset is used to
calculate the RSSI to be used as trigger for device to roam from
2G to 5G band when it is connected to a bad RSSI 2G AP and a 5G AP
is available in the environment.

New ini added : roam_bad_rssi_thresh_offset_2g

Change-Id: If2285317d1d01bb2faae2cf1928ad7adae8204d4
CRs-Fixed: 2105894
2017-09-20 19:56:53 -07:00
Anurag Chouhan
3920c0f714 qcacld-3.0: Add Vendor command to set/get NUD debug stats
Add vendor commands to set/reset and get NUD debug stats
from firmware.

Change-Id: I773c04bb3f7c6d5ed28528cf2174b3d63de57d98
CRs-Fixed: 2011456
2017-09-20 06:22:06 -07:00
Varun Reddy Yeturu
81d0b373f3 qcacld-3.0: Check for valid pdev in wma_wait_tx_complete
Check for the validity of the pdev in wma_wait_tx_complete
before using it.

Change-Id: I3a98b4092aff42ea9c92490488cba5960b8e3b58
CRs-Fixed: 2111293
2017-09-20 04:40:26 -07:00
Wu Gao
478282a8d0 qcacld-3.0: Check radio id for FW event
In Rome platform, it use invalid radio id in FW event
WMI_RADIO_TX_POWER_LEVEL_STATS_EVENTID and cause crash. So check
radio id when handling this event.

Change-Id: Id720ca94ef496ea883f5ba1848fb4e28af57002f
CRs-Fixed: 2112322
2017-09-19 09:59:37 -07:00
Jiachao Wu
712d4fd6a6 qcacld-3.0: Send beacon tx rate to firmware
Add data structures to save beacon tx rate.
The beacon data rate is multiples of 100 Kbps.
Firmware expects the data rate in the form of hw rate codes.
So convert the data rates to hw rate code.
And send it to firmware.

Change-Id: Ia39fd4c14defa729f75f2c45748fe5b04b909647
CRs-Fixed: 2099052
2017-09-19 04:18:34 -07:00
SaidiReddy Yenuga
cc733aff70 qcacld-3.0: Add ini param to control the crash inject
qcacld-2.0 to qcacld-3.0 propagation

Currently the crash can be injected by iwpriv command and FW
gets crashed.
Changes are done to add the gEnableCrashInject ini parameter

1) This ini param is disabled by default.
2) If this param is disabled the crash inject is ignored.

Change-Id: I7e908be1e37090a9d343dc04411fe387f776a937
CRs-Fixed: 864932
2017-09-19 02:28:33 -07:00
Sandeep Puligilla
d698bf5328 qcacld-3.0: Remove legacy scan event handling
Remove legacy scan event handling
in the WMA and LIM.

Change-Id: Ibeb6f99335b4e745335d5968791d9e9187df47f7
CRs-Fixed: 2101353
2017-09-19 00:17:52 -07:00
Varun Reddy Yeturu
faad37e33b qcacld-3.0: Introduce configuration parameters for bad RSSI roaming
Introduce the below WCNSS_qcom_cfg.ini items to configure
for bad RSSI roaming. These parameters would be used when
the device is connected to an AP with weak signal and has
to roam to a better AP if it is stationary but has found
some other better AP in the vicinity

roam_bg_scan_bad_rssi_thresh:
If the DUT is connected to an AP with weak signal, then the bad RSSI
threshold will be used as an opportunity to use the scan results
from other scan clients and try to roam if there is a better AP
available in the environment.

roam_bg_scan_client_bitmap:
This bitmap is used to define the client scans that need to be used
by the roaming module to perform a background roaming.

Change-Id: I3b9f737ea389d35f8be173ce83b2237c2375fb88
CRs-Fixed: 2082904
2017-09-18 20:27:52 -07:00
Varun Reddy Yeturu
061d4d63e4 qcacld-3.0: Introduce INI items for MAWC based roaming
Introduce the following items in WCNSS_qcom_cfg.ini for
user to modify them for MAWC based roaming.

mawc_roam_enabled
mawc_roam_traffic_threshold
mawc_roam_ap_rssi_threshold
mawc_roam_rssi_high_adjust
mawc_roam_rssi_low_adjust

Change-Id: Ief51e3e91603bfd7f6c6deed3ca48bc717b2b6fb
CRs-Fixed: 2081413
2017-09-14 13:26:37 -07:00
Jeff Johnson
adb3b1cadf qcacld-3.0: Remove cds_[alloc|free]_context() parameter
Currently cds_alloc_context() & cds_free_context() take a CDS context
parameter. However CDS already maintains its own context, hence this
parameter introduces an unnecessary coupling, so remove it.

Change-Id: I4501a0fea7acc7b4a764b0d425da386922b93bcb
CRs-Fixed: 2109265
2017-09-13 20:07:39 -07:00
Jeff Johnson
ff6addf320 qcacld-3.0: Remove wma_open() cds_ctx parameter
Currently wma_open() takes a cds_ctx parameter. All of the other WMA
functions which previously took a cds_ctx no longer use that
parameter, and those functions have been modified to remove the unused
parameter. wma_open() still needs the cds_ctx, but it can get that
context by calling cds_get_global_context(), so remove the cds_ctx
parameter to be consistent with the other WMA functions.

Note: the fact that wma_open() needs the cds_ctx, and then
dereferences it, is a layering violation that needs to be addressed in
the future.

Change-Id: I176e2ac68cc2e8081645a4ce3c158b41d3018587
CRs-Fixed: 2109263
2017-09-13 20:07:37 -07:00
Jeff Johnson
7b3ddc2a5b qcacld-3.0: Remove wma_wmi_service_close() cds_ctx parameter
Currently wma_wmi_service_close() takes a cds_ctx parameter. All of
the other WMA functions which previously took a cds_ctx no longer use
that parameter, and those functions have been modified to remove the
unused parameter. wma_wmi_service_close() still needs the cds_ctx, but
it can get that context by calling cds_get_global_context(), so remove
the cds_ctx parameter to be consistent with the other WMA functions.

Note: the fact that wma_wmi_service_close() needs the cds_ctx, and
then dereferences it, is a layering violation that needs to be
addressed in the future.

Change-Id: I02564bae87077314fea58c1509b3a50b8d567a7a
CRs-Fixed: 2109262
2017-09-13 20:07:35 -07:00