rtw88-usb: bump to latest git HEAD

Fixes: #11331
This commit is contained in:
AmadeusGhost 2023-06-14 23:01:25 +08:00 committed by aiamadeus
parent 8d2d9dd648
commit 9c0329ad5e
4 changed files with 464 additions and 37 deletions

View File

@ -11,10 +11,10 @@ PKG_NAME:=rtw88-usb
PKG_RELEASE:=1 PKG_RELEASE:=1
PKG_SOURCE_PROTO:=git PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2023-02-11 PKG_SOURCE_DATE:=2023-06-28
PKG_SOURCE_URL:=https://github.com/lwfinger/rtw88.git PKG_SOURCE_URL:=https://github.com/lwfinger/rtw88.git
PKG_SOURCE_VERSION:=3af004dd40588e86280f0c58a483de6f53b9803f PKG_SOURCE_VERSION:=7ca1ec0e768f083e4a2116d6978021814b83bb74
PKG_MIRROR_HASH:=13a476c6e46702dee0a3ea2cd743587ab889414be2dce979e652f3bbfa106d76 PKG_MIRROR_HASH:=101e4769c8c25a0b1c186c2b65a1f03b4c600b36fdb20948ef3c82e75e2f6582
PKG_BUILD_PARALLEL:=1 PKG_BUILD_PARALLEL:=1
@ -35,7 +35,7 @@ define KernelPackage/rtw88-usb
HIDDEN:=1 HIDDEN:=1
FILES:= \ FILES:= \
$(PKG_BUILD_DIR)/rtw_core.ko \ $(PKG_BUILD_DIR)/rtw_core.ko \
$(PKG_BUILD_DIR)/rtw88_usb.ko $(PKG_BUILD_DIR)/rtw_usb.ko
endef endef
define KernelPackage/rtl8723du define KernelPackage/rtl8723du
@ -44,8 +44,8 @@ define KernelPackage/rtl8723du
DEPENDS+=+kmod-rtw88-usb +rtl8723du-firmware DEPENDS+=+kmod-rtw88-usb +rtl8723du-firmware
FILES:= \ FILES:= \
$(PKG_BUILD_DIR)/rtw_8723d.ko \ $(PKG_BUILD_DIR)/rtw_8723d.ko \
$(PKG_BUILD_DIR)/rtw88_8723du.ko $(PKG_BUILD_DIR)/rtw_8723du.ko
AUTOLOAD:=$(call AutoProbe,rtw88_8723du) AUTOLOAD:=$(call AutoProbe,rtw_8723du)
endef endef
define KernelPackage/rtl8821cu define KernelPackage/rtl8821cu
@ -54,8 +54,8 @@ define KernelPackage/rtl8821cu
DEPENDS+=+kmod-rtw88-usb +rtl8821ce-firmware DEPENDS+=+kmod-rtw88-usb +rtl8821ce-firmware
FILES:= \ FILES:= \
$(PKG_BUILD_DIR)/rtw_8821c.ko \ $(PKG_BUILD_DIR)/rtw_8821c.ko \
$(PKG_BUILD_DIR)/rtw88_8821cu.ko $(PKG_BUILD_DIR)/rtw_8821cu.ko
AUTOLOAD:=$(call AutoProbe,rtw88_8821cu) AUTOLOAD:=$(call AutoProbe,rtw_8821cu)
endef endef
define KernelPackage/rtl8822bu define KernelPackage/rtl8822bu
@ -64,8 +64,8 @@ define KernelPackage/rtl8822bu
DEPENDS+=+kmod-rtw88-usb +rtl8822be-firmware DEPENDS+=+kmod-rtw88-usb +rtl8822be-firmware
FILES:= \ FILES:= \
$(PKG_BUILD_DIR)/rtw_8822b.ko \ $(PKG_BUILD_DIR)/rtw_8822b.ko \
$(PKG_BUILD_DIR)/rtw88_8822bu.ko $(PKG_BUILD_DIR)/rtw_8822bu.ko
AUTOLOAD:=$(call AutoProbe,rtw88_8822bu) AUTOLOAD:=$(call AutoProbe,rtw_8822bu)
endef endef
define KernelPackage/rtl8822cu define KernelPackage/rtl8822cu
@ -74,8 +74,8 @@ define KernelPackage/rtl8822cu
DEPENDS+=+kmod-rtw88-usb +rtl8822ce-firmware DEPENDS+=+kmod-rtw88-usb +rtl8822ce-firmware
FILES:= \ FILES:= \
$(PKG_BUILD_DIR)/rtw_8822c.ko \ $(PKG_BUILD_DIR)/rtw_8822c.ko \
$(PKG_BUILD_DIR)/rtw88_8822cu.ko $(PKG_BUILD_DIR)/rtw_8822cu.ko
AUTOLOAD:=$(call AutoProbe,rtw88_8822cu) AUTOLOAD:=$(call AutoProbe,rtw_8822cu)
endef endef
NOSTDINC_FLAGS := \ NOSTDINC_FLAGS := \

View File

@ -1,11 +0,0 @@
--- a/mac80211.c
+++ b/mac80211.c
@@ -698,7 +698,7 @@ static void rtw_ops_sw_scan_complete(struct ieee80211_hw *hw,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0)
static void rtw_ops_mgd_prepare_tx(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
- #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0))
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0)) || defined(BUILD_OPENWRT)
struct ieee80211_prep_tx_info *info)
#else
u16 duration)

View File

@ -0,0 +1,432 @@
--- a/bf.c
+++ b/bf.c
@@ -57,7 +57,7 @@ void rtw_bf_assoc(struct rtw_dev *rtwdev, struct ieee80211_vif *vif,
}
ic_vht_cap = &hw->wiphy->bands[NL80211_BAND_5GHZ]->vht_cap;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 19, 0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 19, 0) && !defined(BUILD_OPENWRT)
vht_cap = &sta->vht_cap;
#else
vht_cap = &sta->deflink.vht_cap;
@@ -75,7 +75,7 @@ void rtw_bf_assoc(struct rtw_dev *rtwdev, struct ieee80211_vif *vif,
ether_addr_copy(bfee->mac_addr, bssid);
bfee->role = RTW_BFEE_MU;
bfee->p_aid = (bssid[5] << 1) | (bssid[4] >> 7);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || defined(BUILD_OPENWRT)
bfee->aid = vif->cfg.aid;
#else
bfee->aid = bss_conf->aid;
--- a/fw.c
+++ b/fw.c
@@ -118,7 +118,7 @@ legacy:
si->ra_report.desc_rate = rate;
si->ra_report.bit_rate = bit_rate;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) || defined(BUILD_OPENWRT)
sta->deflink.agg.max_rc_amsdu_len = get_max_amsdu_len(bit_rate);
#else
sta->max_rc_amsdu_len = get_max_amsdu_len(bit_rate);
@@ -652,7 +652,7 @@ void rtw_fw_send_rssi_info(struct rtw_dev *rtwdev, struct rtw_sta_info *si)
rtw_fw_send_h2c_command(rtwdev, h2c_pkt);
}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) || defined(BUILD_OPENWRT)
void rtw_fw_send_ra_info(struct rtw_dev *rtwdev, struct rtw_sta_info *si,
bool reset_ra_mask)
#else
@@ -661,7 +661,7 @@ void rtw_fw_send_ra_info(struct rtw_dev *rtwdev, struct rtw_sta_info *si)
{
u8 h2c_pkt[H2C_PKT_SIZE] = {0};
bool disable_pt = true;
-#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 0)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 18, 0) && !defined(BUILD_OPENWRT)
bool reset_ra_mask = true;
#endif
@@ -1154,7 +1154,7 @@ static struct sk_buff *rtw_get_rsvd_page_skb(struct ieee80211_hw *hw,
switch (rsvd_pkt->type) {
case RSVD_BEACON:
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || defined(BUILD_OPENWRT)
skb_new = ieee80211_beacon_get_tim(hw, vif, &tim_offset, NULL, 0);
#else
skb_new = ieee80211_beacon_get_tim(hw, vif, &tim_offset, NULL);
@@ -1169,7 +1169,7 @@ static struct sk_buff *rtw_get_rsvd_page_skb(struct ieee80211_hw *hw,
break;
case RSVD_NULL:
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 17)
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) || defined(BUILD_OPENWRT)
skb_new = ieee80211_nullfunc_get(hw, vif, -1, false);
#else
skb_new = ieee80211_nullfunc_get(hw, vif, false);
@@ -1180,7 +1180,7 @@ static struct sk_buff *rtw_get_rsvd_page_skb(struct ieee80211_hw *hw,
break;
case RSVD_QOS_NULL:
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 14, 17)
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) || defined(BUILD_OPENWRT)
skb_new = ieee80211_nullfunc_get(hw, vif, -1, true);
#else
skb_new = ieee80211_nullfunc_get(hw, vif, true);
--- a/fw.h
+++ b/fw.h
@@ -831,7 +831,7 @@ void rtw_fw_coex_query_hid_info(struct rtw_dev *rtwdev, u8 sub_id, u8 data);
void rtw_fw_bt_wifi_control(struct rtw_dev *rtwdev, u8 op_code, u8 *data);
void rtw_fw_send_rssi_info(struct rtw_dev *rtwdev, struct rtw_sta_info *si);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) || defined(BUILD_OPENWRT)
void rtw_fw_send_ra_info(struct rtw_dev *rtwdev, struct rtw_sta_info *si,
bool reset_ra_mask);
#else
--- a/mac80211.c
+++ b/mac80211.c
@@ -365,7 +365,7 @@ static void rtw_conf_tx(struct rtw_dev *rtwdev,
static void rtw_ops_bss_info_changed(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct ieee80211_bss_conf *conf,
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || defined(BUILD_OPENWRT)
u64 changed)
#else
u32 changed)
@@ -383,7 +383,7 @@ static void rtw_ops_bss_info_changed(struct ieee80211_hw *hw,
if (changed & BSS_CHANGED_ASSOC) {
rtw_vif_assoc_changed(rtwvif, conf);
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || defined(BUILD_OPENWRT)
if (vif->cfg.assoc) {
#else
if (conf->assoc) {
@@ -393,7 +393,7 @@ static void rtw_ops_bss_info_changed(struct ieee80211_hw *hw,
rtw_fw_download_rsvd_page(rtwdev);
rtw_send_rsvd_page_h2c(rtwdev);
rtw_fw_default_port(rtwdev, rtwvif);
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || defined(BUILD_OPENWRT)
rtw_coex_media_status_notify(rtwdev, vif->cfg.assoc);
#else
rtw_coex_media_status_notify(rtwdev, conf->assoc);
@@ -460,7 +460,7 @@ static void rtw_ops_bss_info_changed(struct ieee80211_hw *hw,
mutex_unlock(&rtwdev->mutex);
}
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || defined(BUILD_OPENWRT)
static int rtw_ops_start_ap(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct ieee80211_bss_conf *link_conf)
@@ -481,7 +481,7 @@ static int rtw_ops_start_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
return 0;
}
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || defined(BUILD_OPENWRT)
static void rtw_ops_stop_ap(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
struct ieee80211_bss_conf *link_conf)
@@ -502,7 +502,7 @@ static void rtw_ops_stop_ap(struct ieee80211_hw *hw,
static int rtw_ops_conf_tx(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || defined(BUILD_OPENWRT)
unsigned int link_id, u16 ac,
#else
u16 ac,
@@ -731,7 +731,7 @@ static void rtw_ops_sw_scan_complete(struct ieee80211_hw *hw,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 18, 0)
static void rtw_ops_mgd_prepare_tx(struct ieee80211_hw *hw,
struct ieee80211_vif *vif,
- #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0))
+ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,14,0)) || defined(BUILD_OPENWRT)
struct ieee80211_prep_tx_info *info)
#else
u16 duration)
--- a/main.c
+++ b/main.c
@@ -192,7 +192,7 @@ static void rtw_vif_watch_dog_iter(void *data, u8 *mac,
struct rtw_vif *rtwvif = (struct rtw_vif *)vif->drv_priv;
if (vif->type == NL80211_IFTYPE_STATION)
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || defined(BUILD_OPENWRT)
if (vif->cfg.assoc)
#else
if (vif->bss_conf.assoc)
@@ -345,7 +345,7 @@ int rtw_sta_add(struct rtw_dev *rtwdev, struct ieee80211_sta *sta,
if (si->mac_id >= RTW_MAX_MAC_ID_NUM)
return -ENOSPC;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || defined(BUILD_OPENWRT)
if (vif->type == NL80211_IFTYPE_STATION && vif->cfg.assoc == 0)
#else
if (vif->type == NL80211_IFTYPE_STATION && vif->bss_conf.assoc == 0)
@@ -574,7 +574,7 @@ EXPORT_SYMBOL(rtw_dump_reg);
void rtw_vif_assoc_changed(struct rtw_vif *rtwvif,
struct ieee80211_bss_conf *conf)
{
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || defined(BUILD_OPENWRT)
struct ieee80211_vif *vif = NULL;
if (conf)
@@ -1002,7 +1002,7 @@ static void rtw_hw_config_rf_ant_num(struct rtw_dev *rtwdev, u8 hw_ant_num)
static u64 get_vht_ra_mask(struct ieee80211_sta *sta)
{
u64 ra_mask = 0;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) || defined(BUILD_OPENWRT)
u16 mcs_map = le16_to_cpu(sta->deflink.vht_cap.vht_mcs.rx_mcs_map);
#else
u16 mcs_map = le16_to_cpu(sta->vht_cap.vht_mcs.rx_mcs_map);
@@ -1226,26 +1226,26 @@ void rtw_update_sta_info(struct rtw_dev *rtwdev, struct rtw_sta_info *si,
bool is_vht_enable = false;
bool is_support_sgi = false;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) || defined(BUILD_OPENWRT)
if (sta->deflink.vht_cap.vht_supported) {
#else
if (sta->vht_cap.vht_supported) {
#endif
is_vht_enable = true;
ra_mask |= get_vht_ra_mask(sta);
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) || defined(BUILD_OPENWRT)
if (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_RXSTBC_MASK)
#else
if (sta->vht_cap.cap & IEEE80211_VHT_CAP_RXSTBC_MASK)
#endif
stbc_en = VHT_STBC_EN;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) || defined(BUILD_OPENWRT)
if (sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_RXLDPC)
#else
if (sta->vht_cap.cap & IEEE80211_VHT_CAP_RXLDPC)
#endif
ldpc_en = VHT_LDPC_EN;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) || defined(BUILD_OPENWRT)
} else if (sta->deflink.ht_cap.ht_supported) {
ra_mask |= (sta->deflink.ht_cap.mcs.rx_mask[1] << 20) |
(sta->deflink.ht_cap.mcs.rx_mask[0] << 12);
@@ -1268,20 +1268,20 @@ void rtw_update_sta_info(struct rtw_dev *rtwdev, struct rtw_sta_info *si,
ra_mask &= RA_MASK_VHT_RATES_1SS | RA_MASK_HT_RATES_1SS;
if (hal->current_band_type == RTW_BAND_5G) {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) || defined(BUILD_OPENWRT)
ra_mask |= (u64)sta->deflink.supp_rates[NL80211_BAND_5GHZ] << 4;
#else
ra_mask |= (u64)sta->supp_rates[NL80211_BAND_5GHZ] << 4;
#endif
ra_mask_bak = ra_mask;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) || defined(BUILD_OPENWRT)
if (sta->deflink.vht_cap.vht_supported) {
#else
if (sta->vht_cap.vht_supported) {
#endif
ra_mask &= RA_MASK_VHT_RATES | RA_MASK_OFDM_IN_VHT;
wireless_set = WIRELESS_OFDM | WIRELESS_VHT;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) || defined(BUILD_OPENWRT)
} else if (sta->deflink.ht_cap.ht_supported) {
#else
} else if (sta->ht_cap.ht_supported) {
@@ -1293,13 +1293,13 @@ void rtw_update_sta_info(struct rtw_dev *rtwdev, struct rtw_sta_info *si,
}
dm_info->rrsr_val_init = RRSR_INIT_5G;
} else if (hal->current_band_type == RTW_BAND_2G) {
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) || defined(BUILD_OPENWRT)
ra_mask |= sta->deflink.supp_rates[NL80211_BAND_2GHZ];
#else
ra_mask |= sta->supp_rates[NL80211_BAND_2GHZ];
#endif
ra_mask_bak = ra_mask;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) || defined(BUILD_OPENWRT)
if (sta->deflink.vht_cap.vht_supported) {
#else
if (sta->vht_cap.vht_supported) {
@@ -1308,7 +1308,7 @@ void rtw_update_sta_info(struct rtw_dev *rtwdev, struct rtw_sta_info *si,
RA_MASK_OFDM_IN_VHT;
wireless_set = WIRELESS_CCK | WIRELESS_OFDM |
WIRELESS_HT | WIRELESS_VHT;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) || defined(BUILD_OPENWRT)
} else if (sta->deflink.ht_cap.ht_supported) {
#else
} else if (sta->ht_cap.ht_supported) {
@@ -1317,7 +1317,7 @@ void rtw_update_sta_info(struct rtw_dev *rtwdev, struct rtw_sta_info *si,
RA_MASK_OFDM_IN_HT_2G;
wireless_set = WIRELESS_CCK | WIRELESS_OFDM |
WIRELESS_HT;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) || defined(BUILD_OPENWRT)
} else if (sta->deflink.supp_rates[0] <= 0xf) {
#else
} else if (sta->supp_rates[0] <= 0xf) {
@@ -1334,14 +1334,14 @@ void rtw_update_sta_info(struct rtw_dev *rtwdev, struct rtw_sta_info *si,
wireless_set = 0;
}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) || defined(BUILD_OPENWRT)
switch (sta->deflink.bandwidth) {
#else
switch (sta->bandwidth) {
#endif
case IEEE80211_STA_RX_BW_80:
bw_mode = RTW_CHANNEL_WIDTH_80;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) || defined(BUILD_OPENWRT)
is_support_sgi = sta->deflink.vht_cap.vht_supported &&
(sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_80);
#else
@@ -1351,7 +1351,7 @@ void rtw_update_sta_info(struct rtw_dev *rtwdev, struct rtw_sta_info *si,
break;
case IEEE80211_STA_RX_BW_40:
bw_mode = RTW_CHANNEL_WIDTH_40;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) || defined(BUILD_OPENWRT)
is_support_sgi = sta->deflink.ht_cap.ht_supported &&
(sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SGI_40);
#else
@@ -1361,7 +1361,7 @@ void rtw_update_sta_info(struct rtw_dev *rtwdev, struct rtw_sta_info *si,
break;
default:
bw_mode = RTW_CHANNEL_WIDTH_20;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) || defined(BUILD_OPENWRT)
is_support_sgi = sta->deflink.ht_cap.ht_supported &&
(sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SGI_20);
#else
@@ -1371,14 +1371,14 @@ void rtw_update_sta_info(struct rtw_dev *rtwdev, struct rtw_sta_info *si,
break;
}
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) || defined(BUILD_OPENWRT)
if (sta->deflink.vht_cap.vht_supported && ra_mask & 0xffc00000) {
#else
if (sta->vht_cap.vht_supported && ra_mask & 0xffc00000) {
#endif
tx_num = 2;
rf_type = RF_2T2R;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) || defined(BUILD_OPENWRT)
} else if (sta->deflink.ht_cap.ht_supported && ra_mask & 0xfff00000) {
#else
} else if (sta->ht_cap.ht_supported && ra_mask & 0xfff00000) {
@@ -1403,7 +1403,7 @@ void rtw_update_sta_info(struct rtw_dev *rtwdev, struct rtw_sta_info *si,
si->ra_mask = ra_mask;
si->rate_id = rate_id;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 18, 0) || defined(BUILD_OPENWRT)
rtw_fw_send_ra_info(rtwdev, si, reset_ra_mask);
#else
rtw_fw_send_ra_info(rtwdev, si);
@@ -1783,7 +1783,7 @@ static void rtw_vif_smps_iter(void *data, u8 *mac,
{
struct rtw_dev *rtwdev = (struct rtw_dev *)data;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || defined(BUILD_OPENWRT)
if (vif->type != NL80211_IFTYPE_STATION || !vif->cfg.assoc)
#else
if (vif->type != NL80211_IFTYPE_STATION || !vif->bss_conf.assoc)
@@ -1791,13 +1791,13 @@ static void rtw_vif_smps_iter(void *data, u8 *mac,
return;
if (rtwdev->hal.txrx_1ss)
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || defined(BUILD_OPENWRT)
ieee80211_request_smps(vif, 0, IEEE80211_SMPS_STATIC);
#else
ieee80211_request_smps(vif, IEEE80211_SMPS_STATIC);
#endif
else
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || defined(BUILD_OPENWRT)
ieee80211_request_smps(vif, 0, IEEE80211_SMPS_OFF);
#else
ieee80211_request_smps(vif, IEEE80211_SMPS_OFF);
@@ -2511,7 +2511,7 @@ static void rtw_check_sta_active_iter(void *data, u8 *mac,
if (vif->type != NL80211_IFTYPE_STATION)
return;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || defined(BUILD_OPENWRT)
if (vif->cfg.assoc || !is_zero_ether_addr(rtwvif->bssid))
#else
if (vif->bss_conf.assoc || !is_zero_ether_addr(rtwvif->bssid))
--- a/ps.c
+++ b/ps.c
@@ -334,7 +334,7 @@ void rtw_recalc_lps(struct rtw_dev *rtwdev, struct ieee80211_vif *new_vif)
__rtw_vif_recalc_lps(&data, new_vif);
rtw_iterate_vifs(rtwdev, rtw_vif_recalc_lps_iter, &data);
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) || defined(BUILD_OPENWRT)
if (data.count == 1 && data.found_vif->cfg.ps) {
rtwdev->ps_enabled = true;
} else {
--- a/tx.c
+++ b/tx.c
@@ -90,7 +90,7 @@ EXPORT_SYMBOL(rtw_tx_fill_tx_desc);
static u8 get_tx_ampdu_factor(struct ieee80211_sta *sta)
{
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) || defined(BUILD_OPENWRT)
u8 exp = sta->deflink.ht_cap.ampdu_factor;
#else
u8 exp = sta->ht_cap.ampdu_factor;
@@ -105,7 +105,7 @@ static u8 get_tx_ampdu_factor(struct ieee80211_sta *sta)
static u8 get_tx_ampdu_density(struct ieee80211_sta *sta)
{
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) || defined(BUILD_OPENWRT)
return sta->deflink.ht_cap.ampdu_density;
#else
return sta->ht_cap.ampdu_density;
@@ -117,7 +117,7 @@ static u8 get_highest_ht_tx_rate(struct rtw_dev *rtwdev,
{
u8 rate;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) || defined(BUILD_OPENWRT)
if (rtwdev->hal.rf_type == RF_2T2R && sta->deflink.ht_cap.mcs.rx_mask[1] != 0)
#else
if (rtwdev->hal.rf_type == RF_2T2R && sta->ht_cap.mcs.rx_mask[1] != 0)
@@ -136,7 +136,7 @@ static u8 get_highest_vht_tx_rate(struct rtw_dev *rtwdev,
u8 rate;
u16 tx_mcs_map;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) || defined(BUILD_OPENWRT)
tx_mcs_map = le16_to_cpu(sta->deflink.vht_cap.vht_mcs.tx_mcs_map);
#else
tx_mcs_map = le16_to_cpu(sta->vht_cap.vht_mcs.tx_mcs_map);
@@ -382,7 +382,7 @@ static void rtw_tx_data_pkt_info_update(struct rtw_dev *rtwdev,
if (info->control.use_rts || skb->len > hw->wiphy->rts_threshold)
pkt_info->rts = true;
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0) || defined(BUILD_OPENWRT)
if (sta->deflink.vht_cap.vht_supported)
rate = get_highest_vht_tx_rate(rtwdev, sta);
else if (sta->deflink.ht_cap.ht_supported)

View File

@ -8,49 +8,55 @@
-EXTRA_CFLAGS += -DCONFIG_RTW88_8821CE=1 -EXTRA_CFLAGS += -DCONFIG_RTW88_8821CE=1
-EXTRA_CFLAGS += -DCONFIG_RTW88_8822CE=1 -EXTRA_CFLAGS += -DCONFIG_RTW88_8822CE=1
-EXTRA_CFLAGS += -DCONFIG_RTW88_8723DE=1 -EXTRA_CFLAGS += -DCONFIG_RTW88_8723DE=1
#EXTRA_CFLAGS += -DCONFIG_RTW88_DEBUG=1 EXTRA_CFLAGS += -DCONFIG_RTW88_DEBUG=1
#EXTRA_CFLAGS += -DCONFIG_RTW88_DEBUGFS=1 EXTRA_CFLAGS += -DCONFIG_RTW88_DEBUGFS=1
#EXTRA_CFLAGS += -DCONFIG_RTW88_REGD_USER_REG_HINTS #EXTRA_CFLAGS += -DCONFIG_RTW88_REGD_USER_REG_HINTS
@@ -54,42 +50,27 @@ rtw_core-objs += main.o \ @@ -54,9 +50,6 @@ rtw_core-objs += main.o \
obj-m += rtw_8822b.o obj-m += rtw_8822b.o
rtw_8822b-objs := rtw8822b.o rtw8822b_table.o rtw_8822b-objs := rtw8822b.o rtw8822b_table.o
-obj-m += rtw_8822be.o -obj-m += rtw_8822be.o
-rtw_8822be-objs := rtw8822be.o -rtw_8822be-objs := rtw8822be.o
- -
obj-m += rtw88_8822bu.o obj-m += rtw_8822bu.o
rtw88_8822bu-objs := rtw8822bu.o rtw_8822bu-objs := rtw8822bu.o
@@ -66,9 +59,6 @@ rtw_8822bs-objs := rtw8822bs.o
obj-m += rtw_8822c.o obj-m += rtw_8822c.o
rtw_8822c-objs := rtw8822c.o rtw8822c_table.o rtw_8822c-objs := rtw8822c.o rtw8822c_table.o
-obj-m += rtw_8822ce.o -obj-m += rtw_8822ce.o
-rtw_8822ce-objs := rtw8822ce.o -rtw_8822ce-objs := rtw8822ce.o
- -
obj-m += rtw88_8822cu.o obj-m += rtw_8822cu.o
rtw88_8822cu-objs := rtw8822cu.o rtw_8822cu-objs := rtw8822cu.o
@@ -78,9 +68,6 @@ rtw_8822cs-objs := rtw8822cs.o
obj-m += rtw_8723d.o obj-m += rtw_8723d.o
rtw_8723d-objs := rtw8723d.o rtw8723d_table.o rtw_8723d-objs := rtw8723d.o rtw8723d_table.o
-obj-m += rtw_8723de.o -obj-m += rtw_8723de.o
-rtw_8723de-objs := rtw8723de.o -rtw_8723de-objs := rtw8723de.o
- -
obj-m += rtw88_8723du.o obj-m += rtw_8723du.o
rtw88_8723du-objs := rtw8723du.o rtw_8723du-objs := rtw8723du.o
@@ -90,18 +77,12 @@ rtw_8723ds-objs := rtw8723ds.o
obj-m += rtw_8821c.o obj-m += rtw_8821c.o
rtw_8821c-objs := rtw8821c.o rtw8821c_table.o rtw_8821c-objs := rtw8821c.o rtw8821c_table.o
-obj-m += rtw_8821ce.o -obj-m += rtw_8821ce.o
-rtw_8821ce-objs := rtw8821ce.o -rtw_8821ce-objs := rtw8821ce.o
- -
obj-m += rtw88_8821cu.o obj-m += rtw_8821cs.o
rtw88_8821cu-objs := rtw8821cu.o rtw_8821cs-objs := rtw8821cs.o
obj-m += rtw_8821cu.o
rtw_8821cu-objs := rtw8821cu.o
-obj-m += rtw_pci.o -obj-m += rtw_pci.o
-rtw_pci-objs := pci.o -rtw_pci-objs := pci.o
- -
obj-m += rtw_usb.o obj-m += rtw_sdio.o
rtw_usb-objs := usb.o rtw_sdio-objs := sdio.o