Expand struct scsipi_bustype {} in a ABI-backward-compatible way to
pass more informations about the bus: - bustype_type has 2 different bytes, one holding the existing SCSIPI_BUSTYPE_* (scsi, atapi, ata), and one for a per-SCSIPI_BUSTYPE_* subtype. Introduce macros to build or extract bustype_type. - for SCSIPI_BUSTYPE_SCSI, define subtypes for parallel SCSI, Fibre Channel, SAS and USB, to specify the transport method. SCSIPI_BUSTYPE_SCSI_PSCSI is 0 so that bustype_type value doesn't change for existing code - for non-SCSIPI_BUSTYPE_SCSI busses there's no defined subtype yet, so the bustype_type value doesn't change. - provide scsi_fc_bustype, scsi_sas_bustype and scsi_usb_bustype along with scsi_bustype to be used by bus driver where appropriate - scsipi_print_xfer_mode(): more existing code under a (SCSIPI_BUSTYPE_SCSI, SCSIPI_BUSTYPE_SCSI_PSCSI) case, as sync/wide parameters only make sense for parallel SCSI. For (SCSIPI_BUSTYPE_SCSI, SCSIPI_BUSTYPE_SCSI_FC) and (SCSIPI_BUSTYPE_SCSI, SCSIPI_BUSTYPE_SCSI_SAS), only print tagged queing status if enabled. Just be silent for other bustypes. This change is prompted by this problem: right now, FC (e.g. isp(4)) and SAS (e.g. mfi(4)) don't do anything for ADAPTER_REQ_SET_XFER_MODE, and especially never call scsipi_async_event(ASYNC_EVENT_XFER_MODE), so sd(4) always runs untagged. Doing a scsipi_async_event(ASYNC_EVENT_XFER_MODE) with appropriate parameters is enough to enable tagged queuing, but then scsipi will print: sd0: async, 8-bit transfers, tagged queueing which is harmless (async, 8-bit transfers doens't make sense on SAS anyway) but will confuse users. With this change scsipi will only print: sd0: tagged queueing which is correct. In the long run, knowning the underlying transport in scsipi will allow better handling of device which are not parallel SCSI. Another change adding an extra callback to struct scsipi_bustype {} will come (so that scsipi_print_xfer_mode(), which is SCSI-specific, can be moved out of scsipi_base, and split into per-subtype callback), but this will break kernel ABI and so is not suitable for netbsd-6, so will be commmited later. The above is enough to get tagged queuing on FC and SAS in netbsd-6.
This commit is contained in:
parent
b825b96b8e
commit
63d14cff85
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: atapiconf.c,v 1.84 2012/04/06 17:12:45 chs Exp $ */
|
||||
/* $NetBSD: atapiconf.c,v 1.85 2012/04/19 17:45:20 bouyer Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996, 2001 Manuel Bouyer. All rights reserved.
|
||||
@ -25,7 +25,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: atapiconf.c,v 1.84 2012/04/06 17:12:45 chs Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: atapiconf.c,v 1.85 2012/04/19 17:45:20 bouyer Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -117,7 +117,8 @@ atapibusmatch(device_t parent, cfdata_t cf, void *aux)
|
||||
if (chan == NULL)
|
||||
return (0);
|
||||
|
||||
if (chan->chan_bustype->bustype_type != SCSIPI_BUSTYPE_ATAPI)
|
||||
if (SCSIPI_BUSTYPE_TYPE(chan->chan_bustype->bustype_type) !=
|
||||
SCSIPI_BUSTYPE_ATAPI)
|
||||
return (0);
|
||||
|
||||
return (1);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: cd.c,v 1.306 2012/02/25 10:17:14 shattered Exp $ */
|
||||
/* $NetBSD: cd.c,v 1.307 2012/04/19 17:45:20 bouyer Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 2001, 2003, 2004, 2005, 2008 The NetBSD Foundation,
|
||||
@ -50,7 +50,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.306 2012/02/25 10:17:14 shattered Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.307 2012/04/19 17:45:20 bouyer Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -251,8 +251,8 @@ cdattach(device_t parent, device_t self, void *aux)
|
||||
|
||||
mutex_init(&cd->sc_lock, MUTEX_DEFAULT, IPL_NONE);
|
||||
|
||||
if (scsipi_periph_bustype(sa->sa_periph) == SCSIPI_BUSTYPE_SCSI &&
|
||||
periph->periph_version == 0)
|
||||
if (SCSIPI_BUSTYPE_TYPE(scsipi_periph_bustype(sa->sa_periph)) ==
|
||||
SCSIPI_BUSTYPE_SCSI && periph->periph_version == 0)
|
||||
cd->flags |= CDF_ANCIENT;
|
||||
|
||||
bufq_alloc(&cd->buf_queue, "disksort", BUFQ_SORT_RAWBLOCK);
|
||||
@ -1682,7 +1682,7 @@ cdgetdefaultlabel(struct cd_softc *cd, struct cd_formatted_toc *toc,
|
||||
lp->d_ncylinders = (cd->params.disksize / 100) + 1;
|
||||
lp->d_secpercyl = lp->d_ntracks * lp->d_nsectors;
|
||||
|
||||
switch (scsipi_periph_bustype(cd->sc_periph)) {
|
||||
switch (SCSIPI_BUSTYPE_TYPE(scsipi_periph_bustype(cd->sc_periph))) {
|
||||
case SCSIPI_BUSTYPE_SCSI:
|
||||
lp->d_type = DTYPE_SCSI;
|
||||
break;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: scsiconf.c,v 1.265 2012/04/06 22:50:39 christos Exp $ */
|
||||
/* $NetBSD: scsiconf.c,v 1.266 2012/04/19 17:45:20 bouyer Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 1999, 2004 The NetBSD Foundation, Inc.
|
||||
@ -48,7 +48,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.265 2012/04/06 22:50:39 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.266 2012/04/19 17:45:20 bouyer Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -114,7 +114,31 @@ static int scsibusprint(void *, const char *);
|
||||
static void scsibus_config(struct scsipi_channel *, void *);
|
||||
|
||||
const struct scsipi_bustype scsi_bustype = {
|
||||
SCSIPI_BUSTYPE_SCSI,
|
||||
SCSIPI_BUSTYPE_BUSTYPE(SCSIPI_BUSTYPE_SCSI, SCSIPI_BUSTYPE_SCSI_PSCSI),
|
||||
scsi_scsipi_cmd,
|
||||
scsipi_interpret_sense,
|
||||
scsi_print_addr,
|
||||
scsi_kill_pending,
|
||||
};
|
||||
|
||||
const struct scsipi_bustype scsi_fc_bustype = {
|
||||
SCSIPI_BUSTYPE_BUSTYPE(SCSIPI_BUSTYPE_SCSI, SCSIPI_BUSTYPE_SCSI_FC),
|
||||
scsi_scsipi_cmd,
|
||||
scsipi_interpret_sense,
|
||||
scsi_print_addr,
|
||||
scsi_kill_pending,
|
||||
};
|
||||
|
||||
const struct scsipi_bustype scsi_sas_bustype = {
|
||||
SCSIPI_BUSTYPE_BUSTYPE(SCSIPI_BUSTYPE_SCSI, SCSIPI_BUSTYPE_SCSI_SAS),
|
||||
scsi_scsipi_cmd,
|
||||
scsipi_interpret_sense,
|
||||
scsi_print_addr,
|
||||
scsi_kill_pending,
|
||||
};
|
||||
|
||||
const struct scsipi_bustype scsi_usb_bustype = {
|
||||
SCSIPI_BUSTYPE_BUSTYPE(SCSIPI_BUSTYPE_SCSI, SCSIPI_BUSTYPE_SCSI_USB),
|
||||
scsi_scsipi_cmd,
|
||||
scsipi_interpret_sense,
|
||||
scsi_print_addr,
|
||||
@ -153,7 +177,8 @@ scsibusmatch(device_t parent, cfdata_t cf, void *aux)
|
||||
{
|
||||
struct scsipi_channel *chan = aux;
|
||||
|
||||
if (chan->chan_bustype->bustype_type != SCSIPI_BUSTYPE_SCSI)
|
||||
if (SCSIPI_BUSTYPE_TYPE(chan->chan_bustype->bustype_type) !=
|
||||
SCSIPI_BUSTYPE_SCSI)
|
||||
return 0;
|
||||
|
||||
if (cf->cf_loc[SCSICF_CHANNEL] != chan->chan_channel &&
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: scsiconf.h,v 1.56 2008/07/16 18:50:58 drochner Exp $ */
|
||||
/* $NetBSD: scsiconf.h,v 1.57 2012/04/19 17:45:20 bouyer Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 1999, 2004 The NetBSD Foundation, Inc.
|
||||
@ -64,6 +64,9 @@ struct scsibus_softc {
|
||||
#define SCSIBUSF_OPEN 0x00000001 /* bus is open */
|
||||
|
||||
extern const struct scsipi_bustype scsi_bustype;
|
||||
extern const struct scsipi_bustype scsi_fc_bustype;
|
||||
extern const struct scsipi_bustype scsi_sas_bustype;
|
||||
extern const struct scsipi_bustype scsi_usb_bustype;
|
||||
|
||||
int scsi_change_def(struct scsipi_periph *, int);
|
||||
void scsi_kill_pending(struct scsipi_periph *);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: scsipi_base.c,v 1.157 2012/04/18 20:37:49 bouyer Exp $ */
|
||||
/* $NetBSD: scsipi_base.c,v 1.158 2012/04/19 17:45:20 bouyer Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 1999, 2000, 2002, 2003, 2004 The NetBSD Foundation, Inc.
|
||||
@ -31,7 +31,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: scsipi_base.c,v 1.157 2012/04/18 20:37:49 bouyer Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: scsipi_base.c,v 1.158 2012/04/19 17:45:20 bouyer Exp $");
|
||||
|
||||
#include "opt_scsi.h"
|
||||
|
||||
@ -2181,9 +2181,13 @@ scsipi_print_xfer_mode(struct scsipi_periph *periph)
|
||||
if ((periph->periph_flags & PERIPH_MODE_VALID) == 0)
|
||||
return;
|
||||
|
||||
switch(scsipi_periph_bustype(periph)) {
|
||||
case SCSIPI_BUSTYPE_BUSTYPE(
|
||||
SCSIPI_BUSTYPE_SCSI, SCSIPI_BUSTYPE_SCSI_PSCSI):
|
||||
aprint_normal_dev(periph->periph_dev, "");
|
||||
if (periph->periph_mode & (PERIPH_CAP_SYNC | PERIPH_CAP_DT)) {
|
||||
period = scsipi_sync_factor_to_period(periph->periph_period);
|
||||
period =
|
||||
scsipi_sync_factor_to_period(periph->periph_period);
|
||||
aprint_normal("sync (%d.%02dns offset %d)",
|
||||
period / 100, period % 100, periph->periph_offset);
|
||||
} else
|
||||
@ -2191,13 +2195,15 @@ scsipi_print_xfer_mode(struct scsipi_periph *periph)
|
||||
|
||||
if (periph->periph_mode & PERIPH_CAP_WIDE32)
|
||||
aprint_normal(", 32-bit");
|
||||
else if (periph->periph_mode & (PERIPH_CAP_WIDE16 | PERIPH_CAP_DT))
|
||||
else if (
|
||||
periph->periph_mode & (PERIPH_CAP_WIDE16 | PERIPH_CAP_DT))
|
||||
aprint_normal(", 16-bit");
|
||||
else
|
||||
aprint_normal(", 8-bit");
|
||||
|
||||
if (periph->periph_mode & (PERIPH_CAP_SYNC | PERIPH_CAP_DT)) {
|
||||
freq = scsipi_sync_factor_to_freq(periph->periph_period);
|
||||
freq =
|
||||
scsipi_sync_factor_to_freq(periph->periph_period);
|
||||
speed = freq;
|
||||
if (periph->periph_mode & PERIPH_CAP_WIDE32)
|
||||
speed *= 4;
|
||||
@ -2205,9 +2211,10 @@ scsipi_print_xfer_mode(struct scsipi_periph *periph)
|
||||
(PERIPH_CAP_WIDE16 | PERIPH_CAP_DT))
|
||||
speed *= 2;
|
||||
mbs = speed / 1000;
|
||||
if (mbs > 0)
|
||||
aprint_normal(" (%d.%03dMB/s)", mbs, speed % 1000);
|
||||
else
|
||||
if (mbs > 0) {
|
||||
aprint_normal(" (%d.%03dMB/s)", mbs,
|
||||
speed % 1000);
|
||||
} else
|
||||
aprint_normal(" (%dKB/s)", speed % 1000);
|
||||
}
|
||||
|
||||
@ -2217,6 +2224,20 @@ scsipi_print_xfer_mode(struct scsipi_periph *periph)
|
||||
aprint_normal(", tagged queueing");
|
||||
|
||||
aprint_normal("\n");
|
||||
break;
|
||||
case SCSIPI_BUSTYPE_BUSTYPE(
|
||||
SCSIPI_BUSTYPE_SCSI, SCSIPI_BUSTYPE_SCSI_FC):
|
||||
case SCSIPI_BUSTYPE_BUSTYPE(
|
||||
SCSIPI_BUSTYPE_SCSI, SCSIPI_BUSTYPE_SCSI_SAS):
|
||||
if (periph->periph_mode & PERIPH_CAP_TQING) {
|
||||
aprint_normal_dev(periph->periph_dev,
|
||||
"tagged queueing\n");
|
||||
}
|
||||
break;
|
||||
default:
|
||||
/* nothing */
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: scsipi_ioctl.c,v 1.66 2008/07/14 12:36:44 drochner Exp $ */
|
||||
/* $NetBSD: scsipi_ioctl.c,v 1.67 2012/04/19 17:45:20 bouyer Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 2004 The NetBSD Foundation, Inc.
|
||||
@ -37,7 +37,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: scsipi_ioctl.c,v 1.66 2008/07/14 12:36:44 drochner Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: scsipi_ioctl.c,v 1.67 2012/04/19 17:45:20 bouyer Exp $");
|
||||
|
||||
#include "opt_compat_freebsd.h"
|
||||
#include "opt_compat_netbsd.h"
|
||||
@ -379,7 +379,7 @@ scsipi_do_ioctl(struct scsipi_periph *periph, dev_t dev, u_long cmd,
|
||||
case SCIOCIDENTIFY: {
|
||||
struct scsi_addr *sca = (struct scsi_addr *)addr;
|
||||
|
||||
switch (scsipi_periph_bustype(periph)) {
|
||||
switch (SCSIPI_BUSTYPE_TYPE(scsipi_periph_bustype(periph))) {
|
||||
case SCSIPI_BUSTYPE_SCSI:
|
||||
sca->type = TYPE_SCSI;
|
||||
sca->addr.scsi.scbus =
|
||||
@ -401,7 +401,7 @@ scsipi_do_ioctl(struct scsipi_periph *periph, dev_t dev, u_long cmd,
|
||||
case OSCIOCIDENTIFY: {
|
||||
struct oscsi_addr *sca = (struct oscsi_addr *)addr;
|
||||
|
||||
switch (scsipi_periph_bustype(periph)) {
|
||||
switch (SCSIPI_BUSTYPE_TYPE(scsipi_periph_bustype(periph))) {
|
||||
case SCSIPI_BUSTYPE_SCSI:
|
||||
sca->scbus =
|
||||
device_unit(device_parent(periph->periph_dev));
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: scsipiconf.h,v 1.119 2012/04/06 22:50:39 christos Exp $ */
|
||||
/* $NetBSD: scsipiconf.h,v 1.120 2012/04/19 17:45:20 bouyer Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 1999, 2000, 2004 The NetBSD Foundation, Inc.
|
||||
@ -239,10 +239,25 @@ struct scsipi_bustype {
|
||||
};
|
||||
|
||||
/* bustype_type */
|
||||
#define SCSIPI_BUSTYPE_SCSI 0
|
||||
/* type is stored in the first byte */
|
||||
#define SCSIPI_BUSTYPE_TYPE_SHIFT 0
|
||||
#define SCSIPI_BUSTYPE_TYPE(x) (((x) >> SCSIPI_BUSTYPE_TYPE_SHIFT) & 0xff)
|
||||
#define SCSIPI_BUSTYPE_SCSI 0 /* parallel SCSI */
|
||||
#define SCSIPI_BUSTYPE_ATAPI 1
|
||||
/* #define SCSIPI_BUSTYPE_ATA 2 */
|
||||
/* subtype is stored in the second byte */
|
||||
#define SCSIPI_BUSTYPE_SUBTYPE_SHIFT 8
|
||||
#define SCSIPI_BUSTYPE_SUBTYPE(x) (((x) >> SCSIPI_BUSTYPE_SUBTYPE_SHIFT) & 0xff)
|
||||
|
||||
#define SCSIPI_BUSTYPE_BUSTYPE(t, s) \
|
||||
((t) << SCSIPI_BUSTYPE_TYPE_SHIFT | (s) << SCSIPI_BUSTYPE_SUBTYPE_SHIFT)
|
||||
/* subtypes are defined in each bus type headers */
|
||||
/* XXX this should be in scsiconf.h but is used in scsipi_base.c */
|
||||
/* SCSI subtypes */
|
||||
#define SCSIPI_BUSTYPE_SCSI_PSCSI 0 /* parallel SCSI */
|
||||
#define SCSIPI_BUSTYPE_SCSI_FC 1 /* Fiber channel */
|
||||
#define SCSIPI_BUSTYPE_SCSI_SAS 2 /* SAS */
|
||||
#define SCSIPI_BUSTYPE_SCSI_USB 3 /* USB */
|
||||
|
||||
/*
|
||||
* scsipi_channel:
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: sd.c,v 1.297 2012/04/06 22:50:39 christos Exp $ */
|
||||
/* $NetBSD: sd.c,v 1.298 2012/04/19 17:45:20 bouyer Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 2003, 2004 The NetBSD Foundation, Inc.
|
||||
@ -47,7 +47,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.297 2012/04/06 22:50:39 christos Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: sd.c,v 1.298 2012/04/19 17:45:20 bouyer Exp $");
|
||||
|
||||
#include "opt_scsi.h"
|
||||
|
||||
@ -227,8 +227,8 @@ sdattach(device_t parent, device_t self, void *aux)
|
||||
if (sd->type == T_SIMPLE_DIRECT)
|
||||
periph->periph_quirks |= PQUIRK_ONLYBIG | PQUIRK_NOBIGMODESENSE;
|
||||
|
||||
if (scsipi_periph_bustype(sa->sa_periph) == SCSIPI_BUSTYPE_SCSI &&
|
||||
periph->periph_version == 0)
|
||||
if (SCSIPI_BUSTYPE_TYPE(scsipi_periph_bustype(sa->sa_periph)) ==
|
||||
SCSIPI_BUSTYPE_SCSI && periph->periph_version == 0)
|
||||
sd->flags |= SDF_ANCIENT;
|
||||
|
||||
bufq_alloc(&sd->buf_queue, BUFQ_DISK_DEFAULT_STRAT, BUFQ_SORT_RAWBLOCK);
|
||||
@ -1304,7 +1304,7 @@ sdgetdefaultlabel(struct sd_softc *sd, struct disklabel *lp)
|
||||
lp->d_ncylinders = sd->params.cyls;
|
||||
lp->d_secpercyl = lp->d_ntracks * lp->d_nsectors;
|
||||
|
||||
switch (scsipi_periph_bustype(sd->sc_periph)) {
|
||||
switch (SCSIPI_BUSTYPE_TYPE(scsipi_periph_bustype(sd->sc_periph))) {
|
||||
case SCSIPI_BUSTYPE_SCSI:
|
||||
lp->d_type = DTYPE_SCSI;
|
||||
break;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: st.c,v 1.220 2012/02/28 10:58:10 mbalmer Exp $ */
|
||||
/* $NetBSD: st.c,v 1.221 2012/04/19 17:45:20 bouyer Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 2004 The NetBSD Foundation, Inc.
|
||||
@ -50,7 +50,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: st.c,v 1.220 2012/02/28 10:58:10 mbalmer Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: st.c,v 1.221 2012/04/19 17:45:20 bouyer Exp $");
|
||||
|
||||
#include "opt_scsi.h"
|
||||
|
||||
@ -1735,7 +1735,8 @@ st_write_filemarks(struct st_softc *st, int number, int flags)
|
||||
|
||||
memset(&cmd, 0, sizeof(cmd));
|
||||
cmd.opcode = WRITE_FILEMARKS;
|
||||
if (scsipi_periph_bustype(st->sc_periph) == SCSIPI_BUSTYPE_ATAPI)
|
||||
if (SCSIPI_BUSTYPE_TYPE(scsipi_periph_bustype(st->sc_periph)) ==
|
||||
SCSIPI_BUSTYPE_ATAPI)
|
||||
cmd.byte2 = SR_IMMED;
|
||||
/*
|
||||
* The ATAPI Onstream DI-30 doesn't support writing filemarks, but
|
||||
@ -1811,7 +1812,8 @@ st_load(struct st_softc *st, u_int type, int flags)
|
||||
|
||||
memset(&cmd, 0, sizeof(cmd));
|
||||
cmd.opcode = LOAD;
|
||||
if (scsipi_periph_bustype(st->sc_periph) == SCSIPI_BUSTYPE_ATAPI)
|
||||
if (SCSIPI_BUSTYPE_TYPE(scsipi_periph_bustype(st->sc_periph)) ==
|
||||
SCSIPI_BUSTYPE_ATAPI)
|
||||
cmd.byte2 = SR_IMMED;
|
||||
cmd.how = type;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: st_atapi.c,v 1.28 2012/02/28 10:58:11 mbalmer Exp $ */
|
||||
/* $NetBSD: st_atapi.c,v 1.29 2012/04/19 17:45:21 bouyer Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001 Manuel Bouyer.
|
||||
@ -25,7 +25,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: st_atapi.c,v 1.28 2012/02/28 10:58:11 mbalmer Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: st_atapi.c,v 1.29 2012/04/19 17:45:21 bouyer Exp $");
|
||||
|
||||
#include "opt_scsi.h"
|
||||
|
||||
@ -65,7 +65,8 @@ st_atapibus_match(device_t parent, cfdata_t match, void *aux)
|
||||
struct scsipibus_attach_args *sa = aux;
|
||||
int priority;
|
||||
|
||||
if (scsipi_periph_bustype(sa->sa_periph) != SCSIPI_BUSTYPE_ATAPI)
|
||||
if (SCSIPI_BUSTYPE_TYPE(scsipi_periph_bustype(sa->sa_periph)) !=
|
||||
SCSIPI_BUSTYPE_ATAPI)
|
||||
return 0;
|
||||
|
||||
(void)scsipi_inqmatch(&sa->sa_inqbuf,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: st_scsi.c,v 1.34 2012/02/28 10:58:11 mbalmer Exp $ */
|
||||
/* $NetBSD: st_scsi.c,v 1.35 2012/04/19 17:45:21 bouyer Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 2004 The NetBSD Foundation, Inc.
|
||||
@ -50,7 +50,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: st_scsi.c,v 1.34 2012/02/28 10:58:11 mbalmer Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: st_scsi.c,v 1.35 2012/04/19 17:45:21 bouyer Exp $");
|
||||
|
||||
#include "opt_scsi.h"
|
||||
|
||||
@ -93,7 +93,8 @@ st_scsibus_match(device_t parent, cfdata_t match, void *aux)
|
||||
struct scsipibus_attach_args *sa = aux;
|
||||
int priority;
|
||||
|
||||
if (scsipi_periph_bustype(sa->sa_periph) != SCSIPI_BUSTYPE_SCSI)
|
||||
if (SCSIPI_BUSTYPE_TYPE(scsipi_periph_bustype(sa->sa_periph)) !=
|
||||
SCSIPI_BUSTYPE_SCSI)
|
||||
return 0;
|
||||
|
||||
(void)scsipi_inqmatch(&sa->sa_inqbuf,
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: umass_scsipi.c,v 1.43 2012/03/11 01:06:07 mrg Exp $ */
|
||||
/* $NetBSD: umass_scsipi.c,v 1.44 2012/04/19 17:45:21 bouyer Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001, 2003, 2012 The NetBSD Foundation, Inc.
|
||||
@ -31,7 +31,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: umass_scsipi.c,v 1.43 2012/03/11 01:06:07 mrg Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: umass_scsipi.c,v 1.44 2012/04/19 17:45:21 bouyer Exp $");
|
||||
|
||||
#ifdef _KERNEL_OPT
|
||||
#include "opt_umass.h"
|
||||
@ -245,7 +245,8 @@ umass_scsipi_request(struct scsipi_channel *chan,
|
||||
}
|
||||
|
||||
#ifdef UMASS_DEBUG
|
||||
if (chan->chan_bustype->bustype_type == SCSIPI_BUSTYPE_ATAPI ?
|
||||
if (SCSIPI_BUSTYPE_TYPE(chan->chan_bustype->bustype_type) ==
|
||||
SCSIPI_BUSTYPE_ATAPI ?
|
||||
periph->periph_target != UMASS_ATAPI_DRIVE :
|
||||
periph->periph_target == chan->chan_id) {
|
||||
DPRINTF(UDMASS_SCSI, ("%s: wrong SCSI ID %d\n",
|
||||
|
Loading…
Reference in New Issue
Block a user