21#ifndef NET_GNRC_MAC_TYPES_H
22#define NET_GNRC_MAC_TYPES_H
31#ifdef MODULE_GNRC_LWMAC
34#ifdef MODULE_GNRC_GOMACH
45#define GNRC_MAC_TYPE_GET_DUTYCYCLE (0x4401)
60#define GNRC_MAC_TX_FEEDBACK_INIT { TX_FEEDBACK_UNDEF }
62#if ((GNRC_MAC_RX_QUEUE_SIZE != 0) || (GNRC_MAC_DISPATCH_BUFFER_SIZE != 0)) || defined(DOXYGEN)
71#if (GNRC_MAC_RX_QUEUE_SIZE != 0) || defined(DOXYGEN)
76#if (GNRC_MAC_DISPATCH_BUFFER_SIZE != 0) || defined(DOXYGEN)
80#ifdef MODULE_GNRC_LWMAC
83 uint8_t rx_bad_exten_count;
86#ifdef MODULE_GNRC_GOMACH
97#if ((GNRC_MAC_RX_QUEUE_SIZE != 0) && (GNRC_MAC_DISPATCH_BUFFER_SIZE != 0)) || defined(DOXYGEN)
98#define GNRC_MAC_RX_INIT { \
99 PRIORITY_PKTQUEUE_INIT, \
100 { PRIORITY_PKTQUEUE_NODE_INIT(0, NULL) }, \
103#elif (GNRC_MAC_RX_QUEUE_SIZE != 0) && (GNRC_MAC_DISPATCH_BUFFER_SIZE == 0) || defined(DOXYGEN)
104#define GNRC_MAC_RX_INIT { \
105 PRIORITY_PKTQUEUE_INIT, \
106 { PRIORITY_PKTQUEUE_NODE_INIT(0, NULL) }, \
108#elif (GNRC_MAC_RX_QUEUE_SIZE == 0) && (GNRC_MAC_DISPATCH_BUFFER_SIZE != 0) || defined(DOXYGEN)
109#define GNRC_MAC_RX_INIT { \
115#if (CONFIG_GNRC_MAC_NEIGHBOR_COUNT != 0) || defined(DOXYGEN)
124#if (GNRC_MAC_TX_QUEUE_SIZE != 0) || defined(DOXYGEN)
128#ifdef MODULE_GNRC_GOMACH
129 uint16_t pub_chanseq;
138#define GNRC_MAC_PHASE_UNINITIALIZED (0)
143#define GNRC_MAC_PHASE_MAX (-1)
148#if (GNRC_MAC_TX_QUEUE_SIZE != 0) || defined(DOXYGEN)
149#define GNRC_MAC_TX_NEIGHBOR_INIT { \
152 GNRC_MAC_PHASE_UNINITIALIZED, \
153 PRIORITY_PKTQUEUE_INIT, \
156#define GNRC_MAC_TX_NEIGHBOR_INIT { \
159 GNRC_MAC_PHASE_UNINITIALIZED, \
164#if ((GNRC_MAC_TX_QUEUE_SIZE != 0) || (CONFIG_GNRC_MAC_NEIGHBOR_COUNT != 0)) || defined(DOXYGEN)
173#if (CONFIG_GNRC_MAC_NEIGHBOR_COUNT != 0) || defined(DOXYGEN)
180#if (GNRC_MAC_TX_QUEUE_SIZE != 0) || defined(DOXYGEN)
181#if (CONFIG_GNRC_MAC_NEIGHBOR_COUNT == 0) || defined(DOXYGEN)
190#ifdef MODULE_GNRC_LWMAC
195 uint8_t tx_burst_count;
196 uint8_t tx_retry_count;
197 uint8_t preamble_fail_counts;
200#ifdef MODULE_GNRC_GOMACH
205 uint8_t preamble_sent;
206 uint8_t broadcast_seq;
209 uint8_t no_ack_counter;
210 uint8_t t2u_retry_counter;
211 uint8_t last_tx_neighbor_id;
212 uint8_t tx_busy_count;
213 uint8_t t2u_fail_count;
220#if ((GNRC_MAC_TX_QUEUE_SIZE != 0) && (CONFIG_GNRC_MAC_NEIGHBOR_COUNT != 0)) || defined(DOXYGEN)
221#define GNRC_MAC_TX_INIT { \
222 { GNRC_MAC_TX_NEIGHBOR_INIT }, \
224 { PRIORITY_PKTQUEUE_NODE_INIT(0, NULL) }, \
227#elif ((GNRC_MAC_TX_QUEUE_SIZE != 0) && (CONFIG_GNRC_MAC_NEIGHBOR_COUNT == 0)) || defined(DOXYGEN)
228#define GNRC_MAC_TX_INIT { \
229 PRIORITY_PKTQUEUE_INIT, \
230 { PRIORITY_PKTQUEUE_NODE_INIT(0, NULL) }, \
233#elif ((GNRC_MAC_TX_QUEUE_SIZE == 0) && (CONFIG_GNRC_MAC_NEIGHBOR_COUNT != 0)) || defined(DOXYGEN)
234#define GNRC_MAC_TX_INIT { \
235 { GNRC_MAC_TX_NEIGHBOR_INIT }, \
#define CONFIG_GNRC_MAC_NEIGHBOR_COUNT
Count of neighbor nodes in one-hop distance.
#define GNRC_MAC_DISPATCH_BUFFER_SIZE
The default buffer size for storing dispatching packets.
#define GNRC_MAC_TX_QUEUE_SIZE
The default queue size for transmission packets coming from higher layers.
#define GNRC_MAC_RX_QUEUE_SIZE
The default rx queue size for incoming packets.
General definitions for network packets and their helper functions.
gnrc priority packet queue API
GoMacH's data structure for recording TX information for avoiding receiving duplicate packets.
GoMacH's slot-schedule-unit.
GoMacH's vTDMA (dynamic slots allocation) management unit.
Sender's vTDMA (dynamic slots allocation) management unit.
LWMAC internal L2 address structure.
MAC internal type for storing reception state parameters and state machines.
gnrc_priority_pktqueue_t queue
RX packet queue.
type for storing states of TX neighbor node.
uint8_t l2_addr_len
Neighbor address length.
uint32_t phase
Neighbor's wake-up Phase.
gnrc_priority_pktqueue_t queue
TX queue for this particular Neighbor.
MAC internal type for storing transmission state parameters and state machines.
gnrc_pktsnip_t * packet
currently scheduled packet for sending
gnrc_priority_pktqueue_t queue
If neighbor queues is not used, define a single queue for managing TX packets.
gnrc_mac_tx_neighbor_t * current_neighbor
Neighbor information unit of destination node to which the current packet will be sent.
Type to represent parts (either headers or payload) of a packet, called snips.
data type for gnrc priority packet queue nodes
data type for priority queues
Internal used types of GoMacH.
gnrc_gomach_t2k_state_t
State-machine states of Transmission-to-phase-known (t2k) procedure of GoMacH.
gnrc_gomach_bcast_state_t
State-machine states of Broadcast procedure of GoMacH.
gnrc_gomach_listen_state_t
State-machine states of duty-cycled listening procedure of GoMacH.
gnrc_gomach_transmit_state_t
State-machine states of basic transmission management procedure of GoMacH.
gnrc_gomach_t2u_state_t
State-machine states of Transmission-to-phase-unknown (t2u) procedure of GoMacH.
#define GNRC_GOMACH_SLOSCH_UNIT_COUNT
The default number of slot-schedule-unit gnrc_gomach_slosch_unit_t in GoMacH.
Definition of internal types used by LWMAC.
gnrc_lwmac_tx_state_t
TX states of LWMAC.
gnrc_lwmac_rx_state_t
RX states of LWMAC.
gnrc_mac_tx_feedback_t
definition for device transmission feedback types
@ TX_FEEDBACK_BUSY
found medium busy when doing transmission
@ TX_FEEDBACK_SUCCESS
Transmission succeeded.
@ TX_FEEDBACK_NOACK
No ACK for the transmitted packet.
@ TX_FEEDBACK_UNDEF
Transmission just start, no Tx feedback yet.
IEEE 802.15.4 header definitions.