diff options
author | Veerendranath Jakkam <quic_vjakkam@quicinc.com> | 2020-03-17 11:06:25 +0530 |
---|---|---|
committer | Kumar Anand <kumaranand@google.com> | 2020-03-17 12:22:20 -0700 |
commit | 24c9cf08542055ba659517d7ea7a85e12299c219 (patch) | |
tree | 136d49516653ee557b9c058bb9f87ea7476f80f6 | |
parent | fc600dab603f908eb729983f0d11e6eda543ed7e (diff) | |
download | wlan-24c9cf08542055ba659517d7ea7a85e12299c219.tar.gz |
WiFi-HAL: get base wlan interface index from global handle
Instead of hardcoding base wlan interface as wlan0 get base wlan
interface index from hal_info
Bug: 140311866
Change-Id: I8f66207dfbcb791e02faa57a19460a4cedeaeca8
-rw-r--r-- | qcwcn/wifi_hal/wificonfig.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/qcwcn/wifi_hal/wificonfig.cpp b/qcwcn/wifi_hal/wificonfig.cpp index 1bf71c6..7590f62 100644 --- a/qcwcn/wifi_hal/wificonfig.cpp +++ b/qcwcn/wifi_hal/wificonfig.cpp @@ -554,6 +554,13 @@ wifi_error wifi_set_thermal_mitigation_mode(wifi_handle handle, WiFiConfigCommand *wifiConfigCommand; struct nlattr *nlData; u32 qca_vendor_thermal_level; + hal_info *info = getHalInfo(handle); + + if (!info || info->num_interfaces < 1) { + ALOGE("%s: Error wifi_handle NULL or base wlan interface not present", + __FUNCTION__); + return WIFI_ERROR_UNKNOWN; + } wifiConfigCommand = new WiFiConfigCommand( handle, @@ -573,10 +580,9 @@ wifi_error wifi_set_thermal_mitigation_mode(wifi_handle handle, } /* Set the interface Id of the message. */ - ret = wifiConfigCommand->set_iface_id("wlan0"); - if (ret != WIFI_SUCCESS) { - ALOGE("%s: failed to set iface id. Error:%d", - __FUNCTION__, ret); + if (wifiConfigCommand->put_u32(NL80211_ATTR_IFINDEX, + info->interfaces[0]->id)) { + ALOGE("%s: Failed to put iface id", __FUNCTION__); goto cleanup; } |