From 16a074649b102f7047b3694f1993f6147e6bb686 Mon Sep 17 00:00:00 2001 From: YOUR_NAME Date: Thu, 8 Jul 2021 14:53:19 +0000 Subject: [PATCH 1/3] Description:adapter wlan hdi client Feature or Bugfix:Feature Binary Source: No Signed-off-by: YOUR_NAME --- include/wifi/hdf_wifi_event.h | 2 +- model/network/wifi/core/module/wifi_base.c | 18 +++++++++++++++++- .../network/wifi/platform/src/hdf_wifi_event.c | 7 ++++++- 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/include/wifi/hdf_wifi_event.h b/include/wifi/hdf_wifi_event.h index cfae47b11..4aad40b76 100644 --- a/include/wifi/hdf_wifi_event.h +++ b/include/wifi/hdf_wifi_event.h @@ -474,7 +474,7 @@ int32_t HdfWifiEventEapolRecv(const char *name, void *context); * @since 1.0 * @version 1.0 */ -int32_t HdfWifiEventResetResult(const uint8_t chipId, int32_t resetStatus); +int32_t HdfWifiEventResetResult(const uint8_t chipId, int32_t resetStatus, const char *ifName); #ifdef __cplusplus #if __cplusplus diff --git a/model/network/wifi/core/module/wifi_base.c b/model/network/wifi/core/module/wifi_base.c index 6f2911387..69e8fb1da 100644 --- a/model/network/wifi/core/module/wifi_base.c +++ b/model/network/wifi/core/module/wifi_base.c @@ -1107,6 +1107,7 @@ static int32_t WifiCmdDoResetChip(const RequestContext *context, struct HdfSBuf { int32_t ret; uint8_t chipId; + const char *ifName = NULL; struct HdfWlanDevice *wlanDevice = NULL; ret = ResetParaCheck(context, reqData, rspData); @@ -1118,11 +1119,20 @@ static int32_t WifiCmdDoResetChip(const RequestContext *context, struct HdfSBuf HDF_LOGE("%s: %s!ParamName=%s", __func__, ERROR_DESC_READ_REQ_FAILED, "chipId"); return HDF_FAILURE; } + ifName = HdfSbufReadString(reqData); + if (ifName == NULL) { + HDF_LOGE("%s: %s!ParamName=%s", __func__, ERROR_DESC_READ_REQ_FAILED, "ifName"); + return HDF_FAILURE; + } /* callback function use chipId */ if (!HdfSbufWriteUint8(rspData, chipId)) { HDF_LOGE("%s: %s!", __func__, ERROR_DESC_WRITE_RSP_FAILED); return HDF_FAILURE; } + if (!HdfSbufWriteString(rspData, ifName)) { + HDF_LOGE("%s: Serialize failed!", __func__); + return HDF_FAILURE; + } ret = WifiResetEntranceCheck(chipId); if (ret != HDF_SUCCESS) { @@ -1156,6 +1166,7 @@ void SendMessageResetDriverCallBack(const RequestContext *context, struct HdfSBu ErrorCode rspCode) { uint8_t chipId; + const char *ifName = NULL; (void)context; if (rspData == NULL || reqData == NULL) { @@ -1167,8 +1178,13 @@ void SendMessageResetDriverCallBack(const RequestContext *context, struct HdfSBu HDF_LOGE("%s: read data failed! ParamName=%s", __func__, "chipId"); return; } + ifName = HdfSbufReadString(reqData); + if (ifName == NULL) { + HDF_LOGE("%s: %s!ParamName=%s", __func__, ERROR_DESC_READ_REQ_FAILED, "ifName"); + return HDF_FAILURE; + } - int32_t ret = HdfWifiEventResetResult(chipId, rspCode); + int32_t ret = HdfWifiEventResetResult(chipId, ifName, rspCode); if (ret != HDF_SUCCESS) { HDF_LOGE("%s: send resetDriver event fail!", __func__); } diff --git a/model/network/wifi/platform/src/hdf_wifi_event.c b/model/network/wifi/platform/src/hdf_wifi_event.c index 8ad90b5a2..109577831 100644 --- a/model/network/wifi/platform/src/hdf_wifi_event.c +++ b/model/network/wifi/platform/src/hdf_wifi_event.c @@ -400,7 +400,7 @@ int32_t HdfWifiEventEapolRecv(const char *name, void *context) return ret; } -int32_t HdfWifiEventResetResult(const uint8_t chipId, int32_t resetStatus) +int32_t HdfWifiEventResetResult(const uint8_t chipId, int32_t resetStatus, const char *ifName) { struct HdfSBuf *data = NULL; int32_t ret; @@ -410,6 +410,11 @@ int32_t HdfWifiEventResetResult(const uint8_t chipId, int32_t resetStatus) HDF_LOGE("%s InitDataBlock failed", __func__); return HDF_FAILURE; } + if (!HdfSbufWriteString(data, ifName)) { + HDF_LOGE("%s: Serialize failed!", __func__); + HdfSBufRecycle(data); + return HDF_FAILURE; + } if (!HdfSbufWriteInt32(data, resetStatus)) { HDF_LOGE("%s sbuf write failed", __func__); HdfSBufRecycle(data); -- Gitee From 16836dde36b42c3e640024eb571709a71bda4619 Mon Sep 17 00:00:00 2001 From: YOUR_NAME Date: Fri, 9 Jul 2021 03:21:43 +0000 Subject: [PATCH 2/3] Description:adapter wlan hdi client Feature or Bugfix:Feature Binary Source: No Signed-off-by: YOUR_NAME --- model/network/wifi/core/module/wifi_base.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/model/network/wifi/core/module/wifi_base.c b/model/network/wifi/core/module/wifi_base.c index 69e8fb1da..2bb44d55a 100644 --- a/model/network/wifi/core/module/wifi_base.c +++ b/model/network/wifi/core/module/wifi_base.c @@ -1181,10 +1181,10 @@ void SendMessageResetDriverCallBack(const RequestContext *context, struct HdfSBu ifName = HdfSbufReadString(reqData); if (ifName == NULL) { HDF_LOGE("%s: %s!ParamName=%s", __func__, ERROR_DESC_READ_REQ_FAILED, "ifName"); - return HDF_FAILURE; + return; } - int32_t ret = HdfWifiEventResetResult(chipId, ifName, rspCode); + int32_t ret = HdfWifiEventResetResult(chipId, rspCode, ifName); if (ret != HDF_SUCCESS) { HDF_LOGE("%s: send resetDriver event fail!", __func__); } -- Gitee From 7a1f7380d6d44f266ab8a0be037fc248d6e52f2c Mon Sep 17 00:00:00 2001 From: YOUR_NAME Date: Fri, 9 Jul 2021 07:03:35 +0000 Subject: [PATCH 3/3] Description:adapter wlan hdi client Feature or Bugfix:Feature Binary Source: No Signed-off-by: YOUR_NAME --- model/network/wifi/core/module/wifi_base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/model/network/wifi/core/module/wifi_base.c b/model/network/wifi/core/module/wifi_base.c index 2bb44d55a..1857174d7 100644 --- a/model/network/wifi/core/module/wifi_base.c +++ b/model/network/wifi/core/module/wifi_base.c @@ -1178,7 +1178,7 @@ void SendMessageResetDriverCallBack(const RequestContext *context, struct HdfSBu HDF_LOGE("%s: read data failed! ParamName=%s", __func__, "chipId"); return; } - ifName = HdfSbufReadString(reqData); + ifName = HdfSbufReadString(rspData); if (ifName == NULL) { HDF_LOGE("%s: %s!ParamName=%s", __func__, ERROR_DESC_READ_REQ_FAILED, "ifName"); return; -- Gitee