From 8e6f97846800f870cc89df11458f44e74df6b3a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cwangyougang=E2=80=9D?= Date: Fri, 25 Mar 2022 07:34:33 +0000 Subject: [PATCH] fix:Chip name adaptation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: “wangyougang” --- model/network/wifi/core/hdf_wifi_core.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/model/network/wifi/core/hdf_wifi_core.c b/model/network/wifi/core/hdf_wifi_core.c index 30372e91..cf3233ed 100644 --- a/model/network/wifi/core/hdf_wifi_core.c +++ b/model/network/wifi/core/hdf_wifi_core.c @@ -339,16 +339,24 @@ static void ReleaseWlanDevice(struct HdfWlanDevice *device) static struct HdfWlanDevice *ProbeDevice(struct HdfConfigWlanDevInst *deviceConfig) { + if (deviceConfig == NULL) { + return NULL; + } struct HdfWlanDevice *device = NULL; int32_t ret; - if (deviceConfig == NULL) { + struct HdfConfigWlanChipList *tmpChipList = NULL; + struct HdfConfigWlanRoot *rootConfig = HdfWlanGetModuleConfigRoot(); + if (rootConfig == NULL) { + HDF_LOGE("%s:ProbeDevice rootConfig NULL", __func__); return NULL; } device = (struct HdfWlanDevice *)OsalMemCalloc(sizeof(struct HdfWlanDevice)); if (device == NULL) { - HDF_LOGE("%s:oom", __func__); + HDF_LOGE("%s:ProbeDevice device NULL", __func__); return NULL; } + + tmpChipList = &rootConfig->wlanConfig.chipList; do { device->powers = HdfWlanCreatePowerManager(&deviceConfig->powers); device->reset = HdfWlanCreateResetManager(&deviceConfig->reset, deviceConfig->bootUpTimeOut); @@ -371,7 +379,7 @@ static struct HdfWlanDevice *ProbeDevice(struct HdfConfigWlanDevInst *deviceConf ret = HDF_SUCCESS; OsalMSleep(SLEEPTIME); device->bus = NULL; - device->driverName = "hisi"; // from BDH6_DRIVER_NAME + device->driverName = tmpChipList->chipInst[0].driverName; // from BDH6_DRIVER_NAME HDF_LOGW("Do not call GPIO and HdfWlanBusInit"); #endif