diff options
author | Hsiu-Chang Chen <hsiuchangchen@google.com> | 2022-04-13 14:43:22 +0800 |
---|---|---|
committer | Hsiu-Chang Chen <hsiuchangchen@google.com> | 2022-04-13 14:43:22 +0800 |
commit | 947c29ce0fbf65b0906a9a535cf2585d45ed7487 (patch) | |
tree | 5bd2440d47402e32bbb8d1a020ceb46158fe524c | |
parent | 1d53f25f10ee9908ca2e185e802ea67002e2cfdf (diff) | |
download | wlan-947c29ce0fbf65b0906a9a535cf2585d45ed7487.tar.gz |
wifihal: Send proper return value in diag_msg_handler
Send proper return value in diag_msg_handler, so that
caller would take appropriate action based on return type
Bug: 220992475
Test: VtsHalWifiNan/VtsHalWifiRtt
CRs-Fixed: 3167545
Change-Id: Icbcefb1e45b2d40b0bacc3eb1f849737d2cb0a0f
-rw-r--r-- | qcwcn/wifi_hal/wifilogger_diag.cpp | 38 |
1 files changed, 36 insertions, 2 deletions
diff --git a/qcwcn/wifi_hal/wifilogger_diag.cpp b/qcwcn/wifi_hal/wifilogger_diag.cpp index e1ed948..5fa7777 100644 --- a/qcwcn/wifi_hal/wifilogger_diag.cpp +++ b/qcwcn/wifi_hal/wifilogger_diag.cpp @@ -24,6 +24,40 @@ * 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. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted (subject to the limitations in the + * disclaimer below) provided that the following conditions are met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following + * disclaimer in the documentation and/or other materials provided + * with the distribution. + * + * * Neither the name of Qualcomm Innovation Center, Inc. nor the names of its + * contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE + * GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT + * HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE + * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 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. */ /* Suppress -Waddress-of-packed-member for new toolchain update. @@ -2603,7 +2637,7 @@ wifi_error diag_message_handler(hal_info *info, nl_msg *msg) if (!(tb_vendor[CLD80211_ATTR_DATA] || tb_vendor[CLD80211_ATTR_CMD])) { ALOGE("Invalid oem data received from driver"); - return WIFI_SUCCESS; + return WIFI_ERROR_UNKNOWN; } ctrl_evt = (wifihal_ctrl_event_t *)malloc(sizeof(*ctrl_evt) + nlh->nlmsg_len); @@ -2663,7 +2697,7 @@ wifi_error diag_message_handler(hal_info *info, nl_msg *msg) if (!clh) { ALOGE("Invalid data received from driver"); - return WIFI_SUCCESS; + return WIFI_ERROR_UNKNOWN; } /* Check nlmsg_type also to avoid processing unintended msgs */ if (cmd == ANI_NL_MSG_PUMAC) { |