aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/b43
diff options
context:
space:
mode:
authorRafał Miłecki <zajec5@gmail.com>2011-08-31 17:36:20 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-09-13 15:53:46 -0400
commitbce4dc4a5d6c0ec9b40e353023a4bb30f791dfd2 (patch)
tree24d4fae4ca358159818c8e00196fb80c04f4a20a /drivers/net/wireless/b43
parent71c1d1e97f5849078a68992aee97d0bbe128ac63 (diff)
b43: LCN-PHY: rename functions, get rid of magic names
We've compared b43 with brcmsmac and took functions names from the later. Signed-off-by: Rafał Miłecki <zajec5@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/phy_lcn.c29
-rw-r--r--drivers/net/wireless/b43/tables_phy_lcn.c10
2 files changed, 29 insertions, 10 deletions
diff --git a/drivers/net/wireless/b43/phy_lcn.c b/drivers/net/wireless/b43/phy_lcn.c
index 9e575774e192..b461278c2442 100644
--- a/drivers/net/wireless/b43/phy_lcn.c
+++ b/drivers/net/wireless/b43/phy_lcn.c
@@ -31,6 +31,7 @@
31 * Radio 2064. 31 * Radio 2064.
32 **************************************************/ 32 **************************************************/
33 33
34/* wlc_lcnphy_radio_2064_channel_tune_4313 */
34static void b43_radio_2064_channel_setup(struct b43_wldev *dev) 35static void b43_radio_2064_channel_setup(struct b43_wldev *dev)
35{ 36{
36 u16 save[2]; 37 u16 save[2];
@@ -73,6 +74,7 @@ static void b43_radio_2064_channel_setup(struct b43_wldev *dev)
73 b43_radio_write(dev, 0x091, 0x7); 74 b43_radio_write(dev, 0x091, 0x7);
74} 75}
75 76
77/* wlc_radio_2064_init */
76static void b43_radio_2064_init(struct b43_wldev *dev) 78static void b43_radio_2064_init(struct b43_wldev *dev)
77{ 79{
78 b43_radio_write(dev, 0x09c, 0x0020); 80 b43_radio_write(dev, 0x09c, 0x0020);
@@ -122,6 +124,7 @@ static void b43_radio_2064_init(struct b43_wldev *dev)
122 * Various PHY ops 124 * Various PHY ops
123 **************************************************/ 125 **************************************************/
124 126
127/* wlc_lcnphy_toggle_afe_pwdn */
125static void b43_phy_lcn_afe_set_unset(struct b43_wldev *dev) 128static void b43_phy_lcn_afe_set_unset(struct b43_wldev *dev)
126{ 129{
127 u16 afe_ctl2 = b43_phy_read(dev, B43_PHY_LCN_AFE_CTL2); 130 u16 afe_ctl2 = b43_phy_read(dev, B43_PHY_LCN_AFE_CTL2);
@@ -137,7 +140,8 @@ static void b43_phy_lcn_afe_set_unset(struct b43_wldev *dev)
137 b43_phy_write(dev, B43_PHY_LCN_AFE_CTL1, afe_ctl1); 140 b43_phy_write(dev, B43_PHY_LCN_AFE_CTL1, afe_ctl1);
138} 141}
139 142
140static void b43_phy_lcn_clear_0x07_table(struct b43_wldev *dev) 143/* wlc_lcnphy_clear_tx_power_offsets */
144static void b43_phy_lcn_clear_tx_power_offsets(struct b43_wldev *dev)
141{ 145{
142 u8 i; 146 u8 i;
143 147
@@ -154,7 +158,8 @@ static void b43_phy_lcn_clear_0x07_table(struct b43_wldev *dev)
154 } 158 }
155} 159}
156 160
157static void b43_phy_lcn_pre_radio_init(struct b43_wldev *dev) 161/* wlc_lcnphy_rev0_baseband_init */
162static void b43_phy_lcn_rev0_baseband_init(struct b43_wldev *dev)
158{ 163{
159 b43_radio_write(dev, 0x11c, 0); 164 b43_radio_write(dev, 0x11c, 0);
160 165
@@ -181,7 +186,11 @@ static void b43_phy_lcn_pre_radio_init(struct b43_wldev *dev)
181 b43_phy_maskset(dev, 0x448, ~0x300, 0x100); 186 b43_phy_maskset(dev, 0x448, ~0x300, 0x100);
182 b43_phy_maskset(dev, 0x608, ~0xff, 0x17); 187 b43_phy_maskset(dev, 0x608, ~0xff, 0x17);
183 b43_phy_maskset(dev, 0x604, ~0x7ff, 0x3ea); 188 b43_phy_maskset(dev, 0x604, ~0x7ff, 0x3ea);
189}
184 190
191/* wlc_lcnphy_bu_tweaks */
192static void b43_phy_lcn_bu_tweaks(struct b43_wldev *dev)
193{
185 b43_phy_set(dev, 0x805, 0x1); 194 b43_phy_set(dev, 0x805, 0x1);
186 195
187 b43_phy_maskset(dev, 0x42f, ~0x7, 0x3); 196 b43_phy_maskset(dev, 0x42f, ~0x7, 0x3);
@@ -203,9 +212,16 @@ static void b43_phy_lcn_pre_radio_init(struct b43_wldev *dev)
203 b43_phy_write(dev, 0x7d6, 0x0902); 212 b43_phy_write(dev, 0x7d6, 0x0902);
204 213
205 /* TODO: more ops */ 214 /* TODO: more ops */
215
216 if (dev->phy.rev == 1) {
217 /* TODO: more ops */
218
219 b43_phy_lcn_clear_tx_power_offsets(dev);
220 }
206} 221}
207 222
208static void b43_phy_lcn_save_configsth_restore(struct b43_wldev *dev) 223/* wlc_lcnphy_vbat_temp_sense_setup */
224static void b43_phy_lcn_sense_setup(struct b43_wldev *dev)
209{ 225{
210 u8 i; 226 u8 i;
211 227
@@ -297,6 +313,7 @@ static void b43_phy_lcn_op_prepare_structs(struct b43_wldev *dev)
297 memset(phy_lcn, 0, sizeof(*phy_lcn)); 313 memset(phy_lcn, 0, sizeof(*phy_lcn));
298} 314}
299 315
316/* wlc_phy_init_lcnphy */
300static int b43_phy_lcn_op_init(struct b43_wldev *dev) 317static int b43_phy_lcn_op_init(struct b43_wldev *dev)
301{ 318{
302 b43_phy_set(dev, 0x44a, 0x80); 319 b43_phy_set(dev, 0x44a, 0x80);
@@ -312,15 +329,15 @@ static int b43_phy_lcn_op_init(struct b43_wldev *dev)
312 329
313 b43_phy_lcn_tables_init(dev); 330 b43_phy_lcn_tables_init(dev);
314 331
315 b43_phy_lcn_pre_radio_init(dev); 332 b43_phy_lcn_rev0_baseband_init(dev);
316 b43_phy_lcn_clear_0x07_table(dev); 333 b43_phy_lcn_bu_tweaks(dev);
317 334
318 if (dev->phy.radio_ver == 0x2064) 335 if (dev->phy.radio_ver == 0x2064)
319 b43_radio_2064_init(dev); 336 b43_radio_2064_init(dev);
320 else 337 else
321 B43_WARN_ON(1); 338 B43_WARN_ON(1);
322 339
323 b43_phy_lcn_save_configsth_restore(dev); 340 b43_phy_lcn_sense_setup(dev);
324 341
325 return 0; 342 return 0;
326} 343}
diff --git a/drivers/net/wireless/b43/tables_phy_lcn.c b/drivers/net/wireless/b43/tables_phy_lcn.c
index fd2b16d9d661..c62a94082bca 100644
--- a/drivers/net/wireless/b43/tables_phy_lcn.c
+++ b/drivers/net/wireless/b43/tables_phy_lcn.c
@@ -295,7 +295,7 @@ static const u32 b43_lcntab_0x18[] = {
295 0x00080000, 0x00080000, 0x00080000, 0x00080000, 295 0x00080000, 0x00080000, 0x00080000, 0x00080000,
296}; 296};
297 297
298const u16 b43_lcntab_0x0f_late[] = { 298const u16 b43_lcntab_sw_ctl_4313_epa_rev0[] = {
299 0x0002, 0x0008, 0x0004, 0x0001, 0x0002, 0x0008, 299 0x0002, 0x0008, 0x0004, 0x0001, 0x0002, 0x0008,
300 0x0004, 0x0001, 0x0002, 0x0008, 0x0004, 0x0001, 300 0x0004, 0x0001, 0x0002, 0x0008, 0x0004, 0x0001,
301 0x0002, 0x0008, 0x0004, 0x0001, 0x0002, 0x0008, 301 0x0002, 0x0008, 0x0004, 0x0001, 0x0002, 0x0008,
@@ -488,7 +488,8 @@ static void b43_phy_lcn_rewrite_tables(struct b43_wldev *dev)
488 } 488 }
489} 489}
490 490
491static void b43_phy_lcn_clean_0x18_table(struct b43_wldev *dev) 491/* wlc_lcnphy_clear_papd_comptable */
492static void b43_phy_lcn_clean_papd_comp_table(struct b43_wldev *dev)
492{ 493{
493 u8 i; 494 u8 i;
494 495
@@ -501,8 +502,9 @@ void b43_phy_lcn_tables_init(struct b43_wldev *dev)
501 b43_phy_lcn_upload_static_tables(dev); 502 b43_phy_lcn_upload_static_tables(dev);
502 /* TODO: various tables ops here */ 503 /* TODO: various tables ops here */
503 b43_lcntab_write_bulk(dev, B43_LCNTAB16(0xf, 0), 504 b43_lcntab_write_bulk(dev, B43_LCNTAB16(0xf, 0),
504 ARRAY_SIZE(b43_lcntab_0x0f_late), b43_lcntab_0x0f_late); 505 ARRAY_SIZE(b43_lcntab_sw_ctl_4313_epa_rev0),
506 b43_lcntab_sw_ctl_4313_epa_rev0);
505 /* TODO: various tables ops here */ 507 /* TODO: various tables ops here */
506 b43_phy_lcn_rewrite_tables(dev); 508 b43_phy_lcn_rewrite_tables(dev);
507 b43_phy_lcn_clean_0x18_table(dev); 509 b43_phy_lcn_clean_papd_comp_table(dev);
508} 510}