diff options
Diffstat (limited to 'wcn6740/qcwcn/wifi_hal/wificonfig.cpp')
-rw-r--r-- | wcn6740/qcwcn/wifi_hal/wificonfig.cpp | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/wcn6740/qcwcn/wifi_hal/wificonfig.cpp b/wcn6740/qcwcn/wifi_hal/wificonfig.cpp index 3a47634..989399f 100644 --- a/wcn6740/qcwcn/wifi_hal/wificonfig.cpp +++ b/wcn6740/qcwcn/wifi_hal/wificonfig.cpp @@ -24,6 +24,11 @@ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE * OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN * IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + * Changes from Qualcomm Innovation Center are provided under the following license: + + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. + * SPDX-License-Identifier: BSD-3-Clause-Clear */ #include "sync.h" @@ -89,6 +94,7 @@ wifi_error wifi_extended_dtim_config_set(wifi_request_id id, /* Add the vendor specific attributes for the NL command. */ nlData = wifiConfigCommand->attr_start(NL80211_ATTR_VENDOR_DATA); if (!nlData) { + ret = WIFI_ERROR_UNKNOWN; ALOGE("wifi_extended_dtim_config_set: failed attr_start for " "VENDOR_DATA. Error:%d", ret); goto cleanup; @@ -237,6 +243,7 @@ wifi_error wifi_set_qpower(wifi_interface_handle iface, /* Add the vendor specific attributes for the NL command. */ nlData = wifiConfigCommand->attr_start(NL80211_ATTR_VENDOR_DATA); if (!nlData) { + ret = WIFI_ERROR_UNKNOWN; ALOGE("wifi_set_qpower: failed attr_start for " "VENDOR_DATA. Error:%d", ret); goto cleanup; @@ -244,6 +251,7 @@ wifi_error wifi_set_qpower(wifi_interface_handle iface, if (wifiConfigCommand->put_u8( QCA_WLAN_VENDOR_ATTR_CONFIG_QPOWER, powersave)) { + ret = WIFI_ERROR_UNKNOWN; ALOGE("wifi_set_qpower(): failed to put vendor data. " "Error:%d", ret); goto cleanup; @@ -305,6 +313,7 @@ wifi_error wifi_set_beacon_wifi_iface_stats_averaging_factor( /* Add the vendor specific attributes for the NL command. */ nlData = wifiConfigCommand->attr_start(NL80211_ATTR_VENDOR_DATA); if (!nlData) { + ret = WIFI_ERROR_UNKNOWN; ALOGE("wifi_set_beacon_wifi_iface_stats_averaging_factor: failed " "attr_start for VENDOR_DATA. Error:%d", ret); goto cleanup; @@ -312,6 +321,7 @@ wifi_error wifi_set_beacon_wifi_iface_stats_averaging_factor( if (wifiConfigCommand->put_u32( QCA_WLAN_VENDOR_ATTR_CONFIG_STATS_AVG_FACTOR, factor)) { + ret = WIFI_ERROR_UNKNOWN; ALOGE("wifi_set_beacon_wifi_iface_stats_averaging_factor(): failed to " "put vendor data. Error:%d", ret); goto cleanup; @@ -371,6 +381,7 @@ wifi_error wifi_set_guard_time(wifi_request_id id, /* Add the vendor specific attributes for the NL command. */ nlData = wifiConfigCommand->attr_start(NL80211_ATTR_VENDOR_DATA); if (!nlData) { + ret = WIFI_ERROR_UNKNOWN; ALOGE("wifi_set_guard_time: failed attr_start for VENDOR_DATA. " "Error:%d", ret); goto cleanup; @@ -378,6 +389,7 @@ wifi_error wifi_set_guard_time(wifi_request_id id, if (wifiConfigCommand->put_u32( QCA_WLAN_VENDOR_ATTR_CONFIG_GUARD_TIME, guard_time)) { + ret = WIFI_ERROR_UNKNOWN; ALOGE("wifi_set_guard_time: failed to add vendor data."); goto cleanup; } @@ -485,6 +497,7 @@ wifi_error wifi_select_SARv01_tx_power_scenario(wifi_interface_handle handle, if (wifiConfigCommand->put_u32( QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SAR_ENABLE, bdf_file)) { + ret = WIFI_ERROR_UNKNOWN; ALOGE("failed to put SAR_ENABLE"); goto cleanup; } @@ -711,6 +724,7 @@ wifi_error wifi_reset_tx_power_scenario(wifi_interface_handle handle) /* Add the vendor specific attributes for the NL command. */ nlData = wifiConfigCommand->attr_start(NL80211_ATTR_VENDOR_DATA); if (!nlData) { + ret = WIFI_ERROR_UNKNOWN; ALOGE("wifi_reset_tx_power_scenario: failed attr_start for VENDOR_DATA. " "Error:%d", ret); goto cleanup; @@ -718,6 +732,7 @@ wifi_error wifi_reset_tx_power_scenario(wifi_interface_handle handle) if (wifiConfigCommand->put_u32(QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SAR_ENABLE, QCA_WLAN_VENDOR_ATTR_SAR_LIMITS_SELECT_NONE)) { + ret = WIFI_ERROR_UNKNOWN; ALOGE("failed to put SAR_ENABLE or NUM_SPECS"); goto cleanup; } @@ -770,12 +785,14 @@ wifi_error wifi_set_thermal_mitigation_mode(wifi_handle handle, /* Set the interface Id of the message. */ if (wifiConfigCommand->put_u32(NL80211_ATTR_IFINDEX, info->interfaces[0]->id)) { + ret = WIFI_ERROR_UNKNOWN; ALOGE("%s: Failed to put iface id", __FUNCTION__); - goto cleanup; + goto cleanup; } nlData = wifiConfigCommand->attr_start(NL80211_ATTR_VENDOR_DATA); if (!nlData) { + ret = WIFI_ERROR_UNKNOWN; ALOGE("%s: Failed in attr_start for VENDOR_DATA, Error:%d", __FUNCTION__, ret); goto cleanup; @@ -783,6 +800,7 @@ wifi_error wifi_set_thermal_mitigation_mode(wifi_handle handle, if (wifiConfigCommand->put_u32(QCA_WLAN_VENDOR_ATTR_THERMAL_CMD_VALUE, QCA_WLAN_VENDOR_ATTR_THERMAL_CMD_TYPE_SET_LEVEL)) { + ret = WIFI_ERROR_UNKNOWN; ALOGE("Failed to put THERMAL_LEVEL command type"); goto cleanup; } @@ -815,6 +833,7 @@ wifi_error wifi_set_thermal_mitigation_mode(wifi_handle handle, if (wifiConfigCommand->put_u32( QCA_WLAN_VENDOR_ATTR_THERMAL_LEVEL, qca_vendor_thermal_level)) { + ret = WIFI_ERROR_UNKNOWN; ALOGE("Failed to put thermal level"); goto cleanup; } @@ -822,6 +841,7 @@ wifi_error wifi_set_thermal_mitigation_mode(wifi_handle handle, if (wifiConfigCommand->put_u32( QCA_WLAN_VENDOR_ATTR_THERMAL_COMPLETION_WINDOW, completion_window)) { + ret = WIFI_ERROR_UNKNOWN; ALOGE("Failed to put thermal completion window"); goto cleanup; } @@ -1110,6 +1130,7 @@ wifi_error wifi_virtual_interface_create(wifi_handle handle, if (iface_type == WIFI_INTERFACE_TYPE_STA) { int sock = socket(AF_INET, SOCK_DGRAM, 0); if(sock < 0) { + ret = WIFI_ERROR_UNKNOWN; ALOGE("%s :socket error, Failed to bring up iface \n", __func__); goto done; } @@ -1117,11 +1138,13 @@ wifi_error wifi_virtual_interface_create(wifi_handle handle, memset(&ifr, 0, sizeof(ifr)); strlcpy(ifr.ifr_name, ifname, IFNAMSIZ); if (ioctl(sock, SIOCGIFFLAGS, &ifr) != 0) { + ret = WIFI_ERROR_UNKNOWN; ALOGE("%s :Could not read interface %s flags \n", __func__, ifname); goto done; } ifr.ifr_flags |= IFF_UP; if (ioctl(sock, SIOCSIFFLAGS, &ifr) != 0) { + ret = WIFI_ERROR_UNKNOWN; ALOGE("%s :Could not bring iface %s up \n", __func__, ifname); } } @@ -1233,6 +1256,7 @@ wifi_error wifi_set_latency_mode(wifi_interface_handle iface, /* Add the vendor specific attributes for the NL command. */ nlData = wifiConfigCommand->attr_start(NL80211_ATTR_VENDOR_DATA); if (!nlData) { + ret = WIFI_ERROR_UNKNOWN; ALOGE("%s: failed attr_start for VENDOR_DATA. Error:%d", __FUNCTION__, ret); goto cleanup; @@ -1240,6 +1264,7 @@ wifi_error wifi_set_latency_mode(wifi_interface_handle iface, if (wifiConfigCommand->put_u16( QCA_WLAN_VENDOR_ATTR_CONFIG_LATENCY_LEVEL, level)) { + ret = WIFI_ERROR_UNKNOWN; ALOGE("%s: failed to put vendor data. Error:%d", __FUNCTION__, ret); goto cleanup; @@ -1306,6 +1331,7 @@ wifi_error wifi_multi_sta_set_primary_connection(wifi_handle handle, /* Add the vendor specific attributes for the NL command. */ nlData = wifiConfigCommand->attr_start(NL80211_ATTR_VENDOR_DATA); if (!nlData) { + ret = WIFI_ERROR_UNKNOWN; ALOGE("%s: failed attr_start for VENDOR_DATA. Error:%d", __FUNCTION__, ret); goto cleanup; @@ -1313,6 +1339,7 @@ wifi_error wifi_multi_sta_set_primary_connection(wifi_handle handle, if (wifiConfigCommand->put_u8( QCA_WLAN_VENDOR_ATTR_CONFIG_CONCURRENT_STA_PRIMARY, 1)) { + ret = WIFI_ERROR_UNKNOWN; ALOGE("%s: failed to put vendor data. Error:%d", __FUNCTION__, ret); goto cleanup; @@ -1391,13 +1418,15 @@ wifi_error wifi_multi_sta_set_use_case(wifi_handle handle, /* Set the interface Id of the message. */ if (wifiConfigCommand->put_u32(NL80211_ATTR_IFINDEX, info->interfaces[0]->id)) { + ret = WIFI_ERROR_UNKNOWN; ALOGE("%s: Failed to put iface id", __FUNCTION__); - goto cleanup; + goto cleanup; } /* Add the vendor specific attributes for the NL command. */ nlData = wifiConfigCommand->attr_start(NL80211_ATTR_VENDOR_DATA); if (!nlData) { + ret = WIFI_ERROR_UNKNOWN; ALOGE("%s: failed attr_start for VENDOR_DATA. Error:%d", __FUNCTION__, ret); goto cleanup; @@ -1405,6 +1434,7 @@ wifi_error wifi_multi_sta_set_use_case(wifi_handle handle, if (wifiConfigCommand->put_u8( QCA_WLAN_VENDOR_ATTR_CONCURRENT_STA_POLICY_CONFIG, use_case)) { + ret = WIFI_ERROR_UNKNOWN; ALOGE("%s: failed to put use_case. Error:%d", __FUNCTION__, ret); goto cleanup; |