mirror of
https://github.com/lwfinger/rtl8188eu.git
synced 2025-05-19 19:43:05 +00:00
rtl8188eu: Remove dead code inside #if 0 ... #endif
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
parent
3ad757d04a
commit
77e736c66a
64 changed files with 98 additions and 7692 deletions
246
core/rtw_ap.c
246
core/rtw_ap.c
|
@ -330,13 +330,8 @@ u8 chk_sta_is_alive(struct sta_info *psta)
|
|||
);
|
||||
#endif
|
||||
|
||||
//if (sta_last_rx_pkts(psta) == sta_rx_pkts(psta))
|
||||
if ((psta->sta_stats.last_rx_data_pkts + psta->sta_stats.last_rx_ctrl_pkts) == (psta->sta_stats.rx_data_pkts + psta->sta_stats.rx_ctrl_pkts))
|
||||
{
|
||||
#if 0
|
||||
if (psta->state&WIFI_SLEEP_STATE)
|
||||
ret = _TRUE;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -623,125 +618,6 @@ void add_RATid(_adapter *padapter, struct sta_info *psta, u8 rssi_level)
|
|||
}
|
||||
#endif //CONFIG_80211N_HT
|
||||
|
||||
#if 0//gtest
|
||||
if (get_rf_mimo_mode(padapter) == RTL8712_RF_2T2R)
|
||||
{
|
||||
//is this a 2r STA?
|
||||
if ((pstat->tx_ra_bitmap & 0x0ff00000) != 0 && !(priv->pshare->has_2r_sta & BIT(pstat->aid)))
|
||||
{
|
||||
priv->pshare->has_2r_sta |= BIT(pstat->aid);
|
||||
if (rtw_read16(padapter, 0x102501f6) != 0xffff)
|
||||
{
|
||||
rtw_write16(padapter, 0x102501f6, 0xffff);
|
||||
reset_1r_sta_RA(priv, 0xffff);
|
||||
Switch_1SS_Antenna(priv, 3);
|
||||
}
|
||||
}
|
||||
else// bg or 1R STA?
|
||||
{
|
||||
if ((priv->pmib->dot11BssType.net_work_type & WIRELESS_11N) && pstat->ht_cap_len && priv->pshare->has_2r_sta == 0)
|
||||
{
|
||||
if (rtw_read16(padapter, 0x102501f6) != 0x7777)
|
||||
{ // MCS7 SGI
|
||||
rtw_write16(padapter, 0x102501f6,0x7777);
|
||||
reset_1r_sta_RA(priv, 0x7777);
|
||||
Switch_1SS_Antenna(priv, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if ((pstat->rssi_level < 1) || (pstat->rssi_level > 3))
|
||||
{
|
||||
if (pstat->rssi >= priv->pshare->rf_ft_var.raGoDownUpper)
|
||||
pstat->rssi_level = 1;
|
||||
else if ((pstat->rssi >= priv->pshare->rf_ft_var.raGoDown20MLower) ||
|
||||
((priv->pshare->is_40m_bw) && (pstat->ht_cap_len) &&
|
||||
(pstat->rssi >= priv->pshare->rf_ft_var.raGoDown40MLower) &&
|
||||
(pstat->ht_cap_buf.ht_cap_info & cpu_to_le16(_HTCAP_SUPPORT_CH_WDTH_))))
|
||||
pstat->rssi_level = 2;
|
||||
else
|
||||
pstat->rssi_level = 3;
|
||||
}
|
||||
|
||||
// rate adaptive by rssi
|
||||
if ((priv->pmib->dot11BssType.net_work_type & WIRELESS_11N) && pstat->ht_cap_len)
|
||||
{
|
||||
if ((get_rf_mimo_mode(priv) == MIMO_1T2R) || (get_rf_mimo_mode(priv) == MIMO_1T1R))
|
||||
{
|
||||
switch (pstat->rssi_level) {
|
||||
case 1:
|
||||
pstat->tx_ra_bitmap &= 0x100f0000;
|
||||
break;
|
||||
case 2:
|
||||
pstat->tx_ra_bitmap &= 0x100ff000;
|
||||
break;
|
||||
case 3:
|
||||
if (priv->pshare->is_40m_bw)
|
||||
pstat->tx_ra_bitmap &= 0x100ff005;
|
||||
else
|
||||
pstat->tx_ra_bitmap &= 0x100ff001;
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
switch (pstat->rssi_level) {
|
||||
case 1:
|
||||
pstat->tx_ra_bitmap &= 0x1f0f0000;
|
||||
break;
|
||||
case 2:
|
||||
pstat->tx_ra_bitmap &= 0x1f0ff000;
|
||||
break;
|
||||
case 3:
|
||||
if (priv->pshare->is_40m_bw)
|
||||
pstat->tx_ra_bitmap &= 0x000ff005;
|
||||
else
|
||||
pstat->tx_ra_bitmap &= 0x000ff001;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
// Don't need to mask high rates due to new rate adaptive parameters
|
||||
//if (pstat->is_broadcom_sta) // use MCS12 as the highest rate vs. Broadcom sta
|
||||
// pstat->tx_ra_bitmap &= 0x81ffffff;
|
||||
|
||||
// NIC driver will report not supporting MCS15 and MCS14 in asoc req
|
||||
//if (pstat->is_rtl8190_sta && !pstat->is_2t_mimo_sta)
|
||||
// pstat->tx_ra_bitmap &= 0x83ffffff; // if Realtek 1x2 sta, don't use MCS15 and MCS14
|
||||
}
|
||||
}
|
||||
else if ((priv->pmib->dot11BssType.net_work_type & WIRELESS_11G) && isErpSta(pstat))
|
||||
{
|
||||
switch (pstat->rssi_level) {
|
||||
case 1:
|
||||
pstat->tx_ra_bitmap &= 0x00000f00;
|
||||
break;
|
||||
case 2:
|
||||
pstat->tx_ra_bitmap &= 0x00000ff0;
|
||||
break;
|
||||
case 3:
|
||||
pstat->tx_ra_bitmap &= 0x00000ff5;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pstat->tx_ra_bitmap &= 0x0000000d;
|
||||
}
|
||||
|
||||
// disable tx short GI when station cannot rx MCS15(AP is 2T2R)
|
||||
// disable tx short GI when station cannot rx MCS7 (AP is 1T2R or 1T1R)
|
||||
// if there is only 1r STA and we are 2T2R, DO NOT mask SGI rate
|
||||
if ((!(pstat->tx_ra_bitmap & 0x8000000) && (priv->pshare->has_2r_sta > 0) && (get_rf_mimo_mode(padapter) == RTL8712_RF_2T2R)) ||
|
||||
(!(pstat->tx_ra_bitmap & 0x80000) && (get_rf_mimo_mode(padapter) != RTL8712_RF_2T2R)))
|
||||
{
|
||||
pstat->tx_ra_bitmap &= ~BIT(28);
|
||||
}
|
||||
#endif
|
||||
|
||||
if ( pcur_network->Configuration.DSConfig > 14 ) {
|
||||
// 5G band
|
||||
if (tx_ra_bitmap & 0xffff000)
|
||||
|
@ -1482,49 +1358,8 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
|
|||
|
||||
psecuritypriv->wpa2_group_cipher = group_cipher;
|
||||
psecuritypriv->wpa2_pairwise_cipher = pairwise_cipher;
|
||||
#if 0
|
||||
switch (group_cipher)
|
||||
{
|
||||
case WPA_CIPHER_NONE:
|
||||
psecuritypriv->wpa2_group_cipher = _NO_PRIVACY_;
|
||||
break;
|
||||
case WPA_CIPHER_WEP40:
|
||||
psecuritypriv->wpa2_group_cipher = _WEP40_;
|
||||
break;
|
||||
case WPA_CIPHER_TKIP:
|
||||
psecuritypriv->wpa2_group_cipher = _TKIP_;
|
||||
break;
|
||||
case WPA_CIPHER_CCMP:
|
||||
psecuritypriv->wpa2_group_cipher = _AES_;
|
||||
break;
|
||||
case WPA_CIPHER_WEP104:
|
||||
psecuritypriv->wpa2_group_cipher = _WEP104_;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (pairwise_cipher)
|
||||
{
|
||||
case WPA_CIPHER_NONE:
|
||||
psecuritypriv->wpa2_pairwise_cipher = _NO_PRIVACY_;
|
||||
break;
|
||||
case WPA_CIPHER_WEP40:
|
||||
psecuritypriv->wpa2_pairwise_cipher = _WEP40_;
|
||||
break;
|
||||
case WPA_CIPHER_TKIP:
|
||||
psecuritypriv->wpa2_pairwise_cipher = _TKIP_;
|
||||
break;
|
||||
case WPA_CIPHER_CCMP:
|
||||
psecuritypriv->wpa2_pairwise_cipher = _AES_;
|
||||
break;
|
||||
case WPA_CIPHER_WEP104:
|
||||
psecuritypriv->wpa2_pairwise_cipher = _WEP104_;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//wpa
|
||||
ie_len = 0;
|
||||
group_cipher = 0; pairwise_cipher = 0;
|
||||
|
@ -1545,56 +1380,11 @@ int rtw_check_beacon_data(_adapter *padapter, u8 *pbuf, int len)
|
|||
|
||||
psecuritypriv->wpa_group_cipher = group_cipher;
|
||||
psecuritypriv->wpa_pairwise_cipher = pairwise_cipher;
|
||||
|
||||
#if 0
|
||||
switch (group_cipher)
|
||||
{
|
||||
case WPA_CIPHER_NONE:
|
||||
psecuritypriv->wpa_group_cipher = _NO_PRIVACY_;
|
||||
break;
|
||||
case WPA_CIPHER_WEP40:
|
||||
psecuritypriv->wpa_group_cipher = _WEP40_;
|
||||
break;
|
||||
case WPA_CIPHER_TKIP:
|
||||
psecuritypriv->wpa_group_cipher = _TKIP_;
|
||||
break;
|
||||
case WPA_CIPHER_CCMP:
|
||||
psecuritypriv->wpa_group_cipher = _AES_;
|
||||
break;
|
||||
case WPA_CIPHER_WEP104:
|
||||
psecuritypriv->wpa_group_cipher = _WEP104_;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (pairwise_cipher)
|
||||
{
|
||||
case WPA_CIPHER_NONE:
|
||||
psecuritypriv->wpa_pairwise_cipher = _NO_PRIVACY_;
|
||||
break;
|
||||
case WPA_CIPHER_WEP40:
|
||||
psecuritypriv->wpa_pairwise_cipher = _WEP40_;
|
||||
break;
|
||||
case WPA_CIPHER_TKIP:
|
||||
psecuritypriv->wpa_pairwise_cipher = _TKIP_;
|
||||
break;
|
||||
case WPA_CIPHER_CCMP:
|
||||
psecuritypriv->wpa_pairwise_cipher = _AES_;
|
||||
break;
|
||||
case WPA_CIPHER_WEP104:
|
||||
psecuritypriv->wpa_pairwise_cipher = _WEP104_;
|
||||
break;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
if ((p == NULL) || (ie_len == 0))
|
||||
{
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
|
@ -2254,19 +2044,6 @@ void bss_cap_update_on_sta_join(_adapter *padapter, struct sta_info *psta)
|
|||
struct mlme_priv *pmlmepriv = &(padapter->mlmepriv);
|
||||
struct mlme_ext_priv *pmlmeext = &(padapter->mlmeextpriv);
|
||||
|
||||
|
||||
#if 0
|
||||
if (!(psta->capability & WLAN_CAPABILITY_SHORT_PREAMBLE) &&
|
||||
!psta->no_short_preamble_set) {
|
||||
psta->no_short_preamble_set = 1;
|
||||
pmlmepriv->num_sta_no_short_preamble++;
|
||||
if ((pmlmeext->cur_wireless_mode > WIRELESS_11B) &&
|
||||
(pmlmepriv->num_sta_no_short_preamble == 1))
|
||||
ieee802_11_set_beacons(hapd->iface);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
if (!(psta->flags & WLAN_STA_SHORT_PREAMBLE))
|
||||
{
|
||||
if (!psta->no_short_preamble_set)
|
||||
|
@ -2302,15 +2079,6 @@ void bss_cap_update_on_sta_join(_adapter *padapter, struct sta_info *psta)
|
|||
}
|
||||
}
|
||||
|
||||
#if 0
|
||||
if (psta->flags & WLAN_STA_NONERP && !psta->nonerp_set) {
|
||||
psta->nonerp_set = 1;
|
||||
pmlmepriv->num_sta_non_erp++;
|
||||
if (pmlmepriv->num_sta_non_erp == 1)
|
||||
ieee802_11_set_beacons(hapd->iface);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (psta->flags & WLAN_STA_NONERP)
|
||||
{
|
||||
if (!psta->nonerp_set)
|
||||
|
@ -2344,18 +2112,6 @@ void bss_cap_update_on_sta_join(_adapter *padapter, struct sta_info *psta)
|
|||
|
||||
}
|
||||
|
||||
|
||||
#if 0
|
||||
if (!(psta->capability & WLAN_CAPABILITY_SHORT_SLOT) &&
|
||||
!psta->no_short_slot_time_set) {
|
||||
psta->no_short_slot_time_set = 1;
|
||||
pmlmepriv->num_sta_no_short_slot_time++;
|
||||
if ((pmlmeext->cur_wireless_mode > WIRELESS_11B) &&
|
||||
(pmlmepriv->num_sta_no_short_slot_time == 1))
|
||||
ieee802_11_set_beacons(hapd->iface);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!(psta->capability & WLAN_CAPABILITY_SHORT_SLOT))
|
||||
{
|
||||
if (!psta->no_short_slot_time_set)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue