mac/internal.h

Definitions of internal functions of GNRC_MAC module.

bool gnrc_netif_get_rx_started(gnrc_netif_t * netif)

get the ‘rx_started’ state of the device

This function checks whether the device has started receiving a packet.

Parameters

netif:the network interface

Return values

  • the rx_started state
void gnrc_netif_set_rx_started(gnrc_netif_t * netif, bool rx_started)

set the rx_started state of the device

This function is intended to be called only in netdev.h::netdev::event_callback.

Parameters

netif:the network interface
rx_started:the rx_started state

sys/include/net/gnrc/mac/types.h::gnrc_mac_tx_feedback_t gnrc_netif_get_tx_feedback(gnrc_netif_t * netif)

get the transmission feedback of the device

Parameters

netif:the network interface

Return values

  • the transmission feedback
void gnrc_netif_set_tx_feedback(gnrc_netif_t * netif, sys/include/net/gnrc/mac/types.h::gnrc_mac_tx_feedback_t txf)

set the transmission feedback of the device

This function is intended to be called only in netdev.h::netdev::event_callback.

Parameters

netif:the network interface
txf:the transmission feedback

bool gnrc_mac_queue_tx_packet(gnrc_mac_tx_t * tx, uint32_t priority, include/net/gnrc/pkt.h::gnrc_pktsnip_t * pkt)

Queues the packet into the related transmission packet queue in netdev_t::tx.

Note that, in case the gnrc_mac_tx_neighbor_t structure is in used (indicated by GNRC_MAC_NEIGHBOR_COUNT != 0), this function queues the packet to the queue associated to the pkt’s destination neighbor, including a broadcast-neighbor (neighbor id is 0 in netdev_t::tx::neighbors) which specifically stores broadcasting packets. On the other hand, if gnrc_mac_tx_neighbor_t structure is not in used (indicated by GNRC_MAC_NEIGHBOR_COUNT == 0), this function queues the packet into the single priority TX queue defined in in netdev_t::tx.

Parameters

tx:gnrc_mac transmission management object
priority:the priority of pkt
pkt:gnrc packet that will be queued

Return values

  • true if queued successfully, otherwise false.
bool gnrc_mac_queue_rx_packet(gnrc_mac_rx_t * rx, uint32_t priority, include/net/gnrc/pkt.h::gnrc_pktsnip_t * pkt)

Queues the packet into the reception packet queue in netdev_t::rx.

Parameters

rx:gnrc_mac reception management object
priority:the priority of pkt
pkt:gnrc packet that will be queued

Return values

  • true if queued successfully, otherwise false.
void gnrc_mac_dispatch(gnrc_mac_rx_t * rx)

Dispatch all the packets stored in netdev_t::rx:dispatch_buffer to upper layer.

Parameters

rx:gnrc_mac reception management object