Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4d0707e6 authored by Senthil Balasubramanian's avatar Senthil Balasubramanian Committed by John W. Linville
Browse files

ath9k_hw: Split tx/rx gain table initval handling



Split tx/rx gain table initval hanlding part so readability
is better and easy to manage the code.

Signed-off-by: default avatarSenthil Balasubramanian <senthilb@qca.qualcomm.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent ce407afc
Loading
Loading
Loading
Loading
+210 −180
Original line number Diff line number Diff line
@@ -374,11 +374,8 @@ static void ar9003_hw_init_mode_regs(struct ath_hw *ah)
	}
}

static void ar9003_tx_gain_table_apply(struct ath_hw *ah)
static void ar9003_tx_gain_table_mode0(struct ath_hw *ah)
{
	switch (ar9003_hw_get_tx_gain_idx(ah)) {
	case 0:
	default:
	if (AR_SREV_9330_12(ah))
		INIT_INI_ARRAY(&ah->iniModesTxGain,
			ar9331_modes_lowest_ob_db_tx_gain_1p2,
@@ -409,8 +406,10 @@ static void ar9003_tx_gain_table_apply(struct ath_hw *ah)
			ar9300Modes_lowest_ob_db_tx_gain_table_2p2,
			ARRAY_SIZE(ar9300Modes_lowest_ob_db_tx_gain_table_2p2),
			5);
		break;
	case 1:
}

static void ar9003_tx_gain_table_mode1(struct ath_hw *ah)
{
	if (AR_SREV_9330_12(ah))
		INIT_INI_ARRAY(&ah->iniModesTxGain,
			ar9331_modes_high_ob_db_tx_gain_1p2,
@@ -441,8 +440,10 @@ static void ar9003_tx_gain_table_apply(struct ath_hw *ah)
			ar9300Modes_high_ob_db_tx_gain_table_2p2,
			ARRAY_SIZE(ar9300Modes_high_ob_db_tx_gain_table_2p2),
			5);
		break;
	case 2:
}

static void ar9003_tx_gain_table_mode2(struct ath_hw *ah)
{
	if (AR_SREV_9330_12(ah))
		INIT_INI_ARRAY(&ah->iniModesTxGain,
			ar9331_modes_low_ob_db_tx_gain_1p2,
@@ -473,8 +474,10 @@ static void ar9003_tx_gain_table_apply(struct ath_hw *ah)
			ar9300Modes_low_ob_db_tx_gain_table_2p2,
			ARRAY_SIZE(ar9300Modes_low_ob_db_tx_gain_table_2p2),
			5);
		break;
	case 3:
}

static void ar9003_tx_gain_table_mode3(struct ath_hw *ah)
{
	if (AR_SREV_9330_12(ah))
		INIT_INI_ARRAY(&ah->iniModesTxGain,
			ar9331_modes_high_power_tx_gain_1p2,
@@ -505,15 +508,29 @@ static void ar9003_tx_gain_table_apply(struct ath_hw *ah)
			ar9300Modes_high_power_tx_gain_table_2p2,
			ARRAY_SIZE(ar9300Modes_high_power_tx_gain_table_2p2),
			5);
		break;
	}
}

static void ar9003_rx_gain_table_apply(struct ath_hw *ah)
static void ar9003_tx_gain_table_apply(struct ath_hw *ah)
{
	switch (ar9003_hw_get_rx_gain_idx(ah)) {
	switch (ar9003_hw_get_tx_gain_idx(ah)) {
	case 0:
	default:
		ar9003_tx_gain_table_mode0(ah);
		break;
	case 1:
		ar9003_tx_gain_table_mode1(ah);
		break;
	case 2:
		ar9003_tx_gain_table_mode2(ah);
		break;
	case 3:
		ar9003_tx_gain_table_mode3(ah);
		break;
	}
}

static void ar9003_rx_gain_table_mode0(struct ath_hw *ah)
{
	if (AR_SREV_9330_12(ah))
		INIT_INI_ARRAY(&ah->iniModesRxGain,
				ar9331_common_rx_gain_1p2,
@@ -544,8 +561,10 @@ static void ar9003_rx_gain_table_apply(struct ath_hw *ah)
				ar9300Common_rx_gain_table_2p2,
				ARRAY_SIZE(ar9300Common_rx_gain_table_2p2),
				2);
		break;
	case 1:
}

static void ar9003_rx_gain_table_mode1(struct ath_hw *ah)
{
	if (AR_SREV_9330_12(ah))
		INIT_INI_ARRAY(&ah->iniModesRxGain,
			ar9331_common_wo_xlna_rx_gain_1p2,
@@ -576,6 +595,17 @@ static void ar9003_rx_gain_table_apply(struct ath_hw *ah)
			ar9300Common_wo_xlna_rx_gain_table_2p2,
			ARRAY_SIZE(ar9300Common_wo_xlna_rx_gain_table_2p2),
			2);
}

static void ar9003_rx_gain_table_apply(struct ath_hw *ah)
{
	switch (ar9003_hw_get_rx_gain_idx(ah)) {
	case 0:
	default:
		ar9003_rx_gain_table_mode0(ah);
		break;
	case 1:
		ar9003_rx_gain_table_mode1(ah);
		break;
	}
}