diff options
Diffstat (limited to 'sys/scsi/scsiconf.h')
-rw-r--r-- | sys/scsi/scsiconf.h | 49 |
1 files changed, 36 insertions, 13 deletions
diff --git a/sys/scsi/scsiconf.h b/sys/scsi/scsiconf.h index 244ff1817a7..9ad7ff3bac1 100644 --- a/sys/scsi/scsiconf.h +++ b/sys/scsi/scsiconf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: scsiconf.h,v 1.106 2009/11/05 03:33:52 marco Exp $ */ +/* $OpenBSD: scsiconf.h,v 1.107 2009/11/10 10:13:08 dlg Exp $ */ /* $NetBSD: scsiconf.h,v 1.35 1997/04/02 02:29:38 mycroft Exp $ */ /* @@ -53,6 +53,7 @@ #include <sys/queue.h> #include <sys/timeout.h> #include <sys/workq.h> +#include <sys/mutex.h> #include <machine/cpu.h> #include <scsi/scsi_debug.h> @@ -234,20 +235,31 @@ _4ltol(u_int8_t *bytes) #define DEVID_T10 3 struct devid { - int d_type; - u_int d_len; - u_int8_t *d_id; + u_int8_t d_type; + u_int8_t d_flags; +#define DEVID_F_PRINT (1<<0) + u_int8_t d_refcount; + u_int8_t d_len; + + /* + * the devid struct is basically a header, the actual id is allocated + * immediately after it. + */ }; -#define DEVID_CMP(_a, _b) ( \ - (_a) != NULL && \ - (_b) != NULL && \ - (_a)->d_type != DEVID_NONE && \ - (_a)->d_type == (_b)->d_type && \ - (_a)->d_len == (_b)->d_len && \ - bcmp((_a)->d_id, (_b)->d_id, (_a)->d_len) == 0 \ +#define DEVID_CMP(_a, _b) ( \ + (_a) != NULL && (_b) != NULL && \ + ((_a) == (_b) || \ + ((_a)->d_type != DEVID_NONE && \ + (_a)->d_type == (_b)->d_type && \ + (_a)->d_len == (_b)->d_len && \ + bcmp((_a) + 1, (_b) + 1, (_a)->d_len) == 0)) \ ) +struct devid * devid_alloc(u_int8_t, u_int8_t, u_int8_t, u_int8_t *); +struct devid * devid_copy(struct devid *); +void devid_free(struct devid *); + /* * The following documentation tries to describe the relationship between the * various structures defined in this file: @@ -339,7 +351,6 @@ struct scsi_link { u_int64_t node_wwn; /* world wide name of node */ u_int16_t adapter_target; /* what are we on the scsi bus */ u_int16_t adapter_buswidth; /* 8 (regular) or 16 (wide). (0 becomes 8) */ - u_int16_t active; /* operations in progress */ u_int16_t flags; /* flags that all devices have */ #define SDEV_REMOVABLE 0x0001 /* media is removable */ #define SDEV_MEDIA_LOADED 0x0002 /* device figures are still valid */ @@ -368,7 +379,8 @@ struct scsi_link { void *adapter_softc; /* needed for call to foo_scsi_cmd */ struct scsibus_softc *bus; /* link to the scsibus we're on */ struct scsi_inquiry_data inqdata; /* copy of INQUIRY data from probe */ - struct devid id; + struct devid *id; + struct mutex mtx; }; int scsiprint(void *, const char *); @@ -444,6 +456,8 @@ struct scsi_xfer { * timeout structure for hba's to use for a command */ struct timeout stimeout; + void *cookie; + void (*done)(struct scsi_xfer *); }; /* @@ -557,14 +571,23 @@ int scsi_detach_lun(struct scsibus_softc *, int, int, int); int scsi_req_probe(struct scsibus_softc *, int, int); int scsi_req_detach(struct scsibus_softc *, int, int, int); +void scsi_activate(struct scsibus_softc *, int, int, int); + extern const u_int8_t version_to_spc[]; #define SCSISPC(x)(version_to_spc[(x) & SID_ANSII]) +struct scsi_xfer * scsi_xs_get(struct scsi_link *, int); +void scsi_xs_exec(struct scsi_xfer *); +void scsi_xs_put(struct scsi_xfer *); + /* * Entrypoints for multipathing */ int mpath_path_attach(struct scsi_link *); int mpath_path_detach(struct scsi_link *, int); +void mpath_path_activate(struct scsi_link *); +void mpath_path_deactivate(struct scsi_link *); + #endif /* _KERNEL */ #endif /* SCSI_SCSICONF_H */ |