Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 419347
Collapse All | Expand All

(-)./drivers/net/wireless/iwlwifi/iwl-eeprom.c.old (-9 / +9 lines)
Lines 511-542 Link Here
511
******************************************************************************/
511
******************************************************************************/
512
/**
512
/**
513
 * iwl_get_max_txpower_avg - get the highest tx power from all chains.
513
 * iwl_get_max_txpower_avg - get the highest tx power from all chains.
514
 *     find the highest tx power from all chains for the channel
514
 *     find the highest tx power from all chains for the channel
515
 */
515
 */
516
static s8 iwl_get_max_txpower_avg(const struct iwl_cfg *cfg,
516
static s8 iwl_get_max_txpower_avg(const struct iwl_priv *priv,
517
		struct iwl_eeprom_enhanced_txpwr *enhanced_txpower,
517
		struct iwl_eeprom_enhanced_txpwr *enhanced_txpower,
518
		int element, s8 *max_txpower_in_half_dbm)
518
		int element, s8 *max_txpower_in_half_dbm)
519
{
519
{
520
	s8 max_txpower_avg = 0; /* (dBm) */
520
	s8 max_txpower_avg = 0; /* (dBm) */
521
521
522
	/* Take the highest tx power from any valid chains */
522
	/* Take the highest tx power from any valid chains */
523
	if ((cfg->valid_tx_ant & ANT_A) &&
523
	if ((hw_params(priv).valid_tx_ant & ANT_A) &&
524
	    (enhanced_txpower[element].chain_a_max > max_txpower_avg))
524
	    (enhanced_txpower[element].chain_a_max > max_txpower_avg))
525
		max_txpower_avg = enhanced_txpower[element].chain_a_max;
525
		max_txpower_avg = enhanced_txpower[element].chain_a_max;
526
	if ((cfg->valid_tx_ant & ANT_B) &&
526
	if ((hw_params(priv).valid_tx_ant & ANT_B) &&
527
	    (enhanced_txpower[element].chain_b_max > max_txpower_avg))
527
	    (enhanced_txpower[element].chain_b_max > max_txpower_avg))
528
		max_txpower_avg = enhanced_txpower[element].chain_b_max;
528
		max_txpower_avg = enhanced_txpower[element].chain_b_max;
529
	if ((cfg->valid_tx_ant & ANT_C) &&
529
	if ((hw_params(priv).valid_tx_ant & ANT_C) &&
530
	    (enhanced_txpower[element].chain_c_max > max_txpower_avg))
530
	    (enhanced_txpower[element].chain_c_max > max_txpower_avg))
531
		max_txpower_avg = enhanced_txpower[element].chain_c_max;
531
		max_txpower_avg = enhanced_txpower[element].chain_c_max;
532
	if (((cfg->valid_tx_ant == ANT_AB) |
532
	if (((hw_params(priv).valid_tx_ant == ANT_AB) |
533
	    (cfg->valid_tx_ant == ANT_BC) |
533
	    (hw_params(priv).valid_tx_ant == ANT_BC) |
534
	    (cfg->valid_tx_ant == ANT_AC)) &&
534
	    (hw_params(priv).valid_tx_ant == ANT_AC)) &&
535
	    (enhanced_txpower[element].mimo2_max > max_txpower_avg))
535
	    (enhanced_txpower[element].mimo2_max > max_txpower_avg))
536
		max_txpower_avg =  enhanced_txpower[element].mimo2_max;
536
		max_txpower_avg =  enhanced_txpower[element].mimo2_max;
537
	if ((cfg->valid_tx_ant == ANT_ABC) &&
537
	if ((hw_params(priv).valid_tx_ant == ANT_ABC) &&
538
	    (enhanced_txpower[element].mimo3_max > max_txpower_avg))
538
	    (enhanced_txpower[element].mimo3_max > max_txpower_avg))
539
		max_txpower_avg = enhanced_txpower[element].mimo3_max;
539
		max_txpower_avg = enhanced_txpower[element].mimo3_max;
540
540
541
	/*
541
	/*
542
	 * max. tx power in EEPROM is in 1/2 dBm format
542
	 * max. tx power in EEPROM is in 1/2 dBm format
Lines 635-645 Link Here
635
				 "Low 20_on_40: 0x%02x\n",
635
				 "Low 20_on_40: 0x%02x\n",
636
				 txp->mimo2_max, txp->mimo3_max,
636
				 txp->mimo2_max, txp->mimo3_max,
637
				 ((txp->delta_20_in_40 & 0xf0) >> 4),
637
				 ((txp->delta_20_in_40 & 0xf0) >> 4),
638
				 (txp->delta_20_in_40 & 0x0f));
638
				 (txp->delta_20_in_40 & 0x0f));
639
639
640
		max_txp_avg = iwl_get_max_txpower_avg(cfg(priv), txp_array, idx,
640
		max_txp_avg = iwl_get_max_txpower_avg(priv, txp_array, idx,
641
						      &max_txp_avg_halfdbm);
641
						      &max_txp_avg_halfdbm);
642
642
643
		/*
643
		/*
644
		 * Update the user limit values values to the highest
644
		 * Update the user limit values values to the highest
645
		 * power supported by any channel
645
		 * power supported by any channel

Return to bug 419347