gnrc_mac: updated coding style.
This commit is contained in:
parent
ed9899ad57
commit
83e1385683
@ -22,8 +22,9 @@
|
|||||||
#define NET_GNRC_MAC_INTERNAL_H
|
#define NET_GNRC_MAC_INTERNAL_H
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <net/ieee802154.h>
|
|
||||||
#include <net/gnrc/mac/types.h>
|
#include "net/ieee802154.h"
|
||||||
|
#include "net/gnrc/mac/types.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|||||||
@ -23,11 +23,12 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <kernel_types.h>
|
|
||||||
#include <net/gnrc.h>
|
#include "kernel_types.h"
|
||||||
#include <net/gnrc/priority_pktqueue.h>
|
#include "net/gnrc.h"
|
||||||
#include <net/ieee802154.h>
|
#include "net/gnrc/priority_pktqueue.h"
|
||||||
#include <net/gnrc/mac/mac.h>
|
#include "net/ieee802154.h"
|
||||||
|
#include "net/gnrc/mac/mac.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|||||||
@ -20,14 +20,16 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <net/gnrc.h>
|
|
||||||
#include <net/gnrc/mac/internal.h>
|
#include "net/gnrc.h"
|
||||||
|
#include "net/gnrc/mac/internal.h"
|
||||||
|
|
||||||
#define ENABLE_DEBUG (0)
|
#define ENABLE_DEBUG (0)
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
#if ((GNRC_MAC_TX_QUEUE_SIZE != 0) || (GNRC_MAC_RX_QUEUE_SIZE != 0))
|
#if ((GNRC_MAC_TX_QUEUE_SIZE != 0) || (GNRC_MAC_RX_QUEUE_SIZE != 0))
|
||||||
gnrc_priority_pktqueue_node_t* _alloc_pktqueue_node(gnrc_priority_pktqueue_node_t* nodes, uint32_t size)
|
gnrc_priority_pktqueue_node_t *_alloc_pktqueue_node(gnrc_priority_pktqueue_node_t *nodes,
|
||||||
|
uint32_t size)
|
||||||
{
|
{
|
||||||
assert(nodes != NULL);
|
assert(nodes != NULL);
|
||||||
assert(size > 0);
|
assert(size > 0);
|
||||||
@ -143,12 +145,14 @@ bool gnrc_mac_queue_tx_packet(gnrc_mac_tx_t* tx, uint32_t priority, gnrc_pktsnip
|
|||||||
int neighbor_id;
|
int neighbor_id;
|
||||||
|
|
||||||
/* Check whether the packet it for broadcast or multicast */
|
/* Check whether the packet it for broadcast or multicast */
|
||||||
if (gnrc_netif_hdr_get_flag(pkt) & (GNRC_NETIF_HDR_FLAGS_MULTICAST | GNRC_NETIF_HDR_FLAGS_BROADCAST)) {
|
if (gnrc_netif_hdr_get_flag(pkt) &
|
||||||
|
(GNRC_NETIF_HDR_FLAGS_MULTICAST | GNRC_NETIF_HDR_FLAGS_BROADCAST)) {
|
||||||
/* Broadcast/multicast queue is neighbor 0 by definition */
|
/* Broadcast/multicast queue is neighbor 0 by definition */
|
||||||
neighbor_id = 0;
|
neighbor_id = 0;
|
||||||
neighbor = &tx->neighbors[neighbor_id];
|
neighbor = &tx->neighbors[neighbor_id];
|
||||||
|
|
||||||
} else {
|
}
|
||||||
|
else {
|
||||||
uint8_t *addr;
|
uint8_t *addr;
|
||||||
int addr_len;
|
int addr_len;
|
||||||
bool neighbor_known = true;
|
bool neighbor_known = true;
|
||||||
@ -237,7 +241,9 @@ void gnrc_mac_dispatch(gnrc_mac_rx_t* rx)
|
|||||||
|
|
||||||
for (unsigned i = 0; i < GNRC_MAC_DISPATCH_BUFFER_SIZE; i++) {
|
for (unsigned i = 0; i < GNRC_MAC_DISPATCH_BUFFER_SIZE; i++) {
|
||||||
if (rx->dispatch_buffer[i]) {
|
if (rx->dispatch_buffer[i]) {
|
||||||
if (!gnrc_netapi_dispatch_receive(rx->dispatch_buffer[i]->type, GNRC_NETREG_DEMUX_CTX_ALL, rx->dispatch_buffer[i])) {
|
if (!gnrc_netapi_dispatch_receive(rx->dispatch_buffer[i]->type,
|
||||||
|
GNRC_NETREG_DEMUX_CTX_ALL,
|
||||||
|
rx->dispatch_buffer[i])) {
|
||||||
DEBUG("Unable to forward packet of type %i\n", buffer[i]->type);
|
DEBUG("Unable to forward packet of type %i\n", buffer[i]->type);
|
||||||
gnrc_pktbuf_release(rx->dispatch_buffer[i]);
|
gnrc_pktbuf_release(rx->dispatch_buffer[i]);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user