minix/servers/inet/generic/eth_int.h

62 lines
1.5 KiB
C
Raw Normal View History

2005-04-21 16:53:53 +02:00
/*
eth_int.h
Copyright 1995 Philip Homburg
*/
#ifndef ETH_INT_H
#define ETH_INT_H
#define ETH_TYPE_HASH_NR 16
#define ETH_VLAN_HASH_NR 16
/* Assume that the arguments are a local variable */
#define ETH_HASH_VLAN(v,t) \
((t)= (((v) >> 8) ^ (v)), \
(t)= (((t) >> 4) ^ (t)), \
(t) & (ETH_VLAN_HASH_NR-1))
2005-04-21 16:53:53 +02:00
typedef struct eth_port
{
int etp_flags;
ether_addr_t etp_ethaddr;
acc_t *etp_wr_pack, *etp_rd_pack;
struct eth_fd *etp_sendq_head;
struct eth_fd *etp_sendq_tail;
2005-04-21 16:53:53 +02:00
struct eth_fd *etp_type_any;
struct eth_fd *etp_type[ETH_TYPE_HASH_NR];
event_t etp_sendev;
/* VLAN support */
u16_t etp_vlan;
struct eth_port *etp_vlan_port;
struct eth_port *etp_vlan_tab[ETH_VLAN_HASH_NR];
struct eth_port *etp_vlan_next;
2005-04-21 16:53:53 +02:00
osdep_eth_port_t etp_osdep;
} eth_port_t;
#define EPF_EMPTY 0x0
#define EPF_ENABLED 0x1
#define EPF_READ_IP 0x20
#define EPF_READ_SP 0x40
extern eth_port_t *eth_port_table;
extern int no_ethWritePort; /* debug, consistency check */
2005-04-21 16:53:53 +02:00
void osdep_eth_init ARGS(( void ));
int eth_get_stat ARGS(( eth_port_t *eth_port, eth_stat_t *eth_stat ));
void eth_write_port ARGS(( eth_port_t *eth_port, acc_t *pack ));
void eth_arrive ARGS(( eth_port_t *port, acc_t *pack, size_t pack_size ));
void eth_set_rec_conf ARGS(( eth_port_t *eth_port, u32_t flags ));
void eth_restart_write ARGS(( eth_port_t *eth_port ));
void eth_loop_ev ARGS(( event_t *ev, ev_arg_t ev_arg ));
void eth_reg_vlan ARGS(( eth_port_t *eth_port, eth_port_t *vlan_port ));
2005-04-21 16:53:53 +02:00
#endif /* ETH_INT_H */
/*
* $PchId: eth_int.h,v 1.9 2001/04/23 08:04:06 philip Exp $
2005-04-21 16:53:53 +02:00
*/