diff --git a/Makefile b/Makefile index 087734f..6c07ef9 100644 --- a/Makefile +++ b/Makefile @@ -72,7 +72,7 @@ CONFIG_APPEND_VENDOR_IE_ENABLE = n CONFIG_RTW_NAPI = y CONFIG_RTW_GRO = y ########################## Debug ########################### -CONFIG_RTW_DEBUG = y +CONFIG_RTW_DEBUG = n # default log level is _DRV_INFO_ = 2, # please refer to "How_to_set_driver_debug_log_level.doc" to set the available level. CONFIG_RTW_LOG_LEVEL = 2 diff --git a/include/rtw_wifi_regd.h b/include/rtw_wifi_regd.h index 9ac7329..f8c160d 100644 --- a/include/rtw_wifi_regd.h +++ b/include/rtw_wifi_regd.h @@ -26,7 +26,7 @@ enum country_code_type_t { COUNTRY_CODE_MAX }; -int rtw_regd_init(_adapter *padapter); +int rtw_regd_init(struct wiphy *wiphy); void rtw_reg_notify_by_driver(_adapter *adapter); #endif /* __RTW_WIFI_REGD_H__ */ diff --git a/os_dep/linux/ioctl_cfg80211.c b/os_dep/linux/ioctl_cfg80211.c index fd6345b..86bb2a2 100644 --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c @@ -6630,9 +6630,6 @@ void rtw_cfg80211_init_wiphy(_adapter *padapter) rtw_cfg80211_init_ht_capab(padapter, &bands->ht_cap, IEEE80211_BAND_5GHZ, rf_type); } #endif - /* init regulary domain */ - rtw_regd_init(padapter); - /* copy mac_addr to wiphy */ _rtw_memcpy(wiphy->perm_addr, adapter_mac_addr(padapter), ETH_ALEN); @@ -6934,6 +6931,9 @@ int rtw_wiphy_register(struct wiphy *wiphy) rtw_cfgvendor_attach(wiphy); #endif + /* init regulary domain */ + rtw_regd_init(wiphy); + return wiphy_register(wiphy); } diff --git a/os_dep/linux/recv_linux.c b/os_dep/linux/recv_linux.c index 2902fab..07565ed 100644 --- a/os_dep/linux/recv_linux.c +++ b/os_dep/linux/recv_linux.c @@ -359,7 +359,11 @@ static int napi_recv(_adapter *padapter, int budget) #ifdef CONFIG_RTW_GRO if (pregistrypriv->en_gro) { +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 12, 0)) + if (rtw_napi_gro_receive(&padapter->napi, pskb) != GRO_MERGED_FREE) +#else if (rtw_napi_gro_receive(&padapter->napi, pskb) != GRO_DROP) +#endif rx_ok = _TRUE; goto next; } diff --git a/os_dep/linux/wifi_regd.c b/os_dep/linux/wifi_regd.c index fc58d76..d419e2d 100644 --- a/os_dep/linux/wifi_regd.c +++ b/os_dep/linux/wifi_regd.c @@ -519,9 +519,8 @@ static struct country_code_to_enum_rd *_rtw_regd_find_country(u16 countrycode) return NULL; } -int rtw_regd_init(_adapter *padapter) +int rtw_regd_init(struct wiphy *wiphy) { - struct wiphy *wiphy = padapter->rtw_wdev->wiphy; #if 0 if (rtw_regd == NULL) { diff --git a/os_dep/osdep_service.c b/os_dep/osdep_service.c index d98de2f..a65e6f9 100644 --- a/os_dep/osdep_service.c +++ b/os_dep/osdep_service.c @@ -1282,15 +1282,19 @@ static int isFileReadable(const char *path, u32 *sz) { struct file *fp; int ret = 0; +#ifdef set_fs mm_segment_t oldfs; +#endif char buf; fp = filp_open(path, O_RDONLY, 0); if (IS_ERR(fp)) ret = PTR_ERR(fp); else { +#ifdef set_fs oldfs = get_fs(); set_fs(KERNEL_DS); +#endif if (1 != readFile(fp, &buf, 1)) ret = PTR_ERR(fp); @@ -1303,7 +1307,9 @@ static int isFileReadable(const char *path, u32 *sz) #endif } +#ifdef set_fs set_fs(oldfs); +#endif filp_close(fp, NULL); } return ret; @@ -1319,7 +1325,9 @@ static int isFileReadable(const char *path, u32 *sz) static int retriveFromFile(const char *path, u8 *buf, u32 sz) { int ret = -1; +#ifdef set_fs mm_segment_t oldfs; +#endif struct file *fp; if (path && buf) { @@ -1327,10 +1335,14 @@ static int retriveFromFile(const char *path, u8 *buf, u32 sz) if (0 == ret) { RTW_INFO("%s openFile path:%s fp=%p\n", __FUNCTION__, path , fp); +#ifdef set_fs oldfs = get_fs(); set_fs(KERNEL_DS); +#endif ret = readFile(fp, buf, sz); +#ifdef set_fs set_fs(oldfs); +#endif closeFile(fp); RTW_INFO("%s readFile, ret:%d\n", __FUNCTION__, ret); @@ -1354,7 +1366,9 @@ static int retriveFromFile(const char *path, u8 *buf, u32 sz) static int storeToFile(const char *path, u8 *buf, u32 sz) { int ret = 0; +#ifdef set_fs mm_segment_t oldfs; +#endif struct file *fp; if (path && buf) { @@ -1362,10 +1376,14 @@ static int storeToFile(const char *path, u8 *buf, u32 sz) if (0 == ret) { RTW_INFO("%s openFile path:%s fp=%p\n", __FUNCTION__, path , fp); +#ifdef set_fs oldfs = get_fs(); set_fs(KERNEL_DS); +#endif ret = writeFile(fp, buf, sz); +#ifdef set_fs set_fs(oldfs); +#endif closeFile(fp); RTW_INFO("%s writeFile, ret:%d\n", __FUNCTION__, ret);