1 /* $NetBSD: scsi_ctron_ether.h,v 1.6.48.1 2005/02/04 11:47:23 skrll Exp $ */
4 * SCSI interface description
12 #define CTRON_ETHERCMD2(OP, SUB) {OP, SUB}
13 #define CTRON_ETHER_SEND CTRON_ETHERCMD2(0xc, 0x1)
14 #define CTRON_ETHER_RECV 0xe1
15 #define CTRON_ETHER_GET_ADDR CTRON_ETHERCMD2(0xc, 0x4)
16 #define CTRON_ETHER_ADD_PROTO CTRON_ETHERCMD2(0xd, 0x1)
17 #define CTRON_ETHER_REM_PROTO CTRON_ETHERCMD2(0xd, 0x2)
18 #define CTRON_ETHER_SET_MODE CTRON_ETHERCMD2(0xd, 0x3)
19 #define CTRON_ETHER_SET_MULTI CTRON_ETHERCMD2(0xd, 0x4)
20 #define CTRON_ETHER_REMOVE_MULTI CTRON_ETHERCMD2(0xd, 0x5)
21 #define CTRON_ETHER_GET_STATS CTRON_ETHERCMD2(0xd, 0x6)
22 #define CTRON_ETHER_SET_MEDIA CTRON_ETHERCMD2(0xd, 0x07)
23 #define CTRON_ETHER_GET_MEDIA CTRON_ETHERCMD2(0xd, 0x08)
24 #define CTRON_ETHER_SET_ADDR CTRON_ETHERCMD2(0xd, 0xA)
25 #define CTRON_ETHER_LOAD_IMAGE CTRON_ETHERCMD2(0xd, 0x09)
26 #define IS_RECV(generic) ((generic)->opcode == 0xe1)
27 #define IS_SEND(generic) ((generic)->opcode == 0xc && (generic)->bytes[0] == 0x1)
29 struct scsi_ctron_ether_recv
{
30 u_int8_t opcode
; /* This really *is* all */
33 struct scsi_ctron_ether_generic
{
40 struct scsi_ctron_ether_set_mode
{
49 u_int32_t frames_xmit
;
51 u_int32_t ucast_xmit
; /* never incremented? */
52 u_int32_t mcast_xmit
; /* gets ucasts and mcasts?? */
57 u_int32_t tot_xmit_err
;
59 u_int32_t excess_coll
;
60 u_int32_t int_err_xmit
;
62 u_int32_t media_abort
;
65 u_int32_t ucast_rec
; /* never incremented? */
66 u_int32_t mcast_rec
; /* gets ucasts and mcasts?? */
68 u_int32_t tot_rec_err
;
74 u_int32_t int_err_rec
;
78 struct scsi_ctron_ether_inquiry_data
{
80 u_int8_t device
; /* 3 (T_CPU) */
81 u_int8_t dev_qual2
; /* 0 (fixed) */
82 u_int8_t version
; /* 0 */
83 u_int8_t response_format
; /* 0 */
84 u_int8_t additional_len
; /* 75!! */
85 u_int8_t unused
[2]; /* 0, 0 */
86 u_int8_t flags
; /* 0x18 (sync+linked!?) */
87 char vendor
[8]; /* ie; "Cabletrn" or "CABLETRN" */
88 char product
[16]; /* ie; "EA412/...." */
89 char revision
[4]; /* ie; "0100" or "1.00" */
90 char extra
[8]; /* ie; "00.00.19" or "01.00.00" */
92 u_int8_t hwaddr
[6]; /* PROM ethernet addr */
93 u_int8_t swaddr
[6]; /* curr ethernet addr */
94 char date
[22]; /* firmware date string (asciz) */
95 u_int8_t mtype
; /* media type?? */
96 u_int8_t hwport
; /* value of h/w read port?? */
99 enum scsi_ctron_ether_media
{
100 CMEDIA_PRIMARY
=0, /* twisted pair */
101 CMEDIA_SECONDARY
=1, /* coax */
102 CMEDIA_AUTOSENSE
=2 /* set_media command only */