Merge pull request #3661 from authmillenon/auto_init/api/auto_init_gnrc_netif
sys: auto_init: rename auto_init_ng_netif to auto_init_gnrc_netif
This commit is contained in:
commit
bd40b2c56b
@ -1 +0,0 @@
|
||||
include $(RIOTBASE)/Makefile.base
|
||||
@ -18,7 +18,7 @@ BOARD_BLACKLIST := arduino-mega2560 spark-core
|
||||
# Include packages that pull up and auto-init the link layer.
|
||||
# NOTE: 6LoWPAN will be included if IEEE802.15.4 devices are present
|
||||
USEMODULE += gnrc_netif_default
|
||||
USEMODULE += auto_init_ng_netif
|
||||
USEMODULE += auto_init_gnrc_netif
|
||||
# Specify the mandatory networking modules for IPv6 and UDP
|
||||
USEMODULE += gnrc_ipv6_router_default
|
||||
USEMODULE += gnrc_udp
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
DIRS += $(AUTO_INIT_MODULES)
|
||||
|
||||
ifneq (,$(filter auto_init_ng_netif,$(USEMODULE)))
|
||||
ifneq (,$(filter auto_init_gnrc_netif,$(USEMODULE)))
|
||||
DIRS += netif
|
||||
endif
|
||||
|
||||
|
||||
@ -160,7 +160,7 @@ void auto_init(void)
|
||||
|
||||
|
||||
/* initialize network devices */
|
||||
#ifdef MODULE_AUTO_INIT_NG_NETIF
|
||||
#ifdef MODULE_AUTO_INIT_GNRC_NETIF
|
||||
|
||||
#ifdef MODULE_AT86RF2XX
|
||||
extern void auto_init_at86rf2xx(void);
|
||||
@ -178,11 +178,11 @@ void auto_init(void)
|
||||
#endif
|
||||
|
||||
#ifdef MODULE_GNRC_NETDEV_ETH
|
||||
extern void auto_init_ng_netdev_eth(void);
|
||||
auto_init_ng_netdev_eth();
|
||||
extern void auto_init_gnrc_netdev_eth(void);
|
||||
auto_init_gnrc_netdev_eth();
|
||||
#endif
|
||||
|
||||
#endif /* MODULE_AUTO_INIT_NG_NETIF */
|
||||
#endif /* MODULE_AUTO_INIT_GNRC_NETIF */
|
||||
|
||||
#ifdef MODULE_GNRC_IPV6_NETIF
|
||||
gnrc_ipv6_netif_init_by_dev();
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
MODULE = auto_init_ng_netif
|
||||
MODULE = auto_init_gnrc_netif
|
||||
|
||||
include $(RIOTBASE)/Makefile.base
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* @ingroup auto_init_ng_netif
|
||||
* @ingroup auto_init_gnrc_netif
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* @ingroup auto_init_ng_netif
|
||||
* @ingroup auto_init_gnrc_netif
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
@ -40,7 +40,7 @@
|
||||
|
||||
static char _nomac_stack[NETDEV_ETH_MAC_STACKSIZE];
|
||||
|
||||
void auto_init_ng_netdev_eth(void)
|
||||
void auto_init_gnrc_netdev_eth(void)
|
||||
{
|
||||
DEBUG("Initializing NETDEV_ETH device\n");
|
||||
int res = gnrc_netdev_eth_init(&gnrc_netdev_eth, (dev_eth_t*)&dev_eth_tap);
|
||||
@ -9,7 +9,7 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* @ingroup auto_init_ng_netif
|
||||
* @ingroup auto_init_gnrc_netif
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup auto_init_ng_netif
|
||||
* @ingroup auto_init_gnrc_netif
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
|
||||
@ -8,7 +8,7 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup auto_init_ng_netif
|
||||
* @ingroup auto_init_gnrc_netif
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
|
||||
@ -61,7 +61,7 @@ endif
|
||||
|
||||
endif # USE_BOARD_PARAMETERS=false
|
||||
|
||||
USEMODULE += auto_init_ng_netif
|
||||
USEMODULE += auto_init_gnrc_netif
|
||||
USEMODULE += gnrc_netif
|
||||
USEMODULE += gnrc_nomac
|
||||
USEMODULE += gnrc_pktdump
|
||||
|
||||
@ -1,91 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2015 Freie Universität 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup tests
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Test application for AT86RF2xx network device driver
|
||||
*
|
||||
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
||||
*
|
||||
* @}
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "kernel.h"
|
||||
#include "at86rf2xx.h"
|
||||
#include "net/gnrc/nomac.h"
|
||||
#include "net/gnrc.h"
|
||||
|
||||
/* make sure the SPI port and the needed GPIO pins are defined */
|
||||
#ifndef ATRF_SPI
|
||||
#error "SPI not defined"
|
||||
#endif
|
||||
#ifndef ATRF_CS
|
||||
#error "Chip select pin not defined"
|
||||
#endif
|
||||
#ifndef ATRF_INT
|
||||
#error "Interrupt pin not defined"
|
||||
#endif
|
||||
#ifndef ATRF_SLEEP
|
||||
#error "Sleep pin not defined"
|
||||
#endif
|
||||
#ifndef ATRF_RESET
|
||||
#error "Reset pin not defined"
|
||||
#endif
|
||||
#ifndef ATRF_SPI_SPEED
|
||||
#define ATRF_SPI_SPEED (SPI_SPEED_5MHZ)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief MAC layer stack configuration
|
||||
* @{
|
||||
*/
|
||||
#define STACKSIZE (THREAD_STACKSIZE_MAIN)
|
||||
#define PRIO (0)
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @brief Allocate the AT86RF2xx device descriptor
|
||||
*/
|
||||
static at86rf2xx_t dev;
|
||||
|
||||
/**
|
||||
* @brief Stack for the nomac thread
|
||||
*/
|
||||
static char nomac_stack[STACKSIZE];
|
||||
|
||||
|
||||
void auto_init_ng_netif(void)
|
||||
{
|
||||
kernel_pid_t iface;
|
||||
int res;
|
||||
|
||||
/* initialize the AT86RF2xx device */
|
||||
printf("Initializing the AT86RF2xx radio at SPI_%i... \n", ATRF_SPI);
|
||||
res = at86rf2xx_init(&dev, ATRF_SPI, ATRF_SPI_SPEED,
|
||||
ATRF_CS, ATRF_INT,
|
||||
ATRF_SLEEP, ATRF_RESET);
|
||||
if (res < 0) {
|
||||
puts("Error initializing AT86RF2xx radio device");
|
||||
return;
|
||||
}
|
||||
|
||||
/* start MAC layer */
|
||||
puts("Starting the NOMAC layer on top of the driver");
|
||||
iface = gnrc_nomac_init(nomac_stack, sizeof(nomac_stack), PRIO, "at86rf2xx",
|
||||
(gnrc_netdev_t *)(&dev));
|
||||
if (iface <= KERNEL_PID_UNDEF) {
|
||||
puts("Error initializing MAC layer");
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
@ -50,7 +50,7 @@ endif
|
||||
|
||||
endif # USE_BOARD_PARAMETERS=false
|
||||
|
||||
USEMODULE += auto_init_ng_netif
|
||||
USEMODULE += auto_init_gnrc_netif
|
||||
USEMODULE += gnrc_netif
|
||||
USEMODULE += gnrc_nomac
|
||||
USEMODULE += gnrc_pktdump
|
||||
|
||||
@ -1,86 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2015 Freie Universität Berlin
|
||||
* Copyright (C) 2015 PHYTEC Messtechnik GmbH
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @ingroup tests
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief Test application for KW2xRF network device driver
|
||||
*
|
||||
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
|
||||
* @author Jonas Remmert <j.remmert@phytec.de>
|
||||
*
|
||||
* @}
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "kernel.h"
|
||||
#include "kw2xrf.h"
|
||||
#include "net/gnrc/nomac.h"
|
||||
#include "net/gnrc.h"
|
||||
|
||||
/* make sure the SPI port and the needed GPIO pins are defined */
|
||||
#ifndef KWRF_SPI
|
||||
#error "SPI not defined"
|
||||
#endif
|
||||
#ifndef KWRF_CS
|
||||
#error "Chip select pin not defined"
|
||||
#endif
|
||||
#ifndef KWRF_INT
|
||||
#error "Interrupt pin not defined"
|
||||
#endif
|
||||
#ifndef KWRF_SPI_SPEED
|
||||
#define KWRF_SPI_SPEED (SPI_SPEED_10MHZ)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief MAC layer stack configuration
|
||||
* @{
|
||||
*/
|
||||
#define STACKSIZE (THREAD_STACKSIZE_MAIN)
|
||||
#define PRIO (0)
|
||||
/** @} */
|
||||
|
||||
/**
|
||||
* @brief Allocate the KW2XRF device descriptor
|
||||
*/
|
||||
static kw2xrf_t dev;
|
||||
|
||||
/**
|
||||
* @brief Stack for the nomac thread
|
||||
*/
|
||||
static char nomac_stack[STACKSIZE];
|
||||
|
||||
|
||||
void auto_init_ng_netif(void)
|
||||
{
|
||||
kernel_pid_t iface;
|
||||
int res;
|
||||
|
||||
/* initialize the KW2XRF device */
|
||||
printf("Initializing the KW2XRF radio at SPI_%i... \n", KWRF_SPI);
|
||||
res = kw2xrf_init(&dev, KWRF_SPI, KWRF_SPI_SPEED,
|
||||
KWRF_CS, KWRF_INT);
|
||||
if (res < 0) {
|
||||
puts("Error initializing KW2XRF radio device");
|
||||
return;
|
||||
}
|
||||
|
||||
/* start MAC layer */
|
||||
puts("Starting the NOMAC layer on top of the driver");
|
||||
iface = gnrc_nomac_init(nomac_stack, sizeof(nomac_stack), PRIO, "kw2xrf",
|
||||
(gnrc_netdev_t *)(&dev));
|
||||
if (iface <= KERNEL_PID_UNDEF) {
|
||||
puts("Error initializing MAC layer");
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
@ -8,7 +8,7 @@ USEMODULE += gnrc
|
||||
USEMODULE += gnrc_nomac
|
||||
USEMODULE += gnrc_pktdump
|
||||
USEMODULE += gnrc_netdev_eth
|
||||
USEMODULE += auto_init_ng_netif
|
||||
USEMODULE += auto_init_gnrc_netif
|
||||
USEMODULE += shell
|
||||
USEMODULE += shell_commands
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@ endif
|
||||
|
||||
USEMODULE += xbee
|
||||
USEMODULE += gnrc_netif
|
||||
USEMODULE += auto_init_ng_netif
|
||||
USEMODULE += auto_init_gnrc_netif
|
||||
USEMODULE += gnrc_nomac
|
||||
USEMODULE += gnrc_pktdump
|
||||
USEMODULE += shell
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief xbee driver parameters example, used by auto_init_ng_netif
|
||||
* @brief xbee driver parameters example, used by auto_init_gnrc_netif
|
||||
*
|
||||
* @author Kaspar Schleiser <kaspar@schleiser.de>
|
||||
*/
|
||||
|
||||
@ -11,7 +11,7 @@
|
||||
* @{
|
||||
*
|
||||
* @file
|
||||
* @brief slip parameters example, used by auto_init_ng_netif
|
||||
* @brief slip parameters example, used by auto_init_gnrc_netif
|
||||
*
|
||||
* @author Martine Lenders <mlenders@inf.fu-berlin.de>
|
||||
*/
|
||||
|
||||
@ -7,7 +7,7 @@ BOARD_WHITELIST = native
|
||||
|
||||
USEMODULE += gnrc_zep
|
||||
USEMODULE += gnrc_netif_default
|
||||
USEMODULE += auto_init_ng_netif
|
||||
USEMODULE += auto_init_gnrc_netif
|
||||
USEMODULE += gnrc_ipv6_default
|
||||
USEMODULE += gnrc_nomac
|
||||
USEMODULE += gnrc_pktdump
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user