gnrc_mac: updated coding style.

This commit is contained in:
zhuoshuguo 2017-06-19 10:15:41 +02:00
parent ed9899ad57
commit 83e1385683
3 changed files with 82 additions and 74 deletions

View File

@ -22,8 +22,9 @@
#define NET_GNRC_MAC_INTERNAL_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
extern "C" {

View File

@ -23,11 +23,12 @@
#include <stdint.h>
#include <stdbool.h>
#include <kernel_types.h>
#include <net/gnrc.h>
#include <net/gnrc/priority_pktqueue.h>
#include <net/ieee802154.h>
#include <net/gnrc/mac/mac.h>
#include "kernel_types.h"
#include "net/gnrc.h"
#include "net/gnrc/priority_pktqueue.h"
#include "net/ieee802154.h"
#include "net/gnrc/mac/mac.h"
#ifdef __cplusplus
extern "C" {

View File

@ -20,14 +20,16 @@
*/
#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)
#include "debug.h"
#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(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;
/* 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 */
neighbor_id = 0;
neighbor = &tx->neighbors[neighbor_id];
} else {
}
else {
uint8_t *addr;
int addr_len;
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++) {
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);
gnrc_pktbuf_release(rx->dispatch_buffer[i]);
}