1 #ifndef __LWIP_DRIVER_H_
2 #define __LWIP_DRIVER_H_
4 #include <minix/endpoint.h>
10 #define DRV_NAME_LEN DS_MAX_KEYLEN
12 #define TX_IOVEC_NUM 16 /* something the drivers assume */
15 struct packet_q
* next
;
22 #define DRV_RECEIVING 2
26 char name
[NIC_NAME_LEN
];
27 char drv_name
[DRV_NAME_LEN
];
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
;
40 unsigned int max_pkt_sz
;
41 unsigned int 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_ */