mirror of
https://github.com/coolsnowwolf/lede.git
synced 2025-04-16 04:13:31 +00:00
433 lines
18 KiB
Diff
433 lines
18 KiB
Diff
--- 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
|
|
@@ -191,7 +191,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);
|
|
@@ -726,7 +726,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
|
|
@@ -735,7 +735,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
|
|
|
|
@@ -1228,7 +1228,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);
|
|
@@ -1243,7 +1243,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);
|
|
@@ -1254,7 +1254,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
|
|
@@ -834,7 +834,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
|
|
@@ -191,7 +191,7 @@ static void rtw_vif_watch_dog_iter(void *data, struct ieee80211_vif *vif)
|
|
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)
|
|
@@ -343,7 +343,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)
|
|
@@ -572,7 +572,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)
|
|
@@ -1000,7 +1000,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);
|
|
@@ -1224,26 +1224,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);
|
|
@@ -1266,20 +1266,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) {
|
|
@@ -1291,13 +1291,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) {
|
|
@@ -1306,7 +1306,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) {
|
|
@@ -1315,7 +1315,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) {
|
|
@@ -1332,14 +1332,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
|
|
@@ -1349,7 +1349,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
|
|
@@ -1359,7 +1359,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
|
|
@@ -1369,14 +1369,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) {
|
|
@@ -1400,7 +1400,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);
|
|
@@ -1780,7 +1780,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)
|
|
@@ -1788,13 +1788,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);
|
|
@@ -2516,7 +2516,7 @@ static void rtw_check_sta_active_iter(void *data, struct ieee80211_vif *vif)
|
|
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)
|