diff options
author | Gábor Stefanik <netrolller.3d@gmail.com> | 2009-08-27 16:49:49 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-08-28 14:40:55 -0400 |
commit | 64e368bf9c3690eebd4b3a5cc243f39e902ecdd1 (patch) | |
tree | f39751877ea511aa2ecc640278c6560be0301c06 /drivers/net/wireless/b43 | |
parent | 867b2efe68b6bb929e3bd1c6d699ba61ff2cf847 (diff) |
b43: Implement antenna diversity support for LP-PHY
The A/G-PHY changes are fallout fixes from the enum change,
which in turn allows the LP-PHY code to be much simpler.
The antenna_to_phyctl change is a fix for a potential
existing bug that this patch may otherwise trigger.
Signed-off-by: Gábor Stefanik <netrolller.3d@gmail.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/b43')
-rw-r--r-- | drivers/net/wireless/b43/main.c | 3 | ||||
-rw-r--r-- | drivers/net/wireless/b43/phy_a.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/b43/phy_common.h | 10 | ||||
-rw-r--r-- | drivers/net/wireless/b43/phy_g.c | 2 | ||||
-rw-r--r-- | drivers/net/wireless/b43/phy_lp.c | 9 |
5 files changed, 17 insertions, 9 deletions
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c index f5bdf1cae1d1..0f168443ad49 100644 --- a/drivers/net/wireless/b43/main.c +++ b/drivers/net/wireless/b43/main.c | |||
@@ -1456,7 +1456,8 @@ static u16 b43_antenna_to_phyctl(int antenna) | |||
1456 | return B43_TXH_PHY_ANT2; | 1456 | return B43_TXH_PHY_ANT2; |
1457 | case B43_ANTENNA3: | 1457 | case B43_ANTENNA3: |
1458 | return B43_TXH_PHY_ANT3; | 1458 | return B43_TXH_PHY_ANT3; |
1459 | case B43_ANTENNA_AUTO: | 1459 | case B43_ANTENNA_AUTO0: |
1460 | case B43_ANTENNA_AUTO1: | ||
1460 | return B43_TXH_PHY_ANT01AUTO; | 1461 | return B43_TXH_PHY_ANT01AUTO; |
1461 | } | 1462 | } |
1462 | B43_WARN_ON(1); | 1463 | B43_WARN_ON(1); |
diff --git a/drivers/net/wireless/b43/phy_a.c b/drivers/net/wireless/b43/phy_a.c index 816e028a2620..809ec97031cb 100644 --- a/drivers/net/wireless/b43/phy_a.c +++ b/drivers/net/wireless/b43/phy_a.c | |||
@@ -531,7 +531,7 @@ static void b43_aphy_op_set_rx_antenna(struct b43_wldev *dev, int antenna) | |||
531 | 531 | ||
532 | tmp = b43_phy_read(dev, B43_PHY_BBANDCFG); | 532 | tmp = b43_phy_read(dev, B43_PHY_BBANDCFG); |
533 | tmp &= ~B43_PHY_BBANDCFG_RXANT; | 533 | tmp &= ~B43_PHY_BBANDCFG_RXANT; |
534 | tmp |= (autodiv ? B43_ANTENNA_AUTO0 : antenna) | 534 | tmp |= (autodiv ? B43_ANTENNA_AUTO1 : antenna) |
535 | << B43_PHY_BBANDCFG_RXANT_SHIFT; | 535 | << B43_PHY_BBANDCFG_RXANT_SHIFT; |
536 | b43_phy_write(dev, B43_PHY_BBANDCFG, tmp); | 536 | b43_phy_write(dev, B43_PHY_BBANDCFG, tmp); |
537 | 537 | ||
diff --git a/drivers/net/wireless/b43/phy_common.h b/drivers/net/wireless/b43/phy_common.h index b47a0f55c0b6..28e384633c34 100644 --- a/drivers/net/wireless/b43/phy_common.h +++ b/drivers/net/wireless/b43/phy_common.h | |||
@@ -49,11 +49,11 @@ enum b43_interference_mitigation { | |||
49 | 49 | ||
50 | /* Antenna identifiers */ | 50 | /* Antenna identifiers */ |
51 | enum { | 51 | enum { |
52 | B43_ANTENNA0, /* Antenna 0 */ | 52 | B43_ANTENNA0 = 0, /* Antenna 0 */ |
53 | B43_ANTENNA1, /* Antenna 0 */ | 53 | B43_ANTENNA1 = 1, /* Antenna 1 */ |
54 | B43_ANTENNA_AUTO1, /* Automatic, starting with antenna 1 */ | 54 | B43_ANTENNA_AUTO0 = 2, /* Automatic, starting with antenna 0 */ |
55 | B43_ANTENNA_AUTO0, /* Automatic, starting with antenna 0 */ | 55 | B43_ANTENNA_AUTO1 = 3, /* Automatic, starting with antenna 1 */ |
56 | B43_ANTENNA2, | 56 | B43_ANTENNA2 = 4, |
57 | B43_ANTENNA3 = 8, | 57 | B43_ANTENNA3 = 8, |
58 | 58 | ||
59 | B43_ANTENNA_AUTO = B43_ANTENNA_AUTO0, | 59 | B43_ANTENNA_AUTO = B43_ANTENNA_AUTO0, |
diff --git a/drivers/net/wireless/b43/phy_g.c b/drivers/net/wireless/b43/phy_g.c index e47131216a67..bdff9afe3f81 100644 --- a/drivers/net/wireless/b43/phy_g.c +++ b/drivers/net/wireless/b43/phy_g.c | |||
@@ -2664,7 +2664,7 @@ static void b43_gphy_op_set_rx_antenna(struct b43_wldev *dev, int antenna) | |||
2664 | 2664 | ||
2665 | tmp = b43_phy_read(dev, B43_PHY_BBANDCFG); | 2665 | tmp = b43_phy_read(dev, B43_PHY_BBANDCFG); |
2666 | tmp &= ~B43_PHY_BBANDCFG_RXANT; | 2666 | tmp &= ~B43_PHY_BBANDCFG_RXANT; |
2667 | tmp |= (autodiv ? B43_ANTENNA_AUTO0 : antenna) | 2667 | tmp |= (autodiv ? B43_ANTENNA_AUTO1 : antenna) |
2668 | << B43_PHY_BBANDCFG_RXANT_SHIFT; | 2668 | << B43_PHY_BBANDCFG_RXANT_SHIFT; |
2669 | b43_phy_write(dev, B43_PHY_BBANDCFG, tmp); | 2669 | b43_phy_write(dev, B43_PHY_BBANDCFG, tmp); |
2670 | 2670 | ||
diff --git a/drivers/net/wireless/b43/phy_lp.c b/drivers/net/wireless/b43/phy_lp.c index 7d2a7027235a..1ab00b034cbd 100644 --- a/drivers/net/wireless/b43/phy_lp.c +++ b/drivers/net/wireless/b43/phy_lp.c | |||
@@ -2205,7 +2205,14 @@ static int b43_lpphy_op_init(struct b43_wldev *dev) | |||
2205 | 2205 | ||
2206 | static void b43_lpphy_op_set_rx_antenna(struct b43_wldev *dev, int antenna) | 2206 | static void b43_lpphy_op_set_rx_antenna(struct b43_wldev *dev, int antenna) |
2207 | { | 2207 | { |
2208 | //TODO | 2208 | if (dev->phy.rev >= 2) |
2209 | return; // rev2+ doesn't support antenna diversity | ||
2210 | |||
2211 | if (B43_WARN_ON(antenna > B43_ANTENNA_AUTO1)) | ||
2212 | return; | ||
2213 | |||
2214 | b43_phy_maskset(dev, B43_LPPHY_CRSGAIN_CTL, 0xFFFD, antenna & 0x2); | ||
2215 | b43_phy_maskset(dev, B43_LPPHY_CRSGAIN_CTL, 0xFFFE, antenna & 0x1); | ||
2209 | } | 2216 | } |
2210 | 2217 | ||
2211 | static void b43_lpphy_op_adjust_txpower(struct b43_wldev *dev) | 2218 | static void b43_lpphy_op_adjust_txpower(struct b43_wldev *dev) |