net: l2: canbus: Add support for canbus Ethernet translator
This commit adds support for a 6LoCAN Ethernet border translator. CAN frames with the translator CAN address are translated and forwarded to Ethernet. Ethernet frames with the first 34 bits matching the MAC address of the translator are translated and forwarded to 6LoCAN. Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
This commit is contained in:
parent
64d495df45
commit
d864f5de5b
5 changed files with 633 additions and 41 deletions
|
@ -20,6 +20,9 @@ LOG_MODULE_REGISTER(net_ethernet, CONFIG_NET_L2_ETHERNET_LOG_LEVEL);
|
|||
#endif
|
||||
|
||||
#include <syscall_handler.h>
|
||||
#if defined(CONFIG_NET_L2_CANBUS_ETH_TRANSLATOR)
|
||||
#include <net/can.h>
|
||||
#endif
|
||||
|
||||
#include "arp.h"
|
||||
#include "eth_stats.h"
|
||||
|
@ -244,6 +247,12 @@ static enum net_verdict ethernet_recv(struct net_if *iface,
|
|||
net_pkt_lladdr_dst(pkt));
|
||||
}
|
||||
|
||||
#if defined(CONFIG_NET_L2_CANBUS_ETH_TRANSLATOR)
|
||||
if (net_canbus_translate_eth_frame(iface, pkt) == NET_OK) {
|
||||
return NET_OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!net_eth_is_addr_broadcast((struct net_eth_addr *)lladdr->addr) &&
|
||||
!net_eth_is_addr_multicast((struct net_eth_addr *)lladdr->addr) &&
|
||||
!net_eth_is_addr_lldp_multicast(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue