!108 adapter wlan hdi client

Merge pull request !108 from michael4096/master
This commit is contained in:
openharmony_ci
2021-07-13 03:52:12 +00:00
committed by Gitee
3 changed files with 24 additions and 3 deletions
+1 -1
View File
@@ -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
+17 -1
View File
@@ -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(rspData);
if (ifName == NULL) {
HDF_LOGE("%s: %s!ParamName=%s", __func__, ERROR_DESC_READ_REQ_FAILED, "ifName");
return;
}
int32_t ret = HdfWifiEventResetResult(chipId, rspCode);
int32_t ret = HdfWifiEventResetResult(chipId, rspCode, ifName);
if (ret != HDF_SUCCESS) {
HDF_LOGE("%s: send resetDriver event fail!", __func__);
}
@@ -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);