diff --git a/drivers/net/wireless/realtek/rtl8852ce/Makefile b/drivers/net/wireless/realtek/rtl8852ce/Makefile index 42c00833..3aab93ba 100644 --- a/drivers/net/wireless/realtek/rtl8852ce/Makefile +++ b/drivers/net/wireless/realtek/rtl8852ce/Makefile @@ -14,9 +14,6 @@ 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 @@ -38,8 +35,7 @@ ifeq ($(GCC_VER_49),1) EXTRA_CFLAGS += -Wno-date-time # Fix compile error && warning on gcc 4.9 and later endif -SOURCETREE = $(srctree.nvidia-oot)/drivers/net/wireless/realtek/rtl8852ce -EXTRA_CFLAGS += -I$(SOURCETREE)/include +EXTRA_CFLAGS += -I$(src)/include EXTRA_LDFLAGS += --strip-debug @@ -165,8 +161,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 = 0 -CONFIG_RTW_PHL_LOG_LEVEL = 0 +CONFIG_RTW_LOG_LEVEL = 4 +CONFIG_RTW_PHL_LOG_LEVEL = 3 # CONFIG_RTW_APPEND_LOGLEVEL decide if append kernel log level to each messages. # default "n" for don't append. @@ -242,8 +238,7 @@ CONFIG_ROAMING_FLAG = 0x3f CONFIG_ROAM_SCAN_ORDER = 526 ###################### Platform Related ####################### -CONFIG_PLATFORM_TEGRA = y -CONFIG_PLATFORM_I386_PC = n +CONFIG_PLATFORM_I386_PC = y CONFIG_PLATFORM_RTL8198D = n CONFIG_PLATFORM_ANDROID_X86 = n CONFIG_PLATFORM_ANDROID_INTEL_X86 = n @@ -773,16 +768,6 @@ 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 @@ -799,18 +784,8 @@ endif include $(wildcard $(DRV_PATH)/platform/*.mk) # Import platform specific compile options -EXTRA_CFLAGS += -I$(SOURCETREE)/platform +EXTRA_CFLAGS += -I$(src)/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 ################################ @@ -830,7 +805,7 @@ endif ifneq ($(KERNELRELEASE),) ########### COMMON ################################# -include $(SOURCETREE)/common.mk +include $(src)/common.mk EXTRA_CFLAGS += -DPHL_PLATFORM_LINUX EXTRA_CFLAGS += -DCONFIG_PHL_ARCH @@ -851,10 +826,11 @@ ifeq ($(DIRTY_FOR_WORK), y) EXTRA_CFLAGS += -DDIRTY_FOR_WORK endif -include $(SOURCETREE)/phl/phl.mk +include $(src)/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 f6eb419e..b5cf5649 100644 --- a/drivers/net/wireless/realtek/rtl8852ce/common.mk +++ b/drivers/net/wireless/realtek/rtl8852ce/common.mk @@ -99,7 +99,7 @@ _CORE_FILES := core/rtw_fsm.o \ _CORE_FILES += core/rtw_phl.o \ core/rtw_phl_cmd.o -EXTRA_CFLAGS += -I$(SOURCETREE)/core/crypto +EXTRA_CFLAGS += -I$(src)/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_ap.c b/drivers/net/wireless/realtek/rtl8852ce/core/rtw_ap.c index 1525d37f..95fc6df1 100644 --- a/drivers/net/wireless/realtek/rtl8852ce/core/rtw_ap.c +++ b/drivers/net/wireless/realtek/rtl8852ce/core/rtw_ap.c @@ -4542,9 +4542,6 @@ void stop_ap_mode(_adapter *padapter) rtw_warn_on(1); pmlmepriv->update_bcn = _FALSE; - /*pmlmeext->bstart_bss = _FALSE;*/ - padapter->netif_up = _FALSE; - /* _rtw_spinlock_free(&pmlmepriv->bcn_update_lock); */ /* reset and init security priv , this can refine with rtw_reset_securitypriv */ _rtw_memset((unsigned char *)&padapter->securitypriv, 0, sizeof(struct security_priv)); @@ -7806,8 +7803,14 @@ bool rtw_add_del_sta_cmd_check(struct _ADAPTER *padapter, unsigned char *MacAddr if (padapter->ap_add_del_sta_cmd_state == ADD_DEL_STA_ST_IDLE) { status = rtw_ap_add_del_sta_cmd(padapter); - if (status == RTW_PHL_STATUS_SUCCESS) + if (status == RTW_PHL_STATUS_SUCCESS) { padapter->ap_add_del_sta_cmd_state = ADD_DEL_STA_ST_REQUESTING; + } else { + rtw_list_delete(&add_del_sta_obj->list); + pstapriv->add_sta_list_cnt--; + rtw_mfree(add_del_sta_obj, sizeof(struct rtw_add_del_sta_obj)); + add_del_sta_obj = NULL; + } } else { RTW_INFO(FUNC_ADPT_FMT": reuse token\n", FUNC_ADPT_ARG(padapter)); } diff --git a/drivers/net/wireless/realtek/rtl8852ce/core/rtw_mlme.c b/drivers/net/wireless/realtek/rtl8852ce/core/rtw_mlme.c index 07ceae31..dc224097 100644 --- a/drivers/net/wireless/realtek/rtl8852ce/core/rtw_mlme.c +++ b/drivers/net/wireless/realtek/rtl8852ce/core/rtw_mlme.c @@ -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 (2) /* 5*(2 second)*/ -#define RTW_ROAM_RSSI_THRESHOLD 45 +#define RTW_ROAM_SCAN_INTERVAL (5) /* 5*(2 second)*/ +#define RTW_ROAM_RSSI_THRESHOLD 30 #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/core/rtw_mlme_ext.c b/drivers/net/wireless/realtek/rtl8852ce/core/rtw_mlme_ext.c index b56e4b5a..ae3b2df3 100644 --- a/drivers/net/wireless/realtek/rtl8852ce/core/rtw_mlme_ext.c +++ b/drivers/net/wireless/realtek/rtl8852ce/core/rtw_mlme_ext.c @@ -7393,18 +7393,17 @@ void _issue_assocreq(_adapter *padapter, u8 is_reassoc) #endif pattrib->last_txcmdsz = pattrib->pktlen; + rtw_buf_update(&padapter->mlmepriv.assoc_req, &padapter->mlmepriv.assoc_req_len, (u8 *)pwlanhdr, pattrib->pktlen); +#ifdef CONFIG_RTW_WNM + if (is_reassoc == _TRUE) + rtw_wnm_update_reassoc_req_ie(padapter); +#endif dump_mgntframe(padapter, pmgntframe); ret = _SUCCESS; exit: - if (ret == _SUCCESS) { - rtw_buf_update(&padapter->mlmepriv.assoc_req, &padapter->mlmepriv.assoc_req_len, (u8 *)pwlanhdr, pattrib->pktlen); - #ifdef CONFIG_RTW_WNM - if (is_reassoc == _TRUE) - rtw_wnm_update_reassoc_req_ie(padapter); - #endif - } else + if (ret == _FAIL) rtw_buf_free(&padapter->mlmepriv.assoc_req, &padapter->mlmepriv.assoc_req_len); return; diff --git a/drivers/net/wireless/realtek/rtl8852ce/core/rtw_scan.c b/drivers/net/wireless/realtek/rtl8852ce/core/rtw_scan.c index 5e5d6e81..298cb060 100644 --- a/drivers/net/wireless/realtek/rtl8852ce/core/rtw_scan.c +++ b/drivers/net/wireless/realtek/rtl8852ce/core/rtw_scan.c @@ -1783,12 +1783,6 @@ u8 _rtw_sitesurvey_condition_check(const char *caller, _adapter *adapter, bool c } #endif /* RTW_BUSY_DENY_SCAN */ - if (adapter_to_pwrctl(adapter)->bInSuspend == _TRUE) { - RTW_INFO("%s bInSuspend scan abort!\n", __func__); - ss_condition = SS_DENY_BLOCK_SCAN; - goto _exit; - } - _exit: return ss_condition; } diff --git a/drivers/net/wireless/realtek/rtl8852ce/core/rtw_tdls.c b/drivers/net/wireless/realtek/rtl8852ce/core/rtw_tdls.c index ed9e1fde..746832ad 100644 --- a/drivers/net/wireless/realtek/rtl8852ce/core/rtw_tdls.c +++ b/drivers/net/wireless/realtek/rtl8852ce/core/rtw_tdls.c @@ -532,14 +532,18 @@ void rtw_tdls_process_ht_cap(_adapter *padapter, struct sta_info *ptdls_sta, PND /* AMPDU Parameters field */ /* Get MIN of MAX AMPDU Length Exp */ - max_AMPDU_len = GET_HT_CAP_ELE_MAX_AMPDU_LEN_EXP(pIE->data); - max_AMPDU_len = rtw_min((pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x3), max_AMPDU_len); - + if ((pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x3) > (*(pIE->data + 2) & 0x3)) + max_AMPDU_len = (*(pIE->data + 2) & 0x3); + else + max_AMPDU_len = (pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x3); /* Get MAX of MIN MPDU Start Spacing */ - min_MPDU_spacing = GET_HT_CAP_ELE_MIN_MPDU_S_SPACE(pIE->data); - min_MPDU_spacing = rtw_max((pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x1c), min_MPDU_spacing); + if ((pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x1c) > (*(pIE->data + 2) & 0x1c)) + min_MPDU_spacing = (pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x1c); + else + min_MPDU_spacing = (*(pIE->data + 2) & 0x1c); ptdls_sta->ampdu_priv.rx_ampdu_min_spacing = max_AMPDU_len | min_MPDU_spacing; + /* Check if sta support s Short GI 20M */ if ((phtpriv->sgi_20m == _TRUE) && (ptdls_sta->htpriv.ht_cap.cap_info & cpu_to_le16(IEEE80211_HT_CAP_SGI_20))) ptdls_sta->htpriv.sgi_20m = _TRUE; diff --git a/drivers/net/wireless/realtek/rtl8852ce/core/rtw_wlan_util.c b/drivers/net/wireless/realtek/rtl8852ce/core/rtw_wlan_util.c index 1661640d..9972c3cf 100644 --- a/drivers/net/wireless/realtek/rtl8852ce/core/rtw_wlan_util.c +++ b/drivers/net/wireless/realtek/rtl8852ce/core/rtw_wlan_util.c @@ -1027,17 +1027,29 @@ void HT_caps_handler(_adapter *padapter, struct _ADAPTER_LINK *padapter_link, pmlmeinfo->HT_caps_enable = 1; - for (i = 0; i < (pIE->Length); i++) - pmlmeinfo->HT_caps.u.HT_cap[i] &= *(pIE->data + i); + for (i = 0; i < (pIE->Length); i++) { + if (i != 2) { + /* Commented by Albert 2010/07/12 */ + /* Got the endian issue here. */ + pmlmeinfo->HT_caps.u.HT_cap[i] &= *(pIE->data + i); + } else { + /* AMPDU Parameters field */ - /* Get MIN of MAX AMPDU Length Exp */ - max_AMPDU_len = GET_HT_CAP_ELE_MAX_AMPDU_LEN_EXP(pIE->data); - max_AMPDU_len = rtw_min((pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x3), max_AMPDU_len); + /* Get MIN of MAX AMPDU Length Exp */ + if ((pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x3) > (*(pIE->data + i) & 0x3)) + max_AMPDU_len = (*(pIE->data + i) & 0x3); + else + max_AMPDU_len = (pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x3); - /* Get MAX of MIN MPDU Start Spacing */ - min_MPDU_spacing = GET_HT_CAP_ELE_MIN_MPDU_S_SPACE(pIE->data); - min_MPDU_spacing = rtw_max((pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x1c), min_MPDU_spacing); - pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para = max_AMPDU_len | min_MPDU_spacing; + /* Get MAX of MIN MPDU Start Spacing */ + if ((pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x1c) > (*(pIE->data + i) & 0x1c)) + min_MPDU_spacing = (pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x1c); + else + min_MPDU_spacing = (*(pIE->data + i) & 0x1c); + + pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para = max_AMPDU_len | min_MPDU_spacing; + } + } /* Commented by Albert 2010/07/12 */ /* Have to handle the endian issue after copying. */ diff --git a/drivers/net/wireless/realtek/rtl8852ce/include/rtw_version.h b/drivers/net/wireless/realtek/rtl8852ce/include/rtw_version.h index c63e51a7..90176369 100644 --- a/drivers/net/wireless/realtek/rtl8852ce/include/rtw_version.h +++ b/drivers/net/wireless/realtek/rtl8852ce/include/rtw_version.h @@ -1 +1 @@ -#define DRIVERVERSION "v1.19.16_nv-126-1-g1b567deb3.20250716_Certified_Module" +#define DRIVERVERSION "v1.19.16_nv-126-10-g6784793e9.20250808_Certified_Module_beta" diff --git a/drivers/net/wireless/realtek/rtl8852ce/os_dep/linux/ioctl_cfg80211.c b/drivers/net/wireless/realtek/rtl8852ce/os_dep/linux/ioctl_cfg80211.c index dd03b12d..e0b13f48 100644 --- a/drivers/net/wireless/realtek/rtl8852ce/os_dep/linux/ioctl_cfg80211.c +++ b/drivers/net/wireless/realtek/rtl8852ce/os_dep/linux/ioctl_cfg80211.c @@ -6841,7 +6841,7 @@ void rtw_cfg80211_external_auth_request(_adapter *padapter, union recv_frame *rf #if (KERNEL_VERSION(4, 17, 0) <= LINUX_VERSION_CODE) \ || defined(CONFIG_KERNEL_PATCH_EXTERNAL_AUTH) - params.action = EXTERNAL_AUTH_START; + params.action = NL80211_EXTERNAL_AUTH_START; _rtw_memcpy(params.bssid, get_my_bssid(&pmlmeinfo->network), ETH_ALEN); params.ssid.ssid_len = pmlmeinfo->network.Ssid.SsidLength; _rtw_memcpy(params.ssid.ssid, pmlmeinfo->network.Ssid.Ssid, diff --git a/drivers/net/wireless/realtek/rtl8852ce/os_dep/linux/pci_intf.c b/drivers/net/wireless/realtek/rtl8852ce/os_dep/linux/pci_intf.c index d78d63d4..bd4dca91 100644 --- a/drivers/net/wireless/realtek/rtl8852ce/os_dep/linux/pci_intf.c +++ b/drivers/net/wireless/realtek/rtl8852ce/os_dep/linux/pci_intf.c @@ -366,24 +366,18 @@ static irqreturn_t rtw_pci_interrupt(int irq, void *priv, struct pt_regs *regs) struct dvobj_priv *dvobj = (struct dvobj_priv *)priv; PPCI_DATA pci_data = dvobj_to_pci(dvobj); enum rtw_phl_status pstatus = RTW_PHL_STATUS_SUCCESS; - unsigned long sp_flags; _adapter *padapter = dvobj_get_primary_adapter(dvobj); padapter->int_logs.all++; - _rtw_spinlock_irq(&dvobj->phl_com->imr_lock, &sp_flags); - if (rtw_phl_recognize_interrupt(dvobj->phl)) { - padapter->int_logs.known++; - pstatus = rtw_phl_interrupt_handler(dvobj->phl); - } - _rtw_spinunlock_irq(&dvobj->phl_com->imr_lock, &sp_flags); - + pstatus = rtw_phl_interrupt_request_handler(dvobj->phl); if (pstatus == RTW_PHL_STATUS_FAILURE) { padapter->int_logs.err++; return IRQ_HANDLED; } - /* return IRQ_NONE; */ + padapter->int_logs.known++; return IRQ_HANDLED; + /* return IRQ_NONE; */ } #if defined(RTK_DMP_PLATFORM) || defined(CONFIG_PLATFORM_RTL8197D) @@ -1028,10 +1022,6 @@ static void rtw_dev_remove(struct pci_dev *pdev) dev_set_surprise_removed(dvobj); } -#ifdef RTW_WKARD_PCI_DEVRM_DIS_INT - rtw_phl_disable_interrupt(GET_PHL_INFO(dvobj)); -#endif - #ifdef CONFIG_CSI_TIMER_POLLING rtw_csi_poll_timer_cancel(dvobj); #endif 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 cd107811..918b129f 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 := $(SOURCETREE)/phl/$(HAL) +phl_path_d1 := $(src)/phl/$(HAL) else phl_path := $(HAL) -phl_path_d1 := $(SOURCETREE)/$(HAL) +phl_path_d1 := $(src)/$(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 073d84e0..8660c88d 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 := $(SOURCETREE)/phl/$(HAL) +phl_path_d1 := $(src)/phl/$(HAL) else phl_path := -phl_path_d1 := $(SOURCETREE)/$(HAL) +phl_path_d1 := $(src)/$(HAL) endif _HAL_FILES := $(phl_path)$(HAL)/hal_api_mac.o \ diff --git a/drivers/net/wireless/realtek/rtl8852ce/phl/hal_g6/hal_api.h b/drivers/net/wireless/realtek/rtl8852ce/phl/hal_g6/hal_api.h index 98203b40..a13edeb0 100644 --- a/drivers/net/wireless/realtek/rtl8852ce/phl/hal_g6/hal_api.h +++ b/drivers/net/wireless/realtek/rtl8852ce/phl/hal_g6/hal_api.h @@ -60,7 +60,7 @@ void rtw_hal_clear_interrupt(void *h); void rtw_hal_restore_interrupt(struct rtw_phl_com_t *phl_com, void *h); u32 rtw_hal_interrupt_handler(void *h); -void rtw_hal_restore_rx_interrupt(void *h); +void rtw_hal_restore_rx_imr_mask(void *h); #ifdef PHL_RXSC_ISR u16 rtw_hal_rpq_isr_check(void *hal, u8 dma_ch); #endif diff --git a/drivers/net/wireless/realtek/rtl8852ce/phl/hal_g6/hal_init.c b/drivers/net/wireless/realtek/rtl8852ce/phl/hal_g6/hal_init.c index 2fc24d32..826edb45 100644 --- a/drivers/net/wireless/realtek/rtl8852ce/phl/hal_g6/hal_init.c +++ b/drivers/net/wireless/realtek/rtl8852ce/phl/hal_g6/hal_init.c @@ -401,7 +401,7 @@ void rtw_hal_restore_interrupt(struct rtw_phl_com_t *phl_com, void *h) hal_ops->restore_interrupt(hal); } -void rtw_hal_restore_rx_interrupt(void *h) +void rtw_hal_restore_rx_imr_mask(void *h) { struct hal_info_t *hal = (struct hal_info_t *)h; struct hal_ops_t *hal_ops = hal_get_ops(hal); diff --git a/drivers/net/wireless/realtek/rtl8852ce/phl/hal_g6/hal_ser.c b/drivers/net/wireless/realtek/rtl8852ce/phl/hal_g6/hal_ser.c index 624c207e..8d65ab10 100644 --- a/drivers/net/wireless/realtek/rtl8852ce/phl/hal_g6/hal_ser.c +++ b/drivers/net/wireless/realtek/rtl8852ce/phl/hal_g6/hal_ser.c @@ -113,9 +113,6 @@ void rtw_hal_ser_int_cfg(void *hal, struct rtw_phl_com_t *phl_com, enum RTW_PHL_SER_CFG_STEP step) { struct hal_info_t *hal_info = (struct hal_info_t *)hal; -#ifdef CONFIG_SYNC_INTERRUPT - struct rtw_phl_evt_ops *evt_ops = &phl_com->evt_ops; -#endif /* CONFIG_SYNC_INTERRUPT */ struct hal_ops_t *hal_ops = hal_get_ops(hal_info); struct hal_spec_t *hal_spec = phl_get_ic_spec(phl_com); @@ -129,13 +126,7 @@ void rtw_hal_ser_int_cfg(void *hal, struct rtw_phl_com_t *phl_com, * 1. disable imr * 2. set imr used during ser */ - #ifdef CONFIG_SYNC_INTERRUPT - evt_ops->set_interrupt_caps(phlcom_to_drvpriv(phl_com), false); - #else - if (hal_ops->disable_interrupt) - hal_ops->disable_interrupt(hal); - #endif /* CONFIG_SYNC_INTERRUPT */ - + rtw_phl_disable_interrupt_sync(phl_com); if (hal_ops->init_int_default_value) hal_ops->init_int_default_value(hal, INT_SET_OPT_SER_START); break; @@ -143,12 +134,7 @@ void rtw_hal_ser_int_cfg(void *hal, struct rtw_phl_com_t *phl_com, /** * 1. enable interrupt */ - #ifdef CONFIG_SYNC_INTERRUPT - evt_ops->set_interrupt_caps(phlcom_to_drvpriv(phl_com), true); - #else - if (hal_ops->enable_interrupt) - hal_ops->enable_interrupt(hal); - #endif /* CONFIG_SYNC_INTERRUPT */ + rtw_phl_enable_interrupt_sync(phl_com); break; case RTW_PHL_SER_M5_CFG: /** @@ -156,22 +142,11 @@ void rtw_hal_ser_int_cfg(void *hal, struct rtw_phl_com_t *phl_com, * 2. set imr used after ser * 3. enable interrupt */ - #ifdef CONFIG_SYNC_INTERRUPT - evt_ops->set_interrupt_caps(phlcom_to_drvpriv(phl_com), false); - #else - if (hal_ops->disable_interrupt) - hal_ops->disable_interrupt(hal); - #endif /* CONFIG_SYNC_INTERRUPT */ - + rtw_phl_disable_interrupt_sync(phl_com); if (hal_ops->init_int_default_value) hal_ops->init_int_default_value(hal, INT_SET_OPT_SER_DONE); - #ifdef CONFIG_SYNC_INTERRUPT - evt_ops->set_interrupt_caps(phlcom_to_drvpriv(phl_com), true); - #else - if (hal_ops->enable_interrupt) - hal_ops->enable_interrupt(hal); - #endif /* CONFIG_SYNC_INTERRUPT */ + rtw_phl_enable_interrupt_sync(phl_com); break; default: PHL_ERR("%s(): unknown step!\n", __func__); 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 ad635a48..6342c487 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 := $(SOURCETREE)/phl/$(HAL) +phl_path_d1 := $(src)/phl/$(HAL) else phl_path := hal_g6 -phl_path_d1 := $(SOURCETREE)/$(HAL) +phl_path_d1 := $(src)/$(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 02785e87..a1273e96 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 := $(SOURCETREE)/phl/$(HAL) +phl_path_d1 := $(src)/phl/$(HAL) else phl_path := $(HAL) -phl_path_d1 := $(SOURCETREE)/$(HAL) +phl_path_d1 := $(src)/$(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 21dd2569..717e176e 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 := $(SOURCETREE)/phl/$(HAL) +phl_path_d1 := $(src)/phl/$(HAL) else phl_path := $(HAL) -phl_path_d1 := $(SOURCETREE)/$(HAL) +phl_path_d1 := $(src)/$(HAL) endif # Base directory diff --git a/drivers/net/wireless/realtek/rtl8852ce/phl/hal_g6/rtl8852c/pci/rtl8852ce_halinit.c b/drivers/net/wireless/realtek/rtl8852ce/phl/hal_g6/rtl8852c/pci/rtl8852ce_halinit.c index 552f50e7..b7b74966 100644 --- a/drivers/net/wireless/realtek/rtl8852ce/phl/hal_g6/rtl8852c/pci/rtl8852ce_halinit.c +++ b/drivers/net/wireless/realtek/rtl8852ce/phl/hal_g6/rtl8852c/pci/rtl8852ce_halinit.c @@ -882,16 +882,6 @@ bool hal_recognize_int_8852ce(struct hal_info_t *hal) struct rtw_hal_com_t *hal_com = hal->hal_com; bool recognized = false; -#ifndef CONFIG_SYNC_INTERRUPT - /** - * We call hal_disable_int_isr_8852ce only instead of hal_disable_int_8852ce - * which will only disable imr of indicator. Otherwise, if we disable imr - * of wlan mac. ISR of indicator will be auto cleared due to imr & isr is '0' - * in wlan mac. - */ - hal_disable_int_isr_8852ce(hal); -#endif /* CONFIG_SYNC_INTERRUPT */ - /* check isr of indicator */ if (hal_com->_intr_ind[0].en) { hal_com->_intr_ind[0].val = hal_read32(hal_com, R_AX_PCIE_HISR00_V1); @@ -902,13 +892,6 @@ bool hal_recognize_int_8852ce(struct hal_info_t *hal) hal_disable_int_rmn_8852ce(hal); } else { /* if isr is not recognized, go to end */ -#if 1 - PHL_WARN("%s: unknown isr\n", __func__); - hal_com->_intr[0].val = 0; - hal_com->_intr[1].val = 0; - hal_com->_intr[2].val = 0; - hal_com->_intr[3].val = 0; -#endif goto end; } @@ -962,13 +945,6 @@ bool hal_recognize_int_8852ce(struct hal_info_t *hal) } end: -#ifndef CONFIG_SYNC_INTERRUPT - /* clear isr */ - hal_clear_int_8852ce(hal); - /* restore imr */ - hal_restore_int_8852ce(hal); -#endif /* CONFIG_SYNC_INTERRUPT */ - /*if (!recognized) HAL_DUMP_INT_8852CE(hal, true, true, true);*/ @@ -995,12 +971,6 @@ static u32 hal_rx_handler_8852ce(struct hal_info_t *hal, u32 *handled) /* disable rx related IMR, rx thread will restore them */ hal_com->_intr[0].mask &= ~rx_handle_irq_imr; hal_com->_intr[3].mask &= ~rx_handle_irq_lps_imr; -#ifndef CONFIG_SYNC_INTERRUPT - if (hal_com->_intr[0].en) - hal_write32(hal_com, R_AX_PCIE_HIMR00, hal_com->_intr[0].mask); - if (hal_com->_intr[3].en) - hal_write32(hal_com, R_AX_HIMR1, hal_com->_intr[3].mask); -#endif /* CONFIG_SYNC_INTERRUPT */ #ifdef PHL_RXSC_ISR hal_com->rx_int_array = handled0; #endif @@ -1037,12 +1007,6 @@ static u32 hal_rp_handler_8852ce(struct hal_info_t *hal, u32 *handled) /* disable rx related IMR, rx thread will restore them */ hal_com->_intr[0].mask &= ~rp_handle_irq_imr; hal_com->_intr[3].mask &= ~rx_handle_irq_lps_imr; -#ifndef CONFIG_SYNC_INTERRUPT - if (hal_com->_intr[0].en) - hal_write32(hal_com, R_AX_PCIE_HIMR00, hal_com->_intr[0].mask); - if (hal_com->_intr[3].en) - hal_write32(hal_com, R_AX_HIMR1, hal_com->_intr[3].mask); -#endif /* CONFIG_SYNC_INTERRUPT */ #ifdef PHL_RXSC_ISR hal_com->rx_int_array = handled0; #endif @@ -1159,25 +1123,10 @@ u32 hal_int_hdler_8852ce(struct hal_info_t *hal) void hal_rx_int_restore_8852ce(struct hal_info_t *hal) { struct rtw_hal_com_t *hal_com = hal->hal_com; -#ifndef CONFIG_SYNC_INTERRUPT - _os_spinlockfg sp_flags; - - _os_spinlock(hal->phl_com->drv_priv, &hal->phl_com->imr_lock, _irq, &sp_flags); -#endif hal_com->_intr[0].mask |= (B_AX_RXDMA_INT_EN | B_AX_RPQDMA_INT_EN | B_AX_RDU_INT_EN | B_AX_RPQBD_FULL_INT_EN); hal_com->_intr[3].mask |= B_AX_GPIO18_INT_EN; -#ifndef CONFIG_SYNC_INTERRUPT - if (hal_com->_intr[0].en) { - hal_write32(hal_com, R_AX_PCIE_HIMR00, hal_com->_intr[0].mask); - } - if (hal_com->_intr[3].en) { - hal_write32(hal_com, R_AX_HIMR1, hal_com->_intr[3].mask); - } - _os_spinunlock(hal->phl_com->drv_priv, &hal->phl_com->imr_lock, _irq, &sp_flags); -#endif /* CONFIG_SYNC_INTERRUPT */ - } enum rtw_hal_status diff --git a/drivers/net/wireless/realtek/rtl8852ce/phl/hci/phl_trx_pcie.c b/drivers/net/wireless/realtek/rtl8852ce/phl/hci/phl_trx_pcie.c index 327fe41d..441eb0ca 100644 --- a/drivers/net/wireless/realtek/rtl8852ce/phl/hci/phl_trx_pcie.c +++ b/drivers/net/wireless/realtek/rtl8852ce/phl/hci/phl_trx_pcie.c @@ -2784,9 +2784,6 @@ static void _phl_rx_callback_pcie(void *context) struct phl_hci_trx_ops *hci_trx_ops = phl_info->hci_trx_ops; void *drvpriv = phl_to_drvpriv(phl_info); bool rx_pause = false; -#ifdef CONFIG_SYNC_INTERRUPT - struct rtw_phl_evt_ops *ops = &phl_info->phl_com->evt_ops; -#endif /* CONFIG_SYNC_INTERRUPT */ FUNCIN_WSTS(pstatus); @@ -2813,10 +2810,8 @@ static void _phl_rx_callback_pcie(void *context) end: /* restore int mask of rx */ - rtw_hal_restore_rx_interrupt(phl_info->hal); -#ifdef CONFIG_SYNC_INTERRUPT - ops->interrupt_restore(phl_to_drvpriv(phl_info), true); -#endif /* CONFIG_SYNC_INTERRUPT */ + rtw_hal_restore_rx_imr_mask(phl_info->hal); + phl_restore_interrupt_sync(phl_info->phl_com, true, true); FUNCOUT_WSTS(pstatus); diff --git a/drivers/net/wireless/realtek/rtl8852ce/phl/phl.mk b/drivers/net/wireless/realtek/rtl8852ce/phl/phl.mk index aa31e68d..20c1368c 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 := $(SOURCETREE)/phl/$(HAL) +phl_path_d1 := $(src)/phl/$(HAL) else phl_path := -phl_path_d1 := $(SOURCETREE)/$(HAL) +phl_path_d1 := $(src)/$(HAL) endif _PHL_FILES := $(phl_path)phl_init.o \ diff --git a/drivers/net/wireless/realtek/rtl8852ce/phl/phl_api.h b/drivers/net/wireless/realtek/rtl8852ce/phl/phl_api.h index 6f0d7475..15ea1b65 100644 --- a/drivers/net/wireless/realtek/rtl8852ce/phl/phl_api.h +++ b/drivers/net/wireless/realtek/rtl8852ce/phl/phl_api.h @@ -39,6 +39,7 @@ void rtw_phl_disable_interrupt(void *phl); bool rtw_phl_recognize_interrupt(void *phl); void rtw_phl_clear_interrupt(void *phl); void rtw_phl_restore_interrupt(void *phl); +enum rtw_phl_status rtw_phl_interrupt_request_handler(void *phl); enum rtw_phl_status rtw_phl_cmd_cfg_hw_seq(void *phl, diff --git a/drivers/net/wireless/realtek/rtl8852ce/phl/phl_api_drv.c b/drivers/net/wireless/realtek/rtl8852ce/phl/phl_api_drv.c index a905295e..5e51bbe7 100644 --- a/drivers/net/wireless/realtek/rtl8852ce/phl/phl_api_drv.c +++ b/drivers/net/wireless/realtek/rtl8852ce/phl/phl_api_drv.c @@ -260,8 +260,20 @@ void rtw_phl_enable_interrupt_sync(struct rtw_phl_com_t* phl_com) evt_ops->set_interrupt_caps(phl_com->drv_priv, true); #else struct phl_info_t *phl_info = (struct phl_info_t *)phl_com->phl_priv; + #if defined(CONFIG_PCI_HCI) + void *drv = phl_to_drvpriv(phl_info); + struct hci_info_t *hci_info = (struct hci_info_t *)phl_info->hci; + _os_spinlockfg sp_flags; + + _os_spinlock(drv, &hci_info->int_hdl_lock, _irq, &sp_flags); + #endif rtw_hal_enable_interrupt(phl_com, phl_info->hal); + + #if defined(CONFIG_PCI_HCI) + hci_info->int_disabled = false; + _os_spinunlock(drv, &hci_info->int_hdl_lock, _irq, &sp_flags); + #endif #endif /* CONFIG_SYNC_INTERRUPT */ } @@ -273,12 +285,22 @@ void rtw_phl_disable_interrupt_sync(struct rtw_phl_com_t* phl_com) evt_ops->set_interrupt_caps(phl_com->drv_priv, false); #else struct phl_info_t *phl_info = (struct phl_info_t *)phl_com->phl_priv; + #if defined(CONFIG_PCI_HCI) + void *drv = phl_to_drvpriv(phl_info); + struct hci_info_t *hci_info = (struct hci_info_t *)phl_info->hci; + _os_spinlockfg sp_flags; + + _os_spinlock(drv, &hci_info->int_hdl_lock, _irq, &sp_flags); + hci_info->int_disabled = true; + #endif rtw_hal_disable_interrupt(phl_com, phl_info->hal); + #if defined(CONFIG_PCI_HCI) + _os_spinunlock(drv, &hci_info->int_hdl_lock, _irq, &sp_flags); + #endif #endif /* CONFIG_SYNC_INTERRUPT */ } - #ifdef CONFIG_PHL_FW_DUMP_EFUSE void rtw_phl_fw_dump_efuse_precfg(struct rtw_phl_com_t* phl_com) { diff --git a/drivers/net/wireless/realtek/rtl8852ce/phl/phl_cmd_dispatcher.c b/drivers/net/wireless/realtek/rtl8852ce/phl/phl_cmd_dispatcher.c index 4bb8a278..9a396c40 100644 --- a/drivers/net/wireless/realtek/rtl8852ce/phl/phl_cmd_dispatcher.c +++ b/drivers/net/wireless/realtek/rtl8852ce/phl/phl_cmd_dispatcher.c @@ -715,8 +715,8 @@ static void push_back_wait_req(struct cmd_dispatcher *obj, { void *d = phl_to_drvpriv(obj->phl_info); - pq_push(d, &(obj->token_req_wait_q), &(req->list), _tail, _bh); SET_STATUS_FLAG(req->status, REQ_STATUS_ENQ); + pq_push(d, &(obj->token_req_wait_q), &(req->list), _tail, _bh); } static void clear_wating_req(struct cmd_dispatcher *obj) 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 22004d5d..33c54617 100644 --- a/drivers/net/wireless/realtek/rtl8852ce/phl/phl_cmd_scan.c +++ b/drivers/net/wireless/realtek/rtl8852ce/phl/phl_cmd_scan.c @@ -343,12 +343,12 @@ next_ch: goto next_ch; } else { - PHL_INFO("%s: scan done\n", __func__); + printk("%s: scan done\n", __func__); return NULL; } param->done_num = param->ch_num - sctrl->chlist.cnt; - PHL_INFO("%s:[%d] idx=%d, r=%d, ch=%d, p=%d\n", __func__, + 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)); diff --git a/drivers/net/wireless/realtek/rtl8852ce/phl/phl_git_info.h b/drivers/net/wireless/realtek/rtl8852ce/phl/phl_git_info.h index 62cb6d5f..43974824 100644 --- a/drivers/net/wireless/realtek/rtl8852ce/phl/phl_git_info.h +++ b/drivers/net/wireless/realtek/rtl8852ce/phl/phl_git_info.h @@ -26,15 +26,15 @@ #define __PHL_GIT_INFO_H__ /*@--------------------------[Define] ---------------------------------------*/ -#define RTK_CORE_SHA1 "1b567deb317b6f9c4afa584602c34212ac1be727" -#define RTK_PHL_SHA1 "cb718610a2b894e972b2c1179b4c24775480605e" +#define RTK_CORE_SHA1 "6784793e97c8520c94a2fb213397e109827325ec" +#define RTK_PHL_SHA1 "981191b0a91d583e48282299b55d86f768f4b98b" #define RTK_HALMAC_SHA1 "a8003e258e7ceec767c2e329732e7e3b63934473" #define RTK_HALBB_SHA1 "8f07cd65ef4ef6867255f3a95706e417c8d31bf3" #define RTK_HALRF_SHA1 "01c1864e02ade0c1d1482c85d6bb0fa0f4799651" #define RTK_BTC_SHA1 "33bcdb9f10f24aa8b92ee86a7076f89faf6ccbed" -#define RTK_CORE_TAGINFO "v1.19.16_nv-126-1-g1b567deb3" -#define RTK_PHL_TAGINFO "PHL_1_19_111_0100-86-gcb718610a" +#define RTK_CORE_TAGINFO "v1.19.16_nv-126-10-g6784793e9" +#define RTK_PHL_TAGINFO "PHL_1_19_111_0100-94-g981191b0a" #define RTK_HALMAC_TAGINFO "HALMAC_0_29_95_0-1-ga8003e258e" #define RTK_HALBB_TAGINFO "HALBB_029_167_15-2-g8f07cd65" #define RTK_HALRF_TAGINFO "HALRF_029_00_161_HOTFIX_001-0-g01c1864e" diff --git a/drivers/net/wireless/realtek/rtl8852ce/phl/phl_headers.h b/drivers/net/wireless/realtek/rtl8852ce/phl/phl_headers.h index c1ce5ac4..0d75b35f 100644 --- a/drivers/net/wireless/realtek/rtl8852ce/phl/phl_headers.h +++ b/drivers/net/wireless/realtek/rtl8852ce/phl/phl_headers.h @@ -150,4 +150,5 @@ #ifdef CONFIG_WIFI_7 #endif +#include "phl_int.h" #endif /*_PHL_HEADERS_H_*/ diff --git a/drivers/net/wireless/realtek/rtl8852ce/phl/phl_init.c b/drivers/net/wireless/realtek/rtl8852ce/phl/phl_init.c index d8f9bb4e..a217ece4 100644 --- a/drivers/net/wireless/realtek/rtl8852ce/phl/phl_init.c +++ b/drivers/net/wireless/realtek/rtl8852ce/phl/phl_init.c @@ -428,6 +428,9 @@ static enum rtw_phl_status phl_hci_init(struct phl_info_t *phl_info, phl_status = RTW_PHL_STATUS_RESOURCE; goto error_hci_mem; } +#ifdef CONFIG_PCI_HCI + _os_spinlock_init(phl_info->phl_com->drv_priv, &phl_info->hci->int_hdl_lock); +#endif #ifdef CONFIG_USB_HCI phl_info->hci->usb_bulkout_size = ic_info->usb_info.usb_bulkout_size; #endif @@ -470,9 +473,13 @@ static void phl_hci_deinit(struct phl_info_t *phl_info, struct hci_info_t *hci) { /* deinit variable or stop mechanism. */ - if (hci) + if (hci) { + #ifdef CONFIG_PCI_HCI + _os_spinlock_free(phl_info->phl_com->drv_priv, &hci->int_hdl_lock); + #endif _os_mem_free(phl_to_drvpriv(phl_info), hci, sizeof(struct hci_info_t)); + } } static enum rtw_phl_status _phl_hci_ops_check(struct phl_info_t *phl_info) @@ -1612,9 +1619,6 @@ enum rtw_phl_status rtw_phl_start(void *phl) struct phl_info_t *phl_info = (struct phl_info_t *)phl; enum rtw_phl_status phl_status = RTW_PHL_STATUS_FAILURE; enum rtw_hal_status hal_status = RTW_HAL_STATUS_SUCCESS; -#ifdef CONFIG_SYNC_INTERRUPT - struct rtw_phl_evt_ops *evt_ops = &phl_info->phl_com->evt_ops; -#endif /* CONFIG_SYNC_INTERRUPT */ #ifdef CONFIG_POWER_SAVE struct rtw_ps_cap_t *ps_cap = _get_ps_sw_cap(phl_info); #endif @@ -1677,11 +1681,8 @@ enum rtw_phl_status rtw_phl_start(void *phl) /* NOT enable interrupt here to avoid system hang during WiFi up move interrupt enable to end of hw_iface init */ #else -#ifdef CONFIG_SYNC_INTERRUPT - evt_ops->set_interrupt_caps(phl_to_drvpriv(phl_info), true); -#else - rtw_hal_enable_interrupt(phl_info->phl_com, phl_info->hal); -#endif /* CONFIG_SYNC_INTERRUPT */ + rtw_phl_enable_interrupt_sync(phl_info->phl_com); + #endif /* RTW_WKARD_98D_INTR_EN_TIMING */ #ifdef CONFIG_POWER_SAVE } @@ -1717,21 +1718,9 @@ error_hal_start: static void _phl_interrupt_stop(struct phl_info_t *phl_info) { -#ifdef CONFIG_SYNC_INTERRUPT - struct rtw_phl_evt_ops *evt_ops = &phl_info->phl_com->evt_ops; - - do { - if (false == TEST_STATUS_FLAG(phl_info->phl_com->dev_state, - RTW_DEV_SURPRISE_REMOVAL)) - evt_ops->set_interrupt_caps(phl_to_drvpriv(phl_info), false); - } while (false); -#else - do { - if (false == TEST_STATUS_FLAG(phl_info->phl_com->dev_state, - RTW_DEV_SURPRISE_REMOVAL)) - rtw_hal_disable_interrupt(phl_info->phl_com, phl_info->hal); - } while (false); -#endif /* CONFIG_SYNC_INTERRUPT */ + if (false == TEST_STATUS_FLAG(phl_info->phl_com->dev_state, + RTW_DEV_SURPRISE_REMOVAL)) + rtw_phl_disable_interrupt_sync(phl_info->phl_com); } static enum rtw_phl_status _phl_cmd_send_msg_phy_on(struct phl_info_t *phl_info) @@ -1809,9 +1798,7 @@ enum rtw_phl_status phl_wow_start(struct phl_info_t *phl_info, struct rtw_phl_st #ifdef CONFIG_WOWLAN enum rtw_phl_status pstatus = RTW_PHL_STATUS_FAILURE; struct phl_wow_info *wow_info = phl_to_wow_info(phl_info); -#ifdef CONFIG_SYNC_INTERRUPT - struct rtw_phl_evt_ops *evt_ops = &phl_info->phl_com->evt_ops; -#endif /* CONFIG_SYNC_INTERRUPT */ + #ifdef DBG_MONITOR_TIME u32 start_t = 0; @@ -1884,11 +1871,7 @@ enum rtw_phl_status phl_wow_start(struct phl_info_t *phl_info, struct rtw_phl_st end: if (RTW_PHL_STATUS_SUCCESS != pstatus) { - #ifdef CONFIG_SYNC_INTERRUPT - evt_ops->set_interrupt_caps(phl_to_drvpriv(phl_info), false); - #else - rtw_hal_disable_interrupt(phl_info->phl_com, phl_info->hal); - #endif /* CONFIG_SYNC_INTERRUPT */ + rtw_phl_disable_interrupt_sync(phl_info->phl_com); phl_role_suspend(phl_info, PHL_ROLE_SUSPEND_RSN_DEV_SUSP); phl_datapath_stop_sw(phl_info, PHL_MDL_PHY_MGNT); phl_datapath_stop_hw(phl_info); @@ -1916,17 +1899,10 @@ end: static void _wow_stop_reinit(struct phl_info_t *phl_info) { enum rtw_phl_status pstatus = RTW_PHL_STATUS_FAILURE; -#ifdef CONFIG_SYNC_INTERRUPT - struct rtw_phl_evt_ops *evt_ops = &phl_info->phl_com->evt_ops; -#endif /* CONFIG_SYNC_INTERRUPT */ PHL_WARN("%s : reset hw!\n", __func__); phl_role_suspend(phl_info, PHL_ROLE_SUSPEND_RSN_DEV_SUSP); - #ifdef CONFIG_SYNC_INTERRUPT - evt_ops->set_interrupt_caps(phl_to_drvpriv(phl_info), false); - #else - rtw_hal_disable_interrupt(phl_info->phl_com, phl_info->hal); - #endif /* CONFIG_SYNC_INTERRUPT */ + rtw_phl_disable_interrupt_sync(phl_info->phl_com); phl_module_stop(phl_info); phl_datapath_stop_sw(phl_info, PHL_MDL_PHY_MGNT); phl_datapath_stop_hw(phl_info); @@ -2039,9 +2015,6 @@ enum rtw_phl_status rtw_phl_rf_on(void *phl) struct phl_info_t *phl_info = (struct phl_info_t *)phl; enum rtw_phl_status phl_status = RTW_PHL_STATUS_FAILURE; enum rtw_hal_status hal_status = RTW_HAL_STATUS_SUCCESS; -#ifdef CONFIG_SYNC_INTERRUPT - struct rtw_phl_evt_ops *evt_ops = &phl_info->phl_com->evt_ops; -#endif /* CONFIG_SYNC_INTERRUPT */ PHL_INFO("%s\n", __func__); @@ -2065,11 +2038,7 @@ enum rtw_phl_status rtw_phl_rf_on(void *phl) phl_datapath_start_hw(phl_info); phl_datapath_start_sw(phl_info, PHL_MDL_POWER_MGNT); -#ifdef CONFIG_SYNC_INTERRUPT - evt_ops->set_interrupt_caps(phl_to_drvpriv(phl_info), true); -#else - rtw_hal_enable_interrupt(phl_info->phl_com, phl_info->hal); -#endif /* CONFIG_SYNC_INTERRUPT */ + rtw_phl_enable_interrupt_sync(phl_info->phl_com); phl_role_recover(phl_info); @@ -2082,19 +2051,11 @@ error_hal_start: enum rtw_phl_status rtw_phl_rf_off(void *phl) { struct phl_info_t *phl_info = (struct phl_info_t *)phl; -#ifdef CONFIG_SYNC_INTERRUPT - struct rtw_phl_evt_ops *evt_ops = &phl_info->phl_com->evt_ops; -#endif /* CONFIG_SYNC_INTERRUPT */ PHL_INFO("%s\n", __func__); phl_role_suspend(phl_info, PHL_ROLE_SUSPEND_RSN_RF_OFF); - -#ifdef CONFIG_SYNC_INTERRUPT - evt_ops->set_interrupt_caps(phl_to_drvpriv(phl_info), false); -#else - rtw_hal_disable_interrupt(phl_info->phl_com, phl_info->hal); -#endif /* CONFIG_SYNC_INTERRUPT */ + rtw_phl_disable_interrupt_sync(phl_info->phl_com); phl_datapath_stop_sw(phl_info, PHL_MDL_POWER_MGNT); phl_datapath_stop_hw(phl_info); @@ -2219,14 +2180,8 @@ enum rtw_phl_status rtw_phl_pnp_stop(void *phl) #ifdef CONFIG_PCI_HCI struct phl_hci_trx_ops *trx_ops = phl_info->hci_trx_ops; #endif -#ifdef CONFIG_SYNC_INTERRUPT - struct rtw_phl_evt_ops *ops = &phl_info->phl_com->evt_ops; - - ops->set_interrupt_caps(phl_to_drvpriv(phl_info), false); -#else - rtw_hal_disable_interrupt(phl_info->phl_com, phl_info->hal); -#endif /* CONFIG_SYNC_INTERRUPT */ + rtw_phl_disable_interrupt_sync(phl_info->phl_com); rtw_hal_cfg_txhci(phl_info->hal, false); rtw_hal_cfg_rxhci(phl_info->hal, false); #ifdef CONFIG_PCI_HCI @@ -2489,6 +2444,7 @@ void rtw_phl_write_rfreg(void *phl, void rtw_phl_restore_interrupt(void *phl) { struct phl_info_t *phl_info = (struct phl_info_t *)phl; + rtw_hal_restore_interrupt(phl_info->phl_com, phl_info->hal); } @@ -2513,9 +2469,6 @@ enum rtw_phl_status rtw_phl_interrupt_handler(void *phl) enum rtw_phl_status phl_status = RTW_PHL_STATUS_SUCCESS; struct phl_info_t *phl_info = (struct phl_info_t *)phl; u32 int_hdler_msk = 0x0; -#ifdef CONFIG_SYNC_INTERRUPT - struct rtw_phl_evt_ops *ops = &phl_info->phl_com->evt_ops; -#endif /* CONFIG_SYNC_INTERRUPT */ struct gtimer_ctx *gt_ctx = (struct gtimer_ctx *)&phl_info->gt3_ctx; u8 skip_tx = 0; @@ -2593,9 +2546,8 @@ enum rtw_phl_status rtw_phl_interrupt_handler(void *phl) end: -#ifdef CONFIG_SYNC_INTERRUPT - ops->interrupt_restore(phl_to_drvpriv(phl_info), false); -#endif + phl_restore_interrupt_sync(phl_info->phl_com, false, false); + return phl_status; } @@ -2631,6 +2583,33 @@ void rtw_phl_clear_interrupt(void *phl) rtw_hal_clear_interrupt(phl_info->hal); } +enum rtw_phl_status rtw_phl_interrupt_request_handler(void *phl) +{ + enum rtw_phl_status psts = RTW_PHL_STATUS_FAILURE; + +#if defined(CONFIG_PCI_HCI) + struct phl_info_t *phl_info = (struct phl_info_t *)phl; + void *drv = phl_to_drvpriv(phl_info); + struct hci_info_t *hci_info = (struct hci_info_t *)phl_info->hci; + _os_spinlockfg sp_flags; + + _os_spinlock(drv, &hci_info->int_hdl_lock, _irq, &sp_flags); + if (hci_info->int_disabled == true) + PHL_ERR("%s int_disabled ...\n", __func__); + + rtw_phl_disable_interrupt_isr(phl_info);/* Disable Layer 1 IMR */ + if (rtw_phl_recognize_interrupt(phl_info)) { + rtw_phl_clear_interrupt(phl_info);/* clear isr when recognized */ + psts = rtw_phl_interrupt_handler(phl_info); + } else { + rtw_phl_restore_interrupt(phl_info); + psts = RTW_PHL_STATUS_SUCCESS; + } + _os_spinunlock(drv, &hci_info->int_hdl_lock, _irq, &sp_flags); +#endif + return psts; +} + enum rtw_phl_status rtw_phl_msg_hub_register_recver(void* phl, struct phl_msg_receiver* ctx, enum phl_msg_recver_layer layer) { diff --git a/drivers/net/wireless/realtek/rtl8852ce/phl/phl_int.h b/drivers/net/wireless/realtek/rtl8852ce/phl/phl_int.h new file mode 100644 index 00000000..ec8ac84e --- /dev/null +++ b/drivers/net/wireless/realtek/rtl8852ce/phl/phl_int.h @@ -0,0 +1,47 @@ +/****************************************************************************** + * + * Copyright(c) 2024 Realtek Corporation. + * + * 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. + * + * This program is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + * + *****************************************************************************/ +#ifndef _PHL_INT_H_ +#define _PHL_INT_H_ + +void rtw_phl_enable_interrupt_sync(struct rtw_phl_com_t* phl_com); +void rtw_phl_disable_interrupt_sync(struct rtw_phl_com_t* phl_com); + +static inline void phl_restore_interrupt_sync(struct rtw_phl_com_t* phl_com, bool wlock, bool rx) +{ +#ifdef CONFIG_SYNC_INTERRUPT + struct rtw_phl_evt_ops *evt_ops = &phl_com->evt_ops; + + evt_ops->interrupt_restore(phl_com->drv_priv, rx); +#else + #if defined(CONFIG_PCI_HCI) + struct phl_info_t *phl_info = (struct phl_info_t *)phl_com->phl_priv; + + if (wlock) { + void *drv = phl_to_drvpriv(phl_info); + struct hci_info_t *hci_info = (struct hci_info_t *)phl_info->hci; + _os_spinlockfg sp_flags; + + _os_spinlock(drv, &hci_info->int_hdl_lock, _irq, &sp_flags); + if (hci_info->int_disabled == false) + rtw_hal_restore_interrupt(phl_com, phl_info->hal); + _os_spinunlock(drv, &hci_info->int_hdl_lock, _irq, &sp_flags); + } else { + rtw_hal_restore_interrupt(phl_com, phl_info->hal); + } + #endif +#endif +} + +#endif /*_PHL_INT_H_*/ diff --git a/drivers/net/wireless/realtek/rtl8852ce/phl/phl_mr.c b/drivers/net/wireless/realtek/rtl8852ce/phl/phl_mr.c index 3a465770..08656b24 100644 --- a/drivers/net/wireless/realtek/rtl8852ce/phl/phl_mr.c +++ b/drivers/net/wireless/realtek/rtl8852ce/phl/phl_mr.c @@ -2951,6 +2951,12 @@ phl_mr_chandef_sync(struct phl_info_t *phl_info, struct hw_band_ctl_t *band_ctrl if (rlink->hw_band == band_ctrl->id) break; } + + if (rlink == NULL) { + PHL_ERR("ridx :%d rlink == NULL\n", ridx); + continue; + } + if (role_num == 0) { band_ret = rlink->chandef.band; ch_ret = rlink->chandef.chan; diff --git a/drivers/net/wireless/realtek/rtl8852ce/phl/phl_ps.c b/drivers/net/wireless/realtek/rtl8852ce/phl/phl_ps.c index 9a8fe3f8..9497370c 100644 --- a/drivers/net/wireless/realtek/rtl8852ce/phl/phl_ps.c +++ b/drivers/net/wireless/realtek/rtl8852ce/phl/phl_ps.c @@ -221,11 +221,7 @@ _ps_ps_cfg_int(struct phl_info_t *phl_info, u8 ps_mode, enum phl_ps_ps_int_cfg_s * 1. disable imr * 2. stop datapath */ - #ifdef CONFIG_SYNC_INTERRUPT - evt_ops->set_interrupt_caps(phlcom_to_drvpriv(phl_info->phl_com), false); - #else - rtw_hal_disable_interrupt(phl_info->phl_com, phl_info->hal); - #endif /* CONFIG_SYNC_INTERRUPT */ + rtw_phl_disable_interrupt_sync(phl_info->phl_com); _phl_ps_ctrl_datapath(phl_info, true); break; @@ -240,22 +236,14 @@ _ps_ps_cfg_int(struct phl_info_t *phl_info, u8 ps_mode, enum phl_ps_ps_int_cfg_s if (ps_mode == PS_MODE_LPS) _phl_ps_ctrl_datapath(phl_info, false); - #ifdef CONFIG_SYNC_INTERRUPT - evt_ops->set_interrupt_caps(phlcom_to_drvpriv(phl_info->phl_com), true); - #else - rtw_hal_enable_interrupt(phl_info->phl_com, phl_info->hal); - #endif /* CONFIG_SYNC_INTERRUPT */ + rtw_phl_enable_interrupt_sync(phl_info->phl_com); break; case PS_LEAVE_CFG_INT_PRE_PHASE: /** * 1. disable imr * 2. stop datapath */ - #ifdef CONFIG_SYNC_INTERRUPT - evt_ops->set_interrupt_caps(phlcom_to_drvpriv(phl_info->phl_com), false); - #else - rtw_hal_disable_interrupt(phl_info->phl_com, phl_info->hal); - #endif /* CONFIG_SYNC_INTERRUPT */ + rtw_phl_disable_interrupt_sync(phl_info->phl_com); if (ps_mode == PS_MODE_LPS) _phl_ps_ctrl_datapath(phl_info, true); @@ -270,11 +258,7 @@ _ps_ps_cfg_int(struct phl_info_t *phl_info, u8 ps_mode, enum phl_ps_ps_int_cfg_s _phl_ps_ctrl_datapath(phl_info, false); - #ifdef CONFIG_SYNC_INTERRUPT - evt_ops->set_interrupt_caps(phlcom_to_drvpriv(phl_info->phl_com), true); - #else - rtw_hal_enable_interrupt(phl_info->phl_com, phl_info->hal); - #endif /* CONFIG_SYNC_INTERRUPT */ + rtw_phl_enable_interrupt_sync(phl_info->phl_com); break; default: PHL_ERR("%s(): unknown step!\n", __func__); diff --git a/drivers/net/wireless/realtek/rtl8852ce/phl/phl_struct.h b/drivers/net/wireless/realtek/rtl8852ce/phl/phl_struct.h index 5538201f..34331c81 100644 --- a/drivers/net/wireless/realtek/rtl8852ce/phl/phl_struct.h +++ b/drivers/net/wireless/realtek/rtl8852ce/phl/phl_struct.h @@ -33,9 +33,12 @@ struct hci_info_t { #endif void *wd_dma_pool; void *h2c_dma_pool; + _os_lock int_hdl_lock; + bool int_disabled; #elif defined(CONFIG_USB_HCI) u16 usb_bulkout_size; bool usb_in_rx_start; + #elif defined(CONFIG_SDIO_HCI) u32 tx_drop_cnt; /* bit31 means overflow or not */ #ifdef SDIO_TX_THREAD @@ -49,7 +52,6 @@ struct hci_info_t { #endif /* CONFIG_PHL_SDIO_TX_CB_THREAD */ #endif /* SDIO_TX_THREAD */ #endif - u8 *wd_ring; u8 *txbuf_pool; u8 *rxbuf_pool; diff --git a/drivers/net/wireless/realtek/rtl8852ce/phl/phl_wow.c b/drivers/net/wireless/realtek/rtl8852ce/phl/phl_wow.c index cae4453e..0695fe8b 100644 --- a/drivers/net/wireless/realtek/rtl8852ce/phl/phl_wow.c +++ b/drivers/net/wireless/realtek/rtl8852ce/phl/phl_wow.c @@ -1216,16 +1216,9 @@ enum rtw_phl_status phl_wow_init_postcfg(struct phl_wow_info *wow_info) struct phl_info_t *phl_info = wow_info->phl_info; struct phl_hci_trx_ops *trx_ops = phl_info->hci_trx_ops; struct rtw_phl_stainfo_t *sta = wow_info->sta; -#ifdef CONFIG_SYNC_INTERRUPT - struct rtw_phl_evt_ops *evt_ops = &phl_info->phl_com->evt_ops; -#endif /* CONFIG_SYNC_INTERRUPT */ /* disable interrupt */ -#ifdef CONFIG_SYNC_INTERRUPT - evt_ops->set_interrupt_caps(phl_to_drvpriv(phl_info), false); -#else - rtw_hal_disable_interrupt(phl_info->phl_com, phl_info->hal); -#endif /* CONFIG_SYNC_INTERRUPT */ + rtw_phl_disable_interrupt_sync(phl_info->phl_com); _wow_stop_datapath(phl_info, PHL_CTRL_RX); @@ -1251,17 +1244,8 @@ enum rtw_phl_status phl_wow_init_postcfg(struct phl_wow_info *wow_info) static void _wow_initialize_interrupt(struct phl_info_t *phl_info) { -#ifdef CONFIG_SYNC_INTERRUPT - struct rtw_phl_evt_ops *evt_ops = &phl_info->phl_com->evt_ops; -#endif /* CONFIG_SYNC_INTERRUPT */ - rtw_hal_init_int_default_value(phl_info->phl_com, phl_info->hal, INT_SET_OPT_HAL_INIT); - -#ifdef CONFIG_SYNC_INTERRUPT - evt_ops->set_interrupt_caps(phlcom_to_drvpriv(phl_info->phl_com), true); -#else - rtw_hal_enable_interrupt(phl_info->phl_com, phl_info->hal); -#endif /* CONFIG_SYNC_INTERRUPT */ + rtw_phl_enable_interrupt_sync(phl_info->phl_com); } enum rtw_phl_status phl_wow_init(struct phl_wow_info *wow_info)