aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/atari_NCR5380.c
diff options
context:
space:
mode:
authorFinn Thain <fthain@telegraphics.com.au>2014-03-17 20:42:20 -0400
committerChristoph Hellwig <hch@lst.de>2014-05-28 06:10:43 -0400
commitd65e634a86e681ffd36717cde63fb81edbb6f719 (patch)
tree3fb1e463c652f6bdb469dd503c7483f56b420aaa /drivers/scsi/atari_NCR5380.c
parent8ad3a593145b4941a1ee9e52896da67e38d082da (diff)
scsi/NCR5380: adopt dprintk()
All NCR5380 drivers already include the NCR5380.h header. Better to adopt those macros rather than have three variations on them. Moreover, the macros in NCR5380.h are preferable because the atari_NCR5380 and sun3_NCR5380 versions are inflexible. For example, they can't accomodate dprintk(NDEBUG_MAIN | NDEBUG_QUEUES, ...) Replace the *_PRINTK macros from atari_NCR5380.h and sun3_NCR5380.h with the equivalent macros from NCR5380.h. Signed-off-by: Finn Thain <fthain@telegraphics.com.au> Acked-by: Sam Creasey <sammy@sammy.net> Acked-by: Michael Schmitz <schmitz@debian.org> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/scsi/atari_NCR5380.c')
-rw-r--r--drivers/scsi/atari_NCR5380.c130
1 files changed, 65 insertions, 65 deletions
diff --git a/drivers/scsi/atari_NCR5380.c b/drivers/scsi/atari_NCR5380.c
index 82ed2fd6be1e..9e642035b38f 100644
--- a/drivers/scsi/atari_NCR5380.c
+++ b/drivers/scsi/atari_NCR5380.c
@@ -370,7 +370,7 @@ static int is_lun_busy(Scsi_Cmnd *cmd, int should_be_tagged)
370 return 0; 370 return 0;
371 if (TagAlloc[cmd->device->id][cmd->device->lun].nr_allocated >= 371 if (TagAlloc[cmd->device->id][cmd->device->lun].nr_allocated >=
372 TagAlloc[cmd->device->id][cmd->device->lun].queue_size) { 372 TagAlloc[cmd->device->id][cmd->device->lun].queue_size) {
373 TAG_PRINTK("scsi%d: target %d lun %d: no free tags\n", 373 dprintk(NDEBUG_TAGS, "scsi%d: target %d lun %d: no free tags\n",
374 H_NO(cmd), cmd->device->id, cmd->device->lun); 374 H_NO(cmd), cmd->device->id, cmd->device->lun);
375 return 1; 375 return 1;
376 } 376 }
@@ -394,7 +394,7 @@ static void cmd_get_tag(Scsi_Cmnd *cmd, int should_be_tagged)
394 !setup_use_tagged_queuing || !cmd->device->tagged_supported) { 394 !setup_use_tagged_queuing || !cmd->device->tagged_supported) {
395 cmd->tag = TAG_NONE; 395 cmd->tag = TAG_NONE;
396 hostdata->busy[cmd->device->id] |= (1 << cmd->device->lun); 396 hostdata->busy[cmd->device->id] |= (1 << cmd->device->lun);
397 TAG_PRINTK("scsi%d: target %d lun %d now allocated by untagged " 397 dprintk(NDEBUG_TAGS, "scsi%d: target %d lun %d now allocated by untagged "
398 "command\n", H_NO(cmd), cmd->device->id, cmd->device->lun); 398 "command\n", H_NO(cmd), cmd->device->id, cmd->device->lun);
399 } else { 399 } else {
400 TAG_ALLOC *ta = &TagAlloc[cmd->device->id][cmd->device->lun]; 400 TAG_ALLOC *ta = &TagAlloc[cmd->device->id][cmd->device->lun];
@@ -402,7 +402,7 @@ static void cmd_get_tag(Scsi_Cmnd *cmd, int should_be_tagged)
402 cmd->tag = find_first_zero_bit(ta->allocated, MAX_TAGS); 402 cmd->tag = find_first_zero_bit(ta->allocated, MAX_TAGS);
403 set_bit(cmd->tag, ta->allocated); 403 set_bit(cmd->tag, ta->allocated);
404 ta->nr_allocated++; 404 ta->nr_allocated++;
405 TAG_PRINTK("scsi%d: using tag %d for target %d lun %d " 405 dprintk(NDEBUG_TAGS, "scsi%d: using tag %d for target %d lun %d "
406 "(now %d tags in use)\n", 406 "(now %d tags in use)\n",
407 H_NO(cmd), cmd->tag, cmd->device->id, 407 H_NO(cmd), cmd->tag, cmd->device->id,
408 cmd->device->lun, ta->nr_allocated); 408 cmd->device->lun, ta->nr_allocated);
@@ -420,7 +420,7 @@ static void cmd_free_tag(Scsi_Cmnd *cmd)
420 420
421 if (cmd->tag == TAG_NONE) { 421 if (cmd->tag == TAG_NONE) {
422 hostdata->busy[cmd->device->id] &= ~(1 << cmd->device->lun); 422 hostdata->busy[cmd->device->id] &= ~(1 << cmd->device->lun);
423 TAG_PRINTK("scsi%d: target %d lun %d untagged cmd finished\n", 423 dprintk(NDEBUG_TAGS, "scsi%d: target %d lun %d untagged cmd finished\n",
424 H_NO(cmd), cmd->device->id, cmd->device->lun); 424 H_NO(cmd), cmd->device->id, cmd->device->lun);
425 } else if (cmd->tag >= MAX_TAGS) { 425 } else if (cmd->tag >= MAX_TAGS) {
426 printk(KERN_NOTICE "scsi%d: trying to free bad tag %d!\n", 426 printk(KERN_NOTICE "scsi%d: trying to free bad tag %d!\n",
@@ -429,7 +429,7 @@ static void cmd_free_tag(Scsi_Cmnd *cmd)
429 TAG_ALLOC *ta = &TagAlloc[cmd->device->id][cmd->device->lun]; 429 TAG_ALLOC *ta = &TagAlloc[cmd->device->id][cmd->device->lun];
430 clear_bit(cmd->tag, ta->allocated); 430 clear_bit(cmd->tag, ta->allocated);
431 ta->nr_allocated--; 431 ta->nr_allocated--;
432 TAG_PRINTK("scsi%d: freed tag %d for target %d lun %d\n", 432 dprintk(NDEBUG_TAGS, "scsi%d: freed tag %d for target %d lun %d\n",
433 H_NO(cmd), cmd->tag, cmd->device->id, cmd->device->lun); 433 H_NO(cmd), cmd->tag, cmd->device->id, cmd->device->lun);
434 } 434 }
435} 435}
@@ -478,7 +478,7 @@ static void merge_contiguous_buffers(Scsi_Cmnd *cmd)
478 for (endaddr = virt_to_phys(cmd->SCp.ptr + cmd->SCp.this_residual - 1) + 1; 478 for (endaddr = virt_to_phys(cmd->SCp.ptr + cmd->SCp.this_residual - 1) + 1;
479 cmd->SCp.buffers_residual && 479 cmd->SCp.buffers_residual &&
480 virt_to_phys(sg_virt(&cmd->SCp.buffer[1])) == endaddr;) { 480 virt_to_phys(sg_virt(&cmd->SCp.buffer[1])) == endaddr;) {
481 MER_PRINTK("VTOP(%p) == %08lx -> merging\n", 481 dprintk(NDEBUG_MERGING, "VTOP(%p) == %08lx -> merging\n",
482 page_address(sg_page(&cmd->SCp.buffer[1])), endaddr); 482 page_address(sg_page(&cmd->SCp.buffer[1])), endaddr);
483#if (NDEBUG & NDEBUG_MERGING) 483#if (NDEBUG & NDEBUG_MERGING)
484 ++cnt; 484 ++cnt;
@@ -490,7 +490,7 @@ static void merge_contiguous_buffers(Scsi_Cmnd *cmd)
490 } 490 }
491#if (NDEBUG & NDEBUG_MERGING) 491#if (NDEBUG & NDEBUG_MERGING)
492 if (oldlen != cmd->SCp.this_residual) 492 if (oldlen != cmd->SCp.this_residual)
493 MER_PRINTK("merged %d buffers from %p, new length %08x\n", 493 dprintk(NDEBUG_MERGING, "merged %d buffers from %p, new length %08x\n",
494 cnt, cmd->SCp.ptr, cmd->SCp.this_residual); 494 cnt, cmd->SCp.ptr, cmd->SCp.this_residual);
495#endif 495#endif
496} 496}
@@ -676,7 +676,7 @@ static inline void NCR5380_all_init(void)
676{ 676{
677 static int done = 0; 677 static int done = 0;
678 if (!done) { 678 if (!done) {
679 INI_PRINTK("scsi : NCR5380_all_init()\n"); 679 dprintk(NDEBUG_INIT, "scsi : NCR5380_all_init()\n");
680 done = 1; 680 done = 1;
681 } 681 }
682} 682}
@@ -984,7 +984,7 @@ static int NCR5380_queue_command_lck(Scsi_Cmnd *cmd, void (*done)(Scsi_Cmnd *))
984 } 984 }
985 local_irq_restore(flags); 985 local_irq_restore(flags);
986 986
987 QU_PRINTK("scsi%d: command added to %s of queue\n", H_NO(cmd), 987 dprintk(NDEBUG_QUEUES, "scsi%d: command added to %s of queue\n", H_NO(cmd),
988 (cmd->cmnd[0] == REQUEST_SENSE) ? "head" : "tail"); 988 (cmd->cmnd[0] == REQUEST_SENSE) ? "head" : "tail");
989 989
990 /* If queue_command() is called from an interrupt (real one or bottom 990 /* If queue_command() is called from an interrupt (real one or bottom
@@ -1054,7 +1054,7 @@ static void NCR5380_main(struct work_struct *work)
1054 done = 1; 1054 done = 1;
1055 1055
1056 if (!hostdata->connected) { 1056 if (!hostdata->connected) {
1057 MAIN_PRINTK("scsi%d: not connected\n", HOSTNO); 1057 dprintk(NDEBUG_MAIN, "scsi%d: not connected\n", HOSTNO);
1058 /* 1058 /*
1059 * Search through the issue_queue for a command destined 1059 * Search through the issue_queue for a command destined
1060 * for a target that's not busy. 1060 * for a target that's not busy.
@@ -1107,7 +1107,7 @@ static void NCR5380_main(struct work_struct *work)
1107 * On failure, we must add the command back to the 1107 * On failure, we must add the command back to the
1108 * issue queue so we can keep trying. 1108 * issue queue so we can keep trying.
1109 */ 1109 */
1110 MAIN_PRINTK("scsi%d: main(): command for target %d " 1110 dprintk(NDEBUG_MAIN, "scsi%d: main(): command for target %d "
1111 "lun %d removed from issue_queue\n", 1111 "lun %d removed from issue_queue\n",
1112 HOSTNO, tmp->device->id, tmp->device->lun); 1112 HOSTNO, tmp->device->id, tmp->device->lun);
1113 /* 1113 /*
@@ -1140,7 +1140,7 @@ static void NCR5380_main(struct work_struct *work)
1140#endif 1140#endif
1141 falcon_dont_release--; 1141 falcon_dont_release--;
1142 local_irq_restore(flags); 1142 local_irq_restore(flags);
1143 MAIN_PRINTK("scsi%d: main(): select() failed, " 1143 dprintk(NDEBUG_MAIN, "scsi%d: main(): select() failed, "
1144 "returned to issue_queue\n", HOSTNO); 1144 "returned to issue_queue\n", HOSTNO);
1145 if (hostdata->connected) 1145 if (hostdata->connected)
1146 break; 1146 break;
@@ -1155,10 +1155,10 @@ static void NCR5380_main(struct work_struct *work)
1155#endif 1155#endif
1156 ) { 1156 ) {
1157 local_irq_restore(flags); 1157 local_irq_restore(flags);
1158 MAIN_PRINTK("scsi%d: main: performing information transfer\n", 1158 dprintk(NDEBUG_MAIN, "scsi%d: main: performing information transfer\n",
1159 HOSTNO); 1159 HOSTNO);
1160 NCR5380_information_transfer(instance); 1160 NCR5380_information_transfer(instance);
1161 MAIN_PRINTK("scsi%d: main: done set false\n", HOSTNO); 1161 dprintk(NDEBUG_MAIN, "scsi%d: main: done set false\n", HOSTNO);
1162 done = 0; 1162 done = 0;
1163 } 1163 }
1164 } while (!done); 1164 } while (!done);
@@ -1204,12 +1204,12 @@ static void NCR5380_dma_complete(struct Scsi_Host *instance)
1204 (BASR_PHASE_MATCH|BASR_ACK)) { 1204 (BASR_PHASE_MATCH|BASR_ACK)) {
1205 saved_data = NCR5380_read(INPUT_DATA_REG); 1205 saved_data = NCR5380_read(INPUT_DATA_REG);
1206 overrun = 1; 1206 overrun = 1;
1207 DMA_PRINTK("scsi%d: read overrun handled\n", HOSTNO); 1207 dprintk(NDEBUG_DMA, "scsi%d: read overrun handled\n", HOSTNO);
1208 } 1208 }
1209 } 1209 }
1210 } 1210 }
1211 1211
1212 DMA_PRINTK("scsi%d: real DMA transfer complete, basr 0x%X, sr 0x%X\n", 1212 dprintk(NDEBUG_DMA, "scsi%d: real DMA transfer complete, basr 0x%X, sr 0x%X\n",
1213 HOSTNO, NCR5380_read(BUS_AND_STATUS_REG), 1213 HOSTNO, NCR5380_read(BUS_AND_STATUS_REG),
1214 NCR5380_read(STATUS_REG)); 1214 NCR5380_read(STATUS_REG));
1215 1215
@@ -1229,13 +1229,13 @@ static void NCR5380_dma_complete(struct Scsi_Host *instance)
1229 if ((NCR5380_read(STATUS_REG) & PHASE_MASK) == p && (p & SR_IO)) { 1229 if ((NCR5380_read(STATUS_REG) & PHASE_MASK) == p && (p & SR_IO)) {
1230 cnt = toPIO = atari_read_overruns; 1230 cnt = toPIO = atari_read_overruns;
1231 if (overrun) { 1231 if (overrun) {
1232 DMA_PRINTK("Got an input overrun, using saved byte\n"); 1232 dprintk(NDEBUG_DMA, "Got an input overrun, using saved byte\n");
1233 *(*data)++ = saved_data; 1233 *(*data)++ = saved_data;
1234 (*count)--; 1234 (*count)--;
1235 cnt--; 1235 cnt--;
1236 toPIO--; 1236 toPIO--;
1237 } 1237 }
1238 DMA_PRINTK("Doing %d-byte PIO to 0x%08lx\n", cnt, (long)*data); 1238 dprintk(NDEBUG_DMA, "Doing %d-byte PIO to 0x%08lx\n", cnt, (long)*data);
1239 NCR5380_transfer_pio(instance, &p, &cnt, data); 1239 NCR5380_transfer_pio(instance, &p, &cnt, data);
1240 *count -= toPIO - cnt; 1240 *count -= toPIO - cnt;
1241 } 1241 }
@@ -1261,25 +1261,25 @@ static irqreturn_t NCR5380_intr(int irq, void *dev_id)
1261 int done = 1, handled = 0; 1261 int done = 1, handled = 0;
1262 unsigned char basr; 1262 unsigned char basr;
1263 1263
1264 INT_PRINTK("scsi%d: NCR5380 irq triggered\n", HOSTNO); 1264 dprintk(NDEBUG_INTR, "scsi%d: NCR5380 irq triggered\n", HOSTNO);
1265 1265
1266 /* Look for pending interrupts */ 1266 /* Look for pending interrupts */
1267 basr = NCR5380_read(BUS_AND_STATUS_REG); 1267 basr = NCR5380_read(BUS_AND_STATUS_REG);
1268 INT_PRINTK("scsi%d: BASR=%02x\n", HOSTNO, basr); 1268 dprintk(NDEBUG_INTR, "scsi%d: BASR=%02x\n", HOSTNO, basr);
1269 /* dispatch to appropriate routine if found and done=0 */ 1269 /* dispatch to appropriate routine if found and done=0 */
1270 if (basr & BASR_IRQ) { 1270 if (basr & BASR_IRQ) {
1271 NCR5380_dprint(NDEBUG_INTR, instance); 1271 NCR5380_dprint(NDEBUG_INTR, instance);
1272 if ((NCR5380_read(STATUS_REG) & (SR_SEL|SR_IO)) == (SR_SEL|SR_IO)) { 1272 if ((NCR5380_read(STATUS_REG) & (SR_SEL|SR_IO)) == (SR_SEL|SR_IO)) {
1273 done = 0; 1273 done = 0;
1274 ENABLE_IRQ(); 1274 ENABLE_IRQ();
1275 INT_PRINTK("scsi%d: SEL interrupt\n", HOSTNO); 1275 dprintk(NDEBUG_INTR, "scsi%d: SEL interrupt\n", HOSTNO);
1276 NCR5380_reselect(instance); 1276 NCR5380_reselect(instance);
1277 (void)NCR5380_read(RESET_PARITY_INTERRUPT_REG); 1277 (void)NCR5380_read(RESET_PARITY_INTERRUPT_REG);
1278 } else if (basr & BASR_PARITY_ERROR) { 1278 } else if (basr & BASR_PARITY_ERROR) {
1279 INT_PRINTK("scsi%d: PARITY interrupt\n", HOSTNO); 1279 dprintk(NDEBUG_INTR, "scsi%d: PARITY interrupt\n", HOSTNO);
1280 (void)NCR5380_read(RESET_PARITY_INTERRUPT_REG); 1280 (void)NCR5380_read(RESET_PARITY_INTERRUPT_REG);
1281 } else if ((NCR5380_read(STATUS_REG) & SR_RST) == SR_RST) { 1281 } else if ((NCR5380_read(STATUS_REG) & SR_RST) == SR_RST) {
1282 INT_PRINTK("scsi%d: RESET interrupt\n", HOSTNO); 1282 dprintk(NDEBUG_INTR, "scsi%d: RESET interrupt\n", HOSTNO);
1283 (void)NCR5380_read(RESET_PARITY_INTERRUPT_REG); 1283 (void)NCR5380_read(RESET_PARITY_INTERRUPT_REG);
1284 } else { 1284 } else {
1285 /* 1285 /*
@@ -1298,7 +1298,7 @@ static irqreturn_t NCR5380_intr(int irq, void *dev_id)
1298 ((basr & BASR_END_DMA_TRANSFER) || 1298 ((basr & BASR_END_DMA_TRANSFER) ||
1299 !(basr & BASR_PHASE_MATCH))) { 1299 !(basr & BASR_PHASE_MATCH))) {
1300 1300
1301 INT_PRINTK("scsi%d: PHASE MISM or EOP interrupt\n", HOSTNO); 1301 dprintk(NDEBUG_INTR, "scsi%d: PHASE MISM or EOP interrupt\n", HOSTNO);
1302 NCR5380_dma_complete( instance ); 1302 NCR5380_dma_complete( instance );
1303 done = 0; 1303 done = 0;
1304 ENABLE_IRQ(); 1304 ENABLE_IRQ();
@@ -1323,7 +1323,7 @@ static irqreturn_t NCR5380_intr(int irq, void *dev_id)
1323 } 1323 }
1324 1324
1325 if (!done) { 1325 if (!done) {
1326 INT_PRINTK("scsi%d: in int routine, calling main\n", HOSTNO); 1326 dprintk(NDEBUG_INTR, "scsi%d: in int routine, calling main\n", HOSTNO);
1327 /* Put a call to NCR5380_main() on the queue... */ 1327 /* Put a call to NCR5380_main() on the queue... */
1328 queue_main(); 1328 queue_main();
1329 } 1329 }
@@ -1397,7 +1397,7 @@ static int NCR5380_select(struct Scsi_Host *instance, Scsi_Cmnd *cmd, int tag)
1397 1397
1398 hostdata->restart_select = 0; 1398 hostdata->restart_select = 0;
1399 NCR5380_dprint(NDEBUG_ARBITRATION, instance); 1399 NCR5380_dprint(NDEBUG_ARBITRATION, instance);
1400 ARB_PRINTK("scsi%d: starting arbitration, id = %d\n", HOSTNO, 1400 dprintk(NDEBUG_ARBITRATION, "scsi%d: starting arbitration, id = %d\n", HOSTNO,
1401 instance->this_id); 1401 instance->this_id);
1402 1402
1403 /* 1403 /*
@@ -1442,7 +1442,7 @@ static int NCR5380_select(struct Scsi_Host *instance, Scsi_Cmnd *cmd, int tag)
1442 ; 1442 ;
1443#endif 1443#endif
1444 1444
1445 ARB_PRINTK("scsi%d: arbitration complete\n", HOSTNO); 1445 dprintk(NDEBUG_ARBITRATION, "scsi%d: arbitration complete\n", HOSTNO);
1446 1446
1447 if (hostdata->connected) { 1447 if (hostdata->connected) {
1448 NCR5380_write(MODE_REG, MR_BASE); 1448 NCR5380_write(MODE_REG, MR_BASE);
@@ -1463,7 +1463,7 @@ static int NCR5380_select(struct Scsi_Host *instance, Scsi_Cmnd *cmd, int tag)
1463 (NCR5380_read(INITIATOR_COMMAND_REG) & ICR_ARBITRATION_LOST) || 1463 (NCR5380_read(INITIATOR_COMMAND_REG) & ICR_ARBITRATION_LOST) ||
1464 hostdata->connected) { 1464 hostdata->connected) {
1465 NCR5380_write(MODE_REG, MR_BASE); 1465 NCR5380_write(MODE_REG, MR_BASE);
1466 ARB_PRINTK("scsi%d: lost arbitration, deasserting MR_ARBITRATE\n", 1466 dprintk(NDEBUG_ARBITRATION, "scsi%d: lost arbitration, deasserting MR_ARBITRATE\n",
1467 HOSTNO); 1467 HOSTNO);
1468 return -1; 1468 return -1;
1469 } 1469 }
@@ -1478,7 +1478,7 @@ static int NCR5380_select(struct Scsi_Host *instance, Scsi_Cmnd *cmd, int tag)
1478 hostdata->connected) { 1478 hostdata->connected) {
1479 NCR5380_write(MODE_REG, MR_BASE); 1479 NCR5380_write(MODE_REG, MR_BASE);
1480 NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE); 1480 NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
1481 ARB_PRINTK("scsi%d: lost arbitration, deasserting ICR_ASSERT_SEL\n", 1481 dprintk(NDEBUG_ARBITRATION, "scsi%d: lost arbitration, deasserting ICR_ASSERT_SEL\n",
1482 HOSTNO); 1482 HOSTNO);
1483 return -1; 1483 return -1;
1484 } 1484 }
@@ -1501,7 +1501,7 @@ static int NCR5380_select(struct Scsi_Host *instance, Scsi_Cmnd *cmd, int tag)
1501 return -1; 1501 return -1;
1502 } 1502 }
1503 1503
1504 ARB_PRINTK("scsi%d: won arbitration\n", HOSTNO); 1504 dprintk(NDEBUG_ARBITRATION, "scsi%d: won arbitration\n", HOSTNO);
1505 1505
1506 /* 1506 /*
1507 * Now that we have won arbitration, start Selection process, asserting 1507 * Now that we have won arbitration, start Selection process, asserting
@@ -1561,7 +1561,7 @@ static int NCR5380_select(struct Scsi_Host *instance, Scsi_Cmnd *cmd, int tag)
1561 1561
1562 udelay(1); 1562 udelay(1);
1563 1563
1564 SEL_PRINTK("scsi%d: selecting target %d\n", HOSTNO, cmd->device->id); 1564 dprintk(NDEBUG_SELECTION, "scsi%d: selecting target %d\n", HOSTNO, cmd->device->id);
1565 1565
1566 /* 1566 /*
1567 * The SCSI specification calls for a 250 ms timeout for the actual 1567 * The SCSI specification calls for a 250 ms timeout for the actual
@@ -1630,7 +1630,7 @@ static int NCR5380_select(struct Scsi_Host *instance, Scsi_Cmnd *cmd, int tag)
1630#endif 1630#endif
1631 cmd->scsi_done(cmd); 1631 cmd->scsi_done(cmd);
1632 NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask); 1632 NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);
1633 SEL_PRINTK("scsi%d: target did not respond within 250ms\n", HOSTNO); 1633 dprintk(NDEBUG_SELECTION, "scsi%d: target did not respond within 250ms\n", HOSTNO);
1634 NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask); 1634 NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask);
1635 return 0; 1635 return 0;
1636 } 1636 }
@@ -1656,7 +1656,7 @@ static int NCR5380_select(struct Scsi_Host *instance, Scsi_Cmnd *cmd, int tag)
1656 while (!(NCR5380_read(STATUS_REG) & SR_REQ)) 1656 while (!(NCR5380_read(STATUS_REG) & SR_REQ))
1657 ; 1657 ;
1658 1658
1659 SEL_PRINTK("scsi%d: target %d selected, going into MESSAGE OUT phase.\n", 1659 dprintk(NDEBUG_SELECTION, "scsi%d: target %d selected, going into MESSAGE OUT phase.\n",
1660 HOSTNO, cmd->device->id); 1660 HOSTNO, cmd->device->id);
1661 tmp[0] = IDENTIFY(1, cmd->device->lun); 1661 tmp[0] = IDENTIFY(1, cmd->device->lun);
1662 1662
@@ -1676,7 +1676,7 @@ static int NCR5380_select(struct Scsi_Host *instance, Scsi_Cmnd *cmd, int tag)
1676 data = tmp; 1676 data = tmp;
1677 phase = PHASE_MSGOUT; 1677 phase = PHASE_MSGOUT;
1678 NCR5380_transfer_pio(instance, &phase, &len, &data); 1678 NCR5380_transfer_pio(instance, &phase, &len, &data);
1679 SEL_PRINTK("scsi%d: nexus established.\n", HOSTNO); 1679 dprintk(NDEBUG_SELECTION, "scsi%d: nexus established.\n", HOSTNO);
1680 /* XXX need to handle errors here */ 1680 /* XXX need to handle errors here */
1681 hostdata->connected = cmd; 1681 hostdata->connected = cmd;
1682#ifndef SUPPORT_TAGS 1682#ifndef SUPPORT_TAGS
@@ -1737,11 +1737,11 @@ static int NCR5380_transfer_pio(struct Scsi_Host *instance,
1737 while (!((tmp = NCR5380_read(STATUS_REG)) & SR_REQ)) 1737 while (!((tmp = NCR5380_read(STATUS_REG)) & SR_REQ))
1738 ; 1738 ;
1739 1739
1740 HSH_PRINTK("scsi%d: REQ detected\n", HOSTNO); 1740 dprintk(NDEBUG_HANDSHAKE, "scsi%d: REQ detected\n", HOSTNO);
1741 1741
1742 /* Check for phase mismatch */ 1742 /* Check for phase mismatch */
1743 if ((tmp & PHASE_MASK) != p) { 1743 if ((tmp & PHASE_MASK) != p) {
1744 PIO_PRINTK("scsi%d: phase mismatch\n", HOSTNO); 1744 dprintk(NDEBUG_PIO, "scsi%d: phase mismatch\n", HOSTNO);
1745 NCR5380_dprint_phase(NDEBUG_PIO, instance); 1745 NCR5380_dprint_phase(NDEBUG_PIO, instance);
1746 break; 1746 break;
1747 } 1747 }
@@ -1782,7 +1782,7 @@ static int NCR5380_transfer_pio(struct Scsi_Host *instance,
1782 while (NCR5380_read(STATUS_REG) & SR_REQ) 1782 while (NCR5380_read(STATUS_REG) & SR_REQ)
1783 ; 1783 ;
1784 1784
1785 HSH_PRINTK("scsi%d: req false, handshake complete\n", HOSTNO); 1785 dprintk(NDEBUG_HANDSHAKE, "scsi%d: req false, handshake complete\n", HOSTNO);
1786 1786
1787 /* 1787 /*
1788 * We have several special cases to consider during REQ/ACK handshaking : 1788 * We have several special cases to consider during REQ/ACK handshaking :
@@ -1803,7 +1803,7 @@ static int NCR5380_transfer_pio(struct Scsi_Host *instance,
1803 } 1803 }
1804 } while (--c); 1804 } while (--c);
1805 1805
1806 PIO_PRINTK("scsi%d: residual %d\n", HOSTNO, c); 1806 dprintk(NDEBUG_PIO, "scsi%d: residual %d\n", HOSTNO, c);
1807 1807
1808 *count = c; 1808 *count = c;
1809 *data = d; 1809 *data = d;
@@ -1917,7 +1917,7 @@ static int NCR5380_transfer_dma(struct Scsi_Host *instance,
1917 if (atari_read_overruns && (p & SR_IO)) 1917 if (atari_read_overruns && (p & SR_IO))
1918 c -= atari_read_overruns; 1918 c -= atari_read_overruns;
1919 1919
1920 DMA_PRINTK("scsi%d: initializing DMA for %s, %d bytes %s %p\n", 1920 dprintk(NDEBUG_DMA, "scsi%d: initializing DMA for %s, %d bytes %s %p\n",
1921 HOSTNO, (p & SR_IO) ? "reading" : "writing", 1921 HOSTNO, (p & SR_IO) ? "reading" : "writing",
1922 c, (p & SR_IO) ? "to" : "from", d); 1922 c, (p & SR_IO) ? "to" : "from", d);
1923 1923
@@ -2039,7 +2039,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
2039 * they are at contiguous physical addresses. 2039 * they are at contiguous physical addresses.
2040 */ 2040 */
2041 merge_contiguous_buffers(cmd); 2041 merge_contiguous_buffers(cmd);
2042 INF_PRINTK("scsi%d: %d bytes and %d buffers left\n", 2042 dprintk(NDEBUG_INFORMATION, "scsi%d: %d bytes and %d buffers left\n",
2043 HOSTNO, cmd->SCp.this_residual, 2043 HOSTNO, cmd->SCp.this_residual,
2044 cmd->SCp.buffers_residual); 2044 cmd->SCp.buffers_residual);
2045 } 2045 }
@@ -2123,7 +2123,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
2123 /* Accept message by clearing ACK */ 2123 /* Accept message by clearing ACK */
2124 NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE); 2124 NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
2125 2125
2126 LNK_PRINTK("scsi%d: target %d lun %d linked command " 2126 dprintk(NDEBUG_LINKED, "scsi%d: target %d lun %d linked command "
2127 "complete.\n", HOSTNO, cmd->device->id, cmd->device->lun); 2127 "complete.\n", HOSTNO, cmd->device->id, cmd->device->lun);
2128 2128
2129 /* Enable reselect interrupts */ 2129 /* Enable reselect interrupts */
@@ -2148,7 +2148,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
2148 * and don't free it! */ 2148 * and don't free it! */
2149 cmd->next_link->tag = cmd->tag; 2149 cmd->next_link->tag = cmd->tag;
2150 cmd->result = cmd->SCp.Status | (cmd->SCp.Message << 8); 2150 cmd->result = cmd->SCp.Status | (cmd->SCp.Message << 8);
2151 LNK_PRINTK("scsi%d: target %d lun %d linked request " 2151 dprintk(NDEBUG_LINKED, "scsi%d: target %d lun %d linked request "
2152 "done, calling scsi_done().\n", 2152 "done, calling scsi_done().\n",
2153 HOSTNO, cmd->device->id, cmd->device->lun); 2153 HOSTNO, cmd->device->id, cmd->device->lun);
2154#ifdef NCR5380_STATS 2154#ifdef NCR5380_STATS
@@ -2165,7 +2165,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
2165 /* ++guenther: possible race with Falcon locking */ 2165 /* ++guenther: possible race with Falcon locking */
2166 falcon_dont_release++; 2166 falcon_dont_release++;
2167 hostdata->connected = NULL; 2167 hostdata->connected = NULL;
2168 QU_PRINTK("scsi%d: command for target %d, lun %d " 2168 dprintk(NDEBUG_QUEUES, "scsi%d: command for target %d, lun %d "
2169 "completed\n", HOSTNO, cmd->device->id, cmd->device->lun); 2169 "completed\n", HOSTNO, cmd->device->id, cmd->device->lun);
2170#ifdef SUPPORT_TAGS 2170#ifdef SUPPORT_TAGS
2171 cmd_free_tag(cmd); 2171 cmd_free_tag(cmd);
@@ -2179,7 +2179,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
2179 /* ++Andreas: the mid level code knows about 2179 /* ++Andreas: the mid level code knows about
2180 QUEUE_FULL now. */ 2180 QUEUE_FULL now. */
2181 TAG_ALLOC *ta = &TagAlloc[cmd->device->id][cmd->device->lun]; 2181 TAG_ALLOC *ta = &TagAlloc[cmd->device->id][cmd->device->lun];
2182 TAG_PRINTK("scsi%d: target %d lun %d returned " 2182 dprintk(NDEBUG_TAGS, "scsi%d: target %d lun %d returned "
2183 "QUEUE_FULL after %d commands\n", 2183 "QUEUE_FULL after %d commands\n",
2184 HOSTNO, cmd->device->id, cmd->device->lun, 2184 HOSTNO, cmd->device->id, cmd->device->lun,
2185 ta->nr_allocated); 2185 ta->nr_allocated);
@@ -2224,14 +2224,14 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
2224 (status_byte(cmd->SCp.Status) == CHECK_CONDITION)) { 2224 (status_byte(cmd->SCp.Status) == CHECK_CONDITION)) {
2225 scsi_eh_prep_cmnd(cmd, &hostdata->ses, NULL, 0, ~0); 2225 scsi_eh_prep_cmnd(cmd, &hostdata->ses, NULL, 0, ~0);
2226 2226
2227 ASEN_PRINTK("scsi%d: performing request sense\n", HOSTNO); 2227 dprintk(NDEBUG_AUTOSENSE, "scsi%d: performing request sense\n", HOSTNO);
2228 2228
2229 local_irq_save(flags); 2229 local_irq_save(flags);
2230 LIST(cmd,hostdata->issue_queue); 2230 LIST(cmd,hostdata->issue_queue);
2231 SET_NEXT(cmd, hostdata->issue_queue); 2231 SET_NEXT(cmd, hostdata->issue_queue);
2232 hostdata->issue_queue = (Scsi_Cmnd *) cmd; 2232 hostdata->issue_queue = (Scsi_Cmnd *) cmd;
2233 local_irq_restore(flags); 2233 local_irq_restore(flags);
2234 QU_PRINTK("scsi%d: REQUEST SENSE added to head of " 2234 dprintk(NDEBUG_QUEUES, "scsi%d: REQUEST SENSE added to head of "
2235 "issue queue\n", H_NO(cmd)); 2235 "issue queue\n", H_NO(cmd));
2236 } else 2236 } else
2237#endif /* def AUTOSENSE */ 2237#endif /* def AUTOSENSE */
@@ -2277,7 +2277,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
2277 cmd->device->tagged_supported = 0; 2277 cmd->device->tagged_supported = 0;
2278 hostdata->busy[cmd->device->id] |= (1 << cmd->device->lun); 2278 hostdata->busy[cmd->device->id] |= (1 << cmd->device->lun);
2279 cmd->tag = TAG_NONE; 2279 cmd->tag = TAG_NONE;
2280 TAG_PRINTK("scsi%d: target %d lun %d rejected " 2280 dprintk(NDEBUG_TAGS, "scsi%d: target %d lun %d rejected "
2281 "QUEUE_TAG message; tagged queuing " 2281 "QUEUE_TAG message; tagged queuing "
2282 "disabled\n", 2282 "disabled\n",
2283 HOSTNO, cmd->device->id, cmd->device->lun); 2283 HOSTNO, cmd->device->id, cmd->device->lun);
@@ -2294,7 +2294,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
2294 hostdata->connected = NULL; 2294 hostdata->connected = NULL;
2295 hostdata->disconnected_queue = cmd; 2295 hostdata->disconnected_queue = cmd;
2296 local_irq_restore(flags); 2296 local_irq_restore(flags);
2297 QU_PRINTK("scsi%d: command for target %d lun %d was " 2297 dprintk(NDEBUG_QUEUES, "scsi%d: command for target %d lun %d was "
2298 "moved from connected to the " 2298 "moved from connected to the "
2299 "disconnected_queue\n", HOSTNO, 2299 "disconnected_queue\n", HOSTNO,
2300 cmd->device->id, cmd->device->lun); 2300 cmd->device->id, cmd->device->lun);
@@ -2344,13 +2344,13 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
2344 /* Accept first byte by clearing ACK */ 2344 /* Accept first byte by clearing ACK */
2345 NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE); 2345 NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
2346 2346
2347 EXT_PRINTK("scsi%d: receiving extended message\n", HOSTNO); 2347 dprintk(NDEBUG_EXTENDED, "scsi%d: receiving extended message\n", HOSTNO);
2348 2348
2349 len = 2; 2349 len = 2;
2350 data = extended_msg + 1; 2350 data = extended_msg + 1;
2351 phase = PHASE_MSGIN; 2351 phase = PHASE_MSGIN;
2352 NCR5380_transfer_pio(instance, &phase, &len, &data); 2352 NCR5380_transfer_pio(instance, &phase, &len, &data);
2353 EXT_PRINTK("scsi%d: length=%d, code=0x%02x\n", HOSTNO, 2353 dprintk(NDEBUG_EXTENDED, "scsi%d: length=%d, code=0x%02x\n", HOSTNO,
2354 (int)extended_msg[1], (int)extended_msg[2]); 2354 (int)extended_msg[1], (int)extended_msg[2]);
2355 2355
2356 if (!len && extended_msg[1] <= 2356 if (!len && extended_msg[1] <=
@@ -2362,7 +2362,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)
2362 phase = PHASE_MSGIN; 2362 phase = PHASE_MSGIN;
2363 2363
2364 NCR5380_transfer_pio(instance, &phase, &len, &data); 2364 NCR5380_transfer_pio(instance, &phase, &len, &data);
2365 EXT_PRINTK("scsi%d: message received, residual %d\n", 2365 dprintk(NDEBUG_EXTENDED, "scsi%d: message received, residual %d\n",
2366 HOSTNO, len); 2366 HOSTNO, len);
2367 2367
2368 switch (extended_msg[2]) { 2368 switch (extended_msg[2]) {
@@ -2493,7 +2493,7 @@ static void NCR5380_reselect(struct Scsi_Host *instance)
2493 2493
2494 target_mask = NCR5380_read(CURRENT_SCSI_DATA_REG) & ~(hostdata->id_mask); 2494 target_mask = NCR5380_read(CURRENT_SCSI_DATA_REG) & ~(hostdata->id_mask);
2495 2495
2496 RSL_PRINTK("scsi%d: reselect\n", HOSTNO); 2496 dprintk(NDEBUG_RESELECTION, "scsi%d: reselect\n", HOSTNO);
2497 2497
2498 /* 2498 /*
2499 * At this point, we have detected that our SCSI ID is on the bus, 2499 * At this point, we have detected that our SCSI ID is on the bus,
@@ -2544,7 +2544,7 @@ static void NCR5380_reselect(struct Scsi_Host *instance)
2544 if (!NCR5380_transfer_pio(instance, &phase, &len, &data) && 2544 if (!NCR5380_transfer_pio(instance, &phase, &len, &data) &&
2545 msg[1] == SIMPLE_QUEUE_TAG) 2545 msg[1] == SIMPLE_QUEUE_TAG)
2546 tag = msg[2]; 2546 tag = msg[2];
2547 TAG_PRINTK("scsi%d: target mask %02x, lun %d sent tag %d at " 2547 dprintk(NDEBUG_TAGS, "scsi%d: target mask %02x, lun %d sent tag %d at "
2548 "reselection\n", HOSTNO, target_mask, lun, tag); 2548 "reselection\n", HOSTNO, target_mask, lun, tag);
2549 } 2549 }
2550#endif 2550#endif
@@ -2598,7 +2598,7 @@ static void NCR5380_reselect(struct Scsi_Host *instance)
2598 NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE); 2598 NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE);
2599 2599
2600 hostdata->connected = tmp; 2600 hostdata->connected = tmp;
2601 RSL_PRINTK("scsi%d: nexus established, target = %d, lun = %d, tag = %d\n", 2601 dprintk(NDEBUG_RESELECTION, "scsi%d: nexus established, target = %d, lun = %d, tag = %d\n",
2602 HOSTNO, tmp->device->id, tmp->device->lun, tmp->tag); 2602 HOSTNO, tmp->device->id, tmp->device->lun, tmp->tag);
2603 falcon_dont_release--; 2603 falcon_dont_release--;
2604} 2604}
@@ -2640,7 +2640,7 @@ int NCR5380_abort(Scsi_Cmnd *cmd)
2640 printk(KERN_ERR "scsi%d: !!BINGO!! Falcon has no lock in NCR5380_abort\n", 2640 printk(KERN_ERR "scsi%d: !!BINGO!! Falcon has no lock in NCR5380_abort\n",
2641 HOSTNO); 2641 HOSTNO);
2642 2642
2643 ABRT_PRINTK("scsi%d: abort called basr 0x%02x, sr 0x%02x\n", HOSTNO, 2643 dprintk(NDEBUG_ABORT, "scsi%d: abort called basr 0x%02x, sr 0x%02x\n", HOSTNO,
2644 NCR5380_read(BUS_AND_STATUS_REG), 2644 NCR5380_read(BUS_AND_STATUS_REG),
2645 NCR5380_read(STATUS_REG)); 2645 NCR5380_read(STATUS_REG));
2646 2646
@@ -2653,7 +2653,7 @@ int NCR5380_abort(Scsi_Cmnd *cmd)
2653 2653
2654 if (hostdata->connected == cmd) { 2654 if (hostdata->connected == cmd) {
2655 2655
2656 ABRT_PRINTK("scsi%d: aborting connected command\n", HOSTNO); 2656 dprintk(NDEBUG_ABORT, "scsi%d: aborting connected command\n", HOSTNO);
2657 /* 2657 /*
2658 * We should perform BSY checking, and make sure we haven't slipped 2658 * We should perform BSY checking, and make sure we haven't slipped
2659 * into BUS FREE. 2659 * into BUS FREE.
@@ -2705,7 +2705,7 @@ int NCR5380_abort(Scsi_Cmnd *cmd)
2705 SET_NEXT(tmp, NULL); 2705 SET_NEXT(tmp, NULL);
2706 tmp->result = DID_ABORT << 16; 2706 tmp->result = DID_ABORT << 16;
2707 local_irq_restore(flags); 2707 local_irq_restore(flags);
2708 ABRT_PRINTK("scsi%d: abort removed command from issue queue.\n", 2708 dprintk(NDEBUG_ABORT, "scsi%d: abort removed command from issue queue.\n",
2709 HOSTNO); 2709 HOSTNO);
2710 /* Tagged queuing note: no tag to free here, hasn't been assigned 2710 /* Tagged queuing note: no tag to free here, hasn't been assigned
2711 * yet... */ 2711 * yet... */
@@ -2728,7 +2728,7 @@ int NCR5380_abort(Scsi_Cmnd *cmd)
2728 2728
2729 if (hostdata->connected) { 2729 if (hostdata->connected) {
2730 local_irq_restore(flags); 2730 local_irq_restore(flags);
2731 ABRT_PRINTK("scsi%d: abort failed, command connected.\n", HOSTNO); 2731 dprintk(NDEBUG_ABORT, "scsi%d: abort failed, command connected.\n", HOSTNO);
2732 return FAILED; 2732 return FAILED;
2733 } 2733 }
2734 2734
@@ -2761,12 +2761,12 @@ int NCR5380_abort(Scsi_Cmnd *cmd)
2761 tmp = NEXT(tmp)) { 2761 tmp = NEXT(tmp)) {
2762 if (cmd == tmp) { 2762 if (cmd == tmp) {
2763 local_irq_restore(flags); 2763 local_irq_restore(flags);
2764 ABRT_PRINTK("scsi%d: aborting disconnected command.\n", HOSTNO); 2764 dprintk(NDEBUG_ABORT, "scsi%d: aborting disconnected command.\n", HOSTNO);
2765 2765
2766 if (NCR5380_select(instance, cmd, (int)cmd->tag)) 2766 if (NCR5380_select(instance, cmd, (int)cmd->tag))
2767 return FAILED; 2767 return FAILED;
2768 2768
2769 ABRT_PRINTK("scsi%d: nexus reestablished.\n", HOSTNO); 2769 dprintk(NDEBUG_ABORT, "scsi%d: nexus reestablished.\n", HOSTNO);
2770 2770
2771 do_abort(instance); 2771 do_abort(instance);
2772 2772
@@ -2897,7 +2897,7 @@ static int NCR5380_bus_reset(Scsi_Cmnd *cmd)
2897 */ 2897 */
2898 2898
2899 if ((cmd = connected)) { 2899 if ((cmd = connected)) {
2900 ABRT_PRINTK("scsi%d: reset aborted a connected command\n", H_NO(cmd)); 2900 dprintk(NDEBUG_ABORT, "scsi%d: reset aborted a connected command\n", H_NO(cmd));
2901 cmd->result = (cmd->result & 0xffff) | (DID_RESET << 16); 2901 cmd->result = (cmd->result & 0xffff) | (DID_RESET << 16);
2902 cmd->scsi_done(cmd); 2902 cmd->scsi_done(cmd);
2903 } 2903 }
@@ -2909,7 +2909,7 @@ static int NCR5380_bus_reset(Scsi_Cmnd *cmd)
2909 cmd->scsi_done(cmd); 2909 cmd->scsi_done(cmd);
2910 } 2910 }
2911 if (i > 0) 2911 if (i > 0)
2912 ABRT_PRINTK("scsi: reset aborted %d disconnected command(s)\n", i); 2912 dprintk(NDEBUG_ABORT, "scsi: reset aborted %d disconnected command(s)\n", i);
2913 2913
2914 /* The Falcon lock should be released after a reset... 2914 /* The Falcon lock should be released after a reset...
2915 */ 2915 */
@@ -2949,11 +2949,11 @@ static int NCR5380_bus_reset(Scsi_Cmnd *cmd)
2949 */ 2949 */
2950 2950
2951 if (hostdata->issue_queue) 2951 if (hostdata->issue_queue)
2952 ABRT_PRINTK("scsi%d: reset aborted issued command(s)\n", H_NO(cmd)); 2952 dprintk(NDEBUG_ABORT, "scsi%d: reset aborted issued command(s)\n", H_NO(cmd));
2953 if (hostdata->connected) 2953 if (hostdata->connected)
2954 ABRT_PRINTK("scsi%d: reset aborted a connected command\n", H_NO(cmd)); 2954 dprintk(NDEBUG_ABORT, "scsi%d: reset aborted a connected command\n", H_NO(cmd));
2955 if (hostdata->disconnected_queue) 2955 if (hostdata->disconnected_queue)
2956 ABRT_PRINTK("scsi%d: reset aborted disconnected command(s)\n", H_NO(cmd)); 2956 dprintk(NDEBUG_ABORT, "scsi%d: reset aborted disconnected command(s)\n", H_NO(cmd));
2957 2957
2958 local_irq_save(flags); 2958 local_irq_save(flags);
2959 hostdata->issue_queue = NULL; 2959 hostdata->issue_queue = NULL;