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
;
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
];
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
;
36 osdep_eth_port_t etp_osdep
;
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
45 extern eth_port_t
*eth_port_table
;
47 extern int no_ethWritePort
; /* debug, consistency check */
49 void osdep_eth_init
ARGS(( void ));
50 int eth_get_stat
ARGS(( eth_port_t
*eth_port
, eth_stat_t
*eth_stat
));
51 void eth_write_port
ARGS(( eth_port_t
*eth_port
, acc_t
*pack
));
52 void eth_arrive
ARGS(( eth_port_t
*port
, acc_t
*pack
, size_t pack_size
));
53 void eth_set_rec_conf
ARGS(( eth_port_t
*eth_port
, u32_t flags
));
54 void eth_restart_write
ARGS(( eth_port_t
*eth_port
));
55 void eth_loop_ev
ARGS(( event_t
*ev
, ev_arg_t ev_arg
));
56 void eth_reg_vlan
ARGS(( eth_port_t
*eth_port
, eth_port_t
*vlan_port
));
57 void eth_restart_ioctl
ARGS(( eth_port_t
*eth_port
));
59 #endif /* ETH_INT_H */
62 * $PchId: eth_int.h,v 1.9 2001/04/23 08:04:06 philip Exp $