1 /* 2 * Copyright (c) 2022 Nordic Semiconductor ASA 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 */ 6 7 #include <zephyr/net/net_l2.h> 8 #include <zephyr/net/net_if.h> 9 #include <zephyr/net/offloaded_netdev.h> 10 offloaded_netdev_if_enable(struct net_if * iface,bool state)11static inline int offloaded_netdev_if_enable(struct net_if *iface, bool state) 12 { 13 const struct offloaded_if_api *off_if = net_if_get_device(iface)->api; 14 15 if (!off_if || !(off_if->enable)) { 16 return 0; 17 } 18 19 return off_if->enable(iface, state); 20 } 21 22 NET_L2_INIT(OFFLOADED_NETDEV, NULL, NULL, offloaded_netdev_if_enable, NULL); 23