gnrc/mac : Move GNRC_MAC_NEIGHBOR_COUNT to 'CONFIG_'

This commit is contained in:
Akshai M 2020-05-24 16:04:09 +05:30
parent b2550451a1
commit 9ddc9e0633
8 changed files with 39 additions and 39 deletions

View File

@ -98,12 +98,12 @@ static inline void gnrc_netif_set_tx_feedback(gnrc_netif_t *netif,
/** /**
* @brief Queues the packet into the related transmission packet queue in netdev_t::tx. * @brief 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 * 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 * by `CONFIG_GNRC_MAC_NEIGHBOR_COUNT != 0`), this function queues the packet to
* the queue associated to the pkt's destination neighbor, including a * the queue associated to the pkt's destination neighbor, including a
* `broadcast-neighbor` (neighbor id is `0` in netdev_t::tx::neighbors) which * `broadcast-neighbor` (neighbor id is `0` in netdev_t::tx::neighbors) which
* specifically stores broadcasting packets. * specifically stores broadcasting packets.
* On the other hand, if `gnrc_mac_tx_neighbor_t` structure is not in used (indicated * 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 * by `CONFIG_GNRC_MAC_NEIGHBOR_COUNT == 0`), this function queues the packet into the single
* priority TX queue defined in in netdev_t::tx. * priority TX queue defined in in netdev_t::tx.
* *
* @param[in,out] tx gnrc_mac transmission management object * @param[in,out] tx gnrc_mac transmission management object

View File

@ -65,10 +65,10 @@ extern "C" {
#endif #endif
/** /**
* @brief Count of neighbor nodes in one-hop distance * @brief Count of neighbor nodes in one-hop distance.
*/ */
#ifndef GNRC_MAC_NEIGHBOR_COUNT #ifndef CONFIG_GNRC_MAC_NEIGHBOR_COUNT
#define GNRC_MAC_NEIGHBOR_COUNT (8U) #define CONFIG_GNRC_MAC_NEIGHBOR_COUNT (8U)
#endif #endif
/** /**

View File

@ -115,7 +115,7 @@ typedef struct {
#endif /* ((GNRC_MAC_RX_QUEUE_SIZE != 0) && (GNRC_MAC_DISPATCH_BUFFER_SIZE != 0)) || defined(DOXYGEN) */ #endif /* ((GNRC_MAC_RX_QUEUE_SIZE != 0) && (GNRC_MAC_DISPATCH_BUFFER_SIZE != 0)) || defined(DOXYGEN) */
#endif /* ((GNRC_MAC_RX_QUEUE_SIZE != 0) || (GNRC_MAC_DISPATCH_BUFFER_SIZE != 0)) || defined(DOXYGEN) */ #endif /* ((GNRC_MAC_RX_QUEUE_SIZE != 0) || (GNRC_MAC_DISPATCH_BUFFER_SIZE != 0)) || defined(DOXYGEN) */
#if (GNRC_MAC_NEIGHBOR_COUNT != 0) || defined(DOXYGEN) #if (CONFIG_GNRC_MAC_NEIGHBOR_COUNT != 0) || defined(DOXYGEN)
/** /**
* @brief type for storing states of TX neighbor node. * @brief type for storing states of TX neighbor node.
*/ */
@ -162,9 +162,9 @@ typedef struct {
GNRC_MAC_PHASE_UNINITIALIZED, \ GNRC_MAC_PHASE_UNINITIALIZED, \
} }
#endif /* (GNRC_MAC_TX_QUEUE_SIZE != 0) || defined(DOXYGEN) */ #endif /* (GNRC_MAC_TX_QUEUE_SIZE != 0) || defined(DOXYGEN) */
#endif /* (GNRC_MAC_NEIGHBOR_COUNT != 0) || defined(DOXYGEN) */ #endif /* (CONFIG_GNRC_MAC_NEIGHBOR_COUNT != 0) || defined(DOXYGEN) */
#if ((GNRC_MAC_TX_QUEUE_SIZE != 0) || (GNRC_MAC_NEIGHBOR_COUNT != 0)) || defined(DOXYGEN) #if ((GNRC_MAC_TX_QUEUE_SIZE != 0) || (CONFIG_GNRC_MAC_NEIGHBOR_COUNT != 0)) || defined(DOXYGEN)
/** /**
* @brief MAC internal type for storing transmission state parameters and * @brief MAC internal type for storing transmission state parameters and
* state machines. * state machines.
@ -173,18 +173,18 @@ typedef struct {
* \#ifdef directives when applicable. * \#ifdef directives when applicable.
*/ */
typedef struct { typedef struct {
#if (GNRC_MAC_NEIGHBOR_COUNT != 0) || defined(DOXYGEN) #if (CONFIG_GNRC_MAC_NEIGHBOR_COUNT != 0) || defined(DOXYGEN)
gnrc_mac_tx_neighbor_t neighbors[GNRC_MAC_NEIGHBOR_COUNT + 1]; /**< Neighbor information units for one-hop neighbors. gnrc_mac_tx_neighbor_t neighbors[CONFIG_GNRC_MAC_NEIGHBOR_COUNT + 1]; /**< Neighbor information units for one-hop neighbors.
First unit is for broadcast (+1) */ First unit is for broadcast (+1) */
gnrc_mac_tx_neighbor_t *current_neighbor; /**< Neighbor information unit of destination node to which gnrc_mac_tx_neighbor_t *current_neighbor; /**< Neighbor information unit of destination node to which
the current packet will be sent */ the current packet will be sent */
#endif /* (GNRC_MAC_NEIGHBOR_COUNT != 0) || defined(DOXYGEN) */ #endif /* (CONFIG_GNRC_MAC_NEIGHBOR_COUNT != 0) || defined(DOXYGEN) */
#if (GNRC_MAC_TX_QUEUE_SIZE != 0) || defined(DOXYGEN) #if (GNRC_MAC_TX_QUEUE_SIZE != 0) || defined(DOXYGEN)
#if (GNRC_MAC_NEIGHBOR_COUNT == 0) || defined(DOXYGEN) #if (CONFIG_GNRC_MAC_NEIGHBOR_COUNT == 0) || defined(DOXYGEN)
gnrc_priority_pktqueue_t queue; /**< If neighbor queues is not used, define gnrc_priority_pktqueue_t queue; /**< If neighbor queues is not used, define
a single queue for managing TX packets. */ a single queue for managing TX packets. */
#endif /* (GNRC_MAC_NEIGHBOR_COUNT == 0) || defined(DOXYGEN) */ #endif /* (CONFIG_GNRC_MAC_NEIGHBOR_COUNT == 0) || defined(DOXYGEN) */
gnrc_priority_pktqueue_node_t _queue_nodes[GNRC_MAC_TX_QUEUE_SIZE]; /**< Shared buffer for TX queue nodes */ gnrc_priority_pktqueue_node_t _queue_nodes[GNRC_MAC_TX_QUEUE_SIZE]; /**< Shared buffer for TX queue nodes */
gnrc_pktsnip_t *packet; /**< currently scheduled packet for sending */ gnrc_pktsnip_t *packet; /**< currently scheduled packet for sending */
@ -219,26 +219,26 @@ typedef struct {
/** /**
* @brief Static initializer for gnrc_mac_tx_t. * @brief Static initializer for gnrc_mac_tx_t.
*/ */
#if ((GNRC_MAC_TX_QUEUE_SIZE != 0) && (GNRC_MAC_NEIGHBOR_COUNT != 0)) || defined(DOXYGEN) #if ((GNRC_MAC_TX_QUEUE_SIZE != 0) && (CONFIG_GNRC_MAC_NEIGHBOR_COUNT != 0)) || defined(DOXYGEN)
#define GNRC_MAC_TX_INIT { \ #define GNRC_MAC_TX_INIT { \
{ GNRC_MAC_TX_NEIGHBOR_INIT }, \ { GNRC_MAC_TX_NEIGHBOR_INIT }, \
NULL, \ NULL, \
{ PRIORITY_PKTQUEUE_NODE_INIT(0, NULL) }, \ { PRIORITY_PKTQUEUE_NODE_INIT(0, NULL) }, \
NULL, \ NULL, \
} }
#elif ((GNRC_MAC_TX_QUEUE_SIZE != 0) && (GNRC_MAC_NEIGHBOR_COUNT == 0)) || defined(DOXYGEN) #elif ((GNRC_MAC_TX_QUEUE_SIZE != 0) && (CONFIG_GNRC_MAC_NEIGHBOR_COUNT == 0)) || defined(DOXYGEN)
#define GNRC_MAC_TX_INIT { \ #define GNRC_MAC_TX_INIT { \
PRIORITY_PKTQUEUE_INIT, \ PRIORITY_PKTQUEUE_INIT, \
{ PRIORITY_PKTQUEUE_NODE_INIT(0, NULL) }, \ { PRIORITY_PKTQUEUE_NODE_INIT(0, NULL) }, \
NULL, \ NULL, \
} }
#elif ((GNRC_MAC_TX_QUEUE_SIZE == 0) && (GNRC_MAC_NEIGHBOR_COUNT != 0)) || defined(DOXYGEN) #elif ((GNRC_MAC_TX_QUEUE_SIZE == 0) && (CONFIG_GNRC_MAC_NEIGHBOR_COUNT != 0)) || defined(DOXYGEN)
#define GNRC_MAC_TX_INIT { \ #define GNRC_MAC_TX_INIT { \
{ GNRC_MAC_TX_NEIGHBOR_INIT }, \ { GNRC_MAC_TX_NEIGHBOR_INIT }, \
NULL, \ NULL, \
} }
#endif /* ((GNRC_MAC_TX_QUEUE_SIZE != 0) && (GNRC_MAC_NEIGHBOR_COUNT != 0)) || defined(DOXYGEN) */ #endif /* ((GNRC_MAC_TX_QUEUE_SIZE != 0) && (CONFIG_GNRC_MAC_NEIGHBOR_COUNT != 0)) || defined(DOXYGEN) */
#endif /* ((GNRC_MAC_TX_QUEUE_SIZE != 0) || (GNRC_MAC_NEIGHBOR_COUNT != 0)) || defined(DOXYGEN) */ #endif /* ((GNRC_MAC_TX_QUEUE_SIZE != 0) || (CONFIG_GNRC_MAC_NEIGHBOR_COUNT != 0)) || defined(DOXYGEN) */
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -90,16 +90,16 @@ typedef struct {
*/ */
gnrc_mac_rx_t rx; gnrc_mac_rx_t rx;
#endif /* ((GNRC_MAC_RX_QUEUE_SIZE != 0) || (GNRC_MAC_DISPATCH_BUFFER_SIZE != 0)) || DOXYGEN */ #endif /* ((GNRC_MAC_RX_QUEUE_SIZE != 0) || (GNRC_MAC_DISPATCH_BUFFER_SIZE != 0)) || DOXYGEN */
#if ((GNRC_MAC_TX_QUEUE_SIZE != 0) || (GNRC_MAC_NEIGHBOR_COUNT != 0)) || DOXYGEN #if ((GNRC_MAC_TX_QUEUE_SIZE != 0) || (CONFIG_GNRC_MAC_NEIGHBOR_COUNT != 0)) || DOXYGEN
/** /**
* @brief MAC internal object which stores transmission parameters, queues, and * @brief MAC internal object which stores transmission parameters, queues, and
* state machines. * state machines.
* *
* @note Only available if @ref GNRC_MAC_TX_QUEUE_SIZE or * @note Only available if @ref GNRC_MAC_TX_QUEUE_SIZE or
* @ref GNRC_MAC_NEIGHBOR_COUNT is greater than 0. * @ref CONFIG_GNRC_MAC_NEIGHBOR_COUNT is greater than 0.
*/ */
gnrc_mac_tx_t tx; gnrc_mac_tx_t tx;
#endif /* ((GNRC_MAC_TX_QUEUE_SIZE != 0) || (GNRC_MAC_NEIGHBOR_COUNT == 0)) || DOXYGEN */ #endif /* ((GNRC_MAC_TX_QUEUE_SIZE != 0) || (CONFIG_GNRC_MAC_NEIGHBOR_COUNT == 0)) || DOXYGEN */
#if defined(MODULE_GNRC_LWMAC) || defined(MODULE_GNRC_GOMACH) #if defined(MODULE_GNRC_LWMAC) || defined(MODULE_GNRC_GOMACH)
gnrc_mac_prot_t prot; gnrc_mac_prot_t prot;

View File

@ -1166,11 +1166,11 @@ bool gnrc_gomach_find_next_tx_neighbor(gnrc_netif_t *netif)
* thus to be more fair. */ * thus to be more fair. */
uint8_t j = netif->mac.tx.last_tx_neighbor_id + 1; uint8_t j = netif->mac.tx.last_tx_neighbor_id + 1;
if (j >= GNRC_MAC_NEIGHBOR_COUNT) { if (j >= CONFIG_GNRC_MAC_NEIGHBOR_COUNT) {
j = 1; j = 1;
} }
for (uint8_t i = 1; i < GNRC_MAC_NEIGHBOR_COUNT; i++) { for (uint8_t i = 1; i < CONFIG_GNRC_MAC_NEIGHBOR_COUNT; i++) {
if (gnrc_priority_pktqueue_length(&netif->mac.tx.neighbors[j].queue) > 0) { if (gnrc_priority_pktqueue_length(&netif->mac.tx.neighbors[j].queue) > 0) {
netif->mac.tx.last_tx_neighbor_id = j; netif->mac.tx.last_tx_neighbor_id = j;
next = (int) j; next = (int) j;
@ -1178,7 +1178,7 @@ bool gnrc_gomach_find_next_tx_neighbor(gnrc_netif_t *netif)
} }
else { else {
j++; j++;
if (j >= GNRC_MAC_NEIGHBOR_COUNT) { if (j >= CONFIG_GNRC_MAC_NEIGHBOR_COUNT) {
j = 1; j = 1;
} }
} }
@ -1388,7 +1388,7 @@ void gnrc_gomach_update_neighbor_phase(gnrc_netif_t *netif)
{ {
assert(netif != NULL); assert(netif != NULL);
for (uint8_t i = 1; i < GNRC_MAC_NEIGHBOR_COUNT; i++) { for (uint8_t i = 1; i < CONFIG_GNRC_MAC_NEIGHBOR_COUNT; i++) {
if (netif->mac.tx.neighbors[i].mac_type == GNRC_GOMACH_TYPE_KNOWN) { if (netif->mac.tx.neighbors[i].mac_type == GNRC_GOMACH_TYPE_KNOWN) {
long int tmp = netif->mac.tx.neighbors[i].cp_phase - long int tmp = netif->mac.tx.neighbors[i].cp_phase -
netif->mac.prot.gomach.backoff_phase_us; netif->mac.prot.gomach.backoff_phase_us;
@ -1422,7 +1422,7 @@ void gnrc_gomach_update_neighbor_pubchan(gnrc_netif_t *netif)
} }
/* Toggle TX neighbors' current channel. */ /* Toggle TX neighbors' current channel. */
for (uint8_t i = 1; i < GNRC_MAC_NEIGHBOR_COUNT; i++) { for (uint8_t i = 1; i < CONFIG_GNRC_MAC_NEIGHBOR_COUNT; i++) {
if (netif->mac.tx.neighbors[i].mac_type == GNRC_GOMACH_TYPE_KNOWN) { if (netif->mac.tx.neighbors[i].mac_type == GNRC_GOMACH_TYPE_KNOWN) {
if (netif->mac.tx.neighbors[i].pub_chanseq == netif->mac.prot.gomach.pub_channel_1) { if (netif->mac.tx.neighbors[i].pub_chanseq == netif->mac.prot.gomach.pub_channel_1) {
netif->mac.tx.neighbors[i].pub_chanseq = netif->mac.prot.gomach.pub_channel_2; netif->mac.tx.neighbors[i].pub_chanseq = netif->mac.prot.gomach.pub_channel_2;

View File

@ -201,7 +201,7 @@ static gnrc_mac_tx_neighbor_t *_next_tx_neighbor(gnrc_netif_t *netif)
gnrc_mac_tx_neighbor_t *next = NULL; gnrc_mac_tx_neighbor_t *next = NULL;
uint32_t phase_nearest = GNRC_LWMAC_PHASE_MAX; uint32_t phase_nearest = GNRC_LWMAC_PHASE_MAX;
for (unsigned i = 0; i < GNRC_MAC_NEIGHBOR_COUNT; i++) { for (unsigned i = 0; i < CONFIG_GNRC_MAC_NEIGHBOR_COUNT; i++) {
if (gnrc_priority_pktqueue_length(&netif->mac.tx.neighbors[i].queue) > 0) { if (gnrc_priority_pktqueue_length(&netif->mac.tx.neighbors[i].queue) > 0) {
/* Unknown destinations are initialized with their phase at the end /* Unknown destinations are initialized with their phase at the end
* of the local interval, so known destinations that still wakeup * of the local interval, so known destinations that still wakeup

View File

@ -47,7 +47,7 @@ gnrc_priority_pktqueue_node_t *_alloc_pktqueue_node(gnrc_priority_pktqueue_node_
#endif /* ((GNRC_MAC_TX_QUEUE_SIZE != 0) || (GNRC_MAC_RX_QUEUE_SIZE != 0)) */ #endif /* ((GNRC_MAC_TX_QUEUE_SIZE != 0) || (GNRC_MAC_RX_QUEUE_SIZE != 0)) */
#if GNRC_MAC_TX_QUEUE_SIZE != 0 #if GNRC_MAC_TX_QUEUE_SIZE != 0
#if GNRC_MAC_NEIGHBOR_COUNT != 0 #if CONFIG_GNRC_MAC_NEIGHBOR_COUNT != 0
/* Find the neighbor's id based on the given address */ /* Find the neighbor's id based on the given address */
int _gnrc_mac_find_neighbor(gnrc_mac_tx_t *tx, const uint8_t *dst_addr, int addr_len) int _gnrc_mac_find_neighbor(gnrc_mac_tx_t *tx, const uint8_t *dst_addr, int addr_len)
{ {
@ -59,7 +59,7 @@ int _gnrc_mac_find_neighbor(gnrc_mac_tx_t *tx, const uint8_t *dst_addr, int addr
neighbors = tx->neighbors; neighbors = tx->neighbors;
/* Don't attempt to find broadcast neighbor, so start at index 1 */ /* Don't attempt to find broadcast neighbor, so start at index 1 */
for (int i = 1; i <= (signed)GNRC_MAC_NEIGHBOR_COUNT; i++) { for (int i = 1; i <= (signed)CONFIG_GNRC_MAC_NEIGHBOR_COUNT; i++) {
if (neighbors[i].l2_addr_len == addr_len) { if (neighbors[i].l2_addr_len == addr_len) {
if (memcmp(&(neighbors[i].l2_addr), dst_addr, addr_len) == 0) { if (memcmp(&(neighbors[i].l2_addr), dst_addr, addr_len) == 0) {
return i; return i;
@ -78,7 +78,7 @@ int _gnrc_mac_free_neighbor(gnrc_mac_tx_t *tx)
neighbors = tx->neighbors; neighbors = tx->neighbors;
/* Don't attempt to free broadcast neighbor, so start at index 1 */ /* Don't attempt to free broadcast neighbor, so start at index 1 */
for (int i = 1; i <= (signed)GNRC_MAC_NEIGHBOR_COUNT; i++) { for (int i = 1; i <= (signed)CONFIG_GNRC_MAC_NEIGHBOR_COUNT; i++) {
if ((gnrc_priority_pktqueue_length(&(neighbors[i].queue)) == 0) && if ((gnrc_priority_pktqueue_length(&(neighbors[i].queue)) == 0) &&
(&neighbors[i] != tx->current_neighbor)) { (&neighbors[i] != tx->current_neighbor)) {
/* Mark as free */ /* Mark as free */
@ -98,7 +98,7 @@ int _gnrc_mac_alloc_neighbor(gnrc_mac_tx_t *tx)
neighbors = tx->neighbors; neighbors = tx->neighbors;
/* Don't attempt to allocate broadcast neighbor, so start at index 1 */ /* Don't attempt to allocate broadcast neighbor, so start at index 1 */
for (int i = 1; i <= (signed)GNRC_MAC_NEIGHBOR_COUNT; i++) { for (int i = 1; i <= (signed)CONFIG_GNRC_MAC_NEIGHBOR_COUNT; i++) {
if (neighbors[i].l2_addr_len == 0) { if (neighbors[i].l2_addr_len == 0) {
gnrc_priority_pktqueue_init(&(neighbors[i].queue)); gnrc_priority_pktqueue_init(&(neighbors[i].queue));
return i; return i;
@ -118,14 +118,14 @@ void _gnrc_mac_init_neighbor(gnrc_mac_tx_neighbor_t *neighbor, const uint8_t *ad
neighbor->phase = GNRC_MAC_PHASE_MAX; neighbor->phase = GNRC_MAC_PHASE_MAX;
memcpy(&(neighbor->l2_addr), addr, len); memcpy(&(neighbor->l2_addr), addr, len);
} }
#endif /* GNRC_MAC_NEIGHBOR_COUNT != 0 */ #endif /* CONFIG_GNRC_MAC_NEIGHBOR_COUNT != 0 */
bool gnrc_mac_queue_tx_packet(gnrc_mac_tx_t *tx, uint32_t priority, gnrc_pktsnip_t *pkt) bool gnrc_mac_queue_tx_packet(gnrc_mac_tx_t *tx, uint32_t priority, gnrc_pktsnip_t *pkt)
{ {
assert(tx != NULL); assert(tx != NULL);
assert(pkt != NULL); assert(pkt != NULL);
#if GNRC_MAC_NEIGHBOR_COUNT == 0 #if CONFIG_GNRC_MAC_NEIGHBOR_COUNT == 0
gnrc_priority_pktqueue_node_t *node; gnrc_priority_pktqueue_node_t *node;
node = _alloc_pktqueue_node(tx->_queue_nodes, GNRC_MAC_TX_QUEUE_SIZE); node = _alloc_pktqueue_node(tx->_queue_nodes, GNRC_MAC_TX_QUEUE_SIZE);
@ -177,7 +177,7 @@ bool gnrc_mac_queue_tx_packet(gnrc_mac_tx_t *tx, uint32_t priority, gnrc_pktsnip
/* No neighbor entries left */ /* No neighbor entries left */
if (neighbor_id < 0) { if (neighbor_id < 0) {
DEBUG("[gnrc_mac-int] No neighbor entries left, maybe increase " DEBUG("[gnrc_mac-int] No neighbor entries left, maybe increase "
"GNRC_MAC_NEIGHBOR_COUNT for better performance\n"); "CONFIG_GNRC_MAC_NEIGHBOR_COUNT for better performance\n");
/* Try to free an unused queue */ /* Try to free an unused queue */
neighbor_id = _gnrc_mac_free_neighbor(tx); neighbor_id = _gnrc_mac_free_neighbor(tx);
@ -210,7 +210,7 @@ bool gnrc_mac_queue_tx_packet(gnrc_mac_tx_t *tx, uint32_t priority, gnrc_pktsnip
neighbor_id); neighbor_id);
return false; return false;
#endif /* GNRC_MAC_NEIGHBOR_COUNT == 0 */ #endif /* CONFIG_GNRC_MAC_NEIGHBOR_COUNT == 0 */
} }
#endif /* GNRC_MAC_TX_QUEUE_SIZE != 0 */ #endif /* GNRC_MAC_TX_QUEUE_SIZE != 0 */

View File

@ -33,7 +33,7 @@ static void set_up(void)
* correctly queue the packet to the corresponded priority packet queue. * correctly queue the packet to the corresponded priority packet queue.
* *
* In case when the `gnrc_mac_tx_neighbor_t` structure is in used (indicated by * In case when the `gnrc_mac_tx_neighbor_t` structure is in used (indicated by
* by `GNRC_MAC_NEIGHBOR_COUNT != 0`), `test_gnrc_mac_queue_tx_packet()` successively * by `CONFIG_GNRC_MAC_NEIGHBOR_COUNT != 0`), `test_gnrc_mac_queue_tx_packet()` successively
* queues 4 packets, which are pkt1, pkt2, pkt3 and pkt_bcast, into a defined `tx` * queues 4 packets, which are pkt1, pkt2, pkt3 and pkt_bcast, into a defined `tx`
* (type of `gnrc_mac_tx_t`). Pkt1, pkt2 have the same destination address of "0x76b6", * (type of `gnrc_mac_tx_t`). Pkt1, pkt2 have the same destination address of "0x76b6",
* , pkt3 is heading for "0x447e", while pkt_bcast is for broadcasting. * , pkt3 is heading for "0x447e", while pkt_bcast is for broadcasting.
@ -42,7 +42,7 @@ static void set_up(void)
* queued to `tx::neighbors[0]::queue`. * queued to `tx::neighbors[0]::queue`.
* *
* In case when the `gnrc_mac_tx_neighbor_t` structure is not in used (indicated by * In case when the `gnrc_mac_tx_neighbor_t` structure is not in used (indicated by
* by `GNRC_MAC_NEIGHBOR_COUNT == 0`), `test_gnrc_mac_queue_tx_packet()` successively * by `CONFIG_GNRC_MAC_NEIGHBOR_COUNT == 0`), `test_gnrc_mac_queue_tx_packet()` successively
* queues 4 packets, which are pkt1, pkt2, pkt3 and pkt_bcast, into a defined `tx` * queues 4 packets, which are pkt1, pkt2, pkt3 and pkt_bcast, into a defined `tx`
* (type of `gnrc_mac_tx_t`). Pkt1, pkt2 have the same destination address of "0x76b6", * (type of `gnrc_mac_tx_t`). Pkt1, pkt2 have the same destination address of "0x76b6",
* , pkt3 is heading for "0x447e", while pkt_bcast is for broadcasting. * , pkt3 is heading for "0x447e", while pkt_bcast is for broadcasting.
@ -90,7 +90,7 @@ static void test_gnrc_mac_queue_tx_packet(void)
LL_APPEND(hdr, pkt3); LL_APPEND(hdr, pkt3);
pkt3 = hdr; pkt3 = hdr;
#if GNRC_MAC_NEIGHBOR_COUNT != 0 #if CONFIG_GNRC_MAC_NEIGHBOR_COUNT != 0
gnrc_pktsnip_t *pkt_head; gnrc_pktsnip_t *pkt_head;
TEST_ASSERT(gnrc_mac_queue_tx_packet(&tx,1,pkt1)); TEST_ASSERT(gnrc_mac_queue_tx_packet(&tx,1,pkt1));
@ -172,7 +172,7 @@ static void test_gnrc_mac_queue_tx_packet(void)
TEST_ASSERT(0 == gnrc_priority_pktqueue_length(&tx.queue)); TEST_ASSERT(0 == gnrc_priority_pktqueue_length(&tx.queue));
TEST_ASSERT_EQUAL_STRING(TEST_STRING8, pkt_head->next->data); TEST_ASSERT_EQUAL_STRING(TEST_STRING8, pkt_head->next->data);
#endif /* GNRC_MAC_NEIGHBOR_COUNT != 0 */ #endif /* CONFIG_GNRC_MAC_NEIGHBOR_COUNT != 0 */
} }
#endif /* GNRC_MAC_TX_QUEUE_SIZE != 0 */ #endif /* GNRC_MAC_TX_QUEUE_SIZE != 0 */