mac.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 Freie Universität Berlin
3  *
4  * This file is subject to the terms and conditions of the GNU Lesser
5  * General Public License v2.1. See the file LICENSE in the top level
6  * directory for more details.
7  */
8 
18 #ifndef NET_GNRC_NETIF_MAC_H
19 #define NET_GNRC_NETIF_MAC_H
20 
21 #include "net/gnrc/mac/types.h"
22 #include "net/csma_sender.h"
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
31 #define GNRC_NETIF_MAC_INFO_TX_FEEDBACK_MASK (0x0003U)
32 
37 #define GNRC_NETIF_MAC_INFO_RX_STARTED (0x0004U)
38 
46 #define GNRC_NETIF_MAC_INFO_CSMA_ENABLED (0x0100U)
47 
48 #if defined(MODULE_GNRC_LWMAC) || defined(MODULE_GNRC_GOMACH)
49 
52 typedef union {
53 #ifdef MODULE_GNRC_LWMAC
54 
58 #endif
59 
60 #ifdef MODULE_GNRC_GOMACH
61 
65 #endif
66 } gnrc_mac_prot_t;
67 #endif
68 
72 typedef struct {
76  uint16_t mac_info;
77 
82 
83 #if ((GNRC_MAC_RX_QUEUE_SIZE != 0) || (GNRC_MAC_DISPATCH_BUFFER_SIZE != 0)) || DOXYGEN
84 
92 #endif /* ((GNRC_MAC_RX_QUEUE_SIZE != 0) || (GNRC_MAC_DISPATCH_BUFFER_SIZE != 0)) || DOXYGEN */
93 #if ((GNRC_MAC_TX_QUEUE_SIZE != 0) || (CONFIG_GNRC_MAC_NEIGHBOR_COUNT != 0)) || DOXYGEN
94 
102 #endif /* ((GNRC_MAC_TX_QUEUE_SIZE != 0) || (CONFIG_GNRC_MAC_NEIGHBOR_COUNT == 0)) || DOXYGEN */
103 
104 #if defined(MODULE_GNRC_LWMAC) || defined(MODULE_GNRC_GOMACH)
105  gnrc_mac_prot_t prot;
106 #endif
108 
109 #ifdef __cplusplus
110 }
111 #endif
112 
113 #endif /* NET_GNRC_NETIF_MAC_H */
114 
gnrc_netif_mac_t::csma_conf
csma_sender_conf_t csma_conf
device's software CSMA configuration
Definition: mac.h:81
gnrc_mac_rx_t
MAC internal type for storing reception state parameters and state machines.
Definition: types.h:71
types.h
Internal data types used by GNRC_MAC.
gnrc_mac_tx_t
MAC internal type for storing transmission state parameters and state machines.
Definition: types.h:173
gomach
GoMacH's specific structure for storing internal states.
Definition: types.h:276
csma_sender_conf_t
Configuration type for backoff.
Definition: csma_sender.h:75
lwmac
LWMAC specific structure for storing internal states.
Definition: types.h:198
gnrc_netif_mac_t::rx
gnrc_mac_rx_t rx
MAC internal object which stores reception parameters, queues, and state machines.
Definition: mac.h:91
gnrc_netif_mac_t::tx
gnrc_mac_tx_t tx
MAC internal object which stores transmission parameters, queues, and state machines.
Definition: mac.h:101
gnrc_netif_mac_t::mac_info
uint16_t mac_info
general information for the MAC protocol
Definition: mac.h:76
csma_sender.h
Interface definition for the CSMA/CA helper.
gnrc_netif_mac_t
Common MAC module component of gnrc_netif_mac_t
Definition: mac.h:72