aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ide-scsi.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-12-12 17:31:57 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-12-12 17:31:57 -0500
commit69ae6fee4f95c0535e49e338ce0ed3b27fd485b5 (patch)
tree9fcf32235604cd4147f31ba08e60a0611c087331 /drivers/scsi/ide-scsi.c
parentda8cadb31b82c9d41fc593c8deab6aa20b162d6b (diff)
ide-scsi: add ide_scsi_hex_dump() helper
Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Denis Cheng <crquan@gmail.com> Cc: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/scsi/ide-scsi.c')
-rw-r--r--drivers/scsi/ide-scsi.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/scsi/ide-scsi.c b/drivers/scsi/ide-scsi.c
index 7a835a35f21d..9706de9d98d5 100644
--- a/drivers/scsi/ide-scsi.c
+++ b/drivers/scsi/ide-scsi.c
@@ -242,6 +242,11 @@ static void idescsi_output_buffers (ide_drive_t *drive, idescsi_pc_t *pc, unsign
242 } 242 }
243} 243}
244 244
245static void ide_scsi_hex_dump(u8 *data, int len)
246{
247 print_hex_dump(KERN_CONT, "", DUMP_PREFIX_NONE, 16, 1, data, len, 0);
248}
249
245static int idescsi_check_condition(ide_drive_t *drive, struct request *failed_command) 250static int idescsi_check_condition(ide_drive_t *drive, struct request *failed_command)
246{ 251{
247 idescsi_scsi_t *scsi = drive_to_idescsi(drive); 252 idescsi_scsi_t *scsi = drive_to_idescsi(drive);
@@ -272,8 +277,7 @@ static int idescsi_check_condition(ide_drive_t *drive, struct request *failed_co
272 pc->scsi_cmd = ((idescsi_pc_t *) failed_command->special)->scsi_cmd; 277 pc->scsi_cmd = ((idescsi_pc_t *) failed_command->special)->scsi_cmd;
273 if (test_bit(IDESCSI_LOG_CMD, &scsi->log)) { 278 if (test_bit(IDESCSI_LOG_CMD, &scsi->log)) {
274 printk ("ide-scsi: %s: queue cmd = ", drive->name); 279 printk ("ide-scsi: %s: queue cmd = ", drive->name);
275 print_hex_dump(KERN_CONT, "", DUMP_PREFIX_NONE, 16, 1, pc->c, 280 ide_scsi_hex_dump(pc->c, 6);
276 6, 0);
277 } 281 }
278 rq->rq_disk = scsi->disk; 282 rq->rq_disk = scsi->disk;
279 return ide_do_drive_cmd(drive, rq, ide_preempt); 283 return ide_do_drive_cmd(drive, rq, ide_preempt);
@@ -328,8 +332,7 @@ static int idescsi_end_request (ide_drive_t *drive, int uptodate, int nrsecs)
328 idescsi_pc_t *opc = (idescsi_pc_t *) rq->buffer; 332 idescsi_pc_t *opc = (idescsi_pc_t *) rq->buffer;
329 if (log) { 333 if (log) {
330 printk ("ide-scsi: %s: wrap up check %lu, rst = ", drive->name, opc->scsi_cmd->serial_number); 334 printk ("ide-scsi: %s: wrap up check %lu, rst = ", drive->name, opc->scsi_cmd->serial_number);
331 print_hex_dump(KERN_CONT, "", DUMP_PREFIX_NONE, 16, 1, 335 ide_scsi_hex_dump(pc->buffer, 16);
332 pc->buffer, 16, 0);
333 } 336 }
334 memcpy((void *) opc->scsi_cmd->sense_buffer, pc->buffer, SCSI_SENSE_BUFFERSIZE); 337 memcpy((void *) opc->scsi_cmd->sense_buffer, pc->buffer, SCSI_SENSE_BUFFERSIZE);
335 kfree(pc->buffer); 338 kfree(pc->buffer);
@@ -808,12 +811,10 @@ static int idescsi_queue (struct scsi_cmnd *cmd,
808 811
809 if (test_bit(IDESCSI_LOG_CMD, &scsi->log)) { 812 if (test_bit(IDESCSI_LOG_CMD, &scsi->log)) {
810 printk ("ide-scsi: %s: que %lu, cmd = ", drive->name, cmd->serial_number); 813 printk ("ide-scsi: %s: que %lu, cmd = ", drive->name, cmd->serial_number);
811 print_hex_dump(KERN_CONT, "", DUMP_PREFIX_NONE, 16, 1, 814 ide_scsi_hex_dump(cmd->cmnd, cmd->cmd_len);
812 cmd->cmnd, cmd->cmd_len, 0);
813 if (memcmp(pc->c, cmd->cmnd, cmd->cmd_len)) { 815 if (memcmp(pc->c, cmd->cmnd, cmd->cmd_len)) {
814 printk ("ide-scsi: %s: que %lu, tsl = ", drive->name, cmd->serial_number); 816 printk ("ide-scsi: %s: que %lu, tsl = ", drive->name, cmd->serial_number);
815 print_hex_dump(KERN_CONT, "", DUMP_PREFIX_NONE, 16, 1, 817 ide_scsi_hex_dump(pc->c, 12);
816 pc->c, 12, 0);
817 } 818 }
818 } 819 }
819 820