Using the external shift register support for transmit antenna diversity
Overview
The AR5416 and later chips have extended the "sectored antenna" support concept from a 4-bit antenna selection to 24 bits. This allows for much more interesting external antenna designs.
Implementation
Instead of using the external antenna switch pins for configuring transmit antennas, the hardware can optionally shift out an antenna configuration via GPIO pins. This is done on a per-packet basis, based on what is set in the TX descriptor.
The hardware defaults to the contents of AR_DEF_ANTENNA when waiting for an incoming frame.
Two GPIO pins are required - one clock and one data. The GPIO MUX register needs to be configured for each pin you wish to use:
- Configure one GPIO up as the strobe (MUX 15 - HAL_GPIO_OUTPUT_MUX_AS_RUCKUS_STROBE)
- Configure one GPIO up as the data (MUX 16 - HAL_GPIO_OUTPUT_MUX_AS_RUCKUS_DATA)
Then, configure AR_DEF_ANTENNA with the default antenna configuration for receive.
When receiving, the MAC will copy the contents of AR_DEF_ANTENNA to the receive completion descriptor field RxAntenna. It's a 24 bit field.
When transmitting, each transmit series has a 24 bit antenna configuration field. This is what is shifted out to the GPIO pins.
Determining which antenna configuration to use
Again, it's likely that the rate control code would be responsible for probing different antenna configurations and selecting the best one for each node.
Unknowns
There are a few unknowns here!
- What does the hardware do for RTS transmit and CTS reception? Does it leave the antenna configured as-is, or does it use the default antenna configuration?
- What happens if the shift register "skips" a bit somehow? Is there an easy way to reset the shift register?
- .. eg, by monitoring another GPIO line configured as RX_CLEAR ?
- .. eg, by monitoring another GPIO line configured as TX_FRAME ?
- Is RX_CLEAR asserted when the MAC is waiting for an ACK, or just when it's waiting for some arbitrary frame?
It's possible that if this kind of reset is needed to keep things in sync over time, part of the MAC state could be exposed via the MAC observation bus over GPIO lines and used to reset the antenna configuration. But until someone builds a phased antenna array + shift register and starts testing it out, it's all an unknown.