version 1.245, 2008/01/04 21:18:05 |
version 1.245.6.3, 2008/06/02 13:23:50 |
|
|
* 2. Redistributions in binary form must reproduce the above copyright |
* 2. Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* documentation and/or other materials provided with the distribution. |
* 3. All advertising materials mentioning features or use of this software |
|
* must display the following acknowledgement: |
|
* This product includes software developed by the NetBSD |
|
* Foundation, Inc. and its contributors. |
|
* 4. Neither the name of The NetBSD Foundation nor the names of its |
|
* contributors may be used to endorse or promote products derived |
|
* from this software without specific prior written permission. |
|
* |
* |
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS |
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS |
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
Line 165 scsibusattach(struct device *parent, str |
|
Line 158 scsibusattach(struct device *parent, str |
|
struct scsibus_softc *sc = device_private(self); |
struct scsibus_softc *sc = device_private(self); |
struct scsipi_channel *chan = aux; |
struct scsipi_channel *chan = aux; |
struct scsi_initq *scsi_initq; |
struct scsi_initq *scsi_initq; |
|
int maj = cdevsw_lookup_major(&scsibus_cdevsw); |
|
|
if (!pmf_device_register(self, NULL, NULL)) |
if (!pmf_device_register(self, NULL, NULL)) |
aprint_error_dev(self, "couldn't establish power handler\n"); |
aprint_error_dev(self, "couldn't establish power handler\n"); |
|
|
sc->sc_channel = chan; |
sc->sc_channel = chan; |
chan->chan_name = sc->sc_dev.dv_xname; |
chan->chan_name = device_xname(&sc->sc_dev); |
|
|
aprint_naive(": SCSI bus\n"); |
aprint_naive(": SCSI bus\n"); |
aprint_normal(": %d target%s, %d lun%s per target\n", |
aprint_normal(": %d target%s, %d lun%s per target\n", |
Line 191 scsibusattach(struct device *parent, str |
|
Line 185 scsibusattach(struct device *parent, str |
|
TAILQ_INSERT_TAIL(&scsi_initq_head, scsi_initq, scsi_initq); |
TAILQ_INSERT_TAIL(&scsi_initq_head, scsi_initq, scsi_initq); |
config_pending_incr(); |
config_pending_incr(); |
if (scsipi_channel_init(chan)) { |
if (scsipi_channel_init(chan)) { |
aprint_error("%s: failed to init channel\n", |
aprint_error_dev(&sc->sc_dev, "failed to init channel\n"); |
sc->sc_dev.dv_xname); |
|
return; |
return; |
} |
} |
|
|
|
device_register_name(makedev(maj, device_unit(self)), self, true, |
|
DEV_OTHER, device_xname(self)); |
} |
} |
|
|
static void |
static void |
Line 208 scsibus_config(struct scsipi_channel *ch |
|
Line 204 scsibus_config(struct scsipi_channel *ch |
|
#endif |
#endif |
if ((chan->chan_flags & SCSIPI_CHAN_NOSETTLE) == 0 && |
if ((chan->chan_flags & SCSIPI_CHAN_NOSETTLE) == 0 && |
SCSI_DELAY > 0) { |
SCSI_DELAY > 0) { |
aprint_normal( |
aprint_normal_dev(&sc->sc_dev, |
"%s: waiting %d seconds for devices to settle...\n", |
"waiting %d seconds for devices to settle...\n", |
sc->sc_dev.dv_xname, SCSI_DELAY); |
SCSI_DELAY); |
/* ...an identifier we know no one will use... */ |
/* ...an identifier we know no one will use... */ |
(void) tsleep(scsibus_config, PRIBIO, |
(void) tsleep(scsibus_config, PRIBIO, |
"scsidly", SCSI_DELAY * hz); |
"scsidly", SCSI_DELAY * hz); |
Line 288 scsibusdetach(struct device *self, int f |
|
Line 284 scsibusdetach(struct device *self, int f |
|
struct scsipi_xfer *xs; |
struct scsipi_xfer *xs; |
int error; |
int error; |
|
|
|
device_deregister_all(self); |
pmf_device_deregister(self); |
pmf_device_deregister(self); |
|
|
/* |
/* |
Line 751 scsi_probe_device(struct scsibus_softc * |
|
Line 748 scsi_probe_device(struct scsibus_softc * |
|
periph = scsipi_alloc_periph(M_NOWAIT); |
periph = scsipi_alloc_periph(M_NOWAIT); |
if (periph == NULL) { |
if (periph == NULL) { |
#ifdef DIAGNOSTIC |
#ifdef DIAGNOSTIC |
aprint_error( |
aprint_error_dev(&sc->sc_dev, |
"%s: cannot allocate periph for target %d lun %d\n", |
"cannot allocate periph for target %d lun %d\n", |
sc->sc_dev.dv_xname, target, lun); |
target, lun); |
#endif |
#endif |
return (ENOMEM); |
return (ENOMEM); |
} |
} |
Line 961 scsi_probe_device(struct scsibus_softc * |
|
Line 958 scsi_probe_device(struct scsibus_softc * |
|
chld = config_attach_loc(&sc->sc_dev, cf, locs, &sa, |
chld = config_attach_loc(&sc->sc_dev, cf, locs, &sa, |
scsibusprint); |
scsibusprint); |
} else { |
} else { |
scsibusprint(&sa, sc->sc_dev.dv_xname); |
scsibusprint(&sa, device_xname(&sc->sc_dev)); |
aprint_normal(" not configured\n"); |
aprint_normal(" not configured\n"); |
goto bad; |
goto bad; |
} |
} |