summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorMatthew Dempsky <matthew@cvs.openbsd.org>2011-07-09 01:50:42 +0000
committerMatthew Dempsky <matthew@cvs.openbsd.org>2011-07-09 01:50:42 +0000
commit0b6f053d908a15ebee4e7e4a34f05b68b100b94e (patch)
tree67d48b2359b53d347e82db77fe7aa95a48a71e10 /sys/dev
parent0e24d57589d795d2810330512b1a8fdbb1fa3326 (diff)
Fix fallout from my previous SCSI refactoring diff (moving
adapter_buswidth to sc_targets): gdt(4) and atascsi(4) still used it in other ways. Apply appropriate fixes; tested on ahci(4). ok krw@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ata/atascsi.c16
-rw-r--r--sys/dev/ic/gdt_common.c4
2 files changed, 11 insertions, 9 deletions
diff --git a/sys/dev/ata/atascsi.c b/sys/dev/ata/atascsi.c
index e788079e31f..b04fd9d2f14 100644
--- a/sys/dev/ata/atascsi.c
+++ b/sys/dev/ata/atascsi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: atascsi.c,v 1.112 2011/07/08 22:09:27 matthew Exp $ */
+/* $OpenBSD: atascsi.c,v 1.113 2011/07/09 01:50:41 matthew Exp $ */
/*
* Copyright (c) 2007 David Gwynne <dlg@openbsd.org>
@@ -50,6 +50,7 @@ struct atascsi {
struct scsi_link as_link;
struct scsibus_softc *as_scsibus;
+ int as_nports;
int as_capability;
int as_ncqdepth;
};
@@ -176,6 +177,7 @@ atascsi_attach(struct device *self, struct atascsi_attach_args *aaa)
as->as_cookie = aaa->aaa_cookie;
as->as_methods = aaa->aaa_methods;
as->as_capability = aaa->aaa_capability;
+ as->as_nports = aaa->aaa_nports;
as->as_ncqdepth = aaa->aaa_ncmds;
/* copy from template and modify for ourselves */
@@ -186,15 +188,15 @@ atascsi_attach(struct device *self, struct atascsi_attach_args *aaa)
/* fill in our scsi_link */
as->as_link.adapter = &as->as_switch;
as->as_link.adapter_softc = as;
- as->as_link.adapter_target = aaa->aaa_nports;
+ as->as_link.adapter_target = SCSI_NO_ADAPTER_TARGET;
as->as_link.openings = 1;
as->as_host_ports = malloc(sizeof(struct atascsi_host_port *) *
- aaa->aaa_nports, M_DEVBUF, M_WAITOK | M_ZERO);
+ as->as_nports, M_DEVBUF, M_WAITOK | M_ZERO);
bzero(&saa, sizeof(saa));
saa.saa_sc_link = &as->as_link;
- saa.saa_targets = aaa->aaa_nports;
+ saa.saa_targets = as->as_nports;
saa.saa_luns = SATA_PMP_MAX_PORTS;
/* stash the scsibus so we can do hotplug on it */
@@ -245,7 +247,7 @@ atascsi_lookup_port(struct scsi_link *link)
struct atascsi *as = link->adapter_softc;
struct atascsi_host_port *ahp;
- if (link->target >= as->as_link.adapter_buswidth)
+ if (link->target >= as->as_nports)
return (NULL);
ahp = as->as_host_ports[link->target];
@@ -268,7 +270,7 @@ atascsi_probe(struct scsi_link *link)
u_int16_t cmdset;
port = link->target;
- if (port >= as->as_link.adapter_buswidth)
+ if (port >= as->as_nports)
return (ENXIO);
/* if this is a PMP port, check it's valid */
@@ -450,7 +452,7 @@ atascsi_free(struct scsi_link *link)
int port;
port = link->target;
- if (port >= as->as_link.adapter_buswidth)
+ if (port >= as->as_nports)
return;
ahp = as->as_host_ports[port];
diff --git a/sys/dev/ic/gdt_common.c b/sys/dev/ic/gdt_common.c
index ccffa0b78d4..77233069b0f 100644
--- a/sys/dev/ic/gdt_common.c
+++ b/sys/dev/ic/gdt_common.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: gdt_common.c,v 1.58 2011/07/08 22:09:27 matthew Exp $ */
+/* $OpenBSD: gdt_common.c,v 1.59 2011/07/09 01:50:41 matthew Exp $ */
/*
* Copyright (c) 1999, 2000, 2003 Niklas Hallqvist. All rights reserved.
@@ -156,7 +156,7 @@ gdt_attach(struct gdt_softc *sc)
sc->sc_link.adapter_softc = sc;
sc->sc_link.adapter = &gdt_switch;
/* openings will be filled in later. */
- sc->sc_link.adapter_target = sc->sc_link.adapter_buswidth;
+ sc->sc_link.adapter_target = SCSI_NO_ADAPTER_TARGET;
sc->sc_link.pool = &sc->sc_iopool;
if (!gdt_internal_cmd(sc, GDT_SCREENSERVICE, GDT_INIT, 0, 0, 0)) {