Lines Matching +full:0 +full:xfa000000
23 } while (0)
53 rtl_set_bbreg(hw, RRFMOD, 0xC00, 0x3); in rtl8812ae_fixspur()
54 /* 0x8AC[11:10] = 2'b11*/ in rtl8812ae_fixspur()
56 rtl_set_bbreg(hw, RRFMOD, 0xC00, 0x2); in rtl8812ae_fixspur()
57 /* 0x8AC[11:10] = 2'b10*/ in rtl8812ae_fixspur()
64 rtl_set_bbreg(hw, RRFMOD, 0x300, 0x3); in rtl8812ae_fixspur()
65 /*0x8AC[9:8] = 2'b11*/ in rtl8812ae_fixspur()
67 /* 0x8C4[30] = 1*/ in rtl8812ae_fixspur()
71 /*0x8C4[30] = 1*/ in rtl8812ae_fixspur()
73 rtl_set_bbreg(hw, RRFMOD, 0x300, 0x2); in rtl8812ae_fixspur()
74 /*0x8AC[9:8] = 2'b10*/ in rtl8812ae_fixspur()
75 rtl_set_bbreg(hw, RADC_BUF_CLK, BIT(30), 0); in rtl8812ae_fixspur()
76 /*0x8C4[30] = 0*/ in rtl8812ae_fixspur()
84 rtl_set_bbreg(hw, RRFMOD, 0x300, 0x3); in rtl8812ae_fixspur()
85 /*0x8AC[9:8] = 11*/ in rtl8812ae_fixspur()
87 rtl_set_bbreg(hw, RRFMOD, 0x300, 0x2); in rtl8812ae_fixspur()
88 /*0x8AC[9:8] = 10*/ in rtl8812ae_fixspur()
106 "BBR MASK=0x%x Addr[0x%x]=0x%x\n", in rtl8821ae_phy_query_bb_reg()
195 u32 retvalue = 0; in _rtl8821ae_phy_rf_serial_read()
201 return 0xFFFFFFFF; in _rtl8821ae_phy_rf_serial_read()
205 <20120828, Kordan> Toggling CCA would affect RF 0x0, skip it!*/ in _rtl8821ae_phy_rf_serial_read()
206 if (offset != 0x0 && in _rtl8821ae_phy_rf_serial_read()
209 rtl_set_bbreg(hw, RCCAONSEC, 0x8, 1); in _rtl8821ae_phy_rf_serial_read()
210 offset &= 0xff; in _rtl8821ae_phy_rf_serial_read()
213 is_pi_mode = (bool)rtl_get_bbreg(hw, 0xC00, 0x4); in _rtl8821ae_phy_rf_serial_read()
215 is_pi_mode = (bool)rtl_get_bbreg(hw, 0xE00, 0x4); in _rtl8821ae_phy_rf_serial_read()
217 rtl_set_bbreg(hw, RHSSIREAD_8821AE, 0xff, offset); in _rtl8821ae_phy_rf_serial_read()
241 * <20120828, Kordan> Toggling CCA would affect RF 0x0, skip it! in _rtl8821ae_phy_rf_serial_read()
243 if (offset != 0x0 && in _rtl8821ae_phy_rf_serial_read()
246 rtl_set_bbreg(hw, RCCAONSEC, 0x8, 0); in _rtl8821ae_phy_rf_serial_read()
264 offset &= 0xff; in _rtl8821ae_phy_rf_serial_write()
267 (data & 0x000fffff)) & 0x0fffffff; in _rtl8821ae_phy_rf_serial_write()
270 "RFW-%d Addr[0x%x]=0x%x\n", in _rtl8821ae_phy_rf_serial_write()
276 bool rtstatus = 0; in rtl8821ae_phy_mac_config()
301 rtl_write_byte(rtlpriv, REG_RF_CTRL, 0x7); in rtl8821ae_phy_bb_config()
302 rtl_write_byte(rtlpriv, REG_OPT_CTRL + 2, 0x7); in rtl8821ae_phy_bb_config()
307 crystal_cap = rtlefuse->crystalcap & 0x3F; in rtl8821ae_phy_bb_config()
308 rtl_set_bbreg(hw, REG_MAC_PHY_CTRL, 0x7FF80000, in rtl8821ae_phy_bb_config()
311 crystal_cap = rtlefuse->crystalcap & 0x3F; in rtl8821ae_phy_bb_config()
312 rtl_set_bbreg(hw, REG_MAC_PHY_CTRL, 0xFFF000, in rtl8821ae_phy_bb_config()
315 rtlphy->reg_837 = rtl_read_byte(rtlpriv, 0x837); in rtl8821ae_phy_bb_config()
333 rtl_set_bbreg(hw, RA_RFE_PINMUX, BMASKDWORD, 0x54337770); in _rtl8812ae_phy_set_rfe_reg_24g()
334 rtl_set_bbreg(hw, RB_RFE_PINMUX, BMASKDWORD, 0x54337770); in _rtl8812ae_phy_set_rfe_reg_24g()
335 rtl_set_bbreg(hw, RA_RFE_INV, BMASKRFEINV, 0x010); in _rtl8812ae_phy_set_rfe_reg_24g()
336 rtl_set_bbreg(hw, RB_RFE_INV, BMASKRFEINV, 0x010); in _rtl8812ae_phy_set_rfe_reg_24g()
337 rtl_set_bbreg(hw, 0x900, 0x00000303, 0x1); in _rtl8812ae_phy_set_rfe_reg_24g()
340 rtl_set_bbreg(hw, RA_RFE_PINMUX, BMASKDWORD, 0x77777777); in _rtl8812ae_phy_set_rfe_reg_24g()
341 rtl_set_bbreg(hw, RB_RFE_PINMUX, BMASKDWORD, 0x77777777); in _rtl8812ae_phy_set_rfe_reg_24g()
342 rtl_set_bbreg(hw, RA_RFE_INV, BMASKRFEINV, 0x001); in _rtl8812ae_phy_set_rfe_reg_24g()
343 rtl_set_bbreg(hw, RB_RFE_INV, BMASKRFEINV, 0x001); in _rtl8812ae_phy_set_rfe_reg_24g()
346 rtl_write_byte(rtlpriv, RA_RFE_PINMUX + 2, 0x77); in _rtl8812ae_phy_set_rfe_reg_24g()
347 rtl_set_bbreg(hw, RB_RFE_PINMUX, BMASKDWORD, 0x77777777); in _rtl8812ae_phy_set_rfe_reg_24g()
349 rtl_write_byte(rtlpriv, RA_RFE_INV + 3, tmp & ~0x1); in _rtl8812ae_phy_set_rfe_reg_24g()
350 rtl_set_bbreg(hw, RB_RFE_INV, BMASKRFEINV, 0x000); in _rtl8812ae_phy_set_rfe_reg_24g()
354 rtl_set_bbreg(hw, RA_RFE_PINMUX, 0xffffff, 0x777777); in _rtl8812ae_phy_set_rfe_reg_24g()
356 0x77777777); in _rtl8812ae_phy_set_rfe_reg_24g()
357 rtl_set_bbreg(hw, RA_RFE_INV, 0x33f00000, 0x000); in _rtl8812ae_phy_set_rfe_reg_24g()
358 rtl_set_bbreg(hw, RB_RFE_INV, BMASKRFEINV, 0x000); in _rtl8812ae_phy_set_rfe_reg_24g()
362 case 0: in _rtl8812ae_phy_set_rfe_reg_24g()
365 rtl_set_bbreg(hw, RA_RFE_PINMUX, BMASKDWORD, 0x77777777); in _rtl8812ae_phy_set_rfe_reg_24g()
366 rtl_set_bbreg(hw, RB_RFE_PINMUX, BMASKDWORD, 0x77777777); in _rtl8812ae_phy_set_rfe_reg_24g()
367 rtl_set_bbreg(hw, RA_RFE_INV, BMASKRFEINV, 0x000); in _rtl8812ae_phy_set_rfe_reg_24g()
368 rtl_set_bbreg(hw, RB_RFE_INV, BMASKRFEINV, 0x000); in _rtl8812ae_phy_set_rfe_reg_24g()
380 case 0: in _rtl8812ae_phy_set_rfe_reg_5g()
381 rtl_set_bbreg(hw, RA_RFE_PINMUX, BMASKDWORD, 0x77337717); in _rtl8812ae_phy_set_rfe_reg_5g()
382 rtl_set_bbreg(hw, RB_RFE_PINMUX, BMASKDWORD, 0x77337717); in _rtl8812ae_phy_set_rfe_reg_5g()
383 rtl_set_bbreg(hw, RA_RFE_INV, BMASKRFEINV, 0x010); in _rtl8812ae_phy_set_rfe_reg_5g()
384 rtl_set_bbreg(hw, RB_RFE_INV, BMASKRFEINV, 0x010); in _rtl8812ae_phy_set_rfe_reg_5g()
388 rtl_set_bbreg(hw, RA_RFE_PINMUX, 0xffffff, 0x337717); in _rtl8812ae_phy_set_rfe_reg_5g()
390 0x77337717); in _rtl8812ae_phy_set_rfe_reg_5g()
391 rtl_set_bbreg(hw, RA_RFE_INV, 0x33f00000, 0x000); in _rtl8812ae_phy_set_rfe_reg_5g()
392 rtl_set_bbreg(hw, RB_RFE_INV, BMASKRFEINV, 0x000); in _rtl8812ae_phy_set_rfe_reg_5g()
395 0x77337717); in _rtl8812ae_phy_set_rfe_reg_5g()
397 0x77337717); in _rtl8812ae_phy_set_rfe_reg_5g()
398 rtl_set_bbreg(hw, RA_RFE_INV, BMASKRFEINV, 0x000); in _rtl8812ae_phy_set_rfe_reg_5g()
399 rtl_set_bbreg(hw, RB_RFE_INV, BMASKRFEINV, 0x000); in _rtl8812ae_phy_set_rfe_reg_5g()
403 rtl_set_bbreg(hw, RA_RFE_PINMUX, BMASKDWORD, 0x54337717); in _rtl8812ae_phy_set_rfe_reg_5g()
404 rtl_set_bbreg(hw, RB_RFE_PINMUX, BMASKDWORD, 0x54337717); in _rtl8812ae_phy_set_rfe_reg_5g()
405 rtl_set_bbreg(hw, RA_RFE_INV, BMASKRFEINV, 0x010); in _rtl8812ae_phy_set_rfe_reg_5g()
406 rtl_set_bbreg(hw, RB_RFE_INV, BMASKRFEINV, 0x010); in _rtl8812ae_phy_set_rfe_reg_5g()
407 rtl_set_bbreg(hw, 0x900, 0x00000303, 0x1); in _rtl8812ae_phy_set_rfe_reg_5g()
410 rtl_write_byte(rtlpriv, RA_RFE_PINMUX + 2, 0x33); in _rtl8812ae_phy_set_rfe_reg_5g()
411 rtl_set_bbreg(hw, RB_RFE_PINMUX, BMASKDWORD, 0x77337777); in _rtl8812ae_phy_set_rfe_reg_5g()
413 rtl_write_byte(rtlpriv, RA_RFE_INV + 3, tmp | 0x1); in _rtl8812ae_phy_set_rfe_reg_5g()
414 rtl_set_bbreg(hw, RB_RFE_INV, BMASKRFEINV, 0x010); in _rtl8812ae_phy_set_rfe_reg_5g()
419 rtl_set_bbreg(hw, RA_RFE_PINMUX, BMASKDWORD, 0x77337777); in _rtl8812ae_phy_set_rfe_reg_5g()
420 rtl_set_bbreg(hw, RB_RFE_PINMUX, BMASKDWORD, 0x77337777); in _rtl8812ae_phy_set_rfe_reg_5g()
421 rtl_set_bbreg(hw, RA_RFE_INV, BMASKRFEINV, 0x010); in _rtl8812ae_phy_set_rfe_reg_5g()
422 rtl_set_bbreg(hw, RB_RFE_INV, BMASKRFEINV, 0x010); in _rtl8812ae_phy_set_rfe_reg_5g()
434 s8 reg_swing_2g = -1;/* 0xff; */ in phy_get_tx_swing_8812A()
435 s8 reg_swing_5g = -1;/* 0xff; */ in phy_get_tx_swing_8812A()
438 u32 out = 0x200; in phy_get_tx_swing_8812A()
449 if (swing_2g == 0) { in phy_get_tx_swing_8812A()
450 out = 0x200; /* 0 dB */ in phy_get_tx_swing_8812A()
452 out = 0x16A; /* -3 dB */ in phy_get_tx_swing_8812A()
454 out = 0x101; /* -6 dB */ in phy_get_tx_swing_8812A()
456 out = 0x0B6; /* -9 dB */ in phy_get_tx_swing_8812A()
458 rtldm->swing_diff_2g = 0; in phy_get_tx_swing_8812A()
459 out = 0x200; in phy_get_tx_swing_8812A()
463 if (swing_5g == 0) { in phy_get_tx_swing_8812A()
464 out = 0x200; /* 0 dB */ in phy_get_tx_swing_8812A()
466 out = 0x16A; /* -3 dB */ in phy_get_tx_swing_8812A()
468 out = 0x101; /* -6 dB */ in phy_get_tx_swing_8812A()
470 out = 0x0B6; /* -9 dB */ in phy_get_tx_swing_8812A()
474 out = 0x16A; in phy_get_tx_swing_8812A()
476 rtldm->swing_diff_5g = 0; in phy_get_tx_swing_8812A()
477 out = 0x200; in phy_get_tx_swing_8812A()
483 out = 0x16A; /* -3 dB */ in phy_get_tx_swing_8812A()
486 u32 swing = 0, swing_a = 0, swing_b = 0; in phy_get_tx_swing_8812A()
490 efuse_shadow_read(hw, 1, 0xC6, (u32 *)&swing); in phy_get_tx_swing_8812A()
491 swing = (swing == 0xFF) ? 0x00 : swing; in phy_get_tx_swing_8812A()
492 } else if (swing_2g == 0) { in phy_get_tx_swing_8812A()
493 swing = 0x00; /* 0 dB */ in phy_get_tx_swing_8812A()
495 swing = 0x05; /* -3 dB */ in phy_get_tx_swing_8812A()
497 swing = 0x0A; /* -6 dB */ in phy_get_tx_swing_8812A()
499 swing = 0xFF; /* -9 dB */ in phy_get_tx_swing_8812A()
501 swing = 0x00; in phy_get_tx_swing_8812A()
505 efuse_shadow_read(hw, 1, 0xC7, (u32 *)&swing); in phy_get_tx_swing_8812A()
506 swing = (swing == 0xFF) ? 0x00 : swing; in phy_get_tx_swing_8812A()
507 } else if (swing_5g == 0) { in phy_get_tx_swing_8812A()
508 swing = 0x00; /* 0 dB */ in phy_get_tx_swing_8812A()
510 swing = 0x05; /* -3 dB */ in phy_get_tx_swing_8812A()
512 swing = 0x0A; /* -6 dB */ in phy_get_tx_swing_8812A()
514 swing = 0xFF; /* -9 dB */ in phy_get_tx_swing_8812A()
516 swing = 0x00; in phy_get_tx_swing_8812A()
520 swing_a = (swing & 0x3) >> 0; /* 0xC6/C7[1:0] */ in phy_get_tx_swing_8812A()
521 swing_b = (swing & 0xC) >> 2; /* 0xC6/C7[3:2] */ in phy_get_tx_swing_8812A()
523 "===> PHY_GetTXBBSwing_8812A, swingA: 0x%X, swingB: 0x%X\n", in phy_get_tx_swing_8812A()
527 if (swing_a == 0x0) { in phy_get_tx_swing_8812A()
529 rtldm->swing_diff_2g = 0; in phy_get_tx_swing_8812A()
531 rtldm->swing_diff_5g = 0; in phy_get_tx_swing_8812A()
532 out = 0x200; /* 0 dB */ in phy_get_tx_swing_8812A()
533 } else if (swing_a == 0x1) { in phy_get_tx_swing_8812A()
538 out = 0x16A; /* -3 dB */ in phy_get_tx_swing_8812A()
539 } else if (swing_a == 0x2) { in phy_get_tx_swing_8812A()
544 out = 0x101; /* -6 dB */ in phy_get_tx_swing_8812A()
545 } else if (swing_a == 0x3) { in phy_get_tx_swing_8812A()
550 out = 0x0B6; /* -9 dB */ in phy_get_tx_swing_8812A()
553 if (swing_b == 0x0) { in phy_get_tx_swing_8812A()
555 rtldm->swing_diff_2g = 0; in phy_get_tx_swing_8812A()
557 rtldm->swing_diff_5g = 0; in phy_get_tx_swing_8812A()
558 out = 0x200; /* 0 dB */ in phy_get_tx_swing_8812A()
559 } else if (swing_b == 0x1) { in phy_get_tx_swing_8812A()
564 out = 0x16A; /* -3 dB */ in phy_get_tx_swing_8812A()
565 } else if (swing_b == 0x2) { in phy_get_tx_swing_8812A()
570 out = 0x101; /* -6 dB */ in phy_get_tx_swing_8812A()
571 } else if (swing_b == 0x3) { in phy_get_tx_swing_8812A()
576 out = 0x0B6; /* -9 dB */ in phy_get_tx_swing_8812A()
581 "<=== PHY_GetTXBBSwing_8812A, out = 0x%X\n", out); in phy_get_tx_swing_8812A()
593 rtl8821ae_phy_query_bb_reg(hw, RTXPATH, 0xf0); in rtl8821ae_phy_switch_wirelessband()
594 rtl8821ae_phy_query_bb_reg(hw, RCCK_RX, 0x0f000000); in rtl8821ae_phy_switch_wirelessband()
599 rtl_set_bbreg(hw, ROFDMCCKEN, BOFDMEN|BCCKEN, 0x03); in rtl8821ae_phy_switch_wirelessband()
602 /* 0xCB0[15:12] = 0x7 (LNA_On)*/ in rtl8821ae_phy_switch_wirelessband()
603 rtl_set_bbreg(hw, RA_RFE_PINMUX, 0xF000, 0x7); in rtl8821ae_phy_switch_wirelessband()
604 /* 0xCB0[7:4] = 0x7 (PAPE_A)*/ in rtl8821ae_phy_switch_wirelessband()
605 rtl_set_bbreg(hw, RA_RFE_PINMUX, 0xF0, 0x7); in rtl8821ae_phy_switch_wirelessband()
609 /*0x834[1:0] = 0x1*/ in rtl8821ae_phy_switch_wirelessband()
610 rtl_set_bbreg(hw, 0x834, 0x3, 0x1); in rtl8821ae_phy_switch_wirelessband()
614 /* 0xC1C[11:8] = 0 */ in rtl8821ae_phy_switch_wirelessband()
615 rtl_set_bbreg(hw, RA_TXSCALE, 0xF00, 0); in rtl8821ae_phy_switch_wirelessband()
617 /* 0x82C[1:0] = 2b'00 */ in rtl8821ae_phy_switch_wirelessband()
618 rtl_set_bbreg(hw, 0x82c, 0x3, 0); in rtl8821ae_phy_switch_wirelessband()
624 rtl_set_bbreg(hw, RTXPATH, 0xf0, 0x1); in rtl8821ae_phy_switch_wirelessband()
625 rtl_set_bbreg(hw, RCCK_RX, 0x0f000000, 0x1); in rtl8821ae_phy_switch_wirelessband()
627 rtl_write_byte(rtlpriv, REG_CCK_CHECK, 0x0); in rtl8821ae_phy_switch_wirelessband()
632 /*0xCB0[15:12] = 0x5 (LNA_On)*/ in rtl8821ae_phy_switch_wirelessband()
633 rtl_set_bbreg(hw, RA_RFE_PINMUX, 0xF000, 0x5); in rtl8821ae_phy_switch_wirelessband()
634 /*0xCB0[7:4] = 0x4 (PAPE_A)*/ in rtl8821ae_phy_switch_wirelessband()
635 rtl_set_bbreg(hw, RA_RFE_PINMUX, 0xF0, 0x4); in rtl8821ae_phy_switch_wirelessband()
638 rtl_write_byte(rtlpriv, REG_CCK_CHECK, 0x80); in rtl8821ae_phy_switch_wirelessband()
640 count = 0; in rtl8821ae_phy_switch_wirelessband()
644 reg_41a &= 0x30; in rtl8821ae_phy_switch_wirelessband()
645 while ((reg_41a != 0x30) && (count < 50)) { in rtl8821ae_phy_switch_wirelessband()
650 reg_41a &= 0x30; in rtl8821ae_phy_switch_wirelessband()
655 if (count != 0) in rtl8821ae_phy_switch_wirelessband()
657 "PHY_SwitchWirelessBand8812(): Switch to 5G Band. Count = %d reg41A=0x%x\n", in rtl8821ae_phy_switch_wirelessband()
662 rtl_set_bbreg(hw, ROFDMCCKEN, BOFDMEN|BCCKEN, 0x03); in rtl8821ae_phy_switch_wirelessband()
665 /*0x834[1:0] = 0x2*/ in rtl8821ae_phy_switch_wirelessband()
666 rtl_set_bbreg(hw, 0x834, 0x3, 0x2); in rtl8821ae_phy_switch_wirelessband()
671 /* 0xC1C[11:8] = 1*/ in rtl8821ae_phy_switch_wirelessband()
672 rtl_set_bbreg(hw, RA_TXSCALE, 0xF00, 1); in rtl8821ae_phy_switch_wirelessband()
674 /* 0x82C[1:0] = 2'b00 */ in rtl8821ae_phy_switch_wirelessband()
675 rtl_set_bbreg(hw, 0x82c, 0x3, 1); in rtl8821ae_phy_switch_wirelessband()
680 rtl_set_bbreg(hw, RTXPATH, 0xf0, 0); in rtl8821ae_phy_switch_wirelessband()
681 rtl_set_bbreg(hw, RCCK_RX, 0x0f000000, 0xf); in rtl8821ae_phy_switch_wirelessband()
684 "==>PHY_SwitchWirelessBand8812() BAND_ON_5G settings OFDM index 0x%x\n", in rtl8821ae_phy_switch_wirelessband()
690 /* 0xC1C[31:21] */ in rtl8821ae_phy_switch_wirelessband()
691 rtl_set_bbreg(hw, RA_TXSCALE, 0xFFE00000, in rtl8821ae_phy_switch_wirelessband()
693 /* 0xE1C[31:21] */ in rtl8821ae_phy_switch_wirelessband()
694 rtl_set_bbreg(hw, RB_TXSCALE, 0xFFE00000, in rtl8821ae_phy_switch_wirelessband()
725 u32 intf = (rtlhal->interface == INTF_USB ? BIT(1) : BIT(0)); in _rtl8821ae_check_positive()
727 u8 board_type = ((rtlhal->board_type & BIT(4)) >> 4) << 0 | /* _GLNA */ in _rtl8821ae_check_positive()
735 0 << 20 | /* interface 2/2 */ in _rtl8821ae_check_positive()
736 0x04 << 16 | /* platform */ in _rtl8821ae_check_positive()
741 u32 driver2 = rtlhal->type_glna << 0 | in _rtl8821ae_check_positive()
747 "===> [8812A] CheckPositive (cond1, cond2) = (0x%X 0x%X)\n", in _rtl8821ae_check_positive()
750 "===> [8812A] CheckPositive (driver1, driver2) = (0x%X 0x%X)\n", in _rtl8821ae_check_positive()
754 " (Platform, Interface) = (0x%X, 0x%X)\n", 0x04, intf); in _rtl8821ae_check_positive()
756 " (Board, Package) = (0x%X, 0x%X)\n", in _rtl8821ae_check_positive()
762 if (((cond1 & 0x0000F000) != 0) && ((cond1 & 0x0000F000) != in _rtl8821ae_check_positive()
763 (driver1 & 0x0000F000))) in _rtl8821ae_check_positive()
765 if (((cond1 & 0x0F000000) != 0) && ((cond1 & 0x0F000000) != in _rtl8821ae_check_positive()
766 (driver1 & 0x0F000000))) in _rtl8821ae_check_positive()
772 cond1 &= 0x00FF0FFF; in _rtl8821ae_check_positive()
773 driver1 &= 0x00FF0FFF; in _rtl8821ae_check_positive()
776 u32 mask = 0; in _rtl8821ae_check_positive()
778 if ((cond1 & 0x0F) == 0) /* BoardType is DONTCARE*/ in _rtl8821ae_check_positive()
781 if ((cond1 & BIT(0)) != 0) /*GLNA*/ in _rtl8821ae_check_positive()
782 mask |= 0x000000FF; in _rtl8821ae_check_positive()
783 if ((cond1 & BIT(1)) != 0) /*GPA*/ in _rtl8821ae_check_positive()
784 mask |= 0x0000FF00; in _rtl8821ae_check_positive()
785 if ((cond1 & BIT(2)) != 0) /*ALNA*/ in _rtl8821ae_check_positive()
786 mask |= 0x00FF0000; in _rtl8821ae_check_positive()
787 if ((cond1 & BIT(3)) != 0) /*APA*/ in _rtl8821ae_check_positive()
788 mask |= 0xFF000000; in _rtl8821ae_check_positive()
804 u32 _interface = 0x01; /* ODM_ITRF_PCIE */ in _rtl8821ae_check_condition()
805 u32 _platform = 0x08;/* ODM_WIN */ in _rtl8821ae_check_condition()
808 if (condition == 0xCDCDCDCD) in _rtl8821ae_check_condition()
811 cond = condition & 0xFF; in _rtl8821ae_check_condition()
812 if ((_board != cond) && cond != 0xFF) in _rtl8821ae_check_condition()
815 cond = condition & 0xFF00; in _rtl8821ae_check_condition()
817 if ((_interface & cond) == 0 && cond != 0x07) in _rtl8821ae_check_condition()
820 cond = condition & 0xFF0000; in _rtl8821ae_check_condition()
822 if ((_platform & cond) == 0 && cond != 0x0F) in _rtl8821ae_check_condition()
831 if (addr == 0xfe || addr == 0xffe) { in _rtl8821ae_config_rf_reg()
845 u32 content = 0x1000; /*RF Content: radio_a_txt*/ in _rtl8821ae_config_rf_radio_a()
846 u32 maskforphyset = (u32)(content & 0xE000); in _rtl8821ae_config_rf_radio_a()
855 u32 content = 0x1001; /*RF Content: radio_b_txt*/ in _rtl8821ae_config_rf_radio_b()
856 u32 maskforphyset = (u32)(content & 0xE000); in _rtl8821ae_config_rf_radio_b()
865 if (addr == 0xfe) in _rtl8821ae_config_bb_reg()
867 else if (addr == 0xfd) in _rtl8821ae_config_bb_reg()
869 else if (addr == 0xfc) in _rtl8821ae_config_bb_reg()
871 else if (addr == 0xfb) in _rtl8821ae_config_bb_reg()
873 else if (addr == 0xfa) in _rtl8821ae_config_bb_reg()
875 else if (addr == 0xf9) in _rtl8821ae_config_bb_reg()
890 for (rfpath = 0; rfpath < TX_PWR_BY_RATE_NUM_RF; ++rfpath) in _rtl8821ae_phy_init_tx_power_by_rate()
891 for (txnum = 0; txnum < TX_PWR_BY_RATE_NUM_RF; ++txnum) in _rtl8821ae_phy_init_tx_power_by_rate()
892 for (rate_section = 0; in _rtl8821ae_phy_init_tx_power_by_rate()
896 [rfpath][txnum][rate_section] = 0; in _rtl8821ae_phy_init_tx_power_by_rate()
916 rtlphy->txpwr_by_rate_base_24g[path][txnum][0] = value; in _rtl8821ae_phy_set_txpower_by_rate_base()
942 rtlphy->txpwr_by_rate_base_5g[path][txnum][0] = value; in _rtl8821ae_phy_set_txpower_by_rate_base()
974 u8 value = 0; in _rtl8821ae_phy_get_txpower_by_rate_base()
980 return 0; in _rtl8821ae_phy_get_txpower_by_rate_base()
986 value = rtlphy->txpwr_by_rate_base_24g[path][txnum][0]; in _rtl8821ae_phy_get_txpower_by_rate_base()
1012 value = rtlphy->txpwr_by_rate_base_5g[path][txnum][0]; in _rtl8821ae_phy_get_txpower_by_rate_base()
1044 u16 rawvalue = 0; in _rtl8821ae_phy_store_txpower_by_rate_base()
1045 u8 base = 0, path = 0; in _rtl8821ae_phy_store_txpower_by_rate_base()
1048 rawvalue = (u16)(rtlphy->tx_power_by_rate_offset[BAND_ON_2_4G][path][RF_1TX][0] >> 24) & 0xFF; in _rtl8821ae_phy_store_txpower_by_rate_base()
1049 base = (rawvalue >> 4) * 10 + (rawvalue & 0xF); in _rtl8821ae_phy_store_txpower_by_rate_base()
1052 rawvalue = (u16)(rtlphy->tx_power_by_rate_offset[BAND_ON_2_4G][path][RF_1TX][2] >> 24) & 0xFF; in _rtl8821ae_phy_store_txpower_by_rate_base()
1053 base = (rawvalue >> 4) * 10 + (rawvalue & 0xF); in _rtl8821ae_phy_store_txpower_by_rate_base()
1056 rawvalue = (u16)(rtlphy->tx_power_by_rate_offset[BAND_ON_2_4G][path][RF_1TX][4] >> 24) & 0xFF; in _rtl8821ae_phy_store_txpower_by_rate_base()
1057 base = (rawvalue >> 4) * 10 + (rawvalue & 0xF); in _rtl8821ae_phy_store_txpower_by_rate_base()
1060 rawvalue = (u16)(rtlphy->tx_power_by_rate_offset[BAND_ON_2_4G][path][RF_2TX][6] >> 24) & 0xFF; in _rtl8821ae_phy_store_txpower_by_rate_base()
1061 base = (rawvalue >> 4) * 10 + (rawvalue & 0xF); in _rtl8821ae_phy_store_txpower_by_rate_base()
1064 rawvalue = (u16)(rtlphy->tx_power_by_rate_offset[BAND_ON_2_4G][path][RF_1TX][8] >> 24) & 0xFF; in _rtl8821ae_phy_store_txpower_by_rate_base()
1065 base = (rawvalue >> 4) * 10 + (rawvalue & 0xF); in _rtl8821ae_phy_store_txpower_by_rate_base()
1068 rawvalue = (u16)(rtlphy->tx_power_by_rate_offset[BAND_ON_2_4G][path][RF_2TX][11] >> 8) & 0xFF; in _rtl8821ae_phy_store_txpower_by_rate_base()
1069 base = (rawvalue >> 4) * 10 + (rawvalue & 0xF); in _rtl8821ae_phy_store_txpower_by_rate_base()
1072 rawvalue = (u16)(rtlphy->tx_power_by_rate_offset[BAND_ON_5G][path][RF_1TX][2] >> 24) & 0xFF; in _rtl8821ae_phy_store_txpower_by_rate_base()
1073 base = (rawvalue >> 4) * 10 + (rawvalue & 0xF); in _rtl8821ae_phy_store_txpower_by_rate_base()
1076 rawvalue = (u16)(rtlphy->tx_power_by_rate_offset[BAND_ON_5G][path][RF_1TX][4] >> 24) & 0xFF; in _rtl8821ae_phy_store_txpower_by_rate_base()
1077 base = (rawvalue >> 4) * 10 + (rawvalue & 0xF); in _rtl8821ae_phy_store_txpower_by_rate_base()
1080 rawvalue = (u16)(rtlphy->tx_power_by_rate_offset[BAND_ON_5G][path][RF_2TX][6] >> 24) & 0xFF; in _rtl8821ae_phy_store_txpower_by_rate_base()
1081 base = (rawvalue >> 4) * 10 + (rawvalue & 0xF); in _rtl8821ae_phy_store_txpower_by_rate_base()
1084 rawvalue = (u16)(rtlphy->tx_power_by_rate_offset[BAND_ON_5G][path][RF_1TX][8] >> 24) & 0xFF; in _rtl8821ae_phy_store_txpower_by_rate_base()
1085 base = (rawvalue >> 4) * 10 + (rawvalue & 0xF); in _rtl8821ae_phy_store_txpower_by_rate_base()
1088 rawvalue = (u16)(rtlphy->tx_power_by_rate_offset[BAND_ON_5G][path][RF_2TX][11] >> 8) & 0xFF; in _rtl8821ae_phy_store_txpower_by_rate_base()
1089 base = (rawvalue >> 4) * 10 + (rawvalue & 0xF); in _rtl8821ae_phy_store_txpower_by_rate_base()
1098 u8 temp_value = 0; in _phy_convert_txpower_dbm_to_relative_value()
1099 u32 temp_data = 0; in _phy_convert_txpower_dbm_to_relative_value()
1101 for (i = 3; i >= 0; --i) { in _phy_convert_txpower_dbm_to_relative_value()
1104 temp_value = (u8)(*data >> (i * 8)) & 0xF; in _phy_convert_txpower_dbm_to_relative_value()
1105 temp_value += ((u8)((*data >> (i * 8 + 4)) & 0xF)) * 10; in _phy_convert_txpower_dbm_to_relative_value()
1111 temp_value = (u8)(*data >> (i * 8)) & 0xFF; in _phy_convert_txpower_dbm_to_relative_value()
1124 s8 temp_pwrlmt = 0; in _rtl8812ae_phy_cross_reference_ht_and_vht_txpower_limit()
1126 for (regulation = 0; regulation < MAX_REGULATION_NUM; ++regulation) { in _rtl8812ae_phy_cross_reference_ht_and_vht_txpower_limit()
1127 for (bw = 0; bw < MAX_5G_BANDWIDTH_NUM; ++bw) { in _rtl8812ae_phy_cross_reference_ht_and_vht_txpower_limit()
1128 for (channel = 0; channel < CHANNEL_MAX_NUMBER_5G; ++channel) { in _rtl8812ae_phy_cross_reference_ht_and_vht_txpower_limit()
1129 for (rate_section = 0; rate_section < MAX_RATE_SECTION_NUM; ++rate_section) { in _rtl8812ae_phy_cross_reference_ht_and_vht_txpower_limit()
1133 if (bw == 0 || bw == 1) { /*5G 20M 40M VHT and HT can cross reference*/ in _rtl8812ae_phy_cross_reference_ht_and_vht_txpower_limit()
1166 u8 index = 0; in _rtl8812ae_phy_get_txpower_by_rate_base_index()
1173 index = 0; in _rtl8812ae_phy_get_txpower_by_rate_base_index()
1211 "Wrong rate 0x%x to obtain index in 2.4G in PHY_GetTxPowerByRateBaseIndex()\n", in _rtl8812ae_phy_get_txpower_by_rate_base_index()
1225 index = 0; in _rtl8812ae_phy_get_txpower_by_rate_base_index()
1278 "Wrong rate 0x%x to obtain index in 5G in PHY_GetTxPowerByRateBaseIndex()\n", in _rtl8812ae_phy_get_txpower_by_rate_base_index()
1293 u8 base_index2_4G = 0; in _rtl8812ae_phy_convert_txpower_limit_to_power_index()
1294 u8 base_index5G = 0; in _rtl8812ae_phy_convert_txpower_limit_to_power_index()
1295 s8 temp_value = 0, temp_pwrlmt = 0; in _rtl8812ae_phy_convert_txpower_limit_to_power_index()
1296 u8 rf_path = 0; in _rtl8812ae_phy_convert_txpower_limit_to_power_index()
1303 for (regulation = 0; regulation < MAX_REGULATION_NUM; ++regulation) { in _rtl8812ae_phy_convert_txpower_limit_to_power_index()
1304 for (bw = 0; bw < MAX_2_4G_BANDWIDTH_NUM; ++bw) { in _rtl8812ae_phy_convert_txpower_limit_to_power_index()
1305 for (channel = 0; channel < CHANNEL_MAX_NUMBER_2G; ++channel) { in _rtl8812ae_phy_convert_txpower_limit_to_power_index()
1306 for (rate_section = 0; rate_section < MAX_RATE_SECTION_NUM; ++rate_section) { in _rtl8812ae_phy_convert_txpower_limit_to_power_index()
1309 if (rate_section == 0) { /*CCK*/ in _rtl8812ae_phy_convert_txpower_limit_to_power_index()
1352 ? 0 : temp_pwrlmt/2, channel, rf_path, in _rtl8812ae_phy_convert_txpower_limit_to_power_index()
1359 for (regulation = 0; regulation < MAX_REGULATION_NUM; ++regulation) { in _rtl8812ae_phy_convert_txpower_limit_to_power_index()
1360 for (bw = 0; bw < MAX_5G_BANDWIDTH_NUM; ++bw) { in _rtl8812ae_phy_convert_txpower_limit_to_power_index()
1361 for (channel = 0; channel < CHANNEL_MAX_NUMBER_5G; ++channel) { in _rtl8812ae_phy_convert_txpower_limit_to_power_index()
1362 for (rate_section = 0; rate_section < MAX_RATE_SECTION_NUM; ++rate_section) { in _rtl8812ae_phy_convert_txpower_limit_to_power_index()
1436 for (i = 0; i < MAX_REGULATION_NUM; ++i) { in _rtl8821ae_phy_init_txpower_limit()
1437 for (j = 0; j < MAX_2_4G_BANDWIDTH_NUM; ++j) in _rtl8821ae_phy_init_txpower_limit()
1438 for (k = 0; k < MAX_RATE_SECTION_NUM; ++k) in _rtl8821ae_phy_init_txpower_limit()
1439 for (m = 0; m < CHANNEL_MAX_NUMBER_2G; ++m) in _rtl8821ae_phy_init_txpower_limit()
1440 for (l = 0; l < MAX_RF_PATH_NUM; ++l) in _rtl8821ae_phy_init_txpower_limit()
1445 for (i = 0; i < MAX_REGULATION_NUM; ++i) { in _rtl8821ae_phy_init_txpower_limit()
1446 for (j = 0; j < MAX_5G_BANDWIDTH_NUM; ++j) in _rtl8821ae_phy_init_txpower_limit()
1447 for (k = 0; k < MAX_RATE_SECTION_NUM; ++k) in _rtl8821ae_phy_init_txpower_limit()
1448 for (m = 0; m < CHANNEL_MAX_NUMBER_5G; ++m) in _rtl8821ae_phy_init_txpower_limit()
1449 for (l = 0; l < MAX_RF_PATH_NUM; ++l) in _rtl8821ae_phy_init_txpower_limit()
1463 u8 base = 0, rfpath = 0; in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1468 &rtlphy->tx_power_by_rate_offset[BAND_ON_2_4G][rfpath][RF_1TX][0], in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1469 0, 3, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1474 0, 3, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1477 0, 3, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1482 0, 3, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1485 0, 3, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1491 0, 3, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1495 0, 3, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1500 0, 3, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1503 0, 3, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1506 0, 1, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1514 0, 3, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1517 0, 3, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1522 0, 3, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1525 0, 3, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1530 0, 3, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1533 0, 3, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1538 0, 3, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1541 0, 3, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1546 0, 3, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1549 0, 3, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1552 0, 1, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1560 0, 3, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1563 0, 3, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1579 u16 i = 0; in _rtl8812ae_get_integer_from_string()
1580 *pint = 0; in _rtl8812ae_get_integer_from_string()
1582 while (str[i] != '\0') { in _rtl8812ae_get_integer_from_string()
1583 if (str[i] >= '0' && str[i] <= '9') { in _rtl8812ae_get_integer_from_string()
1585 *pint += (str[i] - '0'); in _rtl8812ae_get_integer_from_string()
1600 u8 i = 0; in _rtl8812ae_phy_get_chnl_idx_of_txpwr_lmt()
1605 for (i = 0; i < sizeof(channel5g)/sizeof(u8); ++i) { in _rtl8812ae_phy_get_chnl_idx_of_txpwr_lmt()
1629 u8 regulation = 0, bandwidth = 0, rate_section = 0, channel; in _rtl8812ae_phy_set_txpower_limit()
1631 s8 power_limit = 0, prev_power_limit, ret; in _rtl8812ae_phy_set_txpower_limit()
1644 if (strcmp(pregulation, "FCC") == 0) in _rtl8812ae_phy_set_txpower_limit()
1645 regulation = 0; in _rtl8812ae_phy_set_txpower_limit()
1646 else if (strcmp(pregulation, "MKK") == 0) in _rtl8812ae_phy_set_txpower_limit()
1648 else if (strcmp(pregulation, "ETSI") == 0) in _rtl8812ae_phy_set_txpower_limit()
1650 else if (strcmp(pregulation, "WW13") == 0) in _rtl8812ae_phy_set_txpower_limit()
1653 if (strcmp(prate_section, "CCK") == 0) in _rtl8812ae_phy_set_txpower_limit()
1654 rate_section = 0; in _rtl8812ae_phy_set_txpower_limit()
1655 else if (strcmp(prate_section, "OFDM") == 0) in _rtl8812ae_phy_set_txpower_limit()
1657 else if (strcmp(prate_section, "HT") == 0 && in _rtl8812ae_phy_set_txpower_limit()
1658 strcmp(prf_path, "1T") == 0) in _rtl8812ae_phy_set_txpower_limit()
1660 else if (strcmp(prate_section, "HT") == 0 && in _rtl8812ae_phy_set_txpower_limit()
1661 strcmp(prf_path, "2T") == 0) in _rtl8812ae_phy_set_txpower_limit()
1663 else if (strcmp(prate_section, "VHT") == 0 && in _rtl8812ae_phy_set_txpower_limit()
1664 strcmp(prf_path, "1T") == 0) in _rtl8812ae_phy_set_txpower_limit()
1666 else if (strcmp(prate_section, "VHT") == 0 && in _rtl8812ae_phy_set_txpower_limit()
1667 strcmp(prf_path, "2T") == 0) in _rtl8812ae_phy_set_txpower_limit()
1670 if (strcmp(pbandwidth, "20M") == 0) in _rtl8812ae_phy_set_txpower_limit()
1671 bandwidth = 0; in _rtl8812ae_phy_set_txpower_limit()
1672 else if (strcmp(pbandwidth, "40M") == 0) in _rtl8812ae_phy_set_txpower_limit()
1674 else if (strcmp(pbandwidth, "80M") == 0) in _rtl8812ae_phy_set_txpower_limit()
1676 else if (strcmp(pbandwidth, "160M") == 0) in _rtl8812ae_phy_set_txpower_limit()
1679 if (strcmp(pband, "2.4G") == 0) { in _rtl8812ae_phy_set_txpower_limit()
1703 } else if (strcmp(pband, "5G") == 0) { in _rtl8812ae_phy_set_txpower_limit()
1748 u32 i = 0; in _rtl8821ae_phy_read_and_config_txpwr_lmt()
1762 for (i = 0; i < array_len; i += 7) { in _rtl8821ae_phy_read_and_config_txpwr_lmt()
1820 RFPGA0_XA_HSSIPARAMETER2, 0x200)); in _rtl8821ae_phy_bb8821a_config_parafile()
1833 int i = 0; in __rtl8821ae_phy_config_with_headerfile()
1936 u8 index = 0; in _rtl8821ae_get_rate_section_index()
1937 regaddr &= 0xFFF; in _rtl8821ae_get_rate_section_index()
1938 if (regaddr >= 0xC20 && regaddr <= 0xC4C) in _rtl8821ae_get_rate_section_index()
1939 index = (u8)((regaddr - 0xC20) / 4); in _rtl8821ae_get_rate_section_index()
1940 else if (regaddr >= 0xE20 && regaddr <= 0xE4C) in _rtl8821ae_get_rate_section_index()
1941 index = (u8)((regaddr - 0xE20) / 4); in _rtl8821ae_get_rate_section_index()
1944 "rtl8821ae: Invalid RegAddr 0x%x\n", regaddr); in _rtl8821ae_get_rate_section_index()
1971 "TxPwrByRateOffset[Band %d][RfPath %d][TxNum %d][RateSection %d] = 0x%x\n", in _rtl8821ae_store_tx_power_by_rate()
1999 for (i = 0; i < arraylen; i += 6) { in _rtl8821ae_phy_config_bb_with_pgheaderfile()
2007 if (v1 < 0xCDCDCDCD) { in _rtl8821ae_phy_config_bb_with_pgheaderfile()
2009 (v4 == 0xfe || v4 == 0xffe)) { in _rtl8821ae_phy_config_bb_with_pgheaderfile()
2015 if (v4 == 0xfe) in _rtl8821ae_phy_config_bb_with_pgheaderfile()
2017 else if (v4 == 0xfd) in _rtl8821ae_phy_config_bb_with_pgheaderfile()
2019 else if (v4 == 0xfc) in _rtl8821ae_phy_config_bb_with_pgheaderfile()
2021 else if (v4 == 0xfb) in _rtl8821ae_phy_config_bb_with_pgheaderfile()
2023 else if (v4 == 0xfa) in _rtl8821ae_phy_config_bb_with_pgheaderfile()
2025 else if (v4 == 0xf9) in _rtl8821ae_phy_config_bb_with_pgheaderfile()
2036 while (v2 != 0xDEAD) in _rtl8821ae_phy_config_bb_with_pgheaderfile()
2108 rtlphy->default_initialgain[0] = in rtl8821ae_phy_get_hw_reg_originalvalue()
2118 "Default initial gain (c50=0x%x, c58=0x%x, c60=0x%x, c68=0x%x\n", in rtl8821ae_phy_get_hw_reg_originalvalue()
2119 rtlphy->default_initialgain[0], in rtl8821ae_phy_get_hw_reg_originalvalue()
2130 "Default framesync (0x%x) = 0x%x\n", in rtl8821ae_phy_get_hw_reg_originalvalue()
2190 u8 i = 0; in _rtl8821ae_phy_get_chnl_index()
2199 for (i = 0; i < CHANNEL_MAX_NUMBER_5G; ++i) { in _rtl8821ae_phy_get_chnl_index()
2211 s8 rate_section = 0; in _rtl8821ae_phy_get_ratesection_intxpower_byrate()
2217 rate_section = 0; in _rtl8821ae_phy_get_ratesection_intxpower_byrate()
2295 s8 min = limit_table[0]; in _rtl8812ae_phy_get_world_wide_limit()
2296 u8 i = 0; in _rtl8812ae_phy_get_world_wide_limit()
2298 for (i = 0; i < MAX_REGULATION_NUM; ++i) { in _rtl8812ae_phy_get_world_wide_limit()
2325 band_temp = 0; in _rtl8812ae_phy_get_txpower_limit()
2330 bandwidth_temp = 0; in _rtl8812ae_phy_get_txpower_limit()
2341 rate_section = 0; in _rtl8812ae_phy_get_txpower_limit()
2399 "Wrong rate 0x%x\n", rate); in _rtl8812ae_phy_get_txpower_limit()
2403 if (band_temp == BAND_ON_5G && rate_section == 0) in _rtl8812ae_phy_get_txpower_limit()
2405 "Wrong rate 0x%x: No CCK in 5G Band\n", rate); in _rtl8812ae_phy_get_txpower_limit()
2410 bandwidth_temp = 0; in _rtl8812ae_phy_get_txpower_limit()
2444 s8 limits[10] = {0}; in _rtl8812ae_phy_get_txpower_limit()
2447 for (i = 0; i < 4; ++i) in _rtl8812ae_phy_get_txpower_limit()
2456 s8 limits[10] = {0}; in _rtl8812ae_phy_get_txpower_limit()
2459 for (i = 0; i < MAX_REGULATION_NUM; ++i) in _rtl8812ae_phy_get_txpower_limit()
2479 u8 shift = 0, rate_section, tx_num; in _rtl8821ae_phy_get_txpower_by_rate()
2480 s8 tx_pwr_diff = 0; in _rtl8821ae_phy_get_txpower_by_rate()
2481 s8 limit = 0; in _rtl8821ae_phy_get_txpower_by_rate()
2507 shift = 0; in _rtl8821ae_phy_get_txpower_by_rate()
2557 [tx_num][rate_section] >> shift) & 0xff; in _rtl8821ae_phy_get_txpower_by_rate()
2567 if (limit < 0) { in _rtl8821ae_phy_get_txpower_by_rate()
2572 if (limit < 0) in _rtl8821ae_phy_get_txpower_by_rate()
2592 u8 txpower = 0; in _rtl8821ae_get_txpower_index()
2594 s8 powerdiff_byrate = 0; in _rtl8821ae_get_txpower_index()
2599 index = 0; in _rtl8821ae_get_txpower_index()
2673 for (i = 0; i < sizeof(channel5g_80m) / sizeof(u8); ++i) in _rtl8821ae_get_txpower_index()
3130 for (i = 0; i < size; i++) { in _rtl8821ae_phy_set_txpower_level_by_path()
3152 data = 0; in _rtl8821ae_phy_txpower_training_by_path()
3165 for (i = 0; i < 3; i++) { in _rtl8821ae_phy_txpower_training_by_path()
3166 if (i == 0) in _rtl8821ae_phy_txpower_training_by_path()
3175 rtl_set_bbreg(hw, offset, 0xffffff, data); in _rtl8821ae_phy_txpower_training_by_path()
3242 u8 path = 0; in rtl8821ae_phy_set_txpower_level()
3308 u16 reg_rf_mode_bw, tmp = 0; in _rtl8821ae_phy_set_reg_bw()
3313 rtl_write_word(rtlpriv, REG_TRXPTCL_CTL, reg_rf_mode_bw & 0xFE7F); in _rtl8821ae_phy_set_reg_bw()
3317 rtl_write_word(rtlpriv, REG_TRXPTCL_CTL, tmp & 0xFEFF); in _rtl8821ae_phy_set_reg_bw()
3321 rtl_write_word(rtlpriv, REG_TRXPTCL_CTL, tmp & 0xFF7F); in _rtl8821ae_phy_set_reg_bw()
3324 rtl_dbg(rtlpriv, COMP_ERR, DBG_WARNING, "unknown Bandwidth: 0x%x\n", bw); in _rtl8821ae_phy_set_reg_bw()
3333 u8 sc_set_40 = 0, sc_set_20 = 0; in _rtl8821ae_phy_get_secondary_chnl()
3372 u8 sub_chnl = 0; in rtl8821ae_phy_set_bw_mode_callback()
3373 u8 l1pk_val = 0; in rtl8821ae_phy_set_bw_mode_callback()
3384 rtl_write_byte(rtlpriv, 0x0483, sub_chnl); in rtl8821ae_phy_set_bw_mode_callback()
3388 rtl_set_bbreg(hw, RRFMOD, 0x003003C3, 0x00300200); in rtl8821ae_phy_set_bw_mode_callback()
3389 rtl_set_bbreg(hw, RADC_BUF_CLK, BIT(30), 0); in rtl8821ae_phy_set_bw_mode_callback()
3392 rtl_set_bbreg(hw, RL1PEAKTH, 0x03C00000, 7); in rtl8821ae_phy_set_bw_mode_callback()
3394 rtl_set_bbreg(hw, RL1PEAKTH, 0x03C00000, 8); in rtl8821ae_phy_set_bw_mode_callback()
3397 rtl_set_bbreg(hw, RRFMOD, 0x003003C3, 0x00300201); in rtl8821ae_phy_set_bw_mode_callback()
3398 rtl_set_bbreg(hw, RADC_BUF_CLK, BIT(30), 0); in rtl8821ae_phy_set_bw_mode_callback()
3399 rtl_set_bbreg(hw, RRFMOD, 0x3C, sub_chnl); in rtl8821ae_phy_set_bw_mode_callback()
3400 rtl_set_bbreg(hw, RCCAONSEC, 0xf0000000, sub_chnl); in rtl8821ae_phy_set_bw_mode_callback()
3410 /* 0x848[25:22] = 0x6 */ in rtl8821ae_phy_set_bw_mode_callback()
3411 rtl_set_bbreg(hw, RL1PEAKTH, 0x03C00000, l1pk_val); in rtl8821ae_phy_set_bw_mode_callback()
3416 rtl_set_bbreg(hw, RCCK_SYSTEM, BCCK_SYSTEM, 0); in rtl8821ae_phy_set_bw_mode_callback()
3420 /* 0x8ac[21,20,9:6,1,0]=8'b11100010 */ in rtl8821ae_phy_set_bw_mode_callback()
3421 rtl_set_bbreg(hw, RRFMOD, 0x003003C3, 0x00300202); in rtl8821ae_phy_set_bw_mode_callback()
3422 /* 0x8c4[30] = 1 */ in rtl8821ae_phy_set_bw_mode_callback()
3424 rtl_set_bbreg(hw, RRFMOD, 0x3C, sub_chnl); in rtl8821ae_phy_set_bw_mode_callback()
3425 rtl_set_bbreg(hw, RCCAONSEC, 0xf0000000, sub_chnl); in rtl8821ae_phy_set_bw_mode_callback()
3435 rtl_set_bbreg(hw, RL1PEAKTH, 0x03C00000, l1pk_val); in rtl8821ae_phy_set_bw_mode_callback()
3488 data = 0x494; in rtl8821ae_phy_sw_chnl_callback()
3490 data = 0x453; in rtl8821ae_phy_sw_chnl_callback()
3492 data = 0x452; in rtl8821ae_phy_sw_chnl_callback()
3494 data = 0x412; in rtl8821ae_phy_sw_chnl_callback()
3496 data = 0x96a; in rtl8821ae_phy_sw_chnl_callback()
3497 rtl_set_bbreg(hw, RFC_AREA, 0x1ffe0000, data); in rtl8821ae_phy_sw_chnl_callback()
3501 data = 0x101; in rtl8821ae_phy_sw_chnl_callback()
3503 data = 0x301; in rtl8821ae_phy_sw_chnl_callback()
3505 data = 0x501; in rtl8821ae_phy_sw_chnl_callback()
3507 data = 0x000; in rtl8821ae_phy_sw_chnl_callback()
3517 data = 0x114E9; in rtl8821ae_phy_sw_chnl_callback()
3519 data = 0x110E9; in rtl8821ae_phy_sw_chnl_callback()
3533 u32 timeout = 1000, timecount = 0; in rtl8821ae_phy_sw_chnl()
3536 return 0; in rtl8821ae_phy_sw_chnl()
3538 return 0; in rtl8821ae_phy_sw_chnl()
3543 return 0; in rtl8821ae_phy_sw_chnl()
3588 return 0; in _rtl8812ae_get_right_chnl_place_for_iqk()
3602 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /*[31] = 0 --> Page C*/ in _rtl8821ae_iqk_backup_macbb()
3604 for (i = 0; i < mac_bb_num; i++) in _rtl8821ae_iqk_backup_macbb()
3616 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /*[31] = 0 --> Page C*/ in _rtl8821ae_iqk_backup_afe()
3618 for (i = 0; i < afe_num; i++) in _rtl8821ae_iqk_backup_afe()
3630 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /*[31] = 0 --> Page C*/ in _rtl8821ae_iqk_backup_rf()
3632 for (i = 0; i < rf_num; i++) { in _rtl8821ae_iqk_backup_rf()
3647 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /*[31] = 0 --> Page C*/ in _rtl8821ae_iqk_configure_mac()
3648 rtl_write_byte(rtlpriv, 0x522, 0x3f); in _rtl8821ae_iqk_configure_mac()
3649 rtl_set_bbreg(hw, 0x550, BIT(11) | BIT(3), 0x0); in _rtl8821ae_iqk_configure_mac()
3650 rtl_write_byte(rtlpriv, 0x808, 0x00); /*RX ante off*/ in _rtl8821ae_iqk_configure_mac()
3651 rtl_set_bbreg(hw, 0x838, 0xf, 0xc); /*CCA off*/ in _rtl8821ae_iqk_configure_mac()
3661 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x1); in _rtl8821ae_iqk_tx_fill_iqc()
3662 rtl_write_dword(rtlpriv, 0xc90, 0x00000080); in _rtl8821ae_iqk_tx_fill_iqc()
3663 rtl_write_dword(rtlpriv, 0xcc4, 0x20040000); in _rtl8821ae_iqk_tx_fill_iqc()
3664 rtl_write_dword(rtlpriv, 0xcc8, 0x20000000); in _rtl8821ae_iqk_tx_fill_iqc()
3665 rtl_set_bbreg(hw, 0xccc, 0x000007ff, tx_y); in _rtl8821ae_iqk_tx_fill_iqc()
3666 rtl_set_bbreg(hw, 0xcd4, 0x000007ff, tx_x); in _rtl8821ae_iqk_tx_fill_iqc()
3671 "0xcd4 = %x;;0xccc = %x ====>fill to IQC\n", in _rtl8821ae_iqk_tx_fill_iqc()
3672 rtl_get_bbreg(hw, 0xcd4, 0x000007ff), in _rtl8821ae_iqk_tx_fill_iqc()
3673 rtl_get_bbreg(hw, 0xccc, 0x000007ff)); in _rtl8821ae_iqk_tx_fill_iqc()
3686 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /* [31] = 0 --> Page C */ in _rtl8821ae_iqk_rx_fill_iqc()
3687 rtl_set_bbreg(hw, 0xc10, 0x000003ff, rx_x>>1); in _rtl8821ae_iqk_rx_fill_iqc()
3688 rtl_set_bbreg(hw, 0xc10, 0x03ff0000, rx_y>>1); in _rtl8821ae_iqk_rx_fill_iqc()
3693 "0xc10 = %x ====>fill to IQC\n", in _rtl8821ae_iqk_rx_fill_iqc()
3694 rtl_read_dword(rtlpriv, 0xc10)); in _rtl8821ae_iqk_rx_fill_iqc()
3709 u32 tx_fail, rx_fail, delay_count, iqk_ready, cal_retry, cal = 0, temp_reg65; in _rtl8821ae_iqk_tx()
3710 int tx_x = 0, tx_y = 0, rx_x = 0, rx_y = 0, tx_average = 0, rx_average = 0; in _rtl8821ae_iqk_tx()
3717 ii, dx = 0, dy = 0, tx_finish = 0, rx_finish = 0; in _rtl8821ae_iqk_tx()
3728 temp_reg65 = rtl_get_rfreg(hw, path, 0x65, 0xffffffff); in _rtl8821ae_iqk_tx()
3730 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /*[31] = 0 --> Page C*/ in _rtl8821ae_iqk_tx()
3732 /*Port 0 DAC/ADC on*/ in _rtl8821ae_iqk_tx()
3733 rtl_write_dword(rtlpriv, 0xc60, 0x77777777); in _rtl8821ae_iqk_tx()
3734 rtl_write_dword(rtlpriv, 0xc64, 0x77777777); in _rtl8821ae_iqk_tx()
3735 rtl_write_dword(rtlpriv, 0xc68, 0x19791979); in _rtl8821ae_iqk_tx()
3736 rtl_write_dword(rtlpriv, 0xc6c, 0x19791979); in _rtl8821ae_iqk_tx()
3737 rtl_write_dword(rtlpriv, 0xc70, 0x19791979); in _rtl8821ae_iqk_tx()
3738 rtl_write_dword(rtlpriv, 0xc74, 0x19791979); in _rtl8821ae_iqk_tx()
3739 rtl_write_dword(rtlpriv, 0xc78, 0x19791979); in _rtl8821ae_iqk_tx()
3740 rtl_write_dword(rtlpriv, 0xc7c, 0x19791979); in _rtl8821ae_iqk_tx()
3741 rtl_write_dword(rtlpriv, 0xc80, 0x19791979); in _rtl8821ae_iqk_tx()
3742 rtl_write_dword(rtlpriv, 0xc84, 0x19791979); in _rtl8821ae_iqk_tx()
3744 rtl_set_bbreg(hw, 0xc00, 0xf, 0x4); /*hardware 3-wire off*/ in _rtl8821ae_iqk_tx()
3749 rtl_set_bbreg(hw, 0xc5c, BIT(26) | BIT(25) | BIT(24), 0x7); in _rtl8821ae_iqk_tx()
3752 rtl_set_rfreg(hw, path, 0xef, RFREG_OFFSET_MASK, 0x80002); in _rtl8821ae_iqk_tx()
3753 rtl_set_rfreg(hw, path, 0x18, 0x00c00, 0x3); /* BW 20M */ in _rtl8821ae_iqk_tx()
3754 rtl_set_rfreg(hw, path, 0x30, RFREG_OFFSET_MASK, 0x20000); in _rtl8821ae_iqk_tx()
3755 rtl_set_rfreg(hw, path, 0x31, RFREG_OFFSET_MASK, 0x0003f); in _rtl8821ae_iqk_tx()
3756 rtl_set_rfreg(hw, path, 0x32, RFREG_OFFSET_MASK, 0xf3fc3); in _rtl8821ae_iqk_tx()
3757 rtl_set_rfreg(hw, path, 0x65, RFREG_OFFSET_MASK, 0x931d5); in _rtl8821ae_iqk_tx()
3758 rtl_set_rfreg(hw, path, 0x8f, RFREG_OFFSET_MASK, 0x8a001); in _rtl8821ae_iqk_tx()
3759 rtl_set_bbreg(hw, 0xcb8, 0xf, 0xd); in _rtl8821ae_iqk_tx()
3760 rtl_write_dword(rtlpriv, 0x90c, 0x00008000); in _rtl8821ae_iqk_tx()
3761 rtl_write_dword(rtlpriv, 0xb00, 0x03000100); in _rtl8821ae_iqk_tx()
3762 rtl_set_bbreg(hw, 0xc94, BIT(0), 0x1); in _rtl8821ae_iqk_tx()
3763 rtl_write_dword(rtlpriv, 0x978, 0x29002000);/* TX (X,Y) */ in _rtl8821ae_iqk_tx()
3764 rtl_write_dword(rtlpriv, 0x97c, 0xa9002000);/* RX (X,Y) */ in _rtl8821ae_iqk_tx()
3765 rtl_write_dword(rtlpriv, 0x984, 0x00462910);/* [0]:AGC_en, [15]:idac_K_Mask */ in _rtl8821ae_iqk_tx()
3767 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x1); /* [31] = 1 --> Page C1 */ in _rtl8821ae_iqk_tx()
3768 rtl_write_dword(rtlpriv, 0xc88, 0x821403f4); in _rtl8821ae_iqk_tx()
3771 rtl_write_dword(rtlpriv, 0xc8c, 0x68163e96); in _rtl8821ae_iqk_tx()
3773 rtl_write_dword(rtlpriv, 0xc8c, 0x28163e96); in _rtl8821ae_iqk_tx()
3775 rtl_write_dword(rtlpriv, 0xc80, 0x18008c10);/* TX_TONE_idx[9:0], TxK_Mask[29] TX_Tone = 16 */ in _rtl8821ae_iqk_tx()
3776 rtl_write_dword(rtlpriv, 0xc84, 0x38008c10);/* RX_TONE_idx[9:0], RxK_Mask[29] */ in _rtl8821ae_iqk_tx()
3777 …rtl_write_dword(rtlpriv, 0xcb8, 0x00100000);/* cb8[20] \B1N SI/PI \A8ϥ\CE\C5v\A4\C1\B5\B9 iqk_dpk … in _rtl8821ae_iqk_tx()
3778 rtl_write_dword(rtlpriv, 0x980, 0xfa000000); in _rtl8821ae_iqk_tx()
3779 rtl_write_dword(rtlpriv, 0x980, 0xf8000000); in _rtl8821ae_iqk_tx()
3782 rtl_write_dword(rtlpriv, 0xcb8, 0x00000000); in _rtl8821ae_iqk_tx()
3784 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /* [31] = 0 --> Page C */ in _rtl8821ae_iqk_tx()
3785 rtl_set_rfreg(hw, path, 0x58, 0x7fe00, rtl_get_rfreg(hw, path, 0x8, 0xffc00)); /* Load LOK */ in _rtl8821ae_iqk_tx()
3789 rtl_set_rfreg(hw, path, 0x18, 0x00c00, 0x1); in _rtl8821ae_iqk_tx()
3792 rtl_set_rfreg(hw, path, 0x18, 0x00c00, 0x0); in _rtl8821ae_iqk_tx()
3798 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x1); /* [31] = 1 --> Page C1 */ in _rtl8821ae_iqk_tx()
3801 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /* [31] = 0 --> Page C */ in _rtl8821ae_iqk_tx()
3802 rtl_set_rfreg(hw, path, 0xef, RFREG_OFFSET_MASK, 0x80000); in _rtl8821ae_iqk_tx()
3803 rtl_set_rfreg(hw, path, 0x30, RFREG_OFFSET_MASK, 0x20000); in _rtl8821ae_iqk_tx()
3804 rtl_set_rfreg(hw, path, 0x31, RFREG_OFFSET_MASK, 0x0003f); in _rtl8821ae_iqk_tx()
3805 rtl_set_rfreg(hw, path, 0x32, RFREG_OFFSET_MASK, 0xf3fc3); in _rtl8821ae_iqk_tx()
3806 rtl_set_rfreg(hw, path, 0x65, RFREG_OFFSET_MASK, 0x931d5); in _rtl8821ae_iqk_tx()
3807 rtl_set_rfreg(hw, path, 0x8f, RFREG_OFFSET_MASK, 0x8a001); in _rtl8821ae_iqk_tx()
3808 rtl_set_rfreg(hw, path, 0xef, RFREG_OFFSET_MASK, 0x00000); in _rtl8821ae_iqk_tx()
3809 /* ODM_SetBBReg(pDM_Odm, 0xcb8, 0xf, 0xd); */ in _rtl8821ae_iqk_tx()
3810 rtl_write_dword(rtlpriv, 0x90c, 0x00008000); in _rtl8821ae_iqk_tx()
3811 rtl_write_dword(rtlpriv, 0xb00, 0x03000100); in _rtl8821ae_iqk_tx()
3812 rtl_set_bbreg(hw, 0xc94, BIT(0), 0x1); in _rtl8821ae_iqk_tx()
3813 rtl_write_dword(rtlpriv, 0x978, 0x29002000);/* TX (X,Y) */ in _rtl8821ae_iqk_tx()
3814 rtl_write_dword(rtlpriv, 0x97c, 0xa9002000);/* RX (X,Y) */ in _rtl8821ae_iqk_tx()
3815 rtl_write_dword(rtlpriv, 0x984, 0x0046a910);/* [0]:AGC_en, [15]:idac_K_Mask */ in _rtl8821ae_iqk_tx()
3817 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x1); /* [31] = 1 --> Page C1 */ in _rtl8821ae_iqk_tx()
3818 rtl_write_dword(rtlpriv, 0xc88, 0x821403f1); in _rtl8821ae_iqk_tx()
3820 rtl_write_dword(rtlpriv, 0xc8c, 0x40163e96); in _rtl8821ae_iqk_tx()
3822 rtl_write_dword(rtlpriv, 0xc8c, 0x00163e96); in _rtl8821ae_iqk_tx()
3826 for (k = 0; k <= 2; k++) { in _rtl8821ae_iqk_tx()
3828 case 0: in _rtl8821ae_iqk_tx()
3829 rtl_write_dword(rtlpriv, 0xc80, 0x18008c38);/* TX_TONE_idx[9:0], TxK_Mask[29] TX_Tone = 16 */ in _rtl8821ae_iqk_tx()
3830 rtl_write_dword(rtlpriv, 0xc84, 0x38008c38);/* RX_TONE_idx[9:0], RxK_Mask[29] */ in _rtl8821ae_iqk_tx()
3831 rtl_set_bbreg(hw, 0xce8, BIT(31), 0x0); in _rtl8821ae_iqk_tx()
3834 rtl_set_bbreg(hw, 0xc80, BIT(28), 0x0); in _rtl8821ae_iqk_tx()
3835 rtl_set_bbreg(hw, 0xc84, BIT(28), 0x0); in _rtl8821ae_iqk_tx()
3836 rtl_set_bbreg(hw, 0xce8, BIT(31), 0x0); in _rtl8821ae_iqk_tx()
3840 "vdf_y[1] = %x;;;vdf_y[0] = %x\n", vdf_y[1]>>21 & 0x00007ff, vdf_y[0]>>21 & 0x00007ff); in _rtl8821ae_iqk_tx()
3842 "vdf_x[1] = %x;;;vdf_x[0] = %x\n", vdf_x[1]>>21 & 0x00007ff, vdf_x[0]>>21 & 0x00007ff); in _rtl8821ae_iqk_tx()
3843 tx_dt[cal] = (vdf_y[1]>>20)-(vdf_y[0]>>20); in _rtl8821ae_iqk_tx()
3845 tx_dt[cal] = (tx_dt[cal] >> 1)+(tx_dt[cal] & BIT(0)); in _rtl8821ae_iqk_tx()
3846 rtl_write_dword(rtlpriv, 0xc80, 0x18008c20);/* TX_TONE_idx[9:0], TxK_Mask[29] TX_Tone = 16 */ in _rtl8821ae_iqk_tx()
3847 rtl_write_dword(rtlpriv, 0xc84, 0x38008c20);/* RX_TONE_idx[9:0], RxK_Mask[29] */ in _rtl8821ae_iqk_tx()
3848 rtl_set_bbreg(hw, 0xce8, BIT(31), 0x1); in _rtl8821ae_iqk_tx()
3849 rtl_set_bbreg(hw, 0xce8, 0x3fff0000, tx_dt[cal] & 0x00003fff); in _rtl8821ae_iqk_tx()
3854 …rtl_write_dword(rtlpriv, 0xcb8, 0x00100000);/* cb8[20] \B1N SI/PI \A8ϥ\CE\C5v\A4\C1\B5\B9 iqk_dpk … in _rtl8821ae_iqk_tx()
3855 cal_retry = 0; in _rtl8821ae_iqk_tx()
3858 rtl_write_dword(rtlpriv, 0x980, 0xfa000000); in _rtl8821ae_iqk_tx()
3859 rtl_write_dword(rtlpriv, 0x980, 0xf8000000); in _rtl8821ae_iqk_tx()
3862 rtl_write_dword(rtlpriv, 0xcb8, 0x00000000); in _rtl8821ae_iqk_tx()
3863 delay_count = 0; in _rtl8821ae_iqk_tx()
3865 iqk_ready = rtl_get_bbreg(hw, 0xd00, BIT(10)); in _rtl8821ae_iqk_tx()
3876 tx_fail = rtl_get_bbreg(hw, 0xd00, BIT(12)); in _rtl8821ae_iqk_tx()
3879 rtl_write_dword(rtlpriv, 0xcb8, 0x02000000); in _rtl8821ae_iqk_tx()
3880 vdf_x[k] = rtl_get_bbreg(hw, 0xd00, 0x07ff0000)<<21; in _rtl8821ae_iqk_tx()
3881 rtl_write_dword(rtlpriv, 0xcb8, 0x04000000); in _rtl8821ae_iqk_tx()
3882 vdf_y[k] = rtl_get_bbreg(hw, 0xd00, 0x07ff0000)<<21; in _rtl8821ae_iqk_tx()
3886 rtl_set_bbreg(hw, 0xccc, 0x000007ff, 0x0); in _rtl8821ae_iqk_tx()
3887 rtl_set_bbreg(hw, 0xcd4, 0x000007ff, 0x200); in _rtl8821ae_iqk_tx()
3906 rtl_write_dword(rtlpriv, 0xc80, 0x18008c10);/* TX_TONE_idx[9:0], TxK_Mask[29] TX_Tone = 16 */ in _rtl8821ae_iqk_tx()
3907 rtl_write_dword(rtlpriv, 0xc84, 0x38008c10);/* RX_TONE_idx[9:0], RxK_Mask[29] */ in _rtl8821ae_iqk_tx()
3908 …rtl_write_dword(rtlpriv, 0xcb8, 0x00100000);/* cb8[20] \B1N SI/PI \A8ϥ\CE\C5v\A4\C1\B5\B9 iqk_dpk … in _rtl8821ae_iqk_tx()
3909 cal_retry = 0; in _rtl8821ae_iqk_tx()
3912 rtl_write_dword(rtlpriv, 0x980, 0xfa000000); in _rtl8821ae_iqk_tx()
3913 rtl_write_dword(rtlpriv, 0x980, 0xf8000000); in _rtl8821ae_iqk_tx()
3916 rtl_write_dword(rtlpriv, 0xcb8, 0x00000000); in _rtl8821ae_iqk_tx()
3917 delay_count = 0; in _rtl8821ae_iqk_tx()
3919 iqk_ready = rtl_get_bbreg(hw, 0xd00, BIT(10)); in _rtl8821ae_iqk_tx()
3930 tx_fail = rtl_get_bbreg(hw, 0xd00, BIT(12)); in _rtl8821ae_iqk_tx()
3933 rtl_write_dword(rtlpriv, 0xcb8, 0x02000000); in _rtl8821ae_iqk_tx()
3934 tx_x0[cal] = rtl_get_bbreg(hw, 0xd00, 0x07ff0000)<<21; in _rtl8821ae_iqk_tx()
3935 rtl_write_dword(rtlpriv, 0xcb8, 0x04000000); in _rtl8821ae_iqk_tx()
3936 tx_y0[cal] = rtl_get_bbreg(hw, 0xd00, 0x07ff0000)<<21; in _rtl8821ae_iqk_tx()
3940 rtl_set_bbreg(hw, 0xccc, 0x000007ff, 0x0); in _rtl8821ae_iqk_tx()
3941 rtl_set_bbreg(hw, 0xcd4, 0x000007ff, 0x200); in _rtl8821ae_iqk_tx()
3960 rtl_set_bbreg(hw, 0xce8, BIT(31), 0x0); /* TX VDF Disable */ in _rtl8821ae_iqk_tx()
3962 for (k = 0; k <= 2; k++) { in _rtl8821ae_iqk_tx()
3964 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /* [31] = 0 --> Page C */ in _rtl8821ae_iqk_tx()
3966 rtl_set_rfreg(hw, path, 0xef, RFREG_OFFSET_MASK, 0x80000); in _rtl8821ae_iqk_tx()
3967 rtl_set_rfreg(hw, path, 0x30, RFREG_OFFSET_MASK, 0x30000); in _rtl8821ae_iqk_tx()
3968 rtl_set_rfreg(hw, path, 0x31, RFREG_OFFSET_MASK, 0x00029); in _rtl8821ae_iqk_tx()
3969 rtl_set_rfreg(hw, path, 0x32, RFREG_OFFSET_MASK, 0xd7ffb); in _rtl8821ae_iqk_tx()
3970 rtl_set_rfreg(hw, path, 0x65, RFREG_OFFSET_MASK, temp_reg65); in _rtl8821ae_iqk_tx()
3971 rtl_set_rfreg(hw, path, 0x8f, RFREG_OFFSET_MASK, 0x8a001); in _rtl8821ae_iqk_tx()
3972 rtl_set_rfreg(hw, path, 0xef, RFREG_OFFSET_MASK, 0x00000); in _rtl8821ae_iqk_tx()
3974 rtl_set_bbreg(hw, 0xcb8, 0xf, 0xd); in _rtl8821ae_iqk_tx()
3975 rtl_write_dword(rtlpriv, 0x978, 0x29002000);/* TX (X,Y) */ in _rtl8821ae_iqk_tx()
3976 rtl_write_dword(rtlpriv, 0x97c, 0xa9002000);/* RX (X,Y) */ in _rtl8821ae_iqk_tx()
3977 rtl_write_dword(rtlpriv, 0x984, 0x0046a910);/* [0]:AGC_en, [15]:idac_K_Mask */ in _rtl8821ae_iqk_tx()
3978 rtl_write_dword(rtlpriv, 0x90c, 0x00008000); in _rtl8821ae_iqk_tx()
3979 rtl_write_dword(rtlpriv, 0xb00, 0x03000100); in _rtl8821ae_iqk_tx()
3980 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x1); /* [31] = 1 --> Page C1 */ in _rtl8821ae_iqk_tx()
3982 case 0: in _rtl8821ae_iqk_tx()
3984 rtl_write_dword(rtlpriv, 0xc80, 0x18008c38);/* TX_TONE_idx[9:0], TxK_Mask[29] TX_Tone = 16 */ in _rtl8821ae_iqk_tx()
3985 rtl_write_dword(rtlpriv, 0xc84, 0x38008c38);/* RX_TONE_idx[9:0], RxK_Mask[29] */ in _rtl8821ae_iqk_tx()
3986 rtl_set_bbreg(hw, 0xce8, BIT(30), 0x0); in _rtl8821ae_iqk_tx()
3991 rtl_write_dword(rtlpriv, 0xc80, 0x08008c38);/* TX_TONE_idx[9:0], TxK_Mask[29] TX_Tone = 16 */ in _rtl8821ae_iqk_tx()
3992 rtl_write_dword(rtlpriv, 0xc84, 0x28008c38);/* RX_TONE_idx[9:0], RxK_Mask[29] */ in _rtl8821ae_iqk_tx()
3993 rtl_set_bbreg(hw, 0xce8, BIT(30), 0x0); in _rtl8821ae_iqk_tx()
3999 "VDF_Y[1] = %x;;;VDF_Y[0] = %x\n", in _rtl8821ae_iqk_tx()
4000 vdf_y[1] >> 21 & 0x00007ff, in _rtl8821ae_iqk_tx()
4001 vdf_y[0] >> 21 & 0x00007ff); in _rtl8821ae_iqk_tx()
4003 "VDF_X[1] = %x;;;VDF_X[0] = %x\n", in _rtl8821ae_iqk_tx()
4004 vdf_x[1] >> 21 & 0x00007ff, in _rtl8821ae_iqk_tx()
4005 vdf_x[0] >> 21 & 0x00007ff); in _rtl8821ae_iqk_tx()
4006 rx_dt[cal] = (vdf_y[1]>>20)-(vdf_y[0]>>20); in _rtl8821ae_iqk_tx()
4010 rx_dt[cal] = (rx_dt[cal] >> 1)+(rx_dt[cal] & BIT(0)); in _rtl8821ae_iqk_tx()
4011 rtl_write_dword(rtlpriv, 0xc80, 0x18008c20);/* TX_TONE_idx[9:0], TxK_Mask[29] TX_Tone = 16 */ in _rtl8821ae_iqk_tx()
4012 rtl_write_dword(rtlpriv, 0xc84, 0x38008c20);/* RX_TONE_idx[9:0], RxK_Mask[29] */ in _rtl8821ae_iqk_tx()
4013 rtl_set_bbreg(hw, 0xce8, 0x00003fff, rx_dt[cal] & 0x00003fff); in _rtl8821ae_iqk_tx()
4019 rtl_write_dword(rtlpriv, 0xc88, 0x821603e0); in _rtl8821ae_iqk_tx()
4020 rtl_write_dword(rtlpriv, 0xc8c, 0x68163e96); in _rtl8821ae_iqk_tx()
4021 …rtl_write_dword(rtlpriv, 0xcb8, 0x00100000);/* cb8[20] \B1N SI/PI \A8ϥ\CE\C5v\A4\C1\B5\B9 iqk_dpk … in _rtl8821ae_iqk_tx()
4022 cal_retry = 0; in _rtl8821ae_iqk_tx()
4025 rtl_write_dword(rtlpriv, 0x980, 0xfa000000); in _rtl8821ae_iqk_tx()
4026 rtl_write_dword(rtlpriv, 0x980, 0xf8000000); in _rtl8821ae_iqk_tx()
4029 rtl_write_dword(rtlpriv, 0xcb8, 0x00000000); in _rtl8821ae_iqk_tx()
4030 delay_count = 0; in _rtl8821ae_iqk_tx()
4032 iqk_ready = rtl_get_bbreg(hw, 0xd00, BIT(10)); in _rtl8821ae_iqk_tx()
4043 tx_fail = rtl_get_bbreg(hw, 0xd00, BIT(12)); in _rtl8821ae_iqk_tx()
4046 rtl_write_dword(rtlpriv, 0xcb8, 0x02000000); in _rtl8821ae_iqk_tx()
4047 tx_x0_rxk[cal] = rtl_get_bbreg(hw, 0xd00, 0x07ff0000)<<21; in _rtl8821ae_iqk_tx()
4048 rtl_write_dword(rtlpriv, 0xcb8, 0x04000000); in _rtl8821ae_iqk_tx()
4049 tx_y0_rxk[cal] = rtl_get_bbreg(hw, 0xd00, 0x07ff0000)<<21; in _rtl8821ae_iqk_tx()
4077 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /* [31] = 0 --> Page C */ in _rtl8821ae_iqk_tx()
4079 rtl_set_rfreg(hw, path, 0xef, RFREG_OFFSET_MASK, 0x80000); in _rtl8821ae_iqk_tx()
4080 rtl_set_rfreg(hw, path, 0x30, RFREG_OFFSET_MASK, 0x30000); in _rtl8821ae_iqk_tx()
4081 rtl_set_rfreg(hw, path, 0x31, RFREG_OFFSET_MASK, 0x0002f); in _rtl8821ae_iqk_tx()
4082 rtl_set_rfreg(hw, path, 0x32, RFREG_OFFSET_MASK, 0xfffbb); in _rtl8821ae_iqk_tx()
4083 rtl_set_rfreg(hw, path, 0x8f, RFREG_OFFSET_MASK, 0x88001); in _rtl8821ae_iqk_tx()
4084 rtl_set_rfreg(hw, path, 0x65, RFREG_OFFSET_MASK, 0x931d8); in _rtl8821ae_iqk_tx()
4085 rtl_set_rfreg(hw, path, 0xef, RFREG_OFFSET_MASK, 0x00000); in _rtl8821ae_iqk_tx()
4087 rtl_set_bbreg(hw, 0x978, 0x03FF8000, (tx_x0_rxk[cal])>>21&0x000007ff); in _rtl8821ae_iqk_tx()
4088 rtl_set_bbreg(hw, 0x978, 0x000007FF, (tx_y0_rxk[cal])>>21&0x000007ff); in _rtl8821ae_iqk_tx()
4089 rtl_set_bbreg(hw, 0x978, BIT(31), 0x1); in _rtl8821ae_iqk_tx()
4090 rtl_set_bbreg(hw, 0x97c, BIT(31), 0x0); in _rtl8821ae_iqk_tx()
4091 rtl_set_bbreg(hw, 0xcb8, 0xF, 0xe); in _rtl8821ae_iqk_tx()
4092 rtl_write_dword(rtlpriv, 0x90c, 0x00008000); in _rtl8821ae_iqk_tx()
4093 rtl_write_dword(rtlpriv, 0x984, 0x0046a911); in _rtl8821ae_iqk_tx()
4095 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x1); /* [31] = 1 --> Page C1 */ in _rtl8821ae_iqk_tx()
4096 rtl_set_bbreg(hw, 0xc80, BIT(29), 0x1); in _rtl8821ae_iqk_tx()
4097 rtl_set_bbreg(hw, 0xc84, BIT(29), 0x0); in _rtl8821ae_iqk_tx()
4098 rtl_write_dword(rtlpriv, 0xc88, 0x02140119); in _rtl8821ae_iqk_tx()
4100 rtl_write_dword(rtlpriv, 0xc8c, 0x28160d00); /* pDM_Odm->SupportInterface == 1 */ in _rtl8821ae_iqk_tx()
4103 rtl_set_bbreg(hw, 0xce8, BIT(30), 0x1); /* RX VDF Enable */ in _rtl8821ae_iqk_tx()
4104 …rtl_write_dword(rtlpriv, 0xcb8, 0x00100000);/* cb8[20] \B1N SI/PI \A8ϥ\CE\C5v\A4\C1\B5\B9 iqk_dpk … in _rtl8821ae_iqk_tx()
4106 cal_retry = 0; in _rtl8821ae_iqk_tx()
4109 rtl_write_dword(rtlpriv, 0x980, 0xfa000000); in _rtl8821ae_iqk_tx()
4110 rtl_write_dword(rtlpriv, 0x980, 0xf8000000); in _rtl8821ae_iqk_tx()
4113 rtl_write_dword(rtlpriv, 0xcb8, 0x00000000); in _rtl8821ae_iqk_tx()
4114 delay_count = 0; in _rtl8821ae_iqk_tx()
4116 iqk_ready = rtl_get_bbreg(hw, 0xd00, BIT(10)); in _rtl8821ae_iqk_tx()
4127 rx_fail = rtl_get_bbreg(hw, 0xd00, BIT(11)); in _rtl8821ae_iqk_tx()
4128 if (rx_fail == 0) { in _rtl8821ae_iqk_tx()
4129 rtl_write_dword(rtlpriv, 0xcb8, 0x06000000); in _rtl8821ae_iqk_tx()
4130 vdf_x[k] = rtl_get_bbreg(hw, 0xd00, 0x07ff0000)<<21; in _rtl8821ae_iqk_tx()
4131 rtl_write_dword(rtlpriv, 0xcb8, 0x08000000); in _rtl8821ae_iqk_tx()
4132 vdf_y[k] = rtl_get_bbreg(hw, 0xd00, 0x07ff0000)<<21; in _rtl8821ae_iqk_tx()
4136 rtl_set_bbreg(hw, 0xc10, 0x000003ff, 0x200>>1); in _rtl8821ae_iqk_tx()
4137 rtl_set_bbreg(hw, 0xc10, 0x03ff0000, 0x0>>1); in _rtl8821ae_iqk_tx()
4157 rtl_set_bbreg(hw, 0xce8, BIT(31), 0x1); /* TX VDF Enable */ in _rtl8821ae_iqk_tx()
4162 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /* [31] = 0 --> Page C */ in _rtl8821ae_iqk_tx()
4164 rtl_set_rfreg(hw, path, 0xef, RFREG_OFFSET_MASK, 0x80000); in _rtl8821ae_iqk_tx()
4165 rtl_set_rfreg(hw, path, 0x30, RFREG_OFFSET_MASK, 0x30000); in _rtl8821ae_iqk_tx()
4166 rtl_set_rfreg(hw, path, 0x31, RFREG_OFFSET_MASK, 0x00029); in _rtl8821ae_iqk_tx()
4167 rtl_set_rfreg(hw, path, 0x32, RFREG_OFFSET_MASK, 0xd7ffb); in _rtl8821ae_iqk_tx()
4168 rtl_set_rfreg(hw, path, 0x65, RFREG_OFFSET_MASK, temp_reg65); in _rtl8821ae_iqk_tx()
4169 rtl_set_rfreg(hw, path, 0x8f, RFREG_OFFSET_MASK, 0x8a001); in _rtl8821ae_iqk_tx()
4170 rtl_set_rfreg(hw, path, 0xef, RFREG_OFFSET_MASK, 0x00000); in _rtl8821ae_iqk_tx()
4171 rtl_write_dword(rtlpriv, 0x90c, 0x00008000); in _rtl8821ae_iqk_tx()
4172 rtl_write_dword(rtlpriv, 0xb00, 0x03000100); in _rtl8821ae_iqk_tx()
4173 rtl_write_dword(rtlpriv, 0x984, 0x0046a910);/* [0]:AGC_en, [15]:idac_K_Mask */ in _rtl8821ae_iqk_tx()
4175 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x1); /* [31] = 1 --> Page C1 */ in _rtl8821ae_iqk_tx()
4176 rtl_write_dword(rtlpriv, 0xc80, 0x18008c10);/* TX_TONE_idx[9:0], TxK_Mask[29] TX_Tone = 16 */ in _rtl8821ae_iqk_tx()
4177 rtl_write_dword(rtlpriv, 0xc84, 0x38008c10);/* RX_TONE_idx[9:0], RxK_Mask[29] */ in _rtl8821ae_iqk_tx()
4178 rtl_write_dword(rtlpriv, 0xc88, 0x821603e0); in _rtl8821ae_iqk_tx()
4179 /* ODM_Write4Byte(pDM_Odm, 0xc8c, 0x68163e96); */ in _rtl8821ae_iqk_tx()
4180 …rtl_write_dword(rtlpriv, 0xcb8, 0x00100000);/* cb8[20] \B1N SI/PI \A8ϥ\CE\C5v\A4\C1\B5\B9 iqk_dpk … in _rtl8821ae_iqk_tx()
4181 cal_retry = 0; in _rtl8821ae_iqk_tx()
4184 rtl_write_dword(rtlpriv, 0x980, 0xfa000000); in _rtl8821ae_iqk_tx()
4185 rtl_write_dword(rtlpriv, 0x980, 0xf8000000); in _rtl8821ae_iqk_tx()
4188 rtl_write_dword(rtlpriv, 0xcb8, 0x00000000); in _rtl8821ae_iqk_tx()
4189 delay_count = 0; in _rtl8821ae_iqk_tx()
4191 iqk_ready = rtl_get_bbreg(hw, 0xd00, BIT(10)); in _rtl8821ae_iqk_tx()
4202 tx_fail = rtl_get_bbreg(hw, 0xd00, BIT(12)); in _rtl8821ae_iqk_tx()
4205 rtl_write_dword(rtlpriv, 0xcb8, 0x02000000); in _rtl8821ae_iqk_tx()
4206 tx_x0_rxk[cal] = rtl_get_bbreg(hw, 0xd00, 0x07ff0000)<<21; in _rtl8821ae_iqk_tx()
4207 rtl_write_dword(rtlpriv, 0xcb8, 0x04000000); in _rtl8821ae_iqk_tx()
4208 tx_y0_rxk[cal] = rtl_get_bbreg(hw, 0xd00, 0x07ff0000)<<21; in _rtl8821ae_iqk_tx()
4234 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /* [31] = 0 --> Page C */ in _rtl8821ae_iqk_tx()
4236 rtl_set_rfreg(hw, path, 0xef, RFREG_OFFSET_MASK, 0x80000); in _rtl8821ae_iqk_tx()
4237 rtl_set_rfreg(hw, path, 0x30, RFREG_OFFSET_MASK, 0x30000); in _rtl8821ae_iqk_tx()
4238 rtl_set_rfreg(hw, path, 0x31, RFREG_OFFSET_MASK, 0x0002f); in _rtl8821ae_iqk_tx()
4239 rtl_set_rfreg(hw, path, 0x32, RFREG_OFFSET_MASK, 0xfffbb); in _rtl8821ae_iqk_tx()
4240 rtl_set_rfreg(hw, path, 0x8f, RFREG_OFFSET_MASK, 0x88001); in _rtl8821ae_iqk_tx()
4241 rtl_set_rfreg(hw, path, 0x65, RFREG_OFFSET_MASK, 0x931d8); in _rtl8821ae_iqk_tx()
4242 rtl_set_rfreg(hw, path, 0xef, RFREG_OFFSET_MASK, 0x00000); in _rtl8821ae_iqk_tx()
4244 rtl_set_bbreg(hw, 0x978, 0x03FF8000, (tx_x0_rxk[cal])>>21&0x000007ff); in _rtl8821ae_iqk_tx()
4245 rtl_set_bbreg(hw, 0x978, 0x000007FF, (tx_y0_rxk[cal])>>21&0x000007ff); in _rtl8821ae_iqk_tx()
4246 rtl_set_bbreg(hw, 0x978, BIT(31), 0x1); in _rtl8821ae_iqk_tx()
4247 rtl_set_bbreg(hw, 0x97c, BIT(31), 0x0); in _rtl8821ae_iqk_tx()
4248 /* ODM_SetBBReg(pDM_Odm, 0xcb8, 0xF, 0xe); */ in _rtl8821ae_iqk_tx()
4249 rtl_write_dword(rtlpriv, 0x90c, 0x00008000); in _rtl8821ae_iqk_tx()
4250 rtl_write_dword(rtlpriv, 0x984, 0x0046a911); in _rtl8821ae_iqk_tx()
4252 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x1); /* [31] = 1 --> Page C1 */ in _rtl8821ae_iqk_tx()
4253 rtl_write_dword(rtlpriv, 0xc80, 0x38008c10);/* TX_TONE_idx[9:0], TxK_Mask[29] TX_Tone = 16 */ in _rtl8821ae_iqk_tx()
4254 rtl_write_dword(rtlpriv, 0xc84, 0x18008c10);/* RX_TONE_idx[9:0], RxK_Mask[29] */ in _rtl8821ae_iqk_tx()
4255 rtl_write_dword(rtlpriv, 0xc88, 0x02140119); in _rtl8821ae_iqk_tx()
4257 rtl_write_dword(rtlpriv, 0xc8c, 0x28160d00); /*pDM_Odm->SupportInterface == 1*/ in _rtl8821ae_iqk_tx()
4259 …rtl_write_dword(rtlpriv, 0xcb8, 0x00100000);/* cb8[20] \B1N SI/PI \A8ϥ\CE\C5v\A4\C1\B5\B9 iqk_dpk … in _rtl8821ae_iqk_tx()
4261 cal_retry = 0; in _rtl8821ae_iqk_tx()
4264 rtl_write_dword(rtlpriv, 0x980, 0xfa000000); in _rtl8821ae_iqk_tx()
4265 rtl_write_dword(rtlpriv, 0x980, 0xf8000000); in _rtl8821ae_iqk_tx()
4268 rtl_write_dword(rtlpriv, 0xcb8, 0x00000000); in _rtl8821ae_iqk_tx()
4269 delay_count = 0; in _rtl8821ae_iqk_tx()
4271 iqk_ready = rtl_get_bbreg(hw, 0xd00, BIT(10)); in _rtl8821ae_iqk_tx()
4282 rx_fail = rtl_get_bbreg(hw, 0xd00, BIT(11)); in _rtl8821ae_iqk_tx()
4283 if (rx_fail == 0) { in _rtl8821ae_iqk_tx()
4284 rtl_write_dword(rtlpriv, 0xcb8, 0x06000000); in _rtl8821ae_iqk_tx()
4285 rx_x0[cal] = rtl_get_bbreg(hw, 0xd00, 0x07ff0000)<<21; in _rtl8821ae_iqk_tx()
4286 rtl_write_dword(rtlpriv, 0xcb8, 0x08000000); in _rtl8821ae_iqk_tx()
4287 rx_y0[cal] = rtl_get_bbreg(hw, 0xd00, 0x07ff0000)<<21; in _rtl8821ae_iqk_tx()
4291 rtl_set_bbreg(hw, 0xc10, 0x000003ff, 0x200>>1); in _rtl8821ae_iqk_tx()
4292 rtl_set_bbreg(hw, 0xc10, 0x03ff0000, 0x0>>1); in _rtl8821ae_iqk_tx()
4312 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /* [31] = 0 --> Page C */ in _rtl8821ae_iqk_tx()
4313 rtl_set_rfreg(hw, path, 0x65, RFREG_OFFSET_MASK, temp_reg65); in _rtl8821ae_iqk_tx()
4326 if (tx_average == 0) in _rtl8821ae_iqk_tx()
4329 for (i = 0; i < tx_average; i++) { in _rtl8821ae_iqk_tx()
4332 (tx_x0_rxk[i]) >> 21 & 0x000007ff, i, in _rtl8821ae_iqk_tx()
4333 (tx_y0_rxk[i]) >> 21 & 0x000007ff); in _rtl8821ae_iqk_tx()
4336 (tx_x0[i]) >> 21 & 0x000007ff, i, in _rtl8821ae_iqk_tx()
4337 (tx_y0[i]) >> 21 & 0x000007ff); in _rtl8821ae_iqk_tx()
4339 for (i = 0; i < tx_average; i++) { in _rtl8821ae_iqk_tx()
4359 _rtl8821ae_iqk_tx_fill_iqc(hw, path, 0x200, 0x0); in _rtl8821ae_iqk_tx()
4361 if (rx_average == 0) in _rtl8821ae_iqk_tx()
4364 for (i = 0; i < rx_average; i++) in _rtl8821ae_iqk_tx()
4367 (rx_x0[i])>>21&0x000007ff, i, in _rtl8821ae_iqk_tx()
4368 (rx_y0[i])>>21&0x000007ff); in _rtl8821ae_iqk_tx()
4369 for (i = 0; i < rx_average; i++) { in _rtl8821ae_iqk_tx()
4389 _rtl8821ae_iqk_rx_fill_iqc(hw, path, 0x200, 0x0); in _rtl8821ae_iqk_tx()
4404 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /* [31] = 0 --> Page C */ in _rtl8821ae_iqk_restore_rf()
4405 for (i = 0; i < RF_REG_NUM; i++) in _rtl8821ae_iqk_restore_rf()
4426 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /* [31] = 0 --> Page C */ in _rtl8821ae_iqk_restore_afe()
4428 for (i = 0; i < afe_num; i++) in _rtl8821ae_iqk_restore_afe()
4430 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x1); /* [31] = 1 --> Page C1 */ in _rtl8821ae_iqk_restore_afe()
4431 rtl_write_dword(rtlpriv, 0xc80, 0x0); in _rtl8821ae_iqk_restore_afe()
4432 rtl_write_dword(rtlpriv, 0xc84, 0x0); in _rtl8821ae_iqk_restore_afe()
4433 rtl_write_dword(rtlpriv, 0xc88, 0x0); in _rtl8821ae_iqk_restore_afe()
4434 rtl_write_dword(rtlpriv, 0xc8c, 0x3c000000); in _rtl8821ae_iqk_restore_afe()
4435 rtl_write_dword(rtlpriv, 0xc90, 0x00000080); in _rtl8821ae_iqk_restore_afe()
4436 rtl_write_dword(rtlpriv, 0xc94, 0x00000000); in _rtl8821ae_iqk_restore_afe()
4437 rtl_write_dword(rtlpriv, 0xcc4, 0x20040000); in _rtl8821ae_iqk_restore_afe()
4438 rtl_write_dword(rtlpriv, 0xcc8, 0x20000000); in _rtl8821ae_iqk_restore_afe()
4439 rtl_write_dword(rtlpriv, 0xcb8, 0x0); in _rtl8821ae_iqk_restore_afe()
4451 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /* [31] = 0 --> Page C */ in _rtl8821ae_iqk_restore_macbb()
4453 for (i = 0; i < macbb_num; i++) in _rtl8821ae_iqk_restore_macbb()
4473 0xb00, 0x520, 0x550, 0x808, 0x90c, 0xc00, 0xc50, in _rtl8821ae_phy_iq_calibrate()
4474 0xe00, 0xe50, 0x838, 0x82c in _rtl8821ae_phy_iq_calibrate()
4477 0xc5c, 0xc60, 0xc64, 0xc68, 0xc6c, 0xc70, 0xc74, in _rtl8821ae_phy_iq_calibrate()
4478 0xc78, 0xc7c, 0xc80, 0xc84, 0xcb8 in _rtl8821ae_phy_iq_calibrate()
4480 u32 backup_rf_reg[RF_REG_NUM] = {0x65, 0x8f, 0x0}; in _rtl8821ae_phy_iq_calibrate()
4506 rtl_set_bbreg(hw, RA_RFE_PINMUX + 4, BIT(29) | BIT(28), 0x1); in _rtl8821ae_phy_set_rfpath_switch()
4508 rtl_set_bbreg(hw, RA_RFE_PINMUX + 4, BIT(29) | BIT(28), 0x2); in _rtl8821ae_phy_set_rfpath_switch()
4557 for (i = 0; i < IQK_MATRIX_SETTINGS_NUM; i++) { in rtl8821ae_reset_iqk_result()
4558 rtlphy->iqk_matrix[i].value[0][0] = 0x100; in rtl8821ae_reset_iqk_result()
4559 rtlphy->iqk_matrix[i].value[0][2] = 0x100; in rtl8821ae_reset_iqk_result()
4560 rtlphy->iqk_matrix[i].value[0][4] = 0x100; in rtl8821ae_reset_iqk_result()
4561 rtlphy->iqk_matrix[i].value[0][6] = 0x100; in rtl8821ae_reset_iqk_result()
4563 rtlphy->iqk_matrix[i].value[0][1] = 0x0; in rtl8821ae_reset_iqk_result()
4564 rtlphy->iqk_matrix[i].value[0][3] = 0x0; in rtl8821ae_reset_iqk_result()
4565 rtlphy->iqk_matrix[i].value[0][5] = 0x0; in rtl8821ae_reset_iqk_result()
4566 rtlphy->iqk_matrix[i].value[0][7] = 0x0; in rtl8821ae_reset_iqk_result()
4656 rtl8821ae_dm_write_dig(hw, 0x17); in rtl8821ae_phy_set_io()
4658 rtl8821ae_dm_write_cck_cca_thres(hw, 0x40); in rtl8821ae_phy_set_io()
4676 rtl_write_byte(rtlpriv, REG_SPS0_CTRL, 0x2b); in rtl8821ae_phy_set_rf_on()
4677 rtl_write_byte(rtlpriv, REG_SYS_FUNC_EN, 0xE3); in rtl8821ae_phy_set_rf_on()
4678 rtl_write_byte(rtlpriv, REG_SYS_FUNC_EN, 0xE2); in rtl8821ae_phy_set_rf_on()
4679 rtl_write_byte(rtlpriv, REG_SYS_FUNC_EN, 0xE3); in rtl8821ae_phy_set_rf_on()
4680 rtl_write_byte(rtlpriv, REG_TXPAUSE, 0x00); in rtl8821ae_phy_set_rf_on()
4699 u32 initializecount = 0; in _rtl8821ae_phy_set_rf_power_state()
4726 for (queue_id = 0, i = 0; in _rtl8821ae_phy_set_rf_power_state()
4730 skb_queue_len(&ring->queue) == 0) { in _rtl8821ae_phy_set_rf_power_state()