1 /** @file 2 * @brief CANBUS Sockets related functions 3 */ 4 5 /* 6 * Copyright (c) 2019 Intel Corporation 7 * 8 * SPDX-License-Identifier: Apache-2.0 9 */ 10 11 #include <zephyr/logging/log.h> 12 LOG_MODULE_REGISTER(net_sockets_can, CONFIG_NET_SOCKETS_LOG_LEVEL); 13 14 #include <errno.h> 15 #include <zephyr/net/net_pkt.h> 16 #include <zephyr/net/net_context.h> 17 #include <zephyr/net/socketcan.h> 18 19 #include "connection.h" 20 net_canbus_socket_input(struct net_pkt * pkt)21enum net_verdict net_canbus_socket_input(struct net_pkt *pkt) 22 { 23 __ASSERT_NO_MSG(net_pkt_family(pkt) == AF_CAN); 24 25 if (net_if_l2(net_pkt_iface(pkt)) == &NET_L2_GET_NAME(CANBUS_RAW)) { 26 return net_conn_input(pkt, NULL, CAN_RAW, NULL); 27 } 28 29 return NET_CONTINUE; 30 } 31