aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2010-01-30 14:18:03 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-02-01 15:40:06 -0500
commit99b82c419bc685c5ca3d8d815564bac41e2716e2 (patch)
tree0adb610aaf8d81ed6bd6e9c68201c2f2b803b06d /drivers
parent09d989d179d0c679043556dda77c51b41a2dae7e (diff)
b43: N-PHY: split RSSI selection into two per-PHY-revision functions
Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/b43/phy_n.c101
1 files changed, 52 insertions, 49 deletions
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index d738d769b025..558d3c052d95 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -1316,66 +1316,69 @@ static void b43_nphy_scale_offset_rssi(struct b43_wldev *dev, u16 scale,
1316 b43_phy_write(dev, B43_NPHY_RSSIMC_1Q_TSSI, tmp); 1316 b43_phy_write(dev, B43_NPHY_RSSIMC_1Q_TSSI, tmp);
1317} 1317}
1318 1318
1319/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/RSSISel */ 1319static void b43_nphy_rev2_rssi_select(struct b43_wldev *dev, u8 code, u8 type)
1320static void b43_nphy_rssi_select(struct b43_wldev *dev, u8 code, u8 type)
1321{ 1320{
1322 u16 val; 1321 u16 val;
1323 1322
1324 if (dev->phy.rev >= 3) { 1323 if (type < 3)
1325 /* TODO */ 1324 val = 0;
1326 } else { 1325 else if (type == 6)
1327 if (type < 3) 1326 val = 1;
1328 val = 0; 1327 else if (type == 3)
1329 else if (type == 6) 1328 val = 2;
1330 val = 1; 1329 else
1331 else if (type == 3) 1330 val = 3;
1332 val = 2;
1333 else
1334 val = 3;
1335 1331
1336 val = (val << 12) | (val << 14); 1332 val = (val << 12) | (val << 14);
1337 b43_phy_maskset(dev, B43_NPHY_AFECTL_C1, 0x0FFF, val); 1333 b43_phy_maskset(dev, B43_NPHY_AFECTL_C1, 0x0FFF, val);
1338 b43_phy_maskset(dev, B43_NPHY_AFECTL_C2, 0x0FFF, val); 1334 b43_phy_maskset(dev, B43_NPHY_AFECTL_C2, 0x0FFF, val);
1339 1335
1336 if (type < 3) {
1337 b43_phy_maskset(dev, B43_NPHY_RFCTL_RSSIO1, 0xFFCF,
1338 (type + 1) << 4);
1339 b43_phy_maskset(dev, B43_NPHY_RFCTL_RSSIO2, 0xFFCF,
1340 (type + 1) << 4);
1341 }
1342
1343 /* TODO use some definitions */
1344 if (code == 0) {
1345 b43_phy_maskset(dev, B43_NPHY_AFECTL_OVER, 0xCFFF, 0);
1340 if (type < 3) { 1346 if (type < 3) {
1341 b43_phy_maskset(dev, B43_NPHY_RFCTL_RSSIO1, 0xFFCF, 1347 b43_phy_maskset(dev, B43_NPHY_RFCTL_CMD, 0xFEC7, 0);
1342 (type + 1) << 4); 1348 b43_phy_maskset(dev, B43_NPHY_RFCTL_OVER, 0xEFDC, 0);
1343 b43_phy_maskset(dev, B43_NPHY_RFCTL_RSSIO2, 0xFFCF, 1349 b43_phy_maskset(dev, B43_NPHY_RFCTL_CMD, 0xFFFE, 0);
1344 (type + 1) << 4); 1350 udelay(20);
1351 b43_phy_maskset(dev, B43_NPHY_RFCTL_OVER, 0xFFFE, 0);
1345 } 1352 }
1346 1353 } else {
1347 /* TODO use some definitions */ 1354 b43_phy_maskset(dev, B43_NPHY_AFECTL_OVER, 0xCFFF,
1348 if (code == 0) { 1355 0x3000);
1349 b43_phy_maskset(dev, B43_NPHY_AFECTL_OVER, 0xCFFF, 0); 1356 if (type < 3) {
1350 if (type < 3) { 1357 b43_phy_maskset(dev, B43_NPHY_RFCTL_CMD,
1351 b43_phy_maskset(dev, B43_NPHY_RFCTL_CMD, 1358 0xFEC7, 0x0180);
1352 0xFEC7, 0); 1359 b43_phy_maskset(dev, B43_NPHY_RFCTL_OVER,
1353 b43_phy_maskset(dev, B43_NPHY_RFCTL_OVER, 1360 0xEFDC, (code << 1 | 0x1021));
1354 0xEFDC, 0); 1361 b43_phy_maskset(dev, B43_NPHY_RFCTL_CMD, 0xFFFE, 0x1);
1355 b43_phy_maskset(dev, B43_NPHY_RFCTL_CMD, 1362 udelay(20);
1356 0xFFFE, 0); 1363 b43_phy_maskset(dev, B43_NPHY_RFCTL_OVER, 0xFFFE, 0);
1357 udelay(20);
1358 b43_phy_maskset(dev, B43_NPHY_RFCTL_OVER,
1359 0xFFFE, 0);
1360 }
1361 } else {
1362 b43_phy_maskset(dev, B43_NPHY_AFECTL_OVER, 0xCFFF,
1363 0x3000);
1364 if (type < 3) {
1365 b43_phy_maskset(dev, B43_NPHY_RFCTL_CMD,
1366 0xFEC7, 0x0180);
1367 b43_phy_maskset(dev, B43_NPHY_RFCTL_OVER,
1368 0xEFDC, (code << 1 | 0x1021));
1369 b43_phy_maskset(dev, B43_NPHY_RFCTL_CMD,
1370 0xFFFE, 0x0001);
1371 udelay(20);
1372 b43_phy_maskset(dev, B43_NPHY_RFCTL_OVER,
1373 0xFFFE, 0);
1374 }
1375 } 1364 }
1376 } 1365 }
1377} 1366}
1378 1367
1368static void b43_nphy_rev3_rssi_select(struct b43_wldev *dev, u8 code, u8 type)
1369{
1370 /* TODO */
1371}
1372
1373/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/RSSISel */
1374static void b43_nphy_rssi_select(struct b43_wldev *dev, u8 code, u8 type)
1375{
1376 if (dev->phy.rev >= 3)
1377 b43_nphy_rev3_rssi_select(dev, code, type);
1378 else
1379 b43_nphy_rev2_rssi_select(dev, code, type);
1380}
1381
1379/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/SetRssi2055Vcm */ 1382/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/SetRssi2055Vcm */
1380static void b43_nphy_set_rssi_2055_vcm(struct b43_wldev *dev, u8 type, u8 *buf) 1383static void b43_nphy_set_rssi_2055_vcm(struct b43_wldev *dev, u8 type, u8 *buf)
1381{ 1384{