Loopback Gain Supported
If the PHY Revision is 2 or greater or if Core Flags has the G Mode Enable flag (0x20000000) set, Loopback Gain is enabled.
Find the Loopback Gain
Backup PHY Registers 0x429, 0x1, 0x811, 0x812, 0x814, 0x815, 0x5A, 0x59, 0x58, 0xA, 0x3, 0x80F, 0x810, 0x2B, 0x15, 0x2D
- Back up the current Baseband Attenuation
Back up Radio Registers 0x52, 0x43, 0x7A
AND PHY Register 0x429 with 0x3FFF
OR PHY Register 0x1 with 0x8000
OR PHY Register 0x811 with 0x0002
AND PHY Register 0x812 with 0xFFFD
OR PHY Register 0x811 with 0x0001
AND PHY Register 0x812 with 0xFFFE
OR PHY Register 0x814 with 0x0001
AND PHY Register 0x815 with 0xFFFE
OR PHY Register 0x814 with 0x0002
AND PHY Register 0x815 with 0xFFFD
OR PHY Register 0x811 with 0x000C
OR PHY Register 0x812 with 0x000C
OR PHY Register 0x811 with 0x30
MaskSet PHY Register 0x812 with mask 0xFFCF and set with 0x10
Write 0x780 to PHY Register 0x5A
Write 0xC810 to PHY Register 0x59
Write 0x000D to PHY Register 0x58
OR PHY Register 0xA with 0x2000
OR PHY Register 0x814 with 0x4
AND PHY Register 0x815 with 0xFFFB
MaskSet PHY Register 0x3 with mask 0xFF9F and set with 0x40
- If the Radio Revision is 8
Write 0xF to Radio Register 0x43
- Otherwise
Write 0 to Radio Register 0x52
MaskSet Radio Register 0x43 with mask 0xFFF0 and set with 0x9
- Set the Baseband Attenuation to 0xB
- If the PHY Revision is 3 or greater
Write 0xC020 to PHY Register 0x80F
- Otherwise
Write 0x8020 to PHY Register 0x80F
Write 0 to PHY Register 0x810
MaskSet PHY Register 0x2B with mask 0xFFC0 and set with 1
MaskSet PHY Register 0x2B with mask 0xC0FF and set with 0x800
OR PHY Register 0x811 with 0x100
AND PHY Register 0x812 with 0xCFFF
If the PHY Revision is 7 or greater and the EXT_LNA flag is set in Board Flags
OR PHY Register 0x811 with 0x800
OR PHY Register 0x812 with 0x8000
AND Radio Register 0x7A with 0xF7
- Loop 0xF times if the Radio Revision is 8, 9 times otherwise (starting with the maximum value and going down)
- Loop 16 times
Write the outer loop position to Radio Register 0x43
MaskSet PHY Register 0x812 with mask 0xF0FF and set with the current inner loop value left shifted by 8
MaskSet PHY Register 0x15 with mask 0x0FFF and set with 0xA000
OR PHY Register 0x15 with 0xF000
- Delay 20 uSec
If the value of PHY Register 0x2D is 0xDFC or greater, break out of the loops
- Loop 16 times
- If the number of times last through the inner loop was 8 or greater
OR PHY Register 0x812 with 0x30
- Start with a TRSW RX Gain value of 0x1B
- Starting with the number of times through the inner loop - 8, loop up to 16 times, incrementing the inner loop value each time
MaskSet PHY Register 0x812 with mask 0xF0FF and set with the current loop value left shifted by 8
MaskSet PHY Register 0x15 with mask 0x0FFF and set with 0xA000
OR PHY Register 0x15 with 0xF000
- Delay 20 uSec
- Decrease the TRSW RX Gain value by 3
If the value of PHY Register 0x2D is 0xDFC or greater, break out of the loop
- Otherwise
- The TRSW RX Gain value is 0x18
Restore PHY Registers 0x814, 0x815, 0x5A, 0x59, 0x58, 0xA, 0x3, 0x80F, 0x810, 0x2B, 0x15
- Restore the Baseband Attenuation
Restore Radio Registers 0x52, 0x43, 0x7A
Restore PHY Register 0x811 OR'd with 3
- Delay 10 uSec
Restore PHY Registers 0x811, 0x812, 0x429, 0x1
- Find and save the Maximum Loopback Gain in hdB:
- Take the last number of loops from the first inner loop times 6, subtract from that the last loop value in the first outer loop times 4 and subtract 0xB from the result
- Save the TRSW RX Gain in hdB by multiplying the TRSW RX Gain value by 2