Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Finn Thain and committed by
Christoph Hellwig
d65e634a 8ad3a593

+134 -134
+65 -65
drivers/scsi/atari_NCR5380.c
··· 370 370 return 0; 371 371 if (TagAlloc[cmd->device->id][cmd->device->lun].nr_allocated >= 372 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 374 H_NO(cmd), cmd->device->id, cmd->device->lun); 375 375 return 1; 376 376 } ··· 394 394 !setup_use_tagged_queuing || !cmd->device->tagged_supported) { 395 395 cmd->tag = TAG_NONE; 396 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 398 "command\n", H_NO(cmd), cmd->device->id, cmd->device->lun); 399 399 } else { 400 400 TAG_ALLOC *ta = &TagAlloc[cmd->device->id][cmd->device->lun]; ··· 402 402 cmd->tag = find_first_zero_bit(ta->allocated, MAX_TAGS); 403 403 set_bit(cmd->tag, ta->allocated); 404 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 406 "(now %d tags in use)\n", 407 407 H_NO(cmd), cmd->tag, cmd->device->id, 408 408 cmd->device->lun, ta->nr_allocated); ··· 420 420 421 421 if (cmd->tag == TAG_NONE) { 422 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 424 H_NO(cmd), cmd->device->id, cmd->device->lun); 425 425 } else if (cmd->tag >= MAX_TAGS) { 426 426 printk(KERN_NOTICE "scsi%d: trying to free bad tag %d!\n", ··· 429 429 TAG_ALLOC *ta = &TagAlloc[cmd->device->id][cmd->device->lun]; 430 430 clear_bit(cmd->tag, ta->allocated); 431 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 433 H_NO(cmd), cmd->tag, cmd->device->id, cmd->device->lun); 434 434 } 435 435 } ··· 478 478 for (endaddr = virt_to_phys(cmd->SCp.ptr + cmd->SCp.this_residual - 1) + 1; 479 479 cmd->SCp.buffers_residual && 480 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 482 page_address(sg_page(&cmd->SCp.buffer[1])), endaddr); 483 483 #if (NDEBUG & NDEBUG_MERGING) 484 484 ++cnt; ··· 490 490 } 491 491 #if (NDEBUG & NDEBUG_MERGING) 492 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 494 cnt, cmd->SCp.ptr, cmd->SCp.this_residual); 495 495 #endif 496 496 } ··· 676 676 { 677 677 static int done = 0; 678 678 if (!done) { 679 - INI_PRINTK("scsi : NCR5380_all_init()\n"); 679 + dprintk(NDEBUG_INIT, "scsi : NCR5380_all_init()\n"); 680 680 done = 1; 681 681 } 682 682 } ··· 984 984 } 985 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 988 (cmd->cmnd[0] == REQUEST_SENSE) ? "head" : "tail"); 989 989 990 990 /* If queue_command() is called from an interrupt (real one or bottom ··· 1054 1054 done = 1; 1055 1055 1056 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 1059 * Search through the issue_queue for a command destined 1060 1060 * for a target that's not busy. ··· 1107 1107 * On failure, we must add the command back to the 1108 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 1111 "lun %d removed from issue_queue\n", 1112 1112 HOSTNO, tmp->device->id, tmp->device->lun); 1113 1113 /* ··· 1140 1140 #endif 1141 1141 falcon_dont_release--; 1142 1142 local_irq_restore(flags); 1143 - MAIN_PRINTK("scsi%d: main(): select() failed, " 1143 + dprintk(NDEBUG_MAIN, "scsi%d: main(): select() failed, " 1144 1144 "returned to issue_queue\n", HOSTNO); 1145 1145 if (hostdata->connected) 1146 1146 break; ··· 1155 1155 #endif 1156 1156 ) { 1157 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 1159 HOSTNO); 1160 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 1162 done = 0; 1163 1163 } 1164 1164 } while (!done); ··· 1204 1204 (BASR_PHASE_MATCH|BASR_ACK)) { 1205 1205 saved_data = NCR5380_read(INPUT_DATA_REG); 1206 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 1213 HOSTNO, NCR5380_read(BUS_AND_STATUS_REG), 1214 1214 NCR5380_read(STATUS_REG)); 1215 1215 ··· 1229 1229 if ((NCR5380_read(STATUS_REG) & PHASE_MASK) == p && (p & SR_IO)) { 1230 1230 cnt = toPIO = atari_read_overruns; 1231 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 1233 *(*data)++ = saved_data; 1234 1234 (*count)--; 1235 1235 cnt--; 1236 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 1239 NCR5380_transfer_pio(instance, &p, &cnt, data); 1240 1240 *count -= toPIO - cnt; 1241 1241 } ··· 1261 1261 int done = 1, handled = 0; 1262 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 1266 /* Look for pending interrupts */ 1267 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 1269 /* dispatch to appropriate routine if found and done=0 */ 1270 1270 if (basr & BASR_IRQ) { 1271 1271 NCR5380_dprint(NDEBUG_INTR, instance); 1272 1272 if ((NCR5380_read(STATUS_REG) & (SR_SEL|SR_IO)) == (SR_SEL|SR_IO)) { 1273 1273 done = 0; 1274 1274 ENABLE_IRQ(); 1275 - INT_PRINTK("scsi%d: SEL interrupt\n", HOSTNO); 1275 + dprintk(NDEBUG_INTR, "scsi%d: SEL interrupt\n", HOSTNO); 1276 1276 NCR5380_reselect(instance); 1277 1277 (void)NCR5380_read(RESET_PARITY_INTERRUPT_REG); 1278 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 1280 (void)NCR5380_read(RESET_PARITY_INTERRUPT_REG); 1281 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 1283 (void)NCR5380_read(RESET_PARITY_INTERRUPT_REG); 1284 1284 } else { 1285 1285 /* ··· 1298 1298 ((basr & BASR_END_DMA_TRANSFER) || 1299 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 1302 NCR5380_dma_complete( instance ); 1303 1303 done = 0; 1304 1304 ENABLE_IRQ(); ··· 1323 1323 } 1324 1324 1325 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 1327 /* Put a call to NCR5380_main() on the queue... */ 1328 1328 queue_main(); 1329 1329 } ··· 1397 1397 1398 1398 hostdata->restart_select = 0; 1399 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 1401 instance->this_id); 1402 1402 1403 1403 /* ··· 1442 1442 ; 1443 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 1447 if (hostdata->connected) { 1448 1448 NCR5380_write(MODE_REG, MR_BASE); ··· 1463 1463 (NCR5380_read(INITIATOR_COMMAND_REG) & ICR_ARBITRATION_LOST) || 1464 1464 hostdata->connected) { 1465 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 1467 HOSTNO); 1468 1468 return -1; 1469 1469 } ··· 1478 1478 hostdata->connected) { 1479 1479 NCR5380_write(MODE_REG, MR_BASE); 1480 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 1482 HOSTNO); 1483 1483 return -1; 1484 1484 } ··· 1501 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 1507 * Now that we have won arbitration, start Selection process, asserting ··· 1561 1561 1562 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 1567 * The SCSI specification calls for a 250 ms timeout for the actual ··· 1630 1630 #endif 1631 1631 cmd->scsi_done(cmd); 1632 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 1634 NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask); 1635 1635 return 0; 1636 1636 } ··· 1656 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 1660 HOSTNO, cmd->device->id); 1661 1661 tmp[0] = IDENTIFY(1, cmd->device->lun); 1662 1662 ··· 1676 1676 data = tmp; 1677 1677 phase = PHASE_MSGOUT; 1678 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 1680 /* XXX need to handle errors here */ 1681 1681 hostdata->connected = cmd; 1682 1682 #ifndef SUPPORT_TAGS ··· 1737 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 1742 /* Check for phase mismatch */ 1743 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 1745 NCR5380_dprint_phase(NDEBUG_PIO, instance); 1746 1746 break; 1747 1747 } ··· 1782 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 1788 * We have several special cases to consider during REQ/ACK handshaking : ··· 1803 1803 } 1804 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 1808 *count = c; 1809 1809 *data = d; ··· 1917 1917 if (atari_read_overruns && (p & SR_IO)) 1918 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 1921 HOSTNO, (p & SR_IO) ? "reading" : "writing", 1922 1922 c, (p & SR_IO) ? "to" : "from", d); 1923 1923 ··· 2039 2039 * they are at contiguous physical addresses. 2040 2040 */ 2041 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 2043 HOSTNO, cmd->SCp.this_residual, 2044 2044 cmd->SCp.buffers_residual); 2045 2045 } ··· 2123 2123 /* Accept message by clearing ACK */ 2124 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 2127 "complete.\n", HOSTNO, cmd->device->id, cmd->device->lun); 2128 2128 2129 2129 /* Enable reselect interrupts */ ··· 2148 2148 * and don't free it! */ 2149 2149 cmd->next_link->tag = cmd->tag; 2150 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 2152 "done, calling scsi_done().\n", 2153 2153 HOSTNO, cmd->device->id, cmd->device->lun); 2154 2154 #ifdef NCR5380_STATS ··· 2165 2165 /* ++guenther: possible race with Falcon locking */ 2166 2166 falcon_dont_release++; 2167 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 2169 "completed\n", HOSTNO, cmd->device->id, cmd->device->lun); 2170 2170 #ifdef SUPPORT_TAGS 2171 2171 cmd_free_tag(cmd); ··· 2179 2179 /* ++Andreas: the mid level code knows about 2180 2180 QUEUE_FULL now. */ 2181 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 2183 "QUEUE_FULL after %d commands\n", 2184 2184 HOSTNO, cmd->device->id, cmd->device->lun, 2185 2185 ta->nr_allocated); ··· 2224 2224 (status_byte(cmd->SCp.Status) == CHECK_CONDITION)) { 2225 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 2229 local_irq_save(flags); 2230 2230 LIST(cmd,hostdata->issue_queue); 2231 2231 SET_NEXT(cmd, hostdata->issue_queue); 2232 2232 hostdata->issue_queue = (Scsi_Cmnd *) cmd; 2233 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 2235 "issue queue\n", H_NO(cmd)); 2236 2236 } else 2237 2237 #endif /* def AUTOSENSE */ ··· 2277 2277 cmd->device->tagged_supported = 0; 2278 2278 hostdata->busy[cmd->device->id] |= (1 << cmd->device->lun); 2279 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 2281 "QUEUE_TAG message; tagged queuing " 2282 2282 "disabled\n", 2283 2283 HOSTNO, cmd->device->id, cmd->device->lun); ··· 2294 2294 hostdata->connected = NULL; 2295 2295 hostdata->disconnected_queue = cmd; 2296 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 2298 "moved from connected to the " 2299 2299 "disconnected_queue\n", HOSTNO, 2300 2300 cmd->device->id, cmd->device->lun); ··· 2344 2344 /* Accept first byte by clearing ACK */ 2345 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 2349 len = 2; 2350 2350 data = extended_msg + 1; 2351 2351 phase = PHASE_MSGIN; 2352 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 2354 (int)extended_msg[1], (int)extended_msg[2]); 2355 2355 2356 2356 if (!len && extended_msg[1] <= ··· 2362 2362 phase = PHASE_MSGIN; 2363 2363 2364 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 2366 HOSTNO, len); 2367 2367 2368 2368 switch (extended_msg[2]) { ··· 2493 2493 2494 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 2499 * At this point, we have detected that our SCSI ID is on the bus, ··· 2544 2544 if (!NCR5380_transfer_pio(instance, &phase, &len, &data) && 2545 2545 msg[1] == SIMPLE_QUEUE_TAG) 2546 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 2548 "reselection\n", HOSTNO, target_mask, lun, tag); 2549 2549 } 2550 2550 #endif ··· 2598 2598 NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE); 2599 2599 2600 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 2602 HOSTNO, tmp->device->id, tmp->device->lun, tmp->tag); 2603 2603 falcon_dont_release--; 2604 2604 } ··· 2640 2640 printk(KERN_ERR "scsi%d: !!BINGO!! Falcon has no lock in NCR5380_abort\n", 2641 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 2644 NCR5380_read(BUS_AND_STATUS_REG), 2645 2645 NCR5380_read(STATUS_REG)); 2646 2646 ··· 2653 2653 2654 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 2658 * We should perform BSY checking, and make sure we haven't slipped 2659 2659 * into BUS FREE. ··· 2705 2705 SET_NEXT(tmp, NULL); 2706 2706 tmp->result = DID_ABORT << 16; 2707 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 2709 HOSTNO); 2710 2710 /* Tagged queuing note: no tag to free here, hasn't been assigned 2711 2711 * yet... */ ··· 2728 2728 2729 2729 if (hostdata->connected) { 2730 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 2732 return FAILED; 2733 2733 } 2734 2734 ··· 2761 2761 tmp = NEXT(tmp)) { 2762 2762 if (cmd == tmp) { 2763 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 2766 if (NCR5380_select(instance, cmd, (int)cmd->tag)) 2767 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 2771 do_abort(instance); 2772 2772 ··· 2897 2897 */ 2898 2898 2899 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 2901 cmd->result = (cmd->result & 0xffff) | (DID_RESET << 16); 2902 2902 cmd->scsi_done(cmd); 2903 2903 } ··· 2909 2909 cmd->scsi_done(cmd); 2910 2910 } 2911 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 2914 /* The Falcon lock should be released after a reset... 2915 2915 */ ··· 2949 2949 */ 2950 2950 2951 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 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 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 2958 local_irq_save(flags); 2959 2959 hostdata->issue_queue = NULL;
+8 -8
drivers/scsi/atari_scsi.c
··· 314 314 315 315 dma_stat = tt_scsi_dma.dma_ctrl; 316 316 317 - INT_PRINTK("scsi%d: NCR5380 interrupt, DMA status = %02x\n", 317 + dprintk(NDEBUG_INTR, "scsi%d: NCR5380 interrupt, DMA status = %02x\n", 318 318 atari_scsi_host->host_no, dma_stat & 0xff); 319 319 320 320 /* Look if it was the DMA that has interrupted: First possibility ··· 340 340 if ((dma_stat & 0x02) && !(dma_stat & 0x40)) { 341 341 atari_dma_residual = HOSTDATA_DMALEN - (SCSI_DMA_READ_P(dma_addr) - atari_dma_startaddr); 342 342 343 - DMA_PRINTK("SCSI DMA: There are %ld residual bytes.\n", 343 + dprintk(NDEBUG_DMA, "SCSI DMA: There are %ld residual bytes.\n", 344 344 atari_dma_residual); 345 345 346 346 if ((signed int)atari_dma_residual < 0) ··· 371 371 * other command. These shouldn't disconnect anyway. 372 372 */ 373 373 if (atari_dma_residual & 0x1ff) { 374 - DMA_PRINTK("SCSI DMA: DMA bug corrected, " 374 + dprintk(NDEBUG_DMA, "SCSI DMA: DMA bug corrected, " 375 375 "difference %ld bytes\n", 376 376 512 - (atari_dma_residual & 0x1ff)); 377 377 atari_dma_residual = (atari_dma_residual + 511) & ~0x1ff; ··· 438 438 "ST-DMA fifo\n", transferred & 15); 439 439 440 440 atari_dma_residual = HOSTDATA_DMALEN - transferred; 441 - DMA_PRINTK("SCSI DMA: There are %ld residual bytes.\n", 441 + dprintk(NDEBUG_DMA, "SCSI DMA: There are %ld residual bytes.\n", 442 442 atari_dma_residual); 443 443 } else 444 444 atari_dma_residual = 0; ··· 474 474 /* there are 'nr' bytes left for the last long address 475 475 before the DMA pointer */ 476 476 phys_dst ^= nr; 477 - DMA_PRINTK("SCSI DMA: there are %d rest bytes for phys addr 0x%08lx", 477 + dprintk(NDEBUG_DMA, "SCSI DMA: there are %d rest bytes for phys addr 0x%08lx", 478 478 nr, phys_dst); 479 479 /* The content of the DMA pointer is a physical address! */ 480 480 dst = phys_to_virt(phys_dst); 481 - DMA_PRINTK(" = virt addr %p\n", dst); 481 + dprintk(NDEBUG_DMA, " = virt addr %p\n", dst); 482 482 for (src = (char *)&tt_scsi_dma.dma_restdata; nr != 0; --nr) 483 483 *dst++ = *src++; 484 484 } ··· 883 883 { 884 884 unsigned long addr = virt_to_phys(data); 885 885 886 - DMA_PRINTK("scsi%d: setting up dma, data = %p, phys = %lx, count = %ld, " 886 + dprintk(NDEBUG_DMA, "scsi%d: setting up dma, data = %p, phys = %lx, count = %ld, " 887 887 "dir = %d\n", instance->host_no, data, addr, count, dir); 888 888 889 889 if (!IS_A_TT() && !STRAM_ADDR(addr)) { ··· 1063 1063 possible_len = limit; 1064 1064 1065 1065 if (possible_len != wanted_len) 1066 - DMA_PRINTK("Sorry, must cut DMA transfer size to %ld bytes " 1066 + dprintk(NDEBUG_DMA, "Sorry, must cut DMA transfer size to %ld bytes " 1067 1067 "instead of %ld\n", possible_len, wanted_len); 1068 1068 1069 1069 return possible_len;
+61 -61
drivers/scsi/sun3_NCR5380.c
··· 364 364 return( 0 ); 365 365 if (TagAlloc[cmd->device->id][cmd->device->lun].nr_allocated >= 366 366 TagAlloc[cmd->device->id][cmd->device->lun].queue_size ) { 367 - TAG_PRINTK( "scsi%d: target %d lun %d: no free tags\n", 367 + dprintk(NDEBUG_TAGS, "scsi%d: target %d lun %d: no free tags\n", 368 368 H_NO(cmd), cmd->device->id, cmd->device->lun ); 369 369 return( 1 ); 370 370 } ··· 388 388 !setup_use_tagged_queuing || !cmd->device->tagged_supported) { 389 389 cmd->tag = TAG_NONE; 390 390 hostdata->busy[cmd->device->id] |= (1 << cmd->device->lun); 391 - TAG_PRINTK( "scsi%d: target %d lun %d now allocated by untagged " 391 + dprintk(NDEBUG_TAGS, "scsi%d: target %d lun %d now allocated by untagged " 392 392 "command\n", H_NO(cmd), cmd->device->id, cmd->device->lun ); 393 393 } 394 394 else { ··· 397 397 cmd->tag = find_first_zero_bit( &ta->allocated, MAX_TAGS ); 398 398 set_bit( cmd->tag, &ta->allocated ); 399 399 ta->nr_allocated++; 400 - TAG_PRINTK( "scsi%d: using tag %d for target %d lun %d " 400 + dprintk(NDEBUG_TAGS, "scsi%d: using tag %d for target %d lun %d " 401 401 "(now %d tags in use)\n", 402 402 H_NO(cmd), cmd->tag, cmd->device->id, cmd->device->lun, 403 403 ta->nr_allocated ); ··· 415 415 416 416 if (cmd->tag == TAG_NONE) { 417 417 hostdata->busy[cmd->device->id] &= ~(1 << cmd->device->lun); 418 - TAG_PRINTK( "scsi%d: target %d lun %d untagged cmd finished\n", 418 + dprintk(NDEBUG_TAGS, "scsi%d: target %d lun %d untagged cmd finished\n", 419 419 H_NO(cmd), cmd->device->id, cmd->device->lun ); 420 420 } 421 421 else if (cmd->tag >= MAX_TAGS) { ··· 426 426 TAG_ALLOC *ta = &TagAlloc[cmd->device->id][cmd->device->lun]; 427 427 clear_bit( cmd->tag, &ta->allocated ); 428 428 ta->nr_allocated--; 429 - TAG_PRINTK( "scsi%d: freed tag %d for target %d lun %d\n", 429 + dprintk(NDEBUG_TAGS, "scsi%d: freed tag %d for target %d lun %d\n", 430 430 H_NO(cmd), cmd->tag, cmd->device->id, cmd->device->lun ); 431 431 } 432 432 } ··· 618 618 { 619 619 static int done = 0; 620 620 if (!done) { 621 - INI_PRINTK("scsi : NCR5380_all_init()\n"); 621 + dprintk(NDEBUG_INIT, "scsi : NCR5380_all_init()\n"); 622 622 done = 1; 623 623 } 624 624 } ··· 928 928 929 929 local_irq_restore(flags); 930 930 931 - QU_PRINTK("scsi%d: command added to %s of queue\n", H_NO(cmd), 931 + dprintk(NDEBUG_QUEUES, "scsi%d: command added to %s of queue\n", H_NO(cmd), 932 932 (cmd->cmnd[0] == REQUEST_SENSE) ? "head" : "tail"); 933 933 934 934 /* If queue_command() is called from an interrupt (real one or bottom ··· 998 998 done = 1; 999 999 1000 1000 if (!hostdata->connected) { 1001 - MAIN_PRINTK( "scsi%d: not connected\n", HOSTNO ); 1001 + dprintk(NDEBUG_MAIN, "scsi%d: not connected\n", HOSTNO ); 1002 1002 /* 1003 1003 * Search through the issue_queue for a command destined 1004 1004 * for a target that's not busy. ··· 1047 1047 * On failure, we must add the command back to the 1048 1048 * issue queue so we can keep trying. 1049 1049 */ 1050 - MAIN_PRINTK("scsi%d: main(): command for target %d " 1050 + dprintk(NDEBUG_MAIN, "scsi%d: main(): command for target %d " 1051 1051 "lun %d removed from issue_queue\n", 1052 1052 HOSTNO, tmp->device->id, tmp->device->lun); 1053 1053 /* ··· 1076 1076 cmd_free_tag( tmp ); 1077 1077 #endif 1078 1078 local_irq_restore(flags); 1079 - MAIN_PRINTK("scsi%d: main(): select() failed, " 1079 + dprintk(NDEBUG_MAIN, "scsi%d: main(): select() failed, " 1080 1080 "returned to issue_queue\n", HOSTNO); 1081 1081 if (hostdata->connected) 1082 1082 break; ··· 1090 1090 #endif 1091 1091 ) { 1092 1092 local_irq_restore(flags); 1093 - MAIN_PRINTK("scsi%d: main: performing information transfer\n", 1093 + dprintk(NDEBUG_MAIN, "scsi%d: main: performing information transfer\n", 1094 1094 HOSTNO); 1095 1095 NCR5380_information_transfer(instance); 1096 - MAIN_PRINTK("scsi%d: main: done set false\n", HOSTNO); 1096 + dprintk(NDEBUG_MAIN, "scsi%d: main: done set false\n", HOSTNO); 1097 1097 done = 0; 1098 1098 } 1099 1099 } while (!done); ··· 1130 1130 return; 1131 1131 } 1132 1132 1133 - DMA_PRINTK("scsi%d: real DMA transfer complete, basr 0x%X, sr 0x%X\n", 1133 + dprintk(NDEBUG_DMA, "scsi%d: real DMA transfer complete, basr 0x%X, sr 0x%X\n", 1134 1134 HOSTNO, NCR5380_read(BUS_AND_STATUS_REG), 1135 1135 NCR5380_read(STATUS_REG)); 1136 1136 ··· 1189 1189 int done = 1, handled = 0; 1190 1190 unsigned char basr; 1191 1191 1192 - INT_PRINTK("scsi%d: NCR5380 irq triggered\n", HOSTNO); 1192 + dprintk(NDEBUG_INTR, "scsi%d: NCR5380 irq triggered\n", HOSTNO); 1193 1193 1194 1194 /* Look for pending interrupts */ 1195 1195 basr = NCR5380_read(BUS_AND_STATUS_REG); 1196 - INT_PRINTK("scsi%d: BASR=%02x\n", HOSTNO, basr); 1196 + dprintk(NDEBUG_INTR, "scsi%d: BASR=%02x\n", HOSTNO, basr); 1197 1197 /* dispatch to appropriate routine if found and done=0 */ 1198 1198 if (basr & BASR_IRQ) { 1199 1199 NCR5380_dprint(NDEBUG_INTR, instance); 1200 1200 if ((NCR5380_read(STATUS_REG) & (SR_SEL|SR_IO)) == (SR_SEL|SR_IO)) { 1201 1201 done = 0; 1202 1202 // ENABLE_IRQ(); 1203 - INT_PRINTK("scsi%d: SEL interrupt\n", HOSTNO); 1203 + dprintk(NDEBUG_INTR, "scsi%d: SEL interrupt\n", HOSTNO); 1204 1204 NCR5380_reselect(instance); 1205 1205 (void) NCR5380_read(RESET_PARITY_INTERRUPT_REG); 1206 1206 } 1207 1207 else if (basr & BASR_PARITY_ERROR) { 1208 - INT_PRINTK("scsi%d: PARITY interrupt\n", HOSTNO); 1208 + dprintk(NDEBUG_INTR, "scsi%d: PARITY interrupt\n", HOSTNO); 1209 1209 (void) NCR5380_read(RESET_PARITY_INTERRUPT_REG); 1210 1210 } 1211 1211 else if ((NCR5380_read(STATUS_REG) & SR_RST) == SR_RST) { 1212 - INT_PRINTK("scsi%d: RESET interrupt\n", HOSTNO); 1212 + dprintk(NDEBUG_INTR, "scsi%d: RESET interrupt\n", HOSTNO); 1213 1213 (void)NCR5380_read(RESET_PARITY_INTERRUPT_REG); 1214 1214 } 1215 1215 else { ··· 1229 1229 ((basr & BASR_END_DMA_TRANSFER) || 1230 1230 !(basr & BASR_PHASE_MATCH))) { 1231 1231 1232 - INT_PRINTK("scsi%d: PHASE MISM or EOP interrupt\n", HOSTNO); 1232 + dprintk(NDEBUG_INTR, "scsi%d: PHASE MISM or EOP interrupt\n", HOSTNO); 1233 1233 NCR5380_dma_complete( instance ); 1234 1234 done = 0; 1235 1235 // ENABLE_IRQ(); ··· 1238 1238 { 1239 1239 /* MS: Ignore unknown phase mismatch interrupts (caused by EOP interrupt) */ 1240 1240 if (basr & BASR_PHASE_MATCH) 1241 - INT_PRINTK("scsi%d: unknown interrupt, " 1241 + dprintk(NDEBUG_INTR, "scsi%d: unknown interrupt, " 1242 1242 "BASR 0x%x, MR 0x%x, SR 0x%x\n", 1243 1243 HOSTNO, basr, NCR5380_read(MODE_REG), 1244 1244 NCR5380_read(STATUS_REG)); ··· 1262 1262 } 1263 1263 1264 1264 if (!done) { 1265 - INT_PRINTK("scsi%d: in int routine, calling main\n", HOSTNO); 1265 + dprintk(NDEBUG_INTR, "scsi%d: in int routine, calling main\n", HOSTNO); 1266 1266 /* Put a call to NCR5380_main() on the queue... */ 1267 1267 queue_main(); 1268 1268 } ··· 1339 1339 1340 1340 hostdata->restart_select = 0; 1341 1341 NCR5380_dprint(NDEBUG_ARBITRATION, instance); 1342 - ARB_PRINTK("scsi%d: starting arbitration, id = %d\n", HOSTNO, 1342 + dprintk(NDEBUG_ARBITRATION, "scsi%d: starting arbitration, id = %d\n", HOSTNO, 1343 1343 instance->this_id); 1344 1344 1345 1345 /* ··· 1385 1385 && !hostdata->connected); 1386 1386 #endif 1387 1387 1388 - ARB_PRINTK("scsi%d: arbitration complete\n", HOSTNO); 1388 + dprintk(NDEBUG_ARBITRATION, "scsi%d: arbitration complete\n", HOSTNO); 1389 1389 1390 1390 if (hostdata->connected) { 1391 1391 NCR5380_write(MODE_REG, MR_BASE); ··· 1406 1406 (NCR5380_read(INITIATOR_COMMAND_REG) & ICR_ARBITRATION_LOST) || 1407 1407 hostdata->connected) { 1408 1408 NCR5380_write(MODE_REG, MR_BASE); 1409 - ARB_PRINTK("scsi%d: lost arbitration, deasserting MR_ARBITRATE\n", 1409 + dprintk(NDEBUG_ARBITRATION, "scsi%d: lost arbitration, deasserting MR_ARBITRATE\n", 1410 1410 HOSTNO); 1411 1411 return -1; 1412 1412 } ··· 1421 1421 hostdata->connected) { 1422 1422 NCR5380_write(MODE_REG, MR_BASE); 1423 1423 NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE); 1424 - ARB_PRINTK("scsi%d: lost arbitration, deasserting ICR_ASSERT_SEL\n", 1424 + dprintk(NDEBUG_ARBITRATION, "scsi%d: lost arbitration, deasserting ICR_ASSERT_SEL\n", 1425 1425 HOSTNO); 1426 1426 return -1; 1427 1427 } ··· 1444 1444 return -1; 1445 1445 } 1446 1446 1447 - ARB_PRINTK("scsi%d: won arbitration\n", HOSTNO); 1447 + dprintk(NDEBUG_ARBITRATION, "scsi%d: won arbitration\n", HOSTNO); 1448 1448 1449 1449 /* 1450 1450 * Now that we have won arbitration, start Selection process, asserting ··· 1504 1504 1505 1505 udelay(1); 1506 1506 1507 - SEL_PRINTK("scsi%d: selecting target %d\n", HOSTNO, cmd->device->id); 1507 + dprintk(NDEBUG_SELECTION, "scsi%d: selecting target %d\n", HOSTNO, cmd->device->id); 1508 1508 1509 1509 /* 1510 1510 * The SCSI specification calls for a 250 ms timeout for the actual ··· 1572 1572 #endif 1573 1573 cmd->scsi_done(cmd); 1574 1574 NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask); 1575 - SEL_PRINTK("scsi%d: target did not respond within 250ms\n", HOSTNO); 1575 + dprintk(NDEBUG_SELECTION, "scsi%d: target did not respond within 250ms\n", HOSTNO); 1576 1576 NCR5380_write(SELECT_ENABLE_REG, hostdata->id_mask); 1577 1577 return 0; 1578 1578 } ··· 1597 1597 /* Wait for start of REQ/ACK handshake */ 1598 1598 while (!(NCR5380_read(STATUS_REG) & SR_REQ)); 1599 1599 1600 - SEL_PRINTK("scsi%d: target %d selected, going into MESSAGE OUT phase.\n", 1600 + dprintk(NDEBUG_SELECTION, "scsi%d: target %d selected, going into MESSAGE OUT phase.\n", 1601 1601 HOSTNO, cmd->device->id); 1602 1602 tmp[0] = IDENTIFY(1, cmd->device->lun); 1603 1603 ··· 1617 1617 data = tmp; 1618 1618 phase = PHASE_MSGOUT; 1619 1619 NCR5380_transfer_pio(instance, &phase, &len, &data); 1620 - SEL_PRINTK("scsi%d: nexus established.\n", HOSTNO); 1620 + dprintk(NDEBUG_SELECTION, "scsi%d: nexus established.\n", HOSTNO); 1621 1621 /* XXX need to handle errors here */ 1622 1622 hostdata->connected = cmd; 1623 1623 #ifndef SUPPORT_TAGS ··· 1680 1680 */ 1681 1681 while (!((tmp = NCR5380_read(STATUS_REG)) & SR_REQ)); 1682 1682 1683 - HSH_PRINTK("scsi%d: REQ detected\n", HOSTNO); 1683 + dprintk(NDEBUG_HANDSHAKE, "scsi%d: REQ detected\n", HOSTNO); 1684 1684 1685 1685 /* Check for phase mismatch */ 1686 1686 if ((tmp & PHASE_MASK) != p) { 1687 - PIO_PRINTK("scsi%d: phase mismatch\n", HOSTNO); 1687 + dprintk(NDEBUG_PIO, "scsi%d: phase mismatch\n", HOSTNO); 1688 1688 NCR5380_dprint_phase(NDEBUG_PIO, instance); 1689 1689 break; 1690 1690 } ··· 1725 1725 1726 1726 while (NCR5380_read(STATUS_REG) & SR_REQ); 1727 1727 1728 - HSH_PRINTK("scsi%d: req false, handshake complete\n", HOSTNO); 1728 + dprintk(NDEBUG_HANDSHAKE, "scsi%d: req false, handshake complete\n", HOSTNO); 1729 1729 1730 1730 /* 1731 1731 * We have several special cases to consider during REQ/ACK handshaking : ··· 1746 1746 } 1747 1747 } while (--c); 1748 1748 1749 - PIO_PRINTK("scsi%d: residual %d\n", HOSTNO, c); 1749 + dprintk(NDEBUG_PIO, "scsi%d: residual %d\n", HOSTNO, c); 1750 1750 1751 1751 *count = c; 1752 1752 *data = d; ··· 1854 1854 } 1855 1855 hostdata->dma_len = c; 1856 1856 1857 - DMA_PRINTK("scsi%d: initializing DMA for %s, %d bytes %s %p\n", 1857 + dprintk(NDEBUG_DMA, "scsi%d: initializing DMA for %s, %d bytes %s %p\n", 1858 1858 HOSTNO, (p & SR_IO) ? "reading" : "writing", 1859 1859 c, (p & SR_IO) ? "to" : "from", *data); 1860 1860 ··· 1996 1996 --cmd->SCp.buffers_residual; 1997 1997 cmd->SCp.this_residual = cmd->SCp.buffer->length; 1998 1998 cmd->SCp.ptr = SGADDR(cmd->SCp.buffer); 1999 - INF_PRINTK("scsi%d: %d bytes and %d buffers left\n", 1999 + dprintk(NDEBUG_INFORMATION, "scsi%d: %d bytes and %d buffers left\n", 2000 2000 HOSTNO, cmd->SCp.this_residual, 2001 2001 cmd->SCp.buffers_residual); 2002 2002 } ··· 2088 2088 /* Accept message by clearing ACK */ 2089 2089 NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE); 2090 2090 2091 - LNK_PRINTK("scsi%d: target %d lun %d linked command " 2091 + dprintk(NDEBUG_LINKED, "scsi%d: target %d lun %d linked command " 2092 2092 "complete.\n", HOSTNO, cmd->device->id, cmd->device->lun); 2093 2093 2094 2094 /* Enable reselect interrupts */ ··· 2113 2113 * and don't free it! */ 2114 2114 cmd->next_link->tag = cmd->tag; 2115 2115 cmd->result = cmd->SCp.Status | (cmd->SCp.Message << 8); 2116 - LNK_PRINTK("scsi%d: target %d lun %d linked request " 2116 + dprintk(NDEBUG_LINKED, "scsi%d: target %d lun %d linked request " 2117 2117 "done, calling scsi_done().\n", 2118 2118 HOSTNO, cmd->device->id, cmd->device->lun); 2119 2119 #ifdef NCR5380_STATS ··· 2128 2128 /* Accept message by clearing ACK */ 2129 2129 NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE); 2130 2130 hostdata->connected = NULL; 2131 - QU_PRINTK("scsi%d: command for target %d, lun %d " 2131 + dprintk(NDEBUG_QUEUES, "scsi%d: command for target %d, lun %d " 2132 2132 "completed\n", HOSTNO, cmd->device->id, cmd->device->lun); 2133 2133 #ifdef SUPPORT_TAGS 2134 2134 cmd_free_tag( cmd ); ··· 2142 2142 /* ++Andreas: the mid level code knows about 2143 2143 QUEUE_FULL now. */ 2144 2144 TAG_ALLOC *ta = &TagAlloc[cmd->device->id][cmd->device->lun]; 2145 - TAG_PRINTK("scsi%d: target %d lun %d returned " 2145 + dprintk(NDEBUG_TAGS, "scsi%d: target %d lun %d returned " 2146 2146 "QUEUE_FULL after %d commands\n", 2147 2147 HOSTNO, cmd->device->id, cmd->device->lun, 2148 2148 ta->nr_allocated); ··· 2186 2186 if ((cmd->cmnd[0] != REQUEST_SENSE) && 2187 2187 (status_byte(cmd->SCp.Status) == CHECK_CONDITION)) { 2188 2188 scsi_eh_prep_cmnd(cmd, &hostdata->ses, NULL, 0, ~0); 2189 - ASEN_PRINTK("scsi%d: performing request sense\n", 2189 + dprintk(NDEBUG_AUTOSENSE, "scsi%d: performing request sense\n", 2190 2190 HOSTNO); 2191 2191 /* this is initialized from initialize_SCp 2192 2192 cmd->SCp.buffer = NULL; ··· 2198 2198 SET_NEXT(cmd, hostdata->issue_queue); 2199 2199 hostdata->issue_queue = (struct scsi_cmnd *) cmd; 2200 2200 local_irq_restore(flags); 2201 - QU_PRINTK("scsi%d: REQUEST SENSE added to head of " 2201 + dprintk(NDEBUG_QUEUES, "scsi%d: REQUEST SENSE added to head of " 2202 2202 "issue queue\n", H_NO(cmd)); 2203 2203 } else 2204 2204 #endif /* def AUTOSENSE */ ··· 2238 2238 cmd->device->tagged_supported = 0; 2239 2239 hostdata->busy[cmd->device->id] |= (1 << cmd->device->lun); 2240 2240 cmd->tag = TAG_NONE; 2241 - TAG_PRINTK("scsi%d: target %d lun %d rejected " 2241 + dprintk(NDEBUG_TAGS, "scsi%d: target %d lun %d rejected " 2242 2242 "QUEUE_TAG message; tagged queuing " 2243 2243 "disabled\n", 2244 2244 HOSTNO, cmd->device->id, cmd->device->lun); ··· 2255 2255 hostdata->connected = NULL; 2256 2256 hostdata->disconnected_queue = cmd; 2257 2257 local_irq_restore(flags); 2258 - QU_PRINTK("scsi%d: command for target %d lun %d was " 2258 + dprintk(NDEBUG_QUEUES, "scsi%d: command for target %d lun %d was " 2259 2259 "moved from connected to the " 2260 2260 "disconnected_queue\n", HOSTNO, 2261 2261 cmd->device->id, cmd->device->lun); ··· 2308 2308 /* Accept first byte by clearing ACK */ 2309 2309 NCR5380_write(INITIATOR_COMMAND_REG, ICR_BASE); 2310 2310 2311 - EXT_PRINTK("scsi%d: receiving extended message\n", HOSTNO); 2311 + dprintk(NDEBUG_EXTENDED, "scsi%d: receiving extended message\n", HOSTNO); 2312 2312 2313 2313 len = 2; 2314 2314 data = extended_msg + 1; 2315 2315 phase = PHASE_MSGIN; 2316 2316 NCR5380_transfer_pio(instance, &phase, &len, &data); 2317 - EXT_PRINTK("scsi%d: length=%d, code=0x%02x\n", HOSTNO, 2317 + dprintk(NDEBUG_EXTENDED, "scsi%d: length=%d, code=0x%02x\n", HOSTNO, 2318 2318 (int)extended_msg[1], (int)extended_msg[2]); 2319 2319 2320 2320 if (!len && extended_msg[1] <= ··· 2326 2326 phase = PHASE_MSGIN; 2327 2327 2328 2328 NCR5380_transfer_pio(instance, &phase, &len, &data); 2329 - EXT_PRINTK("scsi%d: message received, residual %d\n", 2329 + dprintk(NDEBUG_EXTENDED, "scsi%d: message received, residual %d\n", 2330 2330 HOSTNO, len); 2331 2331 2332 2332 switch (extended_msg[2]) { ··· 2458 2458 2459 2459 target_mask = NCR5380_read(CURRENT_SCSI_DATA_REG) & ~(hostdata->id_mask); 2460 2460 2461 - RSL_PRINTK("scsi%d: reselect\n", HOSTNO); 2461 + dprintk(NDEBUG_RESELECTION, "scsi%d: reselect\n", HOSTNO); 2462 2462 2463 2463 /* 2464 2464 * At this point, we have detected that our SCSI ID is on the bus, ··· 2580 2580 if (!NCR5380_transfer_pio(instance, &phase, &len, &data) && 2581 2581 msg[1] == SIMPLE_QUEUE_TAG) 2582 2582 tag = msg[2]; 2583 - TAG_PRINTK("scsi%d: target mask %02x, lun %d sent tag %d at " 2583 + dprintk(NDEBUG_TAGS, "scsi%d: target mask %02x, lun %d sent tag %d at " 2584 2584 "reselection\n", HOSTNO, target_mask, lun, tag); 2585 2585 } 2586 2586 #endif 2587 2587 2588 2588 hostdata->connected = tmp; 2589 - RSL_PRINTK("scsi%d: nexus established, target = %d, lun = %d, tag = %d\n", 2589 + dprintk(NDEBUG_RESELECTION, "scsi%d: nexus established, target = %d, lun = %d, tag = %d\n", 2590 2590 HOSTNO, tmp->device->id, tmp->device->lun, tmp->tag); 2591 2591 } 2592 2592 ··· 2622 2622 2623 2623 local_irq_save(flags); 2624 2624 2625 - ABRT_PRINTK("scsi%d: abort called basr 0x%02x, sr 0x%02x\n", HOSTNO, 2625 + dprintk(NDEBUG_ABORT, "scsi%d: abort called basr 0x%02x, sr 0x%02x\n", HOSTNO, 2626 2626 NCR5380_read(BUS_AND_STATUS_REG), 2627 2627 NCR5380_read(STATUS_REG)); 2628 2628 ··· 2635 2635 2636 2636 if (hostdata->connected == cmd) { 2637 2637 2638 - ABRT_PRINTK("scsi%d: aborting connected command\n", HOSTNO); 2638 + dprintk(NDEBUG_ABORT, "scsi%d: aborting connected command\n", HOSTNO); 2639 2639 /* 2640 2640 * We should perform BSY checking, and make sure we haven't slipped 2641 2641 * into BUS FREE. ··· 2686 2686 SET_NEXT(tmp, NULL); 2687 2687 tmp->result = DID_ABORT << 16; 2688 2688 local_irq_restore(flags); 2689 - ABRT_PRINTK("scsi%d: abort removed command from issue queue.\n", 2689 + dprintk(NDEBUG_ABORT, "scsi%d: abort removed command from issue queue.\n", 2690 2690 HOSTNO); 2691 2691 /* Tagged queuing note: no tag to free here, hasn't been assigned 2692 2692 * yet... */ ··· 2707 2707 2708 2708 if (hostdata->connected) { 2709 2709 local_irq_restore(flags); 2710 - ABRT_PRINTK("scsi%d: abort failed, command connected.\n", HOSTNO); 2710 + dprintk(NDEBUG_ABORT, "scsi%d: abort failed, command connected.\n", HOSTNO); 2711 2711 return FAILED; 2712 2712 } 2713 2713 ··· 2740 2740 tmp = NEXT(tmp)) 2741 2741 if (cmd == tmp) { 2742 2742 local_irq_restore(flags); 2743 - ABRT_PRINTK("scsi%d: aborting disconnected command.\n", HOSTNO); 2743 + dprintk(NDEBUG_ABORT, "scsi%d: aborting disconnected command.\n", HOSTNO); 2744 2744 2745 2745 if (NCR5380_select (instance, cmd, (int) cmd->tag)) 2746 2746 return FAILED; 2747 2747 2748 - ABRT_PRINTK("scsi%d: nexus reestablished.\n", HOSTNO); 2748 + dprintk(NDEBUG_ABORT, "scsi%d: nexus reestablished.\n", HOSTNO); 2749 2749 2750 2750 do_abort (instance); 2751 2751 ··· 2864 2864 */ 2865 2865 2866 2866 if ((cmd = connected)) { 2867 - ABRT_PRINTK("scsi%d: reset aborted a connected command\n", H_NO(cmd)); 2867 + dprintk(NDEBUG_ABORT, "scsi%d: reset aborted a connected command\n", H_NO(cmd)); 2868 2868 cmd->result = (cmd->result & 0xffff) | (DID_RESET << 16); 2869 2869 cmd->scsi_done( cmd ); 2870 2870 } ··· 2876 2876 cmd->scsi_done( cmd ); 2877 2877 } 2878 2878 if (i > 0) 2879 - ABRT_PRINTK("scsi: reset aborted %d disconnected command(s)\n", i); 2879 + dprintk(NDEBUG_ABORT, "scsi: reset aborted %d disconnected command(s)\n", i); 2880 2880 2881 2881 2882 2882 /* since all commands have been explicitly terminated, we need to tell ··· 2910 2910 */ 2911 2911 2912 2912 if (hostdata->issue_queue) 2913 - ABRT_PRINTK("scsi%d: reset aborted issued command(s)\n", H_NO(cmd)); 2913 + dprintk(NDEBUG_ABORT, "scsi%d: reset aborted issued command(s)\n", H_NO(cmd)); 2914 2914 if (hostdata->connected) 2915 - ABRT_PRINTK("scsi%d: reset aborted a connected command\n", H_NO(cmd)); 2915 + dprintk(NDEBUG_ABORT, "scsi%d: reset aborted a connected command\n", H_NO(cmd)); 2916 2916 if (hostdata->disconnected_queue) 2917 - ABRT_PRINTK("scsi%d: reset aborted disconnected command(s)\n", H_NO(cmd)); 2917 + dprintk(NDEBUG_ABORT, "scsi%d: reset aborted disconnected command(s)\n", H_NO(cmd)); 2918 2918 2919 2919 local_irq_save(flags); 2920 2920 hostdata->issue_queue = NULL;