summaryrefslogtreecommitdiff
path: root/qcwcn/wifi_hal/wifi_hal.cpp
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-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-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-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-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-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-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-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: 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: 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-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-01-23Wifi-HAL: Provision to get the Wi-Fi interface's MAC modeSrinivas Dasari
This commit introduces a call back to get the interface and hardware MAC mode information from the driver. This event is notified from the driver on any connection / disconnection of a specific interface. This shall depict the mode (SCC / MCC / DBS) of the MAC hardware at any given point of time. Bug: 68349158 Test: Compiles (cherry-picked from 0833d0fa4eac75ef172b09b51925ad0dafbfc8e7) Change-Id: Ic9ac81315a9dd50053e927892eb5cf43b999b0d3
2017-12-14WiFi-Hal: Clean up the return codes in wifi-halSubhani Shaik
Use error codes from "enum wifi_error" throughout the wifi-hal. Convert the error codes returned by kernel to "enum wifi_error" codes appropriately before passing them to upper layers. Change-Id: I62937e3c7870ba1b48b8aeedf38c89c2424532b4 (cherry-picked from d54aafdb39c095318c7fecab6551e018297069ed)
2017-07-28Wifi-Hal: Modify tx power API am: 9aebcc18e7Subhani Shaik
am: 4f9b291b88 Change-Id: I4ff1c13ba9ab8c07f842654df8e636a7e177bf16
2017-07-27Wifi-Hal: Modify tx power APISubhani Shaik
Modify the current tx power API to select predefined power settings and apply the same from the BDF file Bug: 62437848 Test: Manual tests Change-Id: Ie0b5a837f4b4e221f7045b1276e02f510f22e256 (cherry-picked from 06dcdb8f68a3d5751e708cd431ae56e62f251e36)
2017-07-27Merge "WiFi-HAL: Map kernel returned error code to wifihal error" into ↵Subhani Shaik
oc-dr1-dev am: 6feb8575f2 Change-Id: I144bce707bd54ca850fb020bd75e979731218924
2017-07-27WiFi-HAL: Map kernel returned error code to wifihal errorSubhani Shaik
Framework expects error codes of type wifi_error from wifihal. Map the error codes returned by kernel to wifi_error value and return the same to framework Bug: 63971485 Test: Ran VTS tests on marlin. Change-Id: Ifbb8cdb9c1177da0c6715ee2a63d4299b71f74e3
2017-07-11WiFi-HAL: Support to set tx_power_limits am: 1906cf3d29Subhani Shaik
am: 682b962975 Change-Id: I8129c6a48e90136f8648461f68ecc7af752b9784
2017-07-11WiFi-HAL: Support to set tx_power_limitsSubhani Shaik
Framework sends tx power limits to wifihal. Forward the same to WLAN driver with the help of nl80211 vendor command. Bug: 62437848 Test: Compiles Change-Id: I3073b98bacec33dc5ec544b8405330e820ed8bec (cherry-picked from 4735b5927aeb8ef7a4fa18a6f694be86478d3beb)
2017-06-30Building libwifi-hal-qcom with BOARD_VNDK_VERSIONJiyong Park
Add missing header dependency and include system headers such as unistd.h and pthread.h explicitly. Bug: 37342627 Test: BOARD_VNDK_VERSION=current m -j libwifi-hal-qcom Change-Id: Id844f42e02f5b1c83a697862204a52e8cdb8198d
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
2016-12-12WiFiHAL: Add API to enable/disable roamingSubhani Shaik
Add API to enable/disable firmware roaming. Change-Id: I1eee5caf05bdabe79da2b6ad1997b13b6ac3e69f Merged-In: I1eee5caf05bdabe79da2b6ad1997b13b6ac3e69f
2016-12-12WiFiHAL: Configure Roaming parametersSubhani Shaik
Configure blacklist bssid and whitelist ssid information Change-Id: I348d504b55febeb3cc0328d85ad40882c6233d9e Merged-In: I348d504b55febeb3cc0328d85ad40882c6233d9e
2016-12-12WiFiHAL: Get Roaming capabilitiesSubhani Shaik
Get maximum number of blacklist bssids and maximum number of whitelist ssids supported by driver Change-Id: I0abfdd6f9c1c8d77ce5d16bd78a51483de72c947 Merged-In: I0abfdd6f9c1c8d77ce5d16bd78a51483de72c947
2016-12-12WiFiHAL: Isolate bssid_blacklist functionality to wifihalSubhani Shaik
To avoid duplication with roam APIs, blacklist_bssid changes have been removed from gscan.h. So, do not expose wifi_set_bssid_blacklist() API to framework and move the wifi_bssid_params structure definition to wifihal. Change-Id: I31f85b55a6ce6946ecf700bcfa4db440e3582d35 Merged-In: I31f85b55a6ce6946ecf700bcfa4db440e3582d35
2016-12-12WiFiHAL: Get wifi capabilities during initializationSubhani Shaik
Get wifi driver capabilities during wifiHAL initialization and save it locally. When framework queries for capabilities, these are populated from wifiHAL itself instead of sending command to driver Change-Id: If0f7a0e5dd49135f1adc58f3047f385ef352eff9 Merged-In: If0f7a0e5dd49135f1adc58f3047f385ef352eff9
2016-12-12Merge "Update for libnl 3.2.25"Paul Stewart
2016-11-14[AWARE] Add NAN data-path HAL function pointersEtan Cohen
am: e59a77eaa0 Change-Id: I228603ba9609d8b15e54cb7966f0a895ce307306
2016-11-13[AWARE] Add NAN data-path HAL function pointersEtan Cohen
Bug: 26562610 Change-Id: Ia4ed05ba09d0cc467bd0f76b494e323f40eba617
2016-11-11Update for libnl 3.2.25Paul Stewart
NL headers have moved. Private headers are now in their own subdirectory. Bug: 32700211 Test: Compile, connect to WiFi, run "iw link" Change-Id: I69fd006ebe3048538d563d1f91ccf15ebfabd8db
2016-08-30Do not start/stop the driver in HAL startChristopher Wiley
am: f71b2eb448 Change-Id: I06ead37bc4b8f65031d7d39b9e0ea87334da97e1
2016-08-26Do not start/stop the driver in HAL startandroid-n-mr1-preview-2android-n-mr1-preview-1Christopher Wiley
The framework expects to control the state of the driver. The HAL should not be touching it. This code is also a noop on all supported nexi, where the driver is always started. Bug: 29321445 Change-Id: If431b278222ca06a29232874bd0c9870bd0be785 Test: Compiles, wifi continues to work on bullhead (cherry picked from commit 236a52b136b7fdd802389ef1687bd3df37c1adb6)
2016-07-25Wifi-Hal: Set nl socket's local port with nl apiSubhani Shaik
The nl library maintains one local port pool for nl sockets, one port is occupied when new nl socket is allocated and it needs to released, otherwise the nl socket allocation will fail since no local port can be used in nl socket allocation. Wifi hal sets own local port for nl socket directly without calling api and causes leak. BUG: 30350620 Change-Id: I4bb1fd2c352c73cc246a2ba7f837e395f022651f
2016-07-25WiFi-HAL: Avoid race condition in RSSI monitoring commands/eventsSubhani Shaik
There is a possiblility while handling the wlan driver event in the handleEvent of the RssiMonitor, the RssiMonitor stop is also triggered. The stop monitor cleans RssiMonitor command instance. In this case the handleEvent will crash as the object is already deleted. To avoid this scenario moving the handler creation under hal_info and adding checks to ensure that handler is enabled/disabled prior to starting and stopping the monitor command. BUG: 29936203 Change-Id: Id0ab73313a03510f0b15b101e381112c4ace4aef
2016-07-15WiFi-HAL: Fix CLANG warningsSrinivas Girigowda
Fix CLANG warnings. Change-Id: If07194f34abc44e1e58e8b38af59ec705a62ce55 CRs-Fixed: 1015162 Bug: 28825972
2016-04-14Wifi-HAL: promote some messages from INFO to ERRORmukesh agrawal
Originally part of https://partner-android-review.googlesource.com/#/c/558740 BUG=28174258 TEST=compile Change-Id: I0ec26dcf0cffeb7c8d90461dfcddbc419cfaef99
2016-04-14Wifi-HAL: demote some messages from DEBUG to VERBOSEmukesh agrawal
Originally part of https://partner-android-review.googlesource.com/#/c/558740 BUG=27698661 TEST=compile Change-Id: I7264dd7a0095c24bf1f183c9f929bb79ef095703
2016-04-14Wifi-HAL: demote some messages from INFO to VERBOSEmukesh agrawal
Originally part of https://partner-android-review.googlesource.com/#/c/558740 BUG=27698661 TEST=compile Change-Id: I04a6dd680b23322a5382ff144d6ea533f37be2f8
2016-04-13Wifi-HAL: remove some calls to ALOGImukesh agrawal
Originally part of https://partner-android-review.googlesource.com/#/c/558740 BUG=27698661 TEST=compile Change-Id: I6c8d3e09eedd9675439d6a5a5ad17eabc16416db
2016-04-13Merge "WiFi-HAL: Protect packet fate stats resources with mutex" into nyc-devTreeHugger Robot
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