WARP Project Forums - Wireless Open-Access Research Platform

You are not logged in.

#1 2021-Mar-23 11:48:36

amirsepahi
Member
Registered: 2020-Dec-09
Posts: 9

Adding a new field to the MAC frame

Hi,
I want to add a new field which is 10bits to the MAC frame. I want to know if I could use address_4 which is commented in the original code for this purpose or not. Also, when I try to use address_4, I get these errors in wlan_mac_queue.h:

size of array 'ASSERT_TYPE_SIZE_FAILED_eth_rx_queue_buffer_t_neq_QUEUE_ELEMENT_SIZE' is negative

and

size of array 'ASSERT_FIELD_ALIGNMENT_FAILED_eth_rx_queue_buffer_t_member_neq_16' is negative

Do you have any idea how I can modify these errors?

One more thing is that if I want to use 10 bits of payload for this new field instead of address_4 in MAC header, which part of the code should I look at?
I have looked at the code but I am not sure where and how I should add my new field.

Thanks!

Offline

 

#2 2021-Mar-24 09:35:45

murphpo
Administrator
From: Mango Communications
Registered: 2006-Jul-03
Posts: 5159

Re: Adding a new field to the MAC frame

The size of the standard MAC header is fixed in the packet formats defined in the standard. The addr4 field is not used in any of the packet formats supported by the 802.11 Reference Design for WARP v3. Defining a custom packet format is probably easier than modifying every use of the standard MAC header.

Offline

 

#3 2021-Mar-26 03:43:36

amirsepahi
Member
Registered: 2020-Dec-09
Posts: 9

Re: Adding a new field to the MAC frame

Thanks!
Could you please explain more about how can I define a custom packet format? or which .c or .h file I should look at?

For example, I could see this part in the wlan_mac_packet_types.c file, should I define my custom packet by modifying this function or I should define another function like this?

int wlan_create_data_frame_header(u8* pkt,
                                  u8* addr1,
                                  u8* addr2,
                                  u8* addr3,
                                  u8 frame_control_2) {

    if(pkt == NULL) return WLAN_FAILURE;

    mac_header_80211* data_80211_header;
    data_80211_header = (mac_header_80211*)(pkt);

    data_80211_header->frame_control_1 = MAC_FRAME_CTRL1_SUBTYPE_DATA;

    data_80211_header->frame_control_2 = frame_control_2;

    data_80211_header->duration_id = 0;

    memcpy(data_80211_header->address_1, addr1, MAC_ADDR_LEN);
    memcpy(data_80211_header->address_2, addr2, MAC_ADDR_LEN);
    memcpy(data_80211_header->address_3, addr3, MAC_ADDR_LEN);

    data_80211_header->sequence_control = 0; //Will be filled in at dequeue

    return (sizeof(mac_header_80211) + WLAN_PHY_FCS_NBYTES) ;
}

Offline

 

Board footer