1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

netdev2: rename to netdev and remove gnrc_netdev

With some minor hand-edits I used the following chain of commands:

```sh
git rm sys/include/net/gnrc/netdev.h
git grep --name-only -i netdev2 | \
        xargs sed -i -e 's/^\(NETDEV\)2\(.*\)\( [("]\)/\1\2 \3/g' \
                     -e 's/\(netdev\)2\(.*\)\( \/\*\*<\)/\1\2 \3/I' \
                     -e 's/\(netdev\)2/\1/gI'
git add -p
git commit --amend
git ls-tree --full-tree -r HEAD --name-only | \
        grep "netdev2" | xargs -I'{}' dirname '{}' | uniq | \
        grep "netdev2" | while read dir; do
                new_dir="$(echo "$dir" | sed "s/netdev2/netdev/g")"
                git mv -f "$dir" "$new_dir"
        done
git commit --amend
git ls-tree --full-tree -r HEAD --name-only | \
        grep "netdev2" | while read file; do
                new_file="$(echo "$file" | sed "s/netdev2/netdev/g")"
                git mv -f "$file" "$new_file"
        done
git commit --amend
git grep --name-only "\<drivers_netdev_netdev\>" | \
        xargs sed -i "s/\<drivers_netdev_netdev\>/drivers_netdev_api/g"
git add -p
git commit --amend
```
This commit is contained in:
Martine Lenders 2017-02-15 13:07:34 +01:00
parent 2e304bcd17
commit 29842bb5e4
136 changed files with 1554 additions and 1748 deletions

View File

@ -26,11 +26,11 @@ endif
ifneq (,$(filter gnrc_netdev_default,$(USEMODULE)))
USEMODULE += gnrc_netif
USEMODULE += gnrc_netdev2
USEMODULE += gnrc_netdev
USEMODULE += netdev_default
endif
ifneq (,$(filter netdev2_ieee802154,$(USEMODULE)))
ifneq (,$(filter netdev_ieee802154,$(USEMODULE)))
USEMODULE += ieee802154
endif
@ -47,7 +47,7 @@ ifneq (,$(filter nordic_softdevice_ble,$(USEPKG)))
USEMODULE += gnrc_sixlowpan
USEMODULE += gnrc_sixlowpan_iphc
USEMODULE += gnrc_ipv6_default
USEMODULE += gnrc_netdev2
USEMODULE += gnrc_netdev
USEMODULE += gnrc_ipv6_netif
endif
@ -86,11 +86,11 @@ ifneq (,$(filter gnrc_netapi_mbox,$(USEMODULE)))
USEMODULE += core_mbox
endif
ifneq (,$(filter netdev2_tap,$(USEMODULE)))
ifneq (,$(filter netdev_tap,$(USEMODULE)))
USEMODULE += netif
USEMODULE += netdev2_eth
USEMODULE += netdev_eth
ifneq (,$(filter gnrc_%,$(USEMODULE)))
USEMODULE += gnrc_netdev2
USEMODULE += gnrc_netdev
endif
endif
@ -534,7 +534,7 @@ ifneq (,$(filter gnrc_pktbuf_%, $(USEMODULE)))
USEMODULE += gnrc_pktbuf # make MODULE_GNRC_PKTBUF macro available for all implementations
endif
ifneq (,$(filter gnrc_netdev2,$(USEMODULE)))
ifneq (,$(filter gnrc_netdev,$(USEMODULE)))
USEMODULE += netopt
endif

View File

@ -75,7 +75,7 @@ but not limited to:
`WERROR=0 make`
### USING THE NATIVE PORT WITH NETWORKING
If you compile RIOT for the native cpu and include the `netdev2_tap` module,
If you compile RIOT for the native cpu and include the `netdev_tap` module,
you can specify a network interface like this: `PORT=tap0 make term`
#### SETTING UP A TAP NETWORK

View File

@ -1,6 +1,6 @@
ifneq (,$(filter gnrc_netdev_default,$(USEMODULE)))
USEMODULE += netif
USEMODULE += cc2538_rf
USEMODULE += gnrc_netdev2
USEMODULE += netdev2_ieee802154
USEMODULE += gnrc_netdev
USEMODULE += netdev_ieee802154
endif

View File

@ -1,3 +1,3 @@
ifneq (,$(filter netdev_default gnrc_netdev_default,$(USEMODULE)))
USEMODULE += netdev2_tap
USEMODULE += netdev_tap
endif

View File

@ -1,6 +1,6 @@
ifneq (,$(filter gnrc_netdev_default,$(USEMODULE)))
USEMODULE += netif
USEMODULE += cc2538_rf
USEMODULE += gnrc_netdev2
USEMODULE += netdev2_ieee802154
USEMODULE += gnrc_netdev
USEMODULE += netdev_ieee802154
endif

View File

@ -1,8 +1,8 @@
ifneq (,$(filter gnrc_netdev_default,$(USEMODULE)))
USEMODULE += netif
USEMODULE += cc2538_rf
USEMODULE += gnrc_netdev2
USEMODULE += netdev2_ieee802154
USEMODULE += gnrc_netdev
USEMODULE += netdev_ieee802154
endif
ifneq (,$(filter saul_default,$(USEMODULE)))
USEMODULE += saul_gpio

View File

@ -25,8 +25,8 @@
#include <stdbool.h>
#include "net/ieee802154.h"
#include "net/netdev2.h"
#include "net/netdev2/ieee802154.h"
#include "net/netdev.h"
#include "net/netdev/ieee802154.h"
#ifdef __cplusplus
extern "C" {
@ -167,10 +167,10 @@ enum {
/**
* @brief Device descriptor for CC2538 transceiver
*
* @extends netdev2_ieee802154_t
* @extends netdev_ieee802154_t
*/
typedef struct {
netdev2_ieee802154_t netdev; /**< netdev2 parent struct */
netdev_ieee802154_t netdev; /**< netdev parent struct */
uint8_t state; /**< current state of the radio */
} cc2538_rf_t;

View File

@ -20,7 +20,7 @@
#ifndef CC2538_RF_NETDEV_H
#define CC2538_RF_NETDEV_H
#include "net/netdev2.h"
#include "net/netdev.h"
#ifdef __cplusplus
extern "C" {
@ -29,7 +29,7 @@ extern "C" {
/**
* @brief Reference to the netdev device driver struct
*/
extern const netdev2_driver_t cc2538_rf_driver;
extern const netdev_driver_t cc2538_rf_driver;
#ifdef __cplusplus
}

View File

@ -173,7 +173,7 @@ bool cc2538_on(void)
void cc2538_setup(cc2538_rf_t *dev)
{
netdev2_t *netdev = (netdev2_t *)dev;
netdev_t *netdev = (netdev_t *)dev;
netdev->driver = &cc2538_rf_driver;

View File

@ -22,7 +22,7 @@
#include <errno.h>
#include "net/gnrc.h"
#include "net/netdev2.h"
#include "net/netdev.h"
#include "cc2538_rf.h"
#include "cc2538_rf_netdev.h"
@ -33,14 +33,14 @@
#define _MAX_MHR_OVERHEAD (25)
static int _get(netdev2_t *dev, netopt_t opt, void *value, size_t max_len);
static int _set(netdev2_t *dev, netopt_t opt, void *value, size_t value_len);
static int _send(netdev2_t *netdev, const struct iovec *vector, unsigned count);
static int _recv(netdev2_t *netdev, void *buf, size_t len, void *info);
static void _isr(netdev2_t *netdev);
static int _init(netdev2_t *dev);
static int _get(netdev_t *dev, netopt_t opt, void *value, size_t max_len);
static int _set(netdev_t *dev, netopt_t opt, void *value, size_t value_len);
static int _send(netdev_t *netdev, const struct iovec *vector, unsigned count);
static int _recv(netdev_t *netdev, void *buf, size_t len, void *info);
static void _isr(netdev_t *netdev);
static int _init(netdev_t *dev);
const netdev2_driver_t cc2538_rf_driver = {
const netdev_driver_t cc2538_rf_driver = {
.get = _get,
.set = _set,
.send = _send,
@ -50,16 +50,16 @@ const netdev2_driver_t cc2538_rf_driver = {
};
/* Reference pointer for the IRQ handler */
static netdev2_t *_dev;
static netdev_t *_dev;
void _irq_handler(void)
{
if (_dev->event_callback) {
_dev->event_callback(_dev, NETDEV2_EVENT_ISR);
_dev->event_callback(_dev, NETDEV_EVENT_ISR);
}
}
static int _get(netdev2_t *netdev, netopt_t opt, void *value, size_t max_len)
static int _get(netdev_t *netdev, netopt_t opt, void *value, size_t max_len)
{
cc2538_rf_t *dev = (cc2538_rf_t *)netdev;
@ -89,7 +89,7 @@ static int _get(netdev2_t *netdev, netopt_t opt, void *value, size_t max_len)
if (max_len < sizeof(uint16_t)) {
return -EOVERFLOW;
}
*((uint16_t *) value) = NETDEV2_TYPE_IEEE802154;
*((uint16_t *) value) = NETDEV_TYPE_IEEE802154;
return sizeof(uint16_t);
case NETOPT_IS_CHANNEL_CLR:
@ -140,15 +140,15 @@ static int _get(netdev2_t *netdev, netopt_t opt, void *value, size_t max_len)
int res;
if (((res = netdev2_ieee802154_get((netdev2_ieee802154_t *)netdev, opt, value,
max_len)) >= 0) || (res != -ENOTSUP)) {
if (((res = netdev_ieee802154_get((netdev_ieee802154_t *)netdev, opt, value,
max_len)) >= 0) || (res != -ENOTSUP)) {
return res;
}
return -ENOTSUP;
}
static int _set(netdev2_t *netdev, netopt_t opt, void *value, size_t value_len)
static int _set(netdev_t *netdev, netopt_t opt, void *value, size_t value_len)
{
cc2538_rf_t *dev = (cc2538_rf_t *)netdev;
int res = -ENOTSUP;
@ -246,14 +246,14 @@ static int _set(netdev2_t *netdev, netopt_t opt, void *value, size_t value_len)
}
if (res == -ENOTSUP) {
res = netdev2_ieee802154_set((netdev2_ieee802154_t *)netdev, opt,
value, value_len);
res = netdev_ieee802154_set((netdev_ieee802154_t *)netdev, opt,
value, value_len);
}
return res;
}
static int _send(netdev2_t *netdev, const struct iovec *vector, unsigned count)
static int _send(netdev_t *netdev, const struct iovec *vector, unsigned count)
{
int pkt_len = 0;
@ -293,7 +293,7 @@ static int _send(netdev2_t *netdev, const struct iovec *vector, unsigned count)
return pkt_len;
}
static int _recv(netdev2_t *netdev, void *buf, size_t len, void *info)
static int _recv(netdev_t *netdev, void *buf, size_t len, void *info)
{
size_t pkt_len;
@ -335,7 +335,7 @@ static int _recv(netdev2_t *netdev, void *buf, size_t len, void *info)
if (info != NULL && RFCORE->XREG_RSSISTATbits.RSSI_VALID) {
uint8_t corr_val;
int8_t rssi_val;
netdev2_ieee802154_rx_info_t *radio_info = info;
netdev_ieee802154_rx_info_t *radio_info = info;
rssi_val = rfcore_read_byte() + CC2538_RSSI_OFFSET;
RFCORE_ASSERT(rssi_val > CC2538_RF_SENSITIVITY);
@ -364,12 +364,12 @@ static int _recv(netdev2_t *netdev, void *buf, size_t len, void *info)
return pkt_len;
}
static void _isr(netdev2_t *netdev)
static void _isr(netdev_t *netdev)
{
netdev->event_callback(netdev, NETDEV2_EVENT_RX_COMPLETE);
netdev->event_callback(netdev, NETDEV_EVENT_RX_COMPLETE);
}
static int _init(netdev2_t *netdev)
static int _init(netdev_t *netdev)
{
cc2538_rf_t *dev = (cc2538_rf_t *) netdev;
_dev = netdev;
@ -379,15 +379,15 @@ static int _init(netdev2_t *netdev)
uint16_t addr_short = cc2538_get_addr_short();
uint64_t addr_long = cc2538_get_addr_long();
/* Initialise netdev2_ieee802154_t struct */
netdev2_ieee802154_set((netdev2_ieee802154_t *)netdev, NETOPT_NID,
&pan, sizeof(pan));
netdev2_ieee802154_set((netdev2_ieee802154_t *)netdev, NETOPT_CHANNEL,
&chan, sizeof(chan));
netdev2_ieee802154_set((netdev2_ieee802154_t *)netdev, NETOPT_ADDRESS,
&addr_short, sizeof(addr_short));
netdev2_ieee802154_set((netdev2_ieee802154_t *)netdev, NETOPT_ADDRESS_LONG,
&addr_long, sizeof(addr_long));
/* Initialise netdev_ieee802154_t struct */
netdev_ieee802154_set((netdev_ieee802154_t *)netdev, NETOPT_NID, &pan,
sizeof(pan));
netdev_ieee802154_set((netdev_ieee802154_t *)netdev, NETOPT_CHANNEL, &chan,
sizeof(chan));
netdev_ieee802154_set((netdev_ieee802154_t *)netdev, NETOPT_ADDRESS,
&addr_short, sizeof(addr_short));
netdev_ieee802154_set((netdev_ieee802154_t *)netdev, NETOPT_ADDRESS_LONG,
&addr_long, sizeof(addr_long));
cc2538_set_state(dev, NETOPT_STATE_IDLE);

View File

@ -3,8 +3,8 @@ MODULE = cpu
DIRS += periph
DIRS += vfs
ifneq (,$(filter netdev2_tap,$(USEMODULE)))
DIRS += netdev2_tap
ifneq (,$(filter netdev_tap,$(USEMODULE)))
DIRS += netdev_tap
endif
include $(RIOTBASE)/Makefile.base

View File

@ -34,7 +34,7 @@ server (vgdb).
Network Support
===============
If you compile RIOT for the native cpu and include the `netdev2_tap`
If you compile RIOT for the native cpu and include the `netdev_tap`
module, you need to specify a network interface like this:
make term PORT=tap0

View File

@ -7,25 +7,25 @@
*/
/**
* @ingroup netdev2
* @ingroup netdev
* @brief Low-level ethernet driver for native tap interfaces
* @{
*
* @file
* @brief Definitions for @ref netdev2 ethernet driver for host system's
* @brief Definitions for @ref netdev ethernet driver for host system's
* TAP interfaces
*
* @author Kaspar Schleiser <kaspar@schleiser.de>
*/
#ifndef NETDEV2_TAP_H
#define NETDEV2_TAP_H
#ifndef NETDEV_TAP_H
#define NETDEV_TAP_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdint.h>
#include "net/netdev2.h"
#include "net/netdev.h"
#include "net/ethernet/hdr.h"
@ -38,13 +38,13 @@ extern "C" {
/**
* @brief tap interface state
*/
typedef struct netdev2_tap {
netdev2_t netdev; /**< netdev2 internal member */
typedef struct netdev_tap {
netdev_t netdev; /**< netdev internal member */
char tap_name[IFNAMSIZ]; /**< host dev file name */
int tap_fd; /**< host file descriptor for the TAP */
uint8_t addr[ETHERNET_ADDR_LEN]; /**< The MAC address of the TAP */
uint8_t promiscous; /**< Flag for promiscous mode */
} netdev2_tap_t;
} netdev_tap_t;
/**
* @brief tap interface initialization parameters
@ -52,18 +52,18 @@ typedef struct netdev2_tap {
typedef struct {
char **tap_name; /**< Name of the host system's tap
inteface to bind to. */
} netdev2_tap_params_t;
} netdev_tap_params_t;
/**
* @brief Setup netdev2_tap_t structure.
* @brief Setup netdev_tap_t structure.
*
* @param dev the preallocated netdev2_tap device handle to setup
* @param dev the preallocated netdev_tap device handle to setup
* @param params initialization parameters
*/
void netdev2_tap_setup(netdev2_tap_t *dev, const netdev2_tap_params_t *params);
void netdev_tap_setup(netdev_tap_t *dev, const netdev_tap_params_t *params);
#ifdef __cplusplus
}
#endif
/** @} */
#endif /* NETDEV2_TAP_H */
#endif /* NETDEV_TAP_H */

View File

@ -7,44 +7,44 @@
*/
/**
* @ingroup netdev2
* @ingroup netdev
* @brief
* @{
*
* @file
* @brief Default configuration for the netdev2_tap driver
* @brief Default configuration for the netdev_tap driver
*
* @author Martine Lenders <m.lenders@fu-berlin.de>
*/
#ifndef NETDEV2_TAP_PARAMS_H_
#define NETDEV2_TAP_PARAMS_H_
#ifndef NETDEV_TAP_PARAMS_H_
#define NETDEV_TAP_PARAMS_H_
#include "netdev2_tap.h"
#include "netdev_tap.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Number of allocated parameters at @ref netdev2_tap_params
* @brief Number of allocated parameters at @ref netdev_tap_params
*
* @note This was decided to only be configurable on compile-time to be
* more similar to actual boards
*/
#ifndef NETDEV2_TAP_MAX
#define NETDEV2_TAP_MAX (1)
#ifndef NETDEV_TAP_MAX
#define NETDEV_TAP_MAX (1)
#endif
/**
* @brief Configuration parameters for @ref netdev2_tap_t
* @brief Configuration parameters for @ref netdev_tap_t
*
* @note This variable is set on native start-up based on arguments provided
*/
extern netdev2_tap_params_t netdev2_tap_params[NETDEV2_TAP_MAX];
extern netdev_tap_params_t netdev_tap_params[NETDEV_TAP_MAX];
#ifdef __cplusplus
}
#endif
#endif /* NETDEV2_TAP_PARAMS_H_ */
#endif /* NETDEV_TAP_PARAMS_H_ */
/** @} */

View File

@ -52,9 +52,9 @@
#include "cpu.h"
#include "cpu_conf.h"
#ifdef MODULE_NETDEV2_TAP
#include "netdev2_tap.h"
extern netdev2_tap_t netdev2_tap;
#ifdef MODULE_NETDEV_TAP
#include "netdev_tap.h"
extern netdev_tap_t netdev_tap;
#endif
#include "native_internal.h"

View File

@ -10,7 +10,7 @@
*/
/*
* @ingroup netdev2
* @ingroup netdev
* @{
* @brief Low-level ethernet driver for tap interfaces
* @author Kaspar Schleiser <kaspar@schleiser.de>
@ -49,60 +49,60 @@
#include "async_read.h"
#include "net/eui64.h"
#include "net/netdev2.h"
#include "net/netdev2/eth.h"
#include "net/netdev.h"
#include "net/netdev/eth.h"
#include "net/ethernet.h"
#include "net/ethernet/hdr.h"
#include "netdev2_tap.h"
#include "netdev_tap.h"
#include "net/netopt.h"
#include "net/eui64.h"
#define ENABLE_DEBUG (0)
#include "debug.h"
/* netdev2 interface */
static int _init(netdev2_t *netdev);
static int _send(netdev2_t *netdev, const struct iovec *vector, unsigned n);
static int _recv(netdev2_t *netdev, void *buf, size_t n, void *info);
/* netdev interface */
static int _init(netdev_t *netdev);
static int _send(netdev_t *netdev, const struct iovec *vector, unsigned n);
static int _recv(netdev_t *netdev, void *buf, size_t n, void *info);
static inline void _get_mac_addr(netdev2_t *netdev, uint8_t *dst)
static inline void _get_mac_addr(netdev_t *netdev, uint8_t *dst)
{
netdev2_tap_t *dev = (netdev2_tap_t*)netdev;
netdev_tap_t *dev = (netdev_tap_t*)netdev;
memcpy(dst, dev->addr, ETHERNET_ADDR_LEN);
}
static inline void _set_mac_addr(netdev2_t *netdev, uint8_t *src)
static inline void _set_mac_addr(netdev_t *netdev, uint8_t *src)
{
netdev2_tap_t *dev = (netdev2_tap_t*)netdev;
netdev_tap_t *dev = (netdev_tap_t*)netdev;
memcpy(dev->addr, src, ETHERNET_ADDR_LEN);
}
static inline int _get_promiscous(netdev2_t *netdev)
static inline int _get_promiscous(netdev_t *netdev)
{
netdev2_tap_t *dev = (netdev2_tap_t*)netdev;
netdev_tap_t *dev = (netdev_tap_t*)netdev;
return dev->promiscous;
}
static inline int _set_promiscous(netdev2_t *netdev, int value)
static inline int _set_promiscous(netdev_t *netdev, int value)
{
netdev2_tap_t *dev = (netdev2_tap_t*)netdev;
netdev_tap_t *dev = (netdev_tap_t*)netdev;
dev->promiscous = value;
return value;
}
static inline void _isr(netdev2_t *netdev)
static inline void _isr(netdev_t *netdev)
{
if (netdev->event_callback) {
netdev->event_callback(netdev, NETDEV2_EVENT_RX_COMPLETE);
netdev->event_callback(netdev, NETDEV_EVENT_RX_COMPLETE);
}
#if DEVELHELP
else {
puts("netdev2_tap: _isr(): no event_callback set.");
puts("netdev_tap: _isr(): no event_callback set.");
}
#endif
}
static int _get(netdev2_t *dev, netopt_t opt, void *value, size_t max_len)
static int _get(netdev_t *dev, netopt_t opt, void *value, size_t max_len)
{
int res = 0;
@ -121,14 +121,14 @@ static int _get(netdev2_t *dev, netopt_t opt, void *value, size_t max_len)
res = sizeof(bool);
break;
default:
res = netdev2_eth_get(dev, opt, value, max_len);
res = netdev_eth_get(dev, opt, value, max_len);
break;
}
return res;
}
static int _set(netdev2_t *dev, netopt_t opt, void *value, size_t value_len)
static int _set(netdev_t *dev, netopt_t opt, void *value, size_t value_len)
{
(void)value_len;
int res = 0;
@ -148,7 +148,7 @@ static int _set(netdev2_t *dev, netopt_t opt, void *value, size_t value_len)
return res;
}
static netdev2_driver_t netdev2_driver_tap = {
static netdev_driver_t netdev_driver_tap = {
.send = _send,
.recv = _recv,
.init = _init,
@ -170,7 +170,7 @@ static inline bool _is_addr_multicast(uint8_t *addr)
return (addr[0] & 0x01);
}
static void _continue_reading(netdev2_tap_t *dev)
static void _continue_reading(netdev_tap_t *dev)
{
/* work around lost signals */
fd_set rfds;
@ -187,25 +187,25 @@ static void _continue_reading(netdev2_tap_t *dev)
extern ssize_t (*real_write)(int fd, const void * buf, size_t count);
real_write(_sig_pipefd[1], &sig, sizeof(int));
_native_sigpend++;
DEBUG("netdev2_tap: sigpend++\n");
DEBUG("netdev_tap: sigpend++\n");
}
else {
DEBUG("netdev2_tap: native_async_read_continue\n");
DEBUG("netdev_tap: native_async_read_continue\n");
native_async_read_continue(dev->tap_fd);
}
_native_in_syscall--;
}
static int _recv(netdev2_t *netdev2, void *buf, size_t len, void *info)
static int _recv(netdev_t *netdev, void *buf, size_t len, void *info)
{
netdev2_tap_t *dev = (netdev2_tap_t*)netdev2;
netdev_tap_t *dev = (netdev_tap_t*)netdev;
(void)info;
if (!buf) {
if (len > 0) {
/* no memory available in pktbuf, discarding the frame */
DEBUG("netdev2_tap: discarding the frame\n");
DEBUG("netdev_tap: discarding the frame\n");
/* repeating `real_read` for small size on tap device results in
* freeze for some reason. Using a large buffer for now. */
@ -228,14 +228,14 @@ static int _recv(netdev2_t *netdev2, void *buf, size_t len, void *info)
}
int nread = real_read(dev->tap_fd, buf, len);
DEBUG("netdev2_tap: read %d bytes\n", nread);
DEBUG("netdev_tap: read %d bytes\n", nread);
if (nread > 0) {
ethernet_hdr_t *hdr = (ethernet_hdr_t *)buf;
if (!(dev->promiscous) && !_is_addr_multicast(hdr->dst) &&
!_is_addr_broadcast(hdr->dst) &&
(memcmp(hdr->dst, dev->addr, ETHERNET_ADDR_LEN) != 0)) {
DEBUG("netdev2_tap: received for %02x:%02x:%02x:%02x:%02x:%02x\n"
DEBUG("netdev_tap: received for %02x:%02x:%02x:%02x:%02x:%02x\n"
"That's not me => Dropped\n",
hdr->dst[0], hdr->dst[1], hdr->dst[2],
hdr->dst[3], hdr->dst[4], hdr->dst[5]);
@ -248,8 +248,8 @@ static int _recv(netdev2_t *netdev2, void *buf, size_t len, void *info)
_continue_reading(dev);
#ifdef MODULE_NETSTATS_L2
netdev2->stats.rx_count++;
netdev2->stats.rx_bytes += nread;
netdev->stats.rx_count++;
netdev->stats.rx_bytes += nread;
#endif
return nread;
}
@ -257,7 +257,7 @@ static int _recv(netdev2_t *netdev2, void *buf, size_t len, void *info)
if ((errno == EAGAIN) || (errno == EWOULDBLOCK)) {
}
else {
err(EXIT_FAILURE, "netdev2_tap: read");
err(EXIT_FAILURE, "netdev_tap: read");
}
}
else if (nread == 0) {
@ -270,9 +270,9 @@ static int _recv(netdev2_t *netdev2, void *buf, size_t len, void *info)
return -1;
}
static int _send(netdev2_t *netdev, const struct iovec *vector, unsigned n)
static int _send(netdev_t *netdev, const struct iovec *vector, unsigned n)
{
netdev2_tap_t *dev = (netdev2_tap_t*)netdev;
netdev_tap_t *dev = (netdev_tap_t*)netdev;
int res = _native_writev(dev->tap_fd, vector, n);
#ifdef MODULE_NETSTATS_L2
size_t bytes = 0;
@ -283,34 +283,34 @@ static int _send(netdev2_t *netdev, const struct iovec *vector, unsigned n)
netdev->stats.tx_bytes += bytes;
#endif
if (netdev->event_callback) {
netdev->event_callback(netdev, NETDEV2_EVENT_TX_COMPLETE);
netdev->event_callback(netdev, NETDEV_EVENT_TX_COMPLETE);
}
return res;
}
void netdev2_tap_setup(netdev2_tap_t *dev, const netdev2_tap_params_t *params) {
dev->netdev.driver = &netdev2_driver_tap;
void netdev_tap_setup(netdev_tap_t *dev, const netdev_tap_params_t *params) {
dev->netdev.driver = &netdev_driver_tap;
strncpy(dev->tap_name, *(params->tap_name), IFNAMSIZ);
}
static void _tap_isr(int fd, void *arg) {
(void) fd;
netdev2_t *netdev = (netdev2_t *)arg;
netdev_t *netdev = (netdev_t *)arg;
if (netdev->event_callback) {
netdev->event_callback(netdev, NETDEV2_EVENT_ISR);
netdev->event_callback(netdev, NETDEV_EVENT_ISR);
}
else {
puts("netdev2_tap: _isr: no event callback.");
puts("netdev_tap: _isr: no event callback.");
}
}
static int _init(netdev2_t *netdev)
static int _init(netdev_t *netdev)
{
DEBUG("%s:%s:%u\n", RIOT_FILE_RELATIVE, __func__, __LINE__);
netdev2_tap_t *dev = (netdev2_tap_t*)netdev;
netdev_tap_t *dev = (netdev_tap_t*)netdev;
/* check device parametrs */
if (dev == NULL) {

View File

@ -59,10 +59,10 @@ unsigned _native_rng_seed = 0;
int _native_rng_mode = 0;
const char *_native_unix_socket_path = NULL;
#ifdef MODULE_NETDEV2_TAP
#include "netdev2_tap_params.h"
#ifdef MODULE_NETDEV_TAP
#include "netdev_tap_params.h"
netdev2_tap_params_t netdev2_tap_params[NETDEV2_TAP_MAX];
netdev_tap_params_t netdev_tap_params[NETDEV_TAP_MAX];
#endif
static const char short_opts[] = ":hi:s:deEoc:";
@ -199,8 +199,8 @@ void usage_exit(int status)
{
real_printf("usage: %s", _progname);
#if defined(MODULE_NETDEV2_TAP)
for (int i = 0; i < NETDEV2_TAP_MAX; i++) {
#if defined(MODULE_NETDEV_TAP)
for (int i = 0; i < NETDEV_TAP_MAX; i++) {
real_printf(" <tap interface %d>", i + 1);
}
#endif
@ -289,8 +289,8 @@ __attribute__((constructor)) static void startup(int argc, char **argv)
usage_exit(EXIT_FAILURE);
}
}
#ifdef MODULE_NETDEV2_TAP
for (int i = 0; i < NETDEV2_TAP_MAX; i++) {
#ifdef MODULE_NETDEV_TAP
for (int i = 0; i < NETDEV_TAP_MAX; i++) {
if (argv[optind + i] == NULL) {
/* no tap parameter left */
usage_exit(EXIT_FAILURE);
@ -321,9 +321,9 @@ __attribute__((constructor)) static void startup(int argc, char **argv)
native_cpu_init();
native_interrupt_init();
#ifdef MODULE_NETDEV2_TAP
for (int i = 0; i < NETDEV2_TAP_MAX; i++) {
netdev2_tap_params[i].tap_name = &argv[optind + i];
#ifdef MODULE_NETDEV_TAP
for (int i = 0; i < NETDEV_TAP_MAX; i++) {
netdev_tap_params[i].tap_name = &argv[optind + i];
}
#endif

View File

@ -72,7 +72,7 @@
#ifndef NRFMIN_H
#define NRFMIN_H
#include "net/netdev2.h"
#include "net/netdev.h"
#ifdef __cplusplus
extern "C" {
@ -134,14 +134,14 @@ typedef union {
} nrfmin_pkt_t;
/**
* @brief Export the netdev2 device descriptor
* @brief Export the netdev device descriptor
*/
extern netdev2_t nrfmin_dev;
extern netdev_t nrfmin_dev;
/**
* @brief Reference to the netdev driver interface
*/
extern const netdev2_driver_t nrfmin_netdev;
extern const netdev_driver_t nrfmin_netdev;
/**
* @brief Setup the device driver's data structures

View File

@ -38,7 +38,7 @@ extern "C" {
* function can be called from auto_init as is, without the need for external
* memory allocation.
*/
void gnrc_netdev2_nrfmin_init(void);
void gnrc_netdev_nrfmin_init(void);
#ifdef __cplusplus
}

View File

@ -29,7 +29,7 @@
#include "periph/cpuid.h"
#include "nrfmin.h"
#include "net/netdev2.h"
#include "net/netdev.h"
#define ENABLE_DEBUG (0)
#include "debug.h"
@ -90,7 +90,7 @@ typedef enum {
/**
* @brief Since there can only be 1 nrfmin device, we allocate it right here
*/
netdev2_t nrfmin_dev;
netdev_t nrfmin_dev;
/**
* @brief For faster lookup we remember our own 16-bit address
@ -311,7 +311,7 @@ void isr_radio(void)
return;
}
rx_lock = 0;
nrfmin_dev.event_callback(&nrfmin_dev, NETDEV2_EVENT_ISR);
nrfmin_dev.event_callback(&nrfmin_dev, NETDEV_EVENT_ISR);
}
else if (state == STATE_TX) {
goto_target_state();
@ -321,7 +321,7 @@ void isr_radio(void)
cortexm_isr_end();
}
static int nrfmin_send(netdev2_t *dev, const struct iovec *vector, unsigned count)
static int nrfmin_send(netdev_t *dev, const struct iovec *vector, unsigned count)
{
(void)dev;
@ -355,7 +355,7 @@ static int nrfmin_send(netdev2_t *dev, const struct iovec *vector, unsigned coun
return (int)count;
}
static int nrfmin_recv(netdev2_t *dev, void *buf, size_t len, void *info)
static int nrfmin_recv(netdev_t *dev, void *buf, size_t len, void *info)
{
(void)dev;
(void)info;
@ -390,7 +390,7 @@ static int nrfmin_recv(netdev2_t *dev, void *buf, size_t len, void *info)
return pktlen;
}
static int nrfmin_init(netdev2_t *dev)
static int nrfmin_init(netdev_t *dev)
{
uint8_t cpuid[CPUID_LEN];
@ -449,14 +449,14 @@ static int nrfmin_init(netdev2_t *dev)
return 0;
}
static void nrfmin_isr(netdev2_t *dev)
static void nrfmin_isr(netdev_t *dev)
{
if (nrfmin_dev.event_callback) {
nrfmin_dev.event_callback(dev, NETDEV2_EVENT_RX_COMPLETE);
nrfmin_dev.event_callback(dev, NETDEV_EVENT_RX_COMPLETE);
}
}
static int nrfmin_get(netdev2_t *dev, netopt_t opt, void *val, size_t max_len)
static int nrfmin_get(netdev_t *dev, netopt_t opt, void *val, size_t max_len)
{
(void)dev;
@ -494,7 +494,7 @@ static int nrfmin_get(netdev2_t *dev, netopt_t opt, void *val, size_t max_len)
return 2;
case NETOPT_DEVICE_TYPE:
assert(max_len >= sizeof(uint16_t));
*((uint16_t *)val) = NETDEV2_TYPE_NRFMIN;
*((uint16_t *)val) = NETDEV_TYPE_NRFMIN;
return sizeof(uint16_t);
case NETOPT_IPV6_IID:
assert(max_len >= sizeof(uint64_t));
@ -505,7 +505,7 @@ static int nrfmin_get(netdev2_t *dev, netopt_t opt, void *val, size_t max_len)
}
}
static int nrfmin_set(netdev2_t *dev, netopt_t opt, void *val, size_t len)
static int nrfmin_set(netdev_t *dev, netopt_t opt, void *val, size_t len)
{
(void)dev;
@ -537,9 +537,9 @@ static int nrfmin_set(netdev2_t *dev, netopt_t opt, void *val, size_t len)
}
/**
* @brief Export of the netdev2 interface
* @brief Export of the netdev interface
*/
const netdev2_driver_t nrfmin_netdev = {
const netdev_driver_t nrfmin_netdev = {
.send = nrfmin_send,
.recv = nrfmin_recv,
.init = nrfmin_init,

View File

@ -19,7 +19,7 @@
*/
#include "thread.h"
#include "net/gnrc/netdev2.h"
#include "net/gnrc/netdev.h"
#include "nrfmin_gnrc.h"
@ -31,7 +31,7 @@
* @{
*/
#ifndef NRFMIN_GNRC_THREAD_PRIO
#define NRFMIN_GNRC_THREAD_PRIO GNRC_NETDEV2_MAC_PRIO
#define NRFMIN_GNRC_THREAD_PRIO GNRC_NETDEV_MAC_PRIO
#endif
#ifndef NRFMIN_GNRC_STACKSIZE
@ -45,14 +45,14 @@
#define BCAST (GNRC_NETIF_HDR_FLAGS_BROADCAST | GNRC_NETIF_HDR_FLAGS_MULTICAST)
/**
* @brief Allocate the stack for the GNRC netdev2 thread to run in
* @brief Allocate the stack for the GNRC netdev thread to run in
*/
static char stack[NRFMIN_GNRC_STACKSIZE];
/**
* @brief Allocate the GNRC netdev2 data structure.
* @brief Allocate the GNRC netdev data structure.
*/
static gnrc_netdev2_t plug;
static gnrc_netdev_t plug;
static int hdr_netif_to_nrfmin(nrfmin_hdr_t *nrfmin, gnrc_pktsnip_t *pkt)
@ -81,7 +81,7 @@ static int hdr_netif_to_nrfmin(nrfmin_hdr_t *nrfmin, gnrc_pktsnip_t *pkt)
return 0;
}
static int gnrc_nrfmin_send(gnrc_netdev2_t *dev, gnrc_pktsnip_t *pkt)
static int gnrc_nrfmin_send(gnrc_netdev_t *dev, gnrc_pktsnip_t *pkt)
{
int res;
struct iovec *vec;
@ -124,7 +124,7 @@ static int gnrc_nrfmin_send(gnrc_netdev2_t *dev, gnrc_pktsnip_t *pkt)
return res;
}
static gnrc_pktsnip_t *gnrc_nrfmin_recv(gnrc_netdev2_t *dev)
static gnrc_pktsnip_t *gnrc_nrfmin_recv(gnrc_netdev_t *dev)
{
int pktsize;
nrfmin_hdr_t *nrfmin;
@ -195,7 +195,7 @@ void gnrc_nrfmin_init(void)
plug.recv = gnrc_nrfmin_recv;
plug.dev = &nrfmin_dev;
gnrc_netdev2_init(stack, sizeof(stack),
gnrc_netdev_init(stack, sizeof(stack),
NRFMIN_GNRC_THREAD_PRIO,
"nrfmin", &plug);
}

View File

@ -8,7 +8,7 @@ To use, add
#
GNRC_NETIF_NUMOF := 2
USEMODULE += ethos gnrc_netdev2
USEMODULE += ethos gnrc_netdev
CFLAGS += '-DETHOS_UART=UART_DEV(0)' -DETHOS_BAUDRATE=115200 -DUSE_ETHOS_FOR_STDIO
to app Makefile, "make clean all flash", then run this tool so follows:

View File

@ -71,7 +71,7 @@ terminal tools for the specified platform. These targets use the variable
the targets `flash` and `term` are mandatory for the native port.
For the native port, `PORT` has a special meaning: it is used to identify the
tap interface if the `netdev2_tap` module is used. The target `debug` can be
tap interface if the `netdev_tap` module is used. The target `debug` can be
used to invoke a debugger on some platforms. For the native port the additional
targets such as `all-valgrind` and `valgrind` exist. Refer to
`cpu/native/README.md` for additional information

View File

@ -426,9 +426,9 @@
stroke-miterlimit: 4;
stroke-width: 3;
}
#gnrc-detail-netdev2 {
#gnrc-detail-netdev {
fill: none;
stroke: url(#outer-gradient-netdev2);
stroke: url(#outer-gradient-netdev);
stroke-linecap: round;
stroke-linejoin: miter;
stroke-miterlimit: 4;
@ -476,7 +476,7 @@
<stop style="stop-color: #3fa687; stop-opacity: 1;" offset="0.9" />
<stop style="stop-color: #3fa687; stop-opacity: 1;" offset="1" />
</linearGradient>
<linearGradient id="outer-gradient-netdev2" x1="0%" y1="0%" x2="0%" y2="100%">
<linearGradient id="outer-gradient-netdev" x1="0%" y1="0%" x2="0%" y2="100%">
<stop style="stop-color: #3fa687; stop-opacity: 1;" offset="0" />
<stop style="stop-color: #3fa687; stop-opacity: 1;" offset="0.1" />
<stop style="stop-color: #3fa687; stop-opacity: 0;" offset="0.9" />
@ -494,7 +494,7 @@
<g id="transformer" transform="scale(0.75)">
<g id="gnrc-detail" transform="translate(5,0)">
<rect id="gnrc-detail-conn" x="0" y="0" rx="4" ry="4" width="380" height="30" />
<rect id="gnrc-detail-netdev2" x="0" y="360" rx="4" ry="4" width="380" height="30" />
<rect id="gnrc-detail-netdev" x="0" y="360" rx="4" ry="4" width="380" height="30" />
<g id="gnrc-detail-gnrc" transform="translate(0,10)">
<rect id="sys-net-border" class="outer-stroke" x="0" y="30" rx="4" ry="4"
width="380" height="310" />
@ -547,9 +547,9 @@
<text id="gnrc-ipv6-label" class="modbox-text"
x="190" y="192"><tspan>gnrc_ipv6</tspan></text>
</g>
<g id="netapi-ipv6-netdev2">
<path id="netapi-ipv6-netdev2-arrow" d="m 97.5,215 0,100" class="outer-stroke-arrow" />
<text id="netapi-ipv6-netdev2-label" class="outer-text-netapi"
<g id="netapi-ipv6-netdev">
<path id="netapi-ipv6-netdev-arrow" d="m 97.5,215 0,100" class="outer-stroke-arrow" />
<text id="netapi-ipv6-netdev-label" class="outer-text-netapi"
x="104" y="272"><tspan>netapi</tspan></text>
</g>
<g id="netapi-ipv6-6lo">
@ -563,12 +563,12 @@
<text id="gnrc-6lo-label" class="modbox-text"
x="282.5" y="272"><tspan>gnrc_sixlowpan</tspan></text>
</g>
<g id="netapi-6lo-netdev2">
<path id="netapi-6lo-netdev2-arrow" d="m 282.5,295 0,20" class="outer-stroke-arrow" />
<text id="netapi-6lo-netdev2-label" class="outer-text-netapi"
<g id="netapi-6lo-netdev">
<path id="netapi-6lo-netdev-arrow" d="m 282.5,295 0,20" class="outer-stroke-arrow" />
<text id="netapi-6lo-netdev-label" class="outer-text-netapi"
x="289" y="311"><tspan>netapi</tspan></text>
</g>
<g id="gnrc-netdev2-ipv6">
<g id="gnrc-netdev-ipv6">
<rect id="gnrc-udp-box" class="modbox" x="10" y="320" rx="4" ry="4"
width="175" height="50" />
<text id="gnrc-udp-label" class="modbox-text"
@ -578,7 +578,7 @@
<rect id="gnrc-6lo-box" class="modbox" x="195" y="320" rx="4" ry="4"
width="175" height="50" />
<text id="gnrc-6lo-label" class="modbox-text"
x="282.5" y="352"><tspan>gnrc_netdev2</tspan></text>
x="282.5" y="352"><tspan>gnrc_netdev</tspan></text>
</g>
</g>
</g>

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 43 KiB

View File

@ -423,9 +423,9 @@
stroke-miterlimit: 4;
stroke-width: 3;
}
#gnrc-detail-netdev2 {
#gnrc-detail-netdev {
fill: none;
stroke: url(#outer-gradient-netdev2);
stroke: url(#outer-gradient-netdev);
stroke-linecap: round;
stroke-linejoin: miter;
stroke-miterlimit: 4;
@ -473,7 +473,7 @@
<stop style="stop-color: #3fa687; stop-opacity: 1;" offset="0.9" />
<stop style="stop-color: #3fa687; stop-opacity: 1;" offset="1" />
</linearGradient>
<linearGradient id="outer-gradient-netdev2" x1="0%" y1="0%" x2="0%" y2="100%">
<linearGradient id="outer-gradient-netdev" x1="0%" y1="0%" x2="0%" y2="100%">
<stop style="stop-color: #3fa687; stop-opacity: 1;" offset="0" />
<stop style="stop-color: #3fa687; stop-opacity: 1;" offset="0.1" />
<stop style="stop-color: #3fa687; stop-opacity: 0;" offset="0.9" />

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

View File

@ -11,11 +11,11 @@ ifneq (,$(filter at86rf2%,$(USEMODULE)))
USEMODULE += luid
USEMODULE += netif
USEMODULE += ieee802154
USEMODULE += netdev2_ieee802154
USEMODULE += netdev_ieee802154
ifneq (,$(filter gnrc_netdev_default,$(USEMODULE)))
# XXX: this can be modelled as a dependency for gnrc_netdev_default as soon
# as all drivers are ported to netdev2
USEMODULE += gnrc_netdev2
# as all drivers are ported to netdev
USEMODULE += gnrc_netdev
endif
endif
@ -24,11 +24,11 @@ ifneq (,$(filter mrf24j40,$(USEMODULE)))
USEMODULE += luid
USEMODULE += netif
USEMODULE += ieee802154
USEMODULE += netdev2_ieee802154
USEMODULE += netdev_ieee802154
ifneq (,$(filter gnrc_netdev_default,$(USEMODULE)))
# XXX: this can be modelled as a dependency for gnrc_netdev_default as soon
# as all drivers are ported to netdev2
USEMODULE += gnrc_netdev2
# as all drivers are ported to netdev
USEMODULE += gnrc_netdev
endif
endif
@ -54,8 +54,8 @@ ifneq (,$(filter cc110x,$(USEMODULE)))
ifneq (,$(filter gnrc_netdev_default,$(USEMODULE)))
USEMODULE += gnrc_cc110x
# XXX: this can be modelled as a dependency for gnrc_netdev_default as soon
# as all drivers are ported to netdev2
USEMODULE += gnrc_netdev2
# as all drivers are ported to netdev
USEMODULE += gnrc_netdev
endif
endif
@ -64,11 +64,11 @@ ifneq (,$(filter cc2420,$(USEMODULE)))
USEMODULE += luid
USEMODULE += netif
USEMODULE += ieee802154
USEMODULE += netdev2_ieee802154
USEMODULE += netdev_ieee802154
ifneq (,$(filter gnrc_netdev_default,$(USEMODULE)))
# XXX: this can be modelled as a dependency for gnrc_netdev_default as soon
# as all drivers are ported to netdev2
USEMODULE += gnrc_netdev2
# as all drivers are ported to netdev
USEMODULE += gnrc_netdev
endif
FEATURES_REQUIRED += periph_gpio
FEATURES_REQUIRED += periph_spi
@ -80,18 +80,18 @@ ifneq (,$(filter dht,$(USEMODULE)))
endif
ifneq (,$(filter enc28j60,$(USEMODULE)))
USEMODULE += netdev2_eth
USEMODULE += netdev_eth
USEMODULE += xtimer
USEMODULE += luid
endif
ifneq (,$(filter encx24j600,$(USEMODULE)))
USEMODULE += netdev2_eth
USEMODULE += netdev_eth
USEMODULE += xtimer
endif
ifneq (,$(filter ethos,$(USEMODULE)))
USEMODULE += netdev2_eth
USEMODULE += netdev_eth
USEMODULE += random
USEMODULE += tsrb
endif
@ -117,11 +117,11 @@ ifneq (,$(filter kw2xrf,$(USEMODULE)))
USEMODULE += luid
USEMODULE += netif
USEMODULE += ieee802154
USEMODULE += netdev2_ieee802154
USEMODULE += netdev_ieee802154
ifneq (,$(filter gnrc_netdev_default,$(USEMODULE)))
# XXX: this can be modelled as a dependency for gnrc_netdev_default as soon
# as all drivers are ported to netdev2
USEMODULE += gnrc_netdev2
# as all drivers are ported to netdev
USEMODULE += gnrc_netdev
endif
endif
@ -190,7 +190,7 @@ ifneq (,$(filter veml6070,$(USEMODULE)))
endif
ifneq (,$(filter w5100,$(USEMODULE)))
USEMODULE += netdev2_eth
USEMODULE += netdev_eth
USEMODULE += luid
endif

View File

@ -38,7 +38,7 @@
void at86rf2xx_setup(at86rf2xx_t *dev, const at86rf2xx_params_t *params)
{
netdev2_t *netdev = (netdev2_t *)dev;
netdev_t *netdev = (netdev_t *)dev;
netdev->driver = &at86rf2xx_driver;
/* initialize device descriptor */
@ -161,7 +161,7 @@ size_t at86rf2xx_tx_load(at86rf2xx_t *dev, uint8_t *data,
void at86rf2xx_tx_exec(at86rf2xx_t *dev)
{
netdev2_t *netdev = (netdev2_t *)dev;
netdev_t *netdev = (netdev_t *)dev;
/* write frame length field in FIFO */
at86rf2xx_sram_write(dev, 0, &(dev->tx_frame_len), 1);
@ -170,6 +170,6 @@ void at86rf2xx_tx_exec(at86rf2xx_t *dev)
AT86RF2XX_TRX_STATE__TX_START);
if (netdev->event_callback &&
(dev->netdev.flags & AT86RF2XX_OPT_TELL_TX_START)) {
netdev->event_callback(netdev, NETDEV2_EVENT_TX_STARTED);
netdev->event_callback(netdev, NETDEV_EVENT_TX_STARTED);
}
}

View File

@ -27,8 +27,8 @@
#include "net/eui64.h"
#include "net/ieee802154.h"
#include "net/netdev2.h"
#include "net/netdev2/ieee802154.h"
#include "net/netdev.h"
#include "net/netdev/ieee802154.h"
#include "at86rf2xx.h"
#include "at86rf2xx_netdev.h"
@ -40,14 +40,14 @@
#define _MAX_MHR_OVERHEAD (25)
static int _send(netdev2_t *netdev, const struct iovec *vector, unsigned count);
static int _recv(netdev2_t *netdev, void *buf, size_t len, void *info);
static int _init(netdev2_t *netdev);
static void _isr(netdev2_t *netdev);
static int _get(netdev2_t *netdev, netopt_t opt, void *val, size_t max_len);
static int _set(netdev2_t *netdev, netopt_t opt, void *val, size_t len);
static int _send(netdev_t *netdev, const struct iovec *vector, unsigned count);
static int _recv(netdev_t *netdev, void *buf, size_t len, void *info);
static int _init(netdev_t *netdev);
static void _isr(netdev_t *netdev);
static int _get(netdev_t *netdev, netopt_t opt, void *val, size_t max_len);
static int _set(netdev_t *netdev, netopt_t opt, void *val, size_t len);
const netdev2_driver_t at86rf2xx_driver = {
const netdev_driver_t at86rf2xx_driver = {
.send = _send,
.recv = _recv,
.init = _init,
@ -58,14 +58,14 @@ const netdev2_driver_t at86rf2xx_driver = {
static void _irq_handler(void *arg)
{
netdev2_t *dev = (netdev2_t *) arg;
netdev_t *dev = (netdev_t *) arg;
if (dev->event_callback) {
dev->event_callback(dev, NETDEV2_EVENT_ISR);
dev->event_callback(dev, NETDEV_EVENT_ISR);
}
}
static int _init(netdev2_t *netdev)
static int _init(netdev_t *netdev)
{
at86rf2xx_t *dev = (at86rf2xx_t *)netdev;
@ -96,7 +96,7 @@ static int _init(netdev2_t *netdev)
return 0;
}
static int _send(netdev2_t *netdev, const struct iovec *vector, unsigned count)
static int _send(netdev_t *netdev, const struct iovec *vector, unsigned count)
{
at86rf2xx_t *dev = (at86rf2xx_t *)netdev;
const struct iovec *ptr = vector;
@ -126,7 +126,7 @@ static int _send(netdev2_t *netdev, const struct iovec *vector, unsigned count)
return (int)len;
}
static int _recv(netdev2_t *netdev, void *buf, size_t len, void *info)
static int _recv(netdev_t *netdev, void *buf, size_t len, void *info)
{
at86rf2xx_t *dev = (at86rf2xx_t *)netdev;
uint8_t phr;
@ -166,7 +166,7 @@ static int _recv(netdev2_t *netdev, void *buf, size_t len, void *info)
(void)tmp;
if (info != NULL) {
netdev2_ieee802154_rx_info_t *radio_info = info;
netdev_ieee802154_rx_info_t *radio_info = info;
at86rf2xx_fb_read(dev, &(radio_info->lqi), 1);
#ifndef MODULE_AT86RF231
at86rf2xx_fb_read(dev, &(radio_info->rssi), 1);
@ -222,7 +222,7 @@ netopt_state_t _get_state(at86rf2xx_t *dev)
}
}
static int _get(netdev2_t *netdev, netopt_t opt, void *val, size_t max_len)
static int _get(netdev_t *netdev, netopt_t opt, void *val, size_t max_len)
{
at86rf2xx_t *dev = (at86rf2xx_t *) netdev;
@ -298,7 +298,7 @@ static int _get(netdev2_t *netdev, netopt_t opt, void *val, size_t max_len)
int res;
if (((res = netdev2_ieee802154_get((netdev2_ieee802154_t *)netdev, opt, val,
if (((res = netdev_ieee802154_get((netdev_ieee802154_t *)netdev, opt, val,
max_len)) >= 0) || (res != -ENOTSUP)) {
return res;
}
@ -349,7 +349,7 @@ static int _get(netdev2_t *netdev, netopt_t opt, void *val, size_t max_len)
return res;
}
static int _set(netdev2_t *netdev, netopt_t opt, void *val, size_t len)
static int _set(netdev_t *netdev, netopt_t opt, void *val, size_t len)
{
at86rf2xx_t *dev = (at86rf2xx_t *) netdev;
uint8_t old_state = at86rf2xx_get_status(dev);
@ -368,17 +368,17 @@ static int _set(netdev2_t *netdev, netopt_t opt, void *val, size_t len)
case NETOPT_ADDRESS:
assert(len <= sizeof(uint16_t));
at86rf2xx_set_addr_short(dev, *((uint16_t *)val));
/* don't set res to set netdev2_ieee802154_t::short_addr */
/* don't set res to set netdev_ieee802154_t::short_addr */
break;
case NETOPT_ADDRESS_LONG:
assert(len <= sizeof(uint64_t));
at86rf2xx_set_addr_long(dev, *((uint64_t *)val));
/* don't set res to set netdev2_ieee802154_t::long_addr */
/* don't set res to set netdev_ieee802154_t::long_addr */
break;
case NETOPT_NID:
assert(len <= sizeof(uint16_t));
at86rf2xx_set_pan(dev, *((uint16_t *)val));
/* don't set res to set netdev2_ieee802154_t::pan */
/* don't set res to set netdev_ieee802154_t::pan */
break;
case NETOPT_CHANNEL:
assert(len != sizeof(uint8_t));
@ -389,7 +389,7 @@ static int _set(netdev2_t *netdev, netopt_t opt, void *val, size_t len)
break;
}
at86rf2xx_set_chan(dev, chan);
/* don't set res to set netdev2_ieee802154_t::chan */
/* don't set res to set netdev_ieee802154_t::chan */
break;
case NETOPT_CHANNEL_PAGE:
@ -428,7 +428,7 @@ static int _set(netdev2_t *netdev, netopt_t opt, void *val, size_t len)
case NETOPT_AUTOACK:
at86rf2xx_set_option(dev, AT86RF2XX_OPT_AUTOACK,
((bool *)val)[0]);
/* don't set res to set netdev2_ieee802154_t::flags */
/* don't set res to set netdev_ieee802154_t::flags */
break;
case NETOPT_RETRANS:
@ -509,14 +509,14 @@ static int _set(netdev2_t *netdev, netopt_t opt, void *val, size_t len)
}
if (res == -ENOTSUP) {
res = netdev2_ieee802154_set((netdev2_ieee802154_t *)netdev, opt,
res = netdev_ieee802154_set((netdev_ieee802154_t *)netdev, opt,
val, len);
}
return res;
}
static void _isr(netdev2_t *netdev)
static void _isr(netdev_t *netdev)
{
at86rf2xx_t *dev = (at86rf2xx_t *) netdev;
uint8_t irq_mask;
@ -538,7 +538,7 @@ static void _isr(netdev2_t *netdev)
AT86RF2XX_TRX_STATE_MASK__TRAC;
if (irq_mask & AT86RF2XX_IRQ_STATUS_MASK__RX_START) {
netdev->event_callback(netdev, NETDEV2_EVENT_RX_STARTED);
netdev->event_callback(netdev, NETDEV_EVENT_RX_STARTED);
DEBUG("[at86rf2xx] EVT - RX_START\n");
}
@ -549,7 +549,7 @@ static void _isr(netdev2_t *netdev)
if (!(dev->netdev.flags & AT86RF2XX_OPT_TELL_RX_END)) {
return;
}
netdev->event_callback(netdev, NETDEV2_EVENT_RX_COMPLETE);
netdev->event_callback(netdev, NETDEV_EVENT_RX_COMPLETE);
}
else if (state == AT86RF2XX_STATE_TX_ARET_ON ||
state == AT86RF2XX_STATE_BUSY_TX_ARET) {
@ -567,15 +567,15 @@ static void _isr(netdev2_t *netdev)
switch (trac_status) {
case AT86RF2XX_TRX_STATE__TRAC_SUCCESS:
case AT86RF2XX_TRX_STATE__TRAC_SUCCESS_DATA_PENDING:
netdev->event_callback(netdev, NETDEV2_EVENT_TX_COMPLETE);
netdev->event_callback(netdev, NETDEV_EVENT_TX_COMPLETE);
DEBUG("[at86rf2xx] TX SUCCESS\n");
break;
case AT86RF2XX_TRX_STATE__TRAC_NO_ACK:
netdev->event_callback(netdev, NETDEV2_EVENT_TX_NOACK);
netdev->event_callback(netdev, NETDEV_EVENT_TX_NOACK);
DEBUG("[at86rf2xx] TX NO_ACK\n");
break;
case AT86RF2XX_TRX_STATE__TRAC_CHANNEL_ACCESS_FAILURE:
netdev->event_callback(netdev, NETDEV2_EVENT_TX_MEDIUM_BUSY);
netdev->event_callback(netdev, NETDEV_EVENT_TX_MEDIUM_BUSY);
DEBUG("[at86rf2xx] TX_CHANNEL_ACCESS_FAILURE\n");
break;
default:

View File

@ -19,7 +19,7 @@
#ifndef AT86RF2XX_NETDEV_H
#define AT86RF2XX_NETDEV_H
#include "net/netdev2.h"
#include "net/netdev.h"
#ifdef __cplusplus
extern "C" {
@ -28,7 +28,7 @@ extern "C" {
/**
* @brief Reference to the netdev device driver struct
*/
extern const netdev2_driver_t at86rf2xx_driver;
extern const netdev_driver_t at86rf2xx_driver;
#ifdef __cplusplus
}

View File

@ -11,7 +11,7 @@
* @ingroup drivers_cc110x
* @{
* @file
* @brief Implementation of netdev2 interface for cc110x
* @brief Implementation of netdev interface for cc110x
*
* @author Fabian Nack <nack@inf.fu-berlin.de>
* @author Kaspar Schleiser <kaspar@schleiser.de>
@ -24,33 +24,33 @@
#include <errno.h>
#include "cc110x.h"
#include "cc110x-netdev2.h"
#include "cc110x-netdev.h"
#include "cc110x-internal.h"
#include "cc110x-interface.h"
#include "net/eui64.h"
#include "periph/gpio.h"
#include "net/netdev2.h"
#include "net/netdev.h"
#include "net/gnrc/nettype.h"
#define ENABLE_DEBUG (0)
#include "debug.h"
static int _send(netdev2_t *dev, const struct iovec *vector, unsigned count)
static int _send(netdev_t *dev, const struct iovec *vector, unsigned count)
{
DEBUG("%s:%u\n", __func__, __LINE__);
netdev2_cc110x_t *netdev2_cc110x = (netdev2_cc110x_t*) dev;
netdev_cc110x_t *netdev_cc110x = (netdev_cc110x_t*) dev;
cc110x_pkt_t *cc110x_pkt = vector[0].iov_base;
return cc110x_send(&netdev2_cc110x->cc110x, cc110x_pkt);
return cc110x_send(&netdev_cc110x->cc110x, cc110x_pkt);
}
static int _recv(netdev2_t *dev, void *buf, size_t len, void *info)
static int _recv(netdev_t *dev, void *buf, size_t len, void *info)
{
DEBUG("%s:%u\n", __func__, __LINE__);
cc110x_t *cc110x = &((netdev2_cc110x_t*) dev)->cc110x;
cc110x_t *cc110x = &((netdev_cc110x_t*) dev)->cc110x;
cc110x_pkt_t *cc110x_pkt = &cc110x->pkt_buf.packet;
if (cc110x_pkt->length > len) {
@ -59,7 +59,7 @@ static int _recv(netdev2_t *dev, void *buf, size_t len, void *info)
memcpy(buf, (void*)cc110x_pkt, cc110x_pkt->length);
if (info != NULL) {
netdev2_cc110x_rx_info_t *cc110x_info = info;
netdev_cc110x_rx_info_t *cc110x_info = info;
cc110x_info->rssi = cc110x->pkt_buf.rssi;
cc110x_info->lqi = cc110x->pkt_buf.lqi;
@ -67,9 +67,9 @@ static int _recv(netdev2_t *dev, void *buf, size_t len, void *info)
return cc110x_pkt->length;
}
static inline int _get_iid(netdev2_t *netdev, eui64_t *value, size_t max_len)
static inline int _get_iid(netdev_t *netdev, eui64_t *value, size_t max_len)
{
cc110x_t *cc110x = &((netdev2_cc110x_t*) netdev)->cc110x;
cc110x_t *cc110x = &((netdev_cc110x_t*) netdev)->cc110x;
uint8_t *eui64 = (uint8_t*) value;
if (max_len < sizeof(eui64_t)) {
@ -85,14 +85,14 @@ static inline int _get_iid(netdev2_t *netdev, eui64_t *value, size_t max_len)
return sizeof(eui64_t);
}
static int _get(netdev2_t *dev, netopt_t opt, void *value, size_t value_len)
static int _get(netdev_t *dev, netopt_t opt, void *value, size_t value_len)
{
cc110x_t *cc110x = &((netdev2_cc110x_t*) dev)->cc110x;
cc110x_t *cc110x = &((netdev_cc110x_t*) dev)->cc110x;
switch (opt) {
case NETOPT_DEVICE_TYPE:
assert(value_len == 2);
*((uint16_t *) value) = NETDEV2_TYPE_CC110X;
*((uint16_t *) value) = NETDEV_TYPE_CC110X;
return 2;
#ifdef MODULE_GNRC_NETIF
case NETOPT_PROTO:
@ -121,9 +121,9 @@ static int _get(netdev2_t *dev, netopt_t opt, void *value, size_t value_len)
return -ENOTSUP;
}
static int _set(netdev2_t *dev, netopt_t opt, void *value, size_t value_len)
static int _set(netdev_t *dev, netopt_t opt, void *value, size_t value_len)
{
cc110x_t *cc110x = &((netdev2_cc110x_t*) dev)->cc110x;
cc110x_t *cc110x = &((netdev_cc110x_t*) dev)->cc110x;
switch (opt) {
case NETOPT_CHANNEL:
@ -164,34 +164,34 @@ static int _set(netdev2_t *dev, netopt_t opt, void *value, size_t value_len)
return 0;
}
static void _netdev2_cc110x_isr(void *arg)
static void _netdev_cc110x_isr(void *arg)
{
netdev2_t *netdev2 = (netdev2_t*) arg;
netdev2->event_callback(netdev2, NETDEV2_EVENT_ISR);
netdev_t *netdev = (netdev_t*) arg;
netdev->event_callback(netdev, NETDEV_EVENT_ISR);
}
static void _netdev2_cc110x_rx_callback(void *arg)
static void _netdev_cc110x_rx_callback(void *arg)
{
netdev2_t *netdev2 = (netdev2_t*) arg;
cc110x_t *cc110x = &((netdev2_cc110x_t*) arg)->cc110x;
netdev_t *netdev = (netdev_t*) arg;
cc110x_t *cc110x = &((netdev_cc110x_t*) arg)->cc110x;
gpio_irq_disable(cc110x->params.gdo2);
netdev2->event_callback(netdev2, NETDEV2_EVENT_RX_COMPLETE);
netdev->event_callback(netdev, NETDEV_EVENT_RX_COMPLETE);
}
static void _isr(netdev2_t *dev)
static void _isr(netdev_t *dev)
{
cc110x_t *cc110x = &((netdev2_cc110x_t*) dev)->cc110x;
cc110x_isr_handler(cc110x, _netdev2_cc110x_rx_callback, (void*)dev);
cc110x_t *cc110x = &((netdev_cc110x_t*) dev)->cc110x;
cc110x_isr_handler(cc110x, _netdev_cc110x_rx_callback, (void*)dev);
}
static int _init(netdev2_t *dev)
static int _init(netdev_t *dev)
{
DEBUG("%s:%u\n", __func__, __LINE__);
cc110x_t *cc110x = &((netdev2_cc110x_t*) dev)->cc110x;
cc110x_t *cc110x = &((netdev_cc110x_t*) dev)->cc110x;
gpio_init_int(cc110x->params.gdo2, GPIO_IN, GPIO_BOTH,
&_netdev2_cc110x_isr, (void*)dev);
&_netdev_cc110x_isr, (void*)dev);
gpio_set(cc110x->params.gdo2);
gpio_irq_disable(cc110x->params.gdo2);
@ -202,7 +202,7 @@ static int _init(netdev2_t *dev)
return 0;
}
const netdev2_driver_t netdev2_cc110x_driver = {
const netdev_driver_t netdev_cc110x_driver = {
.send=_send,
.recv=_recv,
.init=_init,
@ -211,19 +211,19 @@ const netdev2_driver_t netdev2_cc110x_driver = {
.isr=_isr
};
int netdev2_cc110x_setup(netdev2_cc110x_t *netdev2_cc110x, const cc110x_params_t *params)
int netdev_cc110x_setup(netdev_cc110x_t *netdev_cc110x, const cc110x_params_t *params)
{
DEBUG("netdev2_cc110x_setup()\n");
netdev2_cc110x->netdev.driver = &netdev2_cc110x_driver;
DEBUG("netdev_cc110x_setup()\n");
netdev_cc110x->netdev.driver = &netdev_cc110x_driver;
/* set default protocol */
#ifdef MODULE_GNRC_NETIF
# ifdef MODULE_GNRC_SIXLOWPAN
netdev2_cc110x->cc110x.proto = GNRC_NETTYPE_SIXLOWPAN;
netdev_cc110x->cc110x.proto = GNRC_NETTYPE_SIXLOWPAN;
# else
netdev2_cc110x->cc110x.proto = GNRC_NETTYPE_UNDEF;
netdev_cc110x->cc110x.proto = GNRC_NETTYPE_UNDEF;
# endif
#endif
return cc110x_setup(&netdev2_cc110x->cc110x, params);
return cc110x_setup(&netdev_cc110x->cc110x, params);
}

View File

@ -10,25 +10,25 @@
#include <sys/uio.h>
#include "net/netdev2.h"
#include "net/netdev.h"
#include "net/gnrc.h"
#include "cc110x.h"
#include "cc110x-netdev2.h"
#include "net/gnrc/netdev2.h"
#include "cc110x-netdev.h"
#include "net/gnrc/netdev.h"
#include "od.h"
#define ENABLE_DEBUG (0)
#include "debug.h"
static int _send(gnrc_netdev2_t *gnrc_netdev2, gnrc_pktsnip_t *pkt)
static int _send(gnrc_netdev_t *gnrc_netdev, gnrc_pktsnip_t *pkt)
{
cc110x_pkt_t cc110x_pkt;
netdev2_t *dev = gnrc_netdev2->dev;
netdev2_cc110x_t *netdev_cc110x = (netdev2_cc110x_t *) dev;
netdev_t *dev = gnrc_netdev->dev;
netdev_cc110x_t *netdev_cc110x = (netdev_cc110x_t *) dev;
cc110x_t *cc110x = &netdev_cc110x->cc110x;
assert(pkt != NULL);
assert(dev->driver == &netdev2_cc110x_driver);
assert(dev->driver == &netdev_cc110x_driver);
gnrc_netif_hdr_t *netif_hdr;
gnrc_pktsnip_t *payload;
@ -36,7 +36,7 @@ static int _send(gnrc_netdev2_t *gnrc_netdev2, gnrc_pktsnip_t *pkt)
payload = pkt->next;
if (pkt->type != GNRC_NETTYPE_NETIF) {
DEBUG("gnrc_netdev2_cc110x: First header was not generic netif header\n");
DEBUG("gnrc_netdev_cc110x: First header was not generic netif header\n");
gnrc_pktbuf_release(pkt);
return -EBADMSG;
}
@ -82,7 +82,7 @@ static int _send(gnrc_netdev2_t *gnrc_netdev2, gnrc_pktsnip_t *pkt)
payload_len += payload->size;
if (payload_len > CC110X_MAX_DATA_LENGTH) {
DEBUG("gnrc_netdev2_cc110x: payload length exceeds maximum"
DEBUG("gnrc_netdev_cc110x: payload length exceeds maximum"
"(%u>%u)\n", payload_len, CC110X_MAX_DATA_LENGTH);
gnrc_pktbuf_release(pkt);
return -EBADMSG;
@ -98,7 +98,7 @@ static int _send(gnrc_netdev2_t *gnrc_netdev2, gnrc_pktsnip_t *pkt)
cc110x_pkt.length = (uint8_t) payload_len + CC110X_HEADER_LENGTH;
DEBUG("gnrc_netdev2_cc110x: sending packet from %u to %u with payload "
DEBUG("gnrc_netdev_cc110x: sending packet from %u to %u with payload "
"length %u\n",
(unsigned)cc110x_pkt.phy_src,
(unsigned)cc110x_pkt.address,
@ -107,10 +107,10 @@ static int _send(gnrc_netdev2_t *gnrc_netdev2, gnrc_pktsnip_t *pkt)
return dev->driver->send(dev, &vector, 1);
}
static gnrc_pktsnip_t *_recv(gnrc_netdev2_t *gnrc_netdev2)
static gnrc_pktsnip_t *_recv(gnrc_netdev_t *gnrc_netdev)
{
netdev2_t *dev = gnrc_netdev2->dev;
cc110x_t *cc110x = &((netdev2_cc110x_t*) dev)->cc110x;
netdev_t *dev = gnrc_netdev->dev;
cc110x_t *cc110x = &((netdev_cc110x_t*) dev)->cc110x;
cc110x_pkt_t *cc110x_pkt = &cc110x->pkt_buf.packet;
@ -147,7 +147,7 @@ static gnrc_pktsnip_t *_recv(gnrc_netdev2_t *gnrc_netdev2)
GNRC_NETTYPE_NETIF);
if (netif_hdr == NULL) {
DEBUG("gnrc_netdev2_cc110x: no space left in packet buffer\n");
DEBUG("gnrc_netdev_cc110x: no space left in packet buffer\n");
gnrc_pktbuf_release(pkt);
return NULL;
}
@ -168,7 +168,7 @@ static gnrc_pktsnip_t *_recv(gnrc_netdev2_t *gnrc_netdev2)
((gnrc_netif_hdr_t *)netif_hdr->data)->lqi = cc110x->pkt_buf.lqi;
((gnrc_netif_hdr_t *)netif_hdr->data)->rssi = cc110x->pkt_buf.rssi;
DEBUG("gnrc_netdev2_cc110x: received packet from %02x"
DEBUG("gnrc_netdev_cc110x: received packet from %02x"
" of length %u\n",
(unsigned)cc110x_pkt->phy_src,
(unsigned)cc110x_pkt->length-CC110X_HEADER_LENGTH);
@ -182,11 +182,11 @@ static gnrc_pktsnip_t *_recv(gnrc_netdev2_t *gnrc_netdev2)
return pkt;
}
int gnrc_netdev2_cc110x_init(gnrc_netdev2_t *gnrc_netdev2, netdev2_t *dev)
int gnrc_netdev_cc110x_init(gnrc_netdev_t *gnrc_netdev, netdev_t *dev)
{
gnrc_netdev2->send = _send;
gnrc_netdev2->recv = _recv;
gnrc_netdev2->dev = dev;
gnrc_netdev->send = _send;
gnrc_netdev->recv = _recv;
gnrc_netdev->dev = dev;
return 0;
}

View File

@ -12,7 +12,7 @@
* @{
*
* @file
* @brief Variables for the cc110x netdev2 interface
* @brief Variables for the cc110x netdev interface
*
* @author Fabian Nack <nack@inf.fu-berlin.de>
* @author Kaspar Schleiser <kaspar@schleiser.de>
@ -23,7 +23,7 @@
#include "periph/gpio.h"
#include "periph/spi.h"
#include "net/netdev2.h"
#include "net/netdev.h"
#include "cc110x.h"
#ifdef __cplusplus
@ -31,33 +31,33 @@ extern "C" {
#endif
/**
* @brief Implementation of netdev2_driver_t for CC110X device
* @brief Implementation of netdev_driver_t for CC110X device
*/
extern const netdev2_driver_t netdev2_cc110x_driver;
extern const netdev_driver_t netdev_cc110x_driver;
/**
* @brief cc110x netdev2 struct
* @brief cc110x netdev struct
*/
typedef struct netdev2_cc110x {
netdev2_t netdev; /**< writing obious */
typedef struct netdev_cc110x {
netdev_t netdev; /**< writing obious */
cc110x_t cc110x; /**< documentation here */
} netdev2_cc110x_t;
} netdev_cc110x_t;
/**
* @brief Received packet status information for cc110x radios
*/
typedef struct netdev2_radio_rx_info netdev2_cc110x_rx_info_t;
typedef struct netdev_radio_rx_info netdev_cc110x_rx_info_t;
/**
* @brief netdev2 <-> cc110x glue code initialization function
* @brief netdev <-> cc110x glue code initialization function
*
* @param[out] netdev2_cc110x ptr to netdev2_cc110x struct ti initialize
* @param[out] netdev_cc110x ptr to netdev_cc110x struct ti initialize
* @param[in] params cc110x IO parameter struct to use
*
* @return 0 on success
* @return -1 on error
*/
int netdev2_cc110x_setup(netdev2_cc110x_t *netdev2_cc110x, const cc110x_params_t *params);
int netdev_cc110x_setup(netdev_cc110x_t *netdev_cc110x, const cc110x_params_t *params);
#ifdef __cplusplus
}

View File

@ -16,8 +16,8 @@
* @author Kaspar Schleiser <kaspar@schleiser.de>
*/
#include "net/gnrc/netdev2.h"
#include "cc110x-netdev2.h"
#include "net/gnrc/netdev.h"
#include "cc110x-netdev.h"
#ifndef GNRC_CC110X_H
#define GNRC_CC110X_H
@ -29,13 +29,13 @@ extern "C" {
/**
* @brief initialize cc110x gnrc glue code
*
* @param[in] gnrc_netdev2 gnrc_netdev2 state structure to initialize
* @param[in] gnrc_netdev gnrc_netdev state structure to initialize
* @param[in] dev cc110x device structure to setup
*
* @return 1 on sucess
* @return <=0 on error
*/
int gnrc_netdev2_cc110x_init(gnrc_netdev2_t *gnrc_netdev2, netdev2_cc110x_t *dev);
int gnrc_netdev_cc110x_init(gnrc_netdev_t *gnrc_netdev, netdev_cc110x_t *dev);
#ifdef __cplusplus
}

View File

@ -160,7 +160,7 @@ void cc2420_tx_exec(cc2420_t *dev)
/* trigger the transmission */
if (dev->options & CC2420_OPT_TELL_TX_START) {
dev->netdev.netdev.event_callback(&dev->netdev.netdev,
NETDEV2_EVENT_TX_STARTED);
NETDEV_EVENT_TX_STARTED);
}
DEBUG("cc2420: tx_exec: TX_START\n");
if (dev->options & CC2420_OPT_CSMA) {

View File

@ -26,8 +26,8 @@
#include "net/eui64.h"
#include "net/ieee802154.h"
#include "net/netdev2.h"
#include "net/netdev2/ieee802154.h"
#include "net/netdev.h"
#include "net/netdev/ieee802154.h"
#include "xtimer.h"
#include "cc2420.h"
@ -39,14 +39,14 @@
#include "debug.h"
static int _send(netdev2_t *netdev, const struct iovec *vector, unsigned count);
static int _recv(netdev2_t *netdev, void *buf, size_t len, void *info);
static int _init(netdev2_t *netdev);
static void _isr(netdev2_t *netdev);
static int _get(netdev2_t *netdev, netopt_t opt, void *val, size_t max_len);
static int _set(netdev2_t *netdev, netopt_t opt, void *val, size_t len);
static int _send(netdev_t *netdev, const struct iovec *vector, unsigned count);
static int _recv(netdev_t *netdev, void *buf, size_t len, void *info);
static int _init(netdev_t *netdev);
static void _isr(netdev_t *netdev);
static int _get(netdev_t *netdev, netopt_t opt, void *val, size_t max_len);
static int _set(netdev_t *netdev, netopt_t opt, void *val, size_t len);
const netdev2_driver_t cc2420_driver = {
const netdev_driver_t cc2420_driver = {
.send = _send,
.recv = _recv,
.init = _init,
@ -57,10 +57,10 @@ const netdev2_driver_t cc2420_driver = {
static void _irq_handler(void *arg)
{
netdev2_t *dev = (netdev2_t *)arg;
netdev_t *dev = (netdev_t *)arg;
if(dev->event_callback) {
dev->event_callback(dev, NETDEV2_EVENT_ISR);
dev->event_callback(dev, NETDEV_EVENT_ISR);
}
}
@ -97,7 +97,7 @@ static inline int opt_state(void *buf, bool cond)
return sizeof(netopt_enable_t);
}
static int _init(netdev2_t *netdev)
static int _init(netdev_t *netdev)
{
cc2420_t *dev = (cc2420_t *)netdev;
@ -145,24 +145,24 @@ static int _init(netdev2_t *netdev)
return cc2420_init((cc2420_t *)dev);
}
static void _isr(netdev2_t *netdev)
static void _isr(netdev_t *netdev)
{
netdev->event_callback(netdev, NETDEV2_EVENT_RX_COMPLETE);
netdev->event_callback(netdev, NETDEV_EVENT_RX_COMPLETE);
}
static int _send(netdev2_t *netdev, const struct iovec *vector, unsigned count)
static int _send(netdev_t *netdev, const struct iovec *vector, unsigned count)
{
cc2420_t *dev = (cc2420_t *)netdev;
return (int)cc2420_send(dev, vector, count);
}
static int _recv(netdev2_t *netdev, void *buf, size_t len, void *info)
static int _recv(netdev_t *netdev, void *buf, size_t len, void *info)
{
cc2420_t *dev = (cc2420_t *)netdev;
return (int)cc2420_rx(dev, buf, len, info);
}
static int _get(netdev2_t *netdev, netopt_t opt, void *val, size_t max_len)
static int _get(netdev_t *netdev, netopt_t opt, void *val, size_t max_len)
{
if (netdev == NULL) {
return -ENODEV;
@ -170,7 +170,7 @@ static int _get(netdev2_t *netdev, netopt_t opt, void *val, size_t max_len)
cc2420_t *dev = (cc2420_t *)netdev;
int ext = netdev2_ieee802154_get(&dev->netdev, opt, val, max_len);
int ext = netdev_ieee802154_get(&dev->netdev, opt, val, max_len);
if (ext > 0) {
return ext;
}
@ -236,7 +236,7 @@ static int _get(netdev2_t *netdev, netopt_t opt, void *val, size_t max_len)
}
}
static int _set(netdev2_t *netdev, netopt_t opt, void *val, size_t val_len)
static int _set(netdev_t *netdev, netopt_t opt, void *val, size_t val_len)
{
if (netdev == NULL) {
return -ENODEV;
@ -244,7 +244,7 @@ static int _set(netdev2_t *netdev, netopt_t opt, void *val, size_t val_len)
cc2420_t *dev = (cc2420_t *)netdev;
int ext = netdev2_ieee802154_set(&dev->netdev, opt, val, val_len);
int ext = netdev_ieee802154_set(&dev->netdev, opt, val, val_len);
switch (opt) {
case NETOPT_ADDRESS:

View File

@ -22,7 +22,7 @@
#ifndef CC2420_NETDEV_H
#define CC2420_NETDEV_H
#include "net/netdev2.h"
#include "net/netdev.h"
#ifdef __cplusplus
extern "C" {
@ -31,7 +31,7 @@ extern "C" {
/**
* @brief Reference to the netdev device driver struct
*/
extern const netdev2_driver_t cc2420_driver;
extern const netdev_driver_t cc2420_driver;
#ifdef __cplusplus
}

View File

@ -26,7 +26,7 @@
#include "xtimer.h"
#include "assert.h"
#include "net/ethernet.h"
#include "net/netdev2/eth.h"
#include "net/netdev/eth.h"
#include "enc28j60.h"
#include "enc28j60_regs.h"
@ -236,11 +236,11 @@ static void mac_set(enc28j60_t *dev, uint8_t *mac)
static void on_int(void *arg)
{
netdev2_t *netdev = (netdev2_t *)arg;
netdev->event_callback(arg, NETDEV2_EVENT_ISR);
netdev_t *netdev = (netdev_t *)arg;
netdev->event_callback(arg, NETDEV_EVENT_ISR);
}
static int nd_send(netdev2_t *netdev, const struct iovec *data, unsigned count)
static int nd_send(netdev_t *netdev, const struct iovec *data, unsigned count)
{
enc28j60_t *dev = (enc28j60_t *)netdev;
uint8_t ctrl = 0;
@ -269,7 +269,7 @@ static int nd_send(netdev2_t *netdev, const struct iovec *data, unsigned count)
return c;
}
static int nd_recv(netdev2_t *netdev, void *buf, size_t max_len, void *info)
static int nd_recv(netdev_t *netdev, void *buf, size_t max_len, void *info)
{
enc28j60_t *dev = (enc28j60_t *)netdev;
uint8_t head[6];
@ -308,7 +308,7 @@ static int nd_recv(netdev2_t *netdev, void *buf, size_t max_len, void *info)
return (int)size;
}
static int nd_init(netdev2_t *netdev)
static int nd_init(netdev_t *netdev)
{
enc28j60_t *dev = (enc28j60_t *)netdev;
int res;
@ -402,7 +402,7 @@ static int nd_init(netdev2_t *netdev)
return 0;
}
static void nd_isr(netdev2_t *netdev)
static void nd_isr(netdev_t *netdev)
{
enc28j60_t *dev = (enc28j60_t *)netdev;
uint8_t eir = cmd_rcr(dev, REG_EIR, -1);
@ -414,17 +414,17 @@ static void nd_isr(netdev2_t *netdev)
/* go and tell the new link layer state to upper layers */
if (cmd_r_phy(dev, REG_PHY_PHSTAT2) & PHSTAT2_LSTAT) {
DEBUG("[enc28j60] isr: link up!\n");
netdev->event_callback(netdev, NETDEV2_EVENT_LINK_UP);
netdev->event_callback(netdev, NETDEV_EVENT_LINK_UP);
}
else {
DEBUG("[enc28j60] isr: link down!\n");
netdev->event_callback(netdev, NETDEV2_EVENT_LINK_DOWN);
netdev->event_callback(netdev, NETDEV_EVENT_LINK_DOWN);
}
}
if (eir & EIR_PKTIF) {
do {
DEBUG("[enc28j60] isr: packet received\n");
netdev->event_callback(netdev, NETDEV2_EVENT_RX_COMPLETE);
netdev->event_callback(netdev, NETDEV_EVENT_RX_COMPLETE);
} while (cmd_rcr(dev, REG_B1_EPKTCNT, 1) > 0);
}
if (eir & EIR_RXERIF) {
@ -433,7 +433,7 @@ static void nd_isr(netdev2_t *netdev)
}
if (eir & EIR_TXIF) {
DEBUG("[enc28j60] isr: packet transmitted\n");
netdev->event_callback(netdev, NETDEV2_EVENT_TX_COMPLETE);
netdev->event_callback(netdev, NETDEV_EVENT_TX_COMPLETE);
cmd_bfc(dev, REG_EIR, -1, EIR_TXIF);
}
if (eir & EIR_TXERIF) {
@ -444,7 +444,7 @@ static void nd_isr(netdev2_t *netdev)
}
}
static int nd_get(netdev2_t *netdev, netopt_t opt, void *value, size_t max_len)
static int nd_get(netdev_t *netdev, netopt_t opt, void *value, size_t max_len)
{
enc28j60_t *dev = (enc28j60_t *)netdev;
@ -454,11 +454,11 @@ static int nd_get(netdev2_t *netdev, netopt_t opt, void *value, size_t max_len)
mac_get(dev, (uint8_t *)value);
return ETHERNET_ADDR_LEN;
default:
return netdev2_eth_get(netdev, opt, value, max_len);
return netdev_eth_get(netdev, opt, value, max_len);
}
}
static int nd_set(netdev2_t *netdev, netopt_t opt, void *value, size_t value_len)
static int nd_set(netdev_t *netdev, netopt_t opt, void *value, size_t value_len)
{
enc28j60_t *dev = (enc28j60_t *)netdev;
@ -468,11 +468,11 @@ static int nd_set(netdev2_t *netdev, netopt_t opt, void *value, size_t value_len
mac_set(dev, (uint8_t *)value);
return ETHERNET_ADDR_LEN;
default:
return netdev2_eth_set(netdev, opt, value, value_len);
return netdev_eth_set(netdev, opt, value, value_len);
}
}
const static netdev2_driver_t netdev2_driver_enc28j60 = {
const static netdev_driver_t netdev_driver_enc28j60 = {
.send = nd_send,
.recv = nd_recv,
.init = nd_init,
@ -483,7 +483,7 @@ const static netdev2_driver_t netdev2_driver_enc28j60 = {
void enc28j60_setup(enc28j60_t *dev, const enc28j60_params_t *params)
{
dev->netdev.driver = &netdev2_driver_enc28j60;
dev->netdev.driver = &netdev_driver_enc28j60;
dev->spi = params->spi;
dev->cs_pin = params->cs_pin;
dev->int_pin = params->int_pin;

View File

@ -32,8 +32,8 @@
#include "encx24j600_defines.h"
#include "xtimer.h"
#include "net/netdev2.h"
#include "net/netdev2/eth.h"
#include "net/netdev.h"
#include "net/netdev/eth.h"
#include "net/eui64.h"
#include "net/ethernet.h"
#include "net/netstats.h"
@ -61,22 +61,22 @@ static uint16_t reg_get(encx24j600_t *dev, uint8_t reg);
static void reg_clear_bits(encx24j600_t *dev, uint8_t reg, uint16_t mask);
static inline int _packets_available(encx24j600_t *dev);
static void _get_mac_addr(netdev2_t *dev, uint8_t* buf);
static void _get_mac_addr(netdev_t *dev, uint8_t* buf);
/* netdev2 interface */
static int _send(netdev2_t *netdev, const struct iovec *vector, unsigned count);
static int _recv(netdev2_t *netdev, void *buf, size_t len, void *info);
static int _init(netdev2_t *dev);
static void _isr(netdev2_t *dev);
static int _get(netdev2_t *dev, netopt_t opt, void *value, size_t max_len);
/* netdev interface */
static int _send(netdev_t *netdev, const struct iovec *vector, unsigned count);
static int _recv(netdev_t *netdev, void *buf, size_t len, void *info);
static int _init(netdev_t *dev);
static void _isr(netdev_t *dev);
static int _get(netdev_t *dev, netopt_t opt, void *value, size_t max_len);
const static netdev2_driver_t netdev2_driver_encx24j600 = {
const static netdev_driver_t netdev_driver_encx24j600 = {
.send = _send,
.recv = _recv,
.init = _init,
.isr = _isr,
.get = _get,
.set = netdev2_eth_set,
.set = netdev_eth_set,
};
static inline void lock(encx24j600_t *dev) {
@ -89,7 +89,7 @@ static inline void unlock(encx24j600_t *dev) {
void encx24j600_setup(encx24j600_t *dev, const encx24j600_params_t *params)
{
dev->netdev.driver = &netdev2_driver_encx24j600;
dev->netdev.driver = &netdev_driver_encx24j600;
dev->spi = params->spi;
dev->cs = params->cs_pin;
dev->int_pin = params->int_pin;
@ -103,11 +103,11 @@ static void encx24j600_isr(void *arg)
/* disable interrupt line */
gpio_irq_disable(dev->int_pin);
/* call netdev2 hook */
dev->netdev.event_callback((netdev2_t*) dev, NETDEV2_EVENT_ISR);
/* call netdev hook */
dev->netdev.event_callback((netdev_t*) dev, NETDEV_EVENT_ISR);
}
static void _isr(netdev2_t *netdev)
static void _isr(netdev_t *netdev)
{
encx24j600_t *dev = (encx24j600_t *) netdev;
@ -122,9 +122,9 @@ static void _isr(netdev2_t *netdev)
if (eir & ENC_LINKIF) {
uint16_t estat = reg_get(dev, ENC_ESTAT);
netdev2_event_t event = (estat & ENC_PHYLNK) ?
NETDEV2_EVENT_LINK_DOWN :
NETDEV2_EVENT_LINK_UP;
netdev_event_t event = (estat & ENC_PHYLNK) ?
NETDEV_EVENT_LINK_DOWN :
NETDEV_EVENT_LINK_UP;
netdev->event_callback(netdev, event);
}
@ -133,7 +133,7 @@ static void _isr(netdev2_t *netdev)
if (eir & ENC_PKTIF) {
while (_packets_available(dev)) {
unlock(dev);
netdev->event_callback(netdev, NETDEV2_EVENT_RX_COMPLETE);
netdev->event_callback(netdev, NETDEV_EVENT_RX_COMPLETE);
lock(dev);
}
}
@ -233,7 +233,7 @@ static void sram_op(encx24j600_t *dev, uint16_t cmd, uint16_t addr, char *ptr, i
cmdn(dev, cmd, in, out, len);
}
static int _init(netdev2_t *encdev)
static int _init(netdev_t *encdev)
{
encx24j600_t *dev = (encx24j600_t *) encdev;
@ -291,7 +291,7 @@ static int _init(netdev2_t *encdev)
return 0;
}
static int _send(netdev2_t *netdev, const struct iovec *vector, unsigned count) {
static int _send(netdev_t *netdev, const struct iovec *vector, unsigned count) {
encx24j600_t * dev = (encx24j600_t *) netdev;
lock(dev);
@ -332,7 +332,7 @@ static inline int _packets_available(encx24j600_t *dev)
return reg_get(dev, ENC_ESTAT) & ~0xFF00;
}
static void _get_mac_addr(netdev2_t *encdev, uint8_t* buf)
static void _get_mac_addr(netdev_t *encdev, uint8_t* buf)
{
encx24j600_t * dev = (encx24j600_t *) encdev;
uint16_t *addr = (uint16_t *) buf;
@ -346,7 +346,7 @@ static void _get_mac_addr(netdev2_t *encdev, uint8_t* buf)
unlock(dev);
}
static int _recv(netdev2_t *netdev, void *buf, size_t len, void *info)
static int _recv(netdev_t *netdev, void *buf, size_t len, void *info)
{
encx24j600_t * dev = (encx24j600_t *) netdev;
encx24j600_frame_hdr_t hdr;
@ -381,7 +381,7 @@ static int _recv(netdev2_t *netdev, void *buf, size_t len, void *info)
return payload_len;
}
static int _get(netdev2_t *dev, netopt_t opt, void *value, size_t max_len)
static int _get(netdev_t *dev, netopt_t opt, void *value, size_t max_len)
{
int res = 0;
@ -396,7 +396,7 @@ static int _get(netdev2_t *dev, netopt_t opt, void *value, size_t max_len)
}
break;
default:
res = netdev2_eth_get(dev, opt, value, max_len);
res = netdev_eth_get(dev, opt, value, max_len);
break;
}

View File

@ -28,8 +28,8 @@
#include "tsrb.h"
#include "irq.h"
#include "net/netdev2.h"
#include "net/netdev2/eth.h"
#include "net/netdev.h"
#include "net/netdev/eth.h"
#include "net/eui64.h"
#include "net/ethernet.h"
@ -42,9 +42,9 @@ extern isrpipe_t uart_stdio_isrpipe;
#define ENABLE_DEBUG (0)
#include "debug.h"
static void _get_mac_addr(netdev2_t *dev, uint8_t* buf);
static void _get_mac_addr(netdev_t *dev, uint8_t* buf);
static void ethos_isr(void *arg, uint8_t c);
static const netdev2_driver_t netdev2_driver_ethos;
static const netdev_driver_t netdev_driver_ethos;
static const uint8_t _esc_esc[] = {ETHOS_ESC_CHAR, (ETHOS_ESC_CHAR ^ 0x20)};
static const uint8_t _esc_delim[] = {ETHOS_ESC_CHAR, (ETHOS_FRAME_DELIMITER ^ 0x20)};
@ -52,7 +52,7 @@ static const uint8_t _esc_delim[] = {ETHOS_ESC_CHAR, (ETHOS_FRAME_DELIMITER ^ 0x
void ethos_setup(ethos_t *dev, const ethos_params_t *params)
{
dev->netdev.driver = &netdev2_driver_ethos;
dev->netdev.driver = &netdev_driver_ethos;
dev->uart = params->uart;
dev->state = WAIT_FRAMESTART;
dev->framesize = 0;
@ -113,7 +113,7 @@ static void _end_of_frame(ethos_t *dev)
case ETHOS_FRAME_TYPE_DATA:
if (dev->framesize) {
dev->last_framesize = dev->framesize;
dev->netdev.event_callback((netdev2_t*) dev, NETDEV2_EVENT_ISR);
dev->netdev.event_callback((netdev_t*) dev, NETDEV_EVENT_ISR);
}
break;
case ETHOS_FRAME_TYPE_HELLO:
@ -176,13 +176,13 @@ static void ethos_isr(void *arg, uint8_t c)
}
}
static void _isr(netdev2_t *netdev)
static void _isr(netdev_t *netdev)
{
ethos_t *dev = (ethos_t *) netdev;
dev->netdev.event_callback((netdev2_t*) dev, NETDEV2_EVENT_RX_COMPLETE);
dev->netdev.event_callback((netdev_t*) dev, NETDEV_EVENT_RX_COMPLETE);
}
static int _init(netdev2_t *encdev)
static int _init(netdev_t *encdev)
{
ethos_t *dev = (ethos_t *) encdev;
(void)dev;
@ -256,7 +256,7 @@ void ethos_send_frame(ethos_t *dev, const uint8_t *data, size_t len, unsigned fr
}
}
static int _send(netdev2_t *netdev, const struct iovec *vector, unsigned count)
static int _send(netdev_t *netdev, const struct iovec *vector, unsigned count)
{
ethos_t * dev = (ethos_t *) netdev;
(void)dev;
@ -288,13 +288,13 @@ static int _send(netdev2_t *netdev, const struct iovec *vector, unsigned count)
return pktlen;
}
static void _get_mac_addr(netdev2_t *encdev, uint8_t* buf)
static void _get_mac_addr(netdev_t *encdev, uint8_t* buf)
{
ethos_t * dev = (ethos_t *) encdev;
memcpy(buf, dev->mac_addr, 6);
}
static int _recv(netdev2_t *netdev, void *buf, size_t len, void* info)
static int _recv(netdev_t *netdev, void *buf, size_t len, void* info)
{
(void) info;
ethos_t * dev = (ethos_t *) netdev;
@ -320,7 +320,7 @@ static int _recv(netdev2_t *netdev, void *buf, size_t len, void* info)
}
}
static int _get(netdev2_t *dev, netopt_t opt, void *value, size_t max_len)
static int _get(netdev_t *dev, netopt_t opt, void *value, size_t max_len)
{
int res = 0;
@ -335,19 +335,19 @@ static int _get(netdev2_t *dev, netopt_t opt, void *value, size_t max_len)
}
break;
default:
res = netdev2_eth_get(dev, opt, value, max_len);
res = netdev_eth_get(dev, opt, value, max_len);
break;
}
return res;
}
/* netdev2 interface */
static const netdev2_driver_t netdev2_driver_ethos = {
/* netdev interface */
static const netdev_driver_t netdev_driver_ethos = {
.send = _send,
.recv = _recv,
.init = _init,
.isr = _isr,
.get = _get,
.set = netdev2_eth_set
.set = netdev_eth_set
};

View File

@ -35,8 +35,8 @@
#include "board.h"
#include "periph/spi.h"
#include "periph/gpio.h"
#include "net/netdev2.h"
#include "net/netdev2/ieee802154.h"
#include "net/netdev.h"
#include "net/netdev/ieee802154.h"
#include "net/gnrc/nettype.h"
#ifdef __cplusplus
@ -110,13 +110,13 @@ extern "C" {
* @brief Internal device option flags
*
* `0x00ff` is reserved for general IEEE 802.15.4 flags
* (see @ref netdev2_ieee802154_t)
* (see @ref netdev_ieee802154_t)
*
* @{
*/
#define AT86RF2XX_OPT_SRC_ADDR_LONG (NETDEV2_IEEE802154_SRC_MODE_LONG) /**< legacy define */
#define AT86RF2XX_OPT_RAWDUMP (NETDEV2_IEEE802154_RAW) /**< legacy define */
#define AT86RF2XX_OPT_AUTOACK (NETDEV2_IEEE802154_ACK_REQ) /**< legacy define */
#define AT86RF2XX_OPT_SRC_ADDR_LONG (NETDEV_IEEE802154_SRC_MODE_LONG) /**< legacy define */
#define AT86RF2XX_OPT_RAWDUMP (NETDEV_IEEE802154_RAW) /**< legacy define */
#define AT86RF2XX_OPT_AUTOACK (NETDEV_IEEE802154_ACK_REQ) /**< legacy define */
#define AT86RF2XX_OPT_CSMA (0x0100) /**< CSMA active */
#define AT86RF2XX_OPT_PROMISCUOUS (0x0200) /**< promiscuous mode
@ -147,10 +147,10 @@ typedef struct at86rf2xx_params {
/**
* @brief Device descriptor for AT86RF2XX radio devices
*
* @extends netdev2_ieee802154_t
* @extends netdev_ieee802154_t
*/
typedef struct {
netdev2_ieee802154_t netdev; /**< netdev2 parent struct */
netdev_ieee802154_t netdev; /**< netdev parent struct */
/**
* @brief device specific fields
* @{

View File

@ -26,8 +26,8 @@
#include "periph/spi.h"
#include "periph/gpio.h"
#include "net/netdev2.h"
#include "net/netdev2/ieee802154.h"
#include "net/netdev.h"
#include "net/netdev/ieee802154.h"
#ifdef __cplusplus
extern "C" {
@ -91,7 +91,7 @@ typedef struct cc2420_params {
*/
typedef struct {
/* netdev fields */
netdev2_ieee802154_t netdev; /**< netdev2 parent struct */
netdev_ieee802154_t netdev; /**< netdev parent struct */
/* device specific fields */
cc2420_params_t params; /**< hardware interface configuration */
/* device state fields */

View File

@ -26,7 +26,7 @@
#include "mutex.h"
#include "periph/spi.h"
#include "periph/gpio.h"
#include "net/netdev2.h"
#include "net/netdev.h"
#ifdef __cplusplus
extern "C" {
@ -46,7 +46,7 @@ typedef struct {
* @brief ENC28J60 device descriptor
*/
typedef struct {
netdev2_t netdev; /**< pull in the netdev2 fields */
netdev_t netdev; /**< pull in the netdev fields */
spi_t spi; /**< SPI bus the transceiver is connected to */
gpio_t cs_pin; /**< pin connected to the CHIP SELECT line */
gpio_t int_pin; /**< pin connected to the INT line */
@ -56,7 +56,7 @@ typedef struct {
} enc28j60_t;
/**
* @brief Ready the device for initialization through it's netdev2 interface
* @brief Ready the device for initialization through it's netdev interface
*
* @param[in] dev device descriptor
* @param[in] params peripheral configuration to use

View File

@ -25,18 +25,18 @@
#include "kernel_types.h"
#include "periph/spi.h"
#include "periph/gpio.h"
#include "net/netdev2.h"
#include "net/netdev.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief encx24j600 netdev2 device
* @extends netdev2_t
* @brief encx24j600 netdev device
* @extends netdev_t
*/
typedef struct {
netdev2_t netdev; /**< extended netdev2 structure */
netdev_t netdev; /**< extended netdev structure */
spi_t spi; /**< SPI device the enc is connected to*/
gpio_t cs; /**< SPI chip select pin */
gpio_t int_pin; /**< SPI interrupt pin */

View File

@ -23,7 +23,7 @@
#include "kernel_types.h"
#include "periph/uart.h"
#include "net/netdev2.h"
#include "net/netdev.h"
#include "tsrb.h"
#include "mutex.h"
@ -64,11 +64,11 @@ typedef enum {
} line_state_t;
/**
* @brief ethos netdev2 device
* @extends netdev2_t
* @brief ethos netdev device
* @extends netdev_t
*/
typedef struct {
netdev2_t netdev; /**< extended netdev2 structure */
netdev_t netdev; /**< extended netdev structure */
uart_t uart; /**< UART device the to use */
uint8_t mac_addr[6]; /**< this device's MAC address */
uint8_t remote_mac_addr[6]; /**< this device's MAC address */

View File

@ -28,8 +28,8 @@
#include "board.h"
#include "periph/spi.h"
#include "periph/gpio.h"
#include "net/netdev2.h"
#include "net/netdev2/ieee802154.h"
#include "net/netdev.h"
#include "net/netdev/ieee802154.h"
#include "net/gnrc/nettype.h"
#ifdef __cplusplus
@ -84,13 +84,13 @@ extern "C" {
* @brief Internal device option flags
*
* `0x00ff` is reserved for general IEEE 802.15.4 flags
* (see @ref netdev2_ieee802154_t)
* (see @ref netdev_ieee802154_t)
*
* @{
*/
#define KW2XRF_OPT_SRC_ADDR_LONG (NETDEV2_IEEE802154_SRC_MODE_LONG) /**< legacy define */
#define KW2XRF_OPT_RAWDUMP (NETDEV2_IEEE802154_RAW) /**< legacy define */
#define KW2XRF_OPT_ACK_REQ (NETDEV2_IEEE802154_ACK_REQ) /**< legacy define */
#define KW2XRF_OPT_SRC_ADDR_LONG (NETDEV_IEEE802154_SRC_MODE_LONG) /**< legacy define */
#define KW2XRF_OPT_RAWDUMP (NETDEV_IEEE802154_RAW) /**< legacy define */
#define KW2XRF_OPT_ACK_REQ (NETDEV_IEEE802154_ACK_REQ) /**< legacy define */
#define KW2XRF_OPT_AUTOCCA (0x0100) /**< CCA befor TX active */
#define KW2XRF_OPT_PROMISCUOUS (0x0200) /**< promiscuous mode
@ -121,10 +121,10 @@ typedef struct kw2xrf_params {
/**
* @brief Device descriptor for KW2XRF radio devices
*
* @extends netdev2_ieee802154_t
* @extends netdev_ieee802154_t
*/
typedef struct {
netdev2_ieee802154_t netdev; /**< netdev2 parent struct */
netdev_ieee802154_t netdev; /**< netdev parent struct */
/**
* @brief device specific fields
* @{

View File

@ -31,8 +31,8 @@
#include "board.h"
#include "periph/spi.h"
#include "periph/gpio.h"
#include "net/netdev2.h"
#include "net/netdev2/ieee802154.h"
#include "net/netdev.h"
#include "net/netdev/ieee802154.h"
#include "net/gnrc/nettype.h"
#ifdef __cplusplus
@ -93,7 +93,7 @@ extern "C" {
* @brief Internal device option flags
*
* `0x00ff` is reserved for general IEEE 802.15.4 flags
* (see @ref netdev2_ieee802154_t)
* (see @ref netdev_ieee802154_t)
*
* @{
*/
@ -135,7 +135,7 @@ typedef struct mrf24j40_params {
* @brief Device descriptor for MRF24J40 radio devices
*/
typedef struct {
netdev2_ieee802154_t netdev; /**< netdev2 parent struct */
netdev_ieee802154_t netdev; /**< netdev parent struct */
/**
* @brief device specific fields
* @{

View File

@ -10,7 +10,7 @@
*/
/**
* @defgroup drivers_netdev_netdev2 Generic Low-Level Network Driver Interface v2
* @defgroup drivers_netdev_api Network Device Driver API
* @ingroup drivers_netdev
* @brief This is the second version of a generic low-level network
* driver interface
@ -22,16 +22,16 @@
*
* 1. packet arrives for device
* 2. The driver previously registered an ISR for handling received packets.
* This ISR then calls @ref netdev2_t::event_callback "netdev->event_callback()"
* with `event` := @ref NETDEV2_EVENT_ISR (from Interrupt Service Routine)
* This ISR then calls @ref netdev_t::event_callback "netdev->event_callback()"
* with `event` := @ref NETDEV_EVENT_ISR (from Interrupt Service Routine)
* which wakes up event handler
* 3. event handler calls @ref netdev2_driver_t::isr "netdev2->driver->isr()"
* 3. event handler calls @ref netdev_driver_t::isr "netdev->driver->isr()"
* (from thread context)
* 4. @ref netdev2_driver_t::isr "netdev->driver->isr()" calls
* @ref netdev2_t::event_callback "netdev->event_callback()" with
* `event` := @ref NETDEV2_EVENT_RX_COMPLETE
* 5. @ref netdev2_t::event_callback "netdev->event_callback()" uses
* @ref netdev2_driver_t::recv "netdev2->driver->recv()" to fetch packet
* 4. @ref netdev_driver_t::isr "netdev->driver->isr()" calls
* @ref netdev_t::event_callback "netdev->event_callback()" with
* `event` := @ref NETDEV_EVENT_RX_COMPLETE
* 5. @ref netdev_t::event_callback "netdev->event_callback()" uses
* @ref netdev_driver_t::recv "netdev->driver->recv()" to fetch packet
*
* ![RX event example](riot-netdev-rx.svg)
*
@ -43,8 +43,8 @@
* @author Hauke Petersen <hauke.petersen@fu-berlin.de>
*/
#ifndef NETDEV2_H
#define NETDEV2_H
#ifndef NETDEV_H
#define NETDEV_H
#ifdef __cplusplus
extern "C" {
@ -57,12 +57,12 @@ extern "C" {
#include "net/netopt.h"
enum {
NETDEV2_TYPE_UNKNOWN,
NETDEV2_TYPE_RAW,
NETDEV2_TYPE_ETHERNET,
NETDEV2_TYPE_IEEE802154,
NETDEV2_TYPE_CC110X,
NETDEV2_TYPE_NRFMIN
NETDEV_TYPE_UNKNOWN,
NETDEV_TYPE_RAW,
NETDEV_TYPE_ETHERNET,
NETDEV_TYPE_IEEE802154,
NETDEV_TYPE_CC110X,
NETDEV_TYPE_NRFMIN
};
/**
@ -70,39 +70,39 @@ enum {
* upper layer
*/
typedef enum {
NETDEV2_EVENT_ISR, /**< driver needs it's ISR handled */
NETDEV2_EVENT_RX_STARTED, /**< started to receive a packet */
NETDEV2_EVENT_RX_COMPLETE, /**< finished receiving a packet */
NETDEV2_EVENT_TX_STARTED, /**< started to transfer a packet */
NETDEV2_EVENT_TX_COMPLETE, /**< finished transferring packet */
NETDEV2_EVENT_TX_NOACK, /**< ACK requested but not received */
NETDEV2_EVENT_TX_MEDIUM_BUSY, /**< couldn't transfer packet */
NETDEV2_EVENT_LINK_UP, /**< link established */
NETDEV2_EVENT_LINK_DOWN, /**< link gone */
NETDEV_EVENT_ISR, /**< driver needs it's ISR handled */
NETDEV_EVENT_RX_STARTED, /**< started to receive a packet */
NETDEV_EVENT_RX_COMPLETE, /**< finished receiving a packet */
NETDEV_EVENT_TX_STARTED, /**< started to transfer a packet */
NETDEV_EVENT_TX_COMPLETE, /**< finished transferring packet */
NETDEV_EVENT_TX_NOACK, /**< ACK requested but not received */
NETDEV_EVENT_TX_MEDIUM_BUSY, /**< couldn't transfer packet */
NETDEV_EVENT_LINK_UP, /**< link established */
NETDEV_EVENT_LINK_DOWN, /**< link gone */
/* expand this list if needed */
} netdev2_event_t;
} netdev_event_t;
/**
* @brief Received packet status information for most radios
*
* May be different for certain radios.
*/
struct netdev2_radio_rx_info {
struct netdev_radio_rx_info {
uint8_t rssi; /**< RSSI of a received packet */
uint8_t lqi; /**< LQI of a received packet */
};
/**
* @brief Forward declaration for netdev2 struct
* @brief Forward declaration for netdev struct
*/
typedef struct netdev2 netdev2_t;
typedef struct netdev netdev_t;
/**
* @brief Event callback for signaling event to upper layers
*
* @param[in] type type of the event
*/
typedef void (*netdev2_event_cb_t)(netdev2_t *dev, netdev2_event_t event);
typedef void (*netdev_event_cb_t)(netdev_t *dev, netdev_event_t event);
/**
* @brief Structure to hold driver state
@ -113,9 +113,9 @@ typedef void (*netdev2_event_cb_t)(netdev2_t *dev, netdev2_event_t event);
* Contains a field @p context which is not used by the drivers, but supposed to
* be used by upper layers to store reference information.
*/
struct netdev2 {
const struct netdev2_driver *driver; /**< ptr to that driver's interface. */
netdev2_event_cb_t event_callback; /**< callback for device events */
struct netdev {
const struct netdev_driver *driver; /**< ptr to that driver's interface. */
netdev_event_cb_t event_callback; /**< callback for device events */
void* context; /**< ptr to network stack context */
#ifdef MODULE_NETSTATS_L2
netstats_t stats; /**< transceiver's statistics */
@ -128,7 +128,7 @@ struct netdev2 {
* The send/receive functions expect/return a full ethernet
* frame (dst mac, src mac, ethertype, payload, no checksum).
*/
typedef struct netdev2_driver {
typedef struct netdev_driver {
/**
* @brief Send frame
*
@ -142,7 +142,7 @@ typedef struct netdev2_driver {
*
* @return number of bytes sent, or `< 0` on error
*/
int (*send)(netdev2_t *dev, const struct iovec *vector, unsigned count);
int (*send)(netdev_t *dev, const struct iovec *vector, unsigned count);
/**
* @brief Get a received frame
@ -150,7 +150,7 @@ typedef struct netdev2_driver {
* @pre `(dev != NULL)`
* @pre `(buf != NULL) && (len > 0)`
*
* Supposed to be called from @ref netdev2_t::event_callback().
* Supposed to be called from @ref netdev_t::event_callback().
*
* If buf == NULL and len == 0, returns the packet size without dropping it.
* If buf == NULL and len > 0, drops the packet and returns the packet size.
@ -159,14 +159,14 @@ typedef struct netdev2_driver {
* @param[out] buf buffer to write into or NULL
* @param[in] len maximum number of bytes to read
* @param[out] info status information for the received packet. Might
* be of different type for different netdev2 devices.
* be of different type for different netdev devices.
* May be NULL if not needed or applicable.
*
* @return `< 0` on error
* @return number of bytes read if buf != NULL
* @return packet size if buf == NULL
*/
int (*recv)(netdev2_t *dev, void *buf, size_t len, void *info);
int (*recv)(netdev_t *dev, void *buf, size_t len, void *info);
/**
* @brief the driver's initialization function
@ -175,7 +175,7 @@ typedef struct netdev2_driver {
*
* @return `< 0` on error, 0 on success
*/
int (*init)(netdev2_t *dev);
int (*init)(netdev_t *dev);
/**
* @brief a driver's user-space ISR handler
@ -183,15 +183,15 @@ typedef struct netdev2_driver {
* @pre `(dev != NULL)`
*
* This function will be called from a network stack's loop when being notified
* by netdev2_isr.
* by netdev_isr.
*
* It is supposed to call @ref netdev2_t::event_callback() for each occuring event.
* It is supposed to call @ref netdev_t::event_callback() for each occuring event.
*
* See receive packet flow description for details.
*
* @param[in] dev network device descriptor
*/
void (*isr)(netdev2_t *dev);
void (*isr)(netdev_t *dev);
/**
* @brief Get an option value from a given network device
@ -206,7 +206,7 @@ typedef struct netdev2_driver {
* @return number of bytes written to @p value
* @return `< 0` on error, 0 on success
*/
int (*get)(netdev2_t *dev, netopt_t opt,
int (*get)(netdev_t *dev, netopt_t opt,
void *value, size_t max_len);
/**
@ -222,12 +222,12 @@ typedef struct netdev2_driver {
* @return number of bytes used from @p value
* @return `< 0` on error, 0 on success
*/
int (*set)(netdev2_t *dev, netopt_t opt,
int (*set)(netdev_t *dev, netopt_t opt,
void *value, size_t value_len);
} netdev2_driver_t;
} netdev_driver_t;
#ifdef __cplusplus
}
#endif
/** @} */
#endif /* NETDEV2_H */
#endif /* NETDEV_H */

View File

@ -7,21 +7,21 @@
*/
/**
* @ingroup drivers_netdev_netdev2
* @ingroup drivers_netdev_api
* @{
*
* @file
* @brief Definitions for netdev2 common ethernet code
* @brief Definitions for netdev common ethernet code
*
* @author Kaspar Schleiser <kaspar@schleiser.de>
*/
#ifndef NETDEV2_ETH_H
#define NETDEV2_ETH_H
#ifndef NETDEV_ETH_H
#define NETDEV_ETH_H
#include <stdint.h>
#include "net/netdev2.h"
#include "net/netdev.h"
#include "net/netopt.h"
#ifdef __cplusplus
@ -29,9 +29,9 @@ extern "C" {
#endif
/**
* @brief Fallback function for netdev2 ethernet devices' _get function
* @brief Fallback function for netdev ethernet devices' _get function
*
* Supposed to be used by netdev2 drivers as default case.
* Supposed to be used by netdev drivers as default case.
*
* @warning Driver *MUST* implement NETOPT_ADDRESS case!
*
@ -43,10 +43,10 @@ extern "C" {
* @return number of bytes written to @p value
* @return <0 on error
*/
int netdev2_eth_get(netdev2_t *dev, netopt_t opt, void *value, size_t max_len);
int netdev_eth_get(netdev_t *dev, netopt_t opt, void *value, size_t max_len);
/**
* @brief Fallback function for netdev2 ethernet devices' _set function
* @brief Fallback function for netdev ethernet devices' _set function
*
* @param[in] dev network device descriptor
* @param[in] opt option type
@ -56,10 +56,10 @@ int netdev2_eth_get(netdev2_t *dev, netopt_t opt, void *value, size_t max_len);
* @return number of bytes used from @p value
* @return <0 on error
*/
int netdev2_eth_set(netdev2_t *dev, netopt_t opt, void *value, size_t value_len);
int netdev_eth_set(netdev_t *dev, netopt_t opt, void *value, size_t value_len);
#ifdef __cplusplus
}
#endif
/** @} */
#endif /* NETDEV2_ETH_H */
#endif /* NETDEV_ETH_H */

View File

@ -7,29 +7,29 @@
*/
/**
* @ingroup drivers_netdev_netdev2
* @ingroup drivers_netdev_api
* @brief
* @{
*
* @file
* @brief Definitions for netdev2 common IEEE 802.15.4 code
* @brief Definitions for netdev common IEEE 802.15.4 code
*
* @author Martine Lenders <mlenders@inf.fu-berlin.de>
*/
#ifndef NETDEV2_IEEE802154_H
#define NETDEV2_IEEE802154_H
#ifndef NETDEV_IEEE802154_H
#define NETDEV_IEEE802154_H
#include "net/ieee802154.h"
#include "net/gnrc/nettype.h"
#include "net/netopt.h"
#include "net/netdev2.h"
#include "net/netdev.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @name IEEE 802.15.4 netdev2 flags
* @name IEEE 802.15.4 netdev flags
* @brief Flags for netdev_ieee802154_t::flags
*
* The flag-space `0xff00` is available for device-specific flags.
@ -38,21 +38,21 @@ extern "C" {
* @{
*/
#define NETDEV2_IEEE802154_SEND_MASK (0x0028) /**< flags to take for send packets */
#define NETDEV2_IEEE802154_RAW (0x0002) /**< pass raw frame to upper layer */
#define NETDEV_IEEE802154_SEND_MASK (0x0028) /**< flags to take for send packets */
#define NETDEV_IEEE802154_RAW (0x0002) /**< pass raw frame to upper layer */
/**
* @brief use long source addres (set) or short source address (unset)
*/
#define NETDEV2_IEEE802154_SRC_MODE_LONG (0x0004)
#define NETDEV_IEEE802154_SRC_MODE_LONG (0x0004)
/**
* @brief enable security
*/
#define NETDEV2_IEEE802154_SECURITY_EN (IEEE802154_FCF_SECURITY_EN)
#define NETDEV_IEEE802154_SECURITY_EN (IEEE802154_FCF_SECURITY_EN)
/**
* @brief request ACK from receiver
*/
#define NETDEV2_IEEE802154_ACK_REQ (IEEE802154_FCF_ACK_REQ)
#define NETDEV_IEEE802154_ACK_REQ (IEEE802154_FCF_ACK_REQ)
/**
* @}
*/
@ -63,25 +63,25 @@ extern "C" {
* in Std 802.15.4.
*/
typedef enum {
NETDEV2_IEEE802154_CCA_MODE_1 = 1, /**< Energy above threshold */
NETDEV2_IEEE802154_CCA_MODE_2, /**< Carrier sense only */
NETDEV2_IEEE802154_CCA_MODE_3, /**< Carrier sense with energy above threshold */
NETDEV2_IEEE802154_CCA_MODE_4, /**< ALOHA */
NETDEV2_IEEE802154_CCA_MODE_5, /**< UWB preamble sense based on the SHR of a frame */
NETDEV2_IEEE802154_CCA_MODE_6, /**< UWB preamble sense based on the packet
NETDEV_IEEE802154_CCA_MODE_1 = 1, /**< Energy above threshold */
NETDEV_IEEE802154_CCA_MODE_2, /**< Carrier sense only */
NETDEV_IEEE802154_CCA_MODE_3, /**< Carrier sense with energy above threshold */
NETDEV_IEEE802154_CCA_MODE_4, /**< ALOHA */
NETDEV_IEEE802154_CCA_MODE_5, /**< UWB preamble sense based on the SHR of a frame */
NETDEV_IEEE802154_CCA_MODE_6, /**< UWB preamble sense based on the packet
* with the multiplexed preamble */
} netdev2_ieee802154_cca_mode_t;
} netdev_ieee802154_cca_mode_t;
/**
* @brief Extended structure to hold IEEE 802.15.4 driver state
*
* @extends netdev2_t
* @extends netdev_t
*
* Supposed to be extended by driver implementations.
* The extended structure should contain all variable driver state.
*/
typedef struct {
netdev2_t netdev; /**< @ref netdev2_t base class */
netdev_t netdev; /**< @ref netdev_t base class */
/**
* @brief IEEE 802.15.4 specific fields
* @{
@ -108,17 +108,17 @@ typedef struct {
uint8_t chan; /**< channel */
uint16_t flags; /**< flags as defined above */
/** @} */
} netdev2_ieee802154_t;
} netdev_ieee802154_t;
/**
* @brief Received packet status information for IEEE 802.15.4 radios
*/
typedef struct netdev2_radio_rx_info netdev2_ieee802154_rx_info_t;
typedef struct netdev_radio_rx_info netdev_ieee802154_rx_info_t;
/**
* @brief Fallback function for netdev2 IEEE 802.15.4 devices' _get function
* @brief Fallback function for netdev IEEE 802.15.4 devices' _get function
*
* Supposed to be used by netdev2 drivers as default case.
* Supposed to be used by netdev drivers as default case.
*
* @param[in] dev network device descriptor
* @param[in] opt option type
@ -128,24 +128,24 @@ typedef struct netdev2_radio_rx_info netdev2_ieee802154_rx_info_t;
* @return number of bytes written to @p value
* @return <0 on error
*/
int netdev2_ieee802154_get(netdev2_ieee802154_t *dev, netopt_t opt, void *value,
size_t max_len);
int netdev_ieee802154_get(netdev_ieee802154_t *dev, netopt_t opt, void *value,
size_t max_len);
/**
* @brief Fallback function for netdev2 IEEE 802.15.4 devices' _set function
* @brief Fallback function for netdev IEEE 802.15.4 devices' _set function
*
* Sets netdev2_ieee802154_t::pan, netdev2_ieee802154_t::short_addr, and
* netdev2_ieee802154_t::long_addr in device struct.
* Additionally @ref NETDEV2_IEEE802154_SRC_MODE_LONG,
* @ref NETDEV2_IEEE802154_RAW and, @ref NETDEV2_IEEE802154_ACK_REQ in
* netdev2_ieee802154_t::flags can be set or unset.
* Sets netdev_ieee802154_t::pan, netdev_ieee802154_t::short_addr, and
* netdev_ieee802154_t::long_addr in device struct.
* Additionally @ref NETDEV_IEEE802154_SRC_MODE_LONG,
* @ref NETDEV_IEEE802154_RAW and, @ref NETDEV_IEEE802154_ACK_REQ in
* netdev_ieee802154_t::flags can be set or unset.
*
* The setting of netdev2_ieee802154_t::chan is omitted since the legality of
* The setting of netdev_ieee802154_t::chan is omitted since the legality of
* its value can be very device specific and can't be checked in this function.
* Please set it in the netdev2_driver_t::set function of your driver.
* Please set it in the netdev_driver_t::set function of your driver.
*
* Be aware that this only manipulates the netdev2_ieee802154_t struct.
* Configuration to the device needs to be done in the netdev2_driver_t::set
* Be aware that this only manipulates the netdev_ieee802154_t struct.
* Configuration to the device needs to be done in the netdev_driver_t::set
* function of the device driver (which should call this function as a fallback
* afterwards).
*
@ -157,12 +157,12 @@ int netdev2_ieee802154_get(netdev2_ieee802154_t *dev, netopt_t opt, void *value,
* @return number of bytes used from @p value
* @return <0 on error
*/
int netdev2_ieee802154_set(netdev2_ieee802154_t *dev, netopt_t opt, void *value,
size_t value_len);
int netdev_ieee802154_set(netdev_ieee802154_t *dev, netopt_t opt, void *value,
size_t value_len);
#ifdef __cplusplus
}
#endif
#endif /* NETDEV2_IEEE802154_H */
#endif /* NETDEV_IEEE802154_H */
/** @} */

View File

@ -14,7 +14,7 @@
* This device driver only exposes the MACRAW mode of W5100 devices, so it does
* not offer any support for the on-chip IPv4, UDP, and TCP capabilities of
* these chips. In connection with RIOT we are only interested in the RAW
* Ethernet packets, which we can use through netdev2 with any software network
* Ethernet packets, which we can use through netdev with any software network
* stack provided by RIOT (e.g. GNRC). This enables W5100 devices to communicate
* via IPv6, enables unlimited connections, and more...
*
@ -38,7 +38,7 @@
#include "periph/spi.h"
#include "periph/gpio.h"
#include "net/netdev2.h"
#include "net/netdev.h"
#ifdef __cplusplus
extern "C" {
@ -65,14 +65,14 @@ typedef struct {
* @brief Device descriptor for W5100 devices
*/
typedef struct {
netdev2_t nd; /**< extends the netdev2 structure */
netdev_t nd; /**< extends the netdev structure */
w5100_params_t p; /**< device configuration parameters */
} w5100_t;
/**
* @brief So the initial device setup
*
* This function pre-initializes the netdev2 structure, saves the configuration
* This function pre-initializes the netdev structure, saves the configuration
* parameters and finally initializes the SPI bus and the used GPIO pins.
*/
void w5100_setup(w5100_t *dev, const w5100_params_t *params);

View File

@ -29,7 +29,7 @@
#include "xtimer.h"
#include "periph/uart.h"
#include "periph/gpio.h"
#include "net/netdev2.h"
#include "net/netdev.h"
#include "net/ieee802154.h"
#include "net/gnrc/nettype.h"
@ -130,8 +130,8 @@ typedef struct {
*/
typedef struct {
/* netdev fields */
const struct netdev2_driver *driver; /**< ptr to that driver's interface. */
netdev2_event_cb_t event_callback; /**< callback for device events */
const struct netdev_driver *driver; /**< ptr to that driver's interface. */
netdev_event_cb_t event_callback; /**< callback for device events */
void* context; /**< ptr to network stack context */
#ifdef MODULE_NETSTATS_L2
netstats_t stats; /**< transceiver's statistics */
@ -177,7 +177,7 @@ typedef struct {
/**
* @brief Reference to the XBee driver interface
*/
extern const netdev2_driver_t xbee_driver;
extern const netdev_driver_t xbee_driver;
/**
* @brief Prepare the given Xbee device

View File

@ -26,7 +26,7 @@ extern "C" {
/**
* @brief Reference to the netdev device driver struct
*/
extern const netdev2_driver_t kw2xrf_driver;
extern const netdev_driver_t kw2xrf_driver;
#ifdef __cplusplus
}

View File

@ -56,7 +56,7 @@ static void kw2xrf_set_address(kw2xrf_t *dev)
void kw2xrf_setup(kw2xrf_t *dev, const kw2xrf_params_t *params)
{
netdev2_t *netdev = (netdev2_t *)dev;
netdev_t *netdev = (netdev_t *)dev;
netdev->driver = &kw2xrf_driver;
/* initialize device descriptor */

View File

@ -23,8 +23,8 @@
#include "log.h"
#include "net/eui64.h"
#include "net/ieee802154.h"
#include "net/netdev2.h"
#include "net/netdev2/ieee802154.h"
#include "net/netdev.h"
#include "net/netdev/ieee802154.h"
#include "kw2xrf.h"
#include "kw2xrf_spi.h"
@ -45,14 +45,14 @@ static uint8_t _send_last_fcf;
static void _irq_handler(void *arg)
{
netdev2_t *dev = (netdev2_t *) arg;
netdev_t *dev = (netdev_t *) arg;
if (dev->event_callback) {
dev->event_callback(dev, NETDEV2_EVENT_ISR);
dev->event_callback(dev, NETDEV_EVENT_ISR);
}
}
static int _init(netdev2_t *netdev)
static int _init(netdev_t *netdev)
{
kw2xrf_t *dev = (kw2xrf_t *)netdev;
@ -91,7 +91,7 @@ static void kw2xrf_tx_exec(kw2xrf_t *dev)
}
}
static int _send(netdev2_t *netdev, const struct iovec *vector, unsigned count)
static int _send(netdev_t *netdev, const struct iovec *vector, unsigned count)
{
kw2xrf_t *dev = (kw2xrf_t *)netdev;
const struct iovec *ptr = vector;
@ -141,7 +141,7 @@ static int _send(netdev2_t *netdev, const struct iovec *vector, unsigned count)
return (int)len;
}
static int _recv(netdev2_t *netdev, void *buf, size_t len, void *info)
static int _recv(netdev_t *netdev, void *buf, size_t len, void *info)
{
kw2xrf_t *dev = (kw2xrf_t *)netdev;
size_t pkt_len = 0;
@ -167,7 +167,7 @@ static int _recv(netdev2_t *netdev, void *buf, size_t len, void *info)
kw2xrf_read_fifo(dev, (uint8_t *)buf, pkt_len + 1);
if (info != NULL) {
netdev2_ieee802154_rx_info_t *radio_info = info;
netdev_ieee802154_rx_info_t *radio_info = info;
radio_info->lqi = ((uint8_t*)buf)[pkt_len];
radio_info->rssi = (uint8_t)kw2xrf_get_rssi(radio_info->lqi);
}
@ -208,7 +208,7 @@ static netopt_state_t _get_state(kw2xrf_t *dev)
return dev->state;
}
int _get(netdev2_t *netdev, netopt_t opt, void *value, size_t len)
int _get(netdev_t *netdev, netopt_t opt, void *value, size_t len)
{
kw2xrf_t *dev = (kw2xrf_t *)netdev;
@ -307,9 +307,9 @@ int _get(netdev2_t *netdev, netopt_t opt, void *value, size_t len)
else {
*(uint8_t *)value = kw2xrf_get_cca_mode(dev);
switch (*((int8_t *)value)) {
case NETDEV2_IEEE802154_CCA_MODE_1:
case NETDEV2_IEEE802154_CCA_MODE_2:
case NETDEV2_IEEE802154_CCA_MODE_3:
case NETDEV_IEEE802154_CCA_MODE_1:
case NETDEV_IEEE802154_CCA_MODE_2:
case NETDEV_IEEE802154_CCA_MODE_3:
return sizeof(uint8_t);
default:
break;
@ -323,10 +323,10 @@ int _get(netdev2_t *netdev, netopt_t opt, void *value, size_t len)
break;
}
return netdev2_ieee802154_get((netdev2_ieee802154_t *)netdev, opt, value, len);
return netdev_ieee802154_get((netdev_ieee802154_t *)netdev, opt, value, len);
}
static int _set(netdev2_t *netdev, netopt_t opt, void *value, size_t len)
static int _set(netdev_t *netdev, netopt_t opt, void *value, size_t len)
{
kw2xrf_t *dev = (kw2xrf_t *)netdev;
int res = -ENOTSUP;
@ -342,7 +342,7 @@ static int _set(netdev2_t *netdev, netopt_t opt, void *value, size_t len)
}
else {
kw2xrf_set_addr_short(dev, *((uint16_t *)value));
/* don't set res to set netdev2_ieee802154_t::short_addr */
/* don't set res to set netdev_ieee802154_t::short_addr */
}
break;
@ -352,7 +352,7 @@ static int _set(netdev2_t *netdev, netopt_t opt, void *value, size_t len)
}
else {
kw2xrf_set_addr_long(dev, *((uint64_t *)value));
/* don't set res to set netdev2_ieee802154_t::short_addr */
/* don't set res to set netdev_ieee802154_t::short_addr */
}
break;
@ -363,7 +363,7 @@ static int _set(netdev2_t *netdev, netopt_t opt, void *value, size_t len)
else {
kw2xrf_set_pan(dev, *((uint16_t *)value));
/* don't set res to set netdev2_ieee802154_t::pan */
/* don't set res to set netdev_ieee802154_t::pan */
}
break;
@ -378,7 +378,7 @@ static int _set(netdev2_t *netdev, netopt_t opt, void *value, size_t len)
break;
}
dev->netdev.chan = chan;
/* don't set res to set netdev2_ieee802154_t::chan */
/* don't set res to set netdev_ieee802154_t::chan */
}
break;
@ -474,15 +474,15 @@ static int _set(netdev2_t *netdev, netopt_t opt, void *value, size_t len)
}
else {
switch (*((int8_t*)value)) {
case NETDEV2_IEEE802154_CCA_MODE_1:
case NETDEV2_IEEE802154_CCA_MODE_2:
case NETDEV2_IEEE802154_CCA_MODE_3:
case NETDEV_IEEE802154_CCA_MODE_1:
case NETDEV_IEEE802154_CCA_MODE_2:
case NETDEV_IEEE802154_CCA_MODE_3:
kw2xrf_set_cca_mode(dev, *((int8_t*)value));
res = sizeof(uint8_t);
break;
case NETDEV2_IEEE802154_CCA_MODE_4:
case NETDEV2_IEEE802154_CCA_MODE_5:
case NETDEV2_IEEE802154_CCA_MODE_6:
case NETDEV_IEEE802154_CCA_MODE_4:
case NETDEV_IEEE802154_CCA_MODE_5:
case NETDEV_IEEE802154_CCA_MODE_6:
default:
break;
}
@ -506,14 +506,14 @@ static int _set(netdev2_t *netdev, netopt_t opt, void *value, size_t len)
}
if (res == -ENOTSUP) {
res = netdev2_ieee802154_set((netdev2_ieee802154_t *)netdev, opt,
res = netdev_ieee802154_set((netdev_ieee802154_t *)netdev, opt,
value, len);
}
return res;
}
static void _isr_event_seq_r(netdev2_t *netdev, uint8_t *dregs)
static void _isr_event_seq_r(netdev_t *netdev, uint8_t *dregs)
{
kw2xrf_t *dev = (kw2xrf_t *)netdev;
uint8_t irqsts1 = 0;
@ -521,14 +521,14 @@ static void _isr_event_seq_r(netdev2_t *netdev, uint8_t *dregs)
if (dregs[MKW2XDM_IRQSTS1] & MKW2XDM_IRQSTS1_RXWTRMRKIRQ) {
DEBUG("[kw2xrf] got RXWTRMRKIRQ\n");
irqsts1 |= MKW2XDM_IRQSTS1_RXWTRMRKIRQ;
netdev->event_callback(netdev, NETDEV2_EVENT_RX_STARTED);
netdev->event_callback(netdev, NETDEV_EVENT_RX_STARTED);
}
if (dregs[MKW2XDM_IRQSTS1] & MKW2XDM_IRQSTS1_RXIRQ) {
DEBUG("[kw2xrf] finished RXSEQ\n");
dev->state = NETOPT_STATE_RX;
irqsts1 |= MKW2XDM_IRQSTS1_RXIRQ;
netdev->event_callback(netdev, NETDEV2_EVENT_RX_COMPLETE);
netdev->event_callback(netdev, NETDEV_EVENT_RX_COMPLETE);
if (dregs[MKW2XDM_PHY_CTRL1] & MKW2XDM_PHY_CTRL1_AUTOACK) {
DEBUG("[kw2xrf]: perform TX ACK\n");
}
@ -549,7 +549,7 @@ static void _isr_event_seq_r(netdev2_t *netdev, uint8_t *dregs)
dregs[MKW2XDM_IRQSTS1] &= ~irqsts1;
}
static void _isr_event_seq_t(netdev2_t *netdev, uint8_t *dregs)
static void _isr_event_seq_t(netdev_t *netdev, uint8_t *dregs)
{
kw2xrf_t *dev = (kw2xrf_t *)netdev;
uint8_t irqsts1 = 0;
@ -567,10 +567,10 @@ static void _isr_event_seq_t(netdev2_t *netdev, uint8_t *dregs)
irqsts1 |= MKW2XDM_IRQSTS1_CCAIRQ;
if (dregs[MKW2XDM_IRQSTS2] & MKW2XDM_IRQSTS2_CCA) {
DEBUG("[kw2xrf] CCA CH busy\n");
netdev->event_callback(netdev, NETDEV2_EVENT_TX_MEDIUM_BUSY);
netdev->event_callback(netdev, NETDEV_EVENT_TX_MEDIUM_BUSY);
}
else {
netdev->event_callback(netdev, NETDEV2_EVENT_TX_COMPLETE);
netdev->event_callback(netdev, NETDEV_EVENT_TX_COMPLETE);
}
}
@ -584,7 +584,7 @@ static void _isr_event_seq_t(netdev2_t *netdev, uint8_t *dregs)
}
/* Standalone CCA */
static void _isr_event_seq_cca(netdev2_t *netdev, uint8_t *dregs)
static void _isr_event_seq_cca(netdev_t *netdev, uint8_t *dregs)
{
kw2xrf_t *dev = (kw2xrf_t *)netdev;
uint8_t irqsts1 = 0;
@ -604,7 +604,7 @@ static void _isr_event_seq_cca(netdev2_t *netdev, uint8_t *dregs)
dregs[MKW2XDM_IRQSTS1] &= ~irqsts1;
}
static void _isr_event_seq_tr(netdev2_t *netdev, uint8_t *dregs)
static void _isr_event_seq_tr(netdev_t *netdev, uint8_t *dregs)
{
kw2xrf_t *dev = (kw2xrf_t *)netdev;
uint8_t irqsts1 = 0;
@ -638,7 +638,7 @@ static void _isr_event_seq_tr(netdev2_t *netdev, uint8_t *dregs)
irqsts1 |= MKW2XDM_IRQSTS1_CCAIRQ;
if (dregs[MKW2XDM_IRQSTS2] & MKW2XDM_IRQSTS2_CCA) {
DEBUG("[kw2xrf] CCA CH busy\n");
netdev->event_callback(netdev, NETDEV2_EVENT_TX_MEDIUM_BUSY);
netdev->event_callback(netdev, NETDEV_EVENT_TX_MEDIUM_BUSY);
}
}
@ -646,7 +646,7 @@ static void _isr_event_seq_tr(netdev2_t *netdev, uint8_t *dregs)
irqsts1 |= MKW2XDM_IRQSTS1_SEQIRQ;
assert(dev->pending_tx != 0);
dev->pending_tx--;
netdev->event_callback(netdev, NETDEV2_EVENT_TX_COMPLETE);
netdev->event_callback(netdev, NETDEV_EVENT_TX_COMPLETE);
kw2xrf_seq_timeout_off(dev);
kw2xrf_set_idle_sequence(dev);
}
@ -654,7 +654,7 @@ static void _isr_event_seq_tr(netdev2_t *netdev, uint8_t *dregs)
DEBUG("[kw2xrf] TC4TMOUT, no SEQIRQ, TX failed\n");
assert(dev->pending_tx != 0);
dev->pending_tx--;
netdev->event_callback(netdev, NETDEV2_EVENT_TX_NOACK);
netdev->event_callback(netdev, NETDEV_EVENT_TX_NOACK);
kw2xrf_seq_timeout_off(dev);
kw2xrf_set_sequence(dev, dev->idle_state);
}
@ -663,7 +663,7 @@ static void _isr_event_seq_tr(netdev2_t *netdev, uint8_t *dregs)
dregs[MKW2XDM_IRQSTS1] &= ~irqsts1;
}
static void _isr_event_seq_ccca(netdev2_t *netdev, uint8_t *dregs)
static void _isr_event_seq_ccca(netdev_t *netdev, uint8_t *dregs)
{
kw2xrf_t *dev = (kw2xrf_t *)netdev;
uint8_t irqsts1 = 0;
@ -685,7 +685,7 @@ static void _isr_event_seq_ccca(netdev2_t *netdev, uint8_t *dregs)
dregs[MKW2XDM_IRQSTS1] &= ~irqsts1;
}
static void _isr(netdev2_t *netdev)
static void _isr(netdev_t *netdev)
{
uint8_t dregs[MKW2XDM_PHY_CTRL4 + 1];
kw2xrf_t *dev = (kw2xrf_t *)netdev;
@ -754,7 +754,7 @@ static void _isr(netdev2_t *netdev)
kw2xrf_enable_irq_b(dev);
}
const netdev2_driver_t kw2xrf_driver = {
const netdev_driver_t kw2xrf_driver = {
.init = _init,
.send = _send,
.recv = _recv,

View File

@ -21,7 +21,7 @@
#ifndef MRF24J40_NETDEV_H
#define MRF24J40_NETDEV_H
#include "net/netdev2.h"
#include "net/netdev.h"
#ifdef __cplusplus
extern "C" {
@ -30,7 +30,7 @@ extern "C" {
/**
* @brief Reference to the netdev device driver struct
*/
extern const netdev2_driver_t mrf24j40_driver;
extern const netdev_driver_t mrf24j40_driver;
#ifdef __cplusplus

View File

@ -33,7 +33,7 @@
void mrf24j40_setup(mrf24j40_t *dev, const mrf24j40_params_t *params)
{
netdev2_t *netdev = (netdev2_t *)dev;
netdev_t *netdev = (netdev_t *)dev;
netdev->driver = &mrf24j40_driver;
/* initialize device descriptor */
@ -67,8 +67,8 @@ void mrf24j40_reset(mrf24j40_t *dev)
/* set default options */
mrf24j40_set_option(dev, IEEE802154_FCF_PAN_COMP, true);
mrf24j40_set_option(dev, NETDEV2_IEEE802154_SRC_MODE_LONG, true);
mrf24j40_set_option(dev, NETDEV2_IEEE802154_ACK_REQ, true);
mrf24j40_set_option(dev, NETDEV_IEEE802154_SRC_MODE_LONG, true);
mrf24j40_set_option(dev, NETDEV_IEEE802154_ACK_REQ, true);
mrf24j40_set_option(dev, MRF24J40_OPT_CSMA, true);
mrf24j40_set_option(dev, MRF24J40_OPT_TELL_RX_START, false);
mrf24j40_set_option(dev, MRF24J40_OPT_TELL_RX_END, true);
@ -142,7 +142,7 @@ size_t mrf24j40_tx_load(mrf24j40_t *dev, uint8_t *data, size_t len, size_t offse
void mrf24j40_tx_exec(mrf24j40_t *dev)
{
netdev2_t *netdev = (netdev2_t *)dev;
netdev_t *netdev = (netdev_t *)dev;
dev->tx_frame_len = dev->tx_frame_len - IEEE802154_FCS_LEN;
@ -156,13 +156,13 @@ void mrf24j40_tx_exec(mrf24j40_t *dev)
*/
mrf24j40_reg_write_long(dev, MRF24J40_TX_NORMAL_FIFO, dev->header_len);
if (dev->netdev.flags & NETDEV2_IEEE802154_ACK_REQ) {
if (dev->netdev.flags & NETDEV_IEEE802154_ACK_REQ) {
mrf24j40_reg_write_short(dev, MRF24J40_REG_TXNCON, MRF24J40_TXNCON_TXNACKREQ | MRF24J40_TXNCON_TXNTRIG);
}
else {
mrf24j40_reg_write_short(dev, MRF24J40_REG_TXNCON, MRF24J40_TXNCON_TXNTRIG);
}
if (netdev->event_callback && (dev->netdev.flags & MRF24J40_OPT_TELL_TX_START)) {
netdev->event_callback(netdev, NETDEV2_EVENT_TX_STARTED);
netdev->event_callback(netdev, NETDEV_EVENT_TX_STARTED);
}
}

View File

@ -351,7 +351,7 @@ void mrf24j40_set_option(mrf24j40_t *dev, uint16_t option, bool state)
tmp &= ~MRF24J40_RXMCR_ERRPKT;
mrf24j40_reg_write_short(dev, MRF24J40_REG_RXMCR, tmp);
break;
case NETDEV2_IEEE802154_ACK_REQ:
case NETDEV_IEEE802154_ACK_REQ:
DEBUG("[mrf24j40] opt: enabling auto ACKs\n");
tmp = mrf24j40_reg_read_short(dev, MRF24J40_REG_RXMCR);
tmp &= ~MRF24J40_RXMCR_NOACKRSP;
@ -383,12 +383,12 @@ void mrf24j40_set_option(mrf24j40_t *dev, uint16_t option, bool state)
tmp &= ~MRF24J40_RXMCR_PROMI;
tmp &= ~MRF24J40_RXMCR_ERRPKT;
/* re-enable AUTOACK only if the option is set */
if (dev->netdev.flags & NETDEV2_IEEE802154_ACK_REQ) {
if (dev->netdev.flags & NETDEV_IEEE802154_ACK_REQ) {
tmp &= ~(MRF24J40_RXMCR_NOACKRSP);
mrf24j40_reg_write_short(dev, MRF24J40_REG_RXMCR, tmp);
}
break;
case NETDEV2_IEEE802154_ACK_REQ:
case NETDEV_IEEE802154_ACK_REQ:
DEBUG("[mrf24j40] opt: disabling auto ACKs\n");
tmp = mrf24j40_reg_read_short(dev, MRF24J40_REG_RXMCR);
tmp |= MRF24J40_RXMCR_NOACKRSP;

View File

@ -26,8 +26,8 @@
#include "net/eui64.h"
#include "net/ieee802154.h"
#include "net/netdev2.h"
#include "net/netdev2/ieee802154.h"
#include "net/netdev.h"
#include "net/netdev/ieee802154.h"
#include "mrf24j40.h"
#include "mrf24j40_netdev.h"
@ -39,14 +39,14 @@
#define _MAX_MHR_OVERHEAD (25)
static int _send(netdev2_t *netdev, const struct iovec *vector, unsigned count);
static int _recv(netdev2_t *netdev, void *buf, size_t len, void *info);
static int _init(netdev2_t *netdev);
static void _isr(netdev2_t *netdev);
static int _get(netdev2_t *netdev, netopt_t opt, void *val, size_t max_len);
static int _set(netdev2_t *netdev, netopt_t opt, void *val, size_t len);
static int _send(netdev_t *netdev, const struct iovec *vector, unsigned count);
static int _recv(netdev_t *netdev, void *buf, size_t len, void *info);
static int _init(netdev_t *netdev);
static void _isr(netdev_t *netdev);
static int _get(netdev_t *netdev, netopt_t opt, void *val, size_t max_len);
static int _set(netdev_t *netdev, netopt_t opt, void *val, size_t len);
const netdev2_driver_t mrf24j40_driver = {
const netdev_driver_t mrf24j40_driver = {
.send = _send,
.recv = _recv,
.init = _init,
@ -57,15 +57,15 @@ const netdev2_driver_t mrf24j40_driver = {
static void _irq_handler(void *arg)
{
netdev2_t *dev = (netdev2_t *) arg;
netdev_t *dev = (netdev_t *) arg;
if (dev->event_callback) {
dev->event_callback(dev, NETDEV2_EVENT_ISR);
dev->event_callback(dev, NETDEV_EVENT_ISR);
}
((mrf24j40_t *)arg)->irq_flag = 1;
}
static int _init(netdev2_t *netdev)
static int _init(netdev_t *netdev)
{
mrf24j40_t *dev = (mrf24j40_t *)netdev;
@ -83,7 +83,7 @@ static int _init(netdev2_t *netdev)
return 0;
}
static int _send(netdev2_t *netdev, const struct iovec *vector, unsigned count)
static int _send(netdev_t *netdev, const struct iovec *vector, unsigned count)
{
mrf24j40_t *dev = (mrf24j40_t *)netdev;
const struct iovec *ptr = vector;
@ -119,7 +119,7 @@ static int _send(netdev2_t *netdev, const struct iovec *vector, unsigned count)
}
static int _recv(netdev2_t *netdev, void *buf, size_t len, void *info)
static int _recv(netdev_t *netdev, void *buf, size_t len, void *info)
{
mrf24j40_t *dev = (mrf24j40_t *)netdev;
uint8_t phr;
@ -153,7 +153,7 @@ static int _recv(netdev2_t *netdev, void *buf, size_t len, void *info)
mrf24j40_rx_fifo_read(dev, 1, (uint8_t *)buf, pkt_len);
if (info != NULL) {
netdev2_ieee802154_rx_info_t *radio_info = info;
netdev_ieee802154_rx_info_t *radio_info = info;
/* Read LQI and RSSI values from the RX fifo */
mrf24j40_rx_fifo_read(dev, phr + 1, &(radio_info->lqi), 1);
mrf24j40_rx_fifo_read(dev, phr + 2, &(radio_info->rssi), 1);
@ -179,7 +179,7 @@ static netopt_state_t _get_state(mrf24j40_t *dev)
return NETOPT_STATE_IDLE;
}
static int _get(netdev2_t *netdev, netopt_t opt, void *val, size_t max_len)
static int _get(netdev_t *netdev, netopt_t opt, void *val, size_t max_len)
{
mrf24j40_t *dev = (mrf24j40_t *) netdev;
@ -321,8 +321,8 @@ static int _get(netdev2_t *netdev, netopt_t opt, void *val, size_t max_len)
break;
default:
/* try netdev2 settings */
res = netdev2_ieee802154_get((netdev2_ieee802154_t *)netdev, opt,
/* try netdev settings */
res = netdev_ieee802154_get((netdev_ieee802154_t *)netdev, opt,
val, max_len);
}
return res;
@ -351,7 +351,7 @@ static int _set_state(mrf24j40_t *dev, netopt_state_t state)
return sizeof(netopt_state_t);
}
static int _set(netdev2_t *netdev, netopt_t opt, void *val, size_t len)
static int _set(netdev_t *netdev, netopt_t opt, void *val, size_t len)
{
mrf24j40_t *dev = (mrf24j40_t *) netdev;
int res = -ENOTSUP;
@ -367,7 +367,7 @@ static int _set(netdev2_t *netdev, netopt_t opt, void *val, size_t len)
}
else {
mrf24j40_set_addr_short(dev, *((uint16_t *)val));
/* don't set res to set netdev2_ieee802154_t::short_addr */
/* don't set res to set netdev_ieee802154_t::short_addr */
}
break;
@ -377,7 +377,7 @@ static int _set(netdev2_t *netdev, netopt_t opt, void *val, size_t len)
}
else {
mrf24j40_set_addr_long(dev, *((uint64_t *)val));
/* don't set res to set netdev2_ieee802154_t::long_addr */
/* don't set res to set netdev_ieee802154_t::long_addr */
}
break;
@ -387,7 +387,7 @@ static int _set(netdev2_t *netdev, netopt_t opt, void *val, size_t len)
}
else {
mrf24j40_set_pan(dev, *((uint16_t *)val));
/* don't set res to set netdev2_ieee802154_t::pan */
/* don't set res to set netdev_ieee802154_t::pan */
}
break;
@ -404,7 +404,7 @@ static int _set(netdev2_t *netdev, netopt_t opt, void *val, size_t len)
break;
}
mrf24j40_set_chan(dev, chan);
/* don't set res to set netdev2_ieee802154_t::chan */
/* don't set res to set netdev_ieee802154_t::chan */
}
break;
@ -445,9 +445,9 @@ static int _set(netdev2_t *netdev, netopt_t opt, void *val, size_t len)
break;
case NETOPT_AUTOACK:
mrf24j40_set_option(dev, NETDEV2_IEEE802154_ACK_REQ,
mrf24j40_set_option(dev, NETDEV_IEEE802154_ACK_REQ,
((bool *)val)[0]);
/* don't set res to set netdev2_ieee802154_t::flags */
/* don't set res to set netdev_ieee802154_t::flags */
break;
case NETOPT_PRELOADING:
@ -517,15 +517,15 @@ static int _set(netdev2_t *netdev, netopt_t opt, void *val, size_t len)
default:
break;
}
/* try netdev2 building flags */
/* try netdev building flags */
if (res == -ENOTSUP) {
res = netdev2_ieee802154_set((netdev2_ieee802154_t *)netdev, opt,
res = netdev_ieee802154_set((netdev_ieee802154_t *)netdev, opt,
val, len);
}
return res;
}
static void _isr(netdev2_t *netdev)
static void _isr(netdev_t *netdev)
{
mrf24j40_t *dev = (mrf24j40_t *) netdev;
/* update pending bits */
@ -542,17 +542,17 @@ static void _isr(netdev2_t *netdev)
if (txstat & MRF24J40_TXSTAT_TXNSTAT) {
/* TX_NOACK - CCAFAIL */
if (txstat & MRF24J40_TXSTAT_CCAFAIL) {
netdev->event_callback(netdev, NETDEV2_EVENT_TX_MEDIUM_BUSY);
netdev->event_callback(netdev, NETDEV_EVENT_TX_MEDIUM_BUSY);
DEBUG("[mrf24j40] TX_CHANNEL_ACCESS_FAILURE\n");
}
/* check max retries */
else if (txstat & MRF24J40_TXSTAT_MAX_FRAME_RETRIES) {
netdev->event_callback(netdev, NETDEV2_EVENT_TX_NOACK);
netdev->event_callback(netdev, NETDEV_EVENT_TX_NOACK);
DEBUG("[mrf24j40] TX NO_ACK\n");
}
}
else {
netdev->event_callback(netdev, NETDEV2_EVENT_TX_COMPLETE);
netdev->event_callback(netdev, NETDEV_EVENT_TX_COMPLETE);
}
}
#endif
@ -561,7 +561,7 @@ static void _isr(netdev2_t *netdev)
if (dev->pending & MRF24J40_TASK_RX_READY) {
DEBUG("[mrf24j40] EVT - RX_END\n");
if ((dev->netdev.flags & MRF24J40_OPT_TELL_RX_END)) {
netdev->event_callback(netdev, NETDEV2_EVENT_RX_COMPLETE);
netdev->event_callback(netdev, NETDEV_EVENT_RX_COMPLETE);
}
dev->pending &= ~(MRF24J40_TASK_RX_READY);
}

View File

@ -7,11 +7,11 @@
*/
/**
* @ingroup driver_netdev2_eth
* @ingroup driver_netdev_eth
* @{
*
* @file
* @brief Common code for netdev2 ethernet drivers
* @brief Common code for netdev ethernet drivers
*
* @author Kaspar Schleiser <kaspar@schleiser.de>
*
@ -21,14 +21,14 @@
#include <assert.h>
#include <errno.h>
#include "net/netdev2.h"
#include "net/netdev.h"
#include "net/eui64.h"
#include "net/ethernet.h"
#define ENABLE_DEBUG (0)
#include "debug.h"
static int _get_iid(netdev2_t *netdev, eui64_t *value, size_t max_len)
static int _get_iid(netdev_t *netdev, eui64_t *value, size_t max_len)
{
if (max_len < sizeof(eui64_t)) {
return -EOVERFLOW;
@ -41,7 +41,7 @@ static int _get_iid(netdev2_t *netdev, eui64_t *value, size_t max_len)
return sizeof(eui64_t);
}
int netdev2_eth_get(netdev2_t *dev, netopt_t opt, void *value, size_t max_len)
int netdev_eth_get(netdev_t *dev, netopt_t opt, void *value, size_t max_len)
{
int res = 0;
@ -49,7 +49,7 @@ int netdev2_eth_get(netdev2_t *dev, netopt_t opt, void *value, size_t max_len)
case NETOPT_DEVICE_TYPE:
{
uint16_t *tgt = (uint16_t *)value;
*tgt = NETDEV2_TYPE_ETHERNET;
*tgt = NETDEV_TYPE_ETHERNET;
res = 2;
break;
}
@ -98,7 +98,7 @@ int netdev2_eth_get(netdev2_t *dev, netopt_t opt, void *value, size_t max_len)
return res;
}
int netdev2_eth_set(netdev2_t *dev, netopt_t opt, void *value, size_t value_len)
int netdev_eth_set(netdev_t *dev, netopt_t opt, void *value, size_t value_len)
{
(void)dev;
(void)value;

View File

@ -20,21 +20,21 @@
#include "net/eui64.h"
#include "net/ieee802154.h"
#include "net/netdev2.h"
#include "net/netdev.h"
#include "net/netdev2/ieee802154.h"
#include "net/netdev/ieee802154.h"
#define ENABLE_DEBUG (0)
#include "debug.h"
static int _get_iid(netdev2_ieee802154_t *dev, eui64_t *value, size_t max_len)
static int _get_iid(netdev_ieee802154_t *dev, eui64_t *value, size_t max_len)
{
uint8_t *addr;
uint16_t addr_len;
assert(max_len >= sizeof(eui64_t));
if (dev->flags & NETDEV2_IEEE802154_SRC_MODE_LONG) {
if (dev->flags & NETDEV_IEEE802154_SRC_MODE_LONG) {
addr_len = IEEE802154_LONG_ADDRESS_LEN;
addr = dev->long_addr;
}
@ -47,7 +47,7 @@ static int _get_iid(netdev2_ieee802154_t *dev, eui64_t *value, size_t max_len)
return sizeof(eui64_t);
}
int netdev2_ieee802154_get(netdev2_ieee802154_t *dev, netopt_t opt, void *value,
int netdev_ieee802154_get(netdev_ieee802154_t *dev, netopt_t opt, void *value,
size_t max_len)
{
int res = -ENOTSUP;
@ -66,7 +66,7 @@ int netdev2_ieee802154_get(netdev2_ieee802154_t *dev, netopt_t opt, void *value,
case NETOPT_ADDR_LEN:
case NETOPT_SRC_LEN:
assert(max_len == sizeof(uint16_t));
if (dev->flags & NETDEV2_IEEE802154_SRC_MODE_LONG) {
if (dev->flags & NETDEV_IEEE802154_SRC_MODE_LONG) {
*((uint16_t *)value) = IEEE802154_LONG_ADDRESS_LEN;
}
else {
@ -86,7 +86,7 @@ int netdev2_ieee802154_get(netdev2_ieee802154_t *dev, netopt_t opt, void *value,
break;
case NETOPT_ACK_REQ:
assert(max_len == sizeof(netopt_enable_t));
if (dev->flags & NETDEV2_IEEE802154_ACK_REQ) {
if (dev->flags & NETDEV_IEEE802154_ACK_REQ) {
*((netopt_enable_t *)value) = NETOPT_ENABLE;
}
else {
@ -96,7 +96,7 @@ int netdev2_ieee802154_get(netdev2_ieee802154_t *dev, netopt_t opt, void *value,
break;
case NETOPT_RAWMODE:
assert(max_len == sizeof(netopt_enable_t));
if (dev->flags & NETDEV2_IEEE802154_RAW) {
if (dev->flags & NETDEV_IEEE802154_RAW) {
*((netopt_enable_t *)value) = NETOPT_ENABLE;
}
else {
@ -113,7 +113,7 @@ int netdev2_ieee802154_get(netdev2_ieee802154_t *dev, netopt_t opt, void *value,
#endif
case NETOPT_DEVICE_TYPE:
assert(max_len == sizeof(uint16_t));
*((uint16_t *)value) = NETDEV2_TYPE_IEEE802154;
*((uint16_t *)value) = NETDEV_TYPE_IEEE802154;
res = sizeof(uint16_t);
break;
case NETOPT_IPV6_IID:
@ -132,7 +132,7 @@ int netdev2_ieee802154_get(netdev2_ieee802154_t *dev, netopt_t opt, void *value,
return res;
}
int netdev2_ieee802154_set(netdev2_ieee802154_t *dev, netopt_t opt, void *value,
int netdev_ieee802154_set(netdev_ieee802154_t *dev, netopt_t opt, void *value,
size_t len)
{
int res = -ENOTSUP;
@ -167,10 +167,10 @@ int netdev2_ieee802154_set(netdev2_ieee802154_t *dev, netopt_t opt, void *value,
assert(len == sizeof(uint16_t));
switch ((*(uint16_t *)value)) {
case IEEE802154_SHORT_ADDRESS_LEN:
dev->flags &= ~NETDEV2_IEEE802154_SRC_MODE_LONG;
dev->flags &= ~NETDEV_IEEE802154_SRC_MODE_LONG;
break;
case IEEE802154_LONG_ADDRESS_LEN:
dev->flags |= NETDEV2_IEEE802154_SRC_MODE_LONG;
dev->flags |= NETDEV_IEEE802154_SRC_MODE_LONG;
break;
default:
res = -EAFNOSUPPORT;
@ -185,19 +185,19 @@ int netdev2_ieee802154_set(netdev2_ieee802154_t *dev, netopt_t opt, void *value,
break;
case NETOPT_ACK_REQ:
if ((*(bool *)value)) {
dev->flags |= NETDEV2_IEEE802154_ACK_REQ;
dev->flags |= NETDEV_IEEE802154_ACK_REQ;
}
else {
dev->flags &= ~NETDEV2_IEEE802154_ACK_REQ;
dev->flags &= ~NETDEV_IEEE802154_ACK_REQ;
}
res = sizeof(uint16_t);
break;
case NETOPT_RAWMODE:
if ((*(bool *)value)) {
dev->flags |= NETDEV2_IEEE802154_RAW;
dev->flags |= NETDEV_IEEE802154_RAW;
}
else {
dev->flags &= ~NETDEV2_IEEE802154_RAW;
dev->flags &= ~NETDEV_IEEE802154_RAW;
}
res = sizeof(uint16_t);
break;

View File

@ -26,7 +26,7 @@
#include "assert.h"
#include "net/ethernet.h"
#include "net/netdev2/eth.h"
#include "net/netdev/eth.h"
#include "w5100.h"
#include "w5100_regs.h"
@ -43,7 +43,7 @@
#define S0_TX_BASE (0x4000)
#define S0_RX_BASE (0x6000)
static const netdev2_driver_t netdev2_driver_w5100;
static const netdev_driver_t netdev_driver_w5100;
static inline void send_addr(w5100_t *dev, uint16_t addr)
{
@ -107,14 +107,14 @@ static void extint(void *arg)
w5100_t *dev = (w5100_t *)arg;
if (dev->nd.event_callback) {
dev->nd.event_callback(&dev->nd, NETDEV2_EVENT_ISR);
dev->nd.event_callback(&dev->nd, NETDEV_EVENT_ISR);
}
}
void w5100_setup(w5100_t *dev, const w5100_params_t *params)
{
/* initialize netdev structure */
dev->nd.driver = &netdev2_driver_w5100;
dev->nd.driver = &netdev_driver_w5100;
dev->nd.event_callback = NULL;
dev->nd.context = dev;
@ -126,7 +126,7 @@ void w5100_setup(w5100_t *dev, const w5100_params_t *params)
gpio_init_int(dev->p.evt, GPIO_IN, GPIO_FALLING, extint, dev);
}
static int init(netdev2_t *netdev)
static int init(netdev_t *netdev)
{
w5100_t *dev = (w5100_t *)netdev;
uint8_t tmp;
@ -194,7 +194,7 @@ static uint16_t tx_upload(w5100_t *dev, uint16_t start, void *data, size_t len)
}
}
static int send(netdev2_t *netdev, const struct iovec *vector, unsigned count)
static int send(netdev_t *netdev, const struct iovec *vector, unsigned count)
{
w5100_t *dev = (w5100_t *)netdev;
int sum = 0;
@ -230,7 +230,7 @@ static int send(netdev2_t *netdev, const struct iovec *vector, unsigned count)
return sum;
}
static int recv(netdev2_t *netdev, void *buf, size_t len, void *info)
static int recv(netdev_t *netdev, void *buf, size_t len, void *info)
{
(void)info;
w5100_t *dev = (w5100_t *)netdev;
@ -279,7 +279,7 @@ static int recv(netdev2_t *netdev, void *buf, size_t len, void *info)
return n;
}
static void isr(netdev2_t *netdev)
static void isr(netdev_t *netdev)
{
uint8_t ir;
w5100_t *dev = (w5100_t *)netdev;
@ -290,12 +290,12 @@ static void isr(netdev2_t *netdev)
ir = rreg(dev, S0_IR);
spi_release(dev->p.spi);
while (ir & IR_RECV) {
DEBUG("[w5100] netdev2 RX complete\n");
netdev->event_callback(netdev, NETDEV2_EVENT_RX_COMPLETE);
DEBUG("[w5100] netdev RX complete\n");
netdev->event_callback(netdev, NETDEV_EVENT_RX_COMPLETE);
}
}
static int get(netdev2_t *netdev, netopt_t opt, void *value, size_t max_len)
static int get(netdev_t *netdev, netopt_t opt, void *value, size_t max_len)
{
w5100_t *dev = (w5100_t *)netdev;
int res = 0;
@ -309,18 +309,18 @@ static int get(netdev2_t *netdev, netopt_t opt, void *value, size_t max_len)
res = ETHERNET_ADDR_LEN;
break;
default:
res = netdev2_eth_get(netdev, opt, value, max_len);
res = netdev_eth_get(netdev, opt, value, max_len);
break;
}
return res;
}
static const netdev2_driver_t netdev2_driver_w5100 = {
static const netdev_driver_t netdev_driver_w5100 = {
.send = send,
.recv = recv,
.init = init,
.isr = isr,
.get = get,
.set = netdev2_eth_set,
.set = netdev_eth_set,
};

View File

@ -27,7 +27,7 @@
#include "assert.h"
#include "xtimer.h"
#include "net/eui64.h"
#include "net/netdev2.h"
#include "net/netdev.h"
#include "net/ieee802154.h"
#define ENABLE_DEBUG (0)
@ -231,7 +231,7 @@ static void _rx_cb(void *arg, uint8_t c)
if (dev->rx_count == dev->rx_limit) {
/* packet is complete */
if (dev->event_callback) {
dev->event_callback((netdev2_t *)dev, NETDEV2_EVENT_ISR);
dev->event_callback((netdev_t *)dev, NETDEV_EVENT_ISR);
}
dev->int_state = XBEE_INT_STATE_IDLE;
}
@ -566,7 +566,7 @@ int xbee_parse_hdr(xbee_t *dev, const uint8_t *xhdr, xbee_l2hdr_t *l2hdr)
return (int)(alen + 3);
}
int xbee_init(netdev2_t *dev)
int xbee_init(netdev_t *dev)
{
uint8_t tmp[2];
xbee_t *xbee = (xbee_t *)dev;
@ -631,7 +631,7 @@ int xbee_init(netdev2_t *dev)
return 0;
}
static int xbee_send(netdev2_t *dev, const struct iovec *vector, unsigned count)
static int xbee_send(netdev_t *dev, const struct iovec *vector, unsigned count)
{
xbee_t *xbee = (xbee_t *)dev;
size_t size;
@ -668,7 +668,7 @@ static int xbee_send(netdev2_t *dev, const struct iovec *vector, unsigned count)
return (int)size;
}
static int xbee_recv(netdev2_t *dev, void *buf, size_t len, void *info)
static int xbee_recv(netdev_t *dev, void *buf, size_t len, void *info)
{
(void)info;
size_t size;
@ -703,7 +703,7 @@ static int xbee_recv(netdev2_t *dev, void *buf, size_t len, void *info)
return (int)size;
}
static void xbee_isr(netdev2_t *netdev)
static void xbee_isr(netdev_t *netdev)
{
xbee_t *dev = (xbee_t *)netdev;
@ -715,12 +715,12 @@ static void xbee_isr(netdev2_t *netdev)
}
else {
DEBUG("[xbee] isr: data available, waiting for read\n");
dev->event_callback(netdev, NETDEV2_EVENT_RX_COMPLETE);
dev->event_callback(netdev, NETDEV_EVENT_RX_COMPLETE);
}
}
}
static int xbee_get(netdev2_t *ndev, netopt_t opt, void *value, size_t max_len)
static int xbee_get(netdev_t *ndev, netopt_t opt, void *value, size_t max_len)
{
xbee_t *dev = (xbee_t *)ndev;
assert(dev);
@ -774,7 +774,7 @@ static int xbee_get(netdev2_t *ndev, netopt_t opt, void *value, size_t max_len)
}
}
static int xbee_set(netdev2_t *ndev, netopt_t opt, void *value, size_t len)
static int xbee_set(netdev_t *ndev, netopt_t opt, void *value, size_t len)
{
xbee_t *dev = (xbee_t *)ndev;
assert(dev);
@ -803,7 +803,7 @@ static int xbee_set(netdev2_t *ndev, netopt_t opt, void *value, size_t len)
/*
* The drivers netdev interface
*/
const netdev2_driver_t xbee_driver = {
const netdev_driver_t xbee_driver = {
.send = xbee_send,
.recv = xbee_recv,
.init = xbee_init,

View File

@ -21,7 +21,7 @@ BOARD_BLACKLIST += mips-malta # No UART available.
# UART, but not on native, as native has a tap interface towards the host.
ifeq (,$(filter native,$(BOARD)))
GNRC_NETIF_NUMOF := 2
USEMODULE += ethos gnrc_netdev2
USEMODULE += ethos gnrc_netdev
# ethos baudrate can be configured from make command
ETHOS_BAUDRATE ?= 115200

View File

@ -101,7 +101,7 @@ has the following:
```make
ifeq (,$(filter native,$(BOARD)))
GNRC_NETIF_NUMOF := 2
USEMODULE += ethos gnrc_netdev2
USEMODULE += ethos gnrc_netdev
CFLAGS += '-DETHOS_UART=UART_DEV(0)' -DETHOS_BAUDRATE=115200 -DUSE_ETHOS_FOR_STDIO
FEATURES_REQUIRED += periph_uart
endif

View File

@ -15,7 +15,7 @@ ifneq (,$(filter emb6,$(USEMODULE)))
USEMODULE += emb6_ipv6_multicast
USEMODULE += emb6_llsec
USEMODULE += emb6_mac
USEMODULE += emb6_netdev2
USEMODULE += emb6_netdev
USEMODULE += emb6_rpl
USEMODULE += emb6_sicslowpan
USEMODULE += emb6_utils

View File

@ -46,8 +46,8 @@ ifneq (,$(filter emb6_mac,$(USEMODULE)))
INCLUDES += -I$(EMB6_DIR)/emb6/inc/mac
endif
ifneq (,$(filter emb6_netdev2,$(USEMODULE)))
DIRS += $(EMB6_CONTRIB)/netdev2
ifneq (,$(filter emb6_netdev,$(USEMODULE)))
DIRS += $(EMB6_CONTRIB)/netdev
endif
ifneq (,$(filter emb6_rpl,$(USEMODULE)))

View File

@ -13,7 +13,7 @@
* @author Martine Lenders <mlenders@inf.fu-berlin.de>
*/
#include "emb6/netdev2.h"
#include "emb6/netdev.h"
#include "etimer.h"
#include "board_conf.h"
@ -24,7 +24,7 @@
uint8_t board_conf(s_ns_t *ps_nStack)
{
if (ps_nStack != NULL) {
ps_nStack->inif = &emb6_netdev2_driver;
ps_nStack->inif = &emb6_netdev_driver;
etimer_init();
return ps_nStack->inif->init(ps_nStack);
}

View File

@ -1,3 +1,3 @@
MODULE = emb6_netdev2
MODULE = emb6_netdev
include $(RIOTBASE)/Makefile.base

View File

@ -18,7 +18,7 @@
#include <sys/uio.h>
#include "msg.h"
#include "net/netdev2.h"
#include "net/netdev.h"
#include "evproc.h"
#include "emb6.h"
@ -30,42 +30,42 @@
extern uip_lladdr_t uip_lladdr;
static netdev2_t *_dev = NULL;
static netdev_t *_dev = NULL;
static s_nsLowMac_t *_lowmac = NULL;
static int8_t _rssi_base_value = -100;
static uint8_t _last_rssi;
static int8_t _netdev2_init(s_ns_t *p_ns);
static int8_t _netdev2_send(const void *pr_payload, uint8_t c_len);
static int8_t _netdev2_on(void);
static int8_t _netdev2_off(void);
static void _netdev2_set_txpower(int8_t power);
static int8_t _netdev2_get_txpower(void);
static void _netdev2_set_sensitivity(int8_t sens);
static int8_t _netdev2_get_sensitivity(void);
static int8_t _netdev2_get_rssi(void);
static void _netdev2_set_promisc(uint8_t c_on_off);
static int8_t _netdev_init(s_ns_t *p_ns);
static int8_t _netdev_send(const void *pr_payload, uint8_t c_len);
static int8_t _netdev_on(void);
static int8_t _netdev_off(void);
static void _netdev_set_txpower(int8_t power);
static int8_t _netdev_get_txpower(void);
static void _netdev_set_sensitivity(int8_t sens);
static int8_t _netdev_get_sensitivity(void);
static int8_t _netdev_get_rssi(void);
static void _netdev_set_promisc(uint8_t c_on_off);
const s_nsIf_t emb6_netdev2_driver = {
.name = "netdev2",
.init = &_netdev2_init,
.send = &_netdev2_send,
.on = &_netdev2_on,
.off = &_netdev2_off,
.set_txpower = &_netdev2_set_txpower,
.get_txpower = &_netdev2_get_txpower,
.set_sensitivity = &_netdev2_set_sensitivity,
.get_sensitivity = &_netdev2_get_sensitivity,
.get_rssi = &_netdev2_get_rssi,
const s_nsIf_t emb6_netdev_driver = {
.name = "netdev",
.init = &_netdev_init,
.send = &_netdev_send,
.on = &_netdev_on,
.off = &_netdev_off,
.set_txpower = &_netdev_set_txpower,
.get_txpower = &_netdev_get_txpower,
.set_sensitivity = &_netdev_set_sensitivity,
.get_sensitivity = &_netdev_get_sensitivity,
.get_rssi = &_netdev_get_rssi,
.ant_div = NULL,
.ant_rf_switch = NULL,
.set_promisc = &_netdev2_set_promisc,
.set_promisc = &_netdev_set_promisc,
};
static void _get_recv_pkt(void)
{
char *dataptr;
struct netdev2_radio_rx_info rx_info;
struct netdev_radio_rx_info rx_info;
int8_t len;
packetbuf_clear();
@ -80,17 +80,17 @@ static void _get_recv_pkt(void)
}
}
static void _event_cb(netdev2_t *dev, netdev2_event_t event)
static void _event_cb(netdev_t *dev, netdev_event_t event)
{
if (event == NETDEV2_EVENT_ISR) {
if (event == NETDEV_EVENT_ISR) {
/* EVENT_TYPE_PCK_LL is supposed to be used by drivers, so use it
* (though NETDEV2_EVENT_ISR technically doesn't only signify
* (though NETDEV_EVENT_ISR technically doesn't only signify
* incoming packets) */
evproc_putEvent(E_EVPROC_HEAD, EVENT_TYPE_PCK_LL, NULL);
}
else {
switch (event) {
case NETDEV2_EVENT_RX_COMPLETE: {
case NETDEV_EVENT_RX_COMPLETE: {
_get_recv_pkt();
}
break;
@ -100,7 +100,7 @@ static void _event_cb(netdev2_t *dev, netdev2_event_t event)
}
}
static void _emb6_netdev2_callback(c_event_t c_event, p_data_t p_data)
static void _emb6_netdev_callback(c_event_t c_event, p_data_t p_data)
{
(void)p_data;
if (c_event == EVENT_TYPE_PCK_LL) {
@ -108,7 +108,7 @@ static void _emb6_netdev2_callback(c_event_t c_event, p_data_t p_data)
}
}
int emb6_netdev2_setup(netdev2_t *dev)
int emb6_netdev_setup(netdev_t *dev)
{
if (_dev == NULL) {
_dev = dev;
@ -117,7 +117,7 @@ int emb6_netdev2_setup(netdev2_t *dev)
return -1;
}
static int8_t _netdev2_init(s_ns_t *p_ns)
static int8_t _netdev_init(s_ns_t *p_ns)
{
if ((_dev != NULL) && (p_ns != NULL) && (p_ns->lmac != NULL)) {
_dev->event_callback = _event_cb;
@ -129,13 +129,13 @@ static int8_t _netdev2_init(s_ns_t *p_ns)
sizeof(mac_phy_config.pan_id));
linkaddr_set_node_addr((linkaddr_t *)&uip_lladdr);
_lowmac = p_ns->lmac;
evproc_regCallback(EVENT_TYPE_PCK_LL, _emb6_netdev2_callback);
evproc_regCallback(EVENT_TYPE_PCK_LL, _emb6_netdev_callback);
return 1;
}
return 0;
}
static int8_t _netdev2_send(const void *pr_payload, uint8_t c_len)
static int8_t _netdev_send(const void *pr_payload, uint8_t c_len)
{
if (_dev != NULL) {
const struct iovec vector = {
@ -153,26 +153,26 @@ static int8_t _netdev2_send(const void *pr_payload, uint8_t c_len)
return RADIO_TX_ERR;
}
static int8_t _netdev2_on(void)
static int8_t _netdev_on(void)
{
/* TODO: turn netdev2 on */
/* TODO: turn netdev on */
return 1;
}
static int8_t _netdev2_off(void)
static int8_t _netdev_off(void)
{
/* TODO: turn netdev2 off */
/* TODO: turn netdev off */
return 1;
}
static void _netdev2_set_txpower(int8_t power)
static void _netdev_set_txpower(int8_t power)
{
int16_t pwr = power;
_dev->driver->set(_dev, NETOPT_TX_POWER, &pwr, sizeof(pwr));
}
static int8_t _netdev2_get_txpower(void)
static int8_t _netdev_get_txpower(void)
{
int16_t power = 0;
@ -180,23 +180,23 @@ static int8_t _netdev2_get_txpower(void)
return (int8_t)power;
}
static void _netdev2_set_sensitivity(int8_t sens)
static void _netdev_set_sensitivity(int8_t sens)
{
/* TODO: set sensitivity */
}
static int8_t _netdev2_get_sensitivity(void)
static int8_t _netdev_get_sensitivity(void)
{
/* TODO: get sensitivity */
return 0;
}
static int8_t _netdev2_get_rssi(void)
static int8_t _netdev_get_rssi(void)
{
return (int8_t)(_rssi_base_value + 1.03 * _last_rssi);
}
static void _netdev2_set_promisc(uint8_t c_on_off)
static void _netdev_set_promisc(uint8_t c_on_off)
{
netopt_enable_t en = (c_on_off) ? NETOPT_ENABLE : NETOPT_DISABLE;

View File

@ -92,7 +92,7 @@ void hal_ledOff(uint16_t ui_led)
uint8_t hal_extIntInit(en_targetExtInt_t e_extInt, pfn_intCallb_t pfn_intCallback)
{
/* RIOT does this in netdev2 initialization so nothing to do here. */
/* RIOT does this in netdev initialization so nothing to do here. */
return 0;
}

View File

@ -7,7 +7,7 @@
*/
/**
* @defgroup pkgemb6_netdev2 netdev2 wrapper for emb6
* @defgroup pkg_emb6_netdev netdev wrapper for emb6
* @ingroup pkg_emb6
* @brief
* @{
@ -17,10 +17,10 @@
*
* @author Martine Lenders <mlenders@inf.fu-berlin.de>
*/
#ifndef EMB6_NETDEV2_H
#define EMB6_NETDEV2_H
#ifndef EMB6_NETDEV_H
#define EMB6_NETDEV_H
#include "net/netdev2.h"
#include "net/netdev.h"
#include "emb6.h"
@ -36,7 +36,7 @@ extern "C" {
* This variable is used by @ref board_conf() to set the interface for the
* stack.
*/
extern const s_nsIf_t emb6_netdev2_driver;
extern const s_nsIf_t emb6_netdev_driver;
/**
* @brief Setup a network device as the emb6 interface.
@ -46,11 +46,11 @@ extern const s_nsIf_t emb6_netdev2_driver;
* @return 0 on success.
* @return <= 0 on error.
*/
int emb6_netdev2_setup(netdev2_t *dev);
int emb6_netdev_setup(netdev_t *dev);
#ifdef __cplusplus
}
#endif
#endif /* EMB6_NETDEV2_H */
#endif /* EMB6_NETDEV_H */
/** @} */

View File

@ -13,8 +13,8 @@ endif
ifneq (,$(filter lwip_contrib,$(USEMODULE)))
DIRS += $(RIOTBASE)/pkg/lwip/contrib
endif
ifneq (,$(filter lwip_netdev2,$(USEMODULE)))
DIRS += $(RIOTBASE)/pkg/lwip/contrib/netdev2
ifneq (,$(filter lwip_netdev,$(USEMODULE)))
DIRS += $(RIOTBASE)/pkg/lwip/contrib/netdev
endif
ifneq (,$(filter lwip_sock,$(USEMODULE)))
ifneq (,$(filter lwip_ipv6,$(USEMODULE)))

View File

@ -14,13 +14,13 @@
*/
#include "lwip/tcpip.h"
#include "lwip/netif/netdev2.h"
#include "lwip/netif/netdev.h"
#include "lwip/netif.h"
#include "netif/lowpan6.h"
#ifdef MODULE_NETDEV2_TAP
#include "netdev2_tap.h"
#include "netdev2_tap_params.h"
#ifdef MODULE_NETDEV_TAP
#include "netdev_tap.h"
#include "netdev_tap_params.h"
#endif
#ifdef MODULE_AT86RF2XX
@ -38,8 +38,8 @@
#define ENABLE_DEBUG (0)
#include "debug.h"
#ifdef MODULE_NETDEV2_TAP
#define LWIP_NETIF_NUMOF (NETDEV2_TAP_MAX)
#ifdef MODULE_NETDEV_TAP
#define LWIP_NETIF_NUMOF (NETDEV_TAP_MAX)
#endif
#ifdef MODULE_AT86RF2XX /* is mutual exclusive with above ifdef */
@ -54,8 +54,8 @@
static struct netif netif[LWIP_NETIF_NUMOF];
#endif
#ifdef MODULE_NETDEV2_TAP
static netdev2_tap_t netdev2_taps[LWIP_NETIF_NUMOF];
#ifdef MODULE_NETDEV_TAP
static netdev_tap_t netdev_taps[LWIP_NETIF_NUMOF];
#endif
#ifdef MODULE_AT86RF2XX
@ -68,21 +68,21 @@ static mrf24j40_t mrf24j40_devs[LWIP_NETIF_NUMOF];
void lwip_bootstrap(void)
{
/* TODO: do for every eligable netdev2 */
/* TODO: do for every eligable netdev */
#ifdef LWIP_NETIF_NUMOF
#ifdef MODULE_NETDEV2_TAP
#ifdef MODULE_NETDEV_TAP
for (int i = 0; i < LWIP_NETIF_NUMOF; i++) {
netdev2_tap_setup(&netdev2_taps[i], &netdev2_tap_params[i]);
if (netif_add(&netif[i], &netdev2_taps[i], lwip_netdev2_init,
netdev_tap_setup(&netdev_taps[i], &netdev_tap_params[i]);
if (netif_add(&netif[i], &netdev_taps[i], lwip_netdev_init,
tcpip_input) == NULL) {
DEBUG("Could not add netdev2_tap device\n");
DEBUG("Could not add netdev_tap device\n");
return;
}
}
#elif defined(MODULE_MRF24J40)
for (int i = 0; i < LWIP_NETIF_NUMOF; i++) {
mrf24j40_setup(&mrf24j40_devs[i], &mrf24j40_params[i]);
if (netif_add(&netif[i], &mrf24j40_devs[i], lwip_netdev2_init,
if (netif_add(&netif[i], &mrf24j40_devs[i], lwip_netdev_init,
tcpip_6lowpan_input) == NULL) {
DEBUG("Could not add mrf24j40 device\n");
return;
@ -91,7 +91,7 @@ void lwip_bootstrap(void)
#elif defined(MODULE_AT86RF2XX)
for (int i = 0; i < LWIP_NETIF_NUMOF; i++) {
at86rf2xx_setup(&at86rf2xx_devs[i], &at86rf2xx_params[i]);
if (netif_add(&netif[i], &at86rf2xx_devs[i], lwip_netdev2_init,
if (netif_add(&netif[i], &at86rf2xx_devs[i], lwip_netdev_init,
tcpip_6lowpan_input) == NULL) {
DEBUG("Could not add at86rf2xx device\n");
return;
@ -99,7 +99,7 @@ void lwip_bootstrap(void)
}
#endif
if (netif[0].state != NULL) {
/* state is set to a netdev2_t in the netif_add() functions above */
/* state is set to a netdev_t in the netif_add() functions above */
netif_set_default(&netif[0]);
}
#endif

View File

@ -1,3 +1,3 @@
MODULE = gnrc_netdev2
MODULE := lwip_netdev
include $(RIOTBASE)/Makefile.base

View File

@ -20,7 +20,7 @@
#include "lwip/err.h"
#include "lwip/ethip6.h"
#include "lwip/netif.h"
#include "lwip/netif/netdev2.h"
#include "lwip/netif/netdev.h"
#include "lwip/opt.h"
#include "lwip/pbuf.h"
#include "netif/etharp.h"
@ -29,7 +29,7 @@
#include "net/eui64.h"
#include "net/ieee802154.h"
#include "net/ipv6/addr.h"
#include "net/netdev2.h"
#include "net/netdev.h"
#include "net/netopt.h"
#include "utlist.h"
#include "thread.h"
@ -37,49 +37,49 @@
#define ENABLE_DEBUG (0)
#include "debug.h"
#define LWIP_NETDEV2_NAME "lwip_netdev2_mux"
#define LWIP_NETDEV2_PRIO (THREAD_PRIORITY_MAIN - 4)
#define LWIP_NETDEV2_STACKSIZE (THREAD_STACKSIZE_DEFAULT)
#define LWIP_NETDEV2_QUEUE_LEN (8)
#define LWIP_NETDEV2_MSG_TYPE_EVENT 0x1235
#define LWIP_NETDEV_NAME "lwip_netdev_mux"
#define LWIP_NETDEV_PRIO (THREAD_PRIORITY_MAIN - 4)
#define LWIP_NETDEV_STACKSIZE (THREAD_STACKSIZE_DEFAULT)
#define LWIP_NETDEV_QUEUE_LEN (8)
#define LWIP_NETDEV_MSG_TYPE_EVENT 0x1235
#define ETHERNET_IFNAME1 'E'
#define ETHERNET_IFNAME2 'T'
static kernel_pid_t _pid = KERNEL_PID_UNDEF;
static char _stack[LWIP_NETDEV2_STACKSIZE];
static msg_t _queue[LWIP_NETDEV2_QUEUE_LEN];
static char _tmp_buf[LWIP_NETDEV2_BUFLEN];
static char _stack[LWIP_NETDEV_STACKSIZE];
static msg_t _queue[LWIP_NETDEV_QUEUE_LEN];
static char _tmp_buf[LWIP_NETDEV_BUFLEN];
#ifdef MODULE_NETDEV2_ETH
#ifdef MODULE_NETDEV_ETH
static err_t _eth_link_output(struct netif *netif, struct pbuf *p);
#endif
#ifdef MODULE_LWIP_SIXLOWPAN
static err_t _ieee802154_link_output(struct netif *netif, struct pbuf *p);
#endif
static void _event_cb(netdev2_t *dev, netdev2_event_t event);
static void _event_cb(netdev_t *dev, netdev_event_t event);
static void *_event_loop(void *arg);
err_t lwip_netdev2_init(struct netif *netif)
err_t lwip_netdev_init(struct netif *netif)
{
LWIP_ASSERT("netif != NULL", (netif != NULL));
LWIP_ASSERT("netif->state != NULL", (netif->state != NULL));
netdev2_t *netdev;
netdev_t *netdev;
uint16_t dev_type;
err_t res = ERR_OK;
/* start multiplexing thread (only one needed) */
if (_pid <= KERNEL_PID_UNDEF) {
_pid = thread_create(_stack, LWIP_NETDEV2_STACKSIZE, LWIP_NETDEV2_PRIO,
_pid = thread_create(_stack, LWIP_NETDEV_STACKSIZE, LWIP_NETDEV_PRIO,
THREAD_CREATE_STACKTEST, _event_loop, netif,
LWIP_NETDEV2_NAME);
LWIP_NETDEV_NAME);
if (_pid <= 0) {
return ERR_IF;
}
}
/* initialize netdev and netif */
netdev = (netdev2_t *)netif->state;
netdev = (netdev_t *)netif->state;
netdev->driver->init(netdev);
netdev->event_callback = _event_cb;
if (netdev->driver->get(netdev, NETOPT_DEVICE_TYPE, &dev_type,
@ -90,10 +90,10 @@ err_t lwip_netdev2_init(struct netif *netif)
netif->hostname = "riot";
#endif /* LWIP_NETIF_HOSTNAME */
/* XXX: for now assume its Ethernet, since netdev2 is implemented only by ethernet drivers */
/* XXX: for now assume its Ethernet, since netdev is implemented only by ethernet drivers */
switch (dev_type) {
#ifdef MODULE_NETDEV2_ETH
case NETDEV2_TYPE_ETHERNET:
#ifdef MODULE_NETDEV_ETH
case NETDEV_TYPE_ETHERNET:
netif->name[0] = ETHERNET_IFNAME1;
netif->name[1] = ETHERNET_IFNAME2;
netif->hwaddr_len = (u8_t)netdev->driver->get(netdev, NETOPT_ADDRESS, netif->hwaddr,
@ -101,7 +101,7 @@ err_t lwip_netdev2_init(struct netif *netif)
if (netif->hwaddr_len > sizeof(netif->hwaddr)) {
return ERR_IF;
}
/* TODO: get from driver (currently not in netdev2_eth) */
/* TODO: get from driver (currently not in netdev_eth) */
netif->mtu = ETHERNET_DATA_LEN;
netif->linkoutput = _eth_link_output;
#if LWIP_IPV4
@ -117,7 +117,7 @@ err_t lwip_netdev2_init(struct netif *netif)
break;
#endif
#ifdef MODULE_LWIP_SIXLOWPAN
case NETDEV2_TYPE_IEEE802154:
case NETDEV_TYPE_IEEE802154:
{
u16_t val;
ipv6_addr_t *addr;
@ -174,10 +174,10 @@ err_t lwip_netdev2_init(struct netif *netif)
return res;
}
#ifdef MODULE_NETDEV2_ETH
#ifdef MODULE_NETDEV_ETH
static err_t _eth_link_output(struct netif *netif, struct pbuf *p)
{
netdev2_t *netdev = (netdev2_t *)netif->state;
netdev_t *netdev = (netdev_t *)netif->state;
struct pbuf *q;
unsigned int count = 0;
@ -201,7 +201,7 @@ static err_t _eth_link_output(struct netif *netif, struct pbuf *p)
static err_t _ieee802154_link_output(struct netif *netif, struct pbuf *p)
{
LWIP_ASSERT("p->next == NULL", p->next == NULL);
netdev2_t *netdev = (netdev2_t *)netif->state;
netdev_t *netdev = (netdev_t *)netif->state;
struct iovec pkt = {
.iov_base = p->payload,
.iov_len = (p->len - IEEE802154_FCS_LEN), /* FCS is written by driver */
@ -211,7 +211,7 @@ static err_t _ieee802154_link_output(struct netif *netif, struct pbuf *p)
}
#endif
static struct pbuf *_get_recv_pkt(netdev2_t *dev)
static struct pbuf *_get_recv_pkt(netdev_t *dev)
{
int len = dev->driver->recv(dev, _tmp_buf, sizeof(_tmp_buf), NULL);
@ -219,37 +219,37 @@ static struct pbuf *_get_recv_pkt(netdev2_t *dev)
struct pbuf *p = pbuf_alloc(PBUF_RAW, (u16_t)len, PBUF_POOL);
if (p == NULL) {
DEBUG("lwip_netdev2: can not allocate in pbuf\n");
DEBUG("lwip_netdev: can not allocate in pbuf\n");
return NULL;
}
pbuf_take(p, _tmp_buf, len);
return p;
}
static void _event_cb(netdev2_t *dev, netdev2_event_t event)
static void _event_cb(netdev_t *dev, netdev_event_t event)
{
if (event == NETDEV2_EVENT_ISR) {
if (event == NETDEV_EVENT_ISR) {
assert(_pid != KERNEL_PID_UNDEF);
msg_t msg;
msg.type = LWIP_NETDEV2_MSG_TYPE_EVENT;
msg.type = LWIP_NETDEV_MSG_TYPE_EVENT;
msg.content.ptr = dev;
if (msg_send(&msg, _pid) <= 0) {
DEBUG("lwip_netdev2: possibly lost interrupt.\n");
DEBUG("lwip_netdev: possibly lost interrupt.\n");
}
}
else {
struct netif *netif = dev->context;
switch (event) {
case NETDEV2_EVENT_RX_COMPLETE: {
case NETDEV_EVENT_RX_COMPLETE: {
struct pbuf *p = _get_recv_pkt(dev);
if (p == NULL) {
DEBUG("lwip_netdev2: error receiving packet\n");
DEBUG("lwip_netdev: error receiving packet\n");
return;
}
if (netif->input(p, netif) != ERR_OK) {
DEBUG("lwip_netdev2: error inputing packet\n");
DEBUG("lwip_netdev: error inputing packet\n");
return;
}
}
@ -263,12 +263,12 @@ static void _event_cb(netdev2_t *dev, netdev2_event_t event)
static void *_event_loop(void *arg)
{
(void)arg;
msg_init_queue(_queue, LWIP_NETDEV2_QUEUE_LEN);
msg_init_queue(_queue, LWIP_NETDEV_QUEUE_LEN);
while (1) {
msg_t msg;
msg_receive(&msg);
if (msg.type == LWIP_NETDEV2_MSG_TYPE_EVENT) {
netdev2_t *dev = msg.content.ptr;
if (msg.type == LWIP_NETDEV_MSG_TYPE_EVENT) {
netdev_t *dev = msg.content.ptr;
dev->driver->isr(dev);
}
}

View File

@ -7,21 +7,21 @@
*/
/**
* @defgroup pkg_lwip_netdev2 lwIP netdev2 adapter
* @defgroup pkg_lwip_netdev lwIP netdev adapter
* @ingroup pkg_lwip
* @brief netdev2 adapter for lwIP
* @brief netdev adapter for lwIP
* @{
*
* @file
* @brief lwIP netdev2 adapter definitions
* @brief lwIP netdev adapter definitions
*
* @author Martine Lenders <mlenders@inf.fu-berlin.de>
*/
#ifndef LWIP_NETDEV2_H
#define LWIP_NETDEV2_H
#ifndef LWIP_NETDEV_H
#define LWIP_NETDEV_H
#include "net/ethernet.h"
#include "net/netdev2.h"
#include "net/netdev.h"
#include "lwip/err.h"
#include "lwip/netif.h"
@ -35,28 +35,28 @@ extern "C" {
* @brief Length of the temporary copying buffer for receival.
* @note It should be as long as the maximum packet length of all the netdev you use.
*/
#ifndef LWIP_NETDEV2_BUFLEN
#define LWIP_NETDEV2_BUFLEN (ETHERNET_MAX_LEN)
#ifndef LWIP_NETDEV_BUFLEN
#define LWIP_NETDEV_BUFLEN (ETHERNET_MAX_LEN)
#endif
/**
* @brief Initializes the netdev2 adapter.
* @brief Initializes the netdev adapter.
*
* Should be passed to lwIP's netif_add() with the state parameter parameter of that function set
* to an existing netdev2_t instance
* to an existing netdev_t instance
*
* @pre netif->state is set to an existing netdev2_t instance.
* @pre netif->state is set to an existing netdev_t instance.
*
* @param[in] netif The network interface intended to be initialized.
*
* @return ERR_OK on success.
* @return ERR_IF on error.
*/
err_t lwip_netdev2_init(struct netif *netif);
err_t lwip_netdev_init(struct netif *netif);
#ifdef __cplusplus
}
#endif
#endif /* LWIP_NETDEV2_H */
#endif /* LWIP_NETDEV_H */
/** @} */

View File

@ -209,7 +209,7 @@ static int _handle_get(gnrc_netapi_opt_t *_opt)
#endif
/* case NETOPT_DEVICE_TYPE:
assert(_opt->data_len == sizeof(uint16_t));
*((uint16_t *)value) = NETDEV2_TYPE_IEEE802154;
*((uint16_t *)value) = NETDEV_TYPE_IEEE802154;
res = sizeof(uint16_t);
break;*/
case NETOPT_IPV6_IID:

View File

@ -67,7 +67,7 @@ Networking
* Provide sock-port for GCOAP
* Provide sock-port for UHCPC
* Provide sock_ip wrapper for LWIP
* Native: allow for multiple netdev2_tap devices
* Native: allow for multiple netdev_tap devices
Packages
--------
@ -100,9 +100,9 @@ Drivers
* Unified NRF5x low power modes
+ Low power modes for the STM32F1 family
* Unified Kinetis low power modes
* Xbee port to netdev2 API
* W5100 port to netdev2 API
* NRF5x/'nrfmin' port to netdev2 API (w/o 6LoWPAN support currently)
* Xbee port to netdev API
* W5100 port to netdev API
* NRF5x/'nrfmin' port to netdev API (w/o 6LoWPAN support currently)
* Refactor synchronous UART by new 'isrpipe' module
Build System
@ -340,7 +340,7 @@ Core
API changes
-----------
+ Socket-like sock API (replacing conn)
* netdev2: Add Testmodes and CCA modes
* netdev: Add Testmodes and CCA modes
* IEEE 802.15.4: clean-up Intra-PAN behavior
* IEEE 802.15.4: centralize default values
* gnrc_pktbuf: allow for 0-sized snips
@ -411,7 +411,7 @@ Fixed Issues from the last release
==================================
#534: native debugging on osx fails
#2071: native: *long* overdue fixes
#3341: netdev2_tap crashes when hammered
#3341: netdev_tap crashes when hammered
#5007: gnrc icmpv6: Ping reply goes out the wrong interface
#5432: native: valgrind fails
@ -863,7 +863,7 @@ Core
Network Stack
---
+ P2P-RPL (RFC6997)
+ netdev2_test: test framework for users of the netdev2 API
+ netdev_test: test framework for users of the netdev API
Packages
---
@ -905,7 +905,7 @@ Other
API changes
---
* at86rf2xx was moved from gnrc_netdev to the netdev2 API
* at86rf2xx was moved from gnrc_netdev to the netdev API
* genrand_* -> random_*
* xtimer_remove() no longer returns whether a timer was actually removed
* disableIRQ(), enableIRQ(), restoreIRQ(), inISR() -> irq_disable(), irq_enable(), irq_restore(), irq_is_in()

View File

@ -25,8 +25,8 @@ endif
ifneq (,$(filter ieee802154,$(USEMODULE)))
DIRS += net/link_layer/ieee802154
endif
ifneq (,$(filter netdev2_test,$(USEMODULE)))
DIRS += net/netdev2_test
ifneq (,$(filter netdev_test,$(USEMODULE)))
DIRS += net/netdev_test
endif
ifneq (,$(filter icmpv6,$(USEMODULE)))
DIRS += net/network_layer/icmpv6
@ -58,8 +58,8 @@ endif
ifneq (,$(filter nhdp,$(USEMODULE)))
DIRS += net/routing/nhdp
endif
ifneq (,$(filter gnrc_netdev2,$(USEMODULE)))
DIRS += net/gnrc/link_layer/netdev2
ifneq (,$(filter gnrc_netdev,$(USEMODULE)))
DIRS += net/gnrc/link_layer/netdev
endif
ifneq (,$(filter fib,$(USEMODULE)))
DIRS += net/network_layer/fib

View File

@ -216,9 +216,9 @@ void auto_init(void)
auto_init_kw2xrf();
#endif
#ifdef MODULE_NETDEV2_TAP
extern void auto_init_netdev2_tap(void);
auto_init_netdev2_tap();
#ifdef MODULE_NETDEV_TAP
extern void auto_init_netdev_tap(void);
auto_init_netdev_tap();
#endif
#ifdef MODULE_NORDIC_SOFTDEVICE_BLE

View File

@ -21,8 +21,8 @@
#include "log.h"
#include "board.h"
#include "net/gnrc/netdev2.h"
#include "net/gnrc/netdev2/ieee802154.h"
#include "net/gnrc/netdev.h"
#include "net/gnrc/netdev/ieee802154.h"
#include "net/gnrc.h"
#include "at86rf2xx.h"
@ -34,13 +34,13 @@
*/
#define AT86RF2XX_MAC_STACKSIZE (THREAD_STACKSIZE_DEFAULT)
#ifndef AT86RF2XX_MAC_PRIO
#define AT86RF2XX_MAC_PRIO (GNRC_NETDEV2_MAC_PRIO)
#define AT86RF2XX_MAC_PRIO (GNRC_NETDEV_MAC_PRIO)
#endif
#define AT86RF2XX_NUM (sizeof(at86rf2xx_params) / sizeof(at86rf2xx_params[0]))
static at86rf2xx_t at86rf2xx_devs[AT86RF2XX_NUM];
static gnrc_netdev2_t gnrc_adpt[AT86RF2XX_NUM];
static gnrc_netdev_t gnrc_adpt[AT86RF2XX_NUM];
static char _at86rf2xx_stacks[AT86RF2XX_NUM][AT86RF2XX_MAC_STACKSIZE];
void auto_init_at86rf2xx(void)
@ -51,18 +51,18 @@ void auto_init_at86rf2xx(void)
LOG_DEBUG("[auto_init_netif] initializing at86rf2xx #%u\n", i);
at86rf2xx_setup(&at86rf2xx_devs[i], &at86rf2xx_params[i]);
res = gnrc_netdev2_ieee802154_init(&gnrc_adpt[i],
(netdev2_ieee802154_t *)&at86rf2xx_devs[i]);
res = gnrc_netdev_ieee802154_init(&gnrc_adpt[i],
(netdev_ieee802154_t *)&at86rf2xx_devs[i]);
if (res < 0) {
LOG_ERROR("[auto_init_netif] error initializing at86rf2xx radio #%u\n", i);
}
else {
gnrc_netdev2_init(_at86rf2xx_stacks[i],
AT86RF2XX_MAC_STACKSIZE,
AT86RF2XX_MAC_PRIO,
"at86rf2xx",
&gnrc_adpt[i]);
gnrc_netdev_init(_at86rf2xx_stacks[i],
AT86RF2XX_MAC_STACKSIZE,
AT86RF2XX_MAC_PRIO,
"at86rf2xx",
&gnrc_adpt[i]);
}
}
}

View File

@ -22,8 +22,8 @@
#include "log.h"
#include "debug.h"
#include "board.h"
#include "net/gnrc/netdev2.h"
#include "gnrc_netdev2_cc110x.h"
#include "net/gnrc/netdev.h"
#include "gnrc_netdev_cc110x.h"
#include "net/gnrc.h"
#include "cc110x.h"
@ -35,15 +35,15 @@
*/
#define CC110X_MAC_STACKSIZE (THREAD_STACKSIZE_DEFAULT + DEBUG_EXTRA_STACKSIZE)
#ifndef CC110X_MAC_PRIO
#define CC110X_MAC_PRIO (GNRC_NETDEV2_MAC_PRIO)
#define CC110X_MAC_PRIO (GNRC_NETDEV_MAC_PRIO)
#endif
#define CC110X_NUM (sizeof(cc110x_params)/sizeof(cc110x_params[0]))
static netdev2_cc110x_t cc110x_devs[CC110X_NUM];
static netdev_cc110x_t cc110x_devs[CC110X_NUM];
static char _stacks[CC110X_NUM][CC110X_MAC_STACKSIZE];
static gnrc_netdev2_t _gnrc_netdev2_devs[CC110X_NUM];
static gnrc_netdev_t _gnrc_netdev_devs[CC110X_NUM];
void auto_init_cc110x(void)
{
@ -52,14 +52,14 @@ void auto_init_cc110x(void)
LOG_DEBUG("[auto_init_netif] initializing cc110x #%u\n", i);
int res = netdev2_cc110x_setup(&cc110x_devs[i], p);
int res = netdev_cc110x_setup(&cc110x_devs[i], p);
if (res < 0) {
LOG_ERROR("[auto_init_netif] error initializing cc110x #%u\n", i);
}
else {
gnrc_netdev2_cc110x_init(&_gnrc_netdev2_devs[i], &cc110x_devs[i]);
res = gnrc_netdev2_init(_stacks[i], CC110X_MAC_STACKSIZE,
CC110X_MAC_PRIO, "cc110x", &_gnrc_netdev2_devs[i]);
gnrc_netdev_cc110x_init(&_gnrc_netdev_devs[i], &cc110x_devs[i]);
res = gnrc_netdev_init(_stacks[i], CC110X_MAC_STACKSIZE,
CC110X_MAC_PRIO, "cc110x", &_gnrc_netdev_devs[i]);
if (res < 0) {
LOG_ERROR("[auto_init_netif] error starting gnrc_cc110x thread\n");
}

View File

@ -23,8 +23,8 @@
#include "log.h"
#include "board.h"
#include "net/gnrc/netdev2.h"
#include "net/gnrc/netdev2/ieee802154.h"
#include "net/gnrc/netdev.h"
#include "net/gnrc/netdev/ieee802154.h"
#include "net/gnrc.h"
#include "cc2420.h"
@ -36,7 +36,7 @@
*/
#define CC2420_MAC_STACKSIZE (THREAD_STACKSIZE_MAIN)
#ifndef CC2420_MAC_PRIO
#define CC2420_MAC_PRIO (GNRC_NETDEV2_MAC_PRIO)
#define CC2420_MAC_PRIO (GNRC_NETDEV_MAC_PRIO)
#endif
/** @} */
@ -50,7 +50,7 @@
* @{
*/
static cc2420_t cc2420_devs[CC2420_NUMOF];
static gnrc_netdev2_t gnrc_adpt[CC2420_NUMOF];
static gnrc_netdev_t gnrc_adpt[CC2420_NUMOF];
static char _cc2420_stacks[CC2420_NUMOF][CC2420_MAC_STACKSIZE];
/** @} */
@ -60,17 +60,17 @@ void auto_init_cc2420(void)
LOG_DEBUG("[auto_init_netif] initializing cc2420 #%u\n", i);
cc2420_setup(&cc2420_devs[i], &cc2420_params[i]);
int res = gnrc_netdev2_ieee802154_init(&gnrc_adpt[i],
(netdev2_ieee802154_t *)&cc2420_devs[i]);
int res = gnrc_netdev_ieee802154_init(&gnrc_adpt[i],
(netdev_ieee802154_t *)&cc2420_devs[i]);
if (res < 0) {
LOG_ERROR("[auto_init_netif] error initializing cc2420 #%u\n", i);
}
else {
gnrc_netdev2_init(_cc2420_stacks[i],
CC2420_MAC_STACKSIZE,
CC2420_MAC_PRIO,
"cc2420", &gnrc_adpt[i]);
gnrc_netdev_init(_cc2420_stacks[i],
CC2420_MAC_STACKSIZE,
CC2420_MAC_PRIO,
"cc2420", &gnrc_adpt[i]);
}
}
}

View File

@ -20,8 +20,8 @@
#ifdef MODULE_CC2538_RF
#include "log.h"
#include "net/gnrc/netdev2.h"
#include "net/gnrc/netdev2/ieee802154.h"
#include "net/gnrc/netdev.h"
#include "net/gnrc/netdev/ieee802154.h"
#include "cc2538_rf.h"
@ -31,11 +31,11 @@
*/
#define CC2538_MAC_STACKSIZE (THREAD_STACKSIZE_DEFAULT)
#ifndef CC2538_MAC_PRIO
#define CC2538_MAC_PRIO (GNRC_NETDEV2_MAC_PRIO)
#define CC2538_MAC_PRIO (GNRC_NETDEV_MAC_PRIO)
#endif
static cc2538_rf_t cc2538_rf_dev;
static gnrc_netdev2_t gnrc_adpt;
static gnrc_netdev_t gnrc_adpt;
static char _cc2538_rf_stack[CC2538_MAC_STACKSIZE];
void auto_init_cc2538_rf(void)
@ -45,18 +45,18 @@ void auto_init_cc2538_rf(void)
LOG_DEBUG("[auto_init_netif] initializing cc2538 radio\n");
cc2538_setup(&cc2538_rf_dev);
res = gnrc_netdev2_ieee802154_init(&gnrc_adpt,
(netdev2_ieee802154_t *)&cc2538_rf_dev);
res = gnrc_netdev_ieee802154_init(&gnrc_adpt,
(netdev_ieee802154_t *)&cc2538_rf_dev);
if (res < 0) {
LOG_ERROR("[auto_init_netif] error initializing cc2538 radio\n");
}
else {
gnrc_netdev2_init(_cc2538_rf_stack,
CC2538_MAC_STACKSIZE,
CC2538_MAC_PRIO,
"cc2538_rf",
&gnrc_adpt);
gnrc_netdev_init(_cc2538_rf_stack,
CC2538_MAC_STACKSIZE,
CC2538_MAC_PRIO,
"cc2538_rf",
&gnrc_adpt);
}
}

View File

@ -24,8 +24,8 @@
#include "log.h"
#include "enc28j60.h"
#include "enc28j60_params.h"
#include "net/gnrc/netdev2.h"
#include "net/gnrc/netdev2/eth.h"
#include "net/gnrc/netdev.h"
#include "net/gnrc/netdev/eth.h"
/**
* @brief Define stack parameters for the MAC layer thread
@ -33,7 +33,7 @@
*/
#define ENC28J60_MAC_STACKSIZE (THREAD_STACKSIZE_DEFAULT)
#ifndef ENC28J60_MAC_PRIO
#define ENC28J60_MAC_PRIO (GNRC_NETDEV2_MAC_PRIO)
#define ENC28J60_MAC_PRIO (GNRC_NETDEV_MAC_PRIO)
#endif
/*** @} */
@ -47,7 +47,7 @@
* @{
*/
static enc28j60_t dev[ENC28J60_NUM];
static gnrc_netdev2_t gnrc_adpt[ENC28J60_NUM];
static gnrc_netdev_t gnrc_adpt[ENC28J60_NUM];
/** @} */
/**
@ -61,13 +61,13 @@ void auto_init_enc28j60(void)
for (unsigned i = 0; i < ENC28J60_NUM; i++) {
LOG_DEBUG("[auto_init_netif] initializing enc28j60 #%u\n", i);
/* setup netdev2 device */
/* setup netdev device */
enc28j60_setup(&dev[i], &enc28j60_params[i]);
/* initialize netdev2 <-> gnrc adapter state */
gnrc_netdev2_eth_init(&gnrc_adpt[i], (netdev2_t *)&dev[i]);
/* start gnrc netdev2 thread */
gnrc_netdev2_init(stack[i], ENC28J60_MAC_STACKSIZE, ENC28J60_MAC_PRIO,
"gnrc_enc28j60", &gnrc_adpt[i]);
/* initialize netdev <-> gnrc adapter state */
gnrc_netdev_eth_init(&gnrc_adpt[i], (netdev_t *)&dev[i]);
/* start gnrc netdev thread */
gnrc_netdev_init(stack[i], ENC28J60_MAC_STACKSIZE, ENC28J60_MAC_PRIO,
"gnrc_enc28j60", &gnrc_adpt[i]);
}
}

View File

@ -22,8 +22,8 @@
#include "log.h"
#include "debug.h"
#include "encx24j600.h"
#include "net/gnrc/netdev2.h"
#include "net/gnrc/netdev2/eth.h"
#include "net/gnrc/netdev.h"
#include "net/gnrc/netdev/eth.h"
static encx24j600_t encx24j600;
@ -33,33 +33,33 @@ static encx24j600_t encx24j600;
*/
#define ENCX24J600_MAC_STACKSIZE (THREAD_STACKSIZE_DEFAULT + DEBUG_EXTRA_STACKSIZE)
#ifndef ENCX24J600_MAC_PRIO
#define ENCX24J600_MAC_PRIO (GNRC_NETDEV2_MAC_PRIO)
#define ENCX24J600_MAC_PRIO (GNRC_NETDEV_MAC_PRIO)
#endif
/**
* @brief Stacks for the MAC layer threads
*/
static char _netdev2_eth_stack[ENCX24J600_MAC_STACKSIZE];
static gnrc_netdev2_t _gnrc_encx24j600;
static char _netdev_eth_stack[ENCX24J600_MAC_STACKSIZE];
static gnrc_netdev_t _gnrc_encx24j600;
void auto_init_encx24j600(void)
{
LOG_DEBUG("[auto_init_netif] initializing encx24j600 #0\n");
/* setup netdev2 device */
/* setup netdev device */
encx24j600_params_t p;
p.spi = ENCX24J600_SPI;
p.cs_pin = ENCX24J600_CS;
p.int_pin = ENCX24J600_INT;
encx24j600_setup(&encx24j600, &p);
/* initialize netdev2<->gnrc adapter state */
gnrc_netdev2_eth_init(&_gnrc_encx24j600, (netdev2_t*)&encx24j600);
/* initialize netdev<->gnrc adapter state */
gnrc_netdev_eth_init(&_gnrc_encx24j600, (netdev_t*)&encx24j600);
/* start gnrc netdev2 thread */
gnrc_netdev2_init(_netdev2_eth_stack, ENCX24J600_MAC_STACKSIZE,
ENCX24J600_MAC_PRIO, "gnrc_encx24j600",
&_gnrc_encx24j600);
/* start gnrc netdev thread */
gnrc_netdev_init(_netdev_eth_stack, ENCX24J600_MAC_STACKSIZE,
ENCX24J600_MAC_PRIO, "gnrc_encx24j600",
&_gnrc_encx24j600);
}
#else

View File

@ -23,8 +23,8 @@
#include "debug.h"
#include "ethos.h"
#include "periph/uart.h"
#include "net/gnrc/netdev2.h"
#include "net/gnrc/netdev2/eth.h"
#include "net/gnrc/netdev.h"
#include "net/gnrc/netdev/eth.h"
/**
* @brief global ethos object, used by uart_stdio
@ -37,14 +37,14 @@ ethos_t ethos;
*/
#define ETHOS_MAC_STACKSIZE (THREAD_STACKSIZE_DEFAULT + DEBUG_EXTRA_STACKSIZE)
#ifndef ETHOS_MAC_PRIO
#define ETHOS_MAC_PRIO (GNRC_NETDEV2_MAC_PRIO)
#define ETHOS_MAC_PRIO (GNRC_NETDEV_MAC_PRIO)
#endif
/**
* @brief Stacks for the MAC layer threads
*/
static char _netdev2_eth_stack[ETHOS_MAC_STACKSIZE];
static gnrc_netdev2_t _gnrc_ethos;
static char _netdev_eth_stack[ETHOS_MAC_STACKSIZE];
static gnrc_netdev_t _gnrc_ethos;
static uint8_t _inbuf[2048];
@ -52,7 +52,7 @@ void auto_init_ethos(void)
{
LOG_DEBUG("[auto_init_netif] initializing ethos #0\n");
/* setup netdev2 device */
/* setup netdev device */
ethos_params_t p;
p.uart = ETHOS_UART;
p.baudrate = ETHOS_BAUDRATE;
@ -60,12 +60,12 @@ void auto_init_ethos(void)
p.bufsize = sizeof(_inbuf);
ethos_setup(&ethos, &p);
/* initialize netdev2<->gnrc adapter state */
gnrc_netdev2_eth_init(&_gnrc_ethos, (netdev2_t*)&ethos);
/* initialize netdev<->gnrc adapter state */
gnrc_netdev_eth_init(&_gnrc_ethos, (netdev_t*)&ethos);
/* start gnrc netdev2 thread */
gnrc_netdev2_init(_netdev2_eth_stack, ETHOS_MAC_STACKSIZE, ETHOS_MAC_PRIO,
"gnrc_ethos", &_gnrc_ethos);
/* start gnrc netdev thread */
gnrc_netdev_init(_netdev_eth_stack, ETHOS_MAC_STACKSIZE, ETHOS_MAC_PRIO,
"gnrc_ethos", &_gnrc_ethos);
}
#else

View File

@ -24,8 +24,8 @@
#include "log.h"
#include "board.h"
#include "net/gnrc/netdev2.h"
#include "net/gnrc/netdev2/ieee802154.h"
#include "net/gnrc/netdev.h"
#include "net/gnrc/netdev/ieee802154.h"
#include "net/gnrc.h"
#include "kw2xrf.h"
@ -37,13 +37,13 @@
*/
#define KW2XRF_MAC_STACKSIZE (THREAD_STACKSIZE_DEFAULT)
#ifndef KW2XRF_MAC_PRIO
#define KW2XRF_MAC_PRIO (GNRC_NETDEV2_MAC_PRIO)
#define KW2XRF_MAC_PRIO (GNRC_NETDEV_MAC_PRIO)
#endif
#define KW2XRF_NUM (sizeof(kw2xrf_params)/sizeof(kw2xrf_params[0]))
static kw2xrf_t kw2xrf_devs[KW2XRF_NUM];
static gnrc_netdev2_t gnrc_adpt[KW2XRF_NUM];
static gnrc_netdev_t gnrc_adpt[KW2XRF_NUM];
static char _kw2xrf_stacks[KW2XRF_NUM][KW2XRF_MAC_STACKSIZE];
void auto_init_kw2xrf(void)
@ -53,12 +53,12 @@ void auto_init_kw2xrf(void)
LOG_DEBUG("[auto_init_netif] initializing kw2xrf #%u\n", i);
kw2xrf_setup(&kw2xrf_devs[i], (kw2xrf_params_t*) p);
if (gnrc_netdev2_ieee802154_init(&gnrc_adpt[i], (netdev2_ieee802154_t *)&kw2xrf_devs[i]) < 0) {
if (gnrc_netdev_ieee802154_init(&gnrc_adpt[i], (netdev_ieee802154_t *)&kw2xrf_devs[i]) < 0) {
LOG_ERROR("[auto_init_netif] error, initializing kw2xrf #%u\n", i);
}
else {
gnrc_netdev2_init(_kw2xrf_stacks[i], KW2XRF_MAC_STACKSIZE,
KW2XRF_MAC_PRIO, "kw2xrf", &gnrc_adpt[i]);
gnrc_netdev_init(_kw2xrf_stacks[i], KW2XRF_MAC_STACKSIZE,
KW2XRF_MAC_PRIO, "kw2xrf", &gnrc_adpt[i]);
}
}
}

View File

@ -21,8 +21,8 @@
#include "log.h"
#include "board.h"
#include "net/gnrc/netdev2.h"
#include "net/gnrc/netdev2/ieee802154.h"
#include "net/gnrc/netdev.h"
#include "net/gnrc/netdev/ieee802154.h"
#include "net/gnrc.h"
#include "mrf24j40.h"
@ -34,13 +34,13 @@
*/
#define MRF24J40_MAC_STACKSIZE (THREAD_STACKSIZE_DEFAULT)
#ifndef MRF24J40_MAC_PRIO
#define MRF24J40_MAC_PRIO (GNRC_NETDEV2_MAC_PRIO)
#define MRF24J40_MAC_PRIO (GNRC_NETDEV_MAC_PRIO)
#endif
#define MRF24J40_NUM (sizeof(mrf24j40_params) / sizeof(mrf24j40_params[0]))
static mrf24j40_t mrf24j40_devs[MRF24J40_NUM];
static gnrc_netdev2_t gnrc_adpt[MRF24J40_NUM];
static gnrc_netdev_t gnrc_adpt[MRF24J40_NUM];
static char _mrf24j40_stacks[MRF24J40_NUM][MRF24J40_MAC_STACKSIZE];
void auto_init_mrf24j40(void)
@ -51,18 +51,18 @@ void auto_init_mrf24j40(void)
LOG_DEBUG("[auto_init_netif] initializing mrf24j40 #%u\n", i);
mrf24j40_setup(&mrf24j40_devs[i], &mrf24j40_params[i]);
res = gnrc_netdev2_ieee802154_init(&gnrc_adpt[i],
(netdev2_ieee802154_t *)&mrf24j40_devs[i]);
res = gnrc_netdev_ieee802154_init(&gnrc_adpt[i],
(netdev_ieee802154_t *)&mrf24j40_devs[i]);
if (res < 0) {
LOG_ERROR("[auto_init_netif] error initializing mrf24j40 #%u\n", i);
}
else {
gnrc_netdev2_init(_mrf24j40_stacks[i],
MRF24J40_MAC_STACKSIZE,
MRF24J40_MAC_PRIO,
"mrf24j40",
&gnrc_adpt[i]);
gnrc_netdev_init(_mrf24j40_stacks[i],
MRF24J40_MAC_STACKSIZE,
MRF24J40_MAC_PRIO,
"mrf24j40",
&gnrc_adpt[i]);
}
}
}

View File

@ -1,54 +0,0 @@
/*
* Copyright (C) 2015 Kaspar Schleiser <kaspar@schleiser.de>
*
* 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 auto_init_gnrc_netif
* @{
*
* @file
* @brief Auto initialization for ethernet devices
*
* @author Kaspar Schleiser <kaspar@schleiser.de>
*/
#ifdef MODULE_NETDEV2_TAP
#include "log.h"
#include "debug.h"
#include "netdev2_tap_params.h"
#include "net/gnrc/netdev2/eth.h"
#define TAP_MAC_STACKSIZE (THREAD_STACKSIZE_DEFAULT + DEBUG_EXTRA_STACKSIZE)
#define TAP_MAC_PRIO (THREAD_PRIORITY_MAIN - 3)
static netdev2_tap_t netdev2_tap[NETDEV2_TAP_MAX];
static char _netdev2_eth_stack[NETDEV2_TAP_MAX][TAP_MAC_STACKSIZE + DEBUG_EXTRA_STACKSIZE];
static gnrc_netdev2_t _gnrc_netdev2_tap[NETDEV2_TAP_MAX];
void auto_init_netdev2_tap(void)
{
for (unsigned i = 0; i < NETDEV2_TAP_MAX; i++) {
const netdev2_tap_params_t *p = &netdev2_tap_params[i];
LOG_DEBUG("[auto_init_netif] initializing netdev2_tap #%u on TAP %s\n",
i, *(p->tap_name));
netdev2_tap_setup(&netdev2_tap[i], p);
gnrc_netdev2_eth_init(&_gnrc_netdev2_tap[i], (netdev2_t*)&netdev2_tap[i]);
gnrc_netdev2_init(_netdev2_eth_stack[i], TAP_MAC_STACKSIZE,
TAP_MAC_PRIO, "gnrc_netdev2_tap",
&_gnrc_netdev2_tap[i]);
}
}
#else
typedef int dont_be_pedantic;
#endif /* MODULE_NETDEV2_TAP */
/** @} */

View File

@ -0,0 +1,54 @@
/*
* Copyright (C) 2015 Kaspar Schleiser <kaspar@schleiser.de>
*
* 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 auto_init_gnrc_netif
* @{
*
* @file
* @brief Auto initialization for ethernet devices
*
* @author Kaspar Schleiser <kaspar@schleiser.de>
*/
#ifdef MODULE_NETDEV_TAP
#include "log.h"
#include "debug.h"
#include "netdev_tap_params.h"
#include "net/gnrc/netdev/eth.h"
#define TAP_MAC_STACKSIZE (THREAD_STACKSIZE_DEFAULT + DEBUG_EXTRA_STACKSIZE)
#define TAP_MAC_PRIO (THREAD_PRIORITY_MAIN - 3)
static netdev_tap_t netdev_tap[NETDEV_TAP_MAX];
static char _netdev_eth_stack[NETDEV_TAP_MAX][TAP_MAC_STACKSIZE + DEBUG_EXTRA_STACKSIZE];
static gnrc_netdev_t _gnrc_netdev_tap[NETDEV_TAP_MAX];
void auto_init_netdev_tap(void)
{
for (unsigned i = 0; i < NETDEV_TAP_MAX; i++) {
const netdev_tap_params_t *p = &netdev_tap_params[i];
LOG_DEBUG("[auto_init_netif] initializing netdev_tap #%u on TAP %s\n",
i, *(p->tap_name));
netdev_tap_setup(&netdev_tap[i], p);
gnrc_netdev_eth_init(&_gnrc_netdev_tap[i], (netdev_t*)&netdev_tap[i]);
gnrc_netdev_init(_netdev_eth_stack[i], TAP_MAC_STACKSIZE,
TAP_MAC_PRIO, "gnrc_netdev_tap",
&_gnrc_netdev_tap[i]);
}
}
#else
typedef int dont_be_pedantic;
#endif /* MODULE_NETDEV_TAP */
/** @} */

View File

@ -21,7 +21,7 @@
#include "log.h"
#include "board.h"
#include "net/gnrc/netdev2.h"
#include "net/gnrc/netdev.h"
#include "net/gnrc.h"
#include "net/gnrc/slip.h"
@ -37,7 +37,7 @@ static gnrc_slip_dev_t slip_devs[SLIP_NUM];
*/
#define SLIP_STACKSIZE (THREAD_STACKSIZE_DEFAULT)
#ifndef SLIP_PRIO
#define SLIP_PRIO (GNRC_NETDEV2_MAC_PRIO)
#define SLIP_PRIO (GNRC_NETDEV_MAC_PRIO)
#endif
/**

View File

@ -22,8 +22,8 @@
#include "log.h"
#include "w5100.h"
#include "w5100_params.h"
#include "net/gnrc/netdev2.h"
#include "net/gnrc/netdev2/eth.h"
#include "net/gnrc/netdev.h"
#include "net/gnrc/netdev/eth.h"
/**
* @brief Define stack parameters for the MAC layer thread
@ -43,7 +43,7 @@
* @{
*/
static w5100_t dev[W5100_NUM];
static gnrc_netdev2_t gnrc_adpt[W5100_NUM];
static gnrc_netdev_t gnrc_adpt[W5100_NUM];
/** @} */
/**
@ -57,13 +57,13 @@ void auto_init_w5100(void)
for (unsigned i = 0; i < W5100_NUM; i++) {
LOG_DEBUG("[auto_init_netif] initializing w5100 #%u\n", i);
/* setup netdev2 device */
/* setup netdev device */
w5100_setup(&dev[i], &w5100_params[i]);
/* initialize netdev2 <-> gnrc adapter state */
gnrc_netdev2_eth_init(&gnrc_adpt[i], (netdev2_t *)&dev[i]);
/* start gnrc netdev2 thread */
gnrc_netdev2_init(stack[i], MAC_STACKSIZE, MAC_PRIO,
"gnrc_w5100", &gnrc_adpt[i]);
/* initialize netdev <-> gnrc adapter state */
gnrc_netdev_eth_init(&gnrc_adpt[i], (netdev_t *)&dev[i]);
/* start gnrc netdev thread */
gnrc_netdev_init(stack[i], MAC_STACKSIZE, MAC_PRIO,
"gnrc_w5100", &gnrc_adpt[i]);
}
}

View File

@ -23,7 +23,7 @@
#include "log.h"
#include "board.h"
#include "net/gnrc/netdev2/xbee_adpt.h"
#include "net/gnrc/netdev/xbee_adpt.h"
#include "xbee_params.h"
/**
@ -36,14 +36,14 @@
*/
#define XBEE_MAC_STACKSIZE (THREAD_STACKSIZE_DEFAULT)
#ifndef XBEE_MAC_PRIO
#define XBEE_MAC_PRIO (GNRC_NETDEV2_MAC_PRIO)
#define XBEE_MAC_PRIO (GNRC_NETDEV_MAC_PRIO)
#endif
/**
* @brief Allocate memory for device descriptors, stacks, and GNRC adaption
*/
static xbee_t xbee_devs[XBEE_NUM];
static gnrc_netdev2_t gnrc_adpt[XBEE_NUM];
static gnrc_netdev_t gnrc_adpt[XBEE_NUM];
static char stacks[XBEE_NUM][XBEE_MAC_STACKSIZE];
void auto_init_xbee(void)
@ -52,8 +52,8 @@ void auto_init_xbee(void)
LOG_DEBUG("[auto_init_netif] initializing xbee #%u\n", i);
xbee_setup(&xbee_devs[i], &xbee_params[i]);
gnrc_netdev2_xbee_init(&gnrc_adpt[i], &xbee_devs[i]);
gnrc_netdev2_init(stacks[i], XBEE_MAC_STACKSIZE, XBEE_MAC_PRIO,
gnrc_netdev_xbee_init(&gnrc_adpt[i], &xbee_devs[i]);
gnrc_netdev_init(stacks[i], XBEE_MAC_STACKSIZE, XBEE_MAC_PRIO,
"xbee", &gnrc_adpt[i]);
}
}

View File

@ -27,7 +27,7 @@
#include <stdint.h>
#include "net/netdev2.h"
#include "net/netdev.h"
#ifdef __cplusplus
@ -101,7 +101,7 @@ extern const csma_sender_conf_t CSMA_SENDER_CONF_DEFAULT;
* @return -EBUSY if radio medium never was available
* to send the given data
*/
int csma_sender_csma_ca_send(netdev2_t *dev, struct iovec *vector,
int csma_sender_csma_ca_send(netdev_t *dev, struct iovec *vector,
unsigned count, const csma_sender_conf_t *conf);
/**
@ -133,7 +133,7 @@ int csma_sender_csma_ca_send(netdev2_t *dev, struct iovec *vector,
* @return -EBUSY if radio medium was not available
* to send the given data
*/
int csma_sender_cca_send(netdev2_t *dev, struct iovec *vector, unsigned count);
int csma_sender_cca_send(netdev_t *dev, struct iovec *vector, unsigned count);
#ifdef __cplusplus

View File

@ -18,7 +18,7 @@
* =====
*
* This module is currently the default network stack for RIOT and includes
* many components ranging from a @ref net_gnrc_netdev2 through a fully-featured
* many components ranging from a @ref net_gnrc_netdev through a fully-featured
* @ref net_gnrc_ipv6 implementation with @ref net_gnrc_sixlowpan "6LowPAN"
* extensions to an @ref net_gnrc_udp "UDP" implementation and
* @ref net_gnrc_rpl.
@ -30,8 +30,8 @@
* =====================
*
* From the application layer the @ref net_gnrc can be accessed through the
* @ref net_sock, while the interface to the @ref drivers_netdev_netdev2 is
* defined by the @ref net_gnrc_netdev2.
* @ref net_sock, while the interface to the @ref drivers_netdev_api is
* defined by the @ref net_gnrc_netdev.
*
* Architecture
* ============
@ -284,7 +284,6 @@
#define GNRC_NETBASE_H
#include "net/netopt.h"
#include "net/gnrc/netdev.h"
#include "net/gnrc/netapi.h"
#include "net/gnrc/netreg.h"
#include "net/gnrc/nettype.h"

View File

@ -31,15 +31,15 @@ extern "C" {
#if (GNRC_MAC_TX_QUEUE_SIZE != 0) || defined(DOXYGEN)
/**
* @brief Queues the packet into the related transmission packet queue in netdev2_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
* by `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 netdev2_t::tx::neighbors) which
* `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
* priority TX queue defined in in netdev2_t::tx.
* priority TX queue defined in in netdev_t::tx.
*
* @param[in,out] tx gnrc_mac transmission management object
* @param[in] priority the priority of @p pkt
@ -52,7 +52,7 @@ bool gnrc_mac_queue_tx_packet(gnrc_mac_tx_t* tx, uint32_t priority, gnrc_pktsnip
#if (GNRC_MAC_RX_QUEUE_SIZE != 0) || defined(DOXYGEN)
/**
* @brief Queues the packet into the reception packet queue in netdev2_t::rx.
* @brief Queues the packet into the reception packet queue in netdev_t::rx.
*
* @param[in,out] rx gnrc_mac reception management object
* @param[in] priority the priority of @p pkt
@ -65,7 +65,7 @@ bool gnrc_mac_queue_rx_packet(gnrc_mac_rx_t* rx, uint32_t priority, gnrc_pktsnip
#if (GNRC_MAC_DISPATCH_BUFFER_SIZE != 0) || defined(DOXYGEN)
/**
* @brief Dispatch all the packets stored in netdev2_t::rx:dispatch_buffer to upper layer.
* @brief Dispatch all the packets stored in netdev_t::rx:dispatch_buffer to upper layer.
*
* @param[in,out] rx gnrc_mac reception management object
*/

Some files were not shown because too many files have changed in this diff Show More