Lines Matching +full:0 +full:x03c00000

23 	} while (0)
33 return 0; in _rtl8821ae_phy_calculate_bit_shift()
60 rtl_set_bbreg(hw, RRFMOD, 0xC00, 0x3); in rtl8812ae_fixspur()
61 /* 0x8AC[11:10] = 2'b11*/ in rtl8812ae_fixspur()
63 rtl_set_bbreg(hw, RRFMOD, 0xC00, 0x2); in rtl8812ae_fixspur()
64 /* 0x8AC[11:10] = 2'b10*/ in rtl8812ae_fixspur()
71 rtl_set_bbreg(hw, RRFMOD, 0x300, 0x3); in rtl8812ae_fixspur()
72 /*0x8AC[9:8] = 2'b11*/ in rtl8812ae_fixspur()
74 /* 0x8C4[30] = 1*/ in rtl8812ae_fixspur()
78 /*0x8C4[30] = 1*/ in rtl8812ae_fixspur()
80 rtl_set_bbreg(hw, RRFMOD, 0x300, 0x2); in rtl8812ae_fixspur()
81 /*0x8AC[9:8] = 2'b10*/ in rtl8812ae_fixspur()
82 rtl_set_bbreg(hw, RADC_BUF_CLK, BIT(30), 0); in rtl8812ae_fixspur()
83 /*0x8C4[30] = 0*/ in rtl8812ae_fixspur()
91 rtl_set_bbreg(hw, RRFMOD, 0x300, 0x3); in rtl8812ae_fixspur()
92 /*0x8AC[9:8] = 11*/ in rtl8812ae_fixspur()
94 rtl_set_bbreg(hw, RRFMOD, 0x300, 0x2); in rtl8812ae_fixspur()
95 /*0x8AC[9:8] = 10*/ in rtl8812ae_fixspur()
113 "BBR MASK=0x%x Addr[0x%x]=0x%x\n", in rtl8821ae_phy_query_bb_reg()
202 u32 retvalue = 0; in _rtl8821ae_phy_rf_serial_read()
208 return 0xFFFFFFFF; in _rtl8821ae_phy_rf_serial_read()
212 <20120828, Kordan> Toggling CCA would affect RF 0x0, skip it!*/ in _rtl8821ae_phy_rf_serial_read()
213 if (offset != 0x0 && in _rtl8821ae_phy_rf_serial_read()
216 rtl_set_bbreg(hw, RCCAONSEC, 0x8, 1); in _rtl8821ae_phy_rf_serial_read()
217 offset &= 0xff; in _rtl8821ae_phy_rf_serial_read()
220 is_pi_mode = (bool)rtl_get_bbreg(hw, 0xC00, 0x4); in _rtl8821ae_phy_rf_serial_read()
222 is_pi_mode = (bool)rtl_get_bbreg(hw, 0xE00, 0x4); in _rtl8821ae_phy_rf_serial_read()
224 rtl_set_bbreg(hw, RHSSIREAD_8821AE, 0xff, offset); in _rtl8821ae_phy_rf_serial_read()
248 * <20120828, Kordan> Toggling CCA would affect RF 0x0, skip it! in _rtl8821ae_phy_rf_serial_read()
250 if (offset != 0x0 && in _rtl8821ae_phy_rf_serial_read()
253 rtl_set_bbreg(hw, RCCAONSEC, 0x8, 0); in _rtl8821ae_phy_rf_serial_read()
271 offset &= 0xff; in _rtl8821ae_phy_rf_serial_write()
274 (data & 0x000fffff)) & 0x0fffffff; in _rtl8821ae_phy_rf_serial_write()
277 "RFW-%d Addr[0x%x]=0x%x\n", in _rtl8821ae_phy_rf_serial_write()
283 bool rtstatus = 0; in rtl8821ae_phy_mac_config()
308 rtl_write_byte(rtlpriv, REG_RF_CTRL, 0x7); in rtl8821ae_phy_bb_config()
309 rtl_write_byte(rtlpriv, REG_OPT_CTRL + 2, 0x7); in rtl8821ae_phy_bb_config()
314 crystal_cap = rtlefuse->crystalcap & 0x3F; in rtl8821ae_phy_bb_config()
315 rtl_set_bbreg(hw, REG_MAC_PHY_CTRL, 0x7FF80000, in rtl8821ae_phy_bb_config()
318 crystal_cap = rtlefuse->crystalcap & 0x3F; in rtl8821ae_phy_bb_config()
319 rtl_set_bbreg(hw, REG_MAC_PHY_CTRL, 0xFFF000, in rtl8821ae_phy_bb_config()
322 rtlphy->reg_837 = rtl_read_byte(rtlpriv, 0x837); in rtl8821ae_phy_bb_config()
340 rtl_set_bbreg(hw, RA_RFE_PINMUX, BMASKDWORD, 0x54337770); in _rtl8812ae_phy_set_rfe_reg_24g()
341 rtl_set_bbreg(hw, RB_RFE_PINMUX, BMASKDWORD, 0x54337770); in _rtl8812ae_phy_set_rfe_reg_24g()
342 rtl_set_bbreg(hw, RA_RFE_INV, BMASKRFEINV, 0x010); in _rtl8812ae_phy_set_rfe_reg_24g()
343 rtl_set_bbreg(hw, RB_RFE_INV, BMASKRFEINV, 0x010); in _rtl8812ae_phy_set_rfe_reg_24g()
344 rtl_set_bbreg(hw, 0x900, 0x00000303, 0x1); in _rtl8812ae_phy_set_rfe_reg_24g()
347 rtl_set_bbreg(hw, RA_RFE_PINMUX, BMASKDWORD, 0x77777777); in _rtl8812ae_phy_set_rfe_reg_24g()
348 rtl_set_bbreg(hw, RB_RFE_PINMUX, BMASKDWORD, 0x77777777); in _rtl8812ae_phy_set_rfe_reg_24g()
349 rtl_set_bbreg(hw, RA_RFE_INV, BMASKRFEINV, 0x001); in _rtl8812ae_phy_set_rfe_reg_24g()
350 rtl_set_bbreg(hw, RB_RFE_INV, BMASKRFEINV, 0x001); in _rtl8812ae_phy_set_rfe_reg_24g()
353 rtl_write_byte(rtlpriv, RA_RFE_PINMUX + 2, 0x77); in _rtl8812ae_phy_set_rfe_reg_24g()
354 rtl_set_bbreg(hw, RB_RFE_PINMUX, BMASKDWORD, 0x77777777); in _rtl8812ae_phy_set_rfe_reg_24g()
356 rtl_write_byte(rtlpriv, RA_RFE_INV + 3, tmp & ~0x1); in _rtl8812ae_phy_set_rfe_reg_24g()
357 rtl_set_bbreg(hw, RB_RFE_INV, BMASKRFEINV, 0x000); in _rtl8812ae_phy_set_rfe_reg_24g()
361 rtl_set_bbreg(hw, RA_RFE_PINMUX, 0xffffff, 0x777777); in _rtl8812ae_phy_set_rfe_reg_24g()
363 0x77777777); in _rtl8812ae_phy_set_rfe_reg_24g()
364 rtl_set_bbreg(hw, RA_RFE_INV, 0x33f00000, 0x000); in _rtl8812ae_phy_set_rfe_reg_24g()
365 rtl_set_bbreg(hw, RB_RFE_INV, BMASKRFEINV, 0x000); in _rtl8812ae_phy_set_rfe_reg_24g()
369 case 0: in _rtl8812ae_phy_set_rfe_reg_24g()
372 rtl_set_bbreg(hw, RA_RFE_PINMUX, BMASKDWORD, 0x77777777); in _rtl8812ae_phy_set_rfe_reg_24g()
373 rtl_set_bbreg(hw, RB_RFE_PINMUX, BMASKDWORD, 0x77777777); in _rtl8812ae_phy_set_rfe_reg_24g()
374 rtl_set_bbreg(hw, RA_RFE_INV, BMASKRFEINV, 0x000); in _rtl8812ae_phy_set_rfe_reg_24g()
375 rtl_set_bbreg(hw, RB_RFE_INV, BMASKRFEINV, 0x000); in _rtl8812ae_phy_set_rfe_reg_24g()
387 case 0: in _rtl8812ae_phy_set_rfe_reg_5g()
388 rtl_set_bbreg(hw, RA_RFE_PINMUX, BMASKDWORD, 0x77337717); in _rtl8812ae_phy_set_rfe_reg_5g()
389 rtl_set_bbreg(hw, RB_RFE_PINMUX, BMASKDWORD, 0x77337717); in _rtl8812ae_phy_set_rfe_reg_5g()
390 rtl_set_bbreg(hw, RA_RFE_INV, BMASKRFEINV, 0x010); in _rtl8812ae_phy_set_rfe_reg_5g()
391 rtl_set_bbreg(hw, RB_RFE_INV, BMASKRFEINV, 0x010); in _rtl8812ae_phy_set_rfe_reg_5g()
395 rtl_set_bbreg(hw, RA_RFE_PINMUX, 0xffffff, 0x337717); in _rtl8812ae_phy_set_rfe_reg_5g()
397 0x77337717); in _rtl8812ae_phy_set_rfe_reg_5g()
398 rtl_set_bbreg(hw, RA_RFE_INV, 0x33f00000, 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()
402 0x77337717); in _rtl8812ae_phy_set_rfe_reg_5g()
404 0x77337717); in _rtl8812ae_phy_set_rfe_reg_5g()
405 rtl_set_bbreg(hw, RA_RFE_INV, BMASKRFEINV, 0x000); in _rtl8812ae_phy_set_rfe_reg_5g()
406 rtl_set_bbreg(hw, RB_RFE_INV, BMASKRFEINV, 0x000); in _rtl8812ae_phy_set_rfe_reg_5g()
410 rtl_set_bbreg(hw, RA_RFE_PINMUX, BMASKDWORD, 0x54337717); in _rtl8812ae_phy_set_rfe_reg_5g()
411 rtl_set_bbreg(hw, RB_RFE_PINMUX, BMASKDWORD, 0x54337717); in _rtl8812ae_phy_set_rfe_reg_5g()
412 rtl_set_bbreg(hw, RA_RFE_INV, BMASKRFEINV, 0x010); in _rtl8812ae_phy_set_rfe_reg_5g()
413 rtl_set_bbreg(hw, RB_RFE_INV, BMASKRFEINV, 0x010); in _rtl8812ae_phy_set_rfe_reg_5g()
414 rtl_set_bbreg(hw, 0x900, 0x00000303, 0x1); in _rtl8812ae_phy_set_rfe_reg_5g()
417 rtl_write_byte(rtlpriv, RA_RFE_PINMUX + 2, 0x33); in _rtl8812ae_phy_set_rfe_reg_5g()
418 rtl_set_bbreg(hw, RB_RFE_PINMUX, BMASKDWORD, 0x77337777); in _rtl8812ae_phy_set_rfe_reg_5g()
420 rtl_write_byte(rtlpriv, RA_RFE_INV + 3, tmp | 0x1); in _rtl8812ae_phy_set_rfe_reg_5g()
421 rtl_set_bbreg(hw, RB_RFE_INV, BMASKRFEINV, 0x010); in _rtl8812ae_phy_set_rfe_reg_5g()
426 rtl_set_bbreg(hw, RA_RFE_PINMUX, BMASKDWORD, 0x77337777); in _rtl8812ae_phy_set_rfe_reg_5g()
427 rtl_set_bbreg(hw, RB_RFE_PINMUX, BMASKDWORD, 0x77337777); in _rtl8812ae_phy_set_rfe_reg_5g()
428 rtl_set_bbreg(hw, RA_RFE_INV, BMASKRFEINV, 0x010); in _rtl8812ae_phy_set_rfe_reg_5g()
429 rtl_set_bbreg(hw, RB_RFE_INV, BMASKRFEINV, 0x010); in _rtl8812ae_phy_set_rfe_reg_5g()
441 s8 reg_swing_2g = -1;/* 0xff; */ in phy_get_tx_swing_8812A()
442 s8 reg_swing_5g = -1;/* 0xff; */ in phy_get_tx_swing_8812A()
445 u32 out = 0x200; in phy_get_tx_swing_8812A()
456 if (swing_2g == 0) { in phy_get_tx_swing_8812A()
457 out = 0x200; /* 0 dB */ in phy_get_tx_swing_8812A()
459 out = 0x16A; /* -3 dB */ in phy_get_tx_swing_8812A()
461 out = 0x101; /* -6 dB */ in phy_get_tx_swing_8812A()
463 out = 0x0B6; /* -9 dB */ in phy_get_tx_swing_8812A()
465 rtldm->swing_diff_2g = 0; in phy_get_tx_swing_8812A()
466 out = 0x200; in phy_get_tx_swing_8812A()
470 if (swing_5g == 0) { in phy_get_tx_swing_8812A()
471 out = 0x200; /* 0 dB */ in phy_get_tx_swing_8812A()
473 out = 0x16A; /* -3 dB */ in phy_get_tx_swing_8812A()
475 out = 0x101; /* -6 dB */ in phy_get_tx_swing_8812A()
477 out = 0x0B6; /* -9 dB */ in phy_get_tx_swing_8812A()
481 out = 0x16A; in phy_get_tx_swing_8812A()
483 rtldm->swing_diff_5g = 0; in phy_get_tx_swing_8812A()
484 out = 0x200; in phy_get_tx_swing_8812A()
490 out = 0x16A; /* -3 dB */ in phy_get_tx_swing_8812A()
493 u32 swing = 0, swing_a = 0, swing_b = 0; in phy_get_tx_swing_8812A()
497 efuse_shadow_read(hw, 1, 0xC6, (u32 *)&swing); in phy_get_tx_swing_8812A()
498 swing = (swing == 0xFF) ? 0x00 : swing; in phy_get_tx_swing_8812A()
499 } else if (swing_2g == 0) { in phy_get_tx_swing_8812A()
500 swing = 0x00; /* 0 dB */ in phy_get_tx_swing_8812A()
502 swing = 0x05; /* -3 dB */ in phy_get_tx_swing_8812A()
504 swing = 0x0A; /* -6 dB */ in phy_get_tx_swing_8812A()
506 swing = 0xFF; /* -9 dB */ in phy_get_tx_swing_8812A()
508 swing = 0x00; in phy_get_tx_swing_8812A()
512 efuse_shadow_read(hw, 1, 0xC7, (u32 *)&swing); in phy_get_tx_swing_8812A()
513 swing = (swing == 0xFF) ? 0x00 : swing; in phy_get_tx_swing_8812A()
514 } else if (swing_5g == 0) { in phy_get_tx_swing_8812A()
515 swing = 0x00; /* 0 dB */ in phy_get_tx_swing_8812A()
517 swing = 0x05; /* -3 dB */ in phy_get_tx_swing_8812A()
519 swing = 0x0A; /* -6 dB */ in phy_get_tx_swing_8812A()
521 swing = 0xFF; /* -9 dB */ in phy_get_tx_swing_8812A()
523 swing = 0x00; in phy_get_tx_swing_8812A()
527 swing_a = (swing & 0x3) >> 0; /* 0xC6/C7[1:0] */ in phy_get_tx_swing_8812A()
528 swing_b = (swing & 0xC) >> 2; /* 0xC6/C7[3:2] */ in phy_get_tx_swing_8812A()
530 "===> PHY_GetTXBBSwing_8812A, swingA: 0x%X, swingB: 0x%X\n", in phy_get_tx_swing_8812A()
534 if (swing_a == 0x0) { in phy_get_tx_swing_8812A()
536 rtldm->swing_diff_2g = 0; in phy_get_tx_swing_8812A()
538 rtldm->swing_diff_5g = 0; in phy_get_tx_swing_8812A()
539 out = 0x200; /* 0 dB */ in phy_get_tx_swing_8812A()
540 } else if (swing_a == 0x1) { in phy_get_tx_swing_8812A()
545 out = 0x16A; /* -3 dB */ in phy_get_tx_swing_8812A()
546 } else if (swing_a == 0x2) { in phy_get_tx_swing_8812A()
551 out = 0x101; /* -6 dB */ in phy_get_tx_swing_8812A()
552 } else if (swing_a == 0x3) { in phy_get_tx_swing_8812A()
557 out = 0x0B6; /* -9 dB */ in phy_get_tx_swing_8812A()
560 if (swing_b == 0x0) { in phy_get_tx_swing_8812A()
562 rtldm->swing_diff_2g = 0; in phy_get_tx_swing_8812A()
564 rtldm->swing_diff_5g = 0; in phy_get_tx_swing_8812A()
565 out = 0x200; /* 0 dB */ in phy_get_tx_swing_8812A()
566 } else if (swing_b == 0x1) { in phy_get_tx_swing_8812A()
571 out = 0x16A; /* -3 dB */ in phy_get_tx_swing_8812A()
572 } else if (swing_b == 0x2) { in phy_get_tx_swing_8812A()
577 out = 0x101; /* -6 dB */ in phy_get_tx_swing_8812A()
578 } else if (swing_b == 0x3) { in phy_get_tx_swing_8812A()
583 out = 0x0B6; /* -9 dB */ in phy_get_tx_swing_8812A()
588 "<=== PHY_GetTXBBSwing_8812A, out = 0x%X\n", out); in phy_get_tx_swing_8812A()
600 rtl8821ae_phy_query_bb_reg(hw, RTXPATH, 0xf0); in rtl8821ae_phy_switch_wirelessband()
601 rtl8821ae_phy_query_bb_reg(hw, RCCK_RX, 0x0f000000); in rtl8821ae_phy_switch_wirelessband()
606 rtl_set_bbreg(hw, ROFDMCCKEN, BOFDMEN|BCCKEN, 0x03); in rtl8821ae_phy_switch_wirelessband()
609 /* 0xCB0[15:12] = 0x7 (LNA_On)*/ in rtl8821ae_phy_switch_wirelessband()
610 rtl_set_bbreg(hw, RA_RFE_PINMUX, 0xF000, 0x7); in rtl8821ae_phy_switch_wirelessband()
611 /* 0xCB0[7:4] = 0x7 (PAPE_A)*/ in rtl8821ae_phy_switch_wirelessband()
612 rtl_set_bbreg(hw, RA_RFE_PINMUX, 0xF0, 0x7); in rtl8821ae_phy_switch_wirelessband()
616 /*0x834[1:0] = 0x1*/ in rtl8821ae_phy_switch_wirelessband()
617 rtl_set_bbreg(hw, 0x834, 0x3, 0x1); in rtl8821ae_phy_switch_wirelessband()
621 /* 0xC1C[11:8] = 0 */ in rtl8821ae_phy_switch_wirelessband()
622 rtl_set_bbreg(hw, RA_TXSCALE, 0xF00, 0); in rtl8821ae_phy_switch_wirelessband()
624 /* 0x82C[1:0] = 2b'00 */ in rtl8821ae_phy_switch_wirelessband()
625 rtl_set_bbreg(hw, 0x82c, 0x3, 0); in rtl8821ae_phy_switch_wirelessband()
631 rtl_set_bbreg(hw, RTXPATH, 0xf0, 0x1); in rtl8821ae_phy_switch_wirelessband()
632 rtl_set_bbreg(hw, RCCK_RX, 0x0f000000, 0x1); in rtl8821ae_phy_switch_wirelessband()
634 rtl_write_byte(rtlpriv, REG_CCK_CHECK, 0x0); in rtl8821ae_phy_switch_wirelessband()
639 /*0xCB0[15:12] = 0x5 (LNA_On)*/ in rtl8821ae_phy_switch_wirelessband()
640 rtl_set_bbreg(hw, RA_RFE_PINMUX, 0xF000, 0x5); in rtl8821ae_phy_switch_wirelessband()
641 /*0xCB0[7:4] = 0x4 (PAPE_A)*/ in rtl8821ae_phy_switch_wirelessband()
642 rtl_set_bbreg(hw, RA_RFE_PINMUX, 0xF0, 0x4); in rtl8821ae_phy_switch_wirelessband()
645 rtl_write_byte(rtlpriv, REG_CCK_CHECK, 0x80); in rtl8821ae_phy_switch_wirelessband()
647 count = 0; in rtl8821ae_phy_switch_wirelessband()
651 reg_41a &= 0x30; in rtl8821ae_phy_switch_wirelessband()
652 while ((reg_41a != 0x30) && (count < 50)) { in rtl8821ae_phy_switch_wirelessband()
657 reg_41a &= 0x30; in rtl8821ae_phy_switch_wirelessband()
662 if (count != 0) in rtl8821ae_phy_switch_wirelessband()
664 "PHY_SwitchWirelessBand8812(): Switch to 5G Band. Count = %d reg41A=0x%x\n", in rtl8821ae_phy_switch_wirelessband()
669 rtl_set_bbreg(hw, ROFDMCCKEN, BOFDMEN|BCCKEN, 0x03); in rtl8821ae_phy_switch_wirelessband()
672 /*0x834[1:0] = 0x2*/ in rtl8821ae_phy_switch_wirelessband()
673 rtl_set_bbreg(hw, 0x834, 0x3, 0x2); in rtl8821ae_phy_switch_wirelessband()
678 /* 0xC1C[11:8] = 1*/ in rtl8821ae_phy_switch_wirelessband()
679 rtl_set_bbreg(hw, RA_TXSCALE, 0xF00, 1); in rtl8821ae_phy_switch_wirelessband()
681 /* 0x82C[1:0] = 2'b00 */ in rtl8821ae_phy_switch_wirelessband()
682 rtl_set_bbreg(hw, 0x82c, 0x3, 1); in rtl8821ae_phy_switch_wirelessband()
687 rtl_set_bbreg(hw, RTXPATH, 0xf0, 0); in rtl8821ae_phy_switch_wirelessband()
688 rtl_set_bbreg(hw, RCCK_RX, 0x0f000000, 0xf); in rtl8821ae_phy_switch_wirelessband()
691 "==>PHY_SwitchWirelessBand8812() BAND_ON_5G settings OFDM index 0x%x\n", in rtl8821ae_phy_switch_wirelessband()
697 /* 0xC1C[31:21] */ in rtl8821ae_phy_switch_wirelessband()
698 rtl_set_bbreg(hw, RA_TXSCALE, 0xFFE00000, in rtl8821ae_phy_switch_wirelessband()
700 /* 0xE1C[31:21] */ in rtl8821ae_phy_switch_wirelessband()
701 rtl_set_bbreg(hw, RB_TXSCALE, 0xFFE00000, in rtl8821ae_phy_switch_wirelessband()
732 u32 intf = (rtlhal->interface == INTF_USB ? BIT(1) : BIT(0)); in _rtl8821ae_check_positive()
734 u8 board_type = ((rtlhal->board_type & BIT(4)) >> 4) << 0 | /* _GLNA */ in _rtl8821ae_check_positive()
742 0 << 20 | /* interface 2/2 */ in _rtl8821ae_check_positive()
743 0x04 << 16 | /* platform */ in _rtl8821ae_check_positive()
748 u32 driver2 = rtlhal->type_glna << 0 | in _rtl8821ae_check_positive()
754 "===> [8812A] CheckPositive (cond1, cond2) = (0x%X 0x%X)\n", in _rtl8821ae_check_positive()
757 "===> [8812A] CheckPositive (driver1, driver2) = (0x%X 0x%X)\n", in _rtl8821ae_check_positive()
761 " (Platform, Interface) = (0x%X, 0x%X)\n", 0x04, intf); in _rtl8821ae_check_positive()
763 " (Board, Package) = (0x%X, 0x%X)\n", in _rtl8821ae_check_positive()
769 if (((cond1 & 0x0000F000) != 0) && ((cond1 & 0x0000F000) != in _rtl8821ae_check_positive()
770 (driver1 & 0x0000F000))) in _rtl8821ae_check_positive()
772 if (((cond1 & 0x0F000000) != 0) && ((cond1 & 0x0F000000) != in _rtl8821ae_check_positive()
773 (driver1 & 0x0F000000))) in _rtl8821ae_check_positive()
779 cond1 &= 0x00FF0FFF; in _rtl8821ae_check_positive()
780 driver1 &= 0x00FF0FFF; in _rtl8821ae_check_positive()
783 u32 mask = 0; in _rtl8821ae_check_positive()
785 if ((cond1 & 0x0F) == 0) /* BoardType is DONTCARE*/ in _rtl8821ae_check_positive()
788 if ((cond1 & BIT(0)) != 0) /*GLNA*/ in _rtl8821ae_check_positive()
789 mask |= 0x000000FF; in _rtl8821ae_check_positive()
790 if ((cond1 & BIT(1)) != 0) /*GPA*/ in _rtl8821ae_check_positive()
791 mask |= 0x0000FF00; in _rtl8821ae_check_positive()
792 if ((cond1 & BIT(2)) != 0) /*ALNA*/ in _rtl8821ae_check_positive()
793 mask |= 0x00FF0000; in _rtl8821ae_check_positive()
794 if ((cond1 & BIT(3)) != 0) /*APA*/ in _rtl8821ae_check_positive()
795 mask |= 0xFF000000; in _rtl8821ae_check_positive()
811 u32 _interface = 0x01; /* ODM_ITRF_PCIE */ in _rtl8821ae_check_condition()
812 u32 _platform = 0x08;/* ODM_WIN */ in _rtl8821ae_check_condition()
815 if (condition == 0xCDCDCDCD) in _rtl8821ae_check_condition()
818 cond = condition & 0xFF; in _rtl8821ae_check_condition()
819 if ((_board != cond) && cond != 0xFF) in _rtl8821ae_check_condition()
822 cond = condition & 0xFF00; in _rtl8821ae_check_condition()
824 if ((_interface & cond) == 0 && cond != 0x07) in _rtl8821ae_check_condition()
827 cond = condition & 0xFF0000; in _rtl8821ae_check_condition()
829 if ((_platform & cond) == 0 && cond != 0x0F) in _rtl8821ae_check_condition()
838 if (addr == 0xfe || addr == 0xffe) { in _rtl8821ae_config_rf_reg()
852 u32 content = 0x1000; /*RF Content: radio_a_txt*/ in _rtl8821ae_config_rf_radio_a()
853 u32 maskforphyset = (u32)(content & 0xE000); in _rtl8821ae_config_rf_radio_a()
862 u32 content = 0x1001; /*RF Content: radio_b_txt*/ in _rtl8821ae_config_rf_radio_b()
863 u32 maskforphyset = (u32)(content & 0xE000); in _rtl8821ae_config_rf_radio_b()
872 if (addr == 0xfe) in _rtl8821ae_config_bb_reg()
874 else if (addr == 0xfd) in _rtl8821ae_config_bb_reg()
876 else if (addr == 0xfc) in _rtl8821ae_config_bb_reg()
878 else if (addr == 0xfb) in _rtl8821ae_config_bb_reg()
880 else if (addr == 0xfa) in _rtl8821ae_config_bb_reg()
882 else if (addr == 0xf9) in _rtl8821ae_config_bb_reg()
897 for (rfpath = 0; rfpath < TX_PWR_BY_RATE_NUM_RF; ++rfpath) in _rtl8821ae_phy_init_tx_power_by_rate()
898 for (txnum = 0; txnum < TX_PWR_BY_RATE_NUM_RF; ++txnum) in _rtl8821ae_phy_init_tx_power_by_rate()
899 for (rate_section = 0; in _rtl8821ae_phy_init_tx_power_by_rate()
903 [rfpath][txnum][rate_section] = 0; in _rtl8821ae_phy_init_tx_power_by_rate()
923 rtlphy->txpwr_by_rate_base_24g[path][txnum][0] = value; in _rtl8821ae_phy_set_txpower_by_rate_base()
949 rtlphy->txpwr_by_rate_base_5g[path][txnum][0] = value; in _rtl8821ae_phy_set_txpower_by_rate_base()
981 u8 value = 0; in _rtl8821ae_phy_get_txpower_by_rate_base()
987 return 0; in _rtl8821ae_phy_get_txpower_by_rate_base()
993 value = rtlphy->txpwr_by_rate_base_24g[path][txnum][0]; in _rtl8821ae_phy_get_txpower_by_rate_base()
1019 value = rtlphy->txpwr_by_rate_base_5g[path][txnum][0]; in _rtl8821ae_phy_get_txpower_by_rate_base()
1051 u16 rawvalue = 0; in _rtl8821ae_phy_store_txpower_by_rate_base()
1052 u8 base = 0, path = 0; in _rtl8821ae_phy_store_txpower_by_rate_base()
1055 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()
1056 base = (rawvalue >> 4) * 10 + (rawvalue & 0xF); in _rtl8821ae_phy_store_txpower_by_rate_base()
1059 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()
1060 base = (rawvalue >> 4) * 10 + (rawvalue & 0xF); in _rtl8821ae_phy_store_txpower_by_rate_base()
1063 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()
1064 base = (rawvalue >> 4) * 10 + (rawvalue & 0xF); in _rtl8821ae_phy_store_txpower_by_rate_base()
1067 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()
1068 base = (rawvalue >> 4) * 10 + (rawvalue & 0xF); in _rtl8821ae_phy_store_txpower_by_rate_base()
1071 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()
1072 base = (rawvalue >> 4) * 10 + (rawvalue & 0xF); in _rtl8821ae_phy_store_txpower_by_rate_base()
1075 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()
1076 base = (rawvalue >> 4) * 10 + (rawvalue & 0xF); in _rtl8821ae_phy_store_txpower_by_rate_base()
1079 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()
1080 base = (rawvalue >> 4) * 10 + (rawvalue & 0xF); in _rtl8821ae_phy_store_txpower_by_rate_base()
1083 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()
1084 base = (rawvalue >> 4) * 10 + (rawvalue & 0xF); in _rtl8821ae_phy_store_txpower_by_rate_base()
1087 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()
1088 base = (rawvalue >> 4) * 10 + (rawvalue & 0xF); in _rtl8821ae_phy_store_txpower_by_rate_base()
1091 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()
1092 base = (rawvalue >> 4) * 10 + (rawvalue & 0xF); in _rtl8821ae_phy_store_txpower_by_rate_base()
1095 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()
1096 base = (rawvalue >> 4) * 10 + (rawvalue & 0xF); in _rtl8821ae_phy_store_txpower_by_rate_base()
1105 u8 temp_value = 0; in _phy_convert_txpower_dbm_to_relative_value()
1106 u32 temp_data = 0; in _phy_convert_txpower_dbm_to_relative_value()
1108 for (i = 3; i >= 0; --i) { in _phy_convert_txpower_dbm_to_relative_value()
1111 temp_value = (u8)(*data >> (i * 8)) & 0xF; in _phy_convert_txpower_dbm_to_relative_value()
1112 temp_value += ((u8)((*data >> (i * 8 + 4)) & 0xF)) * 10; in _phy_convert_txpower_dbm_to_relative_value()
1118 temp_value = (u8)(*data >> (i * 8)) & 0xFF; in _phy_convert_txpower_dbm_to_relative_value()
1131 s8 temp_pwrlmt = 0; in _rtl8812ae_phy_cross_reference_ht_and_vht_txpower_limit()
1133 for (regulation = 0; regulation < MAX_REGULATION_NUM; ++regulation) { in _rtl8812ae_phy_cross_reference_ht_and_vht_txpower_limit()
1134 for (bw = 0; bw < MAX_5G_BANDWIDTH_NUM; ++bw) { in _rtl8812ae_phy_cross_reference_ht_and_vht_txpower_limit()
1135 for (channel = 0; channel < CHANNEL_MAX_NUMBER_5G; ++channel) { in _rtl8812ae_phy_cross_reference_ht_and_vht_txpower_limit()
1136 for (rate_section = 0; rate_section < MAX_RATE_SECTION_NUM; ++rate_section) { in _rtl8812ae_phy_cross_reference_ht_and_vht_txpower_limit()
1140 if (bw == 0 || bw == 1) { /*5G 20M 40M VHT and HT can cross reference*/ in _rtl8812ae_phy_cross_reference_ht_and_vht_txpower_limit()
1173 u8 index = 0; in _rtl8812ae_phy_get_txpower_by_rate_base_index()
1180 index = 0; in _rtl8812ae_phy_get_txpower_by_rate_base_index()
1218 "Wrong rate 0x%x to obtain index in 2.4G in PHY_GetTxPowerByRateBaseIndex()\n", in _rtl8812ae_phy_get_txpower_by_rate_base_index()
1232 index = 0; in _rtl8812ae_phy_get_txpower_by_rate_base_index()
1285 "Wrong rate 0x%x to obtain index in 5G in PHY_GetTxPowerByRateBaseIndex()\n", in _rtl8812ae_phy_get_txpower_by_rate_base_index()
1300 u8 base_index2_4G = 0; in _rtl8812ae_phy_convert_txpower_limit_to_power_index()
1301 u8 base_index5G = 0; in _rtl8812ae_phy_convert_txpower_limit_to_power_index()
1302 s8 temp_value = 0, temp_pwrlmt = 0; in _rtl8812ae_phy_convert_txpower_limit_to_power_index()
1303 u8 rf_path = 0; in _rtl8812ae_phy_convert_txpower_limit_to_power_index()
1310 for (regulation = 0; regulation < MAX_REGULATION_NUM; ++regulation) { in _rtl8812ae_phy_convert_txpower_limit_to_power_index()
1311 for (bw = 0; bw < MAX_2_4G_BANDWIDTH_NUM; ++bw) { in _rtl8812ae_phy_convert_txpower_limit_to_power_index()
1312 for (channel = 0; channel < CHANNEL_MAX_NUMBER_2G; ++channel) { in _rtl8812ae_phy_convert_txpower_limit_to_power_index()
1313 for (rate_section = 0; rate_section < MAX_RATE_SECTION_NUM; ++rate_section) { in _rtl8812ae_phy_convert_txpower_limit_to_power_index()
1316 if (rate_section == 0) { /*CCK*/ in _rtl8812ae_phy_convert_txpower_limit_to_power_index()
1359 ? 0 : temp_pwrlmt/2, channel, rf_path, in _rtl8812ae_phy_convert_txpower_limit_to_power_index()
1366 for (regulation = 0; regulation < MAX_REGULATION_NUM; ++regulation) { in _rtl8812ae_phy_convert_txpower_limit_to_power_index()
1367 for (bw = 0; bw < MAX_5G_BANDWIDTH_NUM; ++bw) { in _rtl8812ae_phy_convert_txpower_limit_to_power_index()
1368 for (channel = 0; channel < CHANNEL_MAX_NUMBER_5G; ++channel) { in _rtl8812ae_phy_convert_txpower_limit_to_power_index()
1369 for (rate_section = 0; rate_section < MAX_RATE_SECTION_NUM; ++rate_section) { in _rtl8812ae_phy_convert_txpower_limit_to_power_index()
1443 for (i = 0; i < MAX_REGULATION_NUM; ++i) { in _rtl8821ae_phy_init_txpower_limit()
1444 for (j = 0; j < MAX_2_4G_BANDWIDTH_NUM; ++j) in _rtl8821ae_phy_init_txpower_limit()
1445 for (k = 0; k < MAX_RATE_SECTION_NUM; ++k) in _rtl8821ae_phy_init_txpower_limit()
1446 for (m = 0; m < CHANNEL_MAX_NUMBER_2G; ++m) in _rtl8821ae_phy_init_txpower_limit()
1447 for (l = 0; l < MAX_RF_PATH_NUM; ++l) in _rtl8821ae_phy_init_txpower_limit()
1452 for (i = 0; i < MAX_REGULATION_NUM; ++i) { in _rtl8821ae_phy_init_txpower_limit()
1453 for (j = 0; j < MAX_5G_BANDWIDTH_NUM; ++j) in _rtl8821ae_phy_init_txpower_limit()
1454 for (k = 0; k < MAX_RATE_SECTION_NUM; ++k) in _rtl8821ae_phy_init_txpower_limit()
1455 for (m = 0; m < CHANNEL_MAX_NUMBER_5G; ++m) in _rtl8821ae_phy_init_txpower_limit()
1456 for (l = 0; l < MAX_RF_PATH_NUM; ++l) in _rtl8821ae_phy_init_txpower_limit()
1470 u8 base = 0, rfpath = 0; in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1475 &rtlphy->tx_power_by_rate_offset[BAND_ON_2_4G][rfpath][RF_1TX][0], in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1476 0, 3, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1481 0, 3, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1484 0, 3, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1489 0, 3, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1492 0, 3, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1498 0, 3, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1502 0, 3, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1507 0, 3, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1510 0, 3, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1513 0, 1, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1521 0, 3, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1524 0, 3, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1529 0, 3, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1532 0, 3, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1537 0, 3, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1540 0, 3, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1545 0, 3, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1548 0, 3, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1553 0, 3, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1556 0, 3, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1559 0, 1, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1567 0, 3, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1570 0, 3, base); in _rtl8821ae_phy_convert_txpower_dbm_to_relative_value()
1586 u16 i = 0; in _rtl8812ae_get_integer_from_string()
1587 *pint = 0; in _rtl8812ae_get_integer_from_string()
1589 while (str[i] != '\0') { in _rtl8812ae_get_integer_from_string()
1590 if (str[i] >= '0' && str[i] <= '9') { in _rtl8812ae_get_integer_from_string()
1592 *pint += (str[i] - '0'); in _rtl8812ae_get_integer_from_string()
1607 u8 i = 0; in _rtl8812ae_phy_get_chnl_idx_of_txpwr_lmt()
1612 for (i = 0; i < sizeof(channel5g)/sizeof(u8); ++i) { in _rtl8812ae_phy_get_chnl_idx_of_txpwr_lmt()
1636 u8 regulation = 0, bandwidth = 0, rate_section = 0, channel; in _rtl8812ae_phy_set_txpower_limit()
1638 s8 power_limit = 0, prev_power_limit, ret; in _rtl8812ae_phy_set_txpower_limit()
1651 if (strcmp(pregulation, "FCC") == 0) in _rtl8812ae_phy_set_txpower_limit()
1652 regulation = 0; in _rtl8812ae_phy_set_txpower_limit()
1653 else if (strcmp(pregulation, "MKK") == 0) in _rtl8812ae_phy_set_txpower_limit()
1655 else if (strcmp(pregulation, "ETSI") == 0) in _rtl8812ae_phy_set_txpower_limit()
1657 else if (strcmp(pregulation, "WW13") == 0) in _rtl8812ae_phy_set_txpower_limit()
1660 if (strcmp(prate_section, "CCK") == 0) in _rtl8812ae_phy_set_txpower_limit()
1661 rate_section = 0; in _rtl8812ae_phy_set_txpower_limit()
1662 else if (strcmp(prate_section, "OFDM") == 0) in _rtl8812ae_phy_set_txpower_limit()
1664 else if (strcmp(prate_section, "HT") == 0 && in _rtl8812ae_phy_set_txpower_limit()
1665 strcmp(prf_path, "1T") == 0) in _rtl8812ae_phy_set_txpower_limit()
1667 else if (strcmp(prate_section, "HT") == 0 && in _rtl8812ae_phy_set_txpower_limit()
1668 strcmp(prf_path, "2T") == 0) in _rtl8812ae_phy_set_txpower_limit()
1670 else if (strcmp(prate_section, "VHT") == 0 && in _rtl8812ae_phy_set_txpower_limit()
1671 strcmp(prf_path, "1T") == 0) in _rtl8812ae_phy_set_txpower_limit()
1673 else if (strcmp(prate_section, "VHT") == 0 && in _rtl8812ae_phy_set_txpower_limit()
1674 strcmp(prf_path, "2T") == 0) in _rtl8812ae_phy_set_txpower_limit()
1677 if (strcmp(pbandwidth, "20M") == 0) in _rtl8812ae_phy_set_txpower_limit()
1678 bandwidth = 0; in _rtl8812ae_phy_set_txpower_limit()
1679 else if (strcmp(pbandwidth, "40M") == 0) in _rtl8812ae_phy_set_txpower_limit()
1681 else if (strcmp(pbandwidth, "80M") == 0) in _rtl8812ae_phy_set_txpower_limit()
1683 else if (strcmp(pbandwidth, "160M") == 0) in _rtl8812ae_phy_set_txpower_limit()
1686 if (strcmp(pband, "2.4G") == 0) { in _rtl8812ae_phy_set_txpower_limit()
1710 } else if (strcmp(pband, "5G") == 0) { in _rtl8812ae_phy_set_txpower_limit()
1755 u32 i = 0; in _rtl8821ae_phy_read_and_config_txpwr_lmt()
1769 for (i = 0; i < array_len; i += 7) { in _rtl8821ae_phy_read_and_config_txpwr_lmt()
1827 RFPGA0_XA_HSSIPARAMETER2, 0x200)); in _rtl8821ae_phy_bb8821a_config_parafile()
1840 int i = 0; in __rtl8821ae_phy_config_with_headerfile()
1943 u8 index = 0; in _rtl8821ae_get_rate_section_index()
1944 regaddr &= 0xFFF; in _rtl8821ae_get_rate_section_index()
1945 if (regaddr >= 0xC20 && regaddr <= 0xC4C) in _rtl8821ae_get_rate_section_index()
1946 index = (u8)((regaddr - 0xC20) / 4); in _rtl8821ae_get_rate_section_index()
1947 else if (regaddr >= 0xE20 && regaddr <= 0xE4C) in _rtl8821ae_get_rate_section_index()
1948 index = (u8)((regaddr - 0xE20) / 4); in _rtl8821ae_get_rate_section_index()
1951 "rtl8821ae: Invalid RegAddr 0x%x\n", regaddr); in _rtl8821ae_get_rate_section_index()
1978 "TxPwrByRateOffset[Band %d][RfPath %d][TxNum %d][RateSection %d] = 0x%x\n", in _rtl8821ae_store_tx_power_by_rate()
2006 for (i = 0; i < arraylen; i += 6) { in _rtl8821ae_phy_config_bb_with_pgheaderfile()
2014 if (v1 < 0xCDCDCDCD) { in _rtl8821ae_phy_config_bb_with_pgheaderfile()
2016 (v4 == 0xfe || v4 == 0xffe)) { in _rtl8821ae_phy_config_bb_with_pgheaderfile()
2022 if (v4 == 0xfe) in _rtl8821ae_phy_config_bb_with_pgheaderfile()
2024 else if (v4 == 0xfd) in _rtl8821ae_phy_config_bb_with_pgheaderfile()
2026 else if (v4 == 0xfc) in _rtl8821ae_phy_config_bb_with_pgheaderfile()
2028 else if (v4 == 0xfb) in _rtl8821ae_phy_config_bb_with_pgheaderfile()
2030 else if (v4 == 0xfa) in _rtl8821ae_phy_config_bb_with_pgheaderfile()
2032 else if (v4 == 0xf9) in _rtl8821ae_phy_config_bb_with_pgheaderfile()
2045 while (v2 != 0xDEAD) { in _rtl8821ae_phy_config_bb_with_pgheaderfile()
2121 rtlphy->default_initialgain[0] = in rtl8821ae_phy_get_hw_reg_originalvalue()
2131 "Default initial gain (c50=0x%x, c58=0x%x, c60=0x%x, c68=0x%x\n", in rtl8821ae_phy_get_hw_reg_originalvalue()
2132 rtlphy->default_initialgain[0], in rtl8821ae_phy_get_hw_reg_originalvalue()
2143 "Default framesync (0x%x) = 0x%x\n", in rtl8821ae_phy_get_hw_reg_originalvalue()
2203 u8 i = 0; in _rtl8821ae_phy_get_chnl_index()
2212 for (i = 0; i < CHANNEL_MAX_NUMBER_5G; ++i) { in _rtl8821ae_phy_get_chnl_index()
2224 s8 rate_section = 0; in _rtl8821ae_phy_get_ratesection_intxpower_byrate()
2230 rate_section = 0; in _rtl8821ae_phy_get_ratesection_intxpower_byrate()
2308 s8 min = limit_table[0]; in _rtl8812ae_phy_get_world_wide_limit()
2309 u8 i = 0; in _rtl8812ae_phy_get_world_wide_limit()
2311 for (i = 0; i < MAX_REGULATION_NUM; ++i) { in _rtl8812ae_phy_get_world_wide_limit()
2338 band_temp = 0; in _rtl8812ae_phy_get_txpower_limit()
2343 bandwidth_temp = 0; in _rtl8812ae_phy_get_txpower_limit()
2354 rate_section = 0; in _rtl8812ae_phy_get_txpower_limit()
2412 "Wrong rate 0x%x\n", rate); in _rtl8812ae_phy_get_txpower_limit()
2416 if (band_temp == BAND_ON_5G && rate_section == 0) in _rtl8812ae_phy_get_txpower_limit()
2418 "Wrong rate 0x%x: No CCK in 5G Band\n", rate); in _rtl8812ae_phy_get_txpower_limit()
2423 bandwidth_temp = 0; in _rtl8812ae_phy_get_txpower_limit()
2457 s8 limits[10] = {0}; in _rtl8812ae_phy_get_txpower_limit()
2460 for (i = 0; i < 4; ++i) in _rtl8812ae_phy_get_txpower_limit()
2469 s8 limits[10] = {0}; in _rtl8812ae_phy_get_txpower_limit()
2472 for (i = 0; i < MAX_REGULATION_NUM; ++i) in _rtl8812ae_phy_get_txpower_limit()
2492 u8 shift = 0, rate_section, tx_num; in _rtl8821ae_phy_get_txpower_by_rate()
2493 s8 tx_pwr_diff = 0; in _rtl8821ae_phy_get_txpower_by_rate()
2494 s8 limit = 0; in _rtl8821ae_phy_get_txpower_by_rate()
2520 shift = 0; in _rtl8821ae_phy_get_txpower_by_rate()
2570 [tx_num][rate_section] >> shift) & 0xff; in _rtl8821ae_phy_get_txpower_by_rate()
2580 if (limit < 0) { in _rtl8821ae_phy_get_txpower_by_rate()
2585 if (limit < 0) in _rtl8821ae_phy_get_txpower_by_rate()
2605 u8 txpower = 0; in _rtl8821ae_get_txpower_index()
2607 s8 powerdiff_byrate = 0; in _rtl8821ae_get_txpower_index()
2612 index = 0; in _rtl8821ae_get_txpower_index()
2686 for (i = 0; i < sizeof(channel5g_80m) / sizeof(u8); ++i) in _rtl8821ae_get_txpower_index()
3143 for (i = 0; i < size; i++) { in _rtl8821ae_phy_set_txpower_level_by_path()
3165 data = 0; in _rtl8821ae_phy_txpower_training_by_path()
3178 for (i = 0; i < 3; i++) { in _rtl8821ae_phy_txpower_training_by_path()
3179 if (i == 0) in _rtl8821ae_phy_txpower_training_by_path()
3188 rtl_set_bbreg(hw, offset, 0xffffff, data); in _rtl8821ae_phy_txpower_training_by_path()
3255 u8 path = 0; in rtl8821ae_phy_set_txpower_level()
3321 u16 reg_rf_mode_bw, tmp = 0; in _rtl8821ae_phy_set_reg_bw()
3326 rtl_write_word(rtlpriv, REG_TRXPTCL_CTL, reg_rf_mode_bw & 0xFE7F); in _rtl8821ae_phy_set_reg_bw()
3330 rtl_write_word(rtlpriv, REG_TRXPTCL_CTL, tmp & 0xFEFF); in _rtl8821ae_phy_set_reg_bw()
3334 rtl_write_word(rtlpriv, REG_TRXPTCL_CTL, tmp & 0xFF7F); in _rtl8821ae_phy_set_reg_bw()
3337 rtl_dbg(rtlpriv, COMP_ERR, DBG_WARNING, "unknown Bandwidth: 0x%x\n", bw); in _rtl8821ae_phy_set_reg_bw()
3346 u8 sc_set_40 = 0, sc_set_20 = 0; in _rtl8821ae_phy_get_secondary_chnl()
3385 u8 sub_chnl = 0; in rtl8821ae_phy_set_bw_mode_callback()
3386 u8 l1pk_val = 0; in rtl8821ae_phy_set_bw_mode_callback()
3397 rtl_write_byte(rtlpriv, 0x0483, sub_chnl); in rtl8821ae_phy_set_bw_mode_callback()
3401 rtl_set_bbreg(hw, RRFMOD, 0x003003C3, 0x00300200); in rtl8821ae_phy_set_bw_mode_callback()
3402 rtl_set_bbreg(hw, RADC_BUF_CLK, BIT(30), 0); in rtl8821ae_phy_set_bw_mode_callback()
3405 rtl_set_bbreg(hw, RL1PEAKTH, 0x03C00000, 7); in rtl8821ae_phy_set_bw_mode_callback()
3407 rtl_set_bbreg(hw, RL1PEAKTH, 0x03C00000, 8); in rtl8821ae_phy_set_bw_mode_callback()
3410 rtl_set_bbreg(hw, RRFMOD, 0x003003C3, 0x00300201); in rtl8821ae_phy_set_bw_mode_callback()
3411 rtl_set_bbreg(hw, RADC_BUF_CLK, BIT(30), 0); in rtl8821ae_phy_set_bw_mode_callback()
3412 rtl_set_bbreg(hw, RRFMOD, 0x3C, sub_chnl); in rtl8821ae_phy_set_bw_mode_callback()
3413 rtl_set_bbreg(hw, RCCAONSEC, 0xf0000000, sub_chnl); in rtl8821ae_phy_set_bw_mode_callback()
3423 /* 0x848[25:22] = 0x6 */ in rtl8821ae_phy_set_bw_mode_callback()
3424 rtl_set_bbreg(hw, RL1PEAKTH, 0x03C00000, l1pk_val); in rtl8821ae_phy_set_bw_mode_callback()
3429 rtl_set_bbreg(hw, RCCK_SYSTEM, BCCK_SYSTEM, 0); in rtl8821ae_phy_set_bw_mode_callback()
3433 /* 0x8ac[21,20,9:6,1,0]=8'b11100010 */ in rtl8821ae_phy_set_bw_mode_callback()
3434 rtl_set_bbreg(hw, RRFMOD, 0x003003C3, 0x00300202); in rtl8821ae_phy_set_bw_mode_callback()
3435 /* 0x8c4[30] = 1 */ in rtl8821ae_phy_set_bw_mode_callback()
3437 rtl_set_bbreg(hw, RRFMOD, 0x3C, sub_chnl); in rtl8821ae_phy_set_bw_mode_callback()
3438 rtl_set_bbreg(hw, RCCAONSEC, 0xf0000000, sub_chnl); in rtl8821ae_phy_set_bw_mode_callback()
3448 rtl_set_bbreg(hw, RL1PEAKTH, 0x03C00000, l1pk_val); in rtl8821ae_phy_set_bw_mode_callback()
3501 data = 0x494; in rtl8821ae_phy_sw_chnl_callback()
3503 data = 0x453; in rtl8821ae_phy_sw_chnl_callback()
3505 data = 0x452; in rtl8821ae_phy_sw_chnl_callback()
3507 data = 0x412; in rtl8821ae_phy_sw_chnl_callback()
3509 data = 0x96a; in rtl8821ae_phy_sw_chnl_callback()
3510 rtl_set_bbreg(hw, RFC_AREA, 0x1ffe0000, data); in rtl8821ae_phy_sw_chnl_callback()
3514 data = 0x101; in rtl8821ae_phy_sw_chnl_callback()
3516 data = 0x301; in rtl8821ae_phy_sw_chnl_callback()
3518 data = 0x501; in rtl8821ae_phy_sw_chnl_callback()
3520 data = 0x000; in rtl8821ae_phy_sw_chnl_callback()
3530 data = 0x114E9; in rtl8821ae_phy_sw_chnl_callback()
3532 data = 0x110E9; in rtl8821ae_phy_sw_chnl_callback()
3546 u32 timeout = 1000, timecount = 0; in rtl8821ae_phy_sw_chnl()
3550 return 0; in rtl8821ae_phy_sw_chnl()
3552 return 0; in rtl8821ae_phy_sw_chnl()
3557 return 0; in rtl8821ae_phy_sw_chnl()
3570 if (channel == 0) in rtl8821ae_phy_sw_chnl()
3604 return 0; in _rtl8812ae_get_right_chnl_place_for_iqk()
3618 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /*[31] = 0 --> Page C*/ in _rtl8821ae_iqk_backup_macbb()
3620 for (i = 0; i < mac_bb_num; i++) in _rtl8821ae_iqk_backup_macbb()
3632 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /*[31] = 0 --> Page C*/ in _rtl8821ae_iqk_backup_afe()
3634 for (i = 0; i < afe_num; i++) in _rtl8821ae_iqk_backup_afe()
3646 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /*[31] = 0 --> Page C*/ in _rtl8821ae_iqk_backup_rf()
3648 for (i = 0; i < rf_num; i++) { in _rtl8821ae_iqk_backup_rf()
3663 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /*[31] = 0 --> Page C*/ in _rtl8821ae_iqk_configure_mac()
3664 rtl_write_byte(rtlpriv, 0x522, 0x3f); in _rtl8821ae_iqk_configure_mac()
3665 rtl_set_bbreg(hw, 0x550, BIT(11) | BIT(3), 0x0); in _rtl8821ae_iqk_configure_mac()
3666 rtl_write_byte(rtlpriv, 0x808, 0x00); /*RX ante off*/ in _rtl8821ae_iqk_configure_mac()
3667 rtl_set_bbreg(hw, 0x838, 0xf, 0xc); /*CCA off*/ in _rtl8821ae_iqk_configure_mac()
3677 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x1); in _rtl8821ae_iqk_tx_fill_iqc()
3678 rtl_write_dword(rtlpriv, 0xc90, 0x00000080); in _rtl8821ae_iqk_tx_fill_iqc()
3679 rtl_write_dword(rtlpriv, 0xcc4, 0x20040000); in _rtl8821ae_iqk_tx_fill_iqc()
3680 rtl_write_dword(rtlpriv, 0xcc8, 0x20000000); in _rtl8821ae_iqk_tx_fill_iqc()
3681 rtl_set_bbreg(hw, 0xccc, 0x000007ff, tx_y); in _rtl8821ae_iqk_tx_fill_iqc()
3682 rtl_set_bbreg(hw, 0xcd4, 0x000007ff, tx_x); in _rtl8821ae_iqk_tx_fill_iqc()
3687 "0xcd4 = %x;;0xccc = %x ====>fill to IQC\n", in _rtl8821ae_iqk_tx_fill_iqc()
3688 rtl_get_bbreg(hw, 0xcd4, 0x000007ff), in _rtl8821ae_iqk_tx_fill_iqc()
3689 rtl_get_bbreg(hw, 0xccc, 0x000007ff)); in _rtl8821ae_iqk_tx_fill_iqc()
3702 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /* [31] = 0 --> Page C */ in _rtl8821ae_iqk_rx_fill_iqc()
3703 rtl_set_bbreg(hw, 0xc10, 0x000003ff, rx_x>>1); in _rtl8821ae_iqk_rx_fill_iqc()
3704 rtl_set_bbreg(hw, 0xc10, 0x03ff0000, rx_y>>1); in _rtl8821ae_iqk_rx_fill_iqc()
3709 "0xc10 = %x ====>fill to IQC\n", in _rtl8821ae_iqk_rx_fill_iqc()
3710 rtl_read_dword(rtlpriv, 0xc10)); in _rtl8821ae_iqk_rx_fill_iqc()
3725 u32 tx_fail, rx_fail, delay_count, iqk_ready, cal_retry, cal = 0, temp_reg65; in _rtl8821ae_iqk_tx()
3726 int tx_x = 0, tx_y = 0, rx_x = 0, rx_y = 0, tx_average = 0, rx_average = 0; in _rtl8821ae_iqk_tx()
3733 ii, dx = 0, dy = 0, tx_finish = 0, rx_finish = 0; in _rtl8821ae_iqk_tx()
3744 temp_reg65 = rtl_get_rfreg(hw, path, 0x65, 0xffffffff); in _rtl8821ae_iqk_tx()
3746 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /*[31] = 0 --> Page C*/ in _rtl8821ae_iqk_tx()
3748 /*Port 0 DAC/ADC on*/ in _rtl8821ae_iqk_tx()
3749 rtl_write_dword(rtlpriv, 0xc60, 0x77777777); in _rtl8821ae_iqk_tx()
3750 rtl_write_dword(rtlpriv, 0xc64, 0x77777777); in _rtl8821ae_iqk_tx()
3751 rtl_write_dword(rtlpriv, 0xc68, 0x19791979); in _rtl8821ae_iqk_tx()
3752 rtl_write_dword(rtlpriv, 0xc6c, 0x19791979); in _rtl8821ae_iqk_tx()
3753 rtl_write_dword(rtlpriv, 0xc70, 0x19791979); in _rtl8821ae_iqk_tx()
3754 rtl_write_dword(rtlpriv, 0xc74, 0x19791979); in _rtl8821ae_iqk_tx()
3755 rtl_write_dword(rtlpriv, 0xc78, 0x19791979); in _rtl8821ae_iqk_tx()
3756 rtl_write_dword(rtlpriv, 0xc7c, 0x19791979); in _rtl8821ae_iqk_tx()
3757 rtl_write_dword(rtlpriv, 0xc80, 0x19791979); in _rtl8821ae_iqk_tx()
3758 rtl_write_dword(rtlpriv, 0xc84, 0x19791979); in _rtl8821ae_iqk_tx()
3760 rtl_set_bbreg(hw, 0xc00, 0xf, 0x4); /*hardware 3-wire off*/ in _rtl8821ae_iqk_tx()
3765 rtl_set_bbreg(hw, 0xc5c, BIT(26) | BIT(25) | BIT(24), 0x7); in _rtl8821ae_iqk_tx()
3768 rtl_set_rfreg(hw, path, 0xef, RFREG_OFFSET_MASK, 0x80002); in _rtl8821ae_iqk_tx()
3769 rtl_set_rfreg(hw, path, 0x18, 0x00c00, 0x3); /* BW 20M */ in _rtl8821ae_iqk_tx()
3770 rtl_set_rfreg(hw, path, 0x30, RFREG_OFFSET_MASK, 0x20000); in _rtl8821ae_iqk_tx()
3771 rtl_set_rfreg(hw, path, 0x31, RFREG_OFFSET_MASK, 0x0003f); in _rtl8821ae_iqk_tx()
3772 rtl_set_rfreg(hw, path, 0x32, RFREG_OFFSET_MASK, 0xf3fc3); in _rtl8821ae_iqk_tx()
3773 rtl_set_rfreg(hw, path, 0x65, RFREG_OFFSET_MASK, 0x931d5); in _rtl8821ae_iqk_tx()
3774 rtl_set_rfreg(hw, path, 0x8f, RFREG_OFFSET_MASK, 0x8a001); in _rtl8821ae_iqk_tx()
3775 rtl_set_bbreg(hw, 0xcb8, 0xf, 0xd); in _rtl8821ae_iqk_tx()
3776 rtl_write_dword(rtlpriv, 0x90c, 0x00008000); in _rtl8821ae_iqk_tx()
3777 rtl_write_dword(rtlpriv, 0xb00, 0x03000100); in _rtl8821ae_iqk_tx()
3778 rtl_set_bbreg(hw, 0xc94, BIT(0), 0x1); in _rtl8821ae_iqk_tx()
3779 rtl_write_dword(rtlpriv, 0x978, 0x29002000);/* TX (X,Y) */ in _rtl8821ae_iqk_tx()
3780 rtl_write_dword(rtlpriv, 0x97c, 0xa9002000);/* RX (X,Y) */ in _rtl8821ae_iqk_tx()
3781 rtl_write_dword(rtlpriv, 0x984, 0x00462910);/* [0]:AGC_en, [15]:idac_K_Mask */ in _rtl8821ae_iqk_tx()
3783 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x1); /* [31] = 1 --> Page C1 */ in _rtl8821ae_iqk_tx()
3784 rtl_write_dword(rtlpriv, 0xc88, 0x821403f4); in _rtl8821ae_iqk_tx()
3787 rtl_write_dword(rtlpriv, 0xc8c, 0x68163e96); in _rtl8821ae_iqk_tx()
3789 rtl_write_dword(rtlpriv, 0xc8c, 0x28163e96); in _rtl8821ae_iqk_tx()
3791 rtl_write_dword(rtlpriv, 0xc80, 0x18008c10);/* TX_TONE_idx[9:0], TxK_Mask[29] TX_Tone = 16 */ in _rtl8821ae_iqk_tx()
3792 rtl_write_dword(rtlpriv, 0xc84, 0x38008c10);/* RX_TONE_idx[9:0], RxK_Mask[29] */ in _rtl8821ae_iqk_tx()
3793 …rtl_write_dword(rtlpriv, 0xcb8, 0x00100000);/* cb8[20] \B1N SI/PI \A8ϥ\CE\C5v\A4\C1\B5\B9 iqk_dpk … in _rtl8821ae_iqk_tx()
3794 rtl_write_dword(rtlpriv, 0x980, 0xfa000000); in _rtl8821ae_iqk_tx()
3795 rtl_write_dword(rtlpriv, 0x980, 0xf8000000); in _rtl8821ae_iqk_tx()
3798 rtl_write_dword(rtlpriv, 0xcb8, 0x00000000); in _rtl8821ae_iqk_tx()
3800 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /* [31] = 0 --> Page C */ in _rtl8821ae_iqk_tx()
3801 rtl_set_rfreg(hw, path, 0x58, 0x7fe00, rtl_get_rfreg(hw, path, 0x8, 0xffc00)); /* Load LOK */ in _rtl8821ae_iqk_tx()
3805 rtl_set_rfreg(hw, path, 0x18, 0x00c00, 0x1); in _rtl8821ae_iqk_tx()
3808 rtl_set_rfreg(hw, path, 0x18, 0x00c00, 0x0); in _rtl8821ae_iqk_tx()
3814 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x1); /* [31] = 1 --> Page C1 */ in _rtl8821ae_iqk_tx()
3817 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /* [31] = 0 --> Page C */ in _rtl8821ae_iqk_tx()
3818 rtl_set_rfreg(hw, path, 0xef, RFREG_OFFSET_MASK, 0x80000); in _rtl8821ae_iqk_tx()
3819 rtl_set_rfreg(hw, path, 0x30, RFREG_OFFSET_MASK, 0x20000); in _rtl8821ae_iqk_tx()
3820 rtl_set_rfreg(hw, path, 0x31, RFREG_OFFSET_MASK, 0x0003f); in _rtl8821ae_iqk_tx()
3821 rtl_set_rfreg(hw, path, 0x32, RFREG_OFFSET_MASK, 0xf3fc3); in _rtl8821ae_iqk_tx()
3822 rtl_set_rfreg(hw, path, 0x65, RFREG_OFFSET_MASK, 0x931d5); in _rtl8821ae_iqk_tx()
3823 rtl_set_rfreg(hw, path, 0x8f, RFREG_OFFSET_MASK, 0x8a001); in _rtl8821ae_iqk_tx()
3824 rtl_set_rfreg(hw, path, 0xef, RFREG_OFFSET_MASK, 0x00000); in _rtl8821ae_iqk_tx()
3825 /* ODM_SetBBReg(pDM_Odm, 0xcb8, 0xf, 0xd); */ in _rtl8821ae_iqk_tx()
3826 rtl_write_dword(rtlpriv, 0x90c, 0x00008000); in _rtl8821ae_iqk_tx()
3827 rtl_write_dword(rtlpriv, 0xb00, 0x03000100); in _rtl8821ae_iqk_tx()
3828 rtl_set_bbreg(hw, 0xc94, BIT(0), 0x1); in _rtl8821ae_iqk_tx()
3829 rtl_write_dword(rtlpriv, 0x978, 0x29002000);/* TX (X,Y) */ in _rtl8821ae_iqk_tx()
3830 rtl_write_dword(rtlpriv, 0x97c, 0xa9002000);/* RX (X,Y) */ in _rtl8821ae_iqk_tx()
3831 rtl_write_dword(rtlpriv, 0x984, 0x0046a910);/* [0]:AGC_en, [15]:idac_K_Mask */ in _rtl8821ae_iqk_tx()
3833 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x1); /* [31] = 1 --> Page C1 */ in _rtl8821ae_iqk_tx()
3834 rtl_write_dword(rtlpriv, 0xc88, 0x821403f1); in _rtl8821ae_iqk_tx()
3836 rtl_write_dword(rtlpriv, 0xc8c, 0x40163e96); in _rtl8821ae_iqk_tx()
3838 rtl_write_dword(rtlpriv, 0xc8c, 0x00163e96); in _rtl8821ae_iqk_tx()
3842 for (k = 0; k <= 2; k++) { in _rtl8821ae_iqk_tx()
3844 case 0: in _rtl8821ae_iqk_tx()
3845 rtl_write_dword(rtlpriv, 0xc80, 0x18008c38);/* TX_TONE_idx[9:0], TxK_Mask[29] TX_Tone = 16 */ in _rtl8821ae_iqk_tx()
3846 rtl_write_dword(rtlpriv, 0xc84, 0x38008c38);/* RX_TONE_idx[9:0], RxK_Mask[29] */ in _rtl8821ae_iqk_tx()
3847 rtl_set_bbreg(hw, 0xce8, BIT(31), 0x0); in _rtl8821ae_iqk_tx()
3850 rtl_set_bbreg(hw, 0xc80, BIT(28), 0x0); in _rtl8821ae_iqk_tx()
3851 rtl_set_bbreg(hw, 0xc84, BIT(28), 0x0); in _rtl8821ae_iqk_tx()
3852 rtl_set_bbreg(hw, 0xce8, BIT(31), 0x0); in _rtl8821ae_iqk_tx()
3856 "vdf_y[1] = %x;;;vdf_y[0] = %x\n", vdf_y[1]>>21 & 0x00007ff, vdf_y[0]>>21 & 0x00007ff); in _rtl8821ae_iqk_tx()
3858 "vdf_x[1] = %x;;;vdf_x[0] = %x\n", vdf_x[1]>>21 & 0x00007ff, vdf_x[0]>>21 & 0x00007ff); in _rtl8821ae_iqk_tx()
3859 tx_dt[cal] = (vdf_y[1]>>20)-(vdf_y[0]>>20); in _rtl8821ae_iqk_tx()
3861 tx_dt[cal] = (tx_dt[cal] >> 1)+(tx_dt[cal] & BIT(0)); in _rtl8821ae_iqk_tx()
3862 rtl_write_dword(rtlpriv, 0xc80, 0x18008c20);/* TX_TONE_idx[9:0], TxK_Mask[29] TX_Tone = 16 */ in _rtl8821ae_iqk_tx()
3863 rtl_write_dword(rtlpriv, 0xc84, 0x38008c20);/* RX_TONE_idx[9:0], RxK_Mask[29] */ in _rtl8821ae_iqk_tx()
3864 rtl_set_bbreg(hw, 0xce8, BIT(31), 0x1); in _rtl8821ae_iqk_tx()
3865 rtl_set_bbreg(hw, 0xce8, 0x3fff0000, tx_dt[cal] & 0x00003fff); in _rtl8821ae_iqk_tx()
3870 …rtl_write_dword(rtlpriv, 0xcb8, 0x00100000);/* cb8[20] \B1N SI/PI \A8ϥ\CE\C5v\A4\C1\B5\B9 iqk_dpk … in _rtl8821ae_iqk_tx()
3871 cal_retry = 0; in _rtl8821ae_iqk_tx()
3874 rtl_write_dword(rtlpriv, 0x980, 0xfa000000); in _rtl8821ae_iqk_tx()
3875 rtl_write_dword(rtlpriv, 0x980, 0xf8000000); in _rtl8821ae_iqk_tx()
3878 rtl_write_dword(rtlpriv, 0xcb8, 0x00000000); in _rtl8821ae_iqk_tx()
3879 delay_count = 0; in _rtl8821ae_iqk_tx()
3881 iqk_ready = rtl_get_bbreg(hw, 0xd00, BIT(10)); in _rtl8821ae_iqk_tx()
3892 tx_fail = rtl_get_bbreg(hw, 0xd00, BIT(12)); in _rtl8821ae_iqk_tx()
3895 rtl_write_dword(rtlpriv, 0xcb8, 0x02000000); in _rtl8821ae_iqk_tx()
3896 vdf_x[k] = rtl_get_bbreg(hw, 0xd00, 0x07ff0000)<<21; in _rtl8821ae_iqk_tx()
3897 rtl_write_dword(rtlpriv, 0xcb8, 0x04000000); in _rtl8821ae_iqk_tx()
3898 vdf_y[k] = rtl_get_bbreg(hw, 0xd00, 0x07ff0000)<<21; in _rtl8821ae_iqk_tx()
3902 rtl_set_bbreg(hw, 0xccc, 0x000007ff, 0x0); in _rtl8821ae_iqk_tx()
3903 rtl_set_bbreg(hw, 0xcd4, 0x000007ff, 0x200); in _rtl8821ae_iqk_tx()
3922 rtl_write_dword(rtlpriv, 0xc80, 0x18008c10);/* TX_TONE_idx[9:0], TxK_Mask[29] TX_Tone = 16 */ in _rtl8821ae_iqk_tx()
3923 rtl_write_dword(rtlpriv, 0xc84, 0x38008c10);/* RX_TONE_idx[9:0], RxK_Mask[29] */ in _rtl8821ae_iqk_tx()
3924 …rtl_write_dword(rtlpriv, 0xcb8, 0x00100000);/* cb8[20] \B1N SI/PI \A8ϥ\CE\C5v\A4\C1\B5\B9 iqk_dpk … in _rtl8821ae_iqk_tx()
3925 cal_retry = 0; in _rtl8821ae_iqk_tx()
3928 rtl_write_dword(rtlpriv, 0x980, 0xfa000000); in _rtl8821ae_iqk_tx()
3929 rtl_write_dword(rtlpriv, 0x980, 0xf8000000); in _rtl8821ae_iqk_tx()
3932 rtl_write_dword(rtlpriv, 0xcb8, 0x00000000); in _rtl8821ae_iqk_tx()
3933 delay_count = 0; in _rtl8821ae_iqk_tx()
3935 iqk_ready = rtl_get_bbreg(hw, 0xd00, BIT(10)); in _rtl8821ae_iqk_tx()
3946 tx_fail = rtl_get_bbreg(hw, 0xd00, BIT(12)); in _rtl8821ae_iqk_tx()
3949 rtl_write_dword(rtlpriv, 0xcb8, 0x02000000); in _rtl8821ae_iqk_tx()
3950 tx_x0[cal] = rtl_get_bbreg(hw, 0xd00, 0x07ff0000)<<21; in _rtl8821ae_iqk_tx()
3951 rtl_write_dword(rtlpriv, 0xcb8, 0x04000000); in _rtl8821ae_iqk_tx()
3952 tx_y0[cal] = rtl_get_bbreg(hw, 0xd00, 0x07ff0000)<<21; in _rtl8821ae_iqk_tx()
3956 rtl_set_bbreg(hw, 0xccc, 0x000007ff, 0x0); in _rtl8821ae_iqk_tx()
3957 rtl_set_bbreg(hw, 0xcd4, 0x000007ff, 0x200); in _rtl8821ae_iqk_tx()
3976 rtl_set_bbreg(hw, 0xce8, BIT(31), 0x0); /* TX VDF Disable */ in _rtl8821ae_iqk_tx()
3978 for (k = 0; k <= 2; k++) { in _rtl8821ae_iqk_tx()
3980 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /* [31] = 0 --> Page C */ in _rtl8821ae_iqk_tx()
3982 rtl_set_rfreg(hw, path, 0xef, RFREG_OFFSET_MASK, 0x80000); in _rtl8821ae_iqk_tx()
3983 rtl_set_rfreg(hw, path, 0x30, RFREG_OFFSET_MASK, 0x30000); in _rtl8821ae_iqk_tx()
3984 rtl_set_rfreg(hw, path, 0x31, RFREG_OFFSET_MASK, 0x00029); in _rtl8821ae_iqk_tx()
3985 rtl_set_rfreg(hw, path, 0x32, RFREG_OFFSET_MASK, 0xd7ffb); in _rtl8821ae_iqk_tx()
3986 rtl_set_rfreg(hw, path, 0x65, RFREG_OFFSET_MASK, temp_reg65); in _rtl8821ae_iqk_tx()
3987 rtl_set_rfreg(hw, path, 0x8f, RFREG_OFFSET_MASK, 0x8a001); in _rtl8821ae_iqk_tx()
3988 rtl_set_rfreg(hw, path, 0xef, RFREG_OFFSET_MASK, 0x00000); in _rtl8821ae_iqk_tx()
3990 rtl_set_bbreg(hw, 0xcb8, 0xf, 0xd); in _rtl8821ae_iqk_tx()
3991 rtl_write_dword(rtlpriv, 0x978, 0x29002000);/* TX (X,Y) */ in _rtl8821ae_iqk_tx()
3992 rtl_write_dword(rtlpriv, 0x97c, 0xa9002000);/* RX (X,Y) */ in _rtl8821ae_iqk_tx()
3993 rtl_write_dword(rtlpriv, 0x984, 0x0046a910);/* [0]:AGC_en, [15]:idac_K_Mask */ in _rtl8821ae_iqk_tx()
3994 rtl_write_dword(rtlpriv, 0x90c, 0x00008000); in _rtl8821ae_iqk_tx()
3995 rtl_write_dword(rtlpriv, 0xb00, 0x03000100); in _rtl8821ae_iqk_tx()
3996 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x1); /* [31] = 1 --> Page C1 */ in _rtl8821ae_iqk_tx()
3998 case 0: in _rtl8821ae_iqk_tx()
4000 rtl_write_dword(rtlpriv, 0xc80, 0x18008c38);/* TX_TONE_idx[9:0], TxK_Mask[29] TX_Tone = 16 */ in _rtl8821ae_iqk_tx()
4001 rtl_write_dword(rtlpriv, 0xc84, 0x38008c38);/* RX_TONE_idx[9:0], RxK_Mask[29] */ in _rtl8821ae_iqk_tx()
4002 rtl_set_bbreg(hw, 0xce8, BIT(30), 0x0); in _rtl8821ae_iqk_tx()
4007 rtl_write_dword(rtlpriv, 0xc80, 0x08008c38);/* TX_TONE_idx[9:0], TxK_Mask[29] TX_Tone = 16 */ in _rtl8821ae_iqk_tx()
4008 rtl_write_dword(rtlpriv, 0xc84, 0x28008c38);/* RX_TONE_idx[9:0], RxK_Mask[29] */ in _rtl8821ae_iqk_tx()
4009 rtl_set_bbreg(hw, 0xce8, BIT(30), 0x0); in _rtl8821ae_iqk_tx()
4015 "VDF_Y[1] = %x;;;VDF_Y[0] = %x\n", in _rtl8821ae_iqk_tx()
4016 vdf_y[1] >> 21 & 0x00007ff, in _rtl8821ae_iqk_tx()
4017 vdf_y[0] >> 21 & 0x00007ff); in _rtl8821ae_iqk_tx()
4019 "VDF_X[1] = %x;;;VDF_X[0] = %x\n", in _rtl8821ae_iqk_tx()
4020 vdf_x[1] >> 21 & 0x00007ff, in _rtl8821ae_iqk_tx()
4021 vdf_x[0] >> 21 & 0x00007ff); in _rtl8821ae_iqk_tx()
4022 rx_dt[cal] = (vdf_y[1]>>20)-(vdf_y[0]>>20); in _rtl8821ae_iqk_tx()
4026 rx_dt[cal] = (rx_dt[cal] >> 1)+(rx_dt[cal] & BIT(0)); in _rtl8821ae_iqk_tx()
4027 rtl_write_dword(rtlpriv, 0xc80, 0x18008c20);/* TX_TONE_idx[9:0], TxK_Mask[29] TX_Tone = 16 */ in _rtl8821ae_iqk_tx()
4028 rtl_write_dword(rtlpriv, 0xc84, 0x38008c20);/* RX_TONE_idx[9:0], RxK_Mask[29] */ in _rtl8821ae_iqk_tx()
4029 rtl_set_bbreg(hw, 0xce8, 0x00003fff, rx_dt[cal] & 0x00003fff); in _rtl8821ae_iqk_tx()
4035 rtl_write_dword(rtlpriv, 0xc88, 0x821603e0); in _rtl8821ae_iqk_tx()
4036 rtl_write_dword(rtlpriv, 0xc8c, 0x68163e96); in _rtl8821ae_iqk_tx()
4037 …rtl_write_dword(rtlpriv, 0xcb8, 0x00100000);/* cb8[20] \B1N SI/PI \A8ϥ\CE\C5v\A4\C1\B5\B9 iqk_dpk … in _rtl8821ae_iqk_tx()
4038 cal_retry = 0; in _rtl8821ae_iqk_tx()
4041 rtl_write_dword(rtlpriv, 0x980, 0xfa000000); in _rtl8821ae_iqk_tx()
4042 rtl_write_dword(rtlpriv, 0x980, 0xf8000000); in _rtl8821ae_iqk_tx()
4045 rtl_write_dword(rtlpriv, 0xcb8, 0x00000000); in _rtl8821ae_iqk_tx()
4046 delay_count = 0; in _rtl8821ae_iqk_tx()
4048 iqk_ready = rtl_get_bbreg(hw, 0xd00, BIT(10)); in _rtl8821ae_iqk_tx()
4059 tx_fail = rtl_get_bbreg(hw, 0xd00, BIT(12)); in _rtl8821ae_iqk_tx()
4062 rtl_write_dword(rtlpriv, 0xcb8, 0x02000000); in _rtl8821ae_iqk_tx()
4063 tx_x0_rxk[cal] = rtl_get_bbreg(hw, 0xd00, 0x07ff0000)<<21; in _rtl8821ae_iqk_tx()
4064 rtl_write_dword(rtlpriv, 0xcb8, 0x04000000); in _rtl8821ae_iqk_tx()
4065 tx_y0_rxk[cal] = rtl_get_bbreg(hw, 0xd00, 0x07ff0000)<<21; in _rtl8821ae_iqk_tx()
4093 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /* [31] = 0 --> Page C */ in _rtl8821ae_iqk_tx()
4095 rtl_set_rfreg(hw, path, 0xef, RFREG_OFFSET_MASK, 0x80000); in _rtl8821ae_iqk_tx()
4096 rtl_set_rfreg(hw, path, 0x30, RFREG_OFFSET_MASK, 0x30000); in _rtl8821ae_iqk_tx()
4097 rtl_set_rfreg(hw, path, 0x31, RFREG_OFFSET_MASK, 0x0002f); in _rtl8821ae_iqk_tx()
4098 rtl_set_rfreg(hw, path, 0x32, RFREG_OFFSET_MASK, 0xfffbb); in _rtl8821ae_iqk_tx()
4099 rtl_set_rfreg(hw, path, 0x8f, RFREG_OFFSET_MASK, 0x88001); in _rtl8821ae_iqk_tx()
4100 rtl_set_rfreg(hw, path, 0x65, RFREG_OFFSET_MASK, 0x931d8); in _rtl8821ae_iqk_tx()
4101 rtl_set_rfreg(hw, path, 0xef, RFREG_OFFSET_MASK, 0x00000); in _rtl8821ae_iqk_tx()
4103 rtl_set_bbreg(hw, 0x978, 0x03FF8000, (tx_x0_rxk[cal])>>21&0x000007ff); in _rtl8821ae_iqk_tx()
4104 rtl_set_bbreg(hw, 0x978, 0x000007FF, (tx_y0_rxk[cal])>>21&0x000007ff); in _rtl8821ae_iqk_tx()
4105 rtl_set_bbreg(hw, 0x978, BIT(31), 0x1); in _rtl8821ae_iqk_tx()
4106 rtl_set_bbreg(hw, 0x97c, BIT(31), 0x0); in _rtl8821ae_iqk_tx()
4107 rtl_set_bbreg(hw, 0xcb8, 0xF, 0xe); in _rtl8821ae_iqk_tx()
4108 rtl_write_dword(rtlpriv, 0x90c, 0x00008000); in _rtl8821ae_iqk_tx()
4109 rtl_write_dword(rtlpriv, 0x984, 0x0046a911); in _rtl8821ae_iqk_tx()
4111 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x1); /* [31] = 1 --> Page C1 */ in _rtl8821ae_iqk_tx()
4112 rtl_set_bbreg(hw, 0xc80, BIT(29), 0x1); in _rtl8821ae_iqk_tx()
4113 rtl_set_bbreg(hw, 0xc84, BIT(29), 0x0); in _rtl8821ae_iqk_tx()
4114 rtl_write_dword(rtlpriv, 0xc88, 0x02140119); in _rtl8821ae_iqk_tx()
4116 rtl_write_dword(rtlpriv, 0xc8c, 0x28160d00); /* pDM_Odm->SupportInterface == 1 */ in _rtl8821ae_iqk_tx()
4119 rtl_set_bbreg(hw, 0xce8, BIT(30), 0x1); /* RX VDF Enable */ in _rtl8821ae_iqk_tx()
4120 …rtl_write_dword(rtlpriv, 0xcb8, 0x00100000);/* cb8[20] \B1N SI/PI \A8ϥ\CE\C5v\A4\C1\B5\B9 iqk_dpk … in _rtl8821ae_iqk_tx()
4122 cal_retry = 0; in _rtl8821ae_iqk_tx()
4125 rtl_write_dword(rtlpriv, 0x980, 0xfa000000); in _rtl8821ae_iqk_tx()
4126 rtl_write_dword(rtlpriv, 0x980, 0xf8000000); in _rtl8821ae_iqk_tx()
4129 rtl_write_dword(rtlpriv, 0xcb8, 0x00000000); in _rtl8821ae_iqk_tx()
4130 delay_count = 0; in _rtl8821ae_iqk_tx()
4132 iqk_ready = rtl_get_bbreg(hw, 0xd00, BIT(10)); in _rtl8821ae_iqk_tx()
4143 rx_fail = rtl_get_bbreg(hw, 0xd00, BIT(11)); in _rtl8821ae_iqk_tx()
4144 if (rx_fail == 0) { in _rtl8821ae_iqk_tx()
4145 rtl_write_dword(rtlpriv, 0xcb8, 0x06000000); in _rtl8821ae_iqk_tx()
4146 vdf_x[k] = rtl_get_bbreg(hw, 0xd00, 0x07ff0000)<<21; in _rtl8821ae_iqk_tx()
4147 rtl_write_dword(rtlpriv, 0xcb8, 0x08000000); in _rtl8821ae_iqk_tx()
4148 vdf_y[k] = rtl_get_bbreg(hw, 0xd00, 0x07ff0000)<<21; in _rtl8821ae_iqk_tx()
4152 rtl_set_bbreg(hw, 0xc10, 0x000003ff, 0x200>>1); in _rtl8821ae_iqk_tx()
4153 rtl_set_bbreg(hw, 0xc10, 0x03ff0000, 0x0>>1); in _rtl8821ae_iqk_tx()
4173 rtl_set_bbreg(hw, 0xce8, BIT(31), 0x1); /* TX VDF Enable */ in _rtl8821ae_iqk_tx()
4178 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /* [31] = 0 --> Page C */ in _rtl8821ae_iqk_tx()
4180 rtl_set_rfreg(hw, path, 0xef, RFREG_OFFSET_MASK, 0x80000); in _rtl8821ae_iqk_tx()
4181 rtl_set_rfreg(hw, path, 0x30, RFREG_OFFSET_MASK, 0x30000); in _rtl8821ae_iqk_tx()
4182 rtl_set_rfreg(hw, path, 0x31, RFREG_OFFSET_MASK, 0x00029); in _rtl8821ae_iqk_tx()
4183 rtl_set_rfreg(hw, path, 0x32, RFREG_OFFSET_MASK, 0xd7ffb); in _rtl8821ae_iqk_tx()
4184 rtl_set_rfreg(hw, path, 0x65, RFREG_OFFSET_MASK, temp_reg65); in _rtl8821ae_iqk_tx()
4185 rtl_set_rfreg(hw, path, 0x8f, RFREG_OFFSET_MASK, 0x8a001); in _rtl8821ae_iqk_tx()
4186 rtl_set_rfreg(hw, path, 0xef, RFREG_OFFSET_MASK, 0x00000); in _rtl8821ae_iqk_tx()
4187 rtl_write_dword(rtlpriv, 0x90c, 0x00008000); in _rtl8821ae_iqk_tx()
4188 rtl_write_dword(rtlpriv, 0xb00, 0x03000100); in _rtl8821ae_iqk_tx()
4189 rtl_write_dword(rtlpriv, 0x984, 0x0046a910);/* [0]:AGC_en, [15]:idac_K_Mask */ in _rtl8821ae_iqk_tx()
4191 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x1); /* [31] = 1 --> Page C1 */ in _rtl8821ae_iqk_tx()
4192 rtl_write_dword(rtlpriv, 0xc80, 0x18008c10);/* TX_TONE_idx[9:0], TxK_Mask[29] TX_Tone = 16 */ in _rtl8821ae_iqk_tx()
4193 rtl_write_dword(rtlpriv, 0xc84, 0x38008c10);/* RX_TONE_idx[9:0], RxK_Mask[29] */ in _rtl8821ae_iqk_tx()
4194 rtl_write_dword(rtlpriv, 0xc88, 0x821603e0); in _rtl8821ae_iqk_tx()
4195 /* ODM_Write4Byte(pDM_Odm, 0xc8c, 0x68163e96); */ in _rtl8821ae_iqk_tx()
4196 …rtl_write_dword(rtlpriv, 0xcb8, 0x00100000);/* cb8[20] \B1N SI/PI \A8ϥ\CE\C5v\A4\C1\B5\B9 iqk_dpk … in _rtl8821ae_iqk_tx()
4197 cal_retry = 0; in _rtl8821ae_iqk_tx()
4200 rtl_write_dword(rtlpriv, 0x980, 0xfa000000); in _rtl8821ae_iqk_tx()
4201 rtl_write_dword(rtlpriv, 0x980, 0xf8000000); in _rtl8821ae_iqk_tx()
4204 rtl_write_dword(rtlpriv, 0xcb8, 0x00000000); in _rtl8821ae_iqk_tx()
4205 delay_count = 0; in _rtl8821ae_iqk_tx()
4207 iqk_ready = rtl_get_bbreg(hw, 0xd00, BIT(10)); in _rtl8821ae_iqk_tx()
4218 tx_fail = rtl_get_bbreg(hw, 0xd00, BIT(12)); in _rtl8821ae_iqk_tx()
4221 rtl_write_dword(rtlpriv, 0xcb8, 0x02000000); in _rtl8821ae_iqk_tx()
4222 tx_x0_rxk[cal] = rtl_get_bbreg(hw, 0xd00, 0x07ff0000)<<21; in _rtl8821ae_iqk_tx()
4223 rtl_write_dword(rtlpriv, 0xcb8, 0x04000000); in _rtl8821ae_iqk_tx()
4224 tx_y0_rxk[cal] = rtl_get_bbreg(hw, 0xd00, 0x07ff0000)<<21; in _rtl8821ae_iqk_tx()
4250 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /* [31] = 0 --> Page C */ in _rtl8821ae_iqk_tx()
4252 rtl_set_rfreg(hw, path, 0xef, RFREG_OFFSET_MASK, 0x80000); in _rtl8821ae_iqk_tx()
4253 rtl_set_rfreg(hw, path, 0x30, RFREG_OFFSET_MASK, 0x30000); in _rtl8821ae_iqk_tx()
4254 rtl_set_rfreg(hw, path, 0x31, RFREG_OFFSET_MASK, 0x0002f); in _rtl8821ae_iqk_tx()
4255 rtl_set_rfreg(hw, path, 0x32, RFREG_OFFSET_MASK, 0xfffbb); in _rtl8821ae_iqk_tx()
4256 rtl_set_rfreg(hw, path, 0x8f, RFREG_OFFSET_MASK, 0x88001); in _rtl8821ae_iqk_tx()
4257 rtl_set_rfreg(hw, path, 0x65, RFREG_OFFSET_MASK, 0x931d8); in _rtl8821ae_iqk_tx()
4258 rtl_set_rfreg(hw, path, 0xef, RFREG_OFFSET_MASK, 0x00000); in _rtl8821ae_iqk_tx()
4260 rtl_set_bbreg(hw, 0x978, 0x03FF8000, (tx_x0_rxk[cal])>>21&0x000007ff); in _rtl8821ae_iqk_tx()
4261 rtl_set_bbreg(hw, 0x978, 0x000007FF, (tx_y0_rxk[cal])>>21&0x000007ff); in _rtl8821ae_iqk_tx()
4262 rtl_set_bbreg(hw, 0x978, BIT(31), 0x1); in _rtl8821ae_iqk_tx()
4263 rtl_set_bbreg(hw, 0x97c, BIT(31), 0x0); in _rtl8821ae_iqk_tx()
4264 /* ODM_SetBBReg(pDM_Odm, 0xcb8, 0xF, 0xe); */ in _rtl8821ae_iqk_tx()
4265 rtl_write_dword(rtlpriv, 0x90c, 0x00008000); in _rtl8821ae_iqk_tx()
4266 rtl_write_dword(rtlpriv, 0x984, 0x0046a911); in _rtl8821ae_iqk_tx()
4268 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x1); /* [31] = 1 --> Page C1 */ in _rtl8821ae_iqk_tx()
4269 rtl_write_dword(rtlpriv, 0xc80, 0x38008c10);/* TX_TONE_idx[9:0], TxK_Mask[29] TX_Tone = 16 */ in _rtl8821ae_iqk_tx()
4270 rtl_write_dword(rtlpriv, 0xc84, 0x18008c10);/* RX_TONE_idx[9:0], RxK_Mask[29] */ in _rtl8821ae_iqk_tx()
4271 rtl_write_dword(rtlpriv, 0xc88, 0x02140119); in _rtl8821ae_iqk_tx()
4273 rtl_write_dword(rtlpriv, 0xc8c, 0x28160d00); /*pDM_Odm->SupportInterface == 1*/ in _rtl8821ae_iqk_tx()
4275 …rtl_write_dword(rtlpriv, 0xcb8, 0x00100000);/* cb8[20] \B1N SI/PI \A8ϥ\CE\C5v\A4\C1\B5\B9 iqk_dpk … in _rtl8821ae_iqk_tx()
4277 cal_retry = 0; in _rtl8821ae_iqk_tx()
4280 rtl_write_dword(rtlpriv, 0x980, 0xfa000000); in _rtl8821ae_iqk_tx()
4281 rtl_write_dword(rtlpriv, 0x980, 0xf8000000); in _rtl8821ae_iqk_tx()
4284 rtl_write_dword(rtlpriv, 0xcb8, 0x00000000); in _rtl8821ae_iqk_tx()
4285 delay_count = 0; in _rtl8821ae_iqk_tx()
4287 iqk_ready = rtl_get_bbreg(hw, 0xd00, BIT(10)); in _rtl8821ae_iqk_tx()
4298 rx_fail = rtl_get_bbreg(hw, 0xd00, BIT(11)); in _rtl8821ae_iqk_tx()
4299 if (rx_fail == 0) { in _rtl8821ae_iqk_tx()
4300 rtl_write_dword(rtlpriv, 0xcb8, 0x06000000); in _rtl8821ae_iqk_tx()
4301 rx_x0[cal] = rtl_get_bbreg(hw, 0xd00, 0x07ff0000)<<21; in _rtl8821ae_iqk_tx()
4302 rtl_write_dword(rtlpriv, 0xcb8, 0x08000000); in _rtl8821ae_iqk_tx()
4303 rx_y0[cal] = rtl_get_bbreg(hw, 0xd00, 0x07ff0000)<<21; in _rtl8821ae_iqk_tx()
4307 rtl_set_bbreg(hw, 0xc10, 0x000003ff, 0x200>>1); in _rtl8821ae_iqk_tx()
4308 rtl_set_bbreg(hw, 0xc10, 0x03ff0000, 0x0>>1); in _rtl8821ae_iqk_tx()
4328 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /* [31] = 0 --> Page C */ in _rtl8821ae_iqk_tx()
4329 rtl_set_rfreg(hw, path, 0x65, RFREG_OFFSET_MASK, temp_reg65); in _rtl8821ae_iqk_tx()
4342 if (tx_average == 0) in _rtl8821ae_iqk_tx()
4345 for (i = 0; i < tx_average; i++) { in _rtl8821ae_iqk_tx()
4348 (tx_x0_rxk[i]) >> 21 & 0x000007ff, i, in _rtl8821ae_iqk_tx()
4349 (tx_y0_rxk[i]) >> 21 & 0x000007ff); in _rtl8821ae_iqk_tx()
4352 (tx_x0[i]) >> 21 & 0x000007ff, i, in _rtl8821ae_iqk_tx()
4353 (tx_y0[i]) >> 21 & 0x000007ff); in _rtl8821ae_iqk_tx()
4355 for (i = 0; i < tx_average; i++) { in _rtl8821ae_iqk_tx()
4375 _rtl8821ae_iqk_tx_fill_iqc(hw, path, 0x200, 0x0); in _rtl8821ae_iqk_tx()
4377 if (rx_average == 0) in _rtl8821ae_iqk_tx()
4380 for (i = 0; i < rx_average; i++) in _rtl8821ae_iqk_tx()
4383 (rx_x0[i])>>21&0x000007ff, i, in _rtl8821ae_iqk_tx()
4384 (rx_y0[i])>>21&0x000007ff); in _rtl8821ae_iqk_tx()
4385 for (i = 0; i < rx_average; i++) { in _rtl8821ae_iqk_tx()
4405 _rtl8821ae_iqk_rx_fill_iqc(hw, path, 0x200, 0x0); in _rtl8821ae_iqk_tx()
4420 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /* [31] = 0 --> Page C */ in _rtl8821ae_iqk_restore_rf()
4421 for (i = 0; i < RF_REG_NUM; i++) in _rtl8821ae_iqk_restore_rf()
4442 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /* [31] = 0 --> Page C */ in _rtl8821ae_iqk_restore_afe()
4444 for (i = 0; i < afe_num; i++) in _rtl8821ae_iqk_restore_afe()
4446 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x1); /* [31] = 1 --> Page C1 */ in _rtl8821ae_iqk_restore_afe()
4447 rtl_write_dword(rtlpriv, 0xc80, 0x0); in _rtl8821ae_iqk_restore_afe()
4448 rtl_write_dword(rtlpriv, 0xc84, 0x0); in _rtl8821ae_iqk_restore_afe()
4449 rtl_write_dword(rtlpriv, 0xc88, 0x0); in _rtl8821ae_iqk_restore_afe()
4450 rtl_write_dword(rtlpriv, 0xc8c, 0x3c000000); in _rtl8821ae_iqk_restore_afe()
4451 rtl_write_dword(rtlpriv, 0xc90, 0x00000080); in _rtl8821ae_iqk_restore_afe()
4452 rtl_write_dword(rtlpriv, 0xc94, 0x00000000); in _rtl8821ae_iqk_restore_afe()
4453 rtl_write_dword(rtlpriv, 0xcc4, 0x20040000); in _rtl8821ae_iqk_restore_afe()
4454 rtl_write_dword(rtlpriv, 0xcc8, 0x20000000); in _rtl8821ae_iqk_restore_afe()
4455 rtl_write_dword(rtlpriv, 0xcb8, 0x0); in _rtl8821ae_iqk_restore_afe()
4467 rtl_set_bbreg(hw, 0x82c, BIT(31), 0x0); /* [31] = 0 --> Page C */ in _rtl8821ae_iqk_restore_macbb()
4469 for (i = 0; i < macbb_num; i++) in _rtl8821ae_iqk_restore_macbb()
4489 0xb00, 0x520, 0x550, 0x808, 0x90c, 0xc00, 0xc50, in _rtl8821ae_phy_iq_calibrate()
4490 0xe00, 0xe50, 0x838, 0x82c in _rtl8821ae_phy_iq_calibrate()
4493 0xc5c, 0xc60, 0xc64, 0xc68, 0xc6c, 0xc70, 0xc74, in _rtl8821ae_phy_iq_calibrate()
4494 0xc78, 0xc7c, 0xc80, 0xc84, 0xcb8 in _rtl8821ae_phy_iq_calibrate()
4496 u32 backup_rf_reg[RF_REG_NUM] = {0x65, 0x8f, 0x0}; in _rtl8821ae_phy_iq_calibrate()
4522 rtl_set_bbreg(hw, RA_RFE_PINMUX + 4, BIT(29) | BIT(28), 0x1); in _rtl8821ae_phy_set_rfpath_switch()
4524 rtl_set_bbreg(hw, RA_RFE_PINMUX + 4, BIT(29) | BIT(28), 0x2); in _rtl8821ae_phy_set_rfpath_switch()
4573 for (i = 0; i < IQK_MATRIX_SETTINGS_NUM; i++) { in rtl8821ae_reset_iqk_result()
4574 rtlphy->iqk_matrix[i].value[0][0] = 0x100; in rtl8821ae_reset_iqk_result()
4575 rtlphy->iqk_matrix[i].value[0][2] = 0x100; in rtl8821ae_reset_iqk_result()
4576 rtlphy->iqk_matrix[i].value[0][4] = 0x100; in rtl8821ae_reset_iqk_result()
4577 rtlphy->iqk_matrix[i].value[0][6] = 0x100; in rtl8821ae_reset_iqk_result()
4579 rtlphy->iqk_matrix[i].value[0][1] = 0x0; in rtl8821ae_reset_iqk_result()
4580 rtlphy->iqk_matrix[i].value[0][3] = 0x0; in rtl8821ae_reset_iqk_result()
4581 rtlphy->iqk_matrix[i].value[0][5] = 0x0; in rtl8821ae_reset_iqk_result()
4582 rtlphy->iqk_matrix[i].value[0][7] = 0x0; in rtl8821ae_reset_iqk_result()
4672 rtl8821ae_dm_write_dig(hw, 0x17); in rtl8821ae_phy_set_io()
4674 rtl8821ae_dm_write_cck_cca_thres(hw, 0x40); in rtl8821ae_phy_set_io()
4692 rtl_write_byte(rtlpriv, REG_SPS0_CTRL, 0x2b); in rtl8821ae_phy_set_rf_on()
4693 rtl_write_byte(rtlpriv, REG_SYS_FUNC_EN, 0xE3); in rtl8821ae_phy_set_rf_on()
4694 rtl_write_byte(rtlpriv, REG_SYS_FUNC_EN, 0xE2); in rtl8821ae_phy_set_rf_on()
4695 rtl_write_byte(rtlpriv, REG_SYS_FUNC_EN, 0xE3); in rtl8821ae_phy_set_rf_on()
4696 rtl_write_byte(rtlpriv, REG_TXPAUSE, 0x00); in rtl8821ae_phy_set_rf_on()
4715 u32 initializecount = 0; in _rtl8821ae_phy_set_rf_power_state()
4742 for (queue_id = 0, i = 0; in _rtl8821ae_phy_set_rf_power_state()
4746 skb_queue_len(&ring->queue) == 0) { in _rtl8821ae_phy_set_rf_power_state()