summaryrefslogtreecommitdiff
path: root/qcwcn/wifi_hal/wifi_hal.cpp
AgeCommit message (Collapse)Author
2022-02-21WifiHal: Add support to send modulated dtim configurationAleti Nageshwar Reddy
Implement wifi_set_dtim_config API to send DTIM configuration to driver/firmware. Bug: 215653020 Test: DTIM configuration supported Change-Id: I553447181c69e90d0f69134792ac9fc7c7ad7d8e CRs-Fixed: 3118522
2021-03-10Wifi-Hal: Refresh interface details on wifi_get_ifaces.Purushottam Kushwaha
With support of dynamic interface create/remove 'commit : 5780336d', wifi interface details shall be refreshed to acoomodate change in interface list. Bug: 181828707 Test: Manual Test - force to create virtual interface to make sure Hal works normally. Change-Id: I35ae3260688dfddaae864676a7f45ce24d4d10a9 Signed-off-by: Purushottam Kushwaha <quic_pkushwah@quicinc.com>
2020-12-17wifi_hal: Fix access check of control param filePablo Mendez Hernandez
Currently, the driver control param file is created write-only, so fix the check: https://android.googlesource.com/kernel/msm-modules/qcacld/+/refs/heads/android-msm-coral-4.14-android11-qpr1/core/hdd/src/wlan_hdd_main.c#190 More importantly the open below uses O_WRONLY as only a write is necessary, there is no need to check for read access. Otherwise, WiFi fails to be enabled: WifiHAL : Failed to access driver state control param Permission denied, 13 at /sys/kernel/boot_wlan/boot_wlan Fixes: 8996467be9 ("wifihal: Update driver control param to check driver is ready") Test: Manual build and functionality test Signed-off-by: Pablo Mendez Hernandez <pablomh@gmail.com> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org> Change-Id: If6308cd790c69d2d57815ef6815c779258005eff
2020-08-11wifihal: Update driver control param to check driver is readyandroid-11.0.0_r37android-11.0.0_r36android-11.0.0_r35android-11.0.0_r34android-11.0.0_r33android-11.0.0_r32android-11.0.0_r30android11-qpr2-releaseandroid11-qpr1-c-releaseVeerendranath Jakkam
Write driver control param and wait for successful update to make sure driver is ready in LONU model. Bug: 157090295 Test: Basic function test, SSR test Change-Id: Ia1a690305266baafabe4c2557723f464ca858db1
2020-04-17WifiHAl:Create separate create/delete virtual iface functionsandroid-mainline-12.0.0_r112android-mainline-11.0.0_r44android-mainline-11.0.0_r43android-mainline-11.0.0_r42android-mainline-11.0.0_r41android-mainline-11.0.0_r40android-mainline-11.0.0_r39android-mainline-11.0.0_r38android-mainline-11.0.0_r37android-mainline-11.0.0_r36android-mainline-11.0.0_r35android-mainline-11.0.0_r34android-mainline-11.0.0_r32android-mainline-11.0.0_r31android-mainline-11.0.0_r30android-mainline-11.0.0_r28android-mainline-11.0.0_r27android-mainline-11.0.0_r26android-mainline-11.0.0_r25android-mainline-11.0.0_r24android-mainline-11.0.0_r23android-mainline-11.0.0_r22android-mainline-11.0.0_r21android-mainline-11.0.0_r20android-mainline-11.0.0_r18android-mainline-11.0.0_r17android-mainline-11.0.0_r16android-mainline-11.0.0_r15android-mainline-11.0.0_r14android-mainline-11.0.0_r13android-mainline-11.0.0_r12aml_tz2_305400500aml_tz2_305400300aml_tz2_305400100aml_tz2_304500300aml_tz2_303900110aml_tz2_303900102aml_tz2_303800002aml_tz2_303800001aml_tz2_303200001android12-mainline-tzdata2-releaseandroid11-mainline-tethering-releaseandroid11-mainline-permission-releaseandroid11-mainline-os-statsd-releaseandroid11-mainline-networkstack-releaseandroid11-mainline-media-swcodec-releaseandroid11-mainline-media-releaseandroid11-mainline-extservices-releaseandroid11-mainline-documentsui-releaseandroid11-mainline-conscrypt-releaseandroid11-mainline-cellbroadcast-releaseandroid11-mainline-captiveportallogin-releaseandroid11-devaml_tz2_305400100Khanjan Desai
The function wifi_add_or_remove_iface was taking care for creation and deletion of virtual Iface. Added new separate functions that will perform create and delete operations instead of one single API. Bug: 153852667 Bug: 154279995 Test: Pass wifi aware tests of CtsVerifier. CRs-Fixed: 2633140 Change-Id: I3c175b1f5a59c6d022b2db51cfc72b48582ec3cf
2020-04-17Wifi-Hal: Add NAN iface type in dynamic creation of ifaceSwarn Singh
This change added interface name start from "wifi" as part of valid wifi interface name. Bug: 153852667 Bug: 154279995 Test: Pass wifi aware tests of CtsVerifier. CRs-Fixed: 2593436 Change-Id: Ic8154616c54905969e55b89c0a8f5cde923e5136
2020-03-15WiFi-HAL: Add support to configure thermal levelVamsi Krishna
Bug: 140311866 Change-Id: If376a9e40ab3a1ad948cd95b15f30ba42fcb19bb
2020-03-10WifiHal: Fix OOB read of ctrl buf while registering monitor sock am: 117593cf89Automerger Merge Worker
Change-Id: Icd749280d34eaf1deb19d7f73a0ee23db7828706
2020-03-10qcwcn: Heap-buffer-overflow in register_monitor_sock() of wifi hal am: ↵Automerger Merge Worker
0ed8dbf042 Change-Id: Id4458dba85b590cc2aed4dedf1ccfd3f93f43f29
2020-03-10Heap-buffer-overflow in send_nl_data() of wifi hal am: 0a1b211537Automerger Merge Worker
Change-Id: I694e87918f034d686a969e0d61a2a3e5f7cb2b9c
2020-03-05WifiHal: Fix OOB read of ctrl buf while registering monitor sockVinay Gannevaram
Boundary check for NLMSG length is not present, which would result in OOB read of the buffer during nla parse. Hence add required boundary checks before processing ctrl msg from wifihal clients. Also allocate required buffer for control events to the size of received nlmsg data Bug: 149836664 Test: Manual - Basic wifi sanity test CRs-Fixed: 2628103 Change-Id: Idc971a343f30e41f359180757f108a8c0dfe2a7e Signed-off-by: Vinay Gannevaram <quic_vganneva@quicinc.com>
2020-03-05qcwcn: Heap-buffer-overflow in register_monitor_sock() of wifi halVinay Gannevaram
This changes is to avoid the buffer-overflow in register_monitor_sock() where "nreg->monsock" is getting filled with the data of length "ctrl_msg->monsock_len" without the validation of length. Address this issue by have a length check done before filling the buffer. Bug: 149836664 Test: Manual - Basic wifi sanity test CRs-Fixed: 2604404 Change-Id: I36b7ac274bd4f92eceabd5bd6534c73ae5a9ae73 Signed-off-by: Vinay Gannevaram <quic_vganneva@quicinc.com>
2020-03-05Heap-buffer-overflow in send_nl_data() of wifi halVinay Gannevaram
In send_nl_data() function, the size of ctrl_msg can be greater than size of nl_msg structure. This can cause buffer overload due to out-of bound write in nl_msg->nm_nlh. Added a check for length of ctrl_msg to avoid the out-of-bound write. Bug: 149836664 Test: Manual - Basic wifi sanity test CRs-Fixed: 2605058 Change-Id: I73032dac6ce2f2e9ee7ede18b45b11a2b3f92053 Signed-off-by: Vinay Gannevaram <quic_vganneva@quicinc.com>
2019-11-15Wifi: Modify log specifiers for 64bit hex numbersAhmed ElArabawy
This commit replaces "0x%lx" with PRIx64 macro for better portability of handling 64bit values in log messages. Bug: 144576287 Test: Builds passes successfully Change-Id: I8b8cd56c874f87e477b7a78b2c0e5197d77df483
2019-11-13feature_set change from 'int' to 'long'Ahmed ElArabawy
This commit makes some adjustments to accomodate the change of the feature_set from being an int (32 bits) into becoming a long (64 bits) Bug: 139354972 Test: Manual: Build succeeds Change-Id: I665b57707fa5b22dd847023c02c92e8513c9caf6
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