Skip to content
Snippets Groups Projects
Commit 615fdc5a authored by Tristan Gingold's avatar Tristan Gingold
Browse files

wrtd-rt-common.h: add an option to use VLAN

For #11
parent bb136ef2
Branches
Tags
No related merge requests found
......@@ -23,6 +23,7 @@
* #define WRTD_NET_TX x // 1 if transmit events to the network
* #define WRTD_LOCAL_RX x // 1 if consume events
* #define WRTD_LOCAL_TX x // 1 if generate events
* #define WRTD_NET_VLAN // Define to tag tx frames (with vlan 0)
* #include "wrtd-rt-common.h"
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*
......@@ -465,6 +466,11 @@ static void wrtd_log_discard(struct wrtd_rule *rule,
}
#if WRTD_NET_TX > 0
#ifdef WRTD_NET_VLAN
#define FILTER_TX (TRTL_EP_FILTER_VLAN)
#else
#define FILTER_TX 0
#endif
static void wrtd_init_tx(void)
{
static const struct trtl_ep_eth_address addr = {
......@@ -474,7 +480,7 @@ static void wrtd_init_tx(void)
.dst_port = WRTD_UDP_PORT,
.src_port = WRTD_UDP_PORT,
.ethertype = 0x800, /* IPv4 */
.filter = 0 /* only the TX path of the endpoint is used */
.filter = FILTER_TX
};
rmq_bind_out(WRTD_RMQ, TRTL_EP_ETH, &addr);
}
......@@ -688,6 +694,11 @@ static void wrtd_route_in(struct wrtd_event *ev)
#endif
#if WRTD_NET_RX > 0
#ifdef WRTD_NET_VLAN
#define FILTER_RX (TRTL_EP_FILTER_VLAN_DIS)
#else
#define FILTER_RX 0
#endif
static void wrtd_init_rx(void)
{
static const struct trtl_ep_eth_address addr = {
......@@ -699,6 +710,7 @@ static void wrtd_init_rx(void)
| TRTL_EP_FILTER_DST_PORT
| TRTL_EP_FILTER_ETHERTYPE
| TRTL_EP_FILTER_DST_IP
| FILTER_RX
| TRTL_EP_FILTER_ENABLE)
};
rmq_bind_in(WRTD_RMQ, TRTL_EP_ETH, &addr);
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment