N PHY Run Samples (u16 samps, u16 loops, u16 wait, u8 iqmode, u8 dac_test)
If phyhang_avoid is TRUE
Call N PHY Stay in Carrier Search with argument TRUE
If nphy_bb_mult_save & 0x80000000 is zero
- Read the N PHY Table with ID 15, length 1, offset 87, width 16, and tmp as data pointer
Set nphy_bb_mult_save to (tmp & 0xFFFF) | 0x80000000
- If the band width is 40 MHz
Set tmp to 71 << 8 + 71
- Otherwise
Set tmp to 100 << 8 + 100
- Write N PHY Table with ID 15, length 1, offset 87, width 16, and data tmp
If phyhang_avoid is TRUE
Call N PHY Stay in Carrier Search with argument FALSE
- Write samps - 1 to PHY Register 0xC6
- If loops not equal to 0xFFFF
- Write loops - 1 to PHY Register 0xC4
- Otherwise
- Write loops to PHY Register 0xC4
- Write wait to PHY Register 0xC5
- Save the contents of PHY Register 0xA1
- Set bit 1 in PHY Register 0xA1
- If iqmode not equal to 0
- Mask PHY Register 0xC2 with mask 0x7FFF
- Set bit 0x8000 in PHY Register 0xC2
- Otherwise
- If dac_test is equal to 1
- Write 5 to PHY Register 0xC3
- Otherwise
- Write 1 to PHY Register 0xC3
- If dac_test is equal to 1
- Spin Wait on bit 1 set in PHY Register 0xA4, wait for a maximum of 1000 usec, test every 10 usec
- Restore the original contents of PHY Register 0xA1