N PHY Restore Calibration
- Establish a 4-element u16 array named coef
- Establish 2 u16 pointers named loft and table
- If the band type is 2 GHz
If nphy_iqcal_chanspec_2G is zero
- Return
Set table to calibration_cache.txcal_coeffs_2G
Set loft to calibration_cache.txcal_coeffs_2G[5]
- Otherwise
If nphy_iqcal_chanspec_5G is zero
- Return
Set table to calibration_cache.txcal_coeffs_5G
Set loft to calibration_cache.txcal_coeffs_5G[5]
- Write an N PHY table with ID 15, length 4, offset 80, width 16, and data from table
- Loop 4 times with index i
If PHY Revision >= 3
- Copy table[i] to coef[i]
- Otherwise
- Set coef[i] to 0
- Write an N PHY table with ID 15, length 4, offset 88, width 16, and data from coef
- Write an N PHY table with ID 15, length 2, offset 85, width 16 and data from loft
- Write an N PHY table with ID 15, length 2, offset 93, width 16 and data from loft
- If PHY Revision less than 2
- If the band type is 2 GHz
If the PHY Revision >= 3
Write calibration_cache.txcal_radio_regs_2G[0] to Radio Register 0x2021
Write calibration_cache.txcal_radio_regs_2G[1] to Radio Register 0x2022
Write calibration_cache.txcal_radio_regs_2G[2] to Radio Register 0x3021
Write calibration_cache.txcal_radio_regs_2G[3] to Radio Register 0x3022
Write calibration_cache.txcal_radio_regs_2G[4] to Radio Register 0x2023
Write calibration_cache.txcal_radio_regs_2G[5] to Radio Register 0x2024
Write calibration_cache.txcal_radio_regs_2G[6] to Radio Register 0x3023
Write calibration_cache.txcal_radio_regs_2G[7] to Radio Register 0x3024
- Otherwise
Write calibration_cache.txcal_radio_regs_2G[0] to Radio Register 0x8B
Write calibration_cache.txcal_radio_regs_2G[1] to Radio Register 0xBA
Write calibration_cache.txcal_radio_regs_2G[2] to Radio Register 0x8D
Write calibration_cache.txcal_radio_regs_2G[3] to Radio Register 0xBC
Call N PHY RX IQ Coefficients with 1, calibration_cache.rxcal_coeffs_2G as arguments
- Otherwise
If the PHY Revision >= 3
Write calibration_cache.txcal_radio_regs_5G[0] to Radio Register 0x2021
Write calibration_cache.txcal_radio_regs_5G[1] to Radio Register 0x2022
Write calibration_cache.txcal_radio_regs_5G[2] to Radio Register 0x3021
Write calibration_cache.txcal_radio_regs_5G[3] to Radio Register 0x3022
Write calibration_cache.txcal_radio_regs_5G[4] to Radio Register 0x2023
Write calibration_cache.txcal_radio_regs_5G[5] to Radio Register 0x2024
Write calibration_cache.txcal_radio_regs_5G[6] to Radio Register 0x3023
Write calibration_cache.txcal_radio_regs_5G[7] to Radio Register 0x3024
- Otherwise
Write calibration_cache.txcal_radio_regs_5G[0] to Radio Register 0x8B
Write calibration_cache.txcal_radio_regs_5G[1] to Radio Register 0xBA
Write calibration_cache.txcal_radio_regs_5G[2] to Radio Register 0x8D
Write calibration_cache.txcal_radio_regs_5G[3] to Radio Register 0xBC
Call N PHY RX IQ Coefficients with 1, calibration_cache.rxcal_coeffs_5G as arguments