aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2010-01-30 14:18:04 -0500
committerJohn W. Linville <linville@tuxdriver.com>2010-02-01 15:40:06 -0500
commit6e3b15a9e7c3e4f22e9ade658b9e185311078648 (patch)
treeb99aecc8c5bff3330ed009a15584e14c78157630 /drivers/net/wireless
parent99b82c419bc685c5ca3d8d815564bac41e2716e2 (diff)
b43: N-PHY: add RSSI selection for newer PHYs
Signed-off-by: Rafał Miłecki <zajec5@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/b43/phy_n.c84
1 files changed, 83 insertions, 1 deletions
diff --git a/drivers/net/wireless/b43/phy_n.c b/drivers/net/wireless/b43/phy_n.c
index 558d3c052d95..0e04a2668ea3 100644
--- a/drivers/net/wireless/b43/phy_n.c
+++ b/drivers/net/wireless/b43/phy_n.c
@@ -1367,7 +1367,89 @@ static void b43_nphy_rev2_rssi_select(struct b43_wldev *dev, u8 code, u8 type)
1367 1367
1368static void b43_nphy_rev3_rssi_select(struct b43_wldev *dev, u8 code, u8 type) 1368static void b43_nphy_rev3_rssi_select(struct b43_wldev *dev, u8 code, u8 type)
1369{ 1369{
1370 /* TODO */ 1370 struct b43_phy_n *nphy = dev->phy.n;
1371 u8 i;
1372 u16 reg, val;
1373
1374 if (code == 0) {
1375 b43_phy_mask(dev, B43_NPHY_AFECTL_OVER1, 0xFDFF);
1376 b43_phy_mask(dev, B43_NPHY_AFECTL_OVER, 0xFDFF);
1377 b43_phy_mask(dev, B43_NPHY_AFECTL_C1, 0xFCFF);
1378 b43_phy_mask(dev, B43_NPHY_AFECTL_C2, 0xFCFF);
1379 b43_phy_mask(dev, B43_NPHY_TXF_40CO_B1S0, 0xFFDF);
1380 b43_phy_mask(dev, B43_NPHY_TXF_40CO_B32S1, 0xFFDF);
1381 b43_phy_mask(dev, B43_NPHY_RFCTL_LUT_TRSW_UP1, 0xFFC3);
1382 b43_phy_mask(dev, B43_NPHY_RFCTL_LUT_TRSW_UP2, 0xFFC3);
1383 } else {
1384 for (i = 0; i < 2; i++) {
1385 if ((code == 1 && i == 1) || (code == 2 && !i))
1386 continue;
1387
1388 reg = (i == 0) ?
1389 B43_NPHY_AFECTL_OVER1 : B43_NPHY_AFECTL_OVER;
1390 b43_phy_maskset(dev, reg, 0xFDFF, 0x0200);
1391
1392 if (type < 3) {
1393 reg = (i == 0) ?
1394 B43_NPHY_AFECTL_C1 :
1395 B43_NPHY_AFECTL_C2;
1396 b43_phy_maskset(dev, reg, 0xFCFF, 0);
1397
1398 reg = (i == 0) ?
1399 B43_NPHY_RFCTL_LUT_TRSW_UP1 :
1400 B43_NPHY_RFCTL_LUT_TRSW_UP2;
1401 b43_phy_maskset(dev, reg, 0xFFC3, 0);
1402
1403 if (type == 0)
1404 val = (b43_current_band(dev->wl) == IEEE80211_BAND_5GHZ) ? 4 : 8;
1405 else if (type == 1)
1406 val = 16;
1407 else
1408 val = 32;
1409 b43_phy_set(dev, reg, val);
1410
1411 reg = (i == 0) ?
1412 B43_NPHY_TXF_40CO_B1S0 :
1413 B43_NPHY_TXF_40CO_B32S1;
1414 b43_phy_set(dev, reg, 0x0020);
1415 } else {
1416 if (type == 6)
1417 val = 0x0100;
1418 else if (type == 3)
1419 val = 0x0200;
1420 else
1421 val = 0x0300;
1422
1423 reg = (i == 0) ?
1424 B43_NPHY_AFECTL_C1 :
1425 B43_NPHY_AFECTL_C2;
1426
1427 b43_phy_maskset(dev, reg, 0xFCFF, val);
1428 b43_phy_maskset(dev, reg, 0xF3FF, val << 2);
1429
1430 if (type != 3 && type != 6) {
1431 enum ieee80211_band band =
1432 b43_current_band(dev->wl);
1433
1434 if ((nphy->ipa2g_on &&
1435 band == IEEE80211_BAND_2GHZ) ||
1436 (nphy->ipa5g_on &&
1437 band == IEEE80211_BAND_5GHZ))
1438 val = (band == IEEE80211_BAND_5GHZ) ? 0xC : 0xE;
1439 else
1440 val = 0x11;
1441 reg = (i == 0) ? 0x2000 : 0x3000;
1442 reg |= B2055_PADDRV;
1443 b43_radio_write16(dev, reg, val);
1444
1445 reg = (i == 0) ?
1446 B43_NPHY_AFECTL_OVER1 :
1447 B43_NPHY_AFECTL_OVER;
1448 b43_phy_set(dev, reg, 0x0200);
1449 }
1450 }
1451 }
1452 }
1371} 1453}
1372 1454
1373/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/RSSISel */ 1455/* http://bcm-v4.sipsolutions.net/802.11/PHY/N/RSSISel */