diff options
Diffstat (limited to 'drivers/net/wireless/bcm43xx/bcm43xx_phy.c')
-rw-r--r-- | drivers/net/wireless/bcm43xx/bcm43xx_phy.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_phy.c b/drivers/net/wireless/bcm43xx/bcm43xx_phy.c index 1ce9a4599903..054c64e462fb 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_phy.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_phy.c | |||
@@ -220,9 +220,9 @@ static void bcm43xx_phy_init_pctl(struct bcm43xx_private *bcm) | |||
220 | bcm43xx_radio_write16(bcm, 0x0076, | 220 | bcm43xx_radio_write16(bcm, 0x0076, |
221 | bcm43xx_radio_read16(bcm, 0x0076) | 0x0084); | 221 | bcm43xx_radio_read16(bcm, 0x0076) | 0x0084); |
222 | } else { | 222 | } else { |
223 | saved_batt = radio->txpower[0]; | 223 | saved_batt = radio->baseband_atten; |
224 | saved_ratt = radio->txpower[1]; | 224 | saved_ratt = radio->radio_atten; |
225 | saved_txctl1 = radio->txpower[2]; | 225 | saved_txctl1 = radio->txctl1; |
226 | if ((radio->revision >= 6) && (radio->revision <= 8) | 226 | if ((radio->revision >= 6) && (radio->revision <= 8) |
227 | && /*FIXME: incomplete specs for 5 < revision < 9 */ 0) | 227 | && /*FIXME: incomplete specs for 5 < revision < 9 */ 0) |
228 | bcm43xx_radio_set_txpower_bg(bcm, 0xB, 0x1F, 0); | 228 | bcm43xx_radio_set_txpower_bg(bcm, 0xB, 0x1F, 0); |
@@ -1039,7 +1039,7 @@ static void bcm43xx_phy_initg(struct bcm43xx_private *bcm) | |||
1039 | bcm43xx_radio_write16(bcm, 0x0078, radio->initval); | 1039 | bcm43xx_radio_write16(bcm, 0x0078, radio->initval); |
1040 | bcm43xx_radio_write16(bcm, 0x0052, | 1040 | bcm43xx_radio_write16(bcm, 0x0052, |
1041 | (bcm43xx_radio_read16(bcm, 0x0052) & 0xFFF0) | 1041 | (bcm43xx_radio_read16(bcm, 0x0052) & 0xFFF0) |
1042 | | radio->txpower[3]); | 1042 | | radio->txctl2); |
1043 | } | 1043 | } |
1044 | 1044 | ||
1045 | if (phy->connected) { | 1045 | if (phy->connected) { |
@@ -1259,7 +1259,6 @@ struct bcm43xx_lopair * bcm43xx_find_lopair(struct bcm43xx_private *bcm, | |||
1259 | if (baseband_attenuation > 6) | 1259 | if (baseband_attenuation > 6) |
1260 | baseband_attenuation = 6; | 1260 | baseband_attenuation = 6; |
1261 | assert(radio_attenuation < 10); | 1261 | assert(radio_attenuation < 10); |
1262 | assert(tx == 0 || tx == 3); | ||
1263 | 1262 | ||
1264 | if (tx == 3) { | 1263 | if (tx == 3) { |
1265 | return bcm43xx_get_lopair(phy, | 1264 | return bcm43xx_get_lopair(phy, |
@@ -1275,9 +1274,9 @@ struct bcm43xx_lopair * bcm43xx_current_lopair(struct bcm43xx_private *bcm) | |||
1275 | struct bcm43xx_radioinfo *radio = bcm43xx_current_radio(bcm); | 1274 | struct bcm43xx_radioinfo *radio = bcm43xx_current_radio(bcm); |
1276 | 1275 | ||
1277 | return bcm43xx_find_lopair(bcm, | 1276 | return bcm43xx_find_lopair(bcm, |
1278 | radio->txpower[0], | 1277 | radio->baseband_atten, |
1279 | radio->txpower[1], | 1278 | radio->radio_atten, |
1280 | radio->txpower[2]); | 1279 | radio->txctl1); |
1281 | } | 1280 | } |
1282 | 1281 | ||
1283 | /* Adjust B/G LO */ | 1282 | /* Adjust B/G LO */ |
@@ -1311,7 +1310,7 @@ static void bcm43xx_phy_lo_g_measure_txctl2(struct bcm43xx_private *bcm) | |||
1311 | txctl2 = i; | 1310 | txctl2 = i; |
1312 | } | 1311 | } |
1313 | } | 1312 | } |
1314 | radio->txpower[3] = txctl2; | 1313 | radio->txctl2 = txctl2; |
1315 | } | 1314 | } |
1316 | 1315 | ||
1317 | static | 1316 | static |
@@ -1530,8 +1529,7 @@ void bcm43xx_phy_lo_g_measure(struct bcm43xx_private *bcm) | |||
1530 | r31 = 0; | 1529 | r31 = 0; |
1531 | } | 1530 | } |
1532 | bcm43xx_radio_write16(bcm, 0x43, i); | 1531 | bcm43xx_radio_write16(bcm, 0x43, i); |
1533 | bcm43xx_radio_write16(bcm, 0x52, | 1532 | bcm43xx_radio_write16(bcm, 0x52, radio->txctl2); |
1534 | radio->txpower[3]); | ||
1535 | udelay(10); | 1533 | udelay(10); |
1536 | 1534 | ||
1537 | bcm43xx_phy_set_baseband_attenuation(bcm, j * 2); | 1535 | bcm43xx_phy_set_baseband_attenuation(bcm, j * 2); |
@@ -1573,7 +1571,7 @@ void bcm43xx_phy_lo_g_measure(struct bcm43xx_private *bcm) | |||
1573 | } | 1571 | } |
1574 | bcm43xx_radio_write16(bcm, 0x43, i - 9); | 1572 | bcm43xx_radio_write16(bcm, 0x43, i - 9); |
1575 | bcm43xx_radio_write16(bcm, 0x52, | 1573 | bcm43xx_radio_write16(bcm, 0x52, |
1576 | radio->txpower[3] | 1574 | radio->txctl2 |
1577 | | (3/*txctl1*/ << 4));//FIXME: shouldn't txctl1 be zero here and 3 in the loop above? | 1575 | | (3/*txctl1*/ << 4));//FIXME: shouldn't txctl1 be zero here and 3 in the loop above? |
1578 | udelay(10); | 1576 | udelay(10); |
1579 | 1577 | ||
@@ -1780,9 +1778,9 @@ void bcm43xx_phy_xmitpower(struct bcm43xx_private *bcm) | |||
1780 | } | 1778 | } |
1781 | 1779 | ||
1782 | /* Calculate the new attenuation values. */ | 1780 | /* Calculate the new attenuation values. */ |
1783 | baseband_attenuation = radio->txpower[0]; | 1781 | baseband_attenuation = radio->baseband_atten; |
1784 | baseband_attenuation += baseband_att_delta; | 1782 | baseband_attenuation += baseband_att_delta; |
1785 | radio_attenuation = radio->txpower[1]; | 1783 | radio_attenuation = radio->radio_atten; |
1786 | radio_attenuation += radio_att_delta; | 1784 | radio_attenuation += radio_att_delta; |
1787 | 1785 | ||
1788 | /* Get baseband and radio attenuation values into their permitted ranges. | 1786 | /* Get baseband and radio attenuation values into their permitted ranges. |
@@ -1807,7 +1805,7 @@ void bcm43xx_phy_xmitpower(struct bcm43xx_private *bcm) | |||
1807 | } | 1805 | } |
1808 | baseband_attenuation = limit_value(baseband_attenuation, 0, 11); | 1806 | baseband_attenuation = limit_value(baseband_attenuation, 0, 11); |
1809 | 1807 | ||
1810 | txpower = radio->txpower[2]; | 1808 | txpower = radio->txctl1; |
1811 | if ((radio->version == 0x2050) && (radio->revision == 2)) { | 1809 | if ((radio->version == 0x2050) && (radio->revision == 2)) { |
1812 | if (radio_attenuation <= 1) { | 1810 | if (radio_attenuation <= 1) { |
1813 | if (txpower == 0) { | 1811 | if (txpower == 0) { |
@@ -1829,7 +1827,7 @@ void bcm43xx_phy_xmitpower(struct bcm43xx_private *bcm) | |||
1829 | } | 1827 | } |
1830 | } | 1828 | } |
1831 | } | 1829 | } |
1832 | radio->txpower[2] = txpower; | 1830 | radio->txctl1 = txpower; |
1833 | baseband_attenuation = limit_value(baseband_attenuation, 0, 11); | 1831 | baseband_attenuation = limit_value(baseband_attenuation, 0, 11); |
1834 | radio_attenuation = limit_value(radio_attenuation, 0, 9); | 1832 | radio_attenuation = limit_value(radio_attenuation, 0, 9); |
1835 | 1833 | ||