N PHY Spur Workaround
- Initialize the current channel to 0
- Initialize an int 2-element tone buffer with values 57 and 58
- Initialize a u32 2-element noise buffer with values 0x3FF and 0x3FF
If the PHY revision >= 3
If phyhang_avoid is not zero
Call N PHY Stay in Carrier Search with argument 1
Extract the current channel from radio_chanspec
If nphy_gband_spurwar_en is not zero
Call N PHY Adjust Analog Pfbw with argument 7
- If the current channel is 11 AND the current channel width is 40 MHz
Call N PHY Adjust Min Noise Var with 2, the tone buffer, and the noise buffer as arguments
- Otherwise
Call N PHY Adjust Min Noise Var with 0, NULL, and NULL as arguments
Call N PHY Adjust CRS Min Power with 0x1E as argument
If nphy_aband_spurwar_en is not zero
- If the current channel is 54
- Set element 0 of the tone buffer to 0x20
- Set element 0 of the noise buffer to 0x25F
- Else if the current channel is 38, 102, or 118
- If the chip is 0x4716 and the chip package is 9
- Set element 0 of the tone buffer to 0x20
- Set element 0 of the noise buffer to 0x21F
- Otherwise
- Set element 0 of the tone buffer to 0
- Set element 0 of the noise buffer to 0
- If the chip is 0x4716 and the chip package is 9
- Else if the current channel is 134
- Set element 0 of the tone buffer to 0x20
- Set element 0 of the noise buffer to 0x21F
- Else if the current channel is 151
- Set element 0 of the tone buffer to 0x10
- Set element 0 of the noise buffer to 0x23F
- Else if the current channel is 153 or 161
- Set element 0 of the tone buffer to 0x30
- Set element 0 of the noise buffer to 0x23F
- Otherwise
- Set element 0 of the tone buffer to 0
- Set element 0 of the noise buffer to 0
- If the 0th element of the tone buffer and the 0th element of the noise buffer are both 0
Call N PHY Adjust Min Noise Var with 1, the tone buffer, and the noise buffer as arguments
- Otherwise
Call N PHY Adjust Min Noise Var with 0, NULL, and NULL as arguments
- If the current channel is 54
If phyhang_avoid is not zero
Call N PHY Stay in Carrier Search with argument 0