Since a lot of things with this chipset are software controlled, a bunch of things need to be done periodically.
Obvious tasks are not listed
These tasks are only done if the device is up!
Approximately Every Second
- For GPHYs
Fetch the current ACI StatsCounter value and save it
Average the last 8 saved ACI StatsCounter values, this is the ACI Moving Average
- If the current interference mode is set to Non WLAN and the PHY revision is 1
Read SHM offset 0xAE (Yes, this is the StatsCounter value, but it's not used as above)
If bit 0x4000 is set in PHYRegister 0x429 (Reading PHY Registers is slow, keep this state in memory)
If the saved value of SHM offset 0xAE isn't 0 and the value of SHM offset 0xAE - the saved value of SHM offset 0xAE is 1501 or greater
Enable the PHYRegisterLock
Unset bit 0x4000 in PHYRegister 0x429
Disable the PHYRegisterLock
- Otherwise
If more than 30 seconds have passed since bit 0x4000 was unset in PHYRegister 0x429
Enable the PHYRegisterLock
Set bit 0x4000 in PHYRegister 0x429
Disable the PHYRegisterLock
Save the value of SHM offset 0xAE
- If the current interference mode is set to WLAN Auto
If the "Do ACI" flag isn't set (see ACI Flags)
- If the ACI Moving Average is less than 200
Perform an ACI Scan
- If the result of the scan indicates interference
Enable WLAN Manual mode as shown in InterferenceCalculation
- Update the ACI Start time
- If the result of the scan indicates no interference
- Delay scanning again for 20 seconds
- Otherwise, if 60 seconds have passed since the ACI Start time
- If the ACI Moving Average is greater than 1000
Perform an ACI Scan
- If the result of the scan doesn't show any interference
Disable WLAN Manual mode as shown in InterferenceCalculation
Approximately Every 15 Seconds
RecalculateTransmissionPower (FIXME: unless scanning?)
for A PHYs (FIXME, temperature?)
Approximately Every 30 Seconds
- Update Statistics
Update each StatsCounter by reading it, but ignore the returned value
FIXME other stats?
Approximately Every Minute
If HardwarePowerControl isn't enabled
- Mark all of the LO Control array values as unused
If BoardFlags BFL_RSSI is set
Do an NRSSISlopeCalculation
If this is an 0x2050 Radio with Radio Revision 8 (VCO Calibration)
- If the current channel is 8 or greater
- Set the channel to 1
- Otherwise
- Set the channel to 13
- Set the channel back to the current channel
- If the current channel is 8 or greater
Approximately Every 2 Minutes
On G PHYs with revision >= 2
If HardwarePowerControl is enabled
- Mark all of the LO Control array values as unused