diff options
Diffstat (limited to 'sys/scsi')
-rw-r--r-- | sys/scsi/ses.c | 15 | ||||
-rw-r--r-- | sys/scsi/ses.h | 4 |
2 files changed, 8 insertions, 11 deletions
diff --git a/sys/scsi/ses.c b/sys/scsi/ses.c index f59d571356d..d7ce4dd2f51 100644 --- a/sys/scsi/ses.c +++ b/sys/scsi/ses.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ses.c,v 1.22 2005/08/18 12:26:39 dlg Exp $ */ +/* $OpenBSD: ses.c,v 1.23 2005/08/18 21:04:47 marco Exp $ */ /* * Copyright (c) 2005 David Gwynne <dlg@openbsd.org> @@ -148,8 +148,6 @@ ses_match(struct device *parent, void *match, void *aux) (inq->version & SID_ANSII) == SID_ANSII_SCSI3) return (3); - /* XXX apparently we can match on passthrough devs too? */ - return (0); } @@ -399,8 +397,6 @@ ses_read_status(struct ses_softc *sc, int autoconf) sizeof(cmd), sc->sc_buf, sc->sc_buflen, 2, 3000, NULL, flags) != 0) return (1); - /* XXX should we check any values in the status header? */ - return (0); } @@ -607,7 +603,7 @@ ses_write_config(struct ses_softc *sc) memset(&cmd, 0, sizeof(cmd)); cmd.opcode = SEND_DIAGNOSTIC; - cmd.flags |= SES_DIAG_PCV; + cmd.flags |= SES_DIAG_PF; cmd.length = htobe16(sc->sc_buflen); flags = SCSI_DATA_OUT; #ifndef SCSIDEBUG @@ -624,10 +620,8 @@ ses_write_config(struct ses_softc *sc) int ses_bio_blink(struct ses_softc *sc, struct bioc_blink *blink) { -#if notyet struct ses_slot *slot; - /* XXX isnt strictly needed? */ if (ses_read_status(sc, 1) != 0) return (EIO); @@ -640,10 +634,11 @@ ses_bio_blink(struct ses_softc *sc, struct bioc_blink *blink) return (EINVAL); /* zero out the config fields */ - /* XXX previous config is lost */ slot->sl_stat->f2 = 0x00; slot->sl_stat->f3 = 0x00; + slot->sl_stat->com = SES_STAT_SELECT; + switch (blink->bb_status) { case BIOC_SBUNBLINK: break; @@ -662,7 +657,7 @@ ses_bio_blink(struct ses_softc *sc, struct bioc_blink *blink) if (ses_write_config(sc) != 0) return (EIO); -#endif /* notyet */ + return (0); } #endif diff --git a/sys/scsi/ses.h b/sys/scsi/ses.h index 2d3f889634f..5267fe6d1f7 100644 --- a/sys/scsi/ses.h +++ b/sys/scsi/ses.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ses.h,v 1.6 2005/08/18 12:26:40 dlg Exp $ */ +/* $OpenBSD: ses.h,v 1.7 2005/08/18 21:04:47 marco Exp $ */ /* * Copyright (c) 2005 Marco Peereboom * All rights reserved. @@ -34,6 +34,7 @@ struct ses_scsi_diag { u_int8_t opcode; /* SEND_DIAGNOSTIC or RECEIVE_DIAGNOSTIC */ u_int8_t flags; #define SES_DIAG_PCV (1<<0) /* page code valid */ +#define SES_DIAG_PF (1<<4) /* set this bit if page code is valid */ u_int8_t pgcode; #define SES_PAGE_CONFIG 0x01 /* Configuration */ #define SES_PAGE_STATUS 0x02 /* Enclosure Status */ @@ -136,6 +137,7 @@ struct ses_status { #define SES_STAT_SWAP (1<<4) /* element has been swapped */ #define SES_STAT_DISABLED (1<<5) /* disabled */ #define SES_STAT_PRDFAIL (1<<6) /* predicted failure */ +#define SES_STAT_SELECT (1<<7) /* set to modify element */ u_int8_t f1; /* use of these flags depends on the SES_T */ u_int8_t f2; |