-
Notifications
You must be signed in to change notification settings - Fork 2k
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
sys: net: add gnrc netdev2 support #3683
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
ifneq (,$(filter gnrc_netif_default,$(USEMODULE))) | ||
USEMODULE += dev_eth_tap | ||
USEMODULE += gnrc_netdev_eth | ||
USEMODULE += gnrc_nomac | ||
USEMODULE += netdev2_tap | ||
USEMODULE += gnrc_netdev2 | ||
endif |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,66 +7,67 @@ | |
*/ | ||
|
||
/** | ||
* @defgroup dev_eth_tap Ethernet driver for TAP interfaces | ||
* @ingroup native_cpu | ||
* @ingroup netdev2 | ||
* @brief Low-level ethernet driver for native tap interfaces | ||
* @{ | ||
* | ||
* @file | ||
* @brief Definitions for @ref net_dev_eth driver for host system's | ||
* @brief Definitions for @ref netdev2 ethernet driver for host system's | ||
* TAP interfaces | ||
* | ||
* @author Kaspar Schleiser <kaspar@schleiser.de> | ||
*/ | ||
#ifndef DEV_ETH_TAP_H | ||
#define DEV_ETH_TAP_H | ||
#ifndef NETDEV2_TAP_H | ||
#define NETDEV2_TAP_H | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#include <stdint.h> | ||
#include "net/dev_eth.h" | ||
#include "net/netdev2.h" | ||
|
||
#include "net/if.h" | ||
#include "net/ethernet/hdr.h" | ||
|
||
#ifdef __MACH__ | ||
#include "net/if_var.h" | ||
#else | ||
#include "net/if.h" | ||
#endif | ||
|
||
/** | ||
* @brief tap interface state | ||
*/ | ||
typedef struct dev_eth_tap { | ||
dev_eth_t ethdev; /**< dev_eth internal member */ | ||
typedef struct netdev2_tap { | ||
netdev2_t netdev; /**< netdev2 internal member */ | ||
char tap_name[IFNAMSIZ]; /**< host dev file name */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Even with the latest commit (f5f0392)? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have to admit I have no clue why this broke. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ah, yes, the remote wasn't up to date. Sorry for the noise. |
||
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 */ | ||
} dev_eth_tap_t; | ||
} netdev2_tap_t; | ||
|
||
/** | ||
* @brief global device struct. driver only supports one tap device as of now. | ||
*/ | ||
extern dev_eth_tap_t dev_eth_tap; | ||
extern netdev2_tap_t netdev2_tap; | ||
|
||
/** | ||
* @brief Setup dev_eth_tap_t structure. | ||
* @brief Setup netdev2_tap_t structure. | ||
* | ||
* @param dev the preallocated dev_eth_tap device handle to setup | ||
* @param dev the preallocated netdev2_tap device handle to setup | ||
* @param name Name of the host system's tap inteface to bind to. | ||
*/ | ||
void dev_eth_tap_setup(dev_eth_tap_t *dev, const char *name); | ||
void netdev2_tap_setup(netdev2_tap_t *dev, const char *name); | ||
|
||
/** | ||
* @brief Cleanup dev_eth_tap_t structure. | ||
* @brief Cleanup tap resources | ||
* | ||
* @param dev the dev_eth_tap device handle to cleanup | ||
* @param dev the netdev2_tap device handle to cleanup | ||
*/ | ||
void dev_eth_tap_cleanup(dev_eth_tap_t *dev); | ||
void netdev2_tap_cleanup(netdev2_tap_t *dev); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
/** @} */ | ||
#endif /* DEV_ETH_TAP_H */ | ||
#endif /* NETDEV2_TAP_H */ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
MODULE = dev_eth_tap | ||
|
||
include $(RIOTBASE)/Makefile.base | ||
|
||
INCLUDES = $(NATIVEINCLUDES) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't these includes be in
<...>
instead of"..."
because they are system headers?