-/* $OpenBSD: scsi_base.c,v 1.185 2010/07/22 05:21:58 matthew Exp $ */
+/* $OpenBSD: scsi_base.c,v 1.186 2010/07/24 04:01:52 matthew Exp $ */
/* $NetBSD: scsi_base.c,v 1.43 1997/04/02 02:29:36 mycroft Exp $ */
/*
#define DECODE_ASC_ASCQ 2
#define DECODE_SKSV 3
-int scsi_running = 0;
struct pool scsi_xfer_pool;
struct pool scsi_plug_pool;
void
scsi_init()
{
- if (scsi_running++)
+ static int scsi_init_done;
+
+ if (scsi_init_done)
return;
+ scsi_init_done = 1;
#if defined(SCSI_DELAY) && SCSI_DELAY > 0
/* Historical. Older buses may need a moment to stabilize. */
pool_put(&scsi_plug_pool, p);
}
-void
-scsi_deinit()
-{
- if (--scsi_running)
- return;
-}
-
int
scsi_sem_enter(struct mutex *mtx, u_int *running)
{
-/* $OpenBSD: scsiconf.c,v 1.161 2010/07/01 05:11:18 krw Exp $ */
+/* $OpenBSD: scsiconf.c,v 1.162 2010/07/24 04:01:52 matthew Exp $ */
/* $NetBSD: scsiconf.c,v 1.57 1996/05/02 01:09:01 neil Exp $ */
/*
KASSERT(SLIST_EMPTY(&sb->sc_link));
- /* Free shared data. */
- scsi_deinit();
-
return (0);
}
-/* $OpenBSD: scsiconf.h,v 1.132 2010/07/22 00:31:06 krw Exp $ */
+/* $OpenBSD: scsiconf.h,v 1.133 2010/07/24 04:01:52 matthew Exp $ */
/* $NetBSD: scsiconf.h,v 1.35 1997/04/02 02:29:38 mycroft Exp $ */
/*
workq_add_task(NULL, (_fl), (_f), (_a1), (_a2))
void scsi_init(void);
-void scsi_deinit(void);
daddr64_t scsi_size(struct scsi_link *, int, u_int32_t *);
int scsi_test_unit_ready(struct scsi_link *, int, int);
int scsi_inquire(struct scsi_link *, struct scsi_inquiry_data *, int);