phys addr arg of 0 must be possible for pt_writemap too (instead of meaning
[minix.git] / servers / inet / generic / eth_int.h
blobb8354dbb7c4b6fd12f6829321022613e6db24a30
1 /*
2 eth_int.h
4 Copyright 1995 Philip Homburg
5 */
7 #ifndef ETH_INT_H
8 #define ETH_INT_H
10 #define ETH_TYPE_HASH_NR 16
11 #define ETH_VLAN_HASH_NR 16
13 /* Assume that the arguments are a local variable */
14 #define ETH_HASH_VLAN(v,t) \
15 ((t)= (((v) >> 8) ^ (v)), \
16 (t)= (((t) >> 4) ^ (t)), \
17 (t) & (ETH_VLAN_HASH_NR-1))
19 typedef struct eth_port
21 int etp_flags;
22 ether_addr_t etp_ethaddr;
23 acc_t *etp_wr_pack, *etp_rd_pack;
24 acc_t *etp_getstat;
25 struct eth_fd *etp_sendq_head;
26 struct eth_fd *etp_sendq_tail;
27 struct eth_fd *etp_type_any;
28 struct eth_fd *etp_type[ETH_TYPE_HASH_NR];
29 event_t etp_sendev;
31 /* VLAN support */
32 u16_t etp_vlan;
33 struct eth_port *etp_vlan_port;
34 struct eth_port *etp_vlan_tab[ETH_VLAN_HASH_NR];
35 struct eth_port *etp_vlan_next;
37 osdep_eth_port_t etp_osdep;
38 } eth_port_t;
40 #define EPF_EMPTY 0x0
41 #define EPF_ENABLED 0x1
42 #define EPF_GOT_ADDR 0x2 /* Got ethernet address from device */
43 #define EPF_READ_IP 0x20
44 #define EPF_READ_SP 0x40
46 extern eth_port_t *eth_port_table;
48 extern int no_ethWritePort; /* debug, consistency check */
50 void osdep_eth_init ARGS(( void ));
51 int eth_get_stat ARGS(( eth_port_t *eth_port, eth_stat_t *eth_stat ));
52 void eth_write_port ARGS(( eth_port_t *eth_port, acc_t *pack ));
53 void eth_arrive ARGS(( eth_port_t *port, acc_t *pack, size_t pack_size ));
54 void eth_set_rec_conf ARGS(( eth_port_t *eth_port, u32_t flags ));
55 void eth_restart_write ARGS(( eth_port_t *eth_port ));
56 void eth_loop_ev ARGS(( event_t *ev, ev_arg_t ev_arg ));
57 void eth_reg_vlan ARGS(( eth_port_t *eth_port, eth_port_t *vlan_port ));
58 void eth_restart_ioctl ARGS(( eth_port_t *eth_port ));
60 #endif /* ETH_INT_H */
63 * $PchId: eth_int.h,v 1.9 2001/04/23 08:04:06 philip Exp $