123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178 |
- #ifndef _SCSI_SAFTE_H_
- #define _SCSI_SAFTE_H_
- #define SAFTE_EXTRA_OFFSET 0x05
- struct safte_inq {
- u_int8_t uniqueid[7];
- u_int8_t chanid;
- u_int8_t ident[6];
- #define SAFTE_IDENT "SAF-TE"
- u_int8_t revision[4];
- #ifdef notyet
- u_int8_t reserved[2];
- #endif
- } __packed;
- #define SAFTE_INQ_LEN 54
- struct safte_readbuf_cmd {
- u_int8_t opcode;
- u_int8_t flags;
- #define SAFTE_RD_LUNMASK 0xe0
- #define SAFTE_RD_MODEMASK 0x07
- #define SAFTE_RD_MODE 0x01
- u_int8_t bufferid;
- #define SAFTE_RD_CONFIG 0x00
- #define SAFTE_RD_ENCSTAT 0x01
- #define SAFTE_RD_USAGE 0x02
- #define SAFTE_RD_INSERTS 0x03
- #define SAFTE_RD_SLOTSTAT 0x04
- #define SAFTE_RD_GLOBALS 0x05
- u_int32_t reserved1;
- u_int16_t length;
- u_int8_t reserved2;
- } __packed;
- struct safte_writebuf_cmd {
- u_int8_t opcode;
- u_int8_t flags;
- #define SAFTE_WR_LUNMASK 0xe0
- #define SAFTE_WR_MODEMASK 0x07
- #define SAFTE_WR_MODE 0x01
- u_int8_t reserved1[5];
- u_int16_t length;
- u_int8_t reserved2;
- } __packed;
- #define SAFTE_WRITE_SLOTSTAT 0x10
- #define SAFTE_WRITE_SETID 0x11
- #define SAFTE_WRITE_SLOTOP 0x12
- #define SAFTE_WRITE_FANSPEED 0x13
- #define SAFTE_WRITE_PWRSUP 0x14
- #define SAFTE_WRITE_GLOBALS 0x15
- struct safte_config {
- u_int8_t nfans;
- u_int8_t npwrsup;
- u_int8_t nslots;
- u_int8_t doorlock;
- u_int8_t ntemps;
- u_int8_t alarm;
- u_int8_t therm;
- #define SAFTE_CFG_CELSIUSMASK 0x80
- #define SAFTE_CFG_CELSIUS(a) ((a) & SAFTE_CFG_CELSIUSMASK ? 1 : 0)
- #define SAFTE_CFG_NTHERMMASK 0x0f
- #define SAFTE_CFG_NTHERM(a) ((a) & SAFTE_CFG_NTHERMMASK)
- u_int8_t reserved[56];
- u_int8_t vendor_bytes;
- } __packed;
- #define SAFTE_CONFIG_LEN sizeof(struct safte_config)
- #define SAFTE_FAN_OP 0x00
- #define SAFTE_FAN_MF 0x01
- #define SAFTE_FAN_NOTINST 0x02
- #define SAFTE_FAN_UNKNOWN 0x80
- #define SAFTE_PWR_OP_ON 0x00
- #define SAFTE_PWR_OP_OFF 0x01
- #define SAFTE_PWR_MF_ON 0x10
- #define SAFTE_PWR_MF_OFF 0x11
- #define SAFTE_PWR_NOTINST 0x20
- #define SAFTE_PWR_PRESENT 0x21
- #define SAFTE_PWR_UNKNOWN 0x80
- #define SAFTE_DOOR_LOCKED 0x00
- #define SAFTE_DOOR_UNLOCKED 0x01
- #define SAFTE_DOOR_UNKNOWN 0x80
- #define SAFTE_SPKR_OFF 0x00
- #define SAFTE_SPKR_ON 0x01
- #define SAFTE_TEMP_OFFSET -10
- #define SAFTE_TEMP_ETA 0x8000
- struct safte_usage {
- u_int32_t minutes;
- u_int32_t cycles;
- u_int8_t reserved[7];
- u_int8_t vendor_bytes;
- };
- #define SAFTE_SLOTSTAT_INSERT (1<<0)
- #define SAFTE_SLOTSTAT_SWAP (1<<1)
- #define SAFTE_SLOTSTAT_OPER (1<<2)
- struct safte_globals {
- u_int8_t flags1;
- #define SAFTE_GLOBAL_ALARM (1<<0)
- #define SAFTE_GLOBAL_FAILURE (1<<1)
- #define SAFTE_GLOBAL_WARNING (1<<2)
- #define SAFTE_GLOBAL_POWER (1<<3)
- #define SAFTE_GLOBAL_COOLING (1<<4)
- #define SAFTE_GLOBAL_PWRFAIL (1<<5)
- #define SAFTE_GLOBAL_DRVFAIL (1<<6)
- #define SAFTE_GLOBAL_DRVWARN (1<<6)
- u_int8_t flags2;
- #define SAFTE_GLOBAL_ARRAYFAIL (1<<0)
- #define SAFTE_GLOBAL_ARRAYWARN (1<<1)
- #define SAFTE_GLOBAL_LOCK (1<<2)
- #define SAFTE_GLOBAL_IDENTIFY (1<<3)
- u_int8_t flags3;
- u_int8_t reserved[13];
- };
- struct safte_slotop {
- u_int8_t opcode;
- u_int8_t slot;
- u_int8_t flags;
- #define SAFTE_SLOTOP_OPERATE (1<<0)
- #define SAFTE_SLOTOP_INSREM (1<<1)
- #define SAFTE_SLOTOP_IDENTIFY (1<<2)
- u_int8_t reserved[61];
- } __packed;
- #endif
|