Merge pull request #14138 from akshaim/Kconfig_mac

gnrc/mac : Expose configurations to Kconfig
This commit is contained in:
Leandro Lanzieri 2020-06-17 18:12:40 +02:00 committed by GitHub
commit 3ce8efd4cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 153 additions and 49 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.
* 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
* `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
* by `CONFIG_GNRC_MAC_NEIGHBOR_COUNT == 0`), this function queues the packet into the single
* priority TX queue defined in in netdev_t::tx.
*
* @param[in,out] tx gnrc_mac transmission management object

View File

@ -21,6 +21,8 @@
* @author Shuguo Zhuo <shuguo.zhuo@inria.fr>
*/
#include "kernel_defines.h"
#ifndef NET_GNRC_MAC_MAC_H
#define NET_GNRC_MAC_MAC_H
@ -29,41 +31,94 @@ extern "C" {
#endif
/**
* @brief The default rx queue size for incoming packets
* @defgroup net_gnrc_mac_conf GNRC MAC compile configurations
* @ingroup net_gnrc_conf
* @{
*/
#ifndef GNRC_MAC_RX_QUEUE_SIZE
#define GNRC_MAC_RX_QUEUE_SIZE (8U)
/**
* @brief Default message queue size to use for the incoming packets (as
* exponent of 2^n).
*
* As the queue size ALWAYS needs to be power of two, this option represents the
* exponent of 2^n, which will be used as the size of the queue.
*/
#ifndef CONFIG_GNRC_MAC_RX_QUEUE_SIZE_EXP
#define CONFIG_GNRC_MAC_RX_QUEUE_SIZE_EXP (3U)
#endif
/**
* @brief The default buffer size for storing dispatching packets
* @brief Default buffer size to use for storing dispatching packets (as
* exponent of 2^n).
*
* As the buffer size ALWAYS needs to be power of two, this option represents
* the exponent of 2^n, which will be used as the size of the buffer.
*/
#ifndef GNRC_MAC_DISPATCH_BUFFER_SIZE
#define GNRC_MAC_DISPATCH_BUFFER_SIZE (8U)
#ifndef CONFIG_GNRC_MAC_DISPATCH_BUFFER_SIZE_EXP
#define CONFIG_GNRC_MAC_DISPATCH_BUFFER_SIZE_EXP (3U)
#endif
/**
* @brief Count of neighbor nodes in one-hop distance
* @brief Count of neighbor nodes in one-hop distance.
*/
#ifndef GNRC_MAC_NEIGHBOR_COUNT
#define GNRC_MAC_NEIGHBOR_COUNT (8U)
#ifndef CONFIG_GNRC_MAC_NEIGHBOR_COUNT
#define CONFIG_GNRC_MAC_NEIGHBOR_COUNT (8U)
#endif
/**
* @brief The default queue size for transmission packets coming from higher layers
* @brief Default queue size for transmission packets coming from higher
* layers (as exponent of 2^n).
*
* As the queue size ALWAYS needs to be power of two, this option represents
* the exponent of 2^n, which will be used as the size of the buffer.
*/
#ifndef GNRC_MAC_TX_QUEUE_SIZE
#define GNRC_MAC_TX_QUEUE_SIZE (8U)
#ifndef CONFIG_GNRC_MAC_TX_QUEUE_SIZE_EXP
#define CONFIG_GNRC_MAC_TX_QUEUE_SIZE_EXP (3U)
#endif
/**
* @brief Disable MAC radio duty-cycle recording and displaying.
*/
#ifdef DOXYGEN
#define CONFIG_GNRC_MAC_DISABLE_DUTYCYCLE_RECORD
#endif
/**
* @brief Enable/disable MAC radio duty-cycle recording and displaying.
*
* Set "1" to enable, set "0" to disable.
* @deprecated Use inverse @ref CONFIG_GNRC_MAC_DISABLE_DUTYCYCLE_RECORD
* instead. Will be removed after 2021.01 release.
*/
#ifndef GNRC_MAC_ENABLE_DUTYCYCLE_RECORD
#if IS_ACTIVE(CONFIG_GNRC_MAC_DISABLE_DUTYCYCLE_RECORD)
#define GNRC_MAC_ENABLE_DUTYCYCLE_RECORD (0)
#else
#define GNRC_MAC_ENABLE_DUTYCYCLE_RECORD (1U)
#endif
#endif
/** @} */
/**
* @brief The default rx queue size for incoming packets
*/
#ifndef GNRC_MAC_RX_QUEUE_SIZE
#define GNRC_MAC_RX_QUEUE_SIZE (1 << CONFIG_GNRC_MAC_RX_QUEUE_SIZE_EXP)
#endif
/**
* @brief The default buffer size for storing dispatching packets
*/
#ifndef GNRC_MAC_DISPATCH_BUFFER_SIZE
#define GNRC_MAC_DISPATCH_BUFFER_SIZE (1 << CONFIG_GNRC_MAC_DISPATCH_BUFFER_SIZE_EXP)
#endif
/**
* @brief The default queue size for transmission packets coming from higher
* layers
*/
#ifndef GNRC_MAC_TX_QUEUE_SIZE
#define GNRC_MAC_TX_QUEUE_SIZE (1 << CONFIG_GNRC_MAC_TX_QUEUE_SIZE_EXP)
#endif
#ifdef __cplusplus
}

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) */
#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.
*/
@ -162,9 +162,9 @@ typedef struct {
GNRC_MAC_PHASE_UNINITIALIZED, \
}
#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
* state machines.
@ -173,18 +173,18 @@ typedef struct {
* \#ifdef directives when applicable.
*/
typedef struct {
#if (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.
#if (CONFIG_GNRC_MAC_NEIGHBOR_COUNT != 0) || defined(DOXYGEN)
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) */
gnrc_mac_tx_neighbor_t *current_neighbor; /**< Neighbor information unit of destination node to which
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_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
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_pktsnip_t *packet; /**< currently scheduled packet for sending */
@ -219,26 +219,26 @@ typedef struct {
/**
* @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 { \
{ GNRC_MAC_TX_NEIGHBOR_INIT }, \
NULL, \
{ PRIORITY_PKTQUEUE_NODE_INIT(0, 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 { \
PRIORITY_PKTQUEUE_INIT, \
{ PRIORITY_PKTQUEUE_NODE_INIT(0, 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 { \
{ GNRC_MAC_TX_NEIGHBOR_INIT }, \
NULL, \
}
#endif /* ((GNRC_MAC_TX_QUEUE_SIZE != 0) && (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) */
#endif /* ((GNRC_MAC_TX_QUEUE_SIZE != 0) || (CONFIG_GNRC_MAC_NEIGHBOR_COUNT != 0)) || defined(DOXYGEN) */
#ifdef __cplusplus
}

View File

@ -90,16 +90,16 @@ typedef struct {
*/
gnrc_mac_rx_t rx;
#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
* state machines.
*
* @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;
#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)
gnrc_mac_prot_t prot;

View File

@ -9,6 +9,7 @@ menu "GNRC Network stack"
rsource "application_layer/dhcpv6/Kconfig"
rsource "link_layer/lorawan/Kconfig"
rsource "link_layer/mac/Kconfig"
rsource "netif/Kconfig"
rsource "network_layer/ipv6/Kconfig"
rsource "network_layer/sixlowpan/Kconfig"

View File

@ -1166,11 +1166,11 @@ bool gnrc_gomach_find_next_tx_neighbor(gnrc_netif_t *netif)
* thus to be more fair. */
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;
}
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) {
netif->mac.tx.last_tx_neighbor_id = j;
next = (int) j;
@ -1178,7 +1178,7 @@ bool gnrc_gomach_find_next_tx_neighbor(gnrc_netif_t *netif)
}
else {
j++;
if (j >= GNRC_MAC_NEIGHBOR_COUNT) {
if (j >= CONFIG_GNRC_MAC_NEIGHBOR_COUNT) {
j = 1;
}
}
@ -1388,7 +1388,7 @@ void gnrc_gomach_update_neighbor_phase(gnrc_netif_t *netif)
{
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) {
long int tmp = netif->mac.tx.neighbors[i].cp_phase -
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. */
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].pub_chanseq == netif->mac.prot.gomach.pub_channel_1) {
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;
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) {
/* Unknown destinations are initialized with their phase at the end
* of the local interval, so known destinations that still wakeup

View File

@ -0,0 +1,46 @@
# Copyright (c) 2020 Freie Universitaet Berlin
#
# This file is subject to the terms and conditions of the GNU Lesser
# General Public License v2.1. See the file LICENSE in the top level
# directory for more details.
#
menuconfig KCONFIG_MODULE_GNRC_MAC
bool "Configure GNRC MAC"
depends on MODULE_GNRC_MAC
help
Configure the GNRC MAC using Kconfig.
if KCONFIG_MODULE_GNRC_MAC
config GNRC_MAC_RX_QUEUE_SIZE_EXP
int "Exponent for the RX queue size (resulting in the queue size 2^n)"
default 3
help
As the queue size ALWAYS needs to be power of two, this option
represents the exponent of 2^n, which will be used as the size of the RX
queue for incoming packets.
config GNRC_MAC_DISPATCH_BUFFER_SIZE_EXP
int "Exponent for the dispatch buffer size (resulting in the buffer size 2^n)"
default 3
help
As the buffer size ALWAYS needs to be power of two, this option
represents the exponent of 2^n, which will be used as the size of the
dispatch buffer for storing dispatching packets.
config GNRC_MAC_NEIGHBOR_COUNT
int "Count of neighbor nodes in one-hop distance"
default 8
config GNRC_MAC_TX_QUEUE_SIZE_EXP
int "Exponent for the TX queue size (resulting in the queue size 2^n)"
default 3
help
As the queue size ALWAYS needs to be power of two, this option
represents the exponent of 2^n, which will be used as the size of the TX
queue for transmission packets coming from higher layers.
config GNRC_MAC_DISABLE_DUTYCYCLE_RECORD
bool "Disable MAC radio duty-cycle recording and displaying"
endif # KCONFIG_MODULE_GNRC_MAC

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)) */
#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 */
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;
/* 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 (memcmp(&(neighbors[i].l2_addr), dst_addr, addr_len) == 0) {
return i;
@ -78,7 +78,7 @@ int _gnrc_mac_free_neighbor(gnrc_mac_tx_t *tx)
neighbors = tx->neighbors;
/* 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) &&
(&neighbors[i] != tx->current_neighbor)) {
/* Mark as free */
@ -98,7 +98,7 @@ int _gnrc_mac_alloc_neighbor(gnrc_mac_tx_t *tx)
neighbors = tx->neighbors;
/* 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) {
gnrc_priority_pktqueue_init(&(neighbors[i].queue));
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;
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)
{
assert(tx != NULL);
assert(pkt != NULL);
#if GNRC_MAC_NEIGHBOR_COUNT == 0
#if CONFIG_GNRC_MAC_NEIGHBOR_COUNT == 0
gnrc_priority_pktqueue_node_t *node;
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 */
if (neighbor_id < 0) {
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 */
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);
return false;
#endif /* GNRC_MAC_NEIGHBOR_COUNT == 0 */
#endif /* CONFIG_GNRC_MAC_NEIGHBOR_COUNT == 0 */
}
#endif /* GNRC_MAC_TX_QUEUE_SIZE != 0 */

View File

@ -1,3 +1,5 @@
USEMODULE += gnrc_priority_pktqueue
USEMODULE += gnrc_mac
CFLAGS += -DGNRC_MAC_TX_QUEUE_SIZE=4 -DGNRC_MAC_NEIGHBOR_COUNT=4
# Set CFLAGS if not being set via Kconfig
CFLAGS += $(if $(CONFIG_KCONFIG_MODULE_GNRC_MAC),,-DGNRC_MAC_TX_QUEUE_SIZE=4 -DCONFIG_GNRC_MAC_NEIGHBOR_COUNT=4)

View File

@ -33,7 +33,7 @@ static void set_up(void)
* 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
* 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`
* (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.
@ -42,7 +42,7 @@ static void set_up(void)
* queued to `tx::neighbors[0]::queue`.
*
* 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`
* (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.
@ -90,7 +90,7 @@ static void test_gnrc_mac_queue_tx_packet(void)
LL_APPEND(hdr, pkt3);
pkt3 = hdr;
#if GNRC_MAC_NEIGHBOR_COUNT != 0
#if CONFIG_GNRC_MAC_NEIGHBOR_COUNT != 0
gnrc_pktsnip_t *pkt_head;
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_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 */