summaryrefslogtreecommitdiff
path: root/qcwcn/wifi_hal/wifilogger_diag.cpp
AgeCommit message (Collapse)Author
2022-07-22wlan: create wifi_hal for wcn6740Hsiu-Chang Chen
The original wifi_hal for legacy projects is so old that we met lots of issues in wcn6740. Create another wifi_hal for wcn6740 that uses latest code and keep using the old wifi_hal code for the legacy projects. Bug: 213413875 Test: Regression Test Change-Id: Ibb3c748254c3e5472b3218bda34c88f79d343dae
2022-06-29WifiHal: Invalid header length check for fw-diag msgHsiu-Chang Chen
Due to invalid length in firmware message, the ring buffer overflows. Added check for length w.r.t msg headers and returned error in case of invalid length. Bug: 231524566 Test: Regression Test CRs-Fixed: 2975064 Change-Id: I830a111fe2e58e1aa4039f2d9d996ba28632a9e5
2022-06-29WifiHal: Invalid length check for fw-diag msgHsiu-Chang Chen
Due to invalid length in firmware message, the ring buffer overflows. Added check for length and returned error in case of invalid length. Bug: 231524566 Test: Regression Test Change-Id: I0daeed2335f7fb7661f44bb119776979d51b906d CRs-Fixed: 2837711
2022-06-29WiFi-Hal: while loops to also check for clean_upHsiu-Chang Chen
A Wi-Fi Turn OFF sets clean_up variable, expecting the Wi-Fi HAL module to exit from its event / socket processing. However, there were some instances , where Wi-FI HAL ended to be in a busy while loop though clean_up is set and further resulted to an improper Wi-Fi OFF. Thereby the further Wi-Fi ON's have failed till a restart. Address such instances by having the while loops also check for clean_up before continuing further. Bug: 231524566 Test: Regression Test Change-Id: I6af24cc38894d3ba98721acce2b147e4158134a3 CRs-Fixed: 2563190
2022-04-13wifihal: Send proper return value in diag_msg_handlerHsiu-Chang Chen
Send proper return value in diag_msg_handler, so that caller would take appropriate action based on return type Bug: 220992475 Test: VtsHalWifiNan/VtsHalWifiRtt CRs-Fixed: 3167545 Change-Id: Icbcefb1e45b2d40b0bacc3eb1f849737d2cb0a0f
2022-04-13WifiHal: Allow WLAN_NL_MSG_OEM with new cld80211 attrs.Hsiu-Chang Chen
WLAN_NL_MSG_OEM uses CLD80211_ATTR_DATA for storing binary data. With added support to cld80211 vendor subcmds wifi hal will receive new attributes in which the data is packed as nested sub attributes. Wifihal will forward the new responses to its clients Bug: 220992475 Test: VtsHalWifiNan/VtsHalWifiRtt CRs-Fixed: 2637824 Change-Id: If4501d5e873622c254fb84a0d2949568d366f3da
2021-11-05Wifi-Hal: Validate TX rate code before parsing itandroid-12.1.0_r9android-12.1.0_r8android-12.1.0_r7android-12.1.0_r22android-12.1.0_r21android-12.1.0_r20android-12.1.0_r19android-12.1.0_r11android-12.1.0_r10android12L-devandroid12-qpr3-s7-releaseandroid12-qpr3-s6-releaseandroid12-qpr3-s5-releaseandroid12-qpr3-s4-releaseandroid12-qpr3-s3-releaseandroid12-qpr3-s2-releaseandroid12-qpr3-s1-releaseandroid12-qpr3-releaseAjit Vaishya
Validate the per packet TX rate codes and calculate transmit rate only for valid rate codes. Bug: 201226143 Test: Regression tests Change-Id: I287d19d97970523b0d695e7dcbd606a49fa23f7c CRs-Fixed: 2469251
2019-06-13Wifi-Hal: Avoid accessing invalid memory while parsing pkt statsAjit Vaishya
Current implementation of packet stats parsing isn't validating remaining buflen, which might lead to accessing invalid memory location while parsing. To address this issue, we need to check whether received buflen is sufficient to parse the stat before reading the stats from nlmsg. While parsing pkt stats, the bufflen shall be decremented for all versions of packet log records. Add logic to decrement buflen for the missed versions also. Change-Id: I573a5158b97f2c2b1b59026a8ae14e23ffc8135f CRs-Fixed: 2422931 Bug: 130226017 Test: Manual Test, turn verbose logging and check pkt log
2019-06-13Wifi-hal: RX and Per packet fate stats for new pkt log version V2Ajit Vaishya
Current RX stats parsing structure differs with the recent architectures. Hence , the firmware / host indicates this need to parse the data with the updated structures through the version ( V2) and the parser is expected to adapt to the same. This commit introduces to parse pktlog stats based on PKT_LOG_V2 parsing structure and the rx rate calculation also differs based on this Version 2. Change-Id: Id0997296e93be15158cb9fd27b25067010227666 CRs-Fixed: 2402099 Bug: 130226017 Test: Manual Test, turn verbose logging and check pkt log
2019-06-13Wifi-hal: TX Per Packet stats for V2 version.Ajit Vaishya
Current TX per packet stats parsing logic cannot be used to parse TX stats for packet log new version V2, because of packet log structure format is different. This changes introduces to parse new packet log version V2, based on required OFFSET from received TX payload. Support to read packet log version i.e V1/V2/V3 by reading firmware version. Change-Id: Ie5c508bb2fd3e00674dd807c3003b00857d3f070 CRs-Fixed: 2402099 Bug: 130226017 Test: Manual Test, turn verbose logging and check pkt log
2019-05-23WIFIHAL: Support to send nl requests through wifihalVinay Gannevaram
Added support in wifihal to send nl messages on behalf of its clients. Since netadmin capabilities are given to wifihal, it is used as bridge to send nl messages to kernel Added support for clients to register for nl events. CRs-Fixed: 2424237 Bug: 131618408 Bug: 28340421 Test: Regression test Change-Id: If8b62733e1d298804e0be98918eb875fc52a4ad1 Signed-off-by: Srinivas Girigowda <quic_sgirigow@quicinc.com>
2019-04-25Wifi-hal: Enable pktlog when verbose log on.lesl
In current desgin, packet fate will start logging when log level change to “VERBOSE_DEBUG_PROBLEM”. But in current design, no any use case will change log level to “VERBOSE_DEBUG_PROBLEM”. Framework use “VERBOSE_REPRO_PROBLEM” when user turn on wifi verbose logging in developer option. Modify pkt ring buffer check condition to VERBOSE_DEBUG_PROBLE to enable pktlog with verbose on. Bug:74360031 Test: Manual Test Change-Id: I0d600797108055adafcedd4ac7664b3781c3b74c
2019-04-02Wifi-Hal: Avoid infinite loop on pkt stats of V0 versionAjit Vaishya
Currently when hardware version received as NULL string, pkt_log sets to V0 version i.e. PKT_LOG_V0 and parsing of packet stats done by decrementing specified length mention in packet log header , in case of PKT_LOG_V0 this length is decrementing which makes parsing stuck to infinite loop. To overcome this, parsing length is decremented apart from V2 packet log version too. CRs-Fixed: 2422931 Bug: 129272032 Bug: 118484168 Test: Connect STA to AP and play youtube. Change-Id: I573a5158b97f2c2b1b59026a8ae14e23ffc8135f
2019-04-02Revert "Revert "Wifi-hal: RX and Per packet fate stats for new pkt log ↵Srinivas Girigowda
version V2"" This reverts commit 9584c413fae876e2883fc0e5a93a98df0f32d3ff. Bug: 129272032 Bug: 118484168 Test: connect STA to AP and play youtube. Change-Id: Id9396d04e6cd202867390dcb428a6177a8a89681
2019-04-02Revert "Revert "Wifi-hal: TX Per Packet stats for V2 version.""Srinivas Girigowda
This reverts commit 41d7798f68a93664a836c8b86c23addd3db9d17f. Bug: 129272032 Bug: 118484168 Test: Connect STA to AP and play youtube. Change-Id: If86b053c4e083cf1c01e7d7293d79706c6bb093e
2019-03-23Revert "Wifi-hal: TX Per Packet stats for V2 version."Sunil Ravi
Bug: 129148201 This reverts commit 181078ab828d12786c457037cda2fa61a50ab188. Reason for revert: Regression observed in 3P App Launch which increased by ~204ms Change-Id: I9dda376c45b528a867d4ca87266e60475d60a3ee
2019-03-23Revert "Wifi-hal: RX and Per packet fate stats for new pkt log version V2"Sunil Ravi
Bug: 129148201 This reverts commit dbac4bd447d0bc8323a1fec31406475036072095. Reason for revert: Regression observed in 3P App Launch which increased by ~204ms Change-Id: I71513fcaa4d3aa0dfdad51b1e4d2845479d500cd
2019-03-12Wifi-hal: RX and Per packet fate stats for new pkt log version V2Ajit Vaishya
Current Rx stats parsing structure which is different from new packet log version i.e V2, so parsed RX per packet stats are coming in improper format and per packet fate stats format also is diff w.r.t V2 pkt log version, which leads to improper offset on received payload while parsing it. This commit introduces to parse pktlog stats based on PKT_LOG_V2 parsing structure and V2 based rx rate calculatio. Bug: 118484168 Test: Regression Test Change-Id: Id0997296e93be15158cb9fd27b25067010227666 CRs-Fixed: 2402099
2019-03-12Wifi-hal: TX Per Packet stats for V2 version.Ajit Vaishya
Current TX per packet stats parsing logic cannot be used to parse TX stats for packet log new version V2, because of packet log structre format is different. This changes introduces to parse new packet log version V2, based on required OFFSET from received TX payload. Support to read packet log version i.e V1/V2/V3 by reading firmare version. Bug: 118484168 Test: Regression test Change-Id: Ie5c508bb2fd3e00674dd807c3003b00857d3f070 CRs-Fixed: 2402099
2019-01-17Wifi-Hal: Support to trigger alert signal On DATA_STALL EVENTAjit Vaishya
On received EVENT_WLAN_STA_DATA_STALL Event support to send alert signal with data stall reason code to wifi framework. Bug: 121120734 Test: Regression CRs-Fixed: 2208413 Change-Id: Ie232b546dffdb6f62191700a6fa321d061a076a7
2018-03-30WiFi-Hal: memset cap_vendor_data before populating data to it.Ajit Vaishya
WiFiHAL populates data to cap_vendor_data elements when diag event LOG_WLAN_EXTSCAN_CAPABILITIES is received. memset the buffer zero before populating to it, to make sure no invalid data is sent to framework. CRs-Fixed: 2020507 Change-Id: Ifc9e8b7a777d8698bc61b139ef5ede20d083cde2 Bug: 76133856 (cherry-picked from 6883d36b6a0af69e5e3860efcc0dd38799626b34)
2017-05-19WifiHal: Fix crash with firmware logs decodeSubhani Shaik
Bug: 37671537 Change-Id: Ic53a9259483fee99902f04f14ef9a2c263ec4ffa
2017-03-14WiFi-Hal: Support new header of size 16-bytes for fate statsSubhani Shaik
Host driver sends the stats with 15th-bit set in flags field of wh_pktlog_hdr_t header if the structure size is 16-bytes. Offset for the fates stats from header by size of new structure (16-bytes) if the flag is set. Otherwise offset by the size of existing structure (12 bytes). Change-Id: I5941c3ac5f525f36291ebee8eff01309dee11cc8
2017-03-14WiFi-Hal: Parse new event for packet fate statsSubhani Shaik
Packet fate stats are sent from host driver with a new id (11) in new chipset. So parse the same to get fate stats. Bug: 36161393 Change-Id: I823d61a5ffd1ea8357ab4347eeb9c4e6667df5ea
2017-03-09WiFi-HAL: changes to support cld80211 familySrinivas Dasari
wifihal debug infrastructure recieves host logs, firmware logs and other debug stats from driver on NETLINK_USERSOCK. Use cld80211 library APIs to receive the same inorder to migrate from NETLINK_USERSOCK to NETLINK_GENERIC. Change-Id: I3eca2ff02ababd3255e3876b2e247eb0d3071e67
2017-01-26Disable -Waddress-of-packed-member temporarily.Stephen Hines
Bug: http://b/31532493 Bug: http://b/33566695 Test: Manual validation Change-Id: I59e906dc8d5c3a1fbec4b01e50ebe8ccb01f7656
2016-07-15WiFi-HAL: Fix CLANG warningsSrinivas Girigowda
Fix CLANG warnings. Change-Id: If07194f34abc44e1e58e8b38af59ec705a62ce55 CRs-Fixed: 1015162 Bug: 28825972
2016-06-28WiFi-HAL: Support timestamp sync in firmware diag messageSubhani Shaik
As part of timestamp synchronization firmware events, logs and F3 message formats have changed which would result in change in processing of the same. This commit will address the change in Wifi-Hal catering to the new format, at the same time maintaining backward compatibility. At least FW 4.3-00089 is required for working. BUG: 29762703
2016-04-14Wifi-HAL: make some messages require QC_HAL_DEBUGmukesh agrawal
Originally part of https://partner-android-review.googlesource.com/#/c/558740 BUG=27698661 TEST=compile Change-Id: Ibfa3245bb91b8138d41566f2e8f7060423c07a40
2016-04-13Wifi-HAL: remove some calls to ALOGDmukesh agrawal
Originally part of https://partner-android-review.googlesource.com/#/c/558740 BUG=27698661 BUG=27835354 TEST=compile Change-Id: I4bc744370131af1058cbbb634f92579ed1b8283f
2016-04-13WiFi-HAL: Protect packet fate stats resources with mutexSubhani Shaik
Wifihal collects packet fate stats to a local buffer and the stats will be copied to the buffers provided by framework in get() APIs. Protect reads and writes to this buffer with a mutex to avoid read from get() while write is going on in the event context. BUG: 27799235
2016-03-23Wifi-HAl: Remove extra type cast in parse_{tx/rx}_pkt_fate_statsSubhani Shaik
In parse_{tx/rx}_pkt_fate_stats(), driver_timestamp_usec and firmware_timestamp_usec are u32 fields, whereas driver_ts is a u32 field and fw_ts is a u16 field. Hence, external type casting is not required here. BUG=27579488
2016-03-16Wifi-HAL: Extract wmsg length from nlmsg_hdr with ntohs()Subhani Shaik
Driver swaps the wmsg length based on endianness for ANI_NL_MSG_PUMAC messages. So, use ntohs() to get correct length of wmsg. The reason this swap is done in Wi-Fi HAL is to co work with the already existing tools that already does the same while operating with the host driver.
2016-03-16WiFi-HAL: Do not free local frame_content in get()Subhani Shaik
Wifihal allocates memory for a frame when it receives the corresponding stat. It gets freed when wifihal receives first packet of the next connection instance. Framework can query for the same any number of times. So, wifihal should maintain the current stats till it gets next connection instance stats. So, do not free it in get() APIs. Correct memcpy() length for management frames from MAX_FRAME_LEN_ETHERNET to MAX_FRAME_LEN_80211_MGMT. BUG: 27502434 Change-Id: I0b5756e1a916f95290c85e90a5ae42c7fcd62d18
2016-03-16Revert "WifiHal: Address Debug framework bugs and misc issues"Mukesh Agrawal
Will land more targeted CLs, with more detail about what's being fixed. This reverts commit c193fd5cb051a566bd1a0e9fd565504cab46ff23. Change-Id: I95d4856ffa69c575790927a6cc90e6c246a39e67
2016-03-16WifiHal: Address Debug framework bugs and misc issuesSubhani Shaik
Fix multiple issues 1) Extract wmsg length from nlmsg_hdr with ntohs() 2) Do not free local frame_content in get() 3) Avoid illegal memory access in wifi_set_packet_filter fn 4) Updating new enums related to WIFI Configuration BUG: 27502434 BUG: 27595799 Change-Id: I369a6b278f3e587f07d3a57be97b61eda658104d
2016-03-08Wifi-HAL: Add length check before proceeding to parse data.Amarnath Hullur Subramanyam
To avoid illegal memory access, if received message is shortened, add a length check before proceeding to parse data. Change-Id: Idf6e24af086abd4521eb4f95b0967b582001a951 CRs-Fixed: 970669
2016-03-08WiFi-HAL: Monitor for packet fate statsAmarnath Hullur Subramanyam
Driver collects stats for first few packets after association. Framework can query for these stats to know the reason if association/any other failure happens. Change-Id: Icc413f503e518a24b6d89578b07b45d11422bb5e CRs-Fixed: 964555
2016-02-03WiFi-HAL: Support for timeout and resource failure eventsSubhani Shaik
Add support for below events, 1. Authentication timeout 2. Association timeout 3. Resource allocation failure Driver sends these events with associated information. Update the same to connectivity ring buffer.
2016-01-20WiFi-HAL: Write firmware prints to FIRMWARE_PRINTS ring bufferSrinivas Dasari
Prima driver sends firmware prints as host messages with subtype ANI_NL_MSG_LOG_FW_MSG_TYPE. Parse the same and update to FIRMWARE_PRINTS ring buffer. Change-Id: I0db598af97513d70ea0999dc89486bbc3fa18426
2016-01-20WiFi-HAL: Add support for beacon_received connectivity eventSrinivas Dasari
Allow start logging for connectivity events and parse the received beacon event. Write the parsed data to ring buffer. Change-Id: I8b9e77c5533dd8d4876642e901a92808cc7e159d
2016-01-20WiFi-HAL: Write per pkt stats to ring buffers without processingSrinivas Dasari
Pronto driver sends the per packet stats in framework expected format. Write the stats received from driver to ring buffer as it is as no processing is needed. Change-Id: Ia5841c30375eeab7e74b1d1b90fa4c76421e5364
2016-01-20WiFi_HAL: Fix static analyzer findingsSrinivas Dasari
This commit fixes few issues found by static analyzer. Change-Id: Ia22718b9545e1e56a784e28a1b2582cb489b8cc9
2015-09-24Wifi-HAL: Fix incorrect firmware log entryandroid-n-preview-1android-6.0.1_r9android-6.0.1_r81android-6.0.1_r80android-6.0.1_r8android-6.0.1_r79android-6.0.1_r78android-6.0.1_r77android-6.0.1_r74android-6.0.1_r73android-6.0.1_r72android-6.0.1_r70android-6.0.1_r7android-6.0.1_r69android-6.0.1_r66android-6.0.1_r65android-6.0.1_r61android-6.0.1_r60android-6.0.1_r59android-6.0.1_r58android-6.0.1_r57android-6.0.1_r56android-6.0.1_r52android-6.0.1_r51android-6.0.1_r50android-6.0.1_r49android-6.0.1_r48android-6.0.1_r47android-6.0.1_r46android-6.0.1_r43android-6.0.1_r42android-6.0.1_r41android-6.0.1_r40android-6.0.1_r30android-6.0.1_r3android-6.0.1_r28android-6.0.1_r27android-6.0.1_r26android-6.0.1_r20android-6.0.1_r17android-6.0.1_r13android-6.0.1_r12android-6.0.1_r11android-6.0.1_r10android-6.0.1_r1android-6.0.0_r41marshmallow-mr3-releasemarshmallow-mr2-releasemarshmallow-mr1-releasemarshmallow-mr1-devmarshmallow-dr-devAmarnath Hullur Subramanyam
The commit "Add the fw diag msg hdr" introduced an error while calculating the offset to the next buffer. This caused incorrect firmware log entries in the ring buffer. Change-Id: Iccce94c33a41f62f4e7c3477f603a6c8d33a1efa CRs-Fixed: 913224 Bug: 24350330
2015-09-22WiFi-HAL: Cleanup additional unnecessary logsAmarnath Hullur Subramanyam
In earlier log cleanup few logs got missed, cleaning up the same. This change involves cleanup of wifilogger module as well. Bug: 24266530 Change-Id: I270a9d295e04938df75a5f15f38d3cfc05360a5b
2015-09-03WiFi-HAL: Write header and payload to same bufferAmarnath Hullur Subramanyam
In case of driver prints and firmware prints, events will be split into write to ring buffer as header and payload. Write header and payload to same buffer so that complete record will be available in a single buffer. Bug:23783279 Change-Id: I54d3f813fbb14932b483cd6423d41c7187a464a9
2015-09-02Wifi-Hal: Add the fw diag msg hdrAmarnath Hullur Subramanyam
Include the fw diag msg hdr as part of payload being passed to ring buffer. The firmware logs require the diag hdr info while parsing the logs collected as part of the bugreport. Bug: 23758463 Change-Id: Iacdfc0d380990bb6b1dc7acf8edf95a2302abb63
2015-08-19WiFi-HAL: Populate stats of previous AMPDU if first MPDU missesAmarnath Hullur Subramanyam
Per packet stats module collects below stats from first MPDU of the AMPDU. 1. RxMCS 2. last_transmit_rate 3. rssi 4. tid But the first MPDU may not be received by hardware/corrupted sometimes. Populate the cached stats from first MPDU of the previous AMPDU in such cases. Don't parse Rx packets if the REORDER flag is set as parsing of these packets may show duplicate entries in the stats. Change-Id: I8cf78f42e055b0c22d123f21c91f2c204087afe0
2015-08-10WiFi-HAL: Fix TID issue in Rx per packet statsSubhani Shaik
Firmware sends valid TID only for first MPDU. Populate the same to all other MPDUs. Change-Id: Ie06b1e032c105c3bcd2ccf3ddf9c92524b71c518
2015-08-10WiFi-HAL: Validate debug events with sufficient length onlySubhani Shaik
Frequent updations are expected to the stats structures from firmware. Validating the events received based on its exact size may not be correct in this case. So, consider events as valid only if the size of events is not less than expected. Rx peer info event has been handled with the help flags already. So, remove the duplicate check from parse_rx_stats() Change-Id: I42f2a3f402684fd3de049d7d9fe011068fabb45b