aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/bcm43xx/bcm43xx_phy.c
diff options
context:
space:
mode:
authorMichael Buesch <mbuesch@freenet.de>2006-03-13 13:27:34 -0500
committerJohn W. Linville <linville@tuxdriver.com>2006-03-27 11:19:37 -0500
commite9357c056c5e62516f0044e60591d41f00ca7cfa (patch)
treea5dc842a43db15403207f1d763df008fb43cb8e6 /drivers/net/wireless/bcm43xx/bcm43xx_phy.c
parentaae3778176ec7a57b1c4f539b7252acfd7d99a1b (diff)
[PATCH] bcm43xx: reduce the size of bcm43xx_private by removing unneeded members.
Signed-off-by: Michael Buesch <mbuesch@freenet.de> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/bcm43xx/bcm43xx_phy.c')
-rw-r--r--drivers/net/wireless/bcm43xx/bcm43xx_phy.c128
1 files changed, 64 insertions, 64 deletions
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_phy.c b/drivers/net/wireless/bcm43xx/bcm43xx_phy.c
index dbbef6ccd153..1ce9a4599903 100644
--- a/drivers/net/wireless/bcm43xx/bcm43xx_phy.c
+++ b/drivers/net/wireless/bcm43xx/bcm43xx_phy.c
@@ -83,7 +83,7 @@ static void bcm43xx_phy_initg(struct bcm43xx_private *bcm);
83 83
84void bcm43xx_raw_phy_lock(struct bcm43xx_private *bcm) 84void bcm43xx_raw_phy_lock(struct bcm43xx_private *bcm)
85{ 85{
86 struct bcm43xx_phyinfo *phy = bcm->current_core->phy; 86 struct bcm43xx_phyinfo *phy = bcm43xx_current_phy(bcm);
87 87
88 assert(irqs_disabled()); 88 assert(irqs_disabled());
89 if (bcm43xx_read32(bcm, BCM43xx_MMIO_STATUS_BITFIELD) == 0x00000000) { 89 if (bcm43xx_read32(bcm, BCM43xx_MMIO_STATUS_BITFIELD) == 0x00000000) {
@@ -102,7 +102,7 @@ void bcm43xx_raw_phy_lock(struct bcm43xx_private *bcm)
102 102
103void bcm43xx_raw_phy_unlock(struct bcm43xx_private *bcm) 103void bcm43xx_raw_phy_unlock(struct bcm43xx_private *bcm)
104{ 104{
105 struct bcm43xx_phyinfo *phy = bcm->current_core->phy; 105 struct bcm43xx_phyinfo *phy = bcm43xx_current_phy(bcm);
106 106
107 assert(irqs_disabled()); 107 assert(irqs_disabled());
108 if (bcm->current_core->rev < 3) { 108 if (bcm->current_core->rev < 3) {
@@ -132,7 +132,7 @@ void bcm43xx_phy_write(struct bcm43xx_private *bcm, u16 offset, u16 val)
132 132
133void bcm43xx_phy_calibrate(struct bcm43xx_private *bcm) 133void bcm43xx_phy_calibrate(struct bcm43xx_private *bcm)
134{ 134{
135 struct bcm43xx_phyinfo *phy = bcm->current_core->phy; 135 struct bcm43xx_phyinfo *phy = bcm43xx_current_phy(bcm);
136 unsigned long flags; 136 unsigned long flags;
137 137
138 bcm43xx_read32(bcm, BCM43xx_MMIO_STATUS_BITFIELD); /* Dummy read. */ 138 bcm43xx_read32(bcm, BCM43xx_MMIO_STATUS_BITFIELD); /* Dummy read. */
@@ -158,39 +158,32 @@ void bcm43xx_phy_calibrate(struct bcm43xx_private *bcm)
158 */ 158 */
159int bcm43xx_phy_connect(struct bcm43xx_private *bcm, int connect) 159int bcm43xx_phy_connect(struct bcm43xx_private *bcm, int connect)
160{ 160{
161 struct bcm43xx_phyinfo *phy = bcm43xx_current_phy(bcm);
161 u32 flags; 162 u32 flags;
162 163
163 if (bcm->current_core->rev < 5) { 164 if (bcm->current_core->rev < 5)
164 if (connect) { 165 goto out;
165 bcm->current_core->phy->connected = 1; 166
166 dprintk(KERN_INFO PFX "PHY connected\n");
167 } else {
168 bcm->current_core->phy->connected = 0;
169 dprintk(KERN_INFO PFX "PHY disconnected\n");
170 }
171 return 0;
172 }
173
174 flags = bcm43xx_read32(bcm, BCM43xx_CIR_SBTMSTATEHIGH); 167 flags = bcm43xx_read32(bcm, BCM43xx_CIR_SBTMSTATEHIGH);
175 if (connect) { 168 if (connect) {
176 if (!(flags & 0x00010000)) 169 if (!(flags & 0x00010000))
177 return -ENODEV; 170 return -ENODEV;
178 bcm->current_core->phy->connected = 1;
179
180 flags = bcm43xx_read32(bcm, BCM43xx_CIR_SBTMSTATELOW); 171 flags = bcm43xx_read32(bcm, BCM43xx_CIR_SBTMSTATELOW);
181 flags |= (0x800 << 18); 172 flags |= (0x800 << 18);
182 bcm43xx_write32(bcm, BCM43xx_CIR_SBTMSTATELOW, flags); 173 bcm43xx_write32(bcm, BCM43xx_CIR_SBTMSTATELOW, flags);
183 dprintk(KERN_INFO PFX "PHY connected\n");
184 } else { 174 } else {
185 if (!(flags & 0x00020000)) 175 if (!(flags & 0x00020000))
186 return -ENODEV; 176 return -ENODEV;
187 bcm->current_core->phy->connected = 0;
188
189 flags = bcm43xx_read32(bcm, BCM43xx_CIR_SBTMSTATELOW); 177 flags = bcm43xx_read32(bcm, BCM43xx_CIR_SBTMSTATELOW);
190 flags &= ~(0x800 << 18); 178 flags &= ~(0x800 << 18);
191 bcm43xx_write32(bcm, BCM43xx_CIR_SBTMSTATELOW, flags); 179 bcm43xx_write32(bcm, BCM43xx_CIR_SBTMSTATELOW, flags);
192 dprintk(KERN_INFO PFX "PHY disconnected\n");
193 } 180 }
181out:
182 phy->connected = connect;
183 if (connect)
184 dprintk(KERN_INFO PFX "PHY connected\n");
185 else
186 dprintk(KERN_INFO PFX "PHY disconnected\n");
194 187
195 return 0; 188 return 0;
196} 189}
@@ -200,8 +193,8 @@ int bcm43xx_phy_connect(struct bcm43xx_private *bcm, int connect)
200 */ 193 */
201static void bcm43xx_phy_init_pctl(struct bcm43xx_private *bcm) 194static void bcm43xx_phy_init_pctl(struct bcm43xx_private *bcm)
202{ 195{
203 struct bcm43xx_phyinfo *phy = bcm->current_core->phy; 196 struct bcm43xx_phyinfo *phy = bcm43xx_current_phy(bcm);
204 struct bcm43xx_radioinfo *radio = bcm->current_core->radio; 197 struct bcm43xx_radioinfo *radio = bcm43xx_current_radio(bcm);
205 u16 saved_batt = 0, saved_ratt = 0, saved_txctl1 = 0; 198 u16 saved_batt = 0, saved_ratt = 0, saved_txctl1 = 0;
206 int must_reset_txpower = 0; 199 int must_reset_txpower = 0;
207 200
@@ -250,7 +243,7 @@ static void bcm43xx_phy_init_pctl(struct bcm43xx_private *bcm)
250 243
251static void bcm43xx_phy_agcsetup(struct bcm43xx_private *bcm) 244static void bcm43xx_phy_agcsetup(struct bcm43xx_private *bcm)
252{ 245{
253 struct bcm43xx_phyinfo *phy = bcm->current_core->phy; 246 struct bcm43xx_phyinfo *phy = bcm43xx_current_phy(bcm);
254 u16 offset = 0x0000; 247 u16 offset = 0x0000;
255 248
256 if (phy->rev == 1) 249 if (phy->rev == 1)
@@ -326,7 +319,7 @@ static void bcm43xx_phy_agcsetup(struct bcm43xx_private *bcm)
326 319
327static void bcm43xx_phy_setupg(struct bcm43xx_private *bcm) 320static void bcm43xx_phy_setupg(struct bcm43xx_private *bcm)
328{ 321{
329 struct bcm43xx_phyinfo *phy = bcm->current_core->phy; 322 struct bcm43xx_phyinfo *phy = bcm43xx_current_phy(bcm);
330 u16 i; 323 u16 i;
331 324
332 assert(phy->type == BCM43xx_PHYTYPE_G); 325 assert(phy->type == BCM43xx_PHYTYPE_G);
@@ -420,7 +413,7 @@ static void bcm43xx_phy_setupg(struct bcm43xx_private *bcm)
420/* Initialize the noisescaletable for APHY */ 413/* Initialize the noisescaletable for APHY */
421static void bcm43xx_phy_init_noisescaletbl(struct bcm43xx_private *bcm) 414static void bcm43xx_phy_init_noisescaletbl(struct bcm43xx_private *bcm)
422{ 415{
423 struct bcm43xx_phyinfo *phy = bcm->current_core->phy; 416 struct bcm43xx_phyinfo *phy = bcm43xx_current_phy(bcm);
424 int i; 417 int i;
425 418
426 bcm43xx_phy_write(bcm, BCM43xx_PHY_ILT_A_CTRL, 0x1400); 419 bcm43xx_phy_write(bcm, BCM43xx_PHY_ILT_A_CTRL, 0x1400);
@@ -448,10 +441,11 @@ static void bcm43xx_phy_init_noisescaletbl(struct bcm43xx_private *bcm)
448 441
449static void bcm43xx_phy_setupa(struct bcm43xx_private *bcm) 442static void bcm43xx_phy_setupa(struct bcm43xx_private *bcm)
450{ 443{
444 struct bcm43xx_phyinfo *phy = bcm43xx_current_phy(bcm);
451 u16 i; 445 u16 i;
452 446
453 assert(bcm->current_core->phy->type == BCM43xx_PHYTYPE_A); 447 assert(phy->type == BCM43xx_PHYTYPE_A);
454 switch (bcm->current_core->phy->rev) { 448 switch (phy->rev) {
455 case 2: 449 case 2:
456 bcm43xx_phy_write(bcm, 0x008E, 0x3800); 450 bcm43xx_phy_write(bcm, 0x008E, 0x3800);
457 bcm43xx_phy_write(bcm, 0x0035, 0x03FF); 451 bcm43xx_phy_write(bcm, 0x0035, 0x03FF);
@@ -563,7 +557,8 @@ static void bcm43xx_phy_setupa(struct bcm43xx_private *bcm)
563/* Initialize APHY. This is also called for the GPHY in some cases. */ 557/* Initialize APHY. This is also called for the GPHY in some cases. */
564static void bcm43xx_phy_inita(struct bcm43xx_private *bcm) 558static void bcm43xx_phy_inita(struct bcm43xx_private *bcm)
565{ 559{
566 struct bcm43xx_phyinfo *phy = bcm->current_core->phy; 560 struct bcm43xx_phyinfo *phy = bcm43xx_current_phy(bcm);
561 struct bcm43xx_radioinfo *radio = bcm43xx_current_radio(bcm);
567 u16 tval; 562 u16 tval;
568 563
569 if (phy->type == BCM43xx_PHYTYPE_A) { 564 if (phy->type == BCM43xx_PHYTYPE_A) {
@@ -586,11 +581,11 @@ static void bcm43xx_phy_inita(struct bcm43xx_private *bcm)
586 581
587 if ((bcm->board_vendor == PCI_VENDOR_ID_BROADCOM) 582 if ((bcm->board_vendor == PCI_VENDOR_ID_BROADCOM)
588 && ((bcm->board_type == 0x0416) || (bcm->board_type == 0x040A))) { 583 && ((bcm->board_type == 0x0416) || (bcm->board_type == 0x040A))) {
589 if (bcm->current_core->radio->lofcal == 0xFFFF) { 584 if (radio->lofcal == 0xFFFF) {
590 TODO();//TODO: LOF Cal 585 TODO();//TODO: LOF Cal
591 bcm43xx_radio_set_tx_iq(bcm); 586 bcm43xx_radio_set_tx_iq(bcm);
592 } else 587 } else
593 bcm43xx_radio_write16(bcm, 0x001E, bcm->current_core->radio->lofcal); 588 bcm43xx_radio_write16(bcm, 0x001E, radio->lofcal);
594 } 589 }
595 590
596 bcm43xx_phy_write(bcm, 0x007A, 0xF111); 591 bcm43xx_phy_write(bcm, 0x007A, 0xF111);
@@ -620,7 +615,7 @@ static void bcm43xx_phy_inita(struct bcm43xx_private *bcm)
620 615
621static void bcm43xx_phy_initb2(struct bcm43xx_private *bcm) 616static void bcm43xx_phy_initb2(struct bcm43xx_private *bcm)
622{ 617{
623 struct bcm43xx_radioinfo *radio = bcm->current_core->radio; 618 struct bcm43xx_radioinfo *radio = bcm43xx_current_radio(bcm);
624 u16 offset, val; 619 u16 offset, val;
625 620
626 bcm43xx_write16(bcm, 0x03EC, 0x3F22); 621 bcm43xx_write16(bcm, 0x03EC, 0x3F22);
@@ -671,7 +666,7 @@ static void bcm43xx_phy_initb2(struct bcm43xx_private *bcm)
671 666
672static void bcm43xx_phy_initb4(struct bcm43xx_private *bcm) 667static void bcm43xx_phy_initb4(struct bcm43xx_private *bcm)
673{ 668{
674 struct bcm43xx_radioinfo *radio = bcm->current_core->radio; 669 struct bcm43xx_radioinfo *radio = bcm43xx_current_radio(bcm);
675 u16 offset, val; 670 u16 offset, val;
676 671
677 bcm43xx_write16(bcm, 0x03EC, 0x3F22); 672 bcm43xx_write16(bcm, 0x03EC, 0x3F22);
@@ -729,8 +724,8 @@ static void bcm43xx_phy_initb4(struct bcm43xx_private *bcm)
729 724
730static void bcm43xx_phy_initb5(struct bcm43xx_private *bcm) 725static void bcm43xx_phy_initb5(struct bcm43xx_private *bcm)
731{ 726{
732 struct bcm43xx_phyinfo *phy = bcm->current_core->phy; 727 struct bcm43xx_phyinfo *phy = bcm43xx_current_phy(bcm);
733 struct bcm43xx_radioinfo *radio = bcm->current_core->radio; 728 struct bcm43xx_radioinfo *radio = bcm43xx_current_radio(bcm);
734 u16 offset; 729 u16 offset;
735 730
736 if (phy->version == 1 && 731 if (phy->version == 1 &&
@@ -835,8 +830,8 @@ static void bcm43xx_phy_initb5(struct bcm43xx_private *bcm)
835 830
836static void bcm43xx_phy_initb6(struct bcm43xx_private *bcm) 831static void bcm43xx_phy_initb6(struct bcm43xx_private *bcm)
837{ 832{
838 struct bcm43xx_phyinfo *phy = bcm->current_core->phy; 833 struct bcm43xx_phyinfo *phy = bcm43xx_current_phy(bcm);
839 struct bcm43xx_radioinfo *radio = bcm->current_core->radio; 834 struct bcm43xx_radioinfo *radio = bcm43xx_current_radio(bcm);
840 u16 offset, val; 835 u16 offset, val;
841 836
842 bcm43xx_phy_write(bcm, 0x003E, 0x817A); 837 bcm43xx_phy_write(bcm, 0x003E, 0x817A);
@@ -946,9 +941,9 @@ static void bcm43xx_phy_initb6(struct bcm43xx_private *bcm)
946 udelay(40); 941 udelay(40);
947 bcm43xx_radio_write16(bcm, 0x007C, (bcm43xx_radio_read16(bcm, 0x007C) | 0x0002)); 942 bcm43xx_radio_write16(bcm, 0x007C, (bcm43xx_radio_read16(bcm, 0x007C) | 0x0002));
948 bcm43xx_radio_write16(bcm, 0x0050, 0x0020); 943 bcm43xx_radio_write16(bcm, 0x0050, 0x0020);
949 if ((bcm->current_core->radio->manufact == 0x17F) && 944 if (radio->manufact == 0x17F &&
950 (bcm->current_core->radio->version == 0x2050) && 945 radio->version == 0x2050 &&
951 (bcm->current_core->radio->revision <= 2)) { 946 radio->revision <= 2) {
952 bcm43xx_radio_write16(bcm, 0x0050, 0x0020); 947 bcm43xx_radio_write16(bcm, 0x0050, 0x0020);
953 bcm43xx_radio_write16(bcm, 0x005A, 0x0070); 948 bcm43xx_radio_write16(bcm, 0x005A, 0x0070);
954 bcm43xx_radio_write16(bcm, 0x005B, 0x007B); 949 bcm43xx_radio_write16(bcm, 0x005B, 0x007B);
@@ -1001,8 +996,8 @@ static void bcm43xx_phy_initb6(struct bcm43xx_private *bcm)
1001 996
1002static void bcm43xx_phy_initg(struct bcm43xx_private *bcm) 997static void bcm43xx_phy_initg(struct bcm43xx_private *bcm)
1003{ 998{
1004 struct bcm43xx_phyinfo *phy = bcm->current_core->phy; 999 struct bcm43xx_phyinfo *phy = bcm43xx_current_phy(bcm);
1005 struct bcm43xx_radioinfo *radio = bcm->current_core->radio; 1000 struct bcm43xx_radioinfo *radio = bcm43xx_current_radio(bcm);
1006 u16 tmp; 1001 u16 tmp;
1007 1002
1008 if (phy->rev == 1) 1003 if (phy->rev == 1)
@@ -1096,8 +1091,8 @@ static u16 bcm43xx_phy_lo_b_r15_loop(struct bcm43xx_private *bcm)
1096 1091
1097void bcm43xx_phy_lo_b_measure(struct bcm43xx_private *bcm) 1092void bcm43xx_phy_lo_b_measure(struct bcm43xx_private *bcm)
1098{ 1093{
1099 struct bcm43xx_radioinfo *radio = bcm->current_core->radio; 1094 struct bcm43xx_radioinfo *radio = bcm43xx_current_radio(bcm);
1100 struct bcm43xx_phyinfo *phy = bcm->current_core->phy; 1095 struct bcm43xx_phyinfo *phy = bcm43xx_current_phy(bcm);
1101 u16 regstack[12] = { 0 }; 1096 u16 regstack[12] = { 0 };
1102 u16 mls; 1097 u16 mls;
1103 u16 fval; 1098 u16 fval;
@@ -1190,7 +1185,9 @@ void bcm43xx_phy_lo_b_measure(struct bcm43xx_private *bcm)
1190static inline 1185static inline
1191u16 bcm43xx_phy_lo_g_deviation_subval(struct bcm43xx_private *bcm, u16 control) 1186u16 bcm43xx_phy_lo_g_deviation_subval(struct bcm43xx_private *bcm, u16 control)
1192{ 1187{
1193 if (bcm->current_core->phy->connected) { 1188 struct bcm43xx_phyinfo *phy = bcm43xx_current_phy(bcm);
1189
1190 if (phy->connected) {
1194 bcm43xx_phy_write(bcm, 0x15, 0xE300); 1191 bcm43xx_phy_write(bcm, 0x15, 0xE300);
1195 control <<= 8; 1192 control <<= 8;
1196 bcm43xx_phy_write(bcm, 0x0812, control | 0x00B0); 1193 bcm43xx_phy_write(bcm, 0x0812, control | 0x00B0);
@@ -1242,7 +1239,7 @@ void bcm43xx_lo_write(struct bcm43xx_private *bcm,
1242 "WARNING: Writing invalid LOpair " 1239 "WARNING: Writing invalid LOpair "
1243 "(low: %d, high: %d, index: %lu)\n", 1240 "(low: %d, high: %d, index: %lu)\n",
1244 pair->low, pair->high, 1241 pair->low, pair->high,
1245 (unsigned long)(pair - bcm->current_core->phy->_lo_pairs)); 1242 (unsigned long)(pair - bcm43xx_current_phy(bcm)->_lo_pairs));
1246 dump_stack(); 1243 dump_stack();
1247 } 1244 }
1248#endif 1245#endif
@@ -1257,7 +1254,7 @@ struct bcm43xx_lopair * bcm43xx_find_lopair(struct bcm43xx_private *bcm,
1257 u16 tx) 1254 u16 tx)
1258{ 1255{
1259 static const u8 dict[10] = { 11, 10, 11, 12, 13, 12, 13, 12, 13, 12 }; 1256 static const u8 dict[10] = { 11, 10, 11, 12, 13, 12, 13, 12, 13, 12 };
1260 struct bcm43xx_phyinfo *phy = bcm->current_core->phy; 1257 struct bcm43xx_phyinfo *phy = bcm43xx_current_phy(bcm);
1261 1258
1262 if (baseband_attenuation > 6) 1259 if (baseband_attenuation > 6)
1263 baseband_attenuation = 6; 1260 baseband_attenuation = 6;
@@ -1275,10 +1272,12 @@ struct bcm43xx_lopair * bcm43xx_find_lopair(struct bcm43xx_private *bcm,
1275static inline 1272static inline
1276struct bcm43xx_lopair * bcm43xx_current_lopair(struct bcm43xx_private *bcm) 1273struct bcm43xx_lopair * bcm43xx_current_lopair(struct bcm43xx_private *bcm)
1277{ 1274{
1275 struct bcm43xx_radioinfo *radio = bcm43xx_current_radio(bcm);
1276
1278 return bcm43xx_find_lopair(bcm, 1277 return bcm43xx_find_lopair(bcm,
1279 bcm->current_core->radio->txpower[0], 1278 radio->txpower[0],
1280 bcm->current_core->radio->txpower[1], 1279 radio->txpower[1],
1281 bcm->current_core->radio->txpower[2]); 1280 radio->txpower[2]);
1282} 1281}
1283 1282
1284/* Adjust B/G LO */ 1283/* Adjust B/G LO */
@@ -1294,9 +1293,9 @@ void bcm43xx_phy_lo_adjust(struct bcm43xx_private *bcm, int fixed)
1294 bcm43xx_lo_write(bcm, pair); 1293 bcm43xx_lo_write(bcm, pair);
1295} 1294}
1296 1295
1297static inline 1296static void bcm43xx_phy_lo_g_measure_txctl2(struct bcm43xx_private *bcm)
1298void bcm43xx_phy_lo_g_measure_txctl2(struct bcm43xx_private *bcm)
1299{ 1297{
1298 struct bcm43xx_radioinfo *radio = bcm43xx_current_radio(bcm);
1300 u16 txctl2 = 0, i; 1299 u16 txctl2 = 0, i;
1301 u32 smallest, tmp; 1300 u32 smallest, tmp;
1302 1301
@@ -1312,7 +1311,7 @@ void bcm43xx_phy_lo_g_measure_txctl2(struct bcm43xx_private *bcm)
1312 txctl2 = i; 1311 txctl2 = i;
1313 } 1312 }
1314 } 1313 }
1315 bcm->current_core->radio->txpower[3] = txctl2; 1314 radio->txpower[3] = txctl2;
1316} 1315}
1317 1316
1318static 1317static
@@ -1402,16 +1401,17 @@ void bcm43xx_phy_lo_g_state(struct bcm43xx_private *bcm,
1402void bcm43xx_phy_set_baseband_attenuation(struct bcm43xx_private *bcm, 1401void bcm43xx_phy_set_baseband_attenuation(struct bcm43xx_private *bcm,
1403 u16 baseband_attenuation) 1402 u16 baseband_attenuation)
1404{ 1403{
1404 struct bcm43xx_phyinfo *phy = bcm43xx_current_phy(bcm);
1405 u16 value; 1405 u16 value;
1406 1406
1407 if (bcm->current_core->phy->version == 0) { 1407 if (phy->version == 0) {
1408 value = (bcm43xx_read16(bcm, 0x03E6) & 0xFFF0); 1408 value = (bcm43xx_read16(bcm, 0x03E6) & 0xFFF0);
1409 value |= (baseband_attenuation & 0x000F); 1409 value |= (baseband_attenuation & 0x000F);
1410 bcm43xx_write16(bcm, 0x03E6, value); 1410 bcm43xx_write16(bcm, 0x03E6, value);
1411 return; 1411 return;
1412 } 1412 }
1413 1413
1414 if (bcm->current_core->phy->version > 1) { 1414 if (phy->version > 1) {
1415 value = bcm43xx_phy_read(bcm, 0x0060) & ~0x003C; 1415 value = bcm43xx_phy_read(bcm, 0x0060) & ~0x003C;
1416 value |= (baseband_attenuation << 2) & 0x003C; 1416 value |= (baseband_attenuation << 2) & 0x003C;
1417 } else { 1417 } else {
@@ -1426,8 +1426,8 @@ void bcm43xx_phy_lo_g_measure(struct bcm43xx_private *bcm)
1426{ 1426{
1427 static const u8 pairorder[10] = { 3, 1, 5, 7, 9, 2, 0, 4, 6, 8 }; 1427 static const u8 pairorder[10] = { 3, 1, 5, 7, 9, 2, 0, 4, 6, 8 };
1428 const int is_initializing = bcm43xx_is_initializing(bcm); 1428 const int is_initializing = bcm43xx_is_initializing(bcm);
1429 struct bcm43xx_phyinfo *phy = bcm->current_core->phy; 1429 struct bcm43xx_phyinfo *phy = bcm43xx_current_phy(bcm);
1430 struct bcm43xx_radioinfo *radio = bcm->current_core->radio; 1430 struct bcm43xx_radioinfo *radio = bcm43xx_current_radio(bcm);
1431 u16 h, i, oldi = 0, j; 1431 u16 h, i, oldi = 0, j;
1432 struct bcm43xx_lopair control; 1432 struct bcm43xx_lopair control;
1433 struct bcm43xx_lopair *tmp_control; 1433 struct bcm43xx_lopair *tmp_control;
@@ -1653,7 +1653,7 @@ void bcm43xx_phy_lo_mark_current_used(struct bcm43xx_private *bcm)
1653 1653
1654void bcm43xx_phy_lo_mark_all_unused(struct bcm43xx_private *bcm) 1654void bcm43xx_phy_lo_mark_all_unused(struct bcm43xx_private *bcm)
1655{ 1655{
1656 struct bcm43xx_phyinfo *phy = bcm->current_core->phy; 1656 struct bcm43xx_phyinfo *phy = bcm43xx_current_phy(bcm);
1657 struct bcm43xx_lopair *pair; 1657 struct bcm43xx_lopair *pair;
1658 int i; 1658 int i;
1659 1659
@@ -1668,7 +1668,7 @@ void bcm43xx_phy_lo_mark_all_unused(struct bcm43xx_private *bcm)
1668 */ 1668 */
1669static s8 bcm43xx_phy_estimate_power_out(struct bcm43xx_private *bcm, s8 tssi) 1669static s8 bcm43xx_phy_estimate_power_out(struct bcm43xx_private *bcm, s8 tssi)
1670{ 1670{
1671 struct bcm43xx_phyinfo *phy = bcm->current_core->phy; 1671 struct bcm43xx_phyinfo *phy = bcm43xx_current_phy(bcm);
1672 s8 dbm = 0; 1672 s8 dbm = 0;
1673 s32 tmp; 1673 s32 tmp;
1674 1674
@@ -1698,8 +1698,8 @@ static s8 bcm43xx_phy_estimate_power_out(struct bcm43xx_private *bcm, s8 tssi)
1698/* http://bcm-specs.sipsolutions.net/RecalculateTransmissionPower */ 1698/* http://bcm-specs.sipsolutions.net/RecalculateTransmissionPower */
1699void bcm43xx_phy_xmitpower(struct bcm43xx_private *bcm) 1699void bcm43xx_phy_xmitpower(struct bcm43xx_private *bcm)
1700{ 1700{
1701 struct bcm43xx_radioinfo *radio = bcm->current_core->radio; 1701 struct bcm43xx_radioinfo *radio = bcm43xx_current_radio(bcm);
1702 struct bcm43xx_phyinfo *phy = bcm->current_core->phy; 1702 struct bcm43xx_phyinfo *phy = bcm43xx_current_phy(bcm);
1703 1703
1704 if (phy->savedpctlreg == 0xFFFF) 1704 if (phy->savedpctlreg == 0xFFFF)
1705 return; 1705 return;
@@ -1880,8 +1880,8 @@ s8 bcm43xx_tssi2dbm_entry(s8 entry [], u8 index, s16 pab0, s16 pab1, s16 pab2)
1880/* http://bcm-specs.sipsolutions.net/TSSI_to_DBM_Table */ 1880/* http://bcm-specs.sipsolutions.net/TSSI_to_DBM_Table */
1881int bcm43xx_phy_init_tssi2dbm_table(struct bcm43xx_private *bcm) 1881int bcm43xx_phy_init_tssi2dbm_table(struct bcm43xx_private *bcm)
1882{ 1882{
1883 struct bcm43xx_phyinfo *phy = bcm->current_core->phy; 1883 struct bcm43xx_phyinfo *phy = bcm43xx_current_phy(bcm);
1884 struct bcm43xx_radioinfo *radio = bcm->current_core->radio; 1884 struct bcm43xx_radioinfo *radio = bcm43xx_current_radio(bcm);
1885 s16 pab0, pab1, pab2; 1885 s16 pab0, pab1, pab2;
1886 u8 idx; 1886 u8 idx;
1887 s8 *dyn_tssi2dbm; 1887 s8 *dyn_tssi2dbm;
@@ -1958,7 +1958,7 @@ int bcm43xx_phy_init_tssi2dbm_table(struct bcm43xx_private *bcm)
1958 1958
1959int bcm43xx_phy_init(struct bcm43xx_private *bcm) 1959int bcm43xx_phy_init(struct bcm43xx_private *bcm)
1960{ 1960{
1961 struct bcm43xx_phyinfo *phy = bcm->current_core->phy; 1961 struct bcm43xx_phyinfo *phy = bcm43xx_current_phy(bcm);
1962 int err = -ENODEV; 1962 int err = -ENODEV;
1963 unsigned long flags; 1963 unsigned long flags;
1964 1964
@@ -2008,7 +2008,7 @@ int bcm43xx_phy_init(struct bcm43xx_private *bcm)
2008 2008
2009void bcm43xx_phy_set_antenna_diversity(struct bcm43xx_private *bcm) 2009void bcm43xx_phy_set_antenna_diversity(struct bcm43xx_private *bcm)
2010{ 2010{
2011 struct bcm43xx_phyinfo *phy = bcm->current_core->phy; 2011 struct bcm43xx_phyinfo *phy = bcm43xx_current_phy(bcm);
2012 u16 antennadiv; 2012 u16 antennadiv;
2013 u16 offset; 2013 u16 offset;
2014 u16 value; 2014 u16 value;