WiFi is divided into MAC layer and PHY layer.
(Purely scare)
Frames (MPDU) is divided into the following parts:
{MAC_HDR, {PHY_HDR, PSDU}}, FCS。
MAC_HDR: RA, TA, VHT/HT/HE, MU/SU GROUP ID,BSSID, LENGTH, AMPDU or MPDU flag, CIPHER_TYPE, defragement or not, duration, MANAGE/CONTROL/DATA timestamp等。
PHY_HDR: AMSDU or MSDU, PHY_MODE, PHY_RATE等。
Corresponding sequences: parse MAC_HDR, check LENGTH,
Corresponding caching mechanism: Use a RxPHY_FIFO to cache data, 256 depthx 64 bits.
Use another RxParseFIFO, 64 depth x 64 bits. This is used to buffer related data, waiting to be unpacked. Need to cache a frame.
Then use RxCache, this part is 8196x64 bits. This part is because DMA moves slowly, so it is needed.
The data that comes out includes data in RxCache, RxCmdFIFO, and Descriptor.
RxCmdFIFO is used by MAC's own DMA (in Aribitor) for data transfer. It contains Descriptor (this Descriptor is not the same as the Descriptor below), Buffer, which also contains the descriptor and buffer of the current buffer list. Since the descriptor is also updated as the buffer is continuously updated (data packets are constantly being parsed), the descriptor will only be truly determined after the entire PSDU has been received. It has the following structure:
The situation of MPDU and MSDU (neither aggregated):
Buffer HDR PADDING MAC HDR msdu payload TRAILER FCS Descriptor
The situation of AMSDU:
Buffer0 HDR PADDING MAC HDR sub-msdu payload Descriptor
Buffer1 HDR PADDING MAC HDR sub-msdu payload
Buffer2 HDR PADDING MAC HDR sub-msdu payload TRAILER FCS
In the case of AMPDU, since the buffer arrangement is a self-linked form, there is no need to be different from AMSDU.
Correspondingly, in the case of MPDU and MSDU, it should be possible to make a completely similar way to the A series.
Descriptor is the interface between provided and software. Contains: AMSDU or MSDU, AMPDU or MPDU, BufferAddr. Next Buffer or next Descriptor. Last MSDU or not. All data storage is defined by MAC itself. The advantage of such an interface is that it reduces software intervention in data scheduling and improves efficiency as much as possible.