Skip to content

Commit

Permalink
Rebase against 5.19.11
Browse files Browse the repository at this point in the history
  • Loading branch information
FreedomBen committed Sep 27, 2022
1 parent 80df7b3 commit 9a38a75
Show file tree
Hide file tree
Showing 23 changed files with 196 additions and 205 deletions.
44 changes: 22 additions & 22 deletions base.c
Original file line number Diff line number Diff line change
Expand Up @@ -629,11 +629,12 @@ static void _rtl_query_shortgi( struct ieee80211_hw *hw,
if ( sta == NULL )
return;

sgi_40 = sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40;
sgi_20 = sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_20;
sgi_80 = sta->vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_80;
sgi_40 = sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SGI_40;
sgi_20 = sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SGI_20;
sgi_80 = sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_80;

if ( ( !sta->ht_cap.ht_supported ) && ( !sta->vht_cap.vht_supported ) )
if ( !sta->deflink.ht_cap.ht_supported &&
!sta->deflink.vht_cap.vht_supported )
return;

if ( !sgi_40 && !sgi_20 )
Expand All @@ -645,8 +646,8 @@ static void _rtl_query_shortgi( struct ieee80211_hw *hw,
} else if ( mac->opmode == NL80211_IFTYPE_AP ||
mac->opmode == NL80211_IFTYPE_ADHOC ||
mac->opmode == NL80211_IFTYPE_MESH_POINT ) {
bw_40 = sta->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40;
bw_80 = sta->vht_cap.vht_supported;
bw_40 = sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40;
bw_80 = sta->deflink.vht_cap.vht_supported;
}

if ( bw_80 ) {
Expand Down Expand Up @@ -864,11 +865,11 @@ static void _rtl_query_bandwidth_mode( struct ieee80211_hw *hw,
if ( mac->opmode == NL80211_IFTYPE_AP ||
mac->opmode == NL80211_IFTYPE_ADHOC ||
mac->opmode == NL80211_IFTYPE_MESH_POINT ) {
if ( !( sta->ht_cap.ht_supported ) ||
!( sta->ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40 ) )
if ( !( sta->deflink.ht_cap.ht_supported ) ||
!( sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SUP_WIDTH_20_40 ) )
return;
} else if ( mac->opmode == NL80211_IFTYPE_STATION ) {
if ( !mac->bw_40 || !( sta->ht_cap.ht_supported ) )
if ( !mac->bw_40 || !( sta->deflink.ht_cap.ht_supported ) )
return;
}
if ( tcb_desc->multicast || tcb_desc->broadcast )
Expand All @@ -884,11 +885,11 @@ static void _rtl_query_bandwidth_mode( struct ieee80211_hw *hw,
if ( mac->opmode == NL80211_IFTYPE_AP ||
mac->opmode == NL80211_IFTYPE_ADHOC ||
mac->opmode == NL80211_IFTYPE_MESH_POINT ) {
if ( !( sta->vht_cap.vht_supported ) )
if ( !( sta->deflink.vht_cap.vht_supported ) )
return;
} else if ( mac->opmode == NL80211_IFTYPE_STATION ) {
if ( !mac->bw_80 ||
!( sta->vht_cap.vht_supported ) )
!( sta->deflink.vht_cap.vht_supported ) )
return;
}
if ( tcb_desc->hw_rate <=
Expand All @@ -904,7 +905,7 @@ static u8 _rtl_get_vht_highest_n_rate( struct ieee80211_hw *hw,
struct rtl_priv *rtlpriv = rtl_priv( hw );
struct rtl_phy *rtlphy = &( rtlpriv->phy );
u8 hw_rate;
u16 tx_mcs_map = le16_to_cpu( sta->vht_cap.vht_mcs.tx_mcs_map );
u16 tx_mcs_map = le16_to_cpu( sta->deflink.vht_cap.vht_mcs.tx_mcs_map );

if ( ( get_rf_type( rtlphy ) == RF_2T2R ) &&
( tx_mcs_map & 0x000c ) != 0x000c ) {
Expand Down Expand Up @@ -944,7 +945,7 @@ static u8 _rtl_get_highest_n_rate( struct ieee80211_hw *hw,
u8 hw_rate;

if ( get_rf_type( rtlphy ) == RF_2T2R &&
sta->ht_cap.mcs.rx_mask[1] != 0 )
sta->deflink.ht_cap.mcs.rx_mask[1] != 0 )
hw_rate = rtlpriv->cfg->maps[RTL_RC_HT_RATEMCS15];
else
hw_rate = rtlpriv->cfg->maps[RTL_RC_HT_RATEMCS7];
Expand Down Expand Up @@ -1271,11 +1272,11 @@ void rtl_get_tcb_desc( struct ieee80211_hw *hw,
*and N rate will all be controlled by FW
*when tcb_desc->use_driver_rate = false
*/
if ( sta && sta->vht_cap.vht_supported ) {
if ( sta && sta->deflink.vht_cap.vht_supported ) {
tcb_desc->hw_rate =
_rtl_get_vht_highest_n_rate( hw, sta );
} else {
if ( sta && sta->ht_cap.ht_supported ) {
if ( sta && sta->deflink.ht_cap.ht_supported ) {
tcb_desc->hw_rate =
_rtl_get_highest_n_rate( hw, sta );
} else {
Expand Down Expand Up @@ -1994,8 +1995,7 @@ void rtl_collect_scan_list( struct ieee80211_hw *hw, struct sk_buff *skb )
struct rtl_mac *mac = rtl_mac( rtl_priv( hw ) );
unsigned long flags;

struct rtl_bssid_entry *entry;
bool entry_found = false;
struct rtl_bssid_entry *entry = NULL, *iter;

/* check if it is scanning */
if ( !mac->act_scanning )
Expand All @@ -2008,18 +2008,18 @@ void rtl_collect_scan_list( struct ieee80211_hw *hw, struct sk_buff *skb )

spin_lock_irqsave( &rtlpriv->locks.scan_list_lock, flags );

list_for_each_entry( entry, &rtlpriv->scan_list.list, list ) {
if ( memcmp( entry->bssid, hdr->addr3, ETH_ALEN ) == 0 ) {
list_del_init( &entry->list );
entry_found = true;
list_for_each_entry( iter, &rtlpriv->scan_list.list, list ) {
if ( memcmp( iter->bssid, hdr->addr3, ETH_ALEN ) == 0 ) {
list_del_init( &iter->list );
entry = iter;
rtl_dbg( rtlpriv, COMP_SCAN, DBG_LOUD,
"Update BSSID=%pM to scan list (total=%d)\n",
hdr->addr3, rtlpriv->scan_list.num );
break;
}
}

if ( !entry_found ) {
if ( !entry ) {
entry = kmalloc( sizeof( *entry ), GFP_ATOMIC );

if ( !entry )
Expand Down
16 changes: 4 additions & 12 deletions btcoexist/halbtc8821a1ant.c
Original file line number Diff line number Diff line change
Expand Up @@ -1600,18 +1600,10 @@ static void btc8821a1ant_act_wifi_con_bt_acl_busy( struct btc_coexist *btcoexist
coex_dm->auto_tdma_adjust = false;
}
} else if ( bt_link_info->hid_exist && bt_link_info->a2dp_exist ) {
/* HID+A2DP */
if ( ( bt_rssi_state == BTC_RSSI_STATE_HIGH ) ||
( bt_rssi_state == BTC_RSSI_STATE_STAY_HIGH ) ) {
btc8821a1ant_ps_tdma( btcoexist, NORMAL_EXEC,
true, 14 );
coex_dm->auto_tdma_adjust = false;
} else {
/*for low BT RSSI*/
btc8821a1ant_ps_tdma( btcoexist, NORMAL_EXEC,
true, 14 );
coex_dm->auto_tdma_adjust = false;
}
/* HID+A2DP ( no need to consider BT RSSI ) */
btc8821a1ant_ps_tdma( btcoexist, NORMAL_EXEC,
true, 14 );
coex_dm->auto_tdma_adjust = false;

btc8821a1ant_coex_table_with_type( btcoexist, NORMAL_EXEC, 1 );
} else if ( ( bt_link_info->pan_only ) ||
Expand Down
40 changes: 20 additions & 20 deletions core.c
Original file line number Diff line number Diff line change
Expand Up @@ -903,26 +903,26 @@ static int rtl_op_sta_add( struct ieee80211_hw *hw,
spin_unlock_bh( &rtlpriv->locks.entry_list_lock );
if ( rtlhal->current_bandtype == BAND_ON_2_4G ) {
sta_entry->wireless_mode = WIRELESS_MODE_G;
if ( sta->supp_rates[0] <= 0xf )
if ( sta->deflink.supp_rates[0] <= 0xf )
sta_entry->wireless_mode = WIRELESS_MODE_B;
if ( sta->ht_cap.ht_supported )
if ( sta->deflink.ht_cap.ht_supported )
sta_entry->wireless_mode = WIRELESS_MODE_N_24G;

if ( vif->type == NL80211_IFTYPE_ADHOC )
sta_entry->wireless_mode = WIRELESS_MODE_G;
} else if ( rtlhal->current_bandtype == BAND_ON_5G ) {
sta_entry->wireless_mode = WIRELESS_MODE_A;
if ( sta->ht_cap.ht_supported )
if ( sta->deflink.ht_cap.ht_supported )
sta_entry->wireless_mode = WIRELESS_MODE_N_5G;
if ( sta->vht_cap.vht_supported )
if ( sta->deflink.vht_cap.vht_supported )
sta_entry->wireless_mode = WIRELESS_MODE_AC_5G;

if ( vif->type == NL80211_IFTYPE_ADHOC )
sta_entry->wireless_mode = WIRELESS_MODE_A;
}
/*disable cck rate for p2p*/
if ( mac->p2p )
sta->supp_rates[0] &= 0xfffffff0;
sta->deflink.supp_rates[0] &= 0xfffffff0;

memcpy( sta_entry->mac_addr, sta->addr, ETH_ALEN );
rtl_dbg( rtlpriv, COMP_MAC80211, DBG_DMESG,
Expand Down Expand Up @@ -1126,28 +1126,28 @@ static void rtl_op_bss_info_changed( struct ieee80211_hw *hw,
rtl_dbg( rtlpriv, COMP_EASY_CONCURRENT, DBG_LOUD,
"send PS STATIC frame\n" );
if ( rtlpriv->dm.supp_phymode_switch ) {
if ( sta->ht_cap.ht_supported )
if ( sta->deflink.ht_cap.ht_supported )
rtl_send_smps_action( hw, sta,
IEEE80211_SMPS_STATIC );
}

if ( rtlhal->current_bandtype == BAND_ON_5G ) {
mac->mode = WIRELESS_MODE_A;
} else {
if ( sta->supp_rates[0] <= 0xf )
if ( sta->deflink.supp_rates[0] <= 0xf )
mac->mode = WIRELESS_MODE_B;
else
mac->mode = WIRELESS_MODE_G;
}

if ( sta->ht_cap.ht_supported ) {
if ( sta->deflink.ht_cap.ht_supported ) {
if ( rtlhal->current_bandtype == BAND_ON_2_4G )
mac->mode = WIRELESS_MODE_N_24G;
else
mac->mode = WIRELESS_MODE_N_5G;
}

if ( sta->vht_cap.vht_supported ) {
if ( sta->deflink.vht_cap.vht_supported ) {
if ( rtlhal->current_bandtype == BAND_ON_5G )
mac->mode = WIRELESS_MODE_AC_5G;
else
Expand Down Expand Up @@ -1256,14 +1256,14 @@ static void rtl_op_bss_info_changed( struct ieee80211_hw *hw,
rcu_read_lock();
sta = ieee80211_find_sta( vif, ( u8 * )bss_conf->bssid );
if ( sta ) {
if ( sta->ht_cap.ampdu_density >
if ( sta->deflink.ht_cap.ampdu_density >
mac->current_ampdu_density )
mac->current_ampdu_density =
sta->ht_cap.ampdu_density;
if ( sta->ht_cap.ampdu_factor <
sta->deflink.ht_cap.ampdu_density;
if ( sta->deflink.ht_cap.ampdu_factor <
mac->current_ampdu_factor )
mac->current_ampdu_factor =
sta->ht_cap.ampdu_factor;
sta->deflink.ht_cap.ampdu_factor;
}
rcu_read_unlock();

Expand Down Expand Up @@ -1298,20 +1298,20 @@ static void rtl_op_bss_info_changed( struct ieee80211_hw *hw,
if ( rtlhal->current_bandtype == BAND_ON_5G ) {
mac->mode = WIRELESS_MODE_A;
} else {
if ( sta->supp_rates[0] <= 0xf )
if ( sta->deflink.supp_rates[0] <= 0xf )
mac->mode = WIRELESS_MODE_B;
else
mac->mode = WIRELESS_MODE_G;
}

if ( sta->ht_cap.ht_supported ) {
if ( sta->deflink.ht_cap.ht_supported ) {
if ( rtlhal->current_bandtype == BAND_ON_2_4G )
mac->mode = WIRELESS_MODE_N_24G;
else
mac->mode = WIRELESS_MODE_N_5G;
}

if ( sta->vht_cap.vht_supported ) {
if ( sta->deflink.vht_cap.vht_supported ) {
if ( rtlhal->current_bandtype == BAND_ON_5G )
mac->mode = WIRELESS_MODE_AC_5G;
else
Expand All @@ -1327,7 +1327,7 @@ static void rtl_op_bss_info_changed( struct ieee80211_hw *hw,
sta_entry->wireless_mode = mac->mode;
}

if ( sta->ht_cap.ht_supported ) {
if ( sta->deflink.ht_cap.ht_supported ) {
mac->ht_enable = true;

/*
Expand All @@ -1338,16 +1338,16 @@ static void rtl_op_bss_info_changed( struct ieee80211_hw *hw,
* */
}

if ( sta->vht_cap.vht_supported )
if ( sta->deflink.vht_cap.vht_supported )
mac->vht_enable = true;

if ( changed & BSS_CHANGED_BASIC_RATES ) {
/* for 5G must << RATE_6M_INDEX = 4,
* because 5G have no cck rate*/
if ( rtlhal->current_bandtype == BAND_ON_5G )
basic_rates = sta->supp_rates[1] << 4;
basic_rates = sta->deflink.supp_rates[1] << 4;
else
basic_rates = sta->supp_rates[0];
basic_rates = sta->deflink.supp_rates[0];

mac->basic_rates = basic_rates;
rtlpriv->cfg->ops->set_hw_reg( hw, HW_VAR_BASIC_RATE,
Expand Down
15 changes: 7 additions & 8 deletions pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,14 +324,13 @@ static bool rtl_pci_check_buddy_priv( struct ieee80211_hw *hw,
{
struct rtl_priv *rtlpriv = rtl_priv( hw );
struct rtl_pci_priv *pcipriv = rtl_pcipriv( hw );
bool find_buddy_priv = false;
struct rtl_priv *tpriv;
struct rtl_priv *tpriv = NULL, *iter;
struct rtl_pci_priv *tpcipriv = NULL;

if ( !list_empty( &rtlpriv->glb_var->glb_priv_list ) ) {
list_for_each_entry( tpriv, &rtlpriv->glb_var->glb_priv_list,
list_for_each_entry( iter, &rtlpriv->glb_var->glb_priv_list,
list ) {
tpcipriv = ( struct rtl_pci_priv * )tpriv->priv;
tpcipriv = ( struct rtl_pci_priv * )iter->priv;
rtl_dbg( rtlpriv, COMP_INIT, DBG_LOUD,
"pcipriv->ndis_adapter.funcnumber %x\n",
pcipriv->ndis_adapter.funcnumber );
Expand All @@ -345,19 +344,19 @@ static bool rtl_pci_check_buddy_priv( struct ieee80211_hw *hw,
tpcipriv->ndis_adapter.devnumber &&
pcipriv->ndis_adapter.funcnumber !=
tpcipriv->ndis_adapter.funcnumber ) {
find_buddy_priv = true;
tpriv = iter;
break;
}
}
}

rtl_dbg( rtlpriv, COMP_INIT, DBG_LOUD,
"find_buddy_priv %d\n", find_buddy_priv );
"find_buddy_priv %d\n", tpriv != NULL );

if ( find_buddy_priv )
if ( tpriv )
*buddy_priv = tpriv;

return find_buddy_priv;
return tpriv != NULL;
}

static void rtl_pci_get_linkcontrol_field( struct ieee80211_hw *hw )
Expand Down
20 changes: 10 additions & 10 deletions rc.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ static u8 _rtl_rc_get_highest_rix( struct rtl_priv *rtlpriv,
else
return N_MODE_MCS15_RIX;
} else if ( wireless_mode == WIRELESS_MODE_AC_24G ) {
if ( sta->bandwidth == IEEE80211_STA_RX_BW_20 ) {
if ( sta->deflink.bandwidth == IEEE80211_STA_RX_BW_20 ) {
ieee80211_rate_set_vht( &rate,
AC_MODE_MCS8_RIX,
nss );
Expand All @@ -88,7 +88,7 @@ static u8 _rtl_rc_get_highest_rix( struct rtl_priv *rtlpriv,
else
return N_MODE_MCS15_RIX;
} else if ( wireless_mode == WIRELESS_MODE_AC_5G ) {
if ( sta->bandwidth == IEEE80211_STA_RX_BW_20 ) {
if ( sta->deflink.bandwidth == IEEE80211_STA_RX_BW_20 ) {
ieee80211_rate_set_vht( &rate,
AC_MODE_MCS8_RIX,
nss );
Expand Down Expand Up @@ -121,9 +121,9 @@ static void _rtl_rc_rate_set_series( struct rtl_priv *rtlpriv,
u8 sgi_20 = 0, sgi_40 = 0, sgi_80 = 0;

if ( sta ) {
sgi_20 = sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_20;
sgi_40 = sta->ht_cap.cap & IEEE80211_HT_CAP_SGI_40;
sgi_80 = sta->vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_80;
sgi_20 = sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SGI_20;
sgi_40 = sta->deflink.ht_cap.cap & IEEE80211_HT_CAP_SGI_40;
sgi_80 = sta->deflink.vht_cap.cap & IEEE80211_VHT_CAP_SHORT_GI_80;
sta_entry = ( struct rtl_sta_info * )sta->drv_priv;
wireless_mode = sta_entry->wireless_mode;
}
Expand All @@ -135,10 +135,10 @@ static void _rtl_rc_rate_set_series( struct rtl_priv *rtlpriv,
rate->flags |= IEEE80211_TX_RC_USE_SHORT_PREAMBLE;
if ( mac->opmode == NL80211_IFTYPE_AP ||
mac->opmode == NL80211_IFTYPE_ADHOC ) {
if ( sta && ( sta->ht_cap.cap &
if ( sta && ( sta->deflink.ht_cap.cap &
IEEE80211_HT_CAP_SUP_WIDTH_20_40 ) )
rate->flags |= IEEE80211_TX_RC_40_MHZ_WIDTH;
if ( sta && sta->vht_cap.vht_supported )
if ( sta && sta->deflink.vht_cap.vht_supported )
rate->flags |= IEEE80211_TX_RC_80_MHZ_WIDTH;
} else {
if ( mac->bw_80 )
Expand All @@ -149,11 +149,11 @@ static void _rtl_rc_rate_set_series( struct rtl_priv *rtlpriv,

if ( sgi_20 || sgi_40 || sgi_80 )
rate->flags |= IEEE80211_TX_RC_SHORT_GI;
if ( sta && sta->ht_cap.ht_supported &&
if ( sta && sta->deflink.ht_cap.ht_supported &&
( wireless_mode == WIRELESS_MODE_N_5G ||
wireless_mode == WIRELESS_MODE_N_24G ) )
rate->flags |= IEEE80211_TX_RC_MCS;
if ( sta && sta->vht_cap.vht_supported &&
if ( sta && sta->deflink.vht_cap.vht_supported &&
( wireless_mode == WIRELESS_MODE_AC_5G ||
wireless_mode == WIRELESS_MODE_AC_24G ||
wireless_mode == WIRELESS_MODE_AC_ONLY ) )
Expand Down Expand Up @@ -229,7 +229,7 @@ static void rtl_tx_status( void *ppriv,
if ( sta ) {
/* Check if aggregation has to be enabled for this tid */
sta_entry = ( struct rtl_sta_info * )sta->drv_priv;
if ( sta->ht_cap.ht_supported &&
if ( sta->deflink.ht_cap.ht_supported &&
!( skb->protocol == cpu_to_be16( ETH_P_PAE ) ) ) {
if ( ieee80211_is_data_qos( fc ) ) {
u8 tid = rtl_get_tid( skb );
Expand Down
Loading

0 comments on commit 9a38a75

Please sign in to comment.