Switch Table: Basic Operation
Overview
A switch table is a set of entries to control an external antenna switch based on the current configuration of the wireless device.
There's a few things that need twiddling:
- The radio has separate TX and RX connections, yet there's a shared TX/RX antenna. Thus there needs to be a way to switch in the TX and RX line into the antenna.
- On earlier devices, there were a handful of external RX attenuation stages to reduce the signal level in preparation to hand to the radio. So the wireless hardware may wish to try different attenuation settings to size the received signal correctly. Later Atheros devices don't require this - they do it on-chip.
- When using multiple antennas for transmit/receive, the results of the above antenna switch is combined with another bit which controls which one of many physical antennas. That way antenna diversity can be implemented.
So what's it look like?
On the Atheros hardware, there'll be a common switch table and one or more antenna switch tables.
Each table has a set of output bits which are set based on the current state of the MAC/baseband, and some other configuration (eg antenna selection.) For each state, there's 'n' bits (where 'n' is the number of output bits being controlled) in that particular antenna switch table entry.
The set of MAC states generally looks something like this:
- Idle
- TX
- RX with no attenuation
- RX with first attenuation
- RX with second attenuation
- Bluetooth coexistence
Normally the "common" switch table (shared among all radio chains) just has idle, TX, RX, bluetooth. The per-radio switch table includes the attenuation stages.
In addition, there may be different configuration settings based on whether the device is operating in 2GHz or 5GHz.
The switch table is stored in EEPROM.
- For AR5210, there's one antenna switch configuration, as the unit is only 5GHz
- For AR5211/AR5212, there's one antenna switch configuration for each operating mode (11a, 11b, 11g).
- For AR5416 and later 11n devices, there's one antenna switch configuration for each operating mode (2GHz, 5GHz) and one antenna configuration for each radio chain.
Per-chipset antenna switch registers
TODO