Expand PMF_FN_* macros.
[netbsd-mini2440.git] / sys / dev / scsipi / scsi_ctron_ether.h
blob9e7b6827c44029979bff33567bcbbdd9920a803d
1 /* $NetBSD: scsi_ctron_ether.h,v 1.6.48.1 2005/02/04 11:47:23 skrll Exp $ */
3 /*
4 * SCSI interface description
5 */
8 /*
9 * SCSI command format
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 {
34 u_int8_t opcode[2];
35 u_int8_t byte3;
36 u_int8_t length[2];
37 u_int8_t byte6;
40 struct scsi_ctron_ether_set_mode {
41 u_int8_t opcode[2];
42 u_int8_t mode;
43 u_int8_t length[2];
44 u_int8_t byte6;
48 struct ctron_stats {
49 u_int32_t frames_xmit;
50 u_int32_t bytes_xmit;
51 u_int32_t ucast_xmit; /* never incremented? */
52 u_int32_t mcast_xmit; /* gets ucasts and mcasts?? */
53 u_int32_t bcast_xmit;
54 u_int32_t defer_xmit;
55 u_int32_t sgl_coll;
56 u_int32_t multi_coll;
57 u_int32_t tot_xmit_err;
58 u_int32_t late_coll;
59 u_int32_t excess_coll;
60 u_int32_t int_err_xmit;
61 u_int32_t carr_err;
62 u_int32_t media_abort;
63 u_int32_t frames_rec;
64 u_int32_t bytes_rec;
65 u_int32_t ucast_rec; /* never incremented? */
66 u_int32_t mcast_rec; /* gets ucasts and mcasts?? */
67 u_int32_t bcast_rec;
68 u_int32_t tot_rec_err;
69 u_int32_t too_long;
70 u_int32_t too_short;
71 u_int32_t align_err;
72 u_int32_t crc_err;
73 u_int32_t len_err;
74 u_int32_t int_err_rec;
75 u_int32_t sqe_err;
78 struct scsi_ctron_ether_inquiry_data {
79 /* standard; */
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" */
91 /* non-standard; */
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 */