1 /* 2 * Copyright (c) 2006-2021, RT-Thread Development Team 3 * 4 * SPDX-License-Identifier: Apache-2.0 5 * 6 * Change Logs: 7 * Date Author Notes 8 * 2021-06-15 Sherman the first version 9 */ 10 11 #include <rtthread.h> 12 #include <rtlink.h> 13 14 #define RT_LINK_RX_NONBLOCKING 0x1000 15 #define RT_LINK_RX_BLOCKING 0x2000 16 #define RT_LINK_TX_NONBLOCKING 0x4000 17 #define RT_LINK_TX_BLOCKING 0x8000 18 #define RT_LINK_DEVICE_MASK 0xf000 19 20 struct rtlink_recv_list 21 { 22 void *data; 23 rt_size_t size; 24 rt_size_t index; 25 struct rt_slist_node list; 26 }; 27 28 struct rt_link_device 29 { 30 struct rt_device parent; 31 struct rt_link_service service; 32 struct rt_slist_node recv_head; /* recv data list, struct rtlink_recv_list */ 33 }; 34 35 /* 36 * rtlink device register 37 */ 38 rt_err_t rt_link_dev_register(struct rt_link_device *rtlink, 39 const char *name, 40 rt_uint32_t flag, 41 void *data); 42