source: trunk/minix/servers/inet/generic/eth_int.h@ 11

Last change on this file since 11 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 1.6 KB
RevLine 
[9]1/*
2eth_int.h
3
4Copyright 1995 Philip Homburg
5*/
6
7#ifndef ETH_INT_H
8#define ETH_INT_H
9
10#define ETH_TYPE_HASH_NR 16
11#define ETH_VLAN_HASH_NR 16
12
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))
18
19typedef struct eth_port
20{
21 int etp_flags;
22 ether_addr_t etp_ethaddr;
23 acc_t *etp_wr_pack, *etp_rd_pack;
24 struct eth_fd *etp_sendq_head;
25 struct eth_fd *etp_sendq_tail;
26 struct eth_fd *etp_type_any;
27 struct eth_fd *etp_type[ETH_TYPE_HASH_NR];
28 event_t etp_sendev;
29
30 /* VLAN support */
31 u16_t etp_vlan;
32 struct eth_port *etp_vlan_port;
33 struct eth_port *etp_vlan_tab[ETH_VLAN_HASH_NR];
34 struct eth_port *etp_vlan_next;
35
36 osdep_eth_port_t etp_osdep;
37} eth_port_t;
38
39#define EPF_EMPTY 0x0
40#define EPF_ENABLED 0x1
41#define EPF_GOT_ADDR 0x2 /* Got ethernet address from device */
42#define EPF_READ_IP 0x20
43#define EPF_READ_SP 0x40
44
45extern eth_port_t *eth_port_table;
46
47extern int no_ethWritePort; /* debug, consistency check */
48
49void osdep_eth_init ARGS(( void ));
50int eth_get_stat ARGS(( eth_port_t *eth_port, eth_stat_t *eth_stat ));
51void eth_write_port ARGS(( eth_port_t *eth_port, acc_t *pack ));
52void eth_arrive ARGS(( eth_port_t *port, acc_t *pack, size_t pack_size ));
53void eth_set_rec_conf ARGS(( eth_port_t *eth_port, u32_t flags ));
54void eth_restart_write ARGS(( eth_port_t *eth_port ));
55void eth_loop_ev ARGS(( event_t *ev, ev_arg_t ev_arg ));
56void eth_reg_vlan ARGS(( eth_port_t *eth_port, eth_port_t *vlan_port ));
57void eth_restart_ioctl ARGS(( eth_port_t *eth_port ));
58
59#endif /* ETH_INT_H */
60
61/*
62 * $PchId: eth_int.h,v 1.9 2001/04/23 08:04:06 philip Exp $
63 */
Note: See TracBrowser for help on using the repository browser.