Lines Matching +full:0 +full:x1a00

30 	0x0002, 0x0003, 0x0001, 0x000F,
31 0x0006, 0x0007, 0x0005, 0x000F,
32 0x000A, 0x000B, 0x0009, 0x000F,
33 0x000E, 0x000F, 0x000D, 0x000F,
41 u16 flipped = 0x0000; in flip_4bit()
43 B43legacy_BUG_ON(!((value & ~0x000F) == 0x0000)); in flip_4bit()
45 flipped |= (value & 0x0001) << 3; in flip_4bit()
46 flipped |= (value & 0x0002) << 1; in flip_4bit()
47 flipped |= (value & 0x0004) >> 1; in flip_4bit()
48 flipped |= (value & 0x0008) >> 3; in flip_4bit()
105 if (phy->radio_ver == 0x2053) { in b43legacy_radio_read16()
106 if (offset < 0x70) in b43legacy_radio_read16()
107 offset += 0x80; in b43legacy_radio_read16()
108 else if (offset < 0x80) in b43legacy_radio_read16()
109 offset += 0x70; in b43legacy_radio_read16()
110 } else if (phy->radio_ver == 0x2050) in b43legacy_radio_read16()
111 offset |= 0x80; in b43legacy_radio_read16()
116 offset |= 0x80; in b43legacy_radio_read16()
137 u16 start = 0x08; in b43legacy_set_all_gains()
138 u16 end = 0x18; in b43legacy_set_all_gains()
139 u16 offset = 0x0400; in b43legacy_set_all_gains()
143 offset = 0x5000; in b43legacy_set_all_gains()
144 start = 0x10; in b43legacy_set_all_gains()
145 end = 0x20; in b43legacy_set_all_gains()
148 for (i = 0; i < 4; i++) in b43legacy_set_all_gains()
156 b43legacy_phy_write(dev, 0x04A0, in b43legacy_set_all_gains()
157 (b43legacy_phy_read(dev, 0x04A0) & 0xBFBF) in b43legacy_set_all_gains()
159 b43legacy_phy_write(dev, 0x04A1, in b43legacy_set_all_gains()
160 (b43legacy_phy_read(dev, 0x04A1) & 0xBFBF) in b43legacy_set_all_gains()
162 b43legacy_phy_write(dev, 0x04A2, in b43legacy_set_all_gains()
163 (b43legacy_phy_read(dev, 0x04A2) & 0xBFBF) in b43legacy_set_all_gains()
174 u16 offset = 0x0400; in b43legacy_set_original_gains()
175 u16 start = 0x0008; in b43legacy_set_original_gains()
176 u16 end = 0x0018; in b43legacy_set_original_gains()
179 offset = 0x5000; in b43legacy_set_original_gains()
180 start = 0x0010; in b43legacy_set_original_gains()
181 end = 0x0020; in b43legacy_set_original_gains()
184 for (i = 0; i < 4; i++) { in b43legacy_set_original_gains()
185 tmp = (i & 0xFFFC); in b43legacy_set_original_gains()
186 tmp |= (i & 0x0001) << 1; in b43legacy_set_original_gains()
187 tmp |= (i & 0x0002) >> 1; in b43legacy_set_original_gains()
195 b43legacy_phy_write(dev, 0x04A0, in b43legacy_set_original_gains()
196 (b43legacy_phy_read(dev, 0x04A0) & 0xBFBF) in b43legacy_set_original_gains()
197 | 0x4040); in b43legacy_set_original_gains()
198 b43legacy_phy_write(dev, 0x04A1, in b43legacy_set_original_gains()
199 (b43legacy_phy_read(dev, 0x04A1) & 0xBFBF) in b43legacy_set_original_gains()
200 | 0x4040); in b43legacy_set_original_gains()
201 b43legacy_phy_write(dev, 0x04A2, in b43legacy_set_original_gains()
202 (b43legacy_phy_read(dev, 0x04A2) & 0xBFBF) in b43legacy_set_original_gains()
203 | 0x4000); in b43legacy_set_original_gains()
215 if (phy->radio_ver != 0x2050 || phy->radio_rev >= 6) in b43legacy_synth_pu_workaround()
233 u8 ret = 0; in b43legacy_radio_aci_detect()
238 int j = 0; in b43legacy_radio_aci_detect()
240 saved = b43legacy_phy_read(dev, 0x0403); in b43legacy_radio_aci_detect()
241 b43legacy_radio_selectchannel(dev, channel, 0); in b43legacy_radio_aci_detect()
242 b43legacy_phy_write(dev, 0x0403, (saved & 0xFFF8) | 5); in b43legacy_radio_aci_detect()
244 rssi = b43legacy_phy_read(dev, 0x048A) & 0x3F; in b43legacy_radio_aci_detect()
246 rssi = saved & 0x3F; in b43legacy_radio_aci_detect()
250 for (i = 0; i < 100; i++) { in b43legacy_radio_aci_detect()
251 temp = (b43legacy_phy_read(dev, 0x047F) >> 8) & 0x3F; in b43legacy_radio_aci_detect()
259 b43legacy_phy_write(dev, 0x0403, saved); in b43legacy_radio_aci_detect()
267 u8 ret[13] = { 0 }; in b43legacy_radio_aci_scan()
274 if (!((phy->type == B43legacy_PHYTYPE_G) && (phy->rev > 0))) in b43legacy_radio_aci_scan()
275 return 0; in b43legacy_radio_aci_scan()
279 b43legacy_phy_write(dev, 0x0802, in b43legacy_radio_aci_scan()
280 b43legacy_phy_read(dev, 0x0802) & 0xFFFC); in b43legacy_radio_aci_scan()
283 & 0x7FFF); in b43legacy_radio_aci_scan()
293 b43legacy_radio_selectchannel(dev, channel, 0); in b43legacy_radio_aci_scan()
294 b43legacy_phy_write(dev, 0x0802, in b43legacy_radio_aci_scan()
295 (b43legacy_phy_read(dev, 0x0802) & 0xFFFC) in b43legacy_radio_aci_scan()
296 | 0x0003); in b43legacy_radio_aci_scan()
297 b43legacy_phy_write(dev, 0x0403, in b43legacy_radio_aci_scan()
298 b43legacy_phy_read(dev, 0x0403) & 0xFFF8); in b43legacy_radio_aci_scan()
301 | 0x8000); in b43legacy_radio_aci_scan()
303 for (i = 0; i < 13; i++) { in b43legacy_radio_aci_scan()
340 for (i = 0; i < 64; i++) { in b43legacy_nrssi_hw_update()
356 delta = 0x1F - phy->nrssi[0]; in b43legacy_nrssi_mem_update()
357 for (i = 0; i < 64; i++) { in b43legacy_nrssi_mem_update()
359 tmp /= 0x10000; in b43legacy_nrssi_mem_update()
360 tmp += 0x3A; in b43legacy_nrssi_mem_update()
361 tmp = clamp_val(tmp, 0, 0x3F); in b43legacy_nrssi_mem_update()
369 u16 backup[20] = { 0 }; in b43legacy_calc_nrssi_offset()
372 u16 saved = 0xFFFF; in b43legacy_calc_nrssi_offset()
374 backup[0] = b43legacy_phy_read(dev, 0x0001); in b43legacy_calc_nrssi_offset()
375 backup[1] = b43legacy_phy_read(dev, 0x0811); in b43legacy_calc_nrssi_offset()
376 backup[2] = b43legacy_phy_read(dev, 0x0812); in b43legacy_calc_nrssi_offset()
377 backup[3] = b43legacy_phy_read(dev, 0x0814); in b43legacy_calc_nrssi_offset()
378 backup[4] = b43legacy_phy_read(dev, 0x0815); in b43legacy_calc_nrssi_offset()
379 backup[5] = b43legacy_phy_read(dev, 0x005A); in b43legacy_calc_nrssi_offset()
380 backup[6] = b43legacy_phy_read(dev, 0x0059); in b43legacy_calc_nrssi_offset()
381 backup[7] = b43legacy_phy_read(dev, 0x0058); in b43legacy_calc_nrssi_offset()
382 backup[8] = b43legacy_phy_read(dev, 0x000A); in b43legacy_calc_nrssi_offset()
383 backup[9] = b43legacy_phy_read(dev, 0x0003); in b43legacy_calc_nrssi_offset()
384 backup[10] = b43legacy_radio_read16(dev, 0x007A); in b43legacy_calc_nrssi_offset()
385 backup[11] = b43legacy_radio_read16(dev, 0x0043); in b43legacy_calc_nrssi_offset()
387 b43legacy_phy_write(dev, 0x0429, in b43legacy_calc_nrssi_offset()
388 b43legacy_phy_read(dev, 0x0429) & 0x7FFF); in b43legacy_calc_nrssi_offset()
389 b43legacy_phy_write(dev, 0x0001, in b43legacy_calc_nrssi_offset()
390 (b43legacy_phy_read(dev, 0x0001) & 0x3FFF) in b43legacy_calc_nrssi_offset()
391 | 0x4000); in b43legacy_calc_nrssi_offset()
392 b43legacy_phy_write(dev, 0x0811, in b43legacy_calc_nrssi_offset()
393 b43legacy_phy_read(dev, 0x0811) | 0x000C); in b43legacy_calc_nrssi_offset()
394 b43legacy_phy_write(dev, 0x0812, in b43legacy_calc_nrssi_offset()
395 (b43legacy_phy_read(dev, 0x0812) & 0xFFF3) in b43legacy_calc_nrssi_offset()
396 | 0x0004); in b43legacy_calc_nrssi_offset()
397 b43legacy_phy_write(dev, 0x0802, in b43legacy_calc_nrssi_offset()
398 b43legacy_phy_read(dev, 0x0802) & ~(0x1 | 0x2)); in b43legacy_calc_nrssi_offset()
400 backup[12] = b43legacy_phy_read(dev, 0x002E); in b43legacy_calc_nrssi_offset()
401 backup[13] = b43legacy_phy_read(dev, 0x002F); in b43legacy_calc_nrssi_offset()
402 backup[14] = b43legacy_phy_read(dev, 0x080F); in b43legacy_calc_nrssi_offset()
403 backup[15] = b43legacy_phy_read(dev, 0x0810); in b43legacy_calc_nrssi_offset()
404 backup[16] = b43legacy_phy_read(dev, 0x0801); in b43legacy_calc_nrssi_offset()
405 backup[17] = b43legacy_phy_read(dev, 0x0060); in b43legacy_calc_nrssi_offset()
406 backup[18] = b43legacy_phy_read(dev, 0x0014); in b43legacy_calc_nrssi_offset()
407 backup[19] = b43legacy_phy_read(dev, 0x0478); in b43legacy_calc_nrssi_offset()
409 b43legacy_phy_write(dev, 0x002E, 0); in b43legacy_calc_nrssi_offset()
410 b43legacy_phy_write(dev, 0x002F, 0); in b43legacy_calc_nrssi_offset()
411 b43legacy_phy_write(dev, 0x080F, 0); in b43legacy_calc_nrssi_offset()
412 b43legacy_phy_write(dev, 0x0810, 0); in b43legacy_calc_nrssi_offset()
413 b43legacy_phy_write(dev, 0x0478, in b43legacy_calc_nrssi_offset()
414 b43legacy_phy_read(dev, 0x0478) | 0x0100); in b43legacy_calc_nrssi_offset()
415 b43legacy_phy_write(dev, 0x0801, in b43legacy_calc_nrssi_offset()
416 b43legacy_phy_read(dev, 0x0801) | 0x0040); in b43legacy_calc_nrssi_offset()
417 b43legacy_phy_write(dev, 0x0060, in b43legacy_calc_nrssi_offset()
418 b43legacy_phy_read(dev, 0x0060) | 0x0040); in b43legacy_calc_nrssi_offset()
419 b43legacy_phy_write(dev, 0x0014, in b43legacy_calc_nrssi_offset()
420 b43legacy_phy_read(dev, 0x0014) | 0x0200); in b43legacy_calc_nrssi_offset()
422 b43legacy_radio_write16(dev, 0x007A, in b43legacy_calc_nrssi_offset()
423 b43legacy_radio_read16(dev, 0x007A) | 0x0070); in b43legacy_calc_nrssi_offset()
424 b43legacy_radio_write16(dev, 0x007A, in b43legacy_calc_nrssi_offset()
425 b43legacy_radio_read16(dev, 0x007A) | 0x0080); in b43legacy_calc_nrssi_offset()
428 v47F = (s16)((b43legacy_phy_read(dev, 0x047F) >> 8) & 0x003F); in b43legacy_calc_nrssi_offset()
429 if (v47F >= 0x20) in b43legacy_calc_nrssi_offset()
430 v47F -= 0x40; in b43legacy_calc_nrssi_offset()
433 b43legacy_radio_write16(dev, 0x007B, i); in b43legacy_calc_nrssi_offset()
435 v47F = (s16)((b43legacy_phy_read(dev, 0x047F) >> 8) in b43legacy_calc_nrssi_offset()
436 & 0x003F); in b43legacy_calc_nrssi_offset()
437 if (v47F >= 0x20) in b43legacy_calc_nrssi_offset()
438 v47F -= 0x40; in b43legacy_calc_nrssi_offset()
439 if (v47F < 31 && saved == 0xFFFF) in b43legacy_calc_nrssi_offset()
442 if (saved == 0xFFFF) in b43legacy_calc_nrssi_offset()
445 b43legacy_radio_write16(dev, 0x007A, in b43legacy_calc_nrssi_offset()
446 b43legacy_radio_read16(dev, 0x007A) in b43legacy_calc_nrssi_offset()
447 & 0x007F); in b43legacy_calc_nrssi_offset()
448 b43legacy_phy_write(dev, 0x0814, in b43legacy_calc_nrssi_offset()
449 b43legacy_phy_read(dev, 0x0814) | 0x0001); in b43legacy_calc_nrssi_offset()
450 b43legacy_phy_write(dev, 0x0815, in b43legacy_calc_nrssi_offset()
451 b43legacy_phy_read(dev, 0x0815) & 0xFFFE); in b43legacy_calc_nrssi_offset()
452 b43legacy_phy_write(dev, 0x0811, in b43legacy_calc_nrssi_offset()
453 b43legacy_phy_read(dev, 0x0811) | 0x000C); in b43legacy_calc_nrssi_offset()
454 b43legacy_phy_write(dev, 0x0812, in b43legacy_calc_nrssi_offset()
455 b43legacy_phy_read(dev, 0x0812) | 0x000C); in b43legacy_calc_nrssi_offset()
456 b43legacy_phy_write(dev, 0x0811, in b43legacy_calc_nrssi_offset()
457 b43legacy_phy_read(dev, 0x0811) | 0x0030); in b43legacy_calc_nrssi_offset()
458 b43legacy_phy_write(dev, 0x0812, in b43legacy_calc_nrssi_offset()
459 b43legacy_phy_read(dev, 0x0812) | 0x0030); in b43legacy_calc_nrssi_offset()
460 b43legacy_phy_write(dev, 0x005A, 0x0480); in b43legacy_calc_nrssi_offset()
461 b43legacy_phy_write(dev, 0x0059, 0x0810); in b43legacy_calc_nrssi_offset()
462 b43legacy_phy_write(dev, 0x0058, 0x000D); in b43legacy_calc_nrssi_offset()
463 if (phy->analog == 0) in b43legacy_calc_nrssi_offset()
464 b43legacy_phy_write(dev, 0x0003, 0x0122); in b43legacy_calc_nrssi_offset()
466 b43legacy_phy_write(dev, 0x000A, in b43legacy_calc_nrssi_offset()
467 b43legacy_phy_read(dev, 0x000A) in b43legacy_calc_nrssi_offset()
468 | 0x2000); in b43legacy_calc_nrssi_offset()
469 b43legacy_phy_write(dev, 0x0814, in b43legacy_calc_nrssi_offset()
470 b43legacy_phy_read(dev, 0x0814) | 0x0004); in b43legacy_calc_nrssi_offset()
471 b43legacy_phy_write(dev, 0x0815, in b43legacy_calc_nrssi_offset()
472 b43legacy_phy_read(dev, 0x0815) & 0xFFFB); in b43legacy_calc_nrssi_offset()
473 b43legacy_phy_write(dev, 0x0003, in b43legacy_calc_nrssi_offset()
474 (b43legacy_phy_read(dev, 0x0003) & 0xFF9F) in b43legacy_calc_nrssi_offset()
475 | 0x0040); in b43legacy_calc_nrssi_offset()
476 b43legacy_radio_write16(dev, 0x007A, in b43legacy_calc_nrssi_offset()
477 b43legacy_radio_read16(dev, 0x007A) in b43legacy_calc_nrssi_offset()
478 | 0x000F); in b43legacy_calc_nrssi_offset()
479 b43legacy_set_all_gains(dev, 3, 0, 1); in b43legacy_calc_nrssi_offset()
480 b43legacy_radio_write16(dev, 0x0043, in b43legacy_calc_nrssi_offset()
481 (b43legacy_radio_read16(dev, 0x0043) in b43legacy_calc_nrssi_offset()
482 & 0x00F0) | 0x000F); in b43legacy_calc_nrssi_offset()
484 v47F = (s16)((b43legacy_phy_read(dev, 0x047F) >> 8) & 0x003F); in b43legacy_calc_nrssi_offset()
485 if (v47F >= 0x20) in b43legacy_calc_nrssi_offset()
486 v47F -= 0x40; in b43legacy_calc_nrssi_offset()
488 for (i = 0; i < 4; i++) { in b43legacy_calc_nrssi_offset()
489 b43legacy_radio_write16(dev, 0x007B, i); in b43legacy_calc_nrssi_offset()
491 v47F = (s16)((b43legacy_phy_read(dev, 0x047F) >> in b43legacy_calc_nrssi_offset()
492 8) & 0x003F); in b43legacy_calc_nrssi_offset()
493 if (v47F >= 0x20) in b43legacy_calc_nrssi_offset()
494 v47F -= 0x40; in b43legacy_calc_nrssi_offset()
495 if (v47F > -31 && saved == 0xFFFF) in b43legacy_calc_nrssi_offset()
498 if (saved == 0xFFFF) in b43legacy_calc_nrssi_offset()
501 saved = 0; in b43legacy_calc_nrssi_offset()
503 b43legacy_radio_write16(dev, 0x007B, saved); in b43legacy_calc_nrssi_offset()
506 b43legacy_phy_write(dev, 0x002E, backup[12]); in b43legacy_calc_nrssi_offset()
507 b43legacy_phy_write(dev, 0x002F, backup[13]); in b43legacy_calc_nrssi_offset()
508 b43legacy_phy_write(dev, 0x080F, backup[14]); in b43legacy_calc_nrssi_offset()
509 b43legacy_phy_write(dev, 0x0810, backup[15]); in b43legacy_calc_nrssi_offset()
511 b43legacy_phy_write(dev, 0x0814, backup[3]); in b43legacy_calc_nrssi_offset()
512 b43legacy_phy_write(dev, 0x0815, backup[4]); in b43legacy_calc_nrssi_offset()
513 b43legacy_phy_write(dev, 0x005A, backup[5]); in b43legacy_calc_nrssi_offset()
514 b43legacy_phy_write(dev, 0x0059, backup[6]); in b43legacy_calc_nrssi_offset()
515 b43legacy_phy_write(dev, 0x0058, backup[7]); in b43legacy_calc_nrssi_offset()
516 b43legacy_phy_write(dev, 0x000A, backup[8]); in b43legacy_calc_nrssi_offset()
517 b43legacy_phy_write(dev, 0x0003, backup[9]); in b43legacy_calc_nrssi_offset()
518 b43legacy_radio_write16(dev, 0x0043, backup[11]); in b43legacy_calc_nrssi_offset()
519 b43legacy_radio_write16(dev, 0x007A, backup[10]); in b43legacy_calc_nrssi_offset()
520 b43legacy_phy_write(dev, 0x0802, in b43legacy_calc_nrssi_offset()
521 b43legacy_phy_read(dev, 0x0802) | 0x1 | 0x2); in b43legacy_calc_nrssi_offset()
522 b43legacy_phy_write(dev, 0x0429, in b43legacy_calc_nrssi_offset()
523 b43legacy_phy_read(dev, 0x0429) | 0x8000); in b43legacy_calc_nrssi_offset()
526 b43legacy_phy_write(dev, 0x0801, backup[16]); in b43legacy_calc_nrssi_offset()
527 b43legacy_phy_write(dev, 0x0060, backup[17]); in b43legacy_calc_nrssi_offset()
528 b43legacy_phy_write(dev, 0x0014, backup[18]); in b43legacy_calc_nrssi_offset()
529 b43legacy_phy_write(dev, 0x0478, backup[19]); in b43legacy_calc_nrssi_offset()
531 b43legacy_phy_write(dev, 0x0001, backup[0]); in b43legacy_calc_nrssi_offset()
532 b43legacy_phy_write(dev, 0x0812, backup[2]); in b43legacy_calc_nrssi_offset()
533 b43legacy_phy_write(dev, 0x0811, backup[1]); in b43legacy_calc_nrssi_offset()
539 u16 backup[18] = { 0 }; in b43legacy_calc_nrssi_slope()
546 backup[0] = b43legacy_radio_read16(dev, 0x007A); in b43legacy_calc_nrssi_slope()
547 backup[1] = b43legacy_radio_read16(dev, 0x0052); in b43legacy_calc_nrssi_slope()
548 backup[2] = b43legacy_radio_read16(dev, 0x0043); in b43legacy_calc_nrssi_slope()
549 backup[3] = b43legacy_phy_read(dev, 0x0030); in b43legacy_calc_nrssi_slope()
550 backup[4] = b43legacy_phy_read(dev, 0x0026); in b43legacy_calc_nrssi_slope()
551 backup[5] = b43legacy_phy_read(dev, 0x0015); in b43legacy_calc_nrssi_slope()
552 backup[6] = b43legacy_phy_read(dev, 0x002A); in b43legacy_calc_nrssi_slope()
553 backup[7] = b43legacy_phy_read(dev, 0x0020); in b43legacy_calc_nrssi_slope()
554 backup[8] = b43legacy_phy_read(dev, 0x005A); in b43legacy_calc_nrssi_slope()
555 backup[9] = b43legacy_phy_read(dev, 0x0059); in b43legacy_calc_nrssi_slope()
556 backup[10] = b43legacy_phy_read(dev, 0x0058); in b43legacy_calc_nrssi_slope()
557 backup[11] = b43legacy_read16(dev, 0x03E2); in b43legacy_calc_nrssi_slope()
558 backup[12] = b43legacy_read16(dev, 0x03E6); in b43legacy_calc_nrssi_slope()
561 tmp = b43legacy_radio_read16(dev, 0x007A); in b43legacy_calc_nrssi_slope()
562 tmp &= (phy->rev >= 5) ? 0x007F : 0x000F; in b43legacy_calc_nrssi_slope()
563 b43legacy_radio_write16(dev, 0x007A, tmp); in b43legacy_calc_nrssi_slope()
564 b43legacy_phy_write(dev, 0x0030, 0x00FF); in b43legacy_calc_nrssi_slope()
565 b43legacy_write16(dev, 0x03EC, 0x7F7F); in b43legacy_calc_nrssi_slope()
566 b43legacy_phy_write(dev, 0x0026, 0x0000); in b43legacy_calc_nrssi_slope()
567 b43legacy_phy_write(dev, 0x0015, in b43legacy_calc_nrssi_slope()
568 b43legacy_phy_read(dev, 0x0015) | 0x0020); in b43legacy_calc_nrssi_slope()
569 b43legacy_phy_write(dev, 0x002A, 0x08A3); in b43legacy_calc_nrssi_slope()
570 b43legacy_radio_write16(dev, 0x007A, in b43legacy_calc_nrssi_slope()
571 b43legacy_radio_read16(dev, 0x007A) in b43legacy_calc_nrssi_slope()
572 | 0x0080); in b43legacy_calc_nrssi_slope()
574 nrssi0 = (s16)b43legacy_phy_read(dev, 0x0027); in b43legacy_calc_nrssi_slope()
575 b43legacy_radio_write16(dev, 0x007A, in b43legacy_calc_nrssi_slope()
576 b43legacy_radio_read16(dev, 0x007A) in b43legacy_calc_nrssi_slope()
577 & 0x007F); in b43legacy_calc_nrssi_slope()
579 b43legacy_write16(dev, 0x03E6, 0x0040); in b43legacy_calc_nrssi_slope()
580 else if (phy->analog == 0) in b43legacy_calc_nrssi_slope()
581 b43legacy_write16(dev, 0x03E6, 0x0122); in b43legacy_calc_nrssi_slope()
585 B43legacy_MMIO_CHANNEL_EXT) & 0x2000); in b43legacy_calc_nrssi_slope()
586 b43legacy_phy_write(dev, 0x0020, 0x3F3F); in b43legacy_calc_nrssi_slope()
587 b43legacy_phy_write(dev, 0x0015, 0xF330); in b43legacy_calc_nrssi_slope()
588 b43legacy_radio_write16(dev, 0x005A, 0x0060); in b43legacy_calc_nrssi_slope()
589 b43legacy_radio_write16(dev, 0x0043, in b43legacy_calc_nrssi_slope()
590 b43legacy_radio_read16(dev, 0x0043) in b43legacy_calc_nrssi_slope()
591 & 0x00F0); in b43legacy_calc_nrssi_slope()
592 b43legacy_phy_write(dev, 0x005A, 0x0480); in b43legacy_calc_nrssi_slope()
593 b43legacy_phy_write(dev, 0x0059, 0x0810); in b43legacy_calc_nrssi_slope()
594 b43legacy_phy_write(dev, 0x0058, 0x000D); in b43legacy_calc_nrssi_slope()
597 nrssi1 = (s16)b43legacy_phy_read(dev, 0x0027); in b43legacy_calc_nrssi_slope()
598 b43legacy_phy_write(dev, 0x0030, backup[3]); in b43legacy_calc_nrssi_slope()
599 b43legacy_radio_write16(dev, 0x007A, backup[0]); in b43legacy_calc_nrssi_slope()
600 b43legacy_write16(dev, 0x03E2, backup[11]); in b43legacy_calc_nrssi_slope()
601 b43legacy_phy_write(dev, 0x0026, backup[4]); in b43legacy_calc_nrssi_slope()
602 b43legacy_phy_write(dev, 0x0015, backup[5]); in b43legacy_calc_nrssi_slope()
603 b43legacy_phy_write(dev, 0x002A, backup[6]); in b43legacy_calc_nrssi_slope()
605 if (phy->analog != 0) in b43legacy_calc_nrssi_slope()
606 b43legacy_write16(dev, 0x03F4, backup[13]); in b43legacy_calc_nrssi_slope()
608 b43legacy_phy_write(dev, 0x0020, backup[7]); in b43legacy_calc_nrssi_slope()
609 b43legacy_phy_write(dev, 0x005A, backup[8]); in b43legacy_calc_nrssi_slope()
610 b43legacy_phy_write(dev, 0x0059, backup[9]); in b43legacy_calc_nrssi_slope()
611 b43legacy_phy_write(dev, 0x0058, backup[10]); in b43legacy_calc_nrssi_slope()
612 b43legacy_radio_write16(dev, 0x0052, backup[1]); in b43legacy_calc_nrssi_slope()
613 b43legacy_radio_write16(dev, 0x0043, backup[2]); in b43legacy_calc_nrssi_slope()
616 phy->nrssislope = 0x00010000; in b43legacy_calc_nrssi_slope()
618 phy->nrssislope = 0x00400000 / (nrssi0 - nrssi1); in b43legacy_calc_nrssi_slope()
621 phy->nrssi[0] = nrssi0; in b43legacy_calc_nrssi_slope()
633 & 0x7FFF); in b43legacy_calc_nrssi_slope()
634 b43legacy_phy_write(dev, 0x0802, in b43legacy_calc_nrssi_slope()
635 b43legacy_phy_read(dev, 0x0802) & 0xFFFC); in b43legacy_calc_nrssi_slope()
636 backup[7] = b43legacy_read16(dev, 0x03E2); in b43legacy_calc_nrssi_slope()
637 b43legacy_write16(dev, 0x03E2, in b43legacy_calc_nrssi_slope()
638 b43legacy_read16(dev, 0x03E2) | 0x8000); in b43legacy_calc_nrssi_slope()
639 backup[0] = b43legacy_radio_read16(dev, 0x007A); in b43legacy_calc_nrssi_slope()
640 backup[1] = b43legacy_radio_read16(dev, 0x0052); in b43legacy_calc_nrssi_slope()
641 backup[2] = b43legacy_radio_read16(dev, 0x0043); in b43legacy_calc_nrssi_slope()
642 backup[3] = b43legacy_phy_read(dev, 0x0015); in b43legacy_calc_nrssi_slope()
643 backup[4] = b43legacy_phy_read(dev, 0x005A); in b43legacy_calc_nrssi_slope()
644 backup[5] = b43legacy_phy_read(dev, 0x0059); in b43legacy_calc_nrssi_slope()
645 backup[6] = b43legacy_phy_read(dev, 0x0058); in b43legacy_calc_nrssi_slope()
646 backup[8] = b43legacy_read16(dev, 0x03E6); in b43legacy_calc_nrssi_slope()
649 backup[10] = b43legacy_phy_read(dev, 0x002E); in b43legacy_calc_nrssi_slope()
650 backup[11] = b43legacy_phy_read(dev, 0x002F); in b43legacy_calc_nrssi_slope()
651 backup[12] = b43legacy_phy_read(dev, 0x080F); in b43legacy_calc_nrssi_slope()
654 backup[14] = b43legacy_phy_read(dev, 0x0801); in b43legacy_calc_nrssi_slope()
655 backup[15] = b43legacy_phy_read(dev, 0x0060); in b43legacy_calc_nrssi_slope()
656 backup[16] = b43legacy_phy_read(dev, 0x0014); in b43legacy_calc_nrssi_slope()
657 backup[17] = b43legacy_phy_read(dev, 0x0478); in b43legacy_calc_nrssi_slope()
658 b43legacy_phy_write(dev, 0x002E, 0); in b43legacy_calc_nrssi_slope()
659 b43legacy_phy_write(dev, B43legacy_PHY_G_LO_CONTROL, 0); in b43legacy_calc_nrssi_slope()
662 b43legacy_phy_write(dev, 0x0478, in b43legacy_calc_nrssi_slope()
664 0x0478) | 0x0100); in b43legacy_calc_nrssi_slope()
665 b43legacy_phy_write(dev, 0x0801, in b43legacy_calc_nrssi_slope()
667 0x0801) | 0x0040); in b43legacy_calc_nrssi_slope()
670 b43legacy_phy_write(dev, 0x0801, in b43legacy_calc_nrssi_slope()
672 0x0801) & 0xFFBF); in b43legacy_calc_nrssi_slope()
675 b43legacy_phy_write(dev, 0x0060, in b43legacy_calc_nrssi_slope()
676 b43legacy_phy_read(dev, 0x0060) in b43legacy_calc_nrssi_slope()
677 | 0x0040); in b43legacy_calc_nrssi_slope()
678 b43legacy_phy_write(dev, 0x0014, in b43legacy_calc_nrssi_slope()
679 b43legacy_phy_read(dev, 0x0014) in b43legacy_calc_nrssi_slope()
680 | 0x0200); in b43legacy_calc_nrssi_slope()
682 b43legacy_radio_write16(dev, 0x007A, in b43legacy_calc_nrssi_slope()
683 b43legacy_radio_read16(dev, 0x007A) in b43legacy_calc_nrssi_slope()
684 | 0x0070); in b43legacy_calc_nrssi_slope()
685 b43legacy_set_all_gains(dev, 0, 8, 0); in b43legacy_calc_nrssi_slope()
686 b43legacy_radio_write16(dev, 0x007A, in b43legacy_calc_nrssi_slope()
687 b43legacy_radio_read16(dev, 0x007A) in b43legacy_calc_nrssi_slope()
688 & 0x00F7); in b43legacy_calc_nrssi_slope()
690 b43legacy_phy_write(dev, 0x0811, in b43legacy_calc_nrssi_slope()
691 (b43legacy_phy_read(dev, 0x0811) in b43legacy_calc_nrssi_slope()
692 & 0xFFCF) | 0x0030); in b43legacy_calc_nrssi_slope()
693 b43legacy_phy_write(dev, 0x0812, in b43legacy_calc_nrssi_slope()
694 (b43legacy_phy_read(dev, 0x0812) in b43legacy_calc_nrssi_slope()
695 & 0xFFCF) | 0x0010); in b43legacy_calc_nrssi_slope()
697 b43legacy_radio_write16(dev, 0x007A, in b43legacy_calc_nrssi_slope()
698 b43legacy_radio_read16(dev, 0x007A) in b43legacy_calc_nrssi_slope()
699 | 0x0080); in b43legacy_calc_nrssi_slope()
702 nrssi0 = (s16)((b43legacy_phy_read(dev, 0x047F) >> 8) & 0x003F); in b43legacy_calc_nrssi_slope()
703 if (nrssi0 >= 0x0020) in b43legacy_calc_nrssi_slope()
704 nrssi0 -= 0x0040; in b43legacy_calc_nrssi_slope()
706 b43legacy_radio_write16(dev, 0x007A, in b43legacy_calc_nrssi_slope()
707 b43legacy_radio_read16(dev, 0x007A) in b43legacy_calc_nrssi_slope()
708 & 0x007F); in b43legacy_calc_nrssi_slope()
710 b43legacy_phy_write(dev, 0x0003, in b43legacy_calc_nrssi_slope()
711 (b43legacy_phy_read(dev, 0x0003) in b43legacy_calc_nrssi_slope()
712 & 0xFF9F) | 0x0040); in b43legacy_calc_nrssi_slope()
716 B43legacy_MMIO_CHANNEL_EXT) | 0x2000); in b43legacy_calc_nrssi_slope()
717 b43legacy_radio_write16(dev, 0x007A, in b43legacy_calc_nrssi_slope()
718 b43legacy_radio_read16(dev, 0x007A) in b43legacy_calc_nrssi_slope()
719 | 0x000F); in b43legacy_calc_nrssi_slope()
720 b43legacy_phy_write(dev, 0x0015, 0xF330); in b43legacy_calc_nrssi_slope()
722 b43legacy_phy_write(dev, 0x0812, in b43legacy_calc_nrssi_slope()
723 (b43legacy_phy_read(dev, 0x0812) in b43legacy_calc_nrssi_slope()
724 & 0xFFCF) | 0x0020); in b43legacy_calc_nrssi_slope()
725 b43legacy_phy_write(dev, 0x0811, in b43legacy_calc_nrssi_slope()
726 (b43legacy_phy_read(dev, 0x0811) in b43legacy_calc_nrssi_slope()
727 & 0xFFCF) | 0x0020); in b43legacy_calc_nrssi_slope()
730 b43legacy_set_all_gains(dev, 3, 0, 1); in b43legacy_calc_nrssi_slope()
732 b43legacy_radio_write16(dev, 0x0043, 0x001F); in b43legacy_calc_nrssi_slope()
734 tmp = b43legacy_radio_read16(dev, 0x0052) & 0xFF0F; in b43legacy_calc_nrssi_slope()
735 b43legacy_radio_write16(dev, 0x0052, tmp | 0x0060); in b43legacy_calc_nrssi_slope()
736 tmp = b43legacy_radio_read16(dev, 0x0043) & 0xFFF0; in b43legacy_calc_nrssi_slope()
737 b43legacy_radio_write16(dev, 0x0043, tmp | 0x0009); in b43legacy_calc_nrssi_slope()
739 b43legacy_phy_write(dev, 0x005A, 0x0480); in b43legacy_calc_nrssi_slope()
740 b43legacy_phy_write(dev, 0x0059, 0x0810); in b43legacy_calc_nrssi_slope()
741 b43legacy_phy_write(dev, 0x0058, 0x000D); in b43legacy_calc_nrssi_slope()
743 nrssi1 = (s16)((b43legacy_phy_read(dev, 0x047F) >> 8) & 0x003F); in b43legacy_calc_nrssi_slope()
744 if (nrssi1 >= 0x0020) in b43legacy_calc_nrssi_slope()
745 nrssi1 -= 0x0040; in b43legacy_calc_nrssi_slope()
747 phy->nrssislope = 0x00010000; in b43legacy_calc_nrssi_slope()
749 phy->nrssislope = 0x00400000 / (nrssi0 - nrssi1); in b43legacy_calc_nrssi_slope()
751 phy->nrssi[0] = nrssi1; in b43legacy_calc_nrssi_slope()
755 b43legacy_phy_write(dev, 0x002E, backup[10]); in b43legacy_calc_nrssi_slope()
756 b43legacy_phy_write(dev, 0x002F, backup[11]); in b43legacy_calc_nrssi_slope()
757 b43legacy_phy_write(dev, 0x080F, backup[12]); in b43legacy_calc_nrssi_slope()
762 b43legacy_phy_write(dev, 0x0812, in b43legacy_calc_nrssi_slope()
763 b43legacy_phy_read(dev, 0x0812) in b43legacy_calc_nrssi_slope()
764 & 0xFFCF); in b43legacy_calc_nrssi_slope()
765 b43legacy_phy_write(dev, 0x0811, in b43legacy_calc_nrssi_slope()
766 b43legacy_phy_read(dev, 0x0811) in b43legacy_calc_nrssi_slope()
767 & 0xFFCF); in b43legacy_calc_nrssi_slope()
770 b43legacy_radio_write16(dev, 0x007A, backup[0]); in b43legacy_calc_nrssi_slope()
771 b43legacy_radio_write16(dev, 0x0052, backup[1]); in b43legacy_calc_nrssi_slope()
772 b43legacy_radio_write16(dev, 0x0043, backup[2]); in b43legacy_calc_nrssi_slope()
773 b43legacy_write16(dev, 0x03E2, backup[7]); in b43legacy_calc_nrssi_slope()
774 b43legacy_write16(dev, 0x03E6, backup[8]); in b43legacy_calc_nrssi_slope()
776 b43legacy_phy_write(dev, 0x0015, backup[3]); in b43legacy_calc_nrssi_slope()
777 b43legacy_phy_write(dev, 0x005A, backup[4]); in b43legacy_calc_nrssi_slope()
778 b43legacy_phy_write(dev, 0x0059, backup[5]); in b43legacy_calc_nrssi_slope()
779 b43legacy_phy_write(dev, 0x0058, backup[6]); in b43legacy_calc_nrssi_slope()
781 b43legacy_phy_write(dev, 0x0802, in b43legacy_calc_nrssi_slope()
782 b43legacy_phy_read(dev, 0x0802) | 0x0003); in b43legacy_calc_nrssi_slope()
786 | 0x8000); in b43legacy_calc_nrssi_slope()
788 b43legacy_phy_write(dev, 0x0801, backup[14]); in b43legacy_calc_nrssi_slope()
789 b43legacy_phy_write(dev, 0x0060, backup[15]); in b43legacy_calc_nrssi_slope()
790 b43legacy_phy_write(dev, 0x0014, backup[16]); in b43legacy_calc_nrssi_slope()
791 b43legacy_phy_write(dev, 0x0478, backup[17]); in b43legacy_calc_nrssi_slope()
812 if (phy->radio_ver != 0x2050) in b43legacy_calc_nrssi_threshold()
819 threshold = (phy->nrssi[1] - phy->nrssi[0]) * 32; in b43legacy_calc_nrssi_threshold()
820 threshold += 20 * (phy->nrssi[0] + 1); in b43legacy_calc_nrssi_threshold()
825 threshold = clamp_val(threshold, 0, 0x3E); in b43legacy_calc_nrssi_threshold()
826 b43legacy_phy_read(dev, 0x0020); /* dummy read */ in b43legacy_calc_nrssi_threshold()
827 b43legacy_phy_write(dev, 0x0020, (((u16)threshold) << 8) in b43legacy_calc_nrssi_threshold()
828 | 0x001C); in b43legacy_calc_nrssi_threshold()
831 b43legacy_phy_write(dev, 0x0087, 0x0E0D); in b43legacy_calc_nrssi_threshold()
832 b43legacy_phy_write(dev, 0x0086, 0x0C0B); in b43legacy_calc_nrssi_threshold()
833 b43legacy_phy_write(dev, 0x0085, 0x0A09); in b43legacy_calc_nrssi_threshold()
834 b43legacy_phy_write(dev, 0x0084, 0x0808); in b43legacy_calc_nrssi_threshold()
835 b43legacy_phy_write(dev, 0x0083, 0x0808); in b43legacy_calc_nrssi_threshold()
836 b43legacy_phy_write(dev, 0x0082, 0x0604); in b43legacy_calc_nrssi_threshold()
837 b43legacy_phy_write(dev, 0x0081, 0x0302); in b43legacy_calc_nrssi_threshold()
838 b43legacy_phy_write(dev, 0x0080, 0x0100); in b43legacy_calc_nrssi_threshold()
846 tmp16 = b43legacy_nrssi_hw_read(dev, 0x20); in b43legacy_calc_nrssi_threshold()
847 if (tmp16 >= 0x20) in b43legacy_calc_nrssi_threshold()
848 tmp16 -= 0x40; in b43legacy_calc_nrssi_threshold()
850 b43legacy_phy_write(dev, 0x048A, in b43legacy_calc_nrssi_threshold()
852 0x048A) & 0xF000) | 0x09EB); in b43legacy_calc_nrssi_threshold()
854 b43legacy_phy_write(dev, 0x048A, in b43legacy_calc_nrssi_threshold()
856 0x048A) & 0xF000) | 0x0AED); in b43legacy_calc_nrssi_threshold()
860 a = 0xE; in b43legacy_calc_nrssi_threshold()
861 b = 0xA; in b43legacy_calc_nrssi_threshold()
864 a = 0x13; in b43legacy_calc_nrssi_threshold()
865 b = 0x12; in b43legacy_calc_nrssi_threshold()
867 a = 0xE; in b43legacy_calc_nrssi_threshold()
868 b = 0x11; in b43legacy_calc_nrssi_threshold()
871 a = a * (phy->nrssi[1] - phy->nrssi[0]); in b43legacy_calc_nrssi_threshold()
872 a += (phy->nrssi[0] << 6); in b43legacy_calc_nrssi_threshold()
880 b = b * (phy->nrssi[1] - phy->nrssi[0]); in b43legacy_calc_nrssi_threshold()
881 b += (phy->nrssi[0] << 6); in b43legacy_calc_nrssi_threshold()
889 tmp_u16 = b43legacy_phy_read(dev, 0x048A) & 0xF000; in b43legacy_calc_nrssi_threshold()
890 tmp_u16 |= ((u32)b & 0x0000003F); in b43legacy_calc_nrssi_threshold()
891 tmp_u16 |= (((u32)a & 0x0000003F) << 6); in b43legacy_calc_nrssi_threshold()
892 b43legacy_phy_write(dev, 0x048A, tmp_u16); in b43legacy_calc_nrssi_threshold()
909 B43legacy_WARN_ON(!((offset & 0xE000) == 0x0000)); in _stack_save()
910 B43legacy_WARN_ON(!((id & 0xF8) == 0x00)); in _stack_save()
923 B43legacy_WARN_ON(!((offset & 0xE000) == 0x0000)); in _stack_restore()
924 B43legacy_WARN_ON(!((id & 0xF8) == 0x00)); in _stack_restore()
925 for (i = 0; i < B43legacy_INTERFSTACK_SIZE; i++, stackptr++) { in _stack_restore()
926 if ((*stackptr & 0x00001FFF) != offset) in _stack_restore()
928 if (((*stackptr & 0x00007000) >> 13) != id) in _stack_restore()
930 return ((*stackptr & 0xFFFF0000) >> 16); in _stack_restore()
934 return 0; in _stack_restore()
939 _stack_save(stack, &stackidx, 0x1, (offset), \
941 } while (0)
945 _stack_restore(stack, 0x1, \
947 } while (0)
950 _stack_save(stack, &stackidx, 0x2, (offset), \
952 } while (0)
956 _stack_restore(stack, 0x2, \
958 } while (0)
961 _stack_save(stack, &stackidx, 0x3, (offset), \
963 } while (0)
967 _stack_restore(stack, 0x3, \
969 } while (0)
979 size_t stackidx = 0; in b43legacy_radio_interference_mitigation_enable()
985 b43legacy_phy_write(dev, 0x042B, in b43legacy_radio_interference_mitigation_enable()
986 b43legacy_phy_read(dev, 0x042B) in b43legacy_radio_interference_mitigation_enable()
987 | 0x0800); in b43legacy_radio_interference_mitigation_enable()
990 B43legacy_PHY_G_CRS) & ~0x4000); in b43legacy_radio_interference_mitigation_enable()
993 radio_stacksave(0x0078); in b43legacy_radio_interference_mitigation_enable()
994 tmp = (b43legacy_radio_read16(dev, 0x0078) & 0x001E); in b43legacy_radio_interference_mitigation_enable()
1001 flipped = (flipped << 1) | 0x0020; in b43legacy_radio_interference_mitigation_enable()
1002 b43legacy_radio_write16(dev, 0x0078, flipped); in b43legacy_radio_interference_mitigation_enable()
1006 phy_stacksave(0x0406); in b43legacy_radio_interference_mitigation_enable()
1007 b43legacy_phy_write(dev, 0x0406, 0x7E28); in b43legacy_radio_interference_mitigation_enable()
1009 b43legacy_phy_write(dev, 0x042B, in b43legacy_radio_interference_mitigation_enable()
1010 b43legacy_phy_read(dev, 0x042B) | 0x0800); in b43legacy_radio_interference_mitigation_enable()
1013 B43legacy_PHY_RADIO_BITFIELD) | 0x1000); in b43legacy_radio_interference_mitigation_enable()
1015 phy_stacksave(0x04A0); in b43legacy_radio_interference_mitigation_enable()
1016 b43legacy_phy_write(dev, 0x04A0, in b43legacy_radio_interference_mitigation_enable()
1017 (b43legacy_phy_read(dev, 0x04A0) & 0xC0C0) in b43legacy_radio_interference_mitigation_enable()
1018 | 0x0008); in b43legacy_radio_interference_mitigation_enable()
1019 phy_stacksave(0x04A1); in b43legacy_radio_interference_mitigation_enable()
1020 b43legacy_phy_write(dev, 0x04A1, in b43legacy_radio_interference_mitigation_enable()
1021 (b43legacy_phy_read(dev, 0x04A1) & 0xC0C0) in b43legacy_radio_interference_mitigation_enable()
1022 | 0x0605); in b43legacy_radio_interference_mitigation_enable()
1023 phy_stacksave(0x04A2); in b43legacy_radio_interference_mitigation_enable()
1024 b43legacy_phy_write(dev, 0x04A2, in b43legacy_radio_interference_mitigation_enable()
1025 (b43legacy_phy_read(dev, 0x04A2) & 0xC0C0) in b43legacy_radio_interference_mitigation_enable()
1026 | 0x0204); in b43legacy_radio_interference_mitigation_enable()
1027 phy_stacksave(0x04A8); in b43legacy_radio_interference_mitigation_enable()
1028 b43legacy_phy_write(dev, 0x04A8, in b43legacy_radio_interference_mitigation_enable()
1029 (b43legacy_phy_read(dev, 0x04A8) & 0xC0C0) in b43legacy_radio_interference_mitigation_enable()
1030 | 0x0803); in b43legacy_radio_interference_mitigation_enable()
1031 phy_stacksave(0x04AB); in b43legacy_radio_interference_mitigation_enable()
1032 b43legacy_phy_write(dev, 0x04AB, in b43legacy_radio_interference_mitigation_enable()
1033 (b43legacy_phy_read(dev, 0x04AB) & 0xC0C0) in b43legacy_radio_interference_mitigation_enable()
1034 | 0x0605); in b43legacy_radio_interference_mitigation_enable()
1036 phy_stacksave(0x04A7); in b43legacy_radio_interference_mitigation_enable()
1037 b43legacy_phy_write(dev, 0x04A7, 0x0002); in b43legacy_radio_interference_mitigation_enable()
1038 phy_stacksave(0x04A3); in b43legacy_radio_interference_mitigation_enable()
1039 b43legacy_phy_write(dev, 0x04A3, 0x287A); in b43legacy_radio_interference_mitigation_enable()
1040 phy_stacksave(0x04A9); in b43legacy_radio_interference_mitigation_enable()
1041 b43legacy_phy_write(dev, 0x04A9, 0x2027); in b43legacy_radio_interference_mitigation_enable()
1042 phy_stacksave(0x0493); in b43legacy_radio_interference_mitigation_enable()
1043 b43legacy_phy_write(dev, 0x0493, 0x32F5); in b43legacy_radio_interference_mitigation_enable()
1044 phy_stacksave(0x04AA); in b43legacy_radio_interference_mitigation_enable()
1045 b43legacy_phy_write(dev, 0x04AA, 0x2027); in b43legacy_radio_interference_mitigation_enable()
1046 phy_stacksave(0x04AC); in b43legacy_radio_interference_mitigation_enable()
1047 b43legacy_phy_write(dev, 0x04AC, 0x32F5); in b43legacy_radio_interference_mitigation_enable()
1050 if (b43legacy_phy_read(dev, 0x0033) & 0x0800) in b43legacy_radio_interference_mitigation_enable()
1058 phy_stacksave(0x0406); in b43legacy_radio_interference_mitigation_enable()
1060 phy_stacksave(0x04C0); in b43legacy_radio_interference_mitigation_enable()
1061 phy_stacksave(0x04C1); in b43legacy_radio_interference_mitigation_enable()
1063 phy_stacksave(0x0033); in b43legacy_radio_interference_mitigation_enable()
1064 phy_stacksave(0x04A7); in b43legacy_radio_interference_mitigation_enable()
1065 phy_stacksave(0x04A3); in b43legacy_radio_interference_mitigation_enable()
1066 phy_stacksave(0x04A9); in b43legacy_radio_interference_mitigation_enable()
1067 phy_stacksave(0x04AA); in b43legacy_radio_interference_mitigation_enable()
1068 phy_stacksave(0x04AC); in b43legacy_radio_interference_mitigation_enable()
1069 phy_stacksave(0x0493); in b43legacy_radio_interference_mitigation_enable()
1070 phy_stacksave(0x04A1); in b43legacy_radio_interference_mitigation_enable()
1071 phy_stacksave(0x04A0); in b43legacy_radio_interference_mitigation_enable()
1072 phy_stacksave(0x04A2); in b43legacy_radio_interference_mitigation_enable()
1073 phy_stacksave(0x048A); in b43legacy_radio_interference_mitigation_enable()
1074 phy_stacksave(0x04A8); in b43legacy_radio_interference_mitigation_enable()
1075 phy_stacksave(0x04AB); in b43legacy_radio_interference_mitigation_enable()
1077 phy_stacksave(0x04AD); in b43legacy_radio_interference_mitigation_enable()
1078 phy_stacksave(0x04AE); in b43legacy_radio_interference_mitigation_enable()
1080 phy_stacksave(0x04AD); in b43legacy_radio_interference_mitigation_enable()
1081 phy_stacksave(0x0415); in b43legacy_radio_interference_mitigation_enable()
1082 phy_stacksave(0x0416); in b43legacy_radio_interference_mitigation_enable()
1083 phy_stacksave(0x0417); in b43legacy_radio_interference_mitigation_enable()
1084 ilt_stacksave(0x1A00 + 0x2); in b43legacy_radio_interference_mitigation_enable()
1085 ilt_stacksave(0x1A00 + 0x3); in b43legacy_radio_interference_mitigation_enable()
1087 phy_stacksave(0x042B); in b43legacy_radio_interference_mitigation_enable()
1088 phy_stacksave(0x048C); in b43legacy_radio_interference_mitigation_enable()
1092 B43legacy_PHY_RADIO_BITFIELD) & ~0x1000); in b43legacy_radio_interference_mitigation_enable()
1096 & 0xFFFC) | 0x0002); in b43legacy_radio_interference_mitigation_enable()
1098 b43legacy_phy_write(dev, 0x0033, 0x0800); in b43legacy_radio_interference_mitigation_enable()
1099 b43legacy_phy_write(dev, 0x04A3, 0x2027); in b43legacy_radio_interference_mitigation_enable()
1100 b43legacy_phy_write(dev, 0x04A9, 0x1CA8); in b43legacy_radio_interference_mitigation_enable()
1101 b43legacy_phy_write(dev, 0x0493, 0x287A); in b43legacy_radio_interference_mitigation_enable()
1102 b43legacy_phy_write(dev, 0x04AA, 0x1CA8); in b43legacy_radio_interference_mitigation_enable()
1103 b43legacy_phy_write(dev, 0x04AC, 0x287A); in b43legacy_radio_interference_mitigation_enable()
1105 b43legacy_phy_write(dev, 0x04A0, in b43legacy_radio_interference_mitigation_enable()
1106 (b43legacy_phy_read(dev, 0x04A0) in b43legacy_radio_interference_mitigation_enable()
1107 & 0xFFC0) | 0x001A); in b43legacy_radio_interference_mitigation_enable()
1108 b43legacy_phy_write(dev, 0x04A7, 0x000D); in b43legacy_radio_interference_mitigation_enable()
1111 b43legacy_phy_write(dev, 0x0406, 0xFF0D); in b43legacy_radio_interference_mitigation_enable()
1113 b43legacy_phy_write(dev, 0x04C0, 0xFFFF); in b43legacy_radio_interference_mitigation_enable()
1114 b43legacy_phy_write(dev, 0x04C1, 0x00A9); in b43legacy_radio_interference_mitigation_enable()
1116 b43legacy_phy_write(dev, 0x04C0, 0x00C1); in b43legacy_radio_interference_mitigation_enable()
1117 b43legacy_phy_write(dev, 0x04C1, 0x0059); in b43legacy_radio_interference_mitigation_enable()
1120 b43legacy_phy_write(dev, 0x04A1, in b43legacy_radio_interference_mitigation_enable()
1121 (b43legacy_phy_read(dev, 0x04A1) in b43legacy_radio_interference_mitigation_enable()
1122 & 0xC0FF) | 0x1800); in b43legacy_radio_interference_mitigation_enable()
1123 b43legacy_phy_write(dev, 0x04A1, in b43legacy_radio_interference_mitigation_enable()
1124 (b43legacy_phy_read(dev, 0x04A1) in b43legacy_radio_interference_mitigation_enable()
1125 & 0xFFC0) | 0x0015); in b43legacy_radio_interference_mitigation_enable()
1126 b43legacy_phy_write(dev, 0x04A8, in b43legacy_radio_interference_mitigation_enable()
1127 (b43legacy_phy_read(dev, 0x04A8) in b43legacy_radio_interference_mitigation_enable()
1128 & 0xCFFF) | 0x1000); in b43legacy_radio_interference_mitigation_enable()
1129 b43legacy_phy_write(dev, 0x04A8, in b43legacy_radio_interference_mitigation_enable()
1130 (b43legacy_phy_read(dev, 0x04A8) in b43legacy_radio_interference_mitigation_enable()
1131 & 0xF0FF) | 0x0A00); in b43legacy_radio_interference_mitigation_enable()
1132 b43legacy_phy_write(dev, 0x04AB, in b43legacy_radio_interference_mitigation_enable()
1133 (b43legacy_phy_read(dev, 0x04AB) in b43legacy_radio_interference_mitigation_enable()
1134 & 0xCFFF) | 0x1000); in b43legacy_radio_interference_mitigation_enable()
1135 b43legacy_phy_write(dev, 0x04AB, in b43legacy_radio_interference_mitigation_enable()
1136 (b43legacy_phy_read(dev, 0x04AB) in b43legacy_radio_interference_mitigation_enable()
1137 & 0xF0FF) | 0x0800); in b43legacy_radio_interference_mitigation_enable()
1138 b43legacy_phy_write(dev, 0x04AB, in b43legacy_radio_interference_mitigation_enable()
1139 (b43legacy_phy_read(dev, 0x04AB) in b43legacy_radio_interference_mitigation_enable()
1140 & 0xFFCF) | 0x0010); in b43legacy_radio_interference_mitigation_enable()
1141 b43legacy_phy_write(dev, 0x04AB, in b43legacy_radio_interference_mitigation_enable()
1142 (b43legacy_phy_read(dev, 0x04AB) in b43legacy_radio_interference_mitigation_enable()
1143 & 0xFFF0) | 0x0005); in b43legacy_radio_interference_mitigation_enable()
1144 b43legacy_phy_write(dev, 0x04A8, in b43legacy_radio_interference_mitigation_enable()
1145 (b43legacy_phy_read(dev, 0x04A8) in b43legacy_radio_interference_mitigation_enable()
1146 & 0xFFCF) | 0x0010); in b43legacy_radio_interference_mitigation_enable()
1147 b43legacy_phy_write(dev, 0x04A8, in b43legacy_radio_interference_mitigation_enable()
1148 (b43legacy_phy_read(dev, 0x04A8) in b43legacy_radio_interference_mitigation_enable()
1149 & 0xFFF0) | 0x0006); in b43legacy_radio_interference_mitigation_enable()
1150 b43legacy_phy_write(dev, 0x04A2, in b43legacy_radio_interference_mitigation_enable()
1151 (b43legacy_phy_read(dev, 0x04A2) in b43legacy_radio_interference_mitigation_enable()
1152 & 0xF0FF) | 0x0800); in b43legacy_radio_interference_mitigation_enable()
1153 b43legacy_phy_write(dev, 0x04A0, in b43legacy_radio_interference_mitigation_enable()
1154 (b43legacy_phy_read(dev, 0x04A0) in b43legacy_radio_interference_mitigation_enable()
1155 & 0xF0FF) | 0x0500); in b43legacy_radio_interference_mitigation_enable()
1156 b43legacy_phy_write(dev, 0x04A2, in b43legacy_radio_interference_mitigation_enable()
1157 (b43legacy_phy_read(dev, 0x04A2) in b43legacy_radio_interference_mitigation_enable()
1158 & 0xFFF0) | 0x000B); in b43legacy_radio_interference_mitigation_enable()
1161 b43legacy_phy_write(dev, 0x048A, in b43legacy_radio_interference_mitigation_enable()
1162 b43legacy_phy_read(dev, 0x048A) in b43legacy_radio_interference_mitigation_enable()
1163 & ~0x8000); in b43legacy_radio_interference_mitigation_enable()
1164 b43legacy_phy_write(dev, 0x0415, in b43legacy_radio_interference_mitigation_enable()
1165 (b43legacy_phy_read(dev, 0x0415) in b43legacy_radio_interference_mitigation_enable()
1166 & 0x8000) | 0x36D8); in b43legacy_radio_interference_mitigation_enable()
1167 b43legacy_phy_write(dev, 0x0416, in b43legacy_radio_interference_mitigation_enable()
1168 (b43legacy_phy_read(dev, 0x0416) in b43legacy_radio_interference_mitigation_enable()
1169 & 0x8000) | 0x36D8); in b43legacy_radio_interference_mitigation_enable()
1170 b43legacy_phy_write(dev, 0x0417, in b43legacy_radio_interference_mitigation_enable()
1171 (b43legacy_phy_read(dev, 0x0417) in b43legacy_radio_interference_mitigation_enable()
1172 & 0xFE00) | 0x016D); in b43legacy_radio_interference_mitigation_enable()
1174 b43legacy_phy_write(dev, 0x048A, in b43legacy_radio_interference_mitigation_enable()
1175 b43legacy_phy_read(dev, 0x048A) in b43legacy_radio_interference_mitigation_enable()
1176 | 0x1000); in b43legacy_radio_interference_mitigation_enable()
1177 b43legacy_phy_write(dev, 0x048A, in b43legacy_radio_interference_mitigation_enable()
1178 (b43legacy_phy_read(dev, 0x048A) in b43legacy_radio_interference_mitigation_enable()
1179 & 0x9FFF) | 0x2000); in b43legacy_radio_interference_mitigation_enable()
1182 if (!(tmp32 & 0x800)) { in b43legacy_radio_interference_mitigation_enable()
1183 tmp32 |= 0x800; in b43legacy_radio_interference_mitigation_enable()
1190 b43legacy_phy_write(dev, 0x042B, in b43legacy_radio_interference_mitigation_enable()
1191 b43legacy_phy_read(dev, 0x042B) in b43legacy_radio_interference_mitigation_enable()
1192 | 0x0800); in b43legacy_radio_interference_mitigation_enable()
1193 b43legacy_phy_write(dev, 0x048C, in b43legacy_radio_interference_mitigation_enable()
1194 (b43legacy_phy_read(dev, 0x048C) in b43legacy_radio_interference_mitigation_enable()
1195 & 0xF0FF) | 0x0200); in b43legacy_radio_interference_mitigation_enable()
1197 b43legacy_phy_write(dev, 0x04AE, in b43legacy_radio_interference_mitigation_enable()
1198 (b43legacy_phy_read(dev, 0x04AE) in b43legacy_radio_interference_mitigation_enable()
1199 & 0xFF00) | 0x007F); in b43legacy_radio_interference_mitigation_enable()
1200 b43legacy_phy_write(dev, 0x04AD, in b43legacy_radio_interference_mitigation_enable()
1201 (b43legacy_phy_read(dev, 0x04AD) in b43legacy_radio_interference_mitigation_enable()
1202 & 0x00FF) | 0x1300); in b43legacy_radio_interference_mitigation_enable()
1204 b43legacy_ilt_write(dev, 0x1A00 + 0x3, 0x007F); in b43legacy_radio_interference_mitigation_enable()
1205 b43legacy_ilt_write(dev, 0x1A00 + 0x2, 0x007F); in b43legacy_radio_interference_mitigation_enable()
1206 b43legacy_phy_write(dev, 0x04AD, in b43legacy_radio_interference_mitigation_enable()
1207 b43legacy_phy_read(dev, 0x04AD) in b43legacy_radio_interference_mitigation_enable()
1208 & 0x00FF); in b43legacy_radio_interference_mitigation_enable()
1228 b43legacy_phy_write(dev, 0x042B, in b43legacy_radio_interference_mitigation_disable()
1229 b43legacy_phy_read(dev, 0x042B) in b43legacy_radio_interference_mitigation_disable()
1230 & ~0x0800); in b43legacy_radio_interference_mitigation_disable()
1233 B43legacy_PHY_G_CRS) | 0x4000); in b43legacy_radio_interference_mitigation_disable()
1236 phy_stackrestore(0x0078); in b43legacy_radio_interference_mitigation_disable()
1238 phy_stackrestore(0x0406); in b43legacy_radio_interference_mitigation_disable()
1239 b43legacy_phy_write(dev, 0x042B, in b43legacy_radio_interference_mitigation_disable()
1240 b43legacy_phy_read(dev, 0x042B) & ~0x0800); in b43legacy_radio_interference_mitigation_disable()
1248 | 0x4000); in b43legacy_radio_interference_mitigation_disable()
1249 phy_stackrestore(0x04A0); in b43legacy_radio_interference_mitigation_disable()
1250 phy_stackrestore(0x04A1); in b43legacy_radio_interference_mitigation_disable()
1251 phy_stackrestore(0x04A2); in b43legacy_radio_interference_mitigation_disable()
1252 phy_stackrestore(0x04A8); in b43legacy_radio_interference_mitigation_disable()
1253 phy_stackrestore(0x04AB); in b43legacy_radio_interference_mitigation_disable()
1254 phy_stackrestore(0x04A7); in b43legacy_radio_interference_mitigation_disable()
1255 phy_stackrestore(0x04A3); in b43legacy_radio_interference_mitigation_disable()
1256 phy_stackrestore(0x04A9); in b43legacy_radio_interference_mitigation_disable()
1257 phy_stackrestore(0x0493); in b43legacy_radio_interference_mitigation_disable()
1258 phy_stackrestore(0x04AA); in b43legacy_radio_interference_mitigation_disable()
1259 phy_stackrestore(0x04AC); in b43legacy_radio_interference_mitigation_disable()
1262 if (!(b43legacy_phy_read(dev, 0x0033) & 0x0800)) in b43legacy_radio_interference_mitigation_disable()
1269 phy_stackrestore(0x0033); in b43legacy_radio_interference_mitigation_disable()
1270 phy_stackrestore(0x04A3); in b43legacy_radio_interference_mitigation_disable()
1271 phy_stackrestore(0x04A9); in b43legacy_radio_interference_mitigation_disable()
1272 phy_stackrestore(0x0493); in b43legacy_radio_interference_mitigation_disable()
1273 phy_stackrestore(0x04AA); in b43legacy_radio_interference_mitigation_disable()
1274 phy_stackrestore(0x04AC); in b43legacy_radio_interference_mitigation_disable()
1275 phy_stackrestore(0x04A0); in b43legacy_radio_interference_mitigation_disable()
1276 phy_stackrestore(0x04A7); in b43legacy_radio_interference_mitigation_disable()
1278 phy_stackrestore(0x04C0); in b43legacy_radio_interference_mitigation_disable()
1279 phy_stackrestore(0x04C1); in b43legacy_radio_interference_mitigation_disable()
1281 phy_stackrestore(0x0406); in b43legacy_radio_interference_mitigation_disable()
1282 phy_stackrestore(0x04A1); in b43legacy_radio_interference_mitigation_disable()
1283 phy_stackrestore(0x04AB); in b43legacy_radio_interference_mitigation_disable()
1284 phy_stackrestore(0x04A8); in b43legacy_radio_interference_mitigation_disable()
1286 phy_stackrestore(0x04AD); in b43legacy_radio_interference_mitigation_disable()
1287 phy_stackrestore(0x04AE); in b43legacy_radio_interference_mitigation_disable()
1289 phy_stackrestore(0x04AD); in b43legacy_radio_interference_mitigation_disable()
1290 phy_stackrestore(0x0415); in b43legacy_radio_interference_mitigation_disable()
1291 phy_stackrestore(0x0416); in b43legacy_radio_interference_mitigation_disable()
1292 phy_stackrestore(0x0417); in b43legacy_radio_interference_mitigation_disable()
1293 ilt_stackrestore(0x1A00 + 0x2); in b43legacy_radio_interference_mitigation_disable()
1294 ilt_stackrestore(0x1A00 + 0x3); in b43legacy_radio_interference_mitigation_disable()
1296 phy_stackrestore(0x04A2); in b43legacy_radio_interference_mitigation_disable()
1297 phy_stackrestore(0x04A8); in b43legacy_radio_interference_mitigation_disable()
1298 phy_stackrestore(0x042B); in b43legacy_radio_interference_mitigation_disable()
1299 phy_stackrestore(0x048C); in b43legacy_radio_interference_mitigation_disable()
1302 if (tmp32 & 0x800) { in b43legacy_radio_interference_mitigation_disable()
1303 tmp32 &= ~0x800; in b43legacy_radio_interference_mitigation_disable()
1329 (phy->rev == 0) || (!phy->gmode)) in b43legacy_radio_set_interference_mitigation()
1351 return 0; in b43legacy_radio_set_interference_mitigation()
1363 return 0; in b43legacy_radio_set_interference_mitigation()
1372 reg = b43legacy_radio_read16(dev, 0x0060); in b43legacy_radio_calibrationvalue()
1373 index = (reg & 0x001E) >> 1; in b43legacy_radio_calibrationvalue()
1375 ret |= (reg & 0x0001); in b43legacy_radio_calibrationvalue()
1376 ret |= 0x0020; in b43legacy_radio_calibrationvalue()
1381 #define LPD(L, P, D) (((L) << 2) | ((P) << 1) | ((D) << 0))
1385 u16 loop_or = 0; in b43legacy_get_812_value()
1386 u16 adj_loopback_gain = phy->loopback_gain[0]; in b43legacy_get_812_value()
1391 return 0; in b43legacy_get_812_value()
1396 case LPD(0, 1, 1): in b43legacy_get_812_value()
1397 return 0x0FB2; in b43legacy_get_812_value()
1398 case LPD(0, 0, 1): in b43legacy_get_812_value()
1399 return 0x00B2; in b43legacy_get_812_value()
1400 case LPD(1, 0, 1): in b43legacy_get_812_value()
1401 return 0x30B2; in b43legacy_get_812_value()
1402 case LPD(1, 0, 0): in b43legacy_get_812_value()
1403 return 0x30B3; in b43legacy_get_812_value()
1409 case LPD(0, 1, 1): in b43legacy_get_812_value()
1410 return 0x8FB2; in b43legacy_get_812_value()
1411 case LPD(0, 0, 1): in b43legacy_get_812_value()
1412 return 0x80B2; in b43legacy_get_812_value()
1413 case LPD(1, 0, 1): in b43legacy_get_812_value()
1414 return 0x20B2; in b43legacy_get_812_value()
1415 case LPD(1, 0, 0): in b43legacy_get_812_value()
1416 return 0x20B3; in b43legacy_get_812_value()
1423 adj_loopback_gain += 0x003E; in b43legacy_get_812_value()
1425 adj_loopback_gain += 0x0026; in b43legacy_get_812_value()
1426 if (adj_loopback_gain >= 0x46) { in b43legacy_get_812_value()
1427 adj_loopback_gain -= 0x46; in b43legacy_get_812_value()
1428 extern_lna_control = 0x3000; in b43legacy_get_812_value()
1429 } else if (adj_loopback_gain >= 0x3A) { in b43legacy_get_812_value()
1430 adj_loopback_gain -= 0x3A; in b43legacy_get_812_value()
1431 extern_lna_control = 0x2000; in b43legacy_get_812_value()
1432 } else if (adj_loopback_gain >= 0x2E) { in b43legacy_get_812_value()
1433 adj_loopback_gain -= 0x2E; in b43legacy_get_812_value()
1434 extern_lna_control = 0x1000; in b43legacy_get_812_value()
1436 adj_loopback_gain -= 0x10; in b43legacy_get_812_value()
1437 extern_lna_control = 0x0000; in b43legacy_get_812_value()
1439 for (loop = 0; loop < 16; loop++) { in b43legacy_get_812_value()
1449 loop_or |= 0x8000; in b43legacy_get_812_value()
1451 case LPD(0, 1, 1): in b43legacy_get_812_value()
1452 return 0x8F92; in b43legacy_get_812_value()
1453 case LPD(0, 0, 1): in b43legacy_get_812_value()
1454 return (0x8092 | loop_or); in b43legacy_get_812_value()
1455 case LPD(1, 0, 1): in b43legacy_get_812_value()
1456 return (0x2092 | loop_or); in b43legacy_get_812_value()
1457 case LPD(1, 0, 0): in b43legacy_get_812_value()
1458 return (0x2093 | loop_or); in b43legacy_get_812_value()
1464 case LPD(0, 1, 1): in b43legacy_get_812_value()
1465 return 0x0F92; in b43legacy_get_812_value()
1466 case LPD(0, 0, 1): in b43legacy_get_812_value()
1467 case LPD(1, 0, 1): in b43legacy_get_812_value()
1468 return (0x0092 | loop_or); in b43legacy_get_812_value()
1469 case LPD(1, 0, 0): in b43legacy_get_812_value()
1470 return (0x0093 | loop_or); in b43legacy_get_812_value()
1476 return 0; in b43legacy_get_812_value()
1482 u16 backup[21] = { 0 }; in b43legacy_radio_init2050()
1486 u32 tmp1 = 0; in b43legacy_radio_init2050()
1487 u32 tmp2 = 0; in b43legacy_radio_init2050()
1489 backup[0] = b43legacy_radio_read16(dev, 0x0043); in b43legacy_radio_init2050()
1490 backup[14] = b43legacy_radio_read16(dev, 0x0051); in b43legacy_radio_init2050()
1491 backup[15] = b43legacy_radio_read16(dev, 0x0052); in b43legacy_radio_init2050()
1492 backup[1] = b43legacy_phy_read(dev, 0x0015); in b43legacy_radio_init2050()
1493 backup[16] = b43legacy_phy_read(dev, 0x005A); in b43legacy_radio_init2050()
1494 backup[17] = b43legacy_phy_read(dev, 0x0059); in b43legacy_radio_init2050()
1495 backup[18] = b43legacy_phy_read(dev, 0x0058); in b43legacy_radio_init2050()
1497 backup[2] = b43legacy_phy_read(dev, 0x0030); in b43legacy_radio_init2050()
1498 backup[3] = b43legacy_read16(dev, 0x03EC); in b43legacy_radio_init2050()
1499 b43legacy_phy_write(dev, 0x0030, 0x00FF); in b43legacy_radio_init2050()
1500 b43legacy_write16(dev, 0x03EC, 0x3F3F); in b43legacy_radio_init2050()
1503 backup[4] = b43legacy_phy_read(dev, 0x0811); in b43legacy_radio_init2050()
1504 backup[5] = b43legacy_phy_read(dev, 0x0812); in b43legacy_radio_init2050()
1505 backup[6] = b43legacy_phy_read(dev, 0x0814); in b43legacy_radio_init2050()
1506 backup[7] = b43legacy_phy_read(dev, 0x0815); in b43legacy_radio_init2050()
1509 backup[9] = b43legacy_phy_read(dev, 0x0802); in b43legacy_radio_init2050()
1510 b43legacy_phy_write(dev, 0x0814, in b43legacy_radio_init2050()
1511 (b43legacy_phy_read(dev, 0x0814) in b43legacy_radio_init2050()
1512 | 0x0003)); in b43legacy_radio_init2050()
1513 b43legacy_phy_write(dev, 0x0815, in b43legacy_radio_init2050()
1514 (b43legacy_phy_read(dev, 0x0815) in b43legacy_radio_init2050()
1515 & 0xFFFC)); in b43legacy_radio_init2050()
1518 B43legacy_PHY_G_CRS) & 0x7FFF)); in b43legacy_radio_init2050()
1519 b43legacy_phy_write(dev, 0x0802, in b43legacy_radio_init2050()
1520 (b43legacy_phy_read(dev, 0x0802) in b43legacy_radio_init2050()
1521 & 0xFFFC)); in b43legacy_radio_init2050()
1523 backup[19] = b43legacy_phy_read(dev, 0x080F); in b43legacy_radio_init2050()
1524 backup[20] = b43legacy_phy_read(dev, 0x0810); in b43legacy_radio_init2050()
1526 b43legacy_phy_write(dev, 0x080F, in b43legacy_radio_init2050()
1527 0xC020); in b43legacy_radio_init2050()
1529 b43legacy_phy_write(dev, 0x080F, in b43legacy_radio_init2050()
1530 0x8020); in b43legacy_radio_init2050()
1531 b43legacy_phy_write(dev, 0x0810, 0x0000); in b43legacy_radio_init2050()
1533 b43legacy_phy_write(dev, 0x0812, in b43legacy_radio_init2050()
1535 LPD(0, 1, 1))); in b43legacy_radio_init2050()
1539 b43legacy_phy_write(dev, 0x0811, 0x01B3); in b43legacy_radio_init2050()
1541 b43legacy_phy_write(dev, 0x0811, 0x09B3); in b43legacy_radio_init2050()
1546 | 0x8000)); in b43legacy_radio_init2050()
1547 backup[10] = b43legacy_phy_read(dev, 0x0035); in b43legacy_radio_init2050()
1548 b43legacy_phy_write(dev, 0x0035, in b43legacy_radio_init2050()
1549 (b43legacy_phy_read(dev, 0x0035) & 0xFF7F)); in b43legacy_radio_init2050()
1550 backup[11] = b43legacy_read16(dev, 0x03E6); in b43legacy_radio_init2050()
1554 if (phy->analog == 0) in b43legacy_radio_init2050()
1555 b43legacy_write16(dev, 0x03E6, 0x0122); in b43legacy_radio_init2050()
1558 b43legacy_phy_write(dev, 0x0003, in b43legacy_radio_init2050()
1559 (b43legacy_phy_read(dev, 0x0003) in b43legacy_radio_init2050()
1560 & 0xFFBF) | 0x0040); in b43legacy_radio_init2050()
1563 B43legacy_MMIO_CHANNEL_EXT) | 0x2000)); in b43legacy_radio_init2050()
1569 b43legacy_radio_write16(dev, 0x0078, 0x0026); in b43legacy_radio_init2050()
1572 b43legacy_phy_write(dev, 0x0812, in b43legacy_radio_init2050()
1574 LPD(0, 1, 1))); in b43legacy_radio_init2050()
1575 b43legacy_phy_write(dev, 0x0015, 0xBFAF); in b43legacy_radio_init2050()
1576 b43legacy_phy_write(dev, 0x002B, 0x1403); in b43legacy_radio_init2050()
1578 b43legacy_phy_write(dev, 0x0812, in b43legacy_radio_init2050()
1580 LPD(0, 0, 1))); in b43legacy_radio_init2050()
1581 b43legacy_phy_write(dev, 0x0015, 0xBFA0); in b43legacy_radio_init2050()
1582 b43legacy_radio_write16(dev, 0x0051, in b43legacy_radio_init2050()
1583 (b43legacy_radio_read16(dev, 0x0051) in b43legacy_radio_init2050()
1584 | 0x0004)); in b43legacy_radio_init2050()
1586 b43legacy_radio_write16(dev, 0x0043, 0x001F); in b43legacy_radio_init2050()
1588 b43legacy_radio_write16(dev, 0x0052, 0x0000); in b43legacy_radio_init2050()
1589 b43legacy_radio_write16(dev, 0x0043, in b43legacy_radio_init2050()
1590 (b43legacy_radio_read16(dev, 0x0043) in b43legacy_radio_init2050()
1591 & 0xFFF0) | 0x0009); in b43legacy_radio_init2050()
1593 b43legacy_phy_write(dev, 0x0058, 0x0000); in b43legacy_radio_init2050()
1595 for (i = 0; i < 16; i++) { in b43legacy_radio_init2050()
1596 b43legacy_phy_write(dev, 0x005A, 0x0480); in b43legacy_radio_init2050()
1597 b43legacy_phy_write(dev, 0x0059, 0xC810); in b43legacy_radio_init2050()
1598 b43legacy_phy_write(dev, 0x0058, 0x000D); in b43legacy_radio_init2050()
1600 b43legacy_phy_write(dev, 0x0812, in b43legacy_radio_init2050()
1602 LPD(1, 0, 1))); in b43legacy_radio_init2050()
1603 b43legacy_phy_write(dev, 0x0015, 0xAFB0); in b43legacy_radio_init2050()
1606 b43legacy_phy_write(dev, 0x0812, in b43legacy_radio_init2050()
1608 LPD(1, 0, 1))); in b43legacy_radio_init2050()
1609 b43legacy_phy_write(dev, 0x0015, 0xEFB0); in b43legacy_radio_init2050()
1612 b43legacy_phy_write(dev, 0x0812, in b43legacy_radio_init2050()
1614 LPD(1, 0, 0))); in b43legacy_radio_init2050()
1615 b43legacy_phy_write(dev, 0x0015, 0xFFF0); in b43legacy_radio_init2050()
1617 tmp1 += b43legacy_phy_read(dev, 0x002D); in b43legacy_radio_init2050()
1618 b43legacy_phy_write(dev, 0x0058, 0x0000); in b43legacy_radio_init2050()
1620 b43legacy_phy_write(dev, 0x0812, in b43legacy_radio_init2050()
1622 LPD(1, 0, 1))); in b43legacy_radio_init2050()
1623 b43legacy_phy_write(dev, 0x0015, 0xAFB0); in b43legacy_radio_init2050()
1629 b43legacy_phy_write(dev, 0x0058, 0x0000); in b43legacy_radio_init2050()
1631 for (i = 0; i < 16; i++) { in b43legacy_radio_init2050()
1632 b43legacy_radio_write16(dev, 0x0078, (flip_4bit(i) << 1) in b43legacy_radio_init2050()
1633 | 0x0020); in b43legacy_radio_init2050()
1634 backup[13] = b43legacy_radio_read16(dev, 0x0078); in b43legacy_radio_init2050()
1636 for (j = 0; j < 16; j++) { in b43legacy_radio_init2050()
1637 b43legacy_phy_write(dev, 0x005A, 0x0D80); in b43legacy_radio_init2050()
1638 b43legacy_phy_write(dev, 0x0059, 0xC810); in b43legacy_radio_init2050()
1639 b43legacy_phy_write(dev, 0x0058, 0x000D); in b43legacy_radio_init2050()
1641 b43legacy_phy_write(dev, 0x0812, in b43legacy_radio_init2050()
1643 LPD(1, 0, 1))); in b43legacy_radio_init2050()
1644 b43legacy_phy_write(dev, 0x0015, 0xAFB0); in b43legacy_radio_init2050()
1647 b43legacy_phy_write(dev, 0x0812, in b43legacy_radio_init2050()
1649 LPD(1, 0, 1))); in b43legacy_radio_init2050()
1650 b43legacy_phy_write(dev, 0x0015, 0xEFB0); in b43legacy_radio_init2050()
1653 b43legacy_phy_write(dev, 0x0812, in b43legacy_radio_init2050()
1655 LPD(1, 0, 0))); in b43legacy_radio_init2050()
1656 b43legacy_phy_write(dev, 0x0015, 0xFFF0); in b43legacy_radio_init2050()
1658 tmp2 += b43legacy_phy_read(dev, 0x002D); in b43legacy_radio_init2050()
1659 b43legacy_phy_write(dev, 0x0058, 0x0000); in b43legacy_radio_init2050()
1661 b43legacy_phy_write(dev, 0x0812, in b43legacy_radio_init2050()
1663 LPD(1, 0, 1))); in b43legacy_radio_init2050()
1664 b43legacy_phy_write(dev, 0x0015, 0xAFB0); in b43legacy_radio_init2050()
1673 b43legacy_phy_write(dev, 0x0015, backup[1]); in b43legacy_radio_init2050()
1674 b43legacy_radio_write16(dev, 0x0051, backup[14]); in b43legacy_radio_init2050()
1675 b43legacy_radio_write16(dev, 0x0052, backup[15]); in b43legacy_radio_init2050()
1676 b43legacy_radio_write16(dev, 0x0043, backup[0]); in b43legacy_radio_init2050()
1677 b43legacy_phy_write(dev, 0x005A, backup[16]); in b43legacy_radio_init2050()
1678 b43legacy_phy_write(dev, 0x0059, backup[17]); in b43legacy_radio_init2050()
1679 b43legacy_phy_write(dev, 0x0058, backup[18]); in b43legacy_radio_init2050()
1680 b43legacy_write16(dev, 0x03E6, backup[11]); in b43legacy_radio_init2050()
1681 if (phy->analog != 0) in b43legacy_radio_init2050()
1683 b43legacy_phy_write(dev, 0x0035, backup[10]); in b43legacy_radio_init2050()
1686 b43legacy_phy_write(dev, 0x0030, backup[2]); in b43legacy_radio_init2050()
1687 b43legacy_write16(dev, 0x03EC, backup[3]); in b43legacy_radio_init2050()
1692 B43legacy_MMIO_PHY_RADIO) & 0x7FFF)); in b43legacy_radio_init2050()
1693 b43legacy_phy_write(dev, 0x0811, backup[4]); in b43legacy_radio_init2050()
1694 b43legacy_phy_write(dev, 0x0812, backup[5]); in b43legacy_radio_init2050()
1695 b43legacy_phy_write(dev, 0x0814, backup[6]); in b43legacy_radio_init2050()
1696 b43legacy_phy_write(dev, 0x0815, backup[7]); in b43legacy_radio_init2050()
1699 b43legacy_phy_write(dev, 0x0802, backup[9]); in b43legacy_radio_init2050()
1701 b43legacy_phy_write(dev, 0x080F, backup[19]); in b43legacy_radio_init2050()
1702 b43legacy_phy_write(dev, 0x0810, backup[20]); in b43legacy_radio_init2050()
1718 if (channel == 0xFF) { in b43legacy_radio_selectchannel()
1757 B43legacy_MMIO_CHANNEL_EXT) & 0xF7BF); in b43legacy_radio_selectchannel()
1764 return 0; in b43legacy_radio_selectchannel()
1772 tmp = b43legacy_shm_read16(dev, B43legacy_SHM_SHARED, 0x0022) & 0xFCFF; in b43legacy_radio_set_txantenna()
1773 b43legacy_shm_write16(dev, B43legacy_SHM_SHARED, 0x0022, tmp | val); in b43legacy_radio_set_txantenna()
1774 tmp = b43legacy_shm_read16(dev, B43legacy_SHM_SHARED, 0x03A8) & 0xFCFF; in b43legacy_radio_set_txantenna()
1775 b43legacy_shm_write16(dev, B43legacy_SHM_SHARED, 0x03A8, tmp | val); in b43legacy_radio_set_txantenna()
1776 tmp = b43legacy_shm_read16(dev, B43legacy_SHM_SHARED, 0x0054) & 0xFCFF; in b43legacy_radio_set_txantenna()
1777 b43legacy_shm_write16(dev, B43legacy_SHM_SHARED, 0x0054, tmp | val); in b43legacy_radio_set_txantenna()
1807 ret = 0; in b43legacy_get_txgain_freq_power_amp()
1855 txpower = clamp_val(txpower, 0, 63); in b43legacy_radio_set_txpower_a()
1859 pamp &= 0x00E0; in b43legacy_radio_set_txpower_a()
1860 b43legacy_phy_write(dev, 0x0019, pamp); in b43legacy_radio_set_txpower_a()
1863 base &= 0x000F; in b43legacy_radio_set_txpower_a()
1864 b43legacy_phy_write(dev, 0x0017, base | 0x0020); in b43legacy_radio_set_txpower_a()
1866 ilt = b43legacy_ilt_read(dev, 0x3001); in b43legacy_radio_set_txpower_a()
1867 ilt &= 0x0007; in b43legacy_radio_set_txpower_a()
1873 b43legacy_ilt_write(dev, 0x3001, dac); in b43legacy_radio_set_txpower_a()
1887 if (baseband_attenuation == 0xFFFF) in b43legacy_radio_set_txpower_bg()
1889 if (radio_attenuation == 0xFFFF) in b43legacy_radio_set_txpower_bg()
1891 if (txpower == 0xFFFF) in b43legacy_radio_set_txpower_bg()
1905 b43legacy_radio_write16(dev, 0x0043, radio_attenuation); in b43legacy_radio_set_txpower_bg()
1906 b43legacy_shm_write16(dev, B43legacy_SHM_SHARED, 0x0064, in b43legacy_radio_set_txpower_bg()
1908 if (phy->radio_ver == 0x2050) in b43legacy_radio_set_txpower_bg()
1909 b43legacy_radio_write16(dev, 0x0052, in b43legacy_radio_set_txpower_bg()
1910 (b43legacy_radio_read16(dev, 0x0052) in b43legacy_radio_set_txpower_bg()
1911 & ~0x0070) | ((txpower << 4) & 0x0070)); in b43legacy_radio_set_txpower_bg()
1914 b43legacy_phy_lo_adjust(dev, 0); in b43legacy_radio_set_txpower_bg()
1921 if (phy->radio_ver == 0x2050 && phy->radio_rev < 6) in b43legacy_default_baseband_attenuation()
1922 return 0; in b43legacy_default_baseband_attenuation()
1929 u16 att = 0xFFFF; in b43legacy_default_radio_attenuation()
1932 case 0x2053: in b43legacy_default_radio_attenuation()
1939 case 0x2050: in b43legacy_default_radio_attenuation()
1941 case 0: in b43legacy_default_radio_attenuation()
1947 dev->dev->bus->boardinfo.type == 0x421 && in b43legacy_default_radio_attenuation()
1951 dev->dev->bus->boardinfo.type == 0x416) in b43legacy_default_radio_attenuation()
1957 dev->dev->bus->boardinfo.type == 0x421 && in b43legacy_default_radio_attenuation()
1967 dev->dev->bus->boardinfo.type == 0x421 && in b43legacy_default_radio_attenuation()
1972 0x416) in b43legacy_default_radio_attenuation()
1974 else if (dev->dev->bus->chip_id == 0x4320) in b43legacy_default_radio_attenuation()
1993 att = 0x1A; in b43legacy_default_radio_attenuation()
2001 dev->dev->bus->boardinfo.type == 0x421) { in b43legacy_default_radio_attenuation()
2002 if (dev->dev->bus->sprom.board_rev < 0x43) in b43legacy_default_radio_attenuation()
2004 else if (dev->dev->bus->sprom.board_rev < 0x51) in b43legacy_default_radio_attenuation()
2007 if (att == 0xFFFF) in b43legacy_default_radio_attenuation()
2017 if (phy->radio_ver != 0x2050) in b43legacy_default_txctl1()
2018 return 0; in b43legacy_default_txctl1()
2025 return 0; in b43legacy_default_txctl1()
2042 b43legacy_phy_write(dev, 0x0015, 0x8000); in b43legacy_radio_turn_on()
2043 b43legacy_phy_write(dev, 0x0015, 0xCC00); in b43legacy_radio_turn_on()
2044 b43legacy_phy_write(dev, 0x0015, in b43legacy_radio_turn_on()
2045 (phy->gmode ? 0x00C0 : 0x0000)); in b43legacy_radio_turn_on()
2057 err |= b43legacy_radio_selectchannel(dev, channel, 0); in b43legacy_radio_turn_on()
2083 b43legacy_phy_write(dev, B43legacy_PHY_RFOVER, rfover | 0x008C); in b43legacy_radio_turn_off()
2085 rfoverval & 0xFF73); in b43legacy_radio_turn_off()
2087 b43legacy_phy_write(dev, 0x0015, 0xAA00); in b43legacy_radio_turn_off()
2099 b43legacy_shm_write16(dev, B43legacy_SHM_SHARED, 0x0058, in b43legacy_radio_clear_tssi()
2100 0x7F7F); in b43legacy_radio_clear_tssi()
2101 b43legacy_shm_write16(dev, B43legacy_SHM_SHARED, 0x005a, in b43legacy_radio_clear_tssi()
2102 0x7F7F); in b43legacy_radio_clear_tssi()
2103 b43legacy_shm_write16(dev, B43legacy_SHM_SHARED, 0x0070, in b43legacy_radio_clear_tssi()
2104 0x7F7F); in b43legacy_radio_clear_tssi()
2105 b43legacy_shm_write16(dev, B43legacy_SHM_SHARED, 0x0072, in b43legacy_radio_clear_tssi()
2106 0x7F7F); in b43legacy_radio_clear_tssi()