diff options
author | Gábor Stefanik <netrolller.3d@gmail.com> | 2009-08-11 15:47:00 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-08-14 09:14:03 -0400 |
commit | 84ec167d327b42414285f22eb037a5bdee486ded (patch) | |
tree | 1156219dd35d7590bd614a6499c55a0d93c6ded9 /drivers/net/wireless/b43/phy_lp.c | |
parent | c00552c60840c32456ca9e45de758ac03e3d3c4f (diff) |
b43: LP-PHY: Implement reading band SPROM
Some of the new variables in b43_phy_lp appear to be dead code in
the vendor driver; they will be removed if they remain unused when
LP-PHY implementation is finished.
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/phy_lp.c')
-rw-r--r-- | drivers/net/wireless/b43/phy_lp.c | 85 |
1 files changed, 84 insertions, 1 deletions
diff --git a/drivers/net/wireless/b43/phy_lp.c b/drivers/net/wireless/b43/phy_lp.c index 95e15e6692ac..2bec791041fe 100644 --- a/drivers/net/wireless/b43/phy_lp.c +++ b/drivers/net/wireless/b43/phy_lp.c | |||
@@ -59,6 +59,89 @@ static void b43_lpphy_op_free(struct b43_wldev *dev) | |||
59 | dev->phy.lp = NULL; | 59 | dev->phy.lp = NULL; |
60 | } | 60 | } |
61 | 61 | ||
62 | static void lpphy_read_band_sprom(struct b43_wldev *dev) | ||
63 | { | ||
64 | struct b43_phy_lp *lpphy = dev->phy.lp; | ||
65 | struct ssb_bus *bus = dev->dev->bus; | ||
66 | u16 cckpo, maxpwr; | ||
67 | u32 ofdmpo; | ||
68 | int i; | ||
69 | |||
70 | if (b43_current_band(dev->wl) == IEEE80211_BAND_2GHZ) { | ||
71 | lpphy->tx_isolation_med_band = bus->sprom.tri2g; | ||
72 | lpphy->bx_arch = bus->sprom.bxa2g; | ||
73 | lpphy->rx_pwr_offset = bus->sprom.rxpo2g; | ||
74 | lpphy->rssi_vf = bus->sprom.rssismf2g; | ||
75 | lpphy->rssi_vc = bus->sprom.rssismc2g; | ||
76 | lpphy->rssi_gs = bus->sprom.rssisav2g; | ||
77 | lpphy->txpa[0] = bus->sprom.pa0b0; | ||
78 | lpphy->txpa[1] = bus->sprom.pa0b1; | ||
79 | lpphy->txpa[2] = bus->sprom.pa0b2; | ||
80 | maxpwr = bus->sprom.maxpwr_bg; | ||
81 | lpphy->max_tx_pwr_med_band = maxpwr; | ||
82 | cckpo = bus->sprom.cck2gpo; | ||
83 | ofdmpo = bus->sprom.ofdm2gpo; | ||
84 | if (cckpo) { | ||
85 | for (i = 0; i < 4; i++) { | ||
86 | lpphy->tx_max_rate[i] = | ||
87 | maxpwr - (ofdmpo & 0xF) * 2; | ||
88 | ofdmpo >>= 4; | ||
89 | } | ||
90 | ofdmpo = bus->sprom.ofdm2gpo; | ||
91 | for (i = 4; i < 15; i++) { | ||
92 | lpphy->tx_max_rate[i] = | ||
93 | maxpwr - (ofdmpo & 0xF) * 2; | ||
94 | ofdmpo >>= 4; | ||
95 | } | ||
96 | } else { | ||
97 | ofdmpo &= 0xFF; | ||
98 | for (i = 0; i < 4; i++) | ||
99 | lpphy->tx_max_rate[i] = maxpwr; | ||
100 | for (i = 4; i < 15; i++) | ||
101 | lpphy->tx_max_rate[i] = maxpwr - ofdmpo; | ||
102 | } | ||
103 | } else { /* 5GHz */ | ||
104 | lpphy->tx_isolation_low_band = bus->sprom.tri5gl; | ||
105 | lpphy->tx_isolation_med_band = bus->sprom.tri5g; | ||
106 | lpphy->tx_isolation_hi_band = bus->sprom.tri5gh; | ||
107 | lpphy->bx_arch = bus->sprom.bxa5g; | ||
108 | lpphy->rx_pwr_offset = bus->sprom.rxpo5g; | ||
109 | lpphy->rssi_vf = bus->sprom.rssismf5g; | ||
110 | lpphy->rssi_vc = bus->sprom.rssismc5g; | ||
111 | lpphy->rssi_gs = bus->sprom.rssisav5g; | ||
112 | lpphy->txpa[0] = bus->sprom.pa1b0; | ||
113 | lpphy->txpa[1] = bus->sprom.pa1b1; | ||
114 | lpphy->txpa[2] = bus->sprom.pa1b2; | ||
115 | lpphy->txpal[0] = bus->sprom.pa1lob0; | ||
116 | lpphy->txpal[1] = bus->sprom.pa1lob1; | ||
117 | lpphy->txpal[2] = bus->sprom.pa1lob2; | ||
118 | lpphy->txpah[0] = bus->sprom.pa1hib0; | ||
119 | lpphy->txpah[1] = bus->sprom.pa1hib1; | ||
120 | lpphy->txpah[2] = bus->sprom.pa1hib2; | ||
121 | maxpwr = bus->sprom.maxpwr_al; | ||
122 | ofdmpo = bus->sprom.ofdm5glpo; | ||
123 | lpphy->max_tx_pwr_low_band = maxpwr; | ||
124 | for (i = 4; i < 12; i++) { | ||
125 | lpphy->tx_max_ratel[i] = maxpwr - (ofdmpo & 0xF) * 2; | ||
126 | ofdmpo >>= 4; | ||
127 | } | ||
128 | maxpwr = bus->sprom.maxpwr_a; | ||
129 | ofdmpo = bus->sprom.ofdm5gpo; | ||
130 | lpphy->max_tx_pwr_med_band = maxpwr; | ||
131 | for (i = 4; i < 12; i++) { | ||
132 | lpphy->tx_max_rate[i] = maxpwr - (ofdmpo & 0xF) * 2; | ||
133 | ofdmpo >>= 4; | ||
134 | } | ||
135 | maxpwr = bus->sprom.maxpwr_ah; | ||
136 | ofdmpo = bus->sprom.ofdm5ghpo; | ||
137 | lpphy->max_tx_pwr_hi_band = maxpwr; | ||
138 | for (i = 4; i < 12; i++) { | ||
139 | lpphy->tx_max_rateh[i] = maxpwr - (ofdmpo & 0xF) * 2; | ||
140 | ofdmpo >>= 4; | ||
141 | } | ||
142 | } | ||
143 | } | ||
144 | |||
62 | static void lpphy_adjust_gain_table(struct b43_wldev *dev) | 145 | static void lpphy_adjust_gain_table(struct b43_wldev *dev) |
63 | { | 146 | { |
64 | struct b43_phy_lp *lpphy = dev->phy.lp; | 147 | struct b43_phy_lp *lpphy = dev->phy.lp; |
@@ -694,7 +777,7 @@ static void lpphy_tx_pctl_init(struct b43_wldev *dev) | |||
694 | 777 | ||
695 | static int b43_lpphy_op_init(struct b43_wldev *dev) | 778 | static int b43_lpphy_op_init(struct b43_wldev *dev) |
696 | { | 779 | { |
697 | /* TODO: band SPROM */ | 780 | lpphy_read_band_sprom(dev); //FIXME should this be in prepare_structs? |
698 | lpphy_baseband_init(dev); | 781 | lpphy_baseband_init(dev); |
699 | lpphy_radio_init(dev); | 782 | lpphy_radio_init(dev); |
700 | //TODO calibrate RC | 783 | //TODO calibrate RC |