coverity appeasement - redundant check
[minix.git] / servers / lwip / driver.h
blob01d4d3bfd25518ca8bf822cd29b9cbe82097510a
1 #ifndef __LWIP_DRIVER_H_
2 #define __LWIP_DRIVER_H_
4 #include <minix/endpoint.h>
5 #include <minix/ds.h>
7 #include <lwip/pbuf.h>
9 #define NIC_NAME_LEN 6
10 #define DRV_NAME_LEN DS_MAX_KEYLEN
12 #define TX_IOVEC_NUM 16 /* something the drivers assume */
14 struct packet_q {
15 struct packet_q * next;
16 unsigned buf_len;
17 char buf[];
20 #define DRV_IDLE 0
21 #define DRV_SENDING 1
22 #define DRV_RECEIVING 2
24 struct nic {
25 unsigned flags;
26 char name[NIC_NAME_LEN];
27 char drv_name[DRV_NAME_LEN];
28 endpoint_t drv_ep;
29 int is_default;
30 int state;
31 cp_grant_id_t rx_iogrant;
32 iovec_s_t rx_iovec[1];
33 struct pbuf * rx_pbuf;
34 cp_grant_id_t tx_iogrant;
35 iovec_s_t tx_iovec[TX_IOVEC_NUM];
36 struct packet_q * tx_head;
37 struct packet_q * tx_tail;
38 void * tx_buffer;
39 struct netif netif;
40 unsigned max_pkt_sz;
41 unsigned min_pkt_sz;
42 struct socket * raw_socket;
45 int driver_tx_enqueue(struct nic * nic, struct pbuf * pbuf);
46 void driver_tx_dequeue(struct nic * nic);
47 struct packet_q * driver_tx_head(struct nic * nic);
50 * Transmit the next packet in the TX queue of this device. Returns 1 if
51 * success, 0 otherwise.
53 int driver_tx(struct nic * nic);
54 int raw_socket_input(struct pbuf * pbuf, struct nic * nic);
56 #endif /* __LWIP_DRIVER_H_ */