Operation
Programming checklists
On this page
Steps name the registers they write, with MAC registers given their offset in the MAC window; steps that run a larger routine link to it. For start-up, see the operation overview.
Stopping the radio
When a scan ends without a joined interface. Wait until no transmission is in flight and no received frame is with the host, then:
RADIO_STOP(+0x0a28) = 0,BEACON_CONTROL(+0x0a00) =0x1030_0000, write the last mode value back toRESPONSE_ENABLE(+0x0a04), and point all 32 response pointer slots at the idle descriptor.- Clear
RxDma.CONTROL.ENABLEand wait forACTIVEto clear. A timeout of about 4 s is fatal. - Stop the PHY’s current operation and write
PlatformControl.POWER_CONTROL=0x10. - Discard the frames still in the RX FIFO, one per pass, until it is empty; then mark every interface record idle.
Retuning to a channel
The scheduler returns at once, doing nothing, when the MAC is already on the requested channel with its receiver running. Otherwise:
- Prepare the scan context and the MAC for the channel:
RATE_RAM_BASE(+0x0800),SECOND_PATH(+0x0270) andSECOND_PATH_ENABLE(+0x0314). - Clear
RxDma.CONTROL.ENABLEand wait forACTIVEto clear. - Unless the PHY is already on this channel in the same mode with no calibration pending, run the full RF initialization: the PHY register lists;
POWER_CONTROL=0x11, about 40 µs, then 1, if its bit 0 reads clear; the gain tables and the receive band. - Program the channel PLL.
- Program the measurement timing and measure the temperature. Run a calibration if step 3 ran and the calibration cache asks for one. Enable AGC and program the channel’s transmit power and gain.
- Wait 120 µs.
- Set
ENABLEagain and write the scan values toRESPONSE_ENABLE,RESPONSE_MASK,FILTER,MODEandTIMING_310.
When a station transmits again after a retune and the PHY’s retained state says the MAC needs it, the firmware first rewrites RATE_RAM_BASE, the rate tables of every active record, the response descriptors and MODE, then writes 0 to DEBUG_CONTEXT_4 to DEBUG_CONTEXT_10 and finally to DEBUG_CONTEXT (+0x1400).
Restoring the joined state
After retuning to the operating channel, a station returns to its joined configuration:
- Program the interface’s slot timings.
- Reprogram the interface’s rate tables.
- Rebuild the ACK, CTS and BlockAck response descriptors and install their pointer slots.
- Write the BSSID:
BSSID_LOW,BSSID_HIGH, thenBSSID_MODE=0x301. - Write the joined values:
RESPONSE_ENABLE=0x0018_0783,RESPONSE_MASK=0x827b_ffdf,FILTER=0x0279_fe00,MODEas computed inMODE, andTIMING_310=0x7800_0000.
Beacon start and stop
- Build response command 3: its header words and beacon stream.
- Start: put the idle descriptor in pointer slot 16, and write
BEACON_AIRTIME(+0x0e94) with the airtime of 24 octets at the beacon rate. - Arm: point slot 0 at response command 3;
BEACON_CONTROL=0x1030_0001;BEACON_TIMER(+0x0e08) =0x4000_0000 | (tbtt & 0x00ff_ffff). - Disarm:
BEACON_TIMER= 0;BEACON_CONTROL=0x1030_0000; point slot 0 at the idle descriptor.
Publishing one HIF output message
- Enqueue. Write the message, header included, into a free output buffer, or for a received frame into its RX FIFO slot, and add it to the 64-entry software queue.
- Stage, while fewer than four messages are on the ring: rewrite the ID with its 3-bit sequence number; write the descriptor’s bus address and
CONTROL = ((length + 1) & 0x1ffe) | 1withSEQUENCEfrom the ID as queued; advance the producer; drain the write buffer. - Reclaim on
STATUS.TX_DONE, as described under Ownership, which stages the next queued message before releasing the buffer.
Resolving an A-MPDU
- On the slot’s completion status, free the slot.
- Find the compressed BlockAck in the RX FIFO and match it to the aggregate by peer, TID and starting sequence number.
- Complete the members whose bitmap bit is set.
- Put the others back at the head of the queue, oldest first. If the BlockAck does not come in time, treat every member as missing.
- After two aggregate transmissions, send a still-missing member alone; the host’s retry policy takes over.