mirror of
https://github.com/Fishwaldo/build.git
synced 2025-07-23 13:29:33 +00:00
fix rtl8189xx for 5.11.y
This commit is contained in:
parent
5aa3b19ee1
commit
bba53d4644
1 changed files with 202 additions and 0 deletions
202
patch/kernel/sunxi-dev/fix-rtl8189es-rtl8189fs-for-5.11.patch
Normal file
202
patch/kernel/sunxi-dev/fix-rtl8189es-rtl8189fs-for-5.11.patch
Normal file
|
@ -0,0 +1,202 @@
|
|||
diff --git a/drivers/net/wireless/rtl8189fs/core/rtw_mlme_ext.c b/drivers/net/wireless/rtl8189fs/core/rtw_mlme_ext.c
|
||||
index 3c13f6d..91399c9 100644
|
||||
--- a/drivers/net/wireless/rtl8189fs/core/rtw_mlme_ext.c
|
||||
+++ b/drivers/net/wireless/rtl8189fs/core/rtw_mlme_ext.c
|
||||
@@ -15168,7 +15168,9 @@ u8 set_chplan_hdl(_adapter *padapter, unsigned char *pbuf)
|
||||
rtw_hal_set_odm_var(padapter,HAL_ODM_REGULATION,NULL,_TRUE);
|
||||
|
||||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
- rtw_reg_notify_by_driver(padapter);
|
||||
+ if (padapter->rtw_wdev != NULL) {
|
||||
+ rtw_reg_notify_by_driver(padapter->rtw_wdev->wiphy);
|
||||
+ }
|
||||
#endif //CONFIG_IOCTL_CFG80211
|
||||
|
||||
return H2C_SUCCESS;
|
||||
diff --git a/drivers/net/wireless/rtl8189fs/include/rtw_wifi_regd.h b/drivers/net/wireless/rtl8189fs/include/rtw_wifi_regd.h
|
||||
index 185dd47..0c51ede 100644
|
||||
--- a/drivers/net/wireless/rtl8189fs/include/rtw_wifi_regd.h
|
||||
+++ b/drivers/net/wireless/rtl8189fs/include/rtw_wifi_regd.h
|
||||
@@ -27,8 +27,8 @@ enum country_code_type_t {
|
||||
COUNTRY_CODE_MAX
|
||||
};
|
||||
|
||||
-int rtw_regd_init(_adapter *padapter);
|
||||
-void rtw_reg_notify_by_driver(_adapter *adapter);
|
||||
+void rtw_regd_init(struct wiphy *wiphy);
|
||||
+void rtw_reg_notify_by_driver(struct wiphy *wiphy);
|
||||
|
||||
#endif /* __RTW_WIFI_REGD_H__ */
|
||||
|
||||
diff --git a/drivers/net/wireless/rtl8189fs/os_dep/linux/ioctl_cfg80211.c b/drivers/net/wireless/rtl8189fs/os_dep/linux/ioctl_cfg80211.c
|
||||
index 809688b..14abfeb 100644
|
||||
--- a/drivers/net/wireless/rtl8189fs/os_dep/linux/ioctl_cfg80211.c
|
||||
+++ b/drivers/net/wireless/rtl8189fs/os_dep/linux/ioctl_cfg80211.c
|
||||
@@ -6467,8 +6467,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);
|
||||
@@ -6805,6 +6803,9 @@ struct wiphy *rtw_wiphy_alloc(_adapter *padapter, struct device *dev)
|
||||
|
||||
rtw_cfg80211_preinit_wiphy(padapter, wiphy);
|
||||
|
||||
+ /* init regulary domain */
|
||||
+ rtw_regd_init(wiphy);
|
||||
+
|
||||
DBG_871X(FUNC_WIPHY_FMT"\n", FUNC_WIPHY_ARG(wiphy));
|
||||
|
||||
exit:
|
||||
diff --git a/drivers/net/wireless/rtl8189fs/os_dep/linux/wifi_regd.c b/drivers/net/wireless/rtl8189fs/os_dep/linux/wifi_regd.c
|
||||
index 1adcfe6..bfe5afd 100644
|
||||
--- a/drivers/net/wireless/rtl8189fs/os_dep/linux/wifi_regd.c
|
||||
+++ b/drivers/net/wireless/rtl8189fs/os_dep/linux/wifi_regd.c
|
||||
@@ -477,12 +477,12 @@ void rtw_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request)
|
||||
#endif
|
||||
}
|
||||
|
||||
-void rtw_reg_notify_by_driver(_adapter *adapter)
|
||||
+void rtw_reg_notify_by_driver(struct wiphy *wiphy)
|
||||
{
|
||||
- if ((adapter->rtw_wdev != NULL) && (adapter->rtw_wdev->wiphy)) {
|
||||
+ if (wiphy) {
|
||||
struct regulatory_request request;
|
||||
request.initiator = NL80211_REGDOM_SET_BY_DRIVER;
|
||||
- rtw_reg_notifier(adapter->rtw_wdev->wiphy, &request);
|
||||
+ rtw_reg_notifier(wiphy, &request);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -522,28 +522,9 @@ static struct country_code_to_enum_rd *_rtw_regd_find_country(u16 countrycode)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
-int rtw_regd_init(_adapter * padapter)
|
||||
+void rtw_regd_init(struct wiphy *wiphy)
|
||||
{
|
||||
- struct wiphy *wiphy = padapter->rtw_wdev->wiphy;
|
||||
-
|
||||
-#if 0
|
||||
- if (rtw_regd == NULL) {
|
||||
- rtw_regd = (struct rtw_regulatory *)
|
||||
- rtw_malloc(sizeof(struct rtw_regulatory));
|
||||
-
|
||||
- rtw_regd->alpha2[0] = '9';
|
||||
- rtw_regd->alpha2[1] = '9';
|
||||
-
|
||||
- rtw_regd->country_code = COUNTRY_CODE_USER;
|
||||
- }
|
||||
-
|
||||
- DBG_8192C("%s: Country alpha2 being used: %c%c\n",
|
||||
- __func__, rtw_regd->alpha2[0], rtw_regd->alpha2[1]);
|
||||
-#endif
|
||||
-
|
||||
_rtw_regd_init_wiphy(NULL, wiphy);
|
||||
-
|
||||
- return 0;
|
||||
}
|
||||
#endif //CONFIG_IOCTL_CFG80211
|
||||
|
||||
diff --git a/drivers/net/wireless/rtl8189es/core/rtw_mlme_ext.c b/drivers/net/wireless/rtl8189es/core/rtw_mlme_ext.c
|
||||
index 7d5662e..9233c9c 100755
|
||||
--- a/drivers/net/wireless/rtl8189es/core/rtw_mlme_ext.c
|
||||
+++ b/drivers/net/wireless/rtl8189es/core/rtw_mlme_ext.c
|
||||
@@ -15094,7 +15094,9 @@ u8 set_chplan_hdl(_adapter *padapter, unsigned char *pbuf)
|
||||
rtw_hal_set_odm_var(padapter,HAL_ODM_REGULATION,NULL,_TRUE);
|
||||
|
||||
#ifdef CONFIG_IOCTL_CFG80211
|
||||
- rtw_reg_notify_by_driver(padapter);
|
||||
+ if (padapter->rtw_wdev != NULL) {
|
||||
+ rtw_reg_notify_by_driver(padapter->rtw_wdev->wiphy);
|
||||
+ }
|
||||
#endif //CONFIG_IOCTL_CFG80211
|
||||
|
||||
return H2C_SUCCESS;
|
||||
diff --git a/drivers/net/wireless/rtl8189es/include/rtw_wifi_regd.h b/drivers/net/wireless/rtl8189es/include/rtw_wifi_regd.h
|
||||
index 0a67614..d2bf1de 100644
|
||||
--- a/drivers/net/wireless/rtl8189es/include/rtw_wifi_regd.h
|
||||
+++ b/drivers/net/wireless/rtl8189es/include/rtw_wifi_regd.h
|
||||
@@ -26,8 +26,8 @@ enum country_code_type_t {
|
||||
COUNTRY_CODE_MAX
|
||||
};
|
||||
|
||||
-int rtw_regd_init(_adapter *padapter);
|
||||
-void rtw_reg_notify_by_driver(_adapter *adapter);
|
||||
+int rtw_regd_init();
|
||||
+void rtw_reg_notify_by_driver(struct wiphy *wiphy);
|
||||
|
||||
#endif /* __RTW_WIFI_REGD_H__ */
|
||||
|
||||
diff --git a/drivers/net/wireless/rtl8189es/os_dep/linux/ioctl_cfg80211.c b/drivers/net/wireless/rtl8189es/os_dep/linux/ioctl_cfg80211.c
|
||||
index 82db199..0fc6fbd 100644
|
||||
--- a/drivers/net/wireless/rtl8189es/os_dep/linux/ioctl_cfg80211.c
|
||||
+++ b/drivers/net/wireless/rtl8189es/os_dep/linux/ioctl_cfg80211.c
|
||||
@@ -6314,8 +6314,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);
|
||||
@@ -6545,6 +6543,9 @@ struct wiphy *rtw_wiphy_alloc(_adapter *padapter, struct device *dev)
|
||||
|
||||
rtw_cfg80211_preinit_wiphy(padapter, wiphy);
|
||||
|
||||
+ /* init regulary domain */
|
||||
+ rtw_regd_init(wiphy);
|
||||
+
|
||||
DBG_871X(FUNC_WIPHY_FMT"\n", FUNC_WIPHY_ARG(wiphy));
|
||||
|
||||
exit:
|
||||
diff --git a/drivers/net/wireless/rtl8189es/os_dep/linux/wifi_regd.c b/drivers/net/wireless/rtl8189es/os_dep/linux/wifi_regd.c
|
||||
index 154a28f..0be580c 100644
|
||||
--- a/drivers/net/wireless/rtl8189es/os_dep/linux/wifi_regd.c
|
||||
+++ b/drivers/net/wireless/rtl8189es/os_dep/linux/wifi_regd.c
|
||||
@@ -476,9 +476,9 @@ void rtw_reg_notifier(struct wiphy *wiphy, struct regulatory_request *request)
|
||||
#endif
|
||||
}
|
||||
|
||||
-void rtw_reg_notify_by_driver(_adapter *adapter)
|
||||
+void rtw_reg_notify_by_driver(struct wiphy *wiphy)
|
||||
{
|
||||
- if ((adapter->rtw_wdev != NULL) && (adapter->rtw_wdev->wiphy)) {
|
||||
+ if (wiphy) {
|
||||
struct regulatory_request request;
|
||||
request.initiator = NL80211_REGDOM_SET_BY_DRIVER;
|
||||
rtw_reg_notifier(adapter->rtw_wdev->wiphy, &request);
|
||||
@@ -521,28 +521,9 @@ static struct country_code_to_enum_rd *_rtw_regd_find_country(u16 countrycode)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
-int rtw_regd_init(_adapter * padapter)
|
||||
+void rtw_regd_init(struct wiphy *wiphy)
|
||||
{
|
||||
- struct wiphy *wiphy = padapter->rtw_wdev->wiphy;
|
||||
-
|
||||
-#if 0
|
||||
- if (rtw_regd == NULL) {
|
||||
- rtw_regd = (struct rtw_regulatory *)
|
||||
- rtw_malloc(sizeof(struct rtw_regulatory));
|
||||
-
|
||||
- rtw_regd->alpha2[0] = '9';
|
||||
- rtw_regd->alpha2[1] = '9';
|
||||
-
|
||||
- rtw_regd->country_code = COUNTRY_CODE_USER;
|
||||
- }
|
||||
-
|
||||
- DBG_8192C("%s: Country alpha2 being used: %c%c\n",
|
||||
- __func__, rtw_regd->alpha2[0], rtw_regd->alpha2[1]);
|
||||
-#endif
|
||||
-
|
||||
_rtw_regd_init_wiphy(NULL, wiphy);
|
||||
-
|
||||
- return 0;
|
||||
}
|
||||
#endif //CONFIG_IOCTL_CFG80211
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue