fix realtek-8723cs for 5.11.y

This commit is contained in:
Martin Ayotte 2021-03-01 18:05:12 -05:00
parent 10cb4b25d2
commit 61ba606f4a

View File

@ -34739,7 +34739,7 @@ new file mode 100644
index 00000000..42137a6a
--- /dev/null
+++ b/drivers/net/wireless/realtek/rtl8723cs/core/rtw_mlme_ext.c
@@ -0,0 +1,15415 @@
@@ -0,0 +1,15417 @@
+/******************************************************************************
+ *
+ * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved.
@ -49869,7 +49869,9 @@ index 00000000..42137a6a
+ 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;
@ -303483,8 +303485,8 @@ index 00000000..aea63652
+ 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__ */
+
@ -314877,8 +314879,6 @@ index 00000000..4b44a788
+ rtw_cfg80211_init_ht_capab(padapter, &bands->ht_cap, NL80211_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);
@ -315112,6 +315112,8 @@ index 00000000..4b44a788
+ *((_adapter**)wiphy_priv(wiphy)) = padapter;
+
+ rtw_cfg80211_preinit_wiphy(padapter, wiphy);
+ /* init regulary domain */
+ rtw_regd_init(wiphy);
+
+ DBG_871X(FUNC_WIPHY_FMT"\n", FUNC_WIPHY_ARG(wiphy));
+
@ -344602,7 +344604,7 @@ new file mode 100644
index 00000000..838f982c
--- /dev/null
+++ b/drivers/net/wireless/realtek/rtl8723cs/os_dep/linux/wifi_regd.c
@@ -0,0 +1,548 @@
@@ -0,0 +1,529 @@
+/******************************************************************************
+ *
+ * Copyright(c) 2009-2010 Realtek Corporation.
@ -345081,12 +345083,12 @@ index 00000000..838f982c
+ #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);
+ }
+}
+
@ -345126,28 +345128,9 @@ index 00000000..838f982c
+ 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
+