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

Commit 6b346e54 authored by Rafał Miłecki's avatar Rafał Miłecki Committed by John W. Linville
Browse files

b43: N-PHY: update digital filters setup



This fixes handling channel 14 and adds code for BCM43217.

Signed-off-by: default avatarRafał Miłecki <zajec5@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 5b5ee450
Loading
Loading
Loading
Loading
+22 −7
Original line number Original line Diff line number Diff line
@@ -4832,24 +4832,39 @@ static void b43_nphy_int_pa_set_tx_dig_filters(struct b43_wldev *dev)
{
{
	/* B43_NPHY_TXF_20CO_S0A1, B43_NPHY_TXF_40CO_S0A1, unknown */
	/* B43_NPHY_TXF_20CO_S0A1, B43_NPHY_TXF_40CO_S0A1, unknown */
	static const u16 offset[] = { 0x186, 0x195, 0x2C5 };
	static const u16 offset[] = { 0x186, 0x195, 0x2C5 };
	static const s16 dig_filter_phy_rev16[] = {
		-375, 136, -407, 208, -1527,
		956, 93, 186, 93, 230,
		-44, 230, 201, -191, 201,
	};
	int i;
	int i;


	for (i = 0; i < 3; i++)
	for (i = 0; i < 3; i++)
		b43_nphy_pa_set_tx_dig_filter(dev, offset[i],
		b43_nphy_pa_set_tx_dig_filter(dev, offset[i],
					      tbl_tx_filter_coef_rev4[i]);
					      tbl_tx_filter_coef_rev4[i]);


	/* Verified with BCM43227 and BCM43228 */
	if (dev->phy.rev == 16)
		b43_nphy_pa_set_tx_dig_filter(dev, 0x186, dig_filter_phy_rev16);

	if (dev->dev->chip_id == BCMA_CHIP_ID_BCM43217) {
		b43_nphy_pa_set_tx_dig_filter(dev, 0x186, dig_filter_phy_rev16);
		b43_nphy_pa_set_tx_dig_filter(dev, 0x195,
					      tbl_tx_filter_coef_rev4[1]);
	}

	if (b43_is_40mhz(dev)) {
	if (b43_is_40mhz(dev)) {
		b43_nphy_pa_set_tx_dig_filter(dev, 0x186,
		b43_nphy_pa_set_tx_dig_filter(dev, 0x186,
					      tbl_tx_filter_coef_rev4[3]);
					      tbl_tx_filter_coef_rev4[3]);
	} else if (b43_current_band(dev->wl) == IEEE80211_BAND_5GHZ) {
	} else {
		if (b43_current_band(dev->wl) == IEEE80211_BAND_5GHZ)
			b43_nphy_pa_set_tx_dig_filter(dev, 0x186,
			b43_nphy_pa_set_tx_dig_filter(dev, 0x186,
						      tbl_tx_filter_coef_rev4[5]);
						      tbl_tx_filter_coef_rev4[5]);
	}

		if (dev->phy.channel == 14)
		if (dev->phy.channel == 14)
			b43_nphy_pa_set_tx_dig_filter(dev, 0x186,
			b43_nphy_pa_set_tx_dig_filter(dev, 0x186,
						      tbl_tx_filter_coef_rev4[6]);
						      tbl_tx_filter_coef_rev4[6]);
	}
	}
}


/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/GetTxGain */
/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/GetTxGain */
static struct nphy_txgains b43_nphy_get_tx_gains(struct b43_wldev *dev)
static struct nphy_txgains b43_nphy_get_tx_gains(struct b43_wldev *dev)