summaryrefslogtreecommitdiffstats
path: root/sys/cam/scsi
diff options
context:
space:
mode:
authormjacob <mjacob@FreeBSD.org>2006-12-05 07:45:28 +0000
committermjacob <mjacob@FreeBSD.org>2006-12-05 07:45:28 +0000
commit18ed122eede36bb9f67ea05ce9fdf22674da2365 (patch)
tree2dfb6b8881a0b9d42d43950512ea20b0903e8be8 /sys/cam/scsi
parent3f733764261ff79c423255375230362d5766defb (diff)
downloadFreeBSD-src-18ed122eede36bb9f67ea05ce9fdf22674da2365.zip
FreeBSD-src-18ed122eede36bb9f67ea05ce9fdf22674da2365.tar.gz
Add an xpt_print function to reduce most of the xpt_print_path/printf
pairs. Convert the core code to use it. Reviewed by: scsi (various folks weighing in with good advice) MFC after: 2 weeks
Diffstat (limited to 'sys/cam/scsi')
-rw-r--r--sys/cam/scsi/scsi_cd.c54
-rw-r--r--sys/cam/scsi/scsi_ch.c33
-rw-r--r--sys/cam/scsi/scsi_da.c65
-rw-r--r--sys/cam/scsi/scsi_pass.c18
-rw-r--r--sys/cam/scsi/scsi_pt.c10
-rw-r--r--sys/cam/scsi/scsi_sa.c96
-rw-r--r--sys/cam/scsi/scsi_ses.c6
-rw-r--r--sys/cam/scsi/scsi_targ_bh.c18
-rw-r--r--sys/cam/scsi/scsi_target.c20
9 files changed, 143 insertions, 177 deletions
diff --git a/sys/cam/scsi/scsi_cd.c b/sys/cam/scsi/scsi_cd.c
index a64d93e..07782ba 100644
--- a/sys/cam/scsi/scsi_cd.c
+++ b/sys/cam/scsi/scsi_cd.c
@@ -408,8 +408,7 @@ cdoninvalidate(struct cam_periph *periph)
camq_remove(&softc->changer->devq, softc->pinfo.index);
disk_gone(softc->disk);
- xpt_print_path(periph->path);
- printf("lost device\n");
+ xpt_print(periph->path, "lost device\n");
}
static void
@@ -420,13 +419,11 @@ cdcleanup(struct cam_periph *periph)
softc = (struct cd_softc *)periph->softc;
- xpt_print_path(periph->path);
- printf("removing device entry\n");
+ xpt_print(periph->path, "removing device entry\n");
if ((softc->flags & CD_FLAG_SCTX_INIT) != 0
&& sysctl_ctx_free(&softc->sysctl_ctx) != 0) {
- xpt_print_path(periph->path);
- printf("can't remove sysctl context\n");
+ xpt_print(periph->path, "can't remove sysctl context\n");
}
s = splsoftcam();
@@ -494,8 +491,7 @@ cdcleanup(struct cam_periph *periph)
STAILQ_REMOVE(&changerq, softc->changer, cdchanger,
changer_links);
- xpt_print_path(periph->path);
- printf("removing changer entry\n");
+ xpt_print(periph->path, "removing changer entry\n");
free(softc->changer, M_DEVBUF);
num_changers--;
}
@@ -1568,8 +1564,8 @@ cdstart(struct cam_periph *periph, union ccb *start_ccb)
M_TEMP,
M_NOWAIT);
if (rcap == NULL) {
- xpt_print_path(periph->path);
- printf("cdstart: Couldn't malloc read_capacity data\n");
+ xpt_print(periph->path,
+ "cdstart: Couldn't malloc read_capacity data\n");
/* cd_free_periph??? */
break;
}
@@ -1631,8 +1627,8 @@ cddone(struct cam_periph *periph, union ccb *done_ccb)
if (error != 0) {
int s;
- xpt_print_path(periph->path);
- printf("cddone: got error %#x back\n", error);
+ xpt_print(periph->path,
+ "cddone: got error %#x back\n", error);
s = splbio();
bioq_flush(&softc->bio_queue, NULL, EIO);
splx(s);
@@ -1813,14 +1809,12 @@ cddone(struct cam_periph *periph, union ccb *done_ccb)
scsi_sense_print(
&done_ccb->csio);
else {
- xpt_print_path(periph->path);
- printf("got CAM status %#x\n",
- done_ccb->ccb_h.status);
+ xpt_print(periph->path,
+ "got CAM status %#x\n",
+ done_ccb->ccb_h.status);
}
- xpt_print_path(periph->path);
- printf("fatal error, failed"
- " to attach to device\n");
-
+ xpt_print(periph->path, "fatal error, "
+ "failed to attach to device\n");
/*
* Invalidate this peripheral.
*/
@@ -2955,16 +2949,16 @@ cd6byteworkaround(union ccb *ccb)
* cdsetmode()!
*/
if (found == 0) {
- xpt_print_path(periph->path);
- printf("mode buffer not found in mode queue!\n");
+ xpt_print(periph->path,
+ "mode buffer not found in mode queue!\n");
return (0);
}
params->cdb_size = 10;
softc->minimum_command_size = 10;
- xpt_print_path(ccb->ccb_h.path);
- printf("%s(6) failed, increasing minimum CDB size to 10 bytes\n",
- (cdb[0] == MODE_SENSE_6) ? "MODE_SENSE" : "MODE_SELECT");
+ xpt_print(ccb->ccb_h.path,
+ "%s(6) failed, increasing minimum CDB size to 10 bytes\n",
+ (cdb[0] == MODE_SENSE_6) ? "MODE_SENSE" : "MODE_SELECT");
if (cdb[0] == MODE_SENSE_6) {
struct scsi_mode_sense_10 ms10;
@@ -3296,10 +3290,9 @@ cdgetmode(struct cam_periph *periph, struct cd_mode_params *data,
* the data length incorrectly.
*/
if (data_len > data->alloc_len) {
- xpt_print_path(periph->path);
- printf("allocated modepage %d length %d < returned "
- "length %d\n", page, data->alloc_len, data_len);
-
+ xpt_print(periph->path, "allocated modepage %d length "
+ "%d < returned length %d\n", page, data->alloc_len,
+ data_len);
error = ENOSPC;
}
}
@@ -3757,9 +3750,8 @@ cdreportkey(struct cam_periph *periph, struct dvd_authinfo *authinfo)
goto bailout;
if (ccb->csio.resid != 0) {
- xpt_print_path(periph->path);
- printf("warning, residual for report key command is %d\n",
- ccb->csio.resid);
+ xpt_print(periph->path, "warning, residual for report key "
+ "command is %d\n", ccb->csio.resid);
}
switch(authinfo->format) {
diff --git a/sys/cam/scsi/scsi_ch.c b/sys/cam/scsi/scsi_ch.c
index c79dd99..7ca7391 100644
--- a/sys/cam/scsi/scsi_ch.c
+++ b/sys/cam/scsi/scsi_ch.c
@@ -273,8 +273,7 @@ choninvalidate(struct cam_periph *periph)
softc->flags |= CH_FLAG_INVALID;
- xpt_print_path(periph->path);
- printf("lost device\n");
+ xpt_print(periph->path, "lost device\n");
}
@@ -287,8 +286,7 @@ chcleanup(struct cam_periph *periph)
devstat_remove_entry(softc->device_stats);
destroy_dev(softc->dev);
- xpt_print_path(periph->path);
- printf("removing device entry\n");
+ xpt_print(periph->path, "removing device entry\n");
free(softc, M_DEVBUF);
}
@@ -647,13 +645,12 @@ chdone(struct cam_periph *periph, union ccb *done_ccb)
== CAM_SCSI_STATUS_ERROR)
scsi_sense_print(&done_ccb->csio);
else {
- xpt_print_path(periph->path);
- printf("got CAM status %#x\n",
- done_ccb->ccb_h.status);
+ xpt_print(periph->path,
+ "got CAM status %#x\n",
+ done_ccb->ccb_h.status);
}
- xpt_print_path(periph->path);
- printf("fatal error, failed to attach to"
- " device\n");
+ xpt_print(periph->path, "fatal error, failed "
+ "to attach to device\n");
cam_periph_invalidate(periph);
@@ -1162,8 +1159,8 @@ chgetelemstatus(struct cam_periph *periph,
avail = scsi_2btoul(st_hdr->count);
if (avail != cesr->cesr_element_count) {
- xpt_print_path(periph->path);
- printf("warning, READ ELEMENT STATUS avail != count\n");
+ xpt_print(periph->path,
+ "warning, READ ELEMENT STATUS avail != count\n");
}
user_data = (struct changer_element_status *)
@@ -1403,9 +1400,9 @@ chgetparams(struct cam_periph *periph)
}
if (error) {
- xpt_print_path(periph->path);
- printf("chgetparams: error getting element "
- "address page\n");
+ xpt_print(periph->path,
+ "chgetparams: error getting element "
+ "address page\n");
xpt_release_ccb(ccb);
free(mode_buffer, M_TEMP);
return(error);
@@ -1466,9 +1463,9 @@ chgetparams(struct cam_periph *periph)
}
if (error) {
- xpt_print_path(periph->path);
- printf("chgetparams: error getting device "
- "capabilities page\n");
+ xpt_print(periph->path,
+ "chgetparams: error getting device "
+ "capabilities page\n");
xpt_release_ccb(ccb);
free(mode_buffer, M_TEMP);
return(error);
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
index 6778054..262ca43 100644
--- a/sys/cam/scsi/scsi_da.c
+++ b/sys/cam/scsi/scsi_da.c
@@ -654,11 +654,10 @@ daclose(struct disk *dp)
if (sense_key != SSD_KEY_ILLEGAL_REQUEST)
scsi_sense_print(&ccb->csio);
} else {
- xpt_print_path(periph->path);
- printf("Synchronize cache failed, status "
- "== 0x%x, scsi status == 0x%x\n",
- ccb->csio.ccb_h.status,
- ccb->csio.scsi_status);
+ xpt_print(periph->path, "Synchronize cache "
+ "failed, status == 0x%x, scsi status == "
+ "0x%x\n", ccb->csio.ccb_h.status,
+ ccb->csio.scsi_status);
}
}
@@ -826,10 +825,10 @@ dadump(void *arg, void *virtual, vm_offset_t physical, off_t offset, size_t leng
if (sense_key != SSD_KEY_ILLEGAL_REQUEST)
scsi_sense_print(&csio);
} else {
- xpt_print_path(periph->path);
- printf("Synchronize cache failed, status "
- "== 0x%x, scsi status == 0x%x\n",
- csio.ccb_h.status, csio.scsi_status);
+ xpt_print(periph->path, "Synchronize cache "
+ "failed, status == 0x%x, scsi status == "
+ "0x%x\n", csio.ccb_h.status,
+ csio.scsi_status);
}
}
}
@@ -923,8 +922,7 @@ daoninvalidate(struct cam_periph *periph)
SLIST_REMOVE(&softc_list, softc, da_softc, links);
disk_gone(softc->disk);
- xpt_print_path(periph->path);
- printf("lost device\n");
+ xpt_print(periph->path, "lost device\n");
}
static void
@@ -934,15 +932,13 @@ dacleanup(struct cam_periph *periph)
softc = (struct da_softc *)periph->softc;
- xpt_print_path(periph->path);
- printf("removing device entry\n");
+ xpt_print(periph->path, "removing device entry\n");
/*
* If we can't free the sysctl tree, oh well...
*/
if ((softc->flags & DA_FLAG_SCTX_INIT) != 0
&& sysctl_ctx_free(&softc->sysctl_ctx) != 0) {
- xpt_print_path(periph->path);
- printf("can't remove sysctl context\n");
+ xpt_print(periph->path, "can't remove sysctl context\n");
}
disk_destroy(softc->disk);
free(softc, M_DEVBUF);
@@ -1401,9 +1397,8 @@ cmd6workaround(union ccb *ccb)
(*cdb != READ_6 && *cdb != WRITE_6))
return 0;
- xpt_print_path(ccb->ccb_h.path);
- printf("READ(6)/WRITE(6) not supported, "
- "increasing minimum_cmd_size to 10.\n");
+ xpt_print(ccb->ccb_h.path, "READ(6)/WRITE(6) not supported, "
+ "increasing minimum_cmd_size to 10.\n");
softc = (struct da_softc *)xpt_path_periph(ccb->ccb_h.path)->softc;
softc->minimum_cmd_size = 10;
@@ -1473,11 +1468,12 @@ dadone(struct cam_periph *periph, union ccb *done_ccb)
* Catastrophic error. Mark our pack as
* invalid.
*/
- /* XXX See if this is really a media
- * change first.
+ /*
+ * XXX See if this is really a media
+ * XXX change first?
*/
- xpt_print_path(periph->path);
- printf("Invalidating pack\n");
+ xpt_print(periph->path,
+ "Invalidating pack\n");
softc->flags |= DA_FLAG_PACK_INVALID;
}
@@ -1575,9 +1571,9 @@ dadone(struct cam_periph *periph, union ccb *done_ccb)
* here.
*/
if (block_size >= MAXPHYS || block_size == 0) {
- xpt_print_path(periph->path);
- printf("unsupportable block size %ju\n",
- (uintmax_t) block_size);
+ xpt_print(periph->path,
+ "unsupportable block size %ju\n",
+ (uintmax_t) block_size);
announce_buf[0] = '\0';
cam_periph_invalidate(periph);
} else {
@@ -1672,14 +1668,13 @@ dadone(struct cam_periph *periph, union ccb *done_ccb)
scsi_sense_print(
&done_ccb->csio);
else {
- xpt_print_path(periph->path);
- printf("got CAM status %#x\n",
- done_ccb->ccb_h.status);
+ xpt_print(periph->path,
+ "got CAM status %#x\n",
+ done_ccb->ccb_h.status);
}
- xpt_print_path(periph->path);
- printf("fatal error, failed"
- " to attach to device\n");
+ xpt_print(periph->path, "fatal error, "
+ "failed to attach to device\n");
/*
* Free up resources.
@@ -2024,10 +2019,10 @@ dashutdown(void * arg, int howto)
if (sense_key != SSD_KEY_ILLEGAL_REQUEST)
scsi_sense_print(&ccb.csio);
} else {
- xpt_print_path(periph->path);
- printf("Synchronize cache failed, status "
- "== 0x%x, scsi status == 0x%x\n",
- ccb.ccb_h.status, ccb.csio.scsi_status);
+ xpt_print(periph->path, "Synchronize "
+ "cache failed, status == 0x%x, scsi status "
+ "== 0x%x\n", ccb.ccb_h.status,
+ ccb.csio.scsi_status);
}
}
diff --git a/sys/cam/scsi/scsi_pass.c b/sys/cam/scsi/scsi_pass.c
index aab0c7d..f08a7ed 100644
--- a/sys/cam/scsi/scsi_pass.c
+++ b/sys/cam/scsi/scsi_pass.c
@@ -174,8 +174,7 @@ passoninvalidate(struct cam_periph *periph)
*/
if (bootverbose) {
- xpt_print_path(periph->path);
- printf("lost device\n");
+ xpt_print(periph->path, "lost device\n");
}
}
@@ -192,8 +191,7 @@ passcleanup(struct cam_periph *periph)
destroy_dev(softc->dev);
if (bootverbose) {
- xpt_print_path(periph->path);
- printf("removing device entry\n");
+ xpt_print(periph->path, "removing device entry\n");
}
free(softc, M_DEVBUF);
}
@@ -360,8 +358,7 @@ passopen(struct cdev *dev, int flags, int fmt, struct thread *td)
* We don't allow nonblocking access.
*/
if ((flags & O_NONBLOCK) != 0) {
- xpt_print_path(periph->path);
- printf("can't do nonblocking access\n");
+ xpt_print(periph->path, "can't do nonblocking access\n");
splx(s);
return(EINVAL);
}
@@ -476,9 +473,9 @@ passioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *t
* through the transport layer device.
*/
if (inccb->ccb_h.func_code & XPT_FC_XPT_ONLY) {
- xpt_print_path(periph->path);
- printf("CCB function code %#x is restricted to the "
- "XPT device\n", inccb->ccb_h.func_code);
+ xpt_print(periph->path, "CCB function code %#x is "
+ "restricted to the XPT device\n",
+ inccb->ccb_h.func_code);
error = ENODEV;
break;
}
@@ -504,8 +501,7 @@ passioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, struct thread *t
}
if (ccb == NULL) {
- xpt_print_path(periph->path);
- printf("unable to allocate CCB\n");
+ xpt_print(periph->path, "unable to allocate CCB\n");
error = ENOMEM;
break;
}
diff --git a/sys/cam/scsi/scsi_pt.c b/sys/cam/scsi/scsi_pt.c
index 412155a..752ddbd 100644
--- a/sys/cam/scsi/scsi_pt.c
+++ b/sys/cam/scsi/scsi_pt.c
@@ -387,8 +387,7 @@ ptoninvalidate(struct cam_periph *periph)
splx(s);
- xpt_print_path(periph->path);
- printf("lost device\n");
+ xpt_print(periph->path, "lost device\n");
}
static void
@@ -402,8 +401,7 @@ ptdtor(struct cam_periph *periph)
destroy_dev(softc->dev);
- xpt_print_path(periph->path);
- printf("removing device entry\n");
+ xpt_print(periph->path, "removing device entry\n");
free(softc, M_DEVBUF);
}
@@ -577,8 +575,8 @@ ptdone(struct cam_periph *periph, union ccb *done_ccb)
* Catastrophic error. Mark our device
* as invalid.
*/
- xpt_print_path(periph->path);
- printf("Invalidating device\n");
+ xpt_print(periph->path,
+ "Invalidating device\n");
softc->flags |= PT_FLAG_DEVICE_INVALID;
}
diff --git a/sys/cam/scsi/scsi_sa.c b/sys/cam/scsi/scsi_sa.c
index d3260b6..013e421 100644
--- a/sys/cam/scsi/scsi_sa.c
+++ b/sys/cam/scsi/scsi_sa.c
@@ -566,8 +566,8 @@ saclose(struct cdev *dev, int flag, int fmt, struct thread *td)
*/
error = sacheckeod(periph);
if (error) {
- xpt_print_path(periph->path);
- printf("failed to write terminating filemark(s)\n");
+ xpt_print(periph->path,
+ "failed to write terminating filemark(s)\n");
softc->flags |= SA_FLAG_TAPE_FROZEN;
}
@@ -622,19 +622,18 @@ saclose(struct cdev *dev, int flag, int fmt, struct thread *td)
if (error == 0 && writing && (softc->quirks & SA_QUIRK_2FM)) {
tmp = saspace(periph, -1, SS_FILEMARKS);
if (tmp) {
- xpt_print_path(periph->path);
- printf("unable to backspace over one of double"
- " filemarks at end of tape\n");
- xpt_print_path(periph->path);
- printf("it is possible that this device"
- " needs a SA_QUIRK_1FM quirk set for it\n");
+ xpt_print(periph->path, "unable to backspace "
+ "over one of double filemarks at end of "
+ "tape\n");
+ xpt_print(periph->path, "it is possible that "
+ "this device needs a SA_QUIRK_1FM quirk set"
+ "for it\n");
softc->flags |= SA_FLAG_TAPE_FROZEN;
}
}
break;
default:
- xpt_print_path(periph->path);
- panic("unknown mode 0x%x in saclose", mode);
+ xpt_print(periph->path, "unknown mode 0x%x in saclose\n", mode);
/* NOTREACHED */
break;
}
@@ -654,9 +653,8 @@ saclose(struct cdev *dev, int flag, int fmt, struct thread *td)
* Inform users if tape state if frozen....
*/
if (softc->flags & SA_FLAG_TAPE_FROZEN) {
- xpt_print_path(periph->path);
- printf("tape is now frozen- use an OFFLINE, REWIND or MTEOM "
- "command to clear this state.\n");
+ xpt_print(periph->path, "tape is now frozen- use an OFFLINE, "
+ "REWIND or MTEOM command to clear this state.\n");
}
/* release the device if it is no longer mounted */
@@ -749,10 +747,9 @@ sastrategy(struct bio *bp)
((bp->bio_bcount & softc->blk_mask) != 0)) ||
((softc->blk_mask == ~0) &&
((bp->bio_bcount % softc->min_blk) != 0))) {
- xpt_print_path(periph->path);
- printf("Invalid request. Fixed block device "
- "requests must be a multiple "
- "of %d bytes\n", softc->min_blk);
+ xpt_print(periph->path, "Invalid request. Fixed block "
+ "device requests must be a multiple of %d bytes\n",
+ softc->min_blk);
biofinish(bp, NULL, EINVAL);
return;
}
@@ -761,8 +758,8 @@ sastrategy(struct bio *bp)
(bp->bio_bcount & softc->blk_mask) != 0) {
xpt_print_path(periph->path);
- printf("Invalid request. Variable block device "
- "requests must be ");
+ printf("Invalid request. Variable block "
+ "device requests must be ");
if (softc->blk_mask != 0) {
printf("a multiple of %d ", (0x1 << softc->blk_gran));
}
@@ -1070,8 +1067,8 @@ saioctl(struct cdev *dev, u_long cmd, caddr_t arg, int flag, struct thread *td)
nmarks = softc->filemarks;
error = sacheckeod(periph);
if (error) {
- xpt_print_path(periph->path);
- printf("EOD check prior to spacing failed\n");
+ xpt_print(periph->path,
+ "EOD check prior to spacing failed\n");
softc->flags |= SA_FLAG_EIO_PENDING;
break;
}
@@ -1322,8 +1319,8 @@ saioctl(struct cdev *dev, u_long cmd, caddr_t arg, int flag, struct thread *td)
softc->fileno = (daddr_t) -1;
softc->blkno = (daddr_t) -1;
softc->flags &= ~SA_FLAG_TAPE_FROZEN;
- xpt_print_path(periph->path);
- printf("tape state now unfrozen.\n");
+ xpt_print(periph->path,
+ "tape state now unfrozen.\n");
break;
default:
break;
@@ -1407,8 +1404,7 @@ saoninvalidate(struct cam_periph *periph)
softc->queue_count = 0;
splx(s);
- xpt_print_path(periph->path);
- printf("lost device\n");
+ xpt_print(periph->path, "lost device\n");
}
@@ -1430,8 +1426,7 @@ sacleanup(struct cam_periph *periph)
destroy_dev(softc->devs.mode_devs[i].er_dev);
}
- xpt_print_path(periph->path);
- printf("removing device entry\n");
+ xpt_print(periph->path, "removing device entry\n");
free(softc, M_SCSISA);
}
@@ -1525,9 +1520,8 @@ saregister(struct cam_periph *periph, void *arg)
softc->last_media_blksize =
((struct sa_quirk_entry *)match)->prefblk;
#ifdef CAMDEBUG
- xpt_print_path(periph->path);
- printf("found quirk entry %d\n", (int)
- (((struct sa_quirk_entry *) match) - sa_quirk_table));
+ xpt_print(periph->path, "found quirk entry %d\n",
+ (int) (((struct sa_quirk_entry *) match) - sa_quirk_table));
#endif
} else
softc->quirks = SA_QUIRK_NONE;
@@ -1693,9 +1687,8 @@ again:
softc->media_blksize;
} else {
bp->bio_error = EIO;
- xpt_print_path(periph->path);
- printf("zero blocksize for "
- "FIXED length writes?\n");
+ xpt_print(periph->path, "zero blocksize"
+ " for FIXED length writes?\n");
splx(s);
biodone(bp);
break;
@@ -1920,8 +1913,8 @@ samount(struct cam_periph *periph, int oflags, struct cdev *dev)
*/
softc->flags &= ~SA_FLAG_TAPE_MOUNTED;
if (CAM_DEBUGGED(periph->path, CAM_DEBUG_INFO)) {
- xpt_print_path(periph->path);
- printf("error %d on TUR in samount\n", error);
+ xpt_print(periph->path,
+ "error %d on TUR in samount\n", error);
}
}
} else {
@@ -1984,8 +1977,7 @@ samount(struct cam_periph *periph, int oflags, struct cdev *dev)
rblim = (struct scsi_read_block_limits_data *)
malloc(8192, M_TEMP, M_WAITOK);
if (rblim == NULL) {
- xpt_print_path(periph->path);
- printf("no memory for test read\n");
+ xpt_print(periph->path, "no memory for test read\n");
xpt_release_ccb(ccb);
error = ENOMEM;
goto exit;
@@ -2006,8 +1998,8 @@ samount(struct cam_periph *periph, int oflags, struct cdev *dev)
softc->device_stats);
QFRLS(ccb);
if (error) {
- xpt_print_path(periph->path);
- printf("unable to rewind after test read\n");
+ xpt_print(periph->path,
+ "unable to rewind after test read\n");
xpt_release_ccb(ccb);
goto exit;
}
@@ -2171,8 +2163,8 @@ samount(struct cam_periph *periph, int oflags, struct cdev *dev)
if ((softc->max_blk < softc->media_blksize) ||
(softc->min_blk > softc->media_blksize &&
softc->media_blksize)) {
- xpt_print_path(periph->path);
- printf("BLOCK LIMITS (%d..%d) could not match current "
+ xpt_print(periph->path,
+ "BLOCK LIMITS (%d..%d) could not match current "
"block settings (%d)- adjusting\n", softc->min_blk,
softc->max_blk, softc->media_blksize);
softc->max_blk = softc->min_blk =
@@ -2206,9 +2198,9 @@ tryagain:
error = sasetparams(periph, SA_PARAM_BLOCKSIZE,
softc->media_blksize, 0, 0, SF_NO_PRINT);
if (error) {
- xpt_print_path(periph->path);
- printf("unable to set fixed blocksize to %d\n",
- softc->media_blksize);
+ xpt_print(periph->path,
+ "unable to set fixed blocksize to %d\n",
+ softc->media_blksize);
goto exit;
}
}
@@ -2233,8 +2225,8 @@ tryagain:
softc->last_media_blksize = 512;
goto tryagain;
}
- xpt_print_path(periph->path);
- printf("unable to set variable blocksize\n");
+ xpt_print(periph->path,
+ "unable to set variable blocksize\n");
goto exit;
}
}
@@ -2291,8 +2283,8 @@ tryagain:
if (error == 0) {
softc->buffer_mode = SMH_SA_BUF_MODE_SIBUF;
} else {
- xpt_print_path(periph->path);
- printf("unable to set buffered mode\n");
+ xpt_print(periph->path,
+ "unable to set buffered mode\n");
}
error = 0; /* not an error */
}
@@ -2534,8 +2526,8 @@ saerror(union ccb *ccb, u_int32_t cflgs, u_int32_t sflgs)
*/
if (error == 0 && (sense->flags & SSD_ILI)) {
if (info < 0) {
- xpt_print_path(csio->ccb_h.path);
- printf(toobig, csio->dxfer_len - info);
+ xpt_print(csio->ccb_h.path, toobig,
+ csio->dxfer_len - info);
csio->resid = csio->dxfer_len;
error = EIO;
} else {
@@ -2956,8 +2948,8 @@ retry:
* so turn off the set compression bit.
*/
params_to_set &= ~SA_PARAM_COMPRESSION;
- xpt_print_path(periph->path);
- printf("device does not seem to support compression\n");
+ xpt_print(periph->path,
+ "device does not seem to support compression\n");
/*
* If that was the only thing the user wanted us to set,
diff --git a/sys/cam/scsi/scsi_ses.c b/sys/cam/scsi/scsi_ses.c
index 608290d..2af83ce 100644
--- a/sys/cam/scsi/scsi_ses.c
+++ b/sys/cam/scsi/scsi_ses.c
@@ -237,8 +237,7 @@ sesoninvalidate(struct cam_periph *periph)
softc->ses_flags |= SES_FLAG_INVALID;
- xpt_print_path(periph->path);
- printf("lost device\n");
+ xpt_print(periph->path, "lost device\n");
}
static void
@@ -250,8 +249,7 @@ sescleanup(struct cam_periph *periph)
destroy_dev(softc->ses_dev);
- xpt_print_path(periph->path);
- printf("removing device entry\n");
+ xpt_print(periph->path, "removing device entry\n");
free(softc, M_SCSISES);
}
diff --git a/sys/cam/scsi/scsi_targ_bh.c b/sys/cam/scsi/scsi_targ_bh.c
index e755f2f..b61152e 100644
--- a/sys/cam/scsi/scsi_targ_bh.c
+++ b/sys/cam/scsi/scsi_targ_bh.c
@@ -263,9 +263,9 @@ targbhenlun(struct cam_periph *periph)
xpt_action(&immed_ccb);
status = immed_ccb.ccb_h.status;
if (status != CAM_REQ_CMP) {
- xpt_print_path(periph->path);
- printf("targbhenlun - Enable Lun Rejected with status 0x%x\n",
- status);
+ xpt_print(periph->path,
+ "targbhenlun - Enable Lun Rejected with status 0x%x\n",
+ status);
return (status);
}
@@ -309,9 +309,9 @@ targbhenlun(struct cam_periph *periph)
}
if (i == 0) {
- xpt_print_path(periph->path);
- printf("targbhenlun - Could not allocate accept tio CCBs: "
- "status = 0x%x\n", status);
+ xpt_print(periph->path,
+ "targbhenlun - Could not allocate accept tio CCBs: status "
+ "= 0x%x\n", status);
targbhdislun(periph);
return (CAM_REQ_CMP_ERR);
}
@@ -345,9 +345,9 @@ targbhenlun(struct cam_periph *periph)
}
if (i == 0) {
- xpt_print_path(periph->path);
- printf("targbhenlun - Could not allocate immediate notify "
- "CCBs: status = 0x%x\n", status);
+ xpt_print(periph->path,
+ "targbhenlun - Could not allocate immediate notify "
+ "CCBs: status = 0x%x\n", status);
targbhdislun(periph);
return (CAM_REQ_CMP_ERR);
}
diff --git a/sys/cam/scsi/scsi_target.c b/sys/cam/scsi/scsi_target.c
index db0df75..aea6922 100644
--- a/sys/cam/scsi/scsi_target.c
+++ b/sys/cam/scsi/scsi_target.c
@@ -357,9 +357,8 @@ targendislun(struct cam_path *path, int enable, int grp6_len, int grp7_len)
xpt_action((union ccb *)&en_ccb);
status = en_ccb.ccb_h.status & CAM_STATUS_MASK;
if (status != CAM_REQ_CMP) {
- xpt_print_path(path);
- printf("%sable lun CCB rejected, status %#x\n",
- enable ? "en" : "dis", status);
+ xpt_print(path, "%sable lun CCB rejected, status %#x\n",
+ enable ? "en" : "dis", status);
}
return (status);
}
@@ -611,8 +610,8 @@ targstart(struct cam_periph *periph, union ccb *start_ccb)
if (error == 0)
error = targsendccb(softc, start_ccb, descr);
if (error != 0) {
- xpt_print_path(periph->path);
- printf("targsendccb failed, err %d\n", error);
+ xpt_print(periph->path,
+ "targsendccb failed, err %d\n", error);
xpt_release_ccb(start_ccb);
suword(&descr->user_ccb->ccb_h.status,
CAM_REQ_CMP_ERR);
@@ -905,9 +904,8 @@ targreturnccb(struct targ_softc *softc, union ccb *ccb)
cam_periph_unmapmem(ccb, &descr->mapinfo);
error = copyout(&ccb->ccb_h + 1, u_ccbh + 1, ccb_len);
if (error != 0) {
- xpt_print_path(softc->path);
- printf("targreturnccb - CCB copyout failed (%d)\n",
- error);
+ xpt_print(softc->path,
+ "targreturnccb - CCB copyout failed (%d)\n", error);
}
/* Free CCB or send back to devq. */
targfreeccb(softc, ccb);
@@ -1031,9 +1029,9 @@ abort_all_pending(struct targ_softc *softc)
cab.abort_ccb = (union ccb *)ccb_h;
xpt_action((union ccb *)&cab);
if (cab.ccb_h.status != CAM_REQ_CMP) {
- xpt_print_path(cab.ccb_h.path);
- printf("Unable to abort CCB, status %#x\n",
- cab.ccb_h.status);
+ xpt_print(cab.ccb_h.path,
+ "Unable to abort CCB, status %#x\n",
+ cab.ccb_h.status);
}
}
OpenPOWER on IntegriCloud