4.2. MAC Software Framework

The Mango 802.11 Design implements most of the MAC stack in C code running in two CPUs in the FPGA design. The design includes reference MAC applications for both CPUs. These applications rely on software frameworks which implement common functionality and provide abstraction from the underlying hardware.

Interprocessor Communications (IPC)

Coordination between the two CPUs takes place using a custom IPC subsystem. This framework relies on shared on-chip memory (OCM) to read and write messages alongside software interrupts to inform the partner processor that a new message is available. The IPC subsystem presents a simple interface to the MAC applications for passing messages that abstracts away the maintenance of the circular buffer that stores the message contents as well as cache flushing and invalidation.

Mutex Locks

The framework presents mutex locks to the MAC applications for tasks that require tight synchronization between the processors. Example uses of the mutex locks include:

  • Printing to a shared UART
  • Synchronized booting
  • Tx Packet Buffer protection

Synchronized Booting

As each processor is brought online, there are configuration tasks that can run independently from the partner processor and there are tasks that require the other processor to have booted sufficiently to deal with coordination efforts. The framework formalizes a boot process where each processor will wait on the partner processor before proceeding. MAC application code is executed only when it safe to do so.

Direct Memory Access (DMA)

The framework wraps DMA transactions so MAC applications can choose whether to copy memory contents manually with their processor or offload the copy to the DMA hardware.


Both processors rely heavily on interrupts to react to events taking place in hardware. The framework configures the shared interrupt hardware and presents an interface to MAC applications to connect new interrupt sources to application callbacks.