4 Copyright 1995 Philip Homburg
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
22 ether_addr_t etp_ethaddr
;
23 acc_t
*etp_wr_pack
, *etp_rd_pack
;
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
];
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
;
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 $