summaryrefslogtreecommitdiff
path: root/qcwcn/wifi_hal
AgeCommit message (Collapse)Author
2019-06-26Merge "WIFIHAL: Fix use-after-free issue while freeing monitor socket list" ↵android-mainline-10.0.0_r9android-mainline-10.0.0_r7android-mainline-10.0.0_r5android-mainline-10.0.0_r4android-10.0.0_r36android-10.0.0_r35android-10.0.0_r34android-10.0.0_r33android-10.0.0_r32android-10.0.0_r31android-10.0.0_r30android10-qpr2-s4-releaseandroid10-qpr2-s3-releaseandroid10-qpr2-s2-releaseandroid10-qpr2-s1-releaseandroid10-qpr2-releaseandroid10-qpr1-mainline-releaseandroid10-mainline-media-releaseTreeHugger Robot
into qt-r1-dev
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-06-10WIFIHAL: Fix use-after-free issue while freeing monitor socket listVinay Gannevaram
During cleanup of monitor socket list, entries are freed with out being deleted from the list. This results in accessing memory which was already freed. Hence deleting the entry before freeing it, so that list would have only valid entries. Bug: 133773150 Test: Manual Test CRs-Fixed: 2463143 Change-Id: Ic746c7527958f238c77ddd4fd6d98cb8abab67bb Signed-off-by: Vinay Gannevaram <quic_vganneva@quicinc.com>
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-05-23wifi-hal: Map kernel error ENOBUFS to wifi-hal error codeRajeev Kumar
Kernel error ENOBUFS is not mapped to any defined wifi-hal error code. Map ENOBUFS error to WIFI_ERROR_TOO_MANY_REQUESTS wifi-hal error. Change-Id: I1d372a70a713a25505849da1a6716650007a7f64 CRs-Fixed: 2439902 Bug: 130214647 Bug: 132599519 Test: Regression Test Signed-off-by: Rajeev Kumar <quic_rajekuma@quicinc.com>
2019-04-30Merge "Wifi-hal: Enable pktlog when verbose log on." into qt-devandroid10-devTreeHugger Robot
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-19Wifi-Hal: Pass the address of the global variable to NL callbackAjit Vaishya
Current implementation passes the address of a local variable to the netlink control block callback, ending up to go out of scope if the callback is invoked after the scope for the current function ends (from where the registration happened), resulting in an invalid memory access. Address this issue by having the respective variable defined with a global scope. Change-Id: Ied10a8f17f20326864f80ac40b0ceac6791f6cd1 CRs-Fixed: 2427930 Bug: 129092516 Test: Manual test
2019-04-03Merge "SAR: Add handling of WIFI_POWER_SCENARIO_ON_BODY_BT"Ahmed ElArabawy
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-29SAR: Add handling of WIFI_POWER_SCENARIO_ON_BODY_BTAhmed ElArabawy
This commit adds support for the WIFI_POWER_SCENARIO_ON_BODY_BT SAR scenario, and map it to the proper BDF table. Bug: Test: adb shell halutil -sar enable 5 Change-Id: I3013815acb022f1d395c260ae16e29c4093346c9
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-18Wifi: Add ether type to sending offloaded packetvamsi krishna
In current implementation, the ether type used for offloaded packets is always hardcoded to IPv4 in lower layers. This commit adds support to specify ether type of offloaded packets from user space. Bug: 122487582 Test: Manual Change-Id: Ib3a5dcb92aa6b193eabbcff32cd5a1138dcd04d0 CRs-Fixed: 2398213
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-03-06Merge "WiFi-HAL: Add user hint sub-type to set country code commmand"Ahmed ElArabawy
2019-02-11wifi-hal: Add support handling NDPE attributePeng Xu
Add handling NDPE attribute in NAN capabilities. This allows the framework to enable or disable using of NDP attribute in NAN data request message. Bug: 113149569 Test: Manual Change-Id: If2ca515447fbd44bca3bc272ce5fd72718d7eb19 CRs-fixed: 2244053
2019-02-06WiFi-HAL: Add user hint sub-type to set country code commmandPeng Xu
Add new user hint sub-type NL80211_USER_REG_HINT_CELL_BASE to wifi_set_country_code command if the feature is supported by host driver. Bug: 121154896 Test: Regression test Change-Id: Ie1c0da1cc75aba02809ffd0f5d76bdb4f2ec680c CRs-fixed: 2205885
2019-02-01Merge "Wifi-Hal: Copy "ignoredBeaconFrames" param in DW/MAC stats"Ahmed ElArabawy
2019-01-28Wifi-Hal: Copy "ignoredBeaconFrames" param in DW/MAC statsRakesh Sunki
"ignoredBeaconFrames" param sent by the firmware not being copied to DE/MAC stats. Add fix to copy the param to the DW/MAC structures Bug: 121156967 Test: Regressin Test Change-Id: I49c2c85987a726ae4cda6faf23376b3b7b0ef87f CRs-Fixed: 2101126
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
2019-01-17Wifi-HAL: Treat wake counter related stats from driver as optionalAmarnath Hullur Subramanyam
Earlier, all the attributes of wakestats were considered mandatory to be present from driver. This commit addresses that wake counter related stats to be treated as optional. If these attributes are not present in the message from driver then it is reported as zero instead of discarding the whole message. Bug: 121156966 Test: Regression CRs-Fixed: 2218700 Change-Id: I51137a5104537edae9529e2b6b62f5f07e10c67a
2019-01-17Wifi-HAL: Prevent using uninitialized data from mode_infomazumdar
Initialize mode_info with zeros so that we can prevent accessing and using uninitialized data from mode_info which might cause stability issues. Bug: 121156968 Test: Regression Testing Change-Id: I92d8647c5db39642c7c727dbcc65fd9875bce173 CRs-Fixed: 2243785
2019-01-17WiFi-HAL: Initialize "wifi_read_packet_filter" return typemazumdar
In earlier implementation of "wifi_read_packet_filter", there may arise a scenario where return "ret" remain uninitialized if "length" value passed to this function is zero and APF "enable/disable" functionality is carried out by the framework. Make changes, so that return "ret" is initialized at the time of its declaration and a check is added where "length" to be passed to this function is non-zero. Bug: 121109906 Test: Regression Test Change-Id: Ibc8bd164f086f8578b98b83eab3b2884188a4138 CRs-Fixed: 2263409
2019-01-16WiFi-Hal: Add support for Wi-Fi latency mode featureSrinivas Girigowda
Add support to set Wi-Fi latency mode in host driver using Wi-Fi HAL. Supported latency modes are NORMAL, MODERATE, LOW and ULTRA LOW. Bug: 118642535 Test: $ adb shell halutil -latency <mode (normal/low/ultra-low)> Change-Id: I4028c2c3c1a5950e9b6bd79f4f04766b8ce309c8
2019-01-16WiFi-Hal: Sync qca-vendor_copy.h to upstream qca-vendor.hSrinivas Dasari
Sync qca-vendor_copy.h to upstream qca-vendor.h and remove duplicate enums/defines from vendor_definitions.h Bug: 121155020 Test: Manual CRs-Fixed: 2290651 Change-Id: I44e1c955ff2e4b207063ce5d7b88bb2bb8fb4ed6
2018-10-19Merge "Allow implicit-fallthrough warnings locally." am: f71546676c am: ↵Chih-Hung Hsieh
421c5642c9 am: 4e08ace081 Change-Id: I484828be8b58ab1e76d88a7cd42bec2832d0ac79
2018-10-19Allow implicit-fallthrough warnings locally.Chih-Hung Hsieh
It will be a global error by default. Test: make checkbuild Bug: 112564944 Change-Id: Ie5b2a9a4d1f58080d7a3e83fbe80c0aa2798e13c Exempt-From-Owner-Approval: do not block on new warnings
2018-07-24wifi-hal: Check ring buffer context before reading itAhmed ElArabawy
When reading ring buffer, check if ring buffer context is NULL before dereference it. Bug: 80528408 Change-Id: Ia5a4eb1aeb6734318e89fa9c985d60da17f2444b CRs-Fixed: 2252883
2018-04-24WiFi-Hal: Add write/read and enable/disable ops to Android Packet Filterandroid-9.0.0_r47android-9.0.0_r46android-9.0.0_r45android-9.0.0_r44android-9.0.0_r43android-9.0.0_r42android-9.0.0_r41android-9.0.0_r40android-9.0.0_r39android-9.0.0_r38android-9.0.0_r37android-9.0.0_r36android-9.0.0_r35android-9.0.0_r34android-9.0.0_r33android-9.0.0_r32android-9.0.0_r31android-9.0.0_r30android-9.0.0_r22android-9.0.0_r21android-9.0.0_r20android-9.0.0_r19android-9.0.0_r16android-9.0.0_r12android-9.0.0_r11pie-qpr3-s1-releasepie-qpr3-releasepie-qpr3-b-releasepie-qpr2-releasepie-qpr1-s3-releasepie-qpr1-s2-releasepie-qpr1-s1-releasepie-qpr1-releasepie-dr1-releasepie-dr1-devpie-devpie-b4s4-releasepie-b4s4-devmazumdar
Add write/read and enable/disable ops for APF (Android Packet Filter). Change-Id: Iae573751db0ec80d4404dccfd5056e2767ac113d Bug: 36221302 Test: dumpsys wifi with ag/3937960
2018-04-06WiFi-Hal: Fix checks on logger capabilities of driverBen Fennema
Not all devices support logger, so don't treat the lack of logger capability as a fatal error. Add checking in wifi_logger_ring_buffers_deinit to not cleanup logger when it was not initialized in the first place due to lack of logger support. Call wifi_logger_ring_buffers_deinit in the wifi_initialize failure path. Bug: 77649716 Test: Boot device without logger support and verify wifi works Change-Id: I135ea60b19e347f62b37da76a476f68e8f441501 Signed-off-by: Ben Fennema <fennema@google.com>
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)
2018-03-30WiFi-Hal: Get the interface index only for wlan0mazumdar
The current implementation gets the interface index for the first interface name. This would result in getting the interface index for non wlan0 interfaces too. Hence, check for the specific interface name of "wlan0" for getting the interface index. CRs-Fixed: 2139907 Change-Id: I088be24cac54fa7f66c6106030d9cb39e60f0963 Bug: 76133856 (cherry-picked from 9207f79db9552595e8264bb944f60ac220d9852c)
2018-03-30WiFi-Hal: Modify SDEA control parametersRakesh Sunki
Modify the sdea control parameters in line with sdea attribute included in publish and subscribe messages. CRs-Fixed: 2087428 Change-Id: I97984010efb5bd5a4d4cc329bb449170e69aa79b Bug: 76133856 (cherry-picked from de731c4b9864dc52948b18ab3dcdf33cb23912b4)
2018-03-30WiFi-Hal: Cleanup in NAN response handlerSubhani Shaik
Specify the corresponding stats member in the union to copy the received NAN response message. Bug: 70872935 Change-Id: I3da3bf3a8df27b87f270eac71989a1cdf27185d5 (cherry-picked from 9a95072f65ee2959e721ea9b5ec8e0bc57b7031c)
2018-03-30WiFi-Hal: Add checks on logger capabilities of driverAjit Vaishya
Check the logger feature capabilities advertized by driver in logger APIs. Return WIFI_ERROR_NOT_SUPPORTED if the respective feature is not supported by driver. CRs-Fixed: 2150998 2174271 Change-Id: Icbac7b9cd34a547c4a371f490bf1ff24b6327dfe Bug: 71716861 (cherry-picked from 2d4390b47afd8e895d9ecb46c45e98080386fdd8)
2018-03-30WiFi-Hal: Correct the mapping of wifihal error codesSrinivas Dasari
Correct the mapping of wifihal error codes. Bug: 70872935 Change-Id: Ic8bf0e6796a4e84ec6b540a34af1e202d9501d9e (cherry-picked from 03ef1ab7c2dc2075d7691a396fc7f2547742ede6)
2018-03-30WiFi-Hal: Cleanup unused command register/deregister codeSrinivas Dasari
wifi_register_cmd and wifi_unregister_cmd APIs are not used anymore and can be cleaned up. Bug: 74215851 Change-Id: I2c7de027515ffa85a3c58cea2b41f02c3ee0e56e (cherry-picked from b690ce2542d5ec41014d760860704be50067136d)
2018-03-30WiFi-Hal: Free event_cb only after deregistering all event handlersSrinivas Dasari
event_cb contains the list of vendor commands registered to receive events. Deregister all events before flushing the event_cb. Bug: 74215851 Change-Id: Ic710f8c3f3c81b11c66855999fc12cbd61b52153 (cherry-picked from 158a66fd427b2116777b5b84f3a0b4d60ca66233)
2018-03-30WiFi-Hal: Mark WiFi-Hal and cld80211_lib as vendor modulesSrinivas Girigowda
Mark WiFi-Hal and cld80211_lib as vendor modules. Binaries generated after compilation would be saved at /vendor/lib* only. CRs-Fixed: 2184654 Bug: 72683986 Change-Id: I4e420de6aff957858d8b7d737c2c05ec75741085 (cherry-picked from 00a14d097bd2c97af465d825c8078eceeb104aa5)
2018-03-06WiFi: Vendor HAL function to wait for driver readyAhmed ElArabawy
This commit adds a vendor hal function to wait for the driver to be ready. This ensures the driver is ready for operatin before framework starts to use it Bug: 73482286 Test: Manual test (reboot and make sure wifi comes up consistently) Test: The reboot test has been performed more than 10 times in a row Test: Also, tested toggling wifi off/on then rebooted, wifi starts fine Change-Id: Ife5a15863b224d59cf04d6dc35b5b5fb85f9161c Signed-off-by: Ahmed ElArabawy <arabawy@google.com>
2018-02-05Wifi-HAL: Free the buffers allocated for interfacesSrinivas Dasari
Interfaces are getting freed but buffers allocated for the interfaces are not getting freed. Free the same. CRs-Fixed: 2106880 Change-Id: If62828814f1f2ac6b704207c052d0f75f57a57e6 Bug: 72683986 (cherry-picked from 58d77484f9ed7ac71d9b4866b103aa87847bd44f)
2018-02-05Wifi-HAL: Free the buffers of gscan and rssi_monitor handlersSrinivas Dasari
gscan and rssi_monitor handlers are getting freed but buffers allocated for these are not getting freed. Free the same. CRs-Fixed: 2106880 Bug: 72683986 Change-Id: I51a0b917061ad0dd0217263110b0c02fce1773cd (cherry-picked from 8eaa6ba3fb3529d0581ea092ea67c5e9a4793c9a)
2018-02-05Wifi-HAL: Free tx_time_per_level of all radiosSrinivas Dasari
Currently tx_time_per_level of the first radio is getting freed. This causes memory leak when driver sends multiple radio stats. Traverse through the radio stats received and free the tx_time_per_level of each radio. CRs-Fixed: 2106880 Change-Id: Ic15e743665e54744773e71e917c3349b9015a7b9 Bug: 72683986 (cherry-picked from a77e59c5fe3ed4538820b0604803fee46dc1076a)
2018-02-05Wifi-HAL: Pass a non NULL message through on_alertAjit Vaishya
Framework expects a non NULL buffer for on_alert call back, without which the indication is not processed. Hence,pass a string as a buffer for on_alert. CRs-Fixed: 2089343 Change-Id: I37f948b8fe1f75f44a40579ad6a2a6bb44b9f17e Bug: 72683986 (cherry-picked from 93e8cac5d0cdb44b4479020c8425d75f07872940)