Home | History | Annotate | Line # | Download | only in scsipi
scsi_ctron_ether.h revision 1.3
      1  1.2   thorpej /*	$NetBSD: scsi_ctron_ether.h,v 1.3 1997/04/04 19:02:44 matthias Exp $	*/
      2  1.1   thorpej 
      3  1.1   thorpej /*
      4  1.1   thorpej  * SCSI interface description
      5  1.1   thorpej  */
      6  1.1   thorpej 
      7  1.1   thorpej 
      8  1.1   thorpej /*
      9  1.1   thorpej  * SCSI command format
     10  1.1   thorpej  */
     11  1.1   thorpej 
     12  1.1   thorpej #ifndef	_SCSI_CTRON_ETHER_H
     13  1.1   thorpej #define _SCSI_CTRON_ETHER_H 1
     14  1.1   thorpej 
     15  1.1   thorpej #define CTRON_ETHERCMD2(OP, SUB) {OP, SUB}
     16  1.1   thorpej #define CTRON_ETHER_SEND CTRON_ETHERCMD2(0xc, 0x1)
     17  1.2   thorpej #define CTRON_ETHER_RECV 0xe1
     18  1.1   thorpej #define CTRON_ETHER_GET_ADDR CTRON_ETHERCMD2(0xc, 0x4)
     19  1.1   thorpej #define CTRON_ETHER_ADD_PROTO CTRON_ETHERCMD2(0xd, 0x1)
     20  1.1   thorpej #define CTRON_ETHER_REM_PROTO CTRON_ETHERCMD2(0xd, 0x2)
     21  1.1   thorpej #define CTRON_ETHER_SET_MODE CTRON_ETHERCMD2(0xd, 0x3)
     22  1.1   thorpej #define CTRON_ETHER_SET_MULTI CTRON_ETHERCMD2(0xd, 0x4)
     23  1.1   thorpej #define CTRON_ETHER_REMOVE_MULTI CTRON_ETHERCMD2(0xd, 0x5)
     24  1.1   thorpej #define CTRON_ETHER_GET_STATS CTRON_ETHERCMD2(0xd, 0x6)
     25  1.1   thorpej #define CTRON_ETHER_SET_MEDIA CTRON_ETHERCMD2(0xd, 0x07)
     26  1.1   thorpej #define CTRON_ETHER_GET_MEDIA CTRON_ETHERCMD2(0xd, 0x08)
     27  1.1   thorpej #define CTRON_ETHER_SET_ADDR CTRON_ETHERCMD2(0xd, 0xA)
     28  1.1   thorpej #define CTRON_ETHER_LOAD_IMAGE CTRON_ETHERCMD2(0xd, 0x09)
     29  1.1   thorpej #define IS_RECV(generic) ((generic)->opcode == 0xe1)
     30  1.1   thorpej #define IS_SEND(generic) ((generic)->opcode == 0xc && (generic)->bytes[0] == 0x1)
     31  1.1   thorpej 
     32  1.1   thorpej struct scsi_ctron_ether_recv {
     33  1.1   thorpej 	u_int8_t opcode;	/* This really *is* all */
     34  1.1   thorpej };
     35  1.1   thorpej 
     36  1.1   thorpej struct scsi_ctron_ether_generic {
     37  1.1   thorpej 	u_int8_t opcode[2];
     38  1.1   thorpej 	u_int8_t byte3;
     39  1.1   thorpej 	u_int8_t length[2];
     40  1.1   thorpej 	u_int8_t byte6;
     41  1.1   thorpej };
     42  1.1   thorpej 
     43  1.1   thorpej struct scsi_ctron_ether_set_mode {
     44  1.1   thorpej 	u_int8_t opcode[2];
     45  1.1   thorpej 	u_int8_t mode;
     46  1.1   thorpej 	u_int8_t length[2];
     47  1.1   thorpej 	u_int8_t byte6;
     48  1.1   thorpej };
     49  1.1   thorpej 
     50  1.1   thorpej 
     51  1.1   thorpej struct ctron_stats {
     52  1.3  matthias 	u_int32_t  frames_xmit;
     53  1.3  matthias 	u_int32_t  bytes_xmit;
     54  1.3  matthias 	u_int32_t  ucast_xmit;			/* never incremented? */
     55  1.3  matthias 	u_int32_t  mcast_xmit;			/* gets ucasts and mcasts?? */
     56  1.3  matthias 	u_int32_t  bcast_xmit;
     57  1.3  matthias 	u_int32_t  defer_xmit;
     58  1.3  matthias 	u_int32_t  sgl_coll;
     59  1.3  matthias 	u_int32_t  multi_coll;
     60  1.3  matthias 	u_int32_t  tot_xmit_err;
     61  1.3  matthias 	u_int32_t  late_coll;
     62  1.3  matthias 	u_int32_t  excess_coll;
     63  1.3  matthias 	u_int32_t  int_err_xmit;
     64  1.3  matthias 	u_int32_t  carr_err;
     65  1.3  matthias 	u_int32_t  media_abort;
     66  1.3  matthias 	u_int32_t  frames_rec;
     67  1.3  matthias 	u_int32_t  bytes_rec;
     68  1.3  matthias 	u_int32_t  ucast_rec;			/* never incremented? */
     69  1.3  matthias 	u_int32_t  mcast_rec;			/* gets ucasts and mcasts?? */
     70  1.3  matthias 	u_int32_t  bcast_rec;
     71  1.3  matthias 	u_int32_t  tot_rec_err;
     72  1.3  matthias 	u_int32_t  too_long;
     73  1.3  matthias 	u_int32_t  too_short;
     74  1.3  matthias 	u_int32_t  align_err;
     75  1.3  matthias 	u_int32_t  crc_err;
     76  1.3  matthias 	u_int32_t  len_err;
     77  1.3  matthias 	u_int32_t  int_err_rec;
     78  1.3  matthias 	u_int32_t  sqe_err;
     79  1.1   thorpej };
     80  1.1   thorpej 
     81  1.1   thorpej struct scsi_ctron_ether_inquiry_data {
     82  1.1   thorpej /* standard; */
     83  1.3  matthias 	u_int8_t device;		/* 3 (T_CPU) */
     84  1.3  matthias 	u_int8_t dev_qual2;		/* 0 (fixed) */
     85  1.3  matthias 	u_int8_t version;		/* 0 */
     86  1.3  matthias 	u_int8_t response_format;		/* 0 */
     87  1.3  matthias 	u_int8_t additional_len;	/* 75!! */
     88  1.3  matthias 	u_int8_t unused[2];		/* 0, 0 */
     89  1.3  matthias 	u_int8_t flags; 		/* 0x18 (sync+linked!?) */
     90  1.3  matthias 	char vendor[8]; 		/* ie; "Cabletrn" or "CABLETRN" */
     91  1.3  matthias 	char product[16];		/* ie; "EA412/...." */
     92  1.3  matthias 	char revision[4];		/* ie; "0100" or "1.00" */
     93  1.3  matthias 	char extra[8];			/* ie; "00.00.19" or "01.00.00" */
     94  1.1   thorpej /* non-standard; */
     95  1.3  matthias 	u_int8_t hwaddr[6];		/* PROM ethernet addr */
     96  1.3  matthias 	u_int8_t swaddr[6];		/* curr ethernet addr */
     97  1.3  matthias 	char date[22];			/* firmware date string (asciz) */
     98  1.3  matthias 	u_int8_t mtype; 		/* media type?? */
     99  1.3  matthias 	u_int8_t hwport;		/* value of h/w read port?? */
    100  1.1   thorpej };
    101  1.1   thorpej 
    102  1.1   thorpej enum scsi_ctron_ether_media {
    103  1.3  matthias 	CMEDIA_PRIMARY=0,		/* twisted pair */
    104  1.3  matthias 	CMEDIA_SECONDARY=1,		/* coax */
    105  1.3  matthias 	CMEDIA_AUTOSENSE=2		/* set_media command only */
    106  1.1   thorpej };
    107  1.1   thorpej 
    108  1.1   thorpej #endif /* _SCSI_CTRON_ETHER_H */
    109