Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Receiving Packets and Management Frames

...

1069973NetDev_Rx() is called by μCμC/TCP-IP’s IP’s Receive task after the Interrupt Service Routine handler has signaled to the Receive task that a receive event has occurred. NetDev_Rx() requires that the device driver return a pointer to the data area containing the received data and return the size of the received frame via pointer. Anchor10699741069974

Receive Buffer Structure

...

10699651069965Since NetDev_Rx() can be called to receive management frames and data packets, all wireless receive buffers must contain an offset before the data area to specify the frame type. So to understand data reception, you first need to understand the structure of receive buffers. Anchor10530501053050 Image Removed

...

Image Added

Figure 7-19 Wireless receive buffer structure

...

F7-19(1) The buffer offset is specified within the

...

device’s Memory configuration. The offset must be at least equal to one octet to handle the Frame type. The offset can include option control data for demultiplex and or to respect the buffer alignment.

...

F7-19(2) The frame type space is always the first octet of the buffer. If receiving data packet, set the frame type equal to NET_IF_WIFI_DATA_PKT and the packet will be processed by the stack. For a management frame the byte must be set equal to NET_IF_WIFI_MGMT_FRAME, in this case NetDev_MgmtDemux() will be called after return to analyses the management frame and signal the Wireless Manager or update the driver

...

data’s state.

...

F7-19(3) The receive buffer can include extra space to help to demultiplex a management frame or to respect buffer alignment required by the

...

device’s BSP function.

...

F7-19(4) The pointer passed to the network

...

device’s BSP function pointer, NetDev_WiFi_SPI_WrRd(), must point to the frame data area. Anchor10533311053331

Receiving Frames

...

NetDev_Rx() should perform the following actions:

...

Transmit Completed Notification

...

Since the SPI cannot be accessed within the ISR handler most of time all interrupts type are read in NetDev_Rx(). Also, when the ISR type is for a transmit completed notification, it is not recommended to notify the stack by the function and return an error since the reception statistics and errors counter will be affected. Instead it is recommended to return a management frame that contains the address of the data area successfully transmitted. Since all management frame are processed by NetDev_MgmtDemux(), the step to notify the stack should be done into it.