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