diff options
author | n_hibma <n_hibma@FreeBSD.org> | 2007-02-21 07:45:02 +0000 |
---|---|---|
committer | n_hibma <n_hibma@FreeBSD.org> | 2007-02-21 07:45:02 +0000 |
commit | 3d196e1a9149230cea336ae9ce43977c10128f9d (patch) | |
tree | 86b52271583c718396e791a1a048208cfdacc7da | |
parent | 989e3abb2c3f951b7af4cec31e3639b87eb15925 (diff) | |
download | FreeBSD-src-3d196e1a9149230cea336ae9ce43977c10128f9d.zip FreeBSD-src-3d196e1a9149230cea336ae9ce43977c10128f9d.tar.gz |
Reduce the noise when plugging in (USB) mass storage devices, like a 4 port
flash card reader.
Also remove an 'Opened da0 -> <random number>' which is not needed on a daily
basis (available through bootverbose).
Reviewed by: phk, ken
MFC after: 1 week
-rw-r--r-- | sys/cam/scsi/scsi_da.c | 8 | ||||
-rw-r--r-- | sys/geom/geom_disk.c | 2 |
2 files changed, 7 insertions, 3 deletions
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index 4d2100d..b4863f6 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -1820,11 +1820,15 @@ dagetcapacity(struct cam_periph *periph) uint32_t block_len; uint64_t maxsector; int error; + u_int32_t sense_flags; softc = (struct da_softc *)periph->softc; block_len = 0; maxsector = 0; error = 0; + sense_flags = SF_RETRY_UA; + if (softc->flags & DA_FLAG_PACK_REMOVABLE) + sense_flags |= SF_NO_PRINT; /* Do a read capacity */ rcap = (struct scsi_read_capacity_data *)malloc(sizeof(*rcaplong), @@ -1843,7 +1847,7 @@ dagetcapacity(struct cam_periph *periph) error = cam_periph_runccb(ccb, daerror, /*cam_flags*/CAM_RETRY_SELTO, - /*sense_flags*/SF_RETRY_UA, + sense_flags, softc->disk->d_devstat); if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) @@ -1878,7 +1882,7 @@ dagetcapacity(struct cam_periph *periph) error = cam_periph_runccb(ccb, daerror, /*cam_flags*/CAM_RETRY_SELTO, - /*sense_flags*/SF_RETRY_UA, + sense_flags, softc->disk->d_devstat); if ((ccb->ccb_h.status & CAM_DEV_QFRZN) != 0) diff --git a/sys/geom/geom_disk.c b/sys/geom/geom_disk.c index 1a65d89..390cd8f 100644 --- a/sys/geom/geom_disk.c +++ b/sys/geom/geom_disk.c @@ -133,7 +133,7 @@ g_disk_access(struct g_provider *pp, int r, int w, int e) if (dp->d_open != NULL) { g_disk_lock_giant(dp); error = dp->d_open(dp); - if (error != 0) + if (bootverbose && error != 0) printf("Opened disk %s -> %d\n", pp->name, error); g_disk_unlock_giant(dp); |