Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

netdev2: rename to netdev and remove gnrc_netdev #6610

Merged
merged 1 commit into from Mar 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 7 additions & 7 deletions Makefile.dep
Expand Up @@ -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

Expand All @@ -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

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions boards/cc2538dk/Makefile.dep
@@ -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
2 changes: 1 addition & 1 deletion boards/native/Makefile.dep
@@ -1,3 +1,3 @@
ifneq (,$(filter netdev_default gnrc_netdev_default,$(USEMODULE)))
USEMODULE += netdev2_tap
USEMODULE += netdev_tap
endif
4 changes: 2 additions & 2 deletions boards/openmote-cc2538/Makefile.dep
@@ -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
4 changes: 2 additions & 2 deletions boards/remote-common/Makefile.dep
@@ -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
Expand Down
8 changes: 4 additions & 4 deletions cpu/cc2538/include/cc2538_rf.h
Expand Up @@ -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" {
Expand Down Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions cpu/cc2538/include/cc2538_rf_netdev.h
Expand Up @@ -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" {
Expand All @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion cpu/cc2538/radio/cc2538_rf.c
Expand Up @@ -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;

Expand Down
64 changes: 32 additions & 32 deletions cpu/cc2538/radio/cc2538_rf_netdev.c
Expand Up @@ -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"
Expand All @@ -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,
Expand All @@ -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;

Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand All @@ -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);

Expand Down
4 changes: 2 additions & 2 deletions cpu/native/Makefile
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion cpu/native/README.md
Expand Up @@ -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
Expand Down
Expand Up @@ -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"

Expand All @@ -38,32 +38,32 @@ 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
*/
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 */