Commit 88cbb390 authored by navin patidar's avatar navin patidar Committed by Greg Kroah-Hartman

staging: rtl8188eu: Rework function getTxPowerIndex88E()

Rename CamelCase variables and function name.
Signed-off-by: default avatarnavin patidar <navin.patidar@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 7b98485c
...@@ -150,78 +150,63 @@ void phy_set_rf_reg(struct adapter *adapt, enum rf_radio_path rf_path, ...@@ -150,78 +150,63 @@ void phy_set_rf_reg(struct adapter *adapt, enum rf_radio_path rf_path,
rf_serial_write(adapt, rf_path, reg_addr, data); rf_serial_write(adapt, rf_path, reg_addr, data);
} }
static void getTxPowerIndex88E(struct adapter *Adapter, u8 channel, u8 *cckPowerLevel, static void get_tx_power_index(struct adapter *adapt, u8 channel, u8 *cck_pwr,
u8 *ofdmPowerLevel, u8 *BW20PowerLevel, u8 *ofdm_pwr, u8 *bw20_pwr, u8 *bw40_pwr)
u8 *BW40PowerLevel)
{ {
struct hal_data_8188e *pHalData = GET_HAL_DATA(Adapter); struct hal_data_8188e *hal_data = GET_HAL_DATA(adapt);
u8 index = (channel - 1); u8 index = (channel - 1);
u8 TxCount = 0, path_nums; u8 TxCount = 0, path_nums;
if ((RF_1T2R == pHalData->rf_type) || (RF_1T1R == pHalData->rf_type)) if ((RF_1T2R == hal_data->rf_type) || (RF_1T1R == hal_data->rf_type))
path_nums = 1; path_nums = 1;
else else
path_nums = 2; path_nums = 2;
for (TxCount = 0; TxCount < path_nums; TxCount++) { for (TxCount = 0; TxCount < path_nums; TxCount++) {
if (TxCount == RF_PATH_A) { if (TxCount == RF_PATH_A) {
/* 1. CCK */ cck_pwr[TxCount] = hal_data->Index24G_CCK_Base[TxCount][index];
cckPowerLevel[TxCount] = pHalData->Index24G_CCK_Base[TxCount][index]; ofdm_pwr[TxCount] = hal_data->Index24G_BW40_Base[RF_PATH_A][index]+
/* 2. OFDM */ hal_data->OFDM_24G_Diff[TxCount][RF_PATH_A];
ofdmPowerLevel[TxCount] = pHalData->Index24G_BW40_Base[RF_PATH_A][index]+
pHalData->OFDM_24G_Diff[TxCount][RF_PATH_A]; bw20_pwr[TxCount] = hal_data->Index24G_BW40_Base[RF_PATH_A][index]+
/* 1. BW20 */ hal_data->BW20_24G_Diff[TxCount][RF_PATH_A];
BW20PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[RF_PATH_A][index]+ bw40_pwr[TxCount] = hal_data->Index24G_BW40_Base[TxCount][index];
pHalData->BW20_24G_Diff[TxCount][RF_PATH_A];
/* 2. BW40 */
BW40PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[TxCount][index];
} else if (TxCount == RF_PATH_B) { } else if (TxCount == RF_PATH_B) {
/* 1. CCK */ cck_pwr[TxCount] = hal_data->Index24G_CCK_Base[TxCount][index];
cckPowerLevel[TxCount] = pHalData->Index24G_CCK_Base[TxCount][index]; ofdm_pwr[TxCount] = hal_data->Index24G_BW40_Base[RF_PATH_A][index]+
/* 2. OFDM */ hal_data->BW20_24G_Diff[RF_PATH_A][index]+
ofdmPowerLevel[TxCount] = pHalData->Index24G_BW40_Base[RF_PATH_A][index]+ hal_data->BW20_24G_Diff[TxCount][index];
pHalData->BW20_24G_Diff[RF_PATH_A][index]+
pHalData->BW20_24G_Diff[TxCount][index]; bw20_pwr[TxCount] = hal_data->Index24G_BW40_Base[RF_PATH_A][index]+
/* 1. BW20 */ hal_data->BW20_24G_Diff[TxCount][RF_PATH_A]+
BW20PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[RF_PATH_A][index]+ hal_data->BW20_24G_Diff[TxCount][index];
pHalData->BW20_24G_Diff[TxCount][RF_PATH_A]+ bw40_pwr[TxCount] = hal_data->Index24G_BW40_Base[TxCount][index];
pHalData->BW20_24G_Diff[TxCount][index];
/* 2. BW40 */
BW40PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[TxCount][index];
} else if (TxCount == RF_PATH_C) { } else if (TxCount == RF_PATH_C) {
/* 1. CCK */ cck_pwr[TxCount] = hal_data->Index24G_CCK_Base[TxCount][index];
cckPowerLevel[TxCount] = pHalData->Index24G_CCK_Base[TxCount][index]; ofdm_pwr[TxCount] = hal_data->Index24G_BW40_Base[RF_PATH_A][index]+
/* 2. OFDM */ hal_data->BW20_24G_Diff[RF_PATH_A][index]+
ofdmPowerLevel[TxCount] = pHalData->Index24G_BW40_Base[RF_PATH_A][index]+ hal_data->BW20_24G_Diff[RF_PATH_B][index]+
pHalData->BW20_24G_Diff[RF_PATH_A][index]+ hal_data->BW20_24G_Diff[TxCount][index];
pHalData->BW20_24G_Diff[RF_PATH_B][index]+
pHalData->BW20_24G_Diff[TxCount][index]; bw20_pwr[TxCount] = hal_data->Index24G_BW40_Base[RF_PATH_A][index]+
/* 1. BW20 */ hal_data->BW20_24G_Diff[RF_PATH_A][index]+
BW20PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[RF_PATH_A][index]+ hal_data->BW20_24G_Diff[RF_PATH_B][index]+
pHalData->BW20_24G_Diff[RF_PATH_A][index]+ hal_data->BW20_24G_Diff[TxCount][index];
pHalData->BW20_24G_Diff[RF_PATH_B][index]+ bw40_pwr[TxCount] = hal_data->Index24G_BW40_Base[TxCount][index];
pHalData->BW20_24G_Diff[TxCount][index];
/* 2. BW40 */
BW40PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[TxCount][index];
} else if (TxCount == RF_PATH_D) { } else if (TxCount == RF_PATH_D) {
/* 1. CCK */ cck_pwr[TxCount] = hal_data->Index24G_CCK_Base[TxCount][index];
cckPowerLevel[TxCount] = pHalData->Index24G_CCK_Base[TxCount][index]; ofdm_pwr[TxCount] = hal_data->Index24G_BW40_Base[RF_PATH_A][index]+
/* 2. OFDM */ hal_data->BW20_24G_Diff[RF_PATH_A][index]+
ofdmPowerLevel[TxCount] = pHalData->Index24G_BW40_Base[RF_PATH_A][index]+ hal_data->BW20_24G_Diff[RF_PATH_B][index]+
pHalData->BW20_24G_Diff[RF_PATH_A][index]+ hal_data->BW20_24G_Diff[RF_PATH_C][index]+
pHalData->BW20_24G_Diff[RF_PATH_B][index]+ hal_data->BW20_24G_Diff[TxCount][index];
pHalData->BW20_24G_Diff[RF_PATH_C][index]+
pHalData->BW20_24G_Diff[TxCount][index]; bw20_pwr[TxCount] = hal_data->Index24G_BW40_Base[RF_PATH_A][index]+
hal_data->BW20_24G_Diff[RF_PATH_A][index]+
/* 1. BW20 */ hal_data->BW20_24G_Diff[RF_PATH_B][index]+
BW20PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[RF_PATH_A][index]+ hal_data->BW20_24G_Diff[RF_PATH_C][index]+
pHalData->BW20_24G_Diff[RF_PATH_A][index]+ hal_data->BW20_24G_Diff[TxCount][index];
pHalData->BW20_24G_Diff[RF_PATH_B][index]+ bw40_pwr[TxCount] = hal_data->Index24G_BW40_Base[TxCount][index];
pHalData->BW20_24G_Diff[RF_PATH_C][index]+
pHalData->BW20_24G_Diff[TxCount][index];
/* 2. BW40 */
BW40PowerLevel[TxCount] = pHalData->Index24G_BW40_Base[TxCount][index];
} }
} }
} }
...@@ -265,7 +250,7 @@ PHY_SetTxPowerLevel8188E( ...@@ -265,7 +250,7 @@ PHY_SetTxPowerLevel8188E(
u8 BW20PowerLevel[MAX_TX_COUNT] = {0}; u8 BW20PowerLevel[MAX_TX_COUNT] = {0};
u8 BW40PowerLevel[MAX_TX_COUNT] = {0}; u8 BW40PowerLevel[MAX_TX_COUNT] = {0};
getTxPowerIndex88E(Adapter, channel, &cckPowerLevel[0], &ofdmPowerLevel[0], &BW20PowerLevel[0], &BW40PowerLevel[0]); get_tx_power_index(Adapter, channel, &cckPowerLevel[0], &ofdmPowerLevel[0], &BW20PowerLevel[0], &BW40PowerLevel[0]);
phy_PowerIndexCheck88E(Adapter, channel, &cckPowerLevel[0], &ofdmPowerLevel[0], &BW20PowerLevel[0], &BW40PowerLevel[0]); phy_PowerIndexCheck88E(Adapter, channel, &cckPowerLevel[0], &ofdmPowerLevel[0], &BW20PowerLevel[0], &BW40PowerLevel[0]);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment