WARP Project Forums - Wireless Open-Access Research Platform

You are not logged in.

#1 2015-Sep-30 01:14:12

zhimeng
Member
Registered: 2015-Sep-30
Posts: 47

Relationship between c and FPGA code on the MAC

Hi, I am a beginner who tries to change the current MAC protocol on warp.
As a newbie, I find myself easily lost, since some code is written in C, while the other is written on the FPGA core (such as SIFS and DIFS waiting). Do you have some suggestions for getting a whole picture of the MAC implementation? For example, I want to change the transmission speed in the frame_transmit function in the wlan_mac_dcf, but I can't find out how is this function called by other programs.
Thanks very much in advance.

Offline

 

#2 2015-Sep-30 08:56:03

welsh
Administrator
From: Mango Communications
Registered: 2013-May-15
Posts: 612

Re: Relationship between c and FPGA code on the MAC

The easiest place to start would be the "NO MAC" reference design.  This is the minimal implementation of a lower-level MAC.  Hopefully, this will allow you to get a better sense of the interaction between various parts of the code.  The main thing to remember, is that the reference design extensively uses interrupts and callbacks in order to process events.  The interrupts allow the reference design to be more efficient when processing events; while the callbacks allow the reference design to be divided into MAC specific code and framework code that is common to all MACs.  Therefore, when you are looking at how functions are called, you have to also understand if that function is used as a callback and where the callback is invoked.

For example, in the case of the frame transmit of the DCF MAC, while the function itself is defined here, you can see that in main() the frame_transmit function is set as the "frame_tx_callback" for the wlan_mac_low_framework.  Then if we look at the wlan_mac_low_framework code in wlan_mac_low.c, you can see where the callback is invoked (i.e. as part of an IPC communication process between CPU High and CPU Low where CPU High tells CPU Low that a "TX_MPDU_READY").  If you study this case statement, you can see that the rate of the transmission used in the frame_tx_callback is set in the TX MPDU PHY parameters.  The TX MPDU comes from a packet buffer that serves as a data communication channel between CPU High and CPU Low, which is documented here.

Hopefully that helps get you started in understanding the reference design.  Just remember that the "Search" --> "File..." dialog in the SDK is very useful when looking for how functions are connected when you use "File name patterns" = "*.h, *.c".

Offline

 

#3 2015-Sep-30 14:50:20

zhimeng
Member
Registered: 2015-Sep-30
Posts: 47

Re: Relationship between c and FPGA code on the MAC

Thank you very much for your information.
Previously, I am not clear about the interaction between callback functions and other normal c code. Now I can understand this part.
Thank you again for your help.

Offline

 

Board footer