Commit 20b7ec09 authored by Mateusz Kulikowski's avatar Mateusz Kulikowski Committed by Greg Kroah-Hartman

staging: rtl8192e: Remove bb tx gains from r8192_priv

r8192_priv structure had 2 big arrays with tx gain register values:
- cck_txbbgain_table
- cck_txbbgain_ch14_table
- txbbgain_table

This arrays were read-only - filled in driver init code and look
like firmware/chip-specific.

This patch removes them from r8192_priv and puts them in (global) variables.

tx_bb_gain is also flattened - register values are stored in array;
Amplification value can be calculated using dm_tx_bb_gain_idx_to_amplify().
Signed-off-by: default avatarMateusz Kulikowski <mateusz.kulikowski@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f6692285
...@@ -918,8 +918,7 @@ bool rtl8192_adapter_start(struct net_device *dev) ...@@ -918,8 +918,7 @@ bool rtl8192_adapter_start(struct net_device *dev)
tmpRegC = rtl8192_QueryBBReg(dev, tmpRegC = rtl8192_QueryBBReg(dev,
rOFDM0_XCTxIQImbalance, bMaskDWord); rOFDM0_XCTxIQImbalance, bMaskDWord);
for (i = 0; i < TxBBGainTableLength; i++) { for (i = 0; i < TxBBGainTableLength; i++) {
if (tmpRegA == if (tmpRegA == dm_tx_bb_gain[i]) {
priv->txbbgain_table[i].txbbgain_value) {
priv->rfa_txpowertrackingindex = (u8)i; priv->rfa_txpowertrackingindex = (u8)i;
priv->rfa_txpowertrackingindex_real = priv->rfa_txpowertrackingindex_real =
(u8)i; (u8)i;
...@@ -933,7 +932,7 @@ bool rtl8192_adapter_start(struct net_device *dev) ...@@ -933,7 +932,7 @@ bool rtl8192_adapter_start(struct net_device *dev)
rCCK0_TxFilter1, bMaskByte2); rCCK0_TxFilter1, bMaskByte2);
for (i = 0; i < CCKTxBBGainTableLength; i++) { for (i = 0; i < CCKTxBBGainTableLength; i++) {
if (TempCCk == priv->cck_txbbgain_table[i].ccktxbb_valuearray[0]) { if (TempCCk == dm_cck_tx_bb_gain[i][0]) {
priv->CCKPresentAttentuation_20Mdefault = (u8)i; priv->CCKPresentAttentuation_20Mdefault = (u8)i;
break; break;
} }
......
...@@ -451,15 +451,6 @@ enum two_port_status { ...@@ -451,15 +451,6 @@ enum two_port_status {
TWO_PORT_STATUS__WITHOUT_ANY_ASSOCIATE TWO_PORT_STATUS__WITHOUT_ANY_ASSOCIATE
}; };
struct txbbgain_struct {
long txbb_iq_amplifygain;
u32 txbbgain_value;
};
struct ccktxbbgain {
u8 ccktxbb_valuearray[8];
};
struct init_gain { struct init_gain {
u8 xaagccore1; u8 xaagccore1;
u8 xbagccore1; u8 xbagccore1;
...@@ -567,11 +558,6 @@ struct r8192_priv { ...@@ -567,11 +558,6 @@ struct r8192_priv {
struct bb_reg_definition PHYRegDef[4]; struct bb_reg_definition PHYRegDef[4];
struct rate_adaptive rate_adaptive; struct rate_adaptive rate_adaptive;
struct ccktxbbgain cck_txbbgain_table[CCKTxBBGainTableLength];
struct ccktxbbgain cck_txbbgain_ch14_table[CCKTxBBGainTableLength];
struct txbbgain_struct txbbgain_table[TxBBGainTableLength];
enum acm_method AcmMethod; enum acm_method AcmMethod;
struct rt_firmware *pFirmware; struct rt_firmware *pFirmware;
......
This diff is collapsed.
...@@ -252,11 +252,20 @@ extern u8 dm_shadow[16][256]; ...@@ -252,11 +252,20 @@ extern u8 dm_shadow[16][256];
extern struct drx_path_sel DM_RxPathSelTable; extern struct drx_path_sel DM_RxPathSelTable;
extern u8 test_flag; extern u8 test_flag;
/* Pre-calculated gain tables */
extern const u32 dm_tx_bb_gain[TxBBGainTableLength];
extern const u8 dm_cck_tx_bb_gain[CCKTxBBGainTableLength][8];
extern const u8 dm_cck_tx_bb_gain_ch14[CCKTxBBGainTableLength][8];
/* Maps table index to iq amplify gain (dB, 12 to -24dB) */
#define dm_tx_bb_gain_idx_to_amplify(idx) (-idx + 12)
/*------------------------Export global variable----------------------------*/ /*------------------------Export global variable----------------------------*/
/*--------------------------Exported Function prototype---------------------*/ /*--------------------------Exported Function prototype---------------------*/
/*--------------------------Exported Function prototype---------------------*/ /*--------------------------Exported Function prototype---------------------*/
extern void init_hal_dm(struct net_device *dev); extern void init_hal_dm(struct net_device *dev);
extern void deinit_hal_dm(struct net_device *dev); extern void deinit_hal_dm(struct net_device *dev);
......
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