Skip to content

Commit

Permalink
staging: r8188eu: Remove no more necessary definitions and code
Browse files Browse the repository at this point in the history
Remove no more necessary further 5GHz related code, along with no
more used definitions of macro and variables.

Acked-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
Link: https://lore.kernel.org/r/20210812002519.23678-4-fmdefrancesco@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
xp4ns3 authored and gregkh committed Aug 12, 2021
1 parent 9f68048 commit 221abd4
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 69 deletions.
25 changes: 1 addition & 24 deletions drivers/staging/r8188eu/core/rtw_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -876,13 +876,11 @@ int proc_get_best_channel(char *page, char **start,
struct adapter *padapter = (struct adapter *)rtw_netdev_priv(dev);
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
int len = 0;
u32 i, best_channel_24G = 1, best_channel_5G = 36, index_24G = 0, index_5G = 0;
u32 i, best_channel_24G = 1, index_24G = 0;

for (i = 0; pmlmeext->channel_set[i].ChannelNum != 0; i++) {
if (pmlmeext->channel_set[i].ChannelNum == 1)
index_24G = i;
if (pmlmeext->channel_set[i].ChannelNum == 36)
index_5G = i;
}

for (i = 0; pmlmeext->channel_set[i].ChannelNum != 0; i++) {
Expand All @@ -894,32 +892,11 @@ int proc_get_best_channel(char *page, char **start,
}
}

/* 5G */
if (pmlmeext->channel_set[i].ChannelNum >= 36 &&
pmlmeext->channel_set[i].ChannelNum < 140) {
/* Find primary channel */
if (((pmlmeext->channel_set[i].ChannelNum - 36) % 8 == 0) &&
(pmlmeext->channel_set[i].rx_count < pmlmeext->channel_set[index_5G].rx_count)) {
index_5G = i;
best_channel_5G = pmlmeext->channel_set[i].ChannelNum;
}
}

if (pmlmeext->channel_set[i].ChannelNum >= 149 &&
pmlmeext->channel_set[i].ChannelNum < 165) {
/* find primary channel */
if (((pmlmeext->channel_set[i].ChannelNum - 149) % 8 == 0) &&
(pmlmeext->channel_set[i].rx_count < pmlmeext->channel_set[index_5G].rx_count)) {
index_5G = i;
best_channel_5G = pmlmeext->channel_set[i].ChannelNum;
}
}
/* debug */
len += snprintf(page + len, count - len, "The rx cnt of channel %3d = %d\n",
pmlmeext->channel_set[i].ChannelNum, pmlmeext->channel_set[i].rx_count);
}

len += snprintf(page + len, count - len, "best_channel_5G = %d\n", best_channel_5G);
len += snprintf(page + len, count - len, "best_channel_24G = %d\n", best_channel_24G);

*eof = 1;
Expand Down
2 changes: 1 addition & 1 deletion drivers/staging/r8188eu/core/rtw_ioctl_set.c
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@ int rtw_set_channel_plan(struct adapter *adapter, u8 channel_plan)
*/
int rtw_set_country(struct adapter *adapter, const char *country_code)
{
int channel_plan = RT_CHANNEL_DOMAIN_WORLD_WIDE_5G;
int channel_plan = RT_CHANNEL_DOMAIN_GLOBAL_DOAMIN_2G;

DBG_88E("%s country_code:%s\n", __func__, country_code);

Expand Down
13 changes: 3 additions & 10 deletions drivers/staging/r8188eu/core/rtw_mlme_ext.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ static struct rt_channel_plan_map RTW_ChannelPlanMap[RT_CHANNEL_DOMAIN_MAX] = {
{0x01}, /* 0x10, RT_CHANNEL_DOMAIN_JAPAN */
{0x02}, /* 0x11, RT_CHANNEL_DOMAIN_FCC_NO_DFS */
{0x01}, /* 0x12, RT_CHANNEL_DOMAIN_JAPAN_NO_DFS */
{0x00}, /* 0x13, RT_CHANNEL_DOMAIN_WORLD_WIDE_5G */
{0x02}, /* 0x14, RT_CHANNEL_DOMAIN_TAIWAN_NO_DFS */
{0x00}, /* 0x15, RT_CHANNEL_DOMAIN_ETSI_NO_DFS */
{0x00}, /* 0x16, RT_CHANNEL_DOMAIN_KOREA_NO_DFS */
Expand All @@ -116,7 +115,6 @@ static struct rt_channel_plan_map RTW_ChannelPlanMap[RT_CHANNEL_DOMAIN_MAX] = {
{0x00}, /* 0x1C, */
{0x00}, /* 0x1D, */
{0x00}, /* 0x1E, */
{0x05}, /* 0x1F, RT_CHANNEL_DOMAIN_WORLD_WIDE_ONLY_5G */
/* 0x20 ~ 0x7F , New Define ===== */
{0x00}, /* 0x20, RT_CHANNEL_DOMAIN_WORLD_NULL */
{0x01}, /* 0x21, RT_CHANNEL_DOMAIN_ETSI1_NULL */
Expand Down Expand Up @@ -6813,11 +6811,7 @@ static void process_80211d(struct adapter *padapter, struct wlan_bssid_ex *bssid
p++;

for (j = 0; j < noc; j++) {
if (fcn <= 14)
channel = fcn + j; /* 2.4 GHz */
else
channel = fcn + j*4; /* 5 GHz */

channel = fcn + j;
chplan_ap.Channel[i++] = channel;
}
}
Expand All @@ -6834,11 +6828,10 @@ static void process_80211d(struct adapter *padapter, struct wlan_bssid_ex *bssid
if (pregistrypriv->wireless_mode & WIRELESS_11G) {
do {
if ((i == MAX_CHANNEL_NUM) ||
(chplan_sta[i].ChannelNum == 0) ||
(chplan_sta[i].ChannelNum > 14))
(chplan_sta[i].ChannelNum == 0))
break;

if ((j == chplan_ap.Len) || (chplan_ap.Channel[j] > 14))
if (j == chplan_ap.Len)
break;

if (chplan_sta[i].ChannelNum == chplan_ap.Channel[j]) {
Expand Down
19 changes: 3 additions & 16 deletions drivers/staging/r8188eu/hal/odm.c
Original file line number Diff line number Diff line change
Expand Up @@ -621,15 +621,9 @@ void odm_DIG(struct odm_dm_struct *pDM_Odm)
FirstDisConnect = (!pDM_Odm->bLinked) && (pDM_DigTable->bMediaConnect_1);
}
} else {
if (*pDM_Odm->pBandType == ODM_BAND_5G) {
DIG_Dynamic_MIN = pDM_DigTable->DIG_Dynamic_MIN_0;
FirstConnect = (pDM_Odm->bLinked) && (!pDM_DigTable->bMediaConnect_0);
FirstDisConnect = (!pDM_Odm->bLinked) && (pDM_DigTable->bMediaConnect_0);
} else {
DIG_Dynamic_MIN = pDM_DigTable->DIG_Dynamic_MIN_1;
FirstConnect = (pDM_Odm->bLinked) && (!pDM_DigTable->bMediaConnect_1);
FirstDisConnect = (!pDM_Odm->bLinked) && (pDM_DigTable->bMediaConnect_1);
}
DIG_Dynamic_MIN = pDM_DigTable->DIG_Dynamic_MIN_1;
FirstConnect = (pDM_Odm->bLinked) && (!pDM_DigTable->bMediaConnect_1);
FirstDisConnect = (!pDM_Odm->bLinked) && (pDM_DigTable->bMediaConnect_1);
}
} else {
DIG_Dynamic_MIN = pDM_DigTable->DIG_Dynamic_MIN_0;
Expand Down Expand Up @@ -1094,12 +1088,6 @@ u32 ODM_Get_Rate_Bitmap(struct odm_dm_struct *pDM_Odm, u32 macid, u32 ra_mask, u
else
rate_bitmap = 0x0000000f;
break;
case (ODM_WM_A|ODM_WM_G):
if (rssi_level == DM_RATR_STA_HIGH)
rate_bitmap = 0x00000f00;
else
rate_bitmap = 0x00000ff0;
break;
case (ODM_WM_B|ODM_WM_G):
if (rssi_level == DM_RATR_STA_HIGH)
rate_bitmap = 0x00000f00;
Expand All @@ -1109,7 +1097,6 @@ u32 ODM_Get_Rate_Bitmap(struct odm_dm_struct *pDM_Odm, u32 macid, u32 ra_mask, u
rate_bitmap = 0x00000ff5;
break;
case (ODM_WM_B|ODM_WM_G|ODM_WM_N24G):
case (ODM_WM_A|ODM_WM_B|ODM_WM_G|ODM_WM_N24G):
if (pDM_Odm->RFType == ODM_1T2R || pDM_Odm->RFType == ODM_1T1R) {
if (rssi_level == DM_RATR_STA_HIGH) {
rate_bitmap = 0x000f0000;
Expand Down
3 changes: 0 additions & 3 deletions drivers/staging/r8188eu/hal/rtl8188e_phycfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1026,9 +1026,6 @@ _PHY_SetBWMode92C(
case RF_8256:
/* Please implement this function in Hal8190PciPhy8256.c */
break;
case RF_8258:
/* Please implement this function in Hal8190PciPhy8258.c */
break;
case RF_PSEUDO_11N:
break;
case RF_6052:
Expand Down
4 changes: 0 additions & 4 deletions drivers/staging/r8188eu/include/Hal8188EPhyCfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,10 @@ enum rf_radio_path {

enum wireless_mode {
WIRELESS_MODE_UNKNOWN = 0x00,
WIRELESS_MODE_A = BIT(2),
WIRELESS_MODE_B = BIT(0),
WIRELESS_MODE_G = BIT(1),
WIRELESS_MODE_AUTO = BIT(5),
WIRELESS_MODE_N_24G = BIT(3),
WIRELESS_MODE_N_5G = BIT(4),
WIRELESS_MODE_AC = BIT(6)
};

enum phy_rate_tx_offset_area {
Expand All @@ -91,7 +88,6 @@ enum RF_TYPE_8190P {
RF_TYPE_MIN, /* 0 */
RF_8225 = 1, /* 1 11b/g RF for verification only */
RF_8256 = 2, /* 2 11b/g/n */
RF_8258 = 3, /* 3 11a/b/g/n RF */
RF_6052 = 4, /* 4 11b/g/n RF */
/* TODO: We should remove this psudo PHY RF after we get new RF. */
RF_PSEUDO_11N = 5, /* 5, It is a temporality RF. */
Expand Down
5 changes: 0 additions & 5 deletions drivers/staging/r8188eu/include/odm.h
Original file line number Diff line number Diff line change
Expand Up @@ -531,17 +531,13 @@ enum odm_wireless_mode {
ODM_WM_UNKNOW = 0x0,
ODM_WM_B = BIT(0),
ODM_WM_G = BIT(1),
ODM_WM_A = BIT(2),
ODM_WM_N24G = BIT(3),
ODM_WM_N5G = BIT(4),
ODM_WM_AUTO = BIT(5),
ODM_WM_AC = BIT(6),
};

/* ODM_CMNINFO_BAND */
enum odm_band_type {
ODM_BAND_2_4G = BIT(0),
ODM_BAND_5G = BIT(1),
};

/* ODM_CMNINFO_SEC_CHNL_OFFSET */
Expand Down Expand Up @@ -933,7 +929,6 @@ enum odm_bb_config_type {
CONFIG_BB_PHY_REG,
CONFIG_BB_AGC_TAB,
CONFIG_BB_AGC_TAB_2G,
CONFIG_BB_AGC_TAB_5G,
CONFIG_BB_PHY_REG_PG,
};

Expand Down
5 changes: 0 additions & 5 deletions drivers/staging/r8188eu/include/rtl8188e_spec.h
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,6 @@ Default: 00b.

/* 8192C BW_OPMODE bits (Offset 0x203, 8bit) */
#define BW_OPMODE_20MHZ BIT(2)
#define BW_OPMODE_5G BIT(1)

/* 8192C CAM Config Setting (offset 0x250, 1 byte) */
#define CAM_VALID BIT(15)
Expand Down Expand Up @@ -1343,10 +1342,6 @@ Current IOREG MAP
#define EEPROM_DEFAULT_24G_HT20_DIFF 0X02
#define EEPROM_DEFAULT_24G_OFDM_DIFF 0X04

#define EEPROM_DEFAULT_5G_INDEX 0X2A
#define EEPROM_DEFAULT_5G_HT20_DIFF 0X00
#define EEPROM_DEFAULT_5G_OFDM_DIFF 0X04

#define EEPROM_DEFAULT_DIFF 0XFE
#define EEPROM_DEFAULT_CHANNEL_PLAN 0x7F
#define EEPROM_DEFAULT_BOARD_OPTION 0x00
Expand Down
1 change: 0 additions & 1 deletion drivers/staging/r8188eu/include/rtw_mlme_ext.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ enum RT_CHANNEL_DOMAIN {
RT_CHANNEL_DOMAIN_JAPAN = 0x10,
RT_CHANNEL_DOMAIN_FCC_NO_DFS = 0x11,
RT_CHANNEL_DOMAIN_JAPAN_NO_DFS = 0x12,
RT_CHANNEL_DOMAIN_WORLD_WIDE_5G = 0x13,
RT_CHANNEL_DOMAIN_TAIWAN_NO_DFS = 0x14,

/* new channel plan mapping, (2GDOMAIN_5GDOMAIN) ===== */
Expand Down

0 comments on commit 221abd4

Please sign in to comment.