# B PHYs

If this isn't a B PHY or doesn't have an 0x2050 Radio or BFL_RSSI isn't set in BoardFlags, we can't set the NRSSIThreshold.

- If the Radio Revision is 6 or greater
- The threshold value is 32 * the difference between the second saved NRSSI value and the first saved NRSSI value, plus 20 * one more than the first saved NRSSI value
- Divide the result by 40

- Otherwise
- The threshold value is the second saved NRSSI vlaue - 5

- Limit the threshold value to between 0 and 0x3E
Perform a dummy read on PHYRegister 0x20

Write the threshold value left shifted by 8 and bitwise OR'd by 0x1C to PHYRegister 0x20

- If the Radio Revision is 6 or greater
Write 0xE0D to PHYRegister 0x87

Write 0xC0B to PHYRegister 0x86

Write 0xA09 to PHYRegister 0x85

Write 0x808 to PHYRegister 0x84

Write 0x808 to PHYRegister 0x83

Write 0x604 to PHYRegister 0x82

Write 0x302 to PHYRegister 0x81

Write 0x100 to PHYRegister 0x80

# G PHYs with PHYConnected set to false or BoardFlags BFL_RSSI is unset

Find offset 0x20 in the hardware NRSSILookupTable

If this value is >= 0x20

- Subtract 0x40 from this value

If the value is < 3

MaskSet PHYRegister 0x48A with mask 0xF000 and set 0x9EB (This corresponds to threshold values of -25 and -21)

- Otherwise
MaskSet PHYRegister 0x48A with mask 0xF000 and set 0xAED (This corresponds to threshold values of -21 and -19)

# G PHYs Otherwise

In the calculations below, use 32 bit signed values.

- If the interference mode is set to Non WLAN
- For the first calculation, start with 0xE and for the second, start with 0xA

If the interference mode isn't set to Automatic and the "Do ACI" flag (see ACI Flags) is set

- For the first calculation, start with 0x13 and for the second, start with 0x12

- Otherwise
- For the first calculation, start with 0xE and for the second, start with 0x11

- Multiply the first starting value with by difference between the second saved NRSSI value and the first saved NRSSI value, then add the first saved NRSSI value left shifted by 6 to the result
If the result is < 0x20, add 0x1F, otherwise, add 0x20

- Right shift the result by 6 and clamp between -0x1F and 0x1F, the lower 6 bits of the result are used as the top 6 bits of the 12 bit value below
- Multiply the second starting value with by difference between the second saved NRSSI value and the first saved NRSSI value, then add the first saved NRSSI value left shifted by 6 to the result
If the result is < 0x20, add 0x1F, otherwise, add 0x20

- Right shift the result by 6 and clamp between -0x1F and 0x1F, the lower 6 bits of the result are used as the lower 6 bits of the 12 bit value below
MaskSet PHYRegister 0x48A with mask 0xF000 and set the lower 12 bits with values found above