From 56fe2c567d3fe5bcaa4eb6e32853529686d8223f Mon Sep 17 00:00:00 2001 From: Shobek Attupurath Date: Fri, 11 Jul 2025 01:15:48 +0000 Subject: [PATCH] rtl8852ce: Add Nvidia changes to driver v277-9 - Reduce log level - Remove unwanted prints - Add Nvidia sourcetree path Bug 5504994 Change-Id: I243236f586b0ee62161d7a4dbca5660c29c3b8b3 Signed-off-by: Shobek Attupurath Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3473468 Tested-by: Narayana Reddy P GVS: buildbot_gerritrpt Reviewed-by: Narayana Reddy P Reviewed-by: Bibek Basu --- .../net/wireless/realtek/rtl8852ce/Makefile | 42 +++++++++++++++---- .../net/wireless/realtek/rtl8852ce/common.mk | 2 +- .../realtek/rtl8852ce/core/rtw_mlme.c | 6 +-- .../realtek/rtl8852ce/phl/hal_g6/btc/btc.mk | 4 +- .../realtek/rtl8852ce/phl/hal_g6/hal.mk | 4 +- .../realtek/rtl8852ce/phl/hal_g6/hal_api_rf.c | 2 +- .../realtek/rtl8852ce/phl/hal_g6/mac/mac.mk | 4 +- .../realtek/rtl8852ce/phl/hal_g6/phy/bb/bb.mk | 4 +- .../realtek/rtl8852ce/phl/hal_g6/phy/rf/rf.mk | 4 +- .../net/wireless/realtek/rtl8852ce/phl/phl.mk | 4 +- .../realtek/rtl8852ce/phl/phl_cmd_scan.c | 10 ++--- 11 files changed, 55 insertions(+), 31 deletions(-) diff --git a/drivers/net/wireless/realtek/rtl8852ce/Makefile b/drivers/net/wireless/realtek/rtl8852ce/Makefile index 6be7211a..d9d5aa0a 100644 --- a/drivers/net/wireless/realtek/rtl8852ce/Makefile +++ b/drivers/net/wireless/realtek/rtl8852ce/Makefile @@ -14,6 +14,9 @@ EXTRA_CFLAGS += -Wno-unused-label #EXTRA_CFLAGS += -Wno-unused-function EXTRA_CFLAGS += -Wno-unused #EXTRA_CFLAGS += -Wno-uninitialized +EXTRA_CFLAGS += -Wno-missing-prototypes +EXTRA_CFLAGS += -Wno-missing-declarations +EXTRA_CFLAGS += -Wno-enum-conversion ############ ANDROID COMMON KERNEL ############ # clang @@ -35,7 +38,8 @@ ifeq ($(GCC_VER_49),1) EXTRA_CFLAGS += -Wno-date-time # Fix compile error && warning on gcc 4.9 and later endif -EXTRA_CFLAGS += -I$(src)/include +SOURCETREE = $(srctree.nvidia-oot)/drivers/net/wireless/realtek/rtl8852ce +EXTRA_CFLAGS += -I$(SOURCETREE)/include EXTRA_LDFLAGS += --strip-debug @@ -161,8 +165,8 @@ endif CONFIG_RTW_DEBUG = y # default log level is _DRV_INFO_ = 4, # please refer to "How_to_set_driver_debug_log_level.doc" to set the available level. -CONFIG_RTW_LOG_LEVEL = 4 -CONFIG_RTW_PHL_LOG_LEVEL = 3 +CONFIG_RTW_LOG_LEVEL = 0 +CONFIG_RTW_PHL_LOG_LEVEL = 0 # CONFIG_RTW_APPEND_LOGLEVEL decide if append kernel log level to each messages. # default "n" for don't append. @@ -244,7 +248,8 @@ CONFIG_BCN_CNT_CONFIRM_HDL = y CONFIG_BCN_NEW_MAX_CNT = 3 ###################### Platform Related ####################### -CONFIG_PLATFORM_I386_PC = y +CONFIG_PLATFORM_TEGRA = y +CONFIG_PLATFORM_I386_PC = n CONFIG_PLATFORM_RTL8198D = n CONFIG_PLATFORM_ANDROID_X86 = n CONFIG_PLATFORM_ANDROID_INTEL_X86 = n @@ -779,6 +784,16 @@ ifeq ($(CONFIG_DBG_AX_CAM), y) EXTRA_CFLAGS += -DCONFIG_DBG_AX_CAM endif +ifeq ($(CONFIG_PLATFORM_TEGRA), y) +ARCH = arm64 +KVER := $(shell uname -r) +KSRC := /lib/modules/$(KVER)/build +EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN +EXTRA_CFLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT +EXTRA_CFLAGS += -Wno-error=date-time +MODULE_NAME = rtl8852ce +endif + ifeq ($(CONFIG_I386_BUILD_VERIFY), y) EXTRA_CFLAGS += -DCONFIG_I386_BUILD_VERIFY endif @@ -795,8 +810,18 @@ endif include $(wildcard $(DRV_PATH)/platform/*.mk) # Import platform specific compile options -EXTRA_CFLAGS += -I$(src)/platform +EXTRA_CFLAGS += -I$(SOURCETREE)/platform #_PLATFORM_FILES := platform/platform_ops.o +ifeq ($(CONFIG_PCI_HCI), y) +EXTRA_CFLAGS += -DCONFIG_PLATFORM_OPS +_PLATFORM_FILES := platform/platform_linux_pc_pci.o +OBJS += $(_PLATFORM_FILES) +# Core Config +CONFIG_MSG_NUM = 128 +EXTRA_CFLAGS += -DCONFIG_MSG_NUM=$(CONFIG_MSG_NUM) +#EXTRA_CFLAGS += -DCONFIG_TX_SKB_ORPHAN +endif +_PLATFORM_FILES += platform/platform_ops.o OBJS += $(_PLATFORM_FILES) ########### CUSTOMER ################################ @@ -816,7 +841,7 @@ endif ifneq ($(KERNELRELEASE),) ########### COMMON ################################# -include $(src)/common.mk +include $(SOURCETREE)/common.mk EXTRA_CFLAGS += -DPHL_PLATFORM_LINUX EXTRA_CFLAGS += -DCONFIG_PHL_ARCH @@ -837,11 +862,10 @@ ifeq ($(DIRTY_FOR_WORK), y) EXTRA_CFLAGS += -DDIRTY_FOR_WORK endif -include $(src)/phl/phl.mk +include $(SOURCETREE)/phl/phl.mk +obj-m := $(MODULE_NAME).o -obj-$(CONFIG_RTL8852CE) := $(MODULE_NAME).o -obj-$(CONFIG_RTL8852CE) := $(MODULE_NAME).o $(MODULE_NAME)-y = $(OBJS) ############# MEMORY MANAGMENT ############# diff --git a/drivers/net/wireless/realtek/rtl8852ce/common.mk b/drivers/net/wireless/realtek/rtl8852ce/common.mk index a0469dff..352006a5 100644 --- a/drivers/net/wireless/realtek/rtl8852ce/common.mk +++ b/drivers/net/wireless/realtek/rtl8852ce/common.mk @@ -103,7 +103,7 @@ _CORE_FILES += core/rtw_phl.o \ core/rtw_phl_rate.o \ core/rtw_phl_cmd.o -EXTRA_CFLAGS += -I$(src)/core/crypto +EXTRA_CFLAGS += -I$(SOURCETREE)/core/crypto _CORE_FILES += core/crypto/aes-internal.o \ core/crypto/aes-internal-enc.o \ core/crypto/aes-gcm.o \ diff --git a/drivers/net/wireless/realtek/rtl8852ce/core/rtw_mlme.c b/drivers/net/wireless/realtek/rtl8852ce/core/rtw_mlme.c index 962ea8de..74bced83 100644 --- a/drivers/net/wireless/realtek/rtl8852ce/core/rtw_mlme.c +++ b/drivers/net/wireless/realtek/rtl8852ce/core/rtw_mlme.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Copyright(c) 2007 - 2024 Realtek Corporation. - * + * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. @@ -177,8 +177,8 @@ sint _rtw_init_mlme_priv(_adapter *padapter) #else #define RTW_ROAM_SCAN_RESULT_EXP_MS (10*1000) #endif -#define RTW_ROAM_SCAN_INTERVAL (5) /* 5*(2 second)*/ -#define RTW_ROAM_RSSI_THRESHOLD 30 +#define RTW_ROAM_SCAN_INTERVAL (2) /* 5*(2 second)*/ +#define RTW_ROAM_RSSI_THRESHOLD 40 #define RTW_ROAM_RSSI_IDLE_TH RTW_ROAM_RSSI_THRESHOLD #define RTW_ROAM_RSSI_BUSY_TH RTW_ROAM_RSSI_THRESHOLD + 5 diff --git a/drivers/net/wireless/realtek/rtl8852ce/phl/hal_g6/btc/btc.mk b/drivers/net/wireless/realtek/rtl8852ce/phl/hal_g6/btc/btc.mk index 918b129f..cd107811 100644 --- a/drivers/net/wireless/realtek/rtl8852ce/phl/hal_g6/btc/btc.mk +++ b/drivers/net/wireless/realtek/rtl8852ce/phl/hal_g6/btc/btc.mk @@ -7,10 +7,10 @@ ifeq ($(CONFIG_PHL_ARCH), y) phl_path := phl/$(HAL) -phl_path_d1 := $(src)/phl/$(HAL) +phl_path_d1 := $(SOURCETREE)/phl/$(HAL) else phl_path := $(HAL) -phl_path_d1 := $(src)/$(HAL) +phl_path_d1 := $(SOURCETREE)/$(HAL) endif # Base directory diff --git a/drivers/net/wireless/realtek/rtl8852ce/phl/hal_g6/hal.mk b/drivers/net/wireless/realtek/rtl8852ce/phl/hal_g6/hal.mk index 8660c88d..073d84e0 100644 --- a/drivers/net/wireless/realtek/rtl8852ce/phl/hal_g6/hal.mk +++ b/drivers/net/wireless/realtek/rtl8852ce/phl/hal_g6/hal.mk @@ -2,10 +2,10 @@ ifeq ($(CONFIG_PHL_ARCH), y) phl_path := phl/ -phl_path_d1 := $(src)/phl/$(HAL) +phl_path_d1 := $(SOURCETREE)/phl/$(HAL) else phl_path := -phl_path_d1 := $(src)/$(HAL) +phl_path_d1 := $(SOURCETREE)/$(HAL) endif _HAL_FILES := $(phl_path)$(HAL)/hal_api_mac.o \ diff --git a/drivers/net/wireless/realtek/rtl8852ce/phl/hal_g6/hal_api_rf.c b/drivers/net/wireless/realtek/rtl8852ce/phl/hal_g6/hal_api_rf.c index 01651981..815ae325 100644 --- a/drivers/net/wireless/realtek/rtl8852ce/phl/hal_g6/hal_api_rf.c +++ b/drivers/net/wireless/realtek/rtl8852ce/phl/hal_g6/hal_api_rf.c @@ -198,9 +198,9 @@ enum rtw_hal_status rtw_hal_rf_read_pwr_table_ru( { int ret = RTW_HAL_STATUS_SUCCESS; struct hal_info_t *hal_info = (struct hal_info_t *)hal_com->hal_priv; + u8 band = hal_com->band[HW_PHY_0].cur_chandef.band; PHL_INFO("[MP HAL API] %s \n", __FUNCTION__); - u8 band = hal_com->band[HW_PHY_0].cur_chandef.band; *get_item = halrf_get_power_by_rate_and_limit_ru_smaller(hal_info->rf, rf_path, rate, dcm,offset, bandwidth, beamforming, channel, band); diff --git a/drivers/net/wireless/realtek/rtl8852ce/phl/hal_g6/mac/mac.mk b/drivers/net/wireless/realtek/rtl8852ce/phl/hal_g6/mac/mac.mk index 6342c487..ad635a48 100644 --- a/drivers/net/wireless/realtek/rtl8852ce/phl/hal_g6/mac/mac.mk +++ b/drivers/net/wireless/realtek/rtl8852ce/phl/hal_g6/mac/mac.mk @@ -7,10 +7,10 @@ HAL = hal_g6 ifeq ($(CONFIG_PHL_ARCH), y) phl_path := phl/hal_g6 -phl_path_d1 := $(src)/phl/$(HAL) +phl_path_d1 := $(SOURCETREE)/phl/$(HAL) else phl_path := hal_g6 -phl_path_d1 := $(src)/$(HAL) +phl_path_d1 := $(SOURCETREE)/$(HAL) endif # Base directory diff --git a/drivers/net/wireless/realtek/rtl8852ce/phl/hal_g6/phy/bb/bb.mk b/drivers/net/wireless/realtek/rtl8852ce/phl/hal_g6/phy/bb/bb.mk index a1273e96..02785e87 100644 --- a/drivers/net/wireless/realtek/rtl8852ce/phl/hal_g6/phy/bb/bb.mk +++ b/drivers/net/wireless/realtek/rtl8852ce/phl/hal_g6/phy/bb/bb.mk @@ -7,10 +7,10 @@ ifeq ($(CONFIG_PHL_ARCH), y) phl_path := phl/$(HAL) -phl_path_d1 := $(src)/phl/$(HAL) +phl_path_d1 := $(SOURCETREE)/phl/$(HAL) else phl_path := $(HAL) -phl_path_d1 := $(src)/$(HAL) +phl_path_d1 := $(SOURCETREE)/$(HAL) endif # Base directory diff --git a/drivers/net/wireless/realtek/rtl8852ce/phl/hal_g6/phy/rf/rf.mk b/drivers/net/wireless/realtek/rtl8852ce/phl/hal_g6/phy/rf/rf.mk index 717e176e..21dd2569 100644 --- a/drivers/net/wireless/realtek/rtl8852ce/phl/hal_g6/phy/rf/rf.mk +++ b/drivers/net/wireless/realtek/rtl8852ce/phl/hal_g6/phy/rf/rf.mk @@ -7,10 +7,10 @@ ifeq ($(CONFIG_PHL_ARCH), y) phl_path := phl/$(HAL) -phl_path_d1 := $(src)/phl/$(HAL) +phl_path_d1 := $(SOURCETREE)/phl/$(HAL) else phl_path := $(HAL) -phl_path_d1 := $(src)/$(HAL) +phl_path_d1 := $(SOURCETREE)/$(HAL) endif # Base directory diff --git a/drivers/net/wireless/realtek/rtl8852ce/phl/phl.mk b/drivers/net/wireless/realtek/rtl8852ce/phl/phl.mk index 20c1368c..aa31e68d 100644 --- a/drivers/net/wireless/realtek/rtl8852ce/phl/phl.mk +++ b/drivers/net/wireless/realtek/rtl8852ce/phl/phl.mk @@ -11,10 +11,10 @@ endif ifeq ($(CONFIG_PHL_ARCH), y) phl_path := phl/ -phl_path_d1 := $(src)/phl/$(HAL) +phl_path_d1 := $(SOURCETREE)/phl/$(HAL) else phl_path := -phl_path_d1 := $(src)/$(HAL) +phl_path_d1 := $(SOURCETREE)/$(HAL) endif _PHL_FILES := $(phl_path)phl_init.o \ diff --git a/drivers/net/wireless/realtek/rtl8852ce/phl/phl_cmd_scan.c b/drivers/net/wireless/realtek/rtl8852ce/phl/phl_cmd_scan.c index 33c54617..bf8073a1 100644 --- a/drivers/net/wireless/realtek/rtl8852ce/phl/phl_cmd_scan.c +++ b/drivers/net/wireless/realtek/rtl8852ce/phl/phl_cmd_scan.c @@ -1,7 +1,7 @@ /****************************************************************************** * * Copyright(c) 2019 - 2020 Realtek Corporation. - * + * SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. * This program is free software; you can redistribute it and/or modify it * under the terms of version 2 of the GNU General Public License as * published by the Free Software Foundation. @@ -343,14 +343,14 @@ next_ch: goto next_ch; } else { - printk("%s: scan done\n", __func__); + PHL_INFO("%s: scan done\n", __func__); return NULL; } param->done_num = param->ch_num - sctrl->chlist.cnt; - printk("%s:[%d] idx=%d, r=%d, ch=%d, p=%d\n", __func__, - band_idx, sctrl->ch_idx, sctrl->chlist.cnt, sctrl->scan_ch->channel, - phl_get_passing_time_ms(param->start_time)); + PHL_INFO("%s:[%d] idx=%d, r=%d, ch=%d, p=%d\n", __func__, + band_idx, sctrl->ch_idx, sctrl->chlist.cnt, sctrl->scan_ch->channel, + phl_get_passing_time_ms(param->start_time)); return sctrl->scan_ch; }