From 153984b30fffdd02c7fa970ef0c1d41c77f67de5 Mon Sep 17 00:00:00 2001 From: kevin Date: Wed, 19 May 2021 09:28:18 +0800 Subject: [PATCH] =?UTF-8?q?IssueNo=EF=BC=9A#I3RW19=20Description:sync=20L2?= =?UTF-8?q?=20peripheral=20code=20to=20L1=20Feature=20or=20Bugfix:Bugfix?= =?UTF-8?q?=20Binary=20Source:=20NO?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Ic4ff341a54e736b149e5225a8c0e4745ef1b45f7 --- model/network/wifi/Makefile | 7 ++--- model/network/wifi/hdfwifi.mk | 19 +++++++++--- .../wifi/platform/src/hdf_wlan_queue.c | 30 +++++++++++-------- model/network/wifi/vendor/hi3881/Makefile | 5 ++++ .../network/wifi/vendor/hi3881/env_config.mk | 2 -- model/sensor/Makefile | 2 +- network/include/netbuf_adapter.h | 2 +- network/src/Makefile | 2 +- network/src/net_device_adapter.c | 2 +- network/src/netbuf_adapter.c | 2 +- test/test_khdf.mk | 6 ++-- 11 files changed, 48 insertions(+), 31 deletions(-) diff --git a/model/network/wifi/Makefile b/model/network/wifi/Makefile index 5b2ce15..396c41d 100755 --- a/model/network/wifi/Makefile +++ b/model/network/wifi/Makefile @@ -18,9 +18,9 @@ HDF_DIR_PREFIX := ../../../../../../ include drivers/hdf/khdf/model/network/wifi/hdfwifi.mk -WAP_PATH := core/compoments/softap -WSTA_PATH := core/compoments/sta -WEAPOL_PATH := core/compoments/eapol +WAP_PATH := core/components/softap +WSTA_PATH := core/components/sta +WEAPOL_PATH := core/components/eapol NETDEV_PATH := ../common/netdevice MODULE_PATH := core/module QOS_PATH := platform/src/qos @@ -28,7 +28,6 @@ MESSAGE_PATH := platform/src/message PLATFORM_PATH := platform/src CORE_PATH := core - obj-$(CONFIG_DRIVERS_HDF_WIFI) += $(MODULE_NAME).o $(MODULE_NAME)-objs := $(HDF_WIFI_FRAMEWORKS_ROOT)/$(WAP_PATH)/ap.o \ $(HDF_WIFI_FRAMEWORKS_ROOT)/$(WEAPOL_PATH)/eapol.o \ diff --git a/model/network/wifi/hdfwifi.mk b/model/network/wifi/hdfwifi.mk index 180ebdb..f82be36 100755 --- a/model/network/wifi/hdfwifi.mk +++ b/model/network/wifi/hdfwifi.mk @@ -14,8 +14,11 @@ HDF_WIFI_FRAMEWORKS_ROOT = $(HDF_DIR_PREFIX)/framework/model/network/wifi HDF_WIFI_KHDF_FRAMEWORKS_ROOT = $(HDF_DIR_PREFIX)/adapter/khdf/linux/model/network/wifi +ifeq ($(TARGET_PRODUCT), Hi3516DV300) +HDF_WIFI_VENDOR_ROOT = $(HDF_VENDOR_PREFIX)/device/hisilicon/drivers/wifi/driver +else ifeq ($(TARGET_PRODUCT), hi3516dv300) HDF_WIFI_VENDOR_ROOT = $(HDF_VENDOR_PREFIX)/device/hisilicon/drivers/huawei_proprietary/wifi/driver - +endif HDF_FRAMEWORKS_INC := \ -Idrivers/hdf/framework/ability/sbuf/include \ -Idrivers/hdf/framework/core/common/include/host \ @@ -37,9 +40,9 @@ HDF_FRAMEWORKS_INC := \ -Iinclude/hdf/utils HDF_WIFI_FRAMEWORKS_INC := \ - -Idrivers/hdf/framework/model/network/wifi/core/compoments/eapol \ - -Idrivers/hdf/framework/model/network/wifi/core/compoments/softap \ - -Idrivers/hdf/framework/model/network/wifi/core/compoments/sta \ + -Idrivers/hdf/framework/model/network/wifi/core/components/eapol \ + -Idrivers/hdf/framework/model/network/wifi/core/components/softap \ + -Idrivers/hdf/framework/model/network/wifi/core/components/sta \ -Idrivers/hdf/framework/model/network/wifi/include \ -Idrivers/hdf/framework/model/network/wifi/core \ -Idrivers/hdf/framework/model/network/wifi/core/module \ @@ -53,8 +56,16 @@ HDF_WIFI_FRAMEWORKS_INC := \ HDF_WIFI_ADAPTER_INC := \ -Idrivers/hdf/khdf/network/include +ifeq ($(TARGET_PRODUCT), Hi3516DV300) +HDF_WIFI_VENDOR_INC := \ + -I../../../../../device/hisilicon/drivers/wifi/driver/core + +SECURE_LIB_INC := \ + -I../../../../../third_party/bounds_checking_function/include +else ifeq ($(TARGET_PRODUCT), hi3516dv300) HDF_WIFI_VENDOR_INC := \ -I../../../../device/hisilicon/drivers/huawei_proprietary/wifi/driver/core SECURE_LIB_INC := \ -I../../../../third_party/bounds_checking_function/include +endif diff --git a/model/network/wifi/platform/src/hdf_wlan_queue.c b/model/network/wifi/platform/src/hdf_wlan_queue.c index 864a6b8..5852a37 100644 --- a/model/network/wifi/platform/src/hdf_wlan_queue.c +++ b/model/network/wifi/platform/src/hdf_wlan_queue.c @@ -55,13 +55,15 @@ HdfWlanQueue *CreateQueue(uint16_t maxQueueSize) } return (HdfWlanQueue*)impl; } + void DestroyQueue(HdfWlanQueue *queue) { int32_t ret; - HdfWlanQueueImpl *impl = (HdfWlanQueueImpl *)queue; + HdfWlanQueueImpl *impl = NULL; if (queue == NULL) { return; } + impl = (HdfWlanQueueImpl *)queue; ret = OsalMutexDestroy(&impl->lock); if (ret != HDF_SUCCESS) { HDF_LOGE("%s: OsalSpinDestroy failed!ret=%d", __func__, ret); @@ -72,7 +74,11 @@ void DestroyQueue(HdfWlanQueue *queue) void *PopQueue(HdfWlanQueue *queue) { int32_t ret; - HdfWlanQueueImpl *impl = (HdfWlanQueueImpl *)queue; + HdfWlanQueueImpl *impl = NULL; + if (queue == NULL) { + return NULL; + } + impl = (HdfWlanQueueImpl *)queue; void *result = NULL; if (queue == NULL) { return NULL; @@ -82,29 +88,27 @@ void *PopQueue(HdfWlanQueue *queue) HDF_LOGE("%s:Get lock failed!ret=%d", __func__, ret); return NULL; } - do { - if (impl->elementCount > 0) { - uint16_t headIndex = impl->headIndex; - - result = impl->elements[headIndex++]; - - impl->headIndex = ((headIndex >= impl->maxElements) ? 0 : headIndex); - impl->elementCount--; - } - } while (false); + if (impl->elementCount > 0) { + uint16_t headIndex = impl->headIndex; + result = impl->elements[headIndex++]; + impl->headIndex = ((headIndex >= impl->maxElements) ? 0 : headIndex); + impl->elementCount--; + } ret = OsalMutexUnlock(&impl->lock); if (ret != HDF_SUCCESS) { HDF_LOGE("%s:Release lock failed!ret=%d", __func__, ret); } return result; } + int32_t PushQueue(HdfWlanQueue *queue, void *context) { int32_t ret; - HdfWlanQueueImpl *impl = (HdfWlanQueueImpl *)queue; + HdfWlanQueueImpl *impl = NULL; if (queue == NULL) { return HDF_FAILURE; } + impl = (HdfWlanQueueImpl *)queue; ret = OsalMutexLock(&impl->lock); if (ret != HDF_SUCCESS) { HDF_LOGE("%s:Get lock failed!ret=%d", __func__, ret); diff --git a/model/network/wifi/vendor/hi3881/Makefile b/model/network/wifi/vendor/hi3881/Makefile index 879133f..9344e14 100755 --- a/model/network/wifi/vendor/hi3881/Makefile +++ b/model/network/wifi/vendor/hi3881/Makefile @@ -18,8 +18,13 @@ HDF_VENDOR_PREFIX := ../../../../../../../../../ include drivers/hdf/khdf/model/network/wifi/hdfwifi.mk +ifeq ($(TARGET_PRODUCT), Hi3516DV300) +INC_TOP_PATH := ../../../../../ +VENDOR_WIFI_PATH := device/hisilicon/drivers/wifi/driver +else ifeq ($(TARGET_PRODUCT), hi3516dv300) INC_TOP_PATH := ../../../../ VENDOR_WIFI_PATH := device/hisilicon/drivers/huawei_proprietary/wifi/driver +endif WIFI_DRIVER_DIR := hi3881 ##################path of compile file :start############### diff --git a/model/network/wifi/vendor/hi3881/env_config.mk b/model/network/wifi/vendor/hi3881/env_config.mk index 4268683..f206ca7 100644 --- a/model/network/wifi/vendor/hi3881/env_config.mk +++ b/model/network/wifi/vendor/hi3881/env_config.mk @@ -91,7 +91,6 @@ else HI1131_WIFI_CFLAGS +=-D_PRE_WLAN_CHIP_VERSION=_HI_BOARD_FPGA endif - ifeq ($(QUICK_START),y) HI1131_WIFI_CFLAGS +=-D_PRE_WLAN_FEATURE_QUICK_START endif @@ -189,7 +188,6 @@ endif ifeq ($(CFG_BTCOEX_ROM), y) HI1131_WIFI_CFLAGS +=-D_PRE_WLAN_FEATURE_BTCOEX_ROM endif -#HI1131_WIFI_CFLAGS +=-D_PRE_PSM_DEBUG_MODE ifeq ($(CFG_RF_110X_CALI_DPD), y) HI1131_WIFI_CFLAGS +=-D_PRE_WLAN_RF_110X_CALI_DPD endif diff --git a/model/sensor/Makefile b/model/sensor/Makefile index 10da304..9b80d99 100644 --- a/model/sensor/Makefile +++ b/model/sensor/Makefile @@ -37,4 +37,4 @@ ccflags-y += -Idrivers/hdf/framework/model/sensor/driver/include \ -Idrivers/hdf/framework/include/platform \ -Idrivers/hdf/framework/include/config \ -Idrivers/hdf/khdf/osal/include \ - -I../../../../third_party/bounds_checking_function/include + -I$(PROJECT_ROOT)/third_party/bounds_checking_function/include diff --git a/network/include/netbuf_adapter.h b/network/include/netbuf_adapter.h index a80ffbb..a9f5df3 100644 --- a/network/include/netbuf_adapter.h +++ b/network/include/netbuf_adapter.h @@ -1,5 +1,5 @@ /* - * netbuf_adatper.h + * netbuf_adapter.h * * net buffer adapter of linux * diff --git a/network/src/Makefile b/network/src/Makefile index 038be61..a660f0a 100755 --- a/network/src/Makefile +++ b/network/src/Makefile @@ -22,4 +22,4 @@ ccflags-$(CONFIG_DRIVERS_HDF_WIFI) += \ -Iinclude/hdf/wifi \ -Iinclude/hdf/utils \ -Iinclude/hdf/osal \ - -I../../../../third_party/bounds_checking_function/include + -Iinclude/../../../../../../third_party/bounds_checking_function/include diff --git a/network/src/net_device_adapter.c b/network/src/net_device_adapter.c index d9fc512..d9e054c 100644 --- a/network/src/net_device_adapter.c +++ b/network/src/net_device_adapter.c @@ -105,7 +105,7 @@ static struct net_device_ops g_netDeviceOps = { .ndo_stop = NetDevStop }; -static struct net_device *CreateNetDevice(const struct NetDevice *hdfDev) +static struct net_device *CreateNetDevice(struct NetDevice *hdfDev) { struct net_device *dev = NULL; diff --git a/network/src/netbuf_adapter.c b/network/src/netbuf_adapter.c index 261465d..7cd0808 100644 --- a/network/src/netbuf_adapter.c +++ b/network/src/netbuf_adapter.c @@ -1,5 +1,5 @@ /* - * netbuf_adapter.h + * netbuf_adapter.c * * net buffer adapter of linux * diff --git a/test/test_khdf.mk b/test/test_khdf.mk index 0ad5cf6..7d59c20 100644 --- a/test/test_khdf.mk +++ b/test/test_khdf.mk @@ -53,10 +53,10 @@ ccflags-$(CONFIG_DRIVERS_HDF_TEST) += -Idrivers/hdf/framework/include/platform \ -I$(HDF_FRAMEWORK_ROOT)/model/network/common/netdevice \ -I$(HDF_FRAMEWORK_ROOT)/model/network/wifi/core/module \ -I$(HDF_FRAMEWORK_ROOT)/model/network/wifi/platfrom/src/qos \ - -I$(HDF_FRAMEWORK_ROOT)/model/network/wifi/core/compoments/softap \ - -I$(HDF_FRAMEWORK_ROOT)/model/network/wifi/core/compoments/sta \ + -I$(HDF_FRAMEWORK_ROOT)/model/network/wifi/core/components/softap \ + -I$(HDF_FRAMEWORK_ROOT)/model/network/wifi/core/components/sta \ -I$(HDF_FRAMEWORK_ROOT)/model/network/wifi/platform/include \ - -I../../../../third_party/bounds_checking_function/include \ + -I$(PROJECT_ROOT)/third_party/bounds_checking_function/include \ -I$(HDF_FRAMEWORK_TEST_ROOT)/platform \ -I$(HDF_FRAMEWORK_TEST_ROOT)/wifi \ -I$(HDF_FRAMEWORK_TEST_ROOT)/platform/common \ -- Gitee