RSSI calibration is done for three RSSI types 0-2 (maybe CCK/OFDM/N?)
steps to take
- back up classifier control (lower three bits)
- turn on waited, off CCK and OFDM in classifier control
- back up Core 1 and Core 2 Clip1 threshold values
write Core 1 and Core 2 Clip1 threshold values (FIXME: hi16(.rodata)+0x30000->_5e04)
- back up PHY (not radio Broadcom...) register 0x91
- back up radio register 0x17
write 0x140 to PHY register 0x91
- write 6 to radio register 0x17
- back up PHY register 0x92
- back up radio register 0x1b
- write 0x140 to phy register 0x92
- write 6 to radio register 0x1b
- back up radio registers 0x18 and 0x1c
- clear the lowest three bits in radio registers 0x18 and 0x1c
- back up radio register 0x3
- back up radio register 0x5
- set RSSI selection to the given RSSI type for core 5 (?)
- scale RSSI offset (FIXME, 0, 0, 0, 5, 0, rssi type)
- scale RSSI offset (FIXME, 0, 0, 0, 5, 1, rssi type)
- [FIXME: ...big loop and if mess...]
- scale RSSI offset (FIXME, 0, ?, ?, ?, 0, rssi type)
- restore the lower three bits of radio registers 0x18 and 0x1c
- set RSSI selection to ...?? for core ...??
- set RSSI selection to ...?? for core ...??
- set RSSI selection to ...?? for core ...??
- restore PHY register 0x91
- restore PHY register 0x92
- restore radio register 0x1b
- restore classifier control
- restore Core 1 and Core 2 Clip1 threshold values