📄 lan_type.h
字号:
/* @(#) pSOSystem x86/V2.5.0: bsps/devices/lan/lan_type.h 4.2 99/04/02 11:51:08 */
/************************************************************************/
/* */
/* MODULE: lan_type.h */
/* DATE: 99/04/02 */
/* PURPOSE: Network Interface Driver Header File */
/* */
/*----------------------------------------------------------------------*/
/* */
/* Copyright 1994, Integrated Systems Inc. */
/* ALL RIGHTS RESERVED */
/* */
/* Permission is hereby granted to licensees of pNA to use or */
/* abstract the following computer program for the sole purpose of */
/* implementing their pNA based software products. No other */
/* rights to reproduce, use or disseminate this computer program, */
/* whether in part or in whole, is granted. */
/* */
/* Integrated Systems Inc. makes no representation or warranties */
/* with respect to the performance of this computer program, and */
/* specifically disclaims any responsibility for any damages, */
/* special or consequential, connected with the use of this program. */
/* */
/*----------------------------------------------------------------------*/
/* */
/* */
/************************************************************************/
#if __cplusplus
extern "C" {
#endif
#ifndef __LAN_TYPE_H
#define __LAN_TYPE_H 1
/*----------------------------------------------------------------------*/
/* special packet sizes */
/*----------------------------------------------------------------------*/
#define RUNT 60 /* minimum transmit data length */
#define GIANT 1514 /* 1500 + 14 */
#define BUFSIZE 1508 /* 4 for CRC, 4 for the hell */
#ifdef __CADUL__
#pragma noalign
#endif
#ifdef __DIAB
#pragma pack(1)
#endif
typedef struct {
UCHAR ea_bytes[6];
} e_addr;
/*----------------------------------------------------------------------*/
/* Ethernet header structure */
/*----------------------------------------------------------------------*/
struct etheader {
e_addr daddr; /* destination address */
e_addr saddr; /* source address */
unsigned short type; /* packet type */
};
#ifdef __CADUL__
#pragma align
#endif
#ifdef __DIAB
#pragma pack()
#endif
#define ETH_HEADER_SIZE 14
/*----------------------------------------------------------------------*/
/* driver receive buffer structure */
/*----------------------------------------------------------------------*/
struct rbcb {
struct rbcb *next;
unsigned long pktsize;
unsigned short dev_num;
struct etheader eth;
char buf[BUFSIZE];
};
/*----------------------------------------------------------------------*/
/* driver transmit buffer structure */
/*----------------------------------------------------------------------*/
struct tbcb {
struct tbcb *next;
unsigned long pktsize;
struct etheader eth;
mblk_t * msg;
};
/*----------------------------------------------------------------------*/
/* statistics for lance operations */
/*----------------------------------------------------------------------*/
struct lance_stat {
/* operational statistics */
unsigned long l_rcv; /* # of frames received */
unsigned long l_xmit; /* # of frames sent */
/* receiver statistics */
unsigned long r_crc; /* crc error */
unsigned long r_fram; /* frame error */
unsigned long r_orun; /* fifo overrun */
unsigned long r_miss; /* missed packet */
unsigned long r_oflo; /* ring overflow */
unsigned long r_nobufs; /* no msg blocks */
unsigned long r_runt; /* Runt Frame */
unsigned long r_too_long; /* Frame too long */
unsigned long r_other; /* other rcv errors */
/* transmitter statistics */
unsigned long t_cerr; /* collision error */
unsigned long t_lcar; /* lost carrier */
unsigned long t_urun; /* fifo underrun */
unsigned long t_nobufs; /* no xmit buffers */
unsigned long t_abort; /* xmit aborted */
unsigned long t_other; /* other xmit errors */
};
/*----------------------------------------------------------------------*/
/* Lan Interface Configuration */
/*----------------------------------------------------------------------*/
struct lan_cfg_info {
unsigned long int_lev;
unsigned long io_base;
unsigned long ram_base;
unsigned long ram_size;
char dma_chan;
char bus_16bit; /* 8 bit or 16 bit */
char soft_cfg; /* is soft-configurale */
};
typedef struct MCTable_struct
{
UCHAR *mc_addr;
ULONG *mc_refs;
ULONG max_num;
ULONG num_used;
} MCAST;
/*----------------------------------------------------------------------*/
/* Lan Interface Common Information */
/*----------------------------------------------------------------------*/
typedef struct lan_intf {
long if_num;
long dev_num;
e_addr if_enet_addr;
e_addr if_broad_addr;
struct ni_funcs if_ni_funcs;
long (*if_announce)(); /* Announce_packe function */
long if_flags;
long intf_flags; /* used by driver internally */
struct lan_cfg_info *lan_cfg;
void *nic_intf;
long mcast_num; /* number of multicast addr. */
MCAST *lan_mcast; /* Multicast address table */
} LAN_INTF;
#define BOARDCAST_ENA 1
#define MULTICAST_ENA 2
#endif /* __LAN_TYPE_H */
#if __cplusplus
}
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -