|
17 | 17 |
|
18 | 18 | struct eth_device |
19 | 19 | { |
20 | | - /* inherit from rt_device */ |
21 | | - struct rt_device parent; |
| 20 | + /* inherit from rt_device */ |
| 21 | + struct rt_device parent; |
22 | 22 |
|
23 | | - /* network interface for lwip */ |
24 | | - struct netif *netif; |
25 | | - struct rt_semaphore tx_ack; |
| 23 | + /* network interface for lwip */ |
| 24 | + struct netif *netif; |
| 25 | + struct rt_semaphore tx_ack; |
26 | 26 |
|
27 | | - rt_uint16_t flags; |
28 | | - rt_uint8_t link_changed; |
29 | | - rt_uint8_t link_status; |
| 27 | + rt_uint16_t flags; |
| 28 | + rt_uint8_t link_changed; |
| 29 | + rt_uint8_t link_status; |
30 | 30 |
|
31 | | - /* eth device interface */ |
32 | | - struct pbuf* (*eth_rx)(rt_device_t dev); |
33 | | - rt_err_t (*eth_tx)(rt_device_t dev, struct pbuf* p); |
| 31 | + /* eth device interface */ |
| 32 | + struct pbuf* (*eth_rx)(rt_device_t dev); |
| 33 | + rt_err_t (*eth_tx)(rt_device_t dev, struct pbuf* p); |
34 | 34 | }; |
35 | 35 |
|
36 | | -rt_err_t eth_device_ready(struct eth_device* dev); |
37 | | -rt_err_t eth_device_init(struct eth_device * dev, char *name); |
38 | | -rt_err_t eth_device_init_with_flag(struct eth_device *dev, char *name, rt_uint16_t flag); |
39 | | -rt_err_t eth_device_linkchange(struct eth_device* dev, rt_bool_t up); |
| 36 | +#ifdef __cplusplus |
| 37 | +extern "C" { |
| 38 | +#endif |
| 39 | + |
| 40 | + rt_err_t eth_device_ready(struct eth_device* dev); |
| 41 | + rt_err_t eth_device_init(struct eth_device * dev, const char *name); |
| 42 | + rt_err_t eth_device_init_with_flag(struct eth_device *dev, const char *name, rt_uint16_t flag); |
| 43 | + rt_err_t eth_device_linkchange(struct eth_device* dev, rt_bool_t up); |
40 | 44 |
|
41 | | -int eth_system_device_init(void); |
| 45 | + int eth_system_device_init(void); |
| 46 | + |
| 47 | +#ifdef __cplusplus |
| 48 | +} |
| 49 | +#endif |
42 | 50 |
|
43 | 51 | #endif /* __NETIF_ETHERNETIF_H__ */ |
0 commit comments