Where do I must send/receive 802.11 MAC frames to/from?

cancel
Showing results for 
Search instead for 
Did you mean: 

Where do I must send/receive 802.11 MAC frames to/from?

396 Views
oscargarciaabad
Contributor III

Hi all,

Currently I'm developing an MQX Wifi driver. This device is sending/receiving 802.11 MAC frames to/from SPI bus. My questions are:

     - When I receive a frame from SPI, How do I send it to RTCS?

     - How do I receive frames from RTCS?

I know there is a structure called PCB (Packet Control Block), but I can't find any documentation regarding this topic. May somebody point out some hints on that topic?

Regards,

Oscar.

Labels (1)
8 Replies

123 Views
oscargarciaabad
Contributor III

Hi,

When I receive a PCB from an upper layer, which is the FRAGMENT  endianess?

Regards,

Oscar.

0 Kudos

123 Views
RadekS
NXP Employee
NXP Employee

I am not sure whether I understood your question.

“The PCB structure consists of two pointers (FREE and PRIVATE) followed by a variable-length array of PCB_FRAGMENT structures.  The array is terminated by an entry with LENGTH=0 and FRAGMENT=NULL.”

ENET driver allow spreading packet into more fragments, however RTCS do not support it. It always work with situation where 1 packet = 1 fragment.

Over network we always transfer big endians.

PCB block already contains functions for automatically rotation between big and little endians and in fact it depends on MCU core settings (PSP_ENDIAN) if something will be changed or not.

So, If you will work with PCB, it should be handled automatically.

0 Kudos

123 Views
oscargarciaabad
Contributor III

Hi RadekS,

If I got you well the FRAGMENT data ( the Ethernet frame ) will be in the same endianness of the processor I’m running on (ARM Cortex-M4 in my case). Isn’t it?

Regards,

Oscar.

De: RadekS

Enviado el: viernes, 20 de marzo de 2015 14:59

Para: Oscar Garcia Abat

Asunto: Re: - Where do I must send/receive 802.11 MAC frames to/from?

<https://community.freescale.com/>

Where do I must send/receive 802.11 MAC frames to/from?

reply from RadekS<https://community.freescale.com/people/RadekS?et=watches.email.thread> in MQX Software Solutions - View the full discussion<https://community.freescale.com/message/496053?et=watches.email.thread#496053>

0 Kudos

123 Views
RadekS
NXP Employee
NXP Employee

In fact, PSP_ENDIAN depends on compiler option.

In default settings, Little-endian format is used for Kinetis M4 core.

The network headers are typically in Big-endian format.

So, there will be applied translation for network headers.

Anyway, mqx.h contains definitions for convert functions (Host to network / network to host) like mqx_htonl or mqx_ntohl…

I hope it helps you.

Have a great day,
RadekS

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

123 Views
oscargarciaabad
Contributor III

Hi RadekS,

Thanks a lot for the help!

Regards,

Oscar.

De: RadekS

Enviado el: lunes, 23 de marzo de 2015 15:52

Para: Oscar Garcia Abat

Asunto: Re: - Where do I must send/receive 802.11 MAC frames to/from?

<https://community.freescale.com/>

Where do I must send/receive 802.11 MAC frames to/from?

reply from RadekS<https://community.freescale.com/people/RadekS?et=watches.email.thread> in MQX Software Solutions - View the full discussion<https://community.freescale.com/message/497029?et=watches.email.thread#497029>

0 Kudos

123 Views
RadekS
NXP Employee
NXP Employee

Yes, you are right. There missing documentation for lowest layer of RTCS stack. We plan to release such documentation during this year (for KSDK1.3).

I would like to recommend take one of already available Wifi patches as inspiration. For some of wifi modules MQX patches was created by third party designers.

Qualcomm/Atheros TWR-WIFI-AR4100 for MQX 4.0.2

GainSpan TWR-WIFI-GS1011M1 and TWR-WIFI-GS1500M for MQX 3.7

Redpine Signals TWR-WIFI-RS2101 for MQX 3.7

These patches you can download from Freescale MQX download pages:

https://freescale.flexnetoperations.com/control/frse/product?child_plneID=683961&ver=ARC

As next inspiration could be taken ENET RTCS adapter in KSDK (fsl_enet_rtcs_adapter.c)

I hope it helps you.

Have a great day,
RadekS

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

123 Views
oscargarciaabad
Contributor III

Hi RadekS,

A far as I've seen the implementations does the following (simplified):

You need to create a ENET_MAC_IF_STRUCT for the Mac interface. Here the SEND memeber is the function that will receive the PCB from upper protocol layers.

For receiving packets you need to create a PCB pool. When a a new frame is received, a PCB is allocated from this pooll (using QGET). After this a buffer for the frame is reseved and linked to the PCB. Then calling ENET_find_receiver figures aout the receiver ( upper layer protocol, i.e IP) for the frame. Finally the PCB sent to the receiver calling the SERVICE member of the ENET_ECB_STRUCT_PTR returned by ENET_find_receiver with the PCB as argument.

Am I right?

Regards,

Oscar.

0 Kudos

123 Views
RadekS
NXP Employee
NXP Employee

Hi Oscar,

Yes, is sounds correct.

Best Regards

RadekS

0 Kudos