Copy Engine(CE14) is used for diag events on qcn9224. Add changes to
configure this CE as dest ring and fix diag event handler to use
wmi_handle from first pdev similar to other WMI events.
Change-Id: I314939169f9be32cd277af68dcd3ef7a0eb06187
CRs-Fixed: 3177987
When non-TLV targets are used, the WMI event table is not populated.
So, it shouldn't be treated as fatal and WMI event register/unregister
functions can return NOSUPPORT instead of FAILURE.
Handle this value in TWT code.
Change-Id: I5bc8e7aae2e572c84ea0333c967cff527d5cbcc3
CRs-Fixed: 3145077
Currently whenever the wmi message is allocated the wmi header
length is also added to check with against the max size supported
by the firmware, there is no need to add the extra wmi header size
as the max length shared by firmware has the wmi header size
included.
Below is the breakdown:
Max CE2 transfer size is 2048 bytes
HTC header is 8 bytes
WMI header is 4 bytes
Max payload can be (MAX CE2 Transfer size - (HTC header+ WMI header)
(2048 - (8 +4)) = 2036
During the htc handshake this max wmi length is recevied by the host as
2040 bytes which is including the wmi header so host adding the extra
4 bytes is redundant and can be removed.
HTC buffer->actual_length = 2036 + WMI(4) = 2040 bytes
Change-Id: Ib958a938506c5c96347dec5304ca30aa8690d459
CRs-Fixed: 3130493
Num stats over QMI indicates how many stats requests are fetched
without triggering RTPM resume. If RTPM resume/suspend happens in
the middle then num stats over QMI counter should reset. Add logic
to reset num stats over QMI counter during WoW enter/exit.
Change-Id: I34fe93759bf8a7a2a6c0d4b389ad96b8e1ba4d6c
CRs-Fixed: 3110590
When WMI diag events are received over CE7,
wmi handle is mapped to null and all the diag
events are freed without processing.
Fix this by properly mapping wmi handle when
diag events received over CE7.
Change-Id: I3dc4f7ce37981a31cb6f01fc66edf6248682bea3
CRs-Fixed: 3082960
Waikiki facilitates a dedicated CE (CE14) for
direct DMA & diag handling purpose. Changes to
register the respective service handler to process
DBR and DIAG events from the target.
CRs-Fixed: 3057986
Change-Id: I4ae1d5676ac702d1f28f3e4031b47ffcd1d2ad7e
As part of minidump enhancement feature, incorporate
wmi_command_tx_cmp_log_buffer data structure into the minidump.
Change-Id: I323971cc397b3ec710152c774462c85900acc603
CRs-Fixed: 2950790
Current in wmi_rx_diag_event_work, rx diag event is processing
in a while loop, if there is continuous diag event comes from
fw, it is possible that it occupy the work queue, and other work
are not able to run.
Break the while loop so give a chance to other work.
Change-Id: I7af6d60aeb8c0524cc51d663658d5b17349daa60
CRs-Fixed: 2948839
Firmware generates wmi Rx diag events every few milliseconds,
and processing the same in system shared work queue may lead to
work queue lock-up detection. Hence, move Rx diag event processing
to dedicated work queue.
Change-Id: I10cdde317794e35bc6d10677ab76ea24a66e1880
CRs-Fixed: 2941409
When unregistering wmi handlers, the position of the
old handler is replaced with the last handler in the table.
But at this stage only handler was getting replaced, but
not the context. Hence, make sure to update the context
as well.
Change-Id: If90ea9d7663fb105e8e8ad7d7e6c70da20264e44
DHCP packet is received in the IPA exception path when
system is suspending. As part of DHCP packet processing,
WMI_PEER_SET_PARAM_CMDID is sent to FW after WOW is
enabled resulting in self recovery getting triggered by
host.
Fix is to do an explicit system wakeup if a WMI command
has to be sent post WOW enablement.
Change-Id: If1904a4fe5c861deed1b35071be10cb8cc8d6407
CRs-Fixed: 2890913
For QMI events qdf_nbuf_set_pktlen is invoked twice. Once in
wmi_buf_alloc and again in __wmi_process_qmi_fw_event. Remove
this duplicate set packet length.
Change-Id: I06c7e077fb1d554215a5ebc52f9d69a333a25a84
CRs-Fixed: 2859036
Currently, Host driver assumes WMI_MIN_HEAD_ROOM is part of WMI
messages and Validations are done accordingly. But this
WMI_MIN_HEAD_ROOM is not considered in the firmware. Because of
this host may drop valid events.
To avoid this, Don't consider WMI_MIN_HEAD_ROOM while validating WMI
msg length.
Change-Id: I5f1fe12cfae570e636defb8a4a46ec154f988195
CRs-Fixed: 2844982
Currently, Stats request commands are sent over qmi right from the
target suspend request is sent to FW. This is leading to a crash in
FW since it is trying to access PCI when it is in suspend state.
To address this, send stats request over QMI only after the ack is
received for the target suspend command.
Change-Id: Id7a79d52740916f66476bf911e571c0ff466c7d3
CRs-Fixed: 2838737
Introduce wmi_validate_handle() with the caller function name
embedded in it to validate the WMI handle and log incase
of error. Calling functions can avoid logging in case
wmi_validate_handle() returns -EINVAL. This reduces logging and
thereby memory foot print.
Change-Id: Ie0a6a84ffad6e5cf2da8f547c7209dc77cdf5729
CRs-Fixed: 2838960
Currently, Rx diag event work is not being flushed during idle shutdown.
This may result in use after free access if the scheduled diag event work
gets the chance to execute after driver modules are closed.
To address this, flush diag events work during idle shutdown.
Change-Id: I348e80d2c86a5e070f0fb67d66b758529fede76c
CRs-Fixed: 2838020
Currently QMI message length is not being validated before
handling QMI event. This is resulting in illegal memory access
when QMI message length is invalid.
To address this, discard QMI events with invalid length.
Change-Id: Ia9f04bcb4fa3b365cbbf2be8885a8d30f78f8f10
CRs-Fixed: 2839277
FW diag events will be dropped when number FW diag events pending for
processing is reached to configured RX_DIAG_WQ_MAX_SIZE value. Add a
log when these diag events a getting dropped for debugging purpose.
Change-Id: Ifc303991bdf274fa7426794eaf71517722e9f386
CRs-Fixed: 2824458
Currently, FW diag logs, management frames and stats responses are
processed in worker context. Because of this, there is a possible
out of memory scenario when there are huge number of diag events
waiting in work queue.
To address this, process diag events in a separate worker thread and
set the limit for the number of diag events that can be queued in
work queue.
Change-Id: Ie6e5b905a3b591cf724cd6b024bec0612f9e2e0c
CRs-Fixed: 2818013
Skip wmi sequence check during SOC stop and enable after
initializing wmi handle. It is required to skip sequence check
during soc stop as the endpoint flush is preceding CE flush.
CRs-Fixed: 2813341
Change-Id: Ieb821483e9786471d033773dc2365ab456345f83
For QMI events, recevid QMI event length is used to allocate wmi buffer
using wmi_buf_alloc. The received QMI event length includes WMI head
room and wmi_buf_alloc also try to reserve WMI head room again.
Because of this, WMI buffer allocation is exceeding max WMI msg length.
To resolve this, use length of the received actual WMI msg to allocate
WMI event buffer using wmi_buf_alloc.
Change-Id: Icd259988c4b1091580a35aaf2c3fabc606e0f2a9
CRs-Fixed: 2786326
Reset the WMI sequence counter after FW recovery to avoid
false assert due to CE pending packets freed in htc layer
instead of WMI completion handler.
CRs-Fixed: 2787424
Change-Id: I109ff56655e5fb428aca637e6420efed5943b3f7
Add WMI command buffer address information(DMA/Physical addr) to
the WMI TX completion logging. This will help in debugging issues
when HW DMAs copies data from a different location than the one
configured.
Change-Id: I60586b865a97e7ff88e48606806ec151321ff0aa
CRs-Fixed: 2789492
Log WMI work queue call stack when WD timer expires to assist
in debugging on non slub debug enabled builds.
Change-Id: Id3dd575700ca586b0738a88ca2af88a757238d1b
CRs-Fixed: 2789114
This records all the WMI events and commands, for all
PDEVs. Set WMI_EXT_DBG flag to enable this feature. Refer
Original Change-Id: I18e46f683e35912cad717ca3b9cc3d1885315362
Change-Id: I4c9bdfe6fdd195656ca0c01ca400eba595be24a3
CRs-Fixed: 2762266
Add sequence number to each packet queued on wmi pipe and
match it against expected sequence number in wmi completion handler.
WMI packets are consumed internally, use the skb mark field to capture
the sequence number of the wmi packet.
Change-Id: I1421e3fcff0a2b326f6d899780c773950544ef26
CRs-Fixed: 2741465
Make each WMI debug log buffer size configurable through
compile time config option. Now memory constraint platforms
can use these config options. Use default values if no
values are configured.
Change-Id: Ibc924e12a56ae7d529aea91e55bcc0bbce72ac7e
CRs-Fixed: 2741465
Support WHUNT FW simulation feature.
Records all the WMI events and commands, for all PDEVs.
Set WMI_EXT_DBG flag to enable this.
Change-Id: I18e46f683e35912cad717ca3b9cc3d1885315362
CRs-Fixed: 2762266
To send received raw event buffer to event handler
Send without processed buffer to registered event with buffer
type WMI_RX_RAW_BUFF
Change-Id: I2a401e2e7afbfd8f32d4bd521d184ed9ddcdb264
Currently, stats over QMI features can only be disabled over build flags,
which is not flexible. Hence, add a CFG ini item to enable/disable stats
over QMI.
Change-Id: If5d57d2fc781fecc8817c2da8f61a2f7977d9c77
CRs-Fixed: 2752310
WMI commands are logged in hex in FW and hence log WMI CMD ID
in hex when stats request is send over QMI to assist in debugging.
Change-Id: I9ce63db30b491f26b9d6ac7ae3c98e6177452d7c
CRs-Fixed: 2733208
Remove panic when tlv doesn't matching attributes, the following commit
takes away a chance to pass invalid values tlv to test the the wmi event
hence reverting commit ca24670e56.
Change-Id: Iafff2067288c8a6fafa016f21b1d7fdfdcb0753e
CRs-Fixed: 2706245
Whenever a wmi even it received the tlv received from the firmware
will be sanitized, if there is any error the event would be dropped.
This dropping of the event can give side effects in the host/firmware
after some time and making it difficult to find the actual reason of
why the tlv is not received properly.
Crash the system if the tlv is not parsed correctly to debug the issues.
Change-Id: Ic56e3f96252ac74917caeebc8296c2b50ae4f3cd
CRs-Fixed: 2695053
Update return type of wmi_discard_fw_event to return QDF_STATUS
to match scheduler_msg_process_fn_t.
Change-Id: Iba2d41c4bab2bfd5fb163d82fca6c6b895e5a2a4
CRs-fixed: 2699644
Somtimes F/W event WMI_REG_CHAN_LIST_CC_EVENTID comes for country
code changed before WMI_READY_EVENTID processed completely in
worker thread, to update current channel list,
hdd_regulatory_dyn_cbk is invoked in scheduler thread and wiphy
is extracted from pdev which isn't attached to pdev yet, assert
will happen.
WMI_READY_EVENTID and WMI_REG_CHAN_LIST_CC_EVENTID
should be serialized, both of them should be handled in same
context, such as worker thread.
Set WMI_REG_CHAN_LIST_CC_EVENTID execution context same as
WMI_READY_EVENTID: WMI_RX_WORK_CTX.
Host F/W handshake during init:
Host <- FW WMI_SERVICE_READY_EVENTID
Host <- FW WMI_SERVICE_READY_EXT_EVENTID
Host -> FW WMI_INIT_CMDID
Host <- FW WMI_REG_CHAN_LIST_CC_EVENTID
Host -> FW WMI_SET_CURRENT_COUNTRY_CMDID
Host <- FW WMI_READY_EVENTID
Host <- FW WMI_REG_CHAN_LIST_CC_EVENTID
Change-Id: I922e5f2a9722e9b441cc844dd38b1039dd4d8900
CRs-Fixed: 2689274
The stale value of this field blocks driver from sending
FW_HANG wmi messages to target after recovery
Change-Id: Ib44388c5c95c2574c96117b77fdabda26f5890bd