aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aic7xxx
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/aic7xxx')
-rw-r--r--drivers/scsi/aic7xxx/aic79xx_osm.c39
-rw-r--r--drivers/scsi/aic7xxx/aic7xxx_osm.c32
2 files changed, 26 insertions, 45 deletions
diff --git a/drivers/scsi/aic7xxx/aic79xx_osm.c b/drivers/scsi/aic7xxx/aic79xx_osm.c
index 95c285cc83e4..cfb46c241b38 100644
--- a/drivers/scsi/aic7xxx/aic79xx_osm.c
+++ b/drivers/scsi/aic7xxx/aic79xx_osm.c
@@ -52,6 +52,7 @@ static struct scsi_transport_template *ahd_linux_transport_template = NULL;
52#include <linux/mm.h> /* For fetching system memory size */ 52#include <linux/mm.h> /* For fetching system memory size */
53#include <linux/blkdev.h> /* For block_size() */ 53#include <linux/blkdev.h> /* For block_size() */
54#include <linux/delay.h> /* For ssleep/msleep */ 54#include <linux/delay.h> /* For ssleep/msleep */
55#include <linux/device.h>
55 56
56/* 57/*
57 * Bucket size for counting good commands in between bad ones. 58 * Bucket size for counting good commands in between bad ones.
@@ -397,7 +398,7 @@ ahd_linux_unmap_scb(struct ahd_softc *ahd, struct scb *scb)
397 398
398/******************************** Macros **************************************/ 399/******************************** Macros **************************************/
399#define BUILD_SCSIID(ahd, cmd) \ 400#define BUILD_SCSIID(ahd, cmd) \
400 ((((cmd)->device->id << TID_SHIFT) & TID) | (ahd)->our_id) 401 (((scmd_id(cmd) << TID_SHIFT) & TID) | (ahd)->our_id)
401 402
402/* 403/*
403 * Return a string describing the driver. 404 * Return a string describing the driver.
@@ -565,7 +566,7 @@ ahd_linux_slave_configure(struct scsi_device *sdev)
565 566
566 ahd = *((struct ahd_softc **)sdev->host->hostdata); 567 ahd = *((struct ahd_softc **)sdev->host->hostdata);
567 if (bootverbose) 568 if (bootverbose)
568 printf("%s: Slave Configure %d\n", ahd_name(ahd), sdev->id); 569 sdev_printk(KERN_INFO, sdev, "Slave Configure\n");
569 570
570 ahd_linux_device_queue_depth(sdev); 571 ahd_linux_device_queue_depth(sdev);
571 572
@@ -684,7 +685,7 @@ ahd_linux_bus_reset(struct scsi_cmnd *cmd)
684 ahd_name(ahd), cmd); 685 ahd_name(ahd), cmd);
685#endif 686#endif
686 ahd_lock(ahd, &s); 687 ahd_lock(ahd, &s);
687 found = ahd_reset_channel(ahd, cmd->device->channel + 'A', 688 found = ahd_reset_channel(ahd, scmd_channel(cmd) + 'A',
688 /*initiate reset*/TRUE); 689 /*initiate reset*/TRUE);
689 ahd_unlock(ahd, &s); 690 ahd_unlock(ahd, &s);
690 691
@@ -2067,9 +2068,8 @@ ahd_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
2067 wait = FALSE; 2068 wait = FALSE;
2068 ahd = *(struct ahd_softc **)cmd->device->host->hostdata; 2069 ahd = *(struct ahd_softc **)cmd->device->host->hostdata;
2069 2070
2070 printf("%s:%d:%d:%d: Attempting to queue a%s message:", 2071 scmd_printk(KERN_INFO, cmd,
2071 ahd_name(ahd), cmd->device->channel, 2072 "Attempting to queue a%s message:",
2072 cmd->device->id, cmd->device->lun,
2073 flag == SCB_ABORT ? "n ABORT" : " TARGET RESET"); 2073 flag == SCB_ABORT ? "n ABORT" : " TARGET RESET");
2074 2074
2075 printf("CDB:"); 2075 printf("CDB:");
@@ -2093,9 +2093,7 @@ ahd_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
2093 * No target device for this command exists, 2093 * No target device for this command exists,
2094 * so we must not still own the command. 2094 * so we must not still own the command.
2095 */ 2095 */
2096 printf("%s:%d:%d:%d: Is not an active device\n", 2096 scmd_printk(KERN_INFO, cmd, "Is not an active device\n");
2097 ahd_name(ahd), cmd->device->channel, cmd->device->id,
2098 cmd->device->lun);
2099 retval = SUCCESS; 2097 retval = SUCCESS;
2100 goto no_cmd; 2098 goto no_cmd;
2101 } 2099 }
@@ -2112,8 +2110,9 @@ ahd_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
2112 2110
2113 /* Any SCB for this device will do for a target reset */ 2111 /* Any SCB for this device will do for a target reset */
2114 LIST_FOREACH(pending_scb, &ahd->pending_scbs, pending_links) { 2112 LIST_FOREACH(pending_scb, &ahd->pending_scbs, pending_links) {
2115 if (ahd_match_scb(ahd, pending_scb, cmd->device->id, 2113 if (ahd_match_scb(ahd, pending_scb,
2116 cmd->device->channel + 'A', 2114 scmd_id(cmd),
2115 scmd_channel(cmd) + 'A',
2117 CAM_LUN_WILDCARD, 2116 CAM_LUN_WILDCARD,
2118 SCB_LIST_NULL, ROLE_INITIATOR) == 0) 2117 SCB_LIST_NULL, ROLE_INITIATOR) == 0)
2119 break; 2118 break;
@@ -2121,9 +2120,7 @@ ahd_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
2121 } 2120 }
2122 2121
2123 if (pending_scb == NULL) { 2122 if (pending_scb == NULL) {
2124 printf("%s:%d:%d:%d: Command not found\n", 2123 scmd_printk(KERN_INFO, cmd, "Command not found\n");
2125 ahd_name(ahd), cmd->device->channel, cmd->device->id,
2126 cmd->device->lun);
2127 goto no_cmd; 2124 goto no_cmd;
2128 } 2125 }
2129 2126
@@ -2146,9 +2143,7 @@ ahd_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
2146 paused = TRUE; 2143 paused = TRUE;
2147 2144
2148 if ((pending_scb->flags & SCB_ACTIVE) == 0) { 2145 if ((pending_scb->flags & SCB_ACTIVE) == 0) {
2149 printf("%s:%d:%d:%d: Command already completed\n", 2146 scmd_printk(KERN_INFO, cmd, "Command already completed\n");
2150 ahd_name(ahd), cmd->device->channel, cmd->device->id,
2151 cmd->device->lun);
2152 goto no_cmd; 2147 goto no_cmd;
2153 } 2148 }
2154 2149
@@ -2204,7 +2199,7 @@ ahd_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
2204 if (last_phase != P_BUSFREE 2199 if (last_phase != P_BUSFREE
2205 && (SCB_GET_TAG(pending_scb) == active_scbptr 2200 && (SCB_GET_TAG(pending_scb) == active_scbptr
2206 || (flag == SCB_DEVICE_RESET 2201 || (flag == SCB_DEVICE_RESET
2207 && SCSIID_TARGET(ahd, saved_scsiid) == cmd->device->id))) { 2202 && SCSIID_TARGET(ahd, saved_scsiid) == scmd_id(cmd)))) {
2208 2203
2209 /* 2204 /*
2210 * We're active on the bus, so assert ATN 2205 * We're active on the bus, so assert ATN
@@ -2214,9 +2209,7 @@ ahd_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
2214 pending_scb->flags |= SCB_RECOVERY_SCB|flag; 2209 pending_scb->flags |= SCB_RECOVERY_SCB|flag;
2215 ahd_outb(ahd, MSG_OUT, HOST_MSG); 2210 ahd_outb(ahd, MSG_OUT, HOST_MSG);
2216 ahd_outb(ahd, SCSISIGO, last_phase|ATNO); 2211 ahd_outb(ahd, SCSISIGO, last_phase|ATNO);
2217 printf("%s:%d:%d:%d: Device is active, asserting ATN\n", 2212 scmd_printk(KERN_INFO, cmd, "Device is active, asserting ATN\n");
2218 ahd_name(ahd), cmd->device->channel,
2219 cmd->device->id, cmd->device->lun);
2220 wait = TRUE; 2213 wait = TRUE;
2221 } else if (disconnected) { 2214 } else if (disconnected) {
2222 2215
@@ -2277,9 +2270,7 @@ ahd_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
2277 printf("Device is disconnected, re-queuing SCB\n"); 2270 printf("Device is disconnected, re-queuing SCB\n");
2278 wait = TRUE; 2271 wait = TRUE;
2279 } else { 2272 } else {
2280 printf("%s:%d:%d:%d: Unable to deliver message\n", 2273 scmd_printk(KERN_INFO, cmd, "Unable to deliver message\n");
2281 ahd_name(ahd), cmd->device->channel,
2282 cmd->device->id, cmd->device->lun);
2283 retval = FAILED; 2274 retval = FAILED;
2284 goto done; 2275 goto done;
2285 } 2276 }
diff --git a/drivers/scsi/aic7xxx/aic7xxx_osm.c b/drivers/scsi/aic7xxx/aic7xxx_osm.c
index 6ee1435d37fa..1861407422e4 100644
--- a/drivers/scsi/aic7xxx/aic7xxx_osm.c
+++ b/drivers/scsi/aic7xxx/aic7xxx_osm.c
@@ -641,7 +641,7 @@ ahc_linux_slave_configure(struct scsi_device *sdev)
641 ahc = *((struct ahc_softc **)sdev->host->hostdata); 641 ahc = *((struct ahc_softc **)sdev->host->hostdata);
642 642
643 if (bootverbose) 643 if (bootverbose)
644 printf("%s: Slave Configure %d\n", ahc_name(ahc), sdev->id); 644 sdev_printk(KERN_INFO, sdev, "Slave Configure\n");
645 645
646 ahc_linux_device_queue_depth(sdev); 646 ahc_linux_device_queue_depth(sdev);
647 647
@@ -686,7 +686,7 @@ ahc_linux_biosparam(struct scsi_device *sdev, struct block_device *bdev,
686 u_int channel; 686 u_int channel;
687 687
688 ahc = *((struct ahc_softc **)sdev->host->hostdata); 688 ahc = *((struct ahc_softc **)sdev->host->hostdata);
689 channel = sdev->channel; 689 channel = sdev_channel(sdev);
690 690
691 bh = scsi_bios_ptable(bdev); 691 bh = scsi_bios_ptable(bdev);
692 if (bh) { 692 if (bh) {
@@ -759,7 +759,7 @@ ahc_linux_bus_reset(struct scsi_cmnd *cmd)
759 ahc = *(struct ahc_softc **)cmd->device->host->hostdata; 759 ahc = *(struct ahc_softc **)cmd->device->host->hostdata;
760 760
761 ahc_lock(ahc, &flags); 761 ahc_lock(ahc, &flags);
762 found = ahc_reset_channel(ahc, cmd->device->channel + 'A', 762 found = ahc_reset_channel(ahc, scmd_channel(cmd) + 'A',
763 /*initiate reset*/TRUE); 763 /*initiate reset*/TRUE);
764 ahc_unlock(ahc, &flags); 764 ahc_unlock(ahc, &flags);
765 765
@@ -2117,9 +2117,7 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
2117 wait = FALSE; 2117 wait = FALSE;
2118 ahc = *(struct ahc_softc **)cmd->device->host->hostdata; 2118 ahc = *(struct ahc_softc **)cmd->device->host->hostdata;
2119 2119
2120 printf("%s:%d:%d:%d: Attempting to queue a%s message\n", 2120 scmd_printk(KERN_INFO, cmd, "Attempting to queue a%s message\n",
2121 ahc_name(ahc), cmd->device->channel,
2122 cmd->device->id, cmd->device->lun,
2123 flag == SCB_ABORT ? "n ABORT" : " TARGET RESET"); 2121 flag == SCB_ABORT ? "n ABORT" : " TARGET RESET");
2124 2122
2125 printf("CDB:"); 2123 printf("CDB:");
@@ -2174,8 +2172,8 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
2174 2172
2175 /* Any SCB for this device will do for a target reset */ 2173 /* Any SCB for this device will do for a target reset */
2176 LIST_FOREACH(pending_scb, &ahc->pending_scbs, pending_links) { 2174 LIST_FOREACH(pending_scb, &ahc->pending_scbs, pending_links) {
2177 if (ahc_match_scb(ahc, pending_scb, cmd->device->id, 2175 if (ahc_match_scb(ahc, pending_scb, scmd_id(cmd),
2178 cmd->device->channel + 'A', 2176 scmd_channel(cmd) + 'A',
2179 CAM_LUN_WILDCARD, 2177 CAM_LUN_WILDCARD,
2180 SCB_LIST_NULL, ROLE_INITIATOR) == 0) 2178 SCB_LIST_NULL, ROLE_INITIATOR) == 0)
2181 break; 2179 break;
@@ -2183,9 +2181,7 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
2183 } 2181 }
2184 2182
2185 if (pending_scb == NULL) { 2183 if (pending_scb == NULL) {
2186 printf("%s:%d:%d:%d: Command not found\n", 2184 scmd_printk(KERN_INFO, cmd, "Command not found\n");
2187 ahc_name(ahc), cmd->device->channel, cmd->device->id,
2188 cmd->device->lun);
2189 goto no_cmd; 2185 goto no_cmd;
2190 } 2186 }
2191 2187
@@ -2207,9 +2203,7 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
2207 paused = TRUE; 2203 paused = TRUE;
2208 2204
2209 if ((pending_scb->flags & SCB_ACTIVE) == 0) { 2205 if ((pending_scb->flags & SCB_ACTIVE) == 0) {
2210 printf("%s:%d:%d:%d: Command already completed\n", 2206 scmd_printk(KERN_INFO, cmd, "Command already completed\n");
2211 ahc_name(ahc), cmd->device->channel, cmd->device->id,
2212 cmd->device->lun);
2213 goto no_cmd; 2207 goto no_cmd;
2214 } 2208 }
2215 2209
@@ -2266,7 +2260,7 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
2266 if (last_phase != P_BUSFREE 2260 if (last_phase != P_BUSFREE
2267 && (pending_scb->hscb->tag == active_scb_index 2261 && (pending_scb->hscb->tag == active_scb_index
2268 || (flag == SCB_DEVICE_RESET 2262 || (flag == SCB_DEVICE_RESET
2269 && SCSIID_TARGET(ahc, saved_scsiid) == cmd->device->id))) { 2263 && SCSIID_TARGET(ahc, saved_scsiid) == scmd_id(cmd)))) {
2270 2264
2271 /* 2265 /*
2272 * We're active on the bus, so assert ATN 2266 * We're active on the bus, so assert ATN
@@ -2276,9 +2270,7 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
2276 pending_scb->flags |= SCB_RECOVERY_SCB|flag; 2270 pending_scb->flags |= SCB_RECOVERY_SCB|flag;
2277 ahc_outb(ahc, MSG_OUT, HOST_MSG); 2271 ahc_outb(ahc, MSG_OUT, HOST_MSG);
2278 ahc_outb(ahc, SCSISIGO, last_phase|ATNO); 2272 ahc_outb(ahc, SCSISIGO, last_phase|ATNO);
2279 printf("%s:%d:%d:%d: Device is active, asserting ATN\n", 2273 scmd_printk(KERN_INFO, cmd, "Device is active, asserting ATN\n");
2280 ahc_name(ahc), cmd->device->channel, cmd->device->id,
2281 cmd->device->lun);
2282 wait = TRUE; 2274 wait = TRUE;
2283 } else if (disconnected) { 2275 } else if (disconnected) {
2284 2276
@@ -2344,9 +2336,7 @@ ahc_linux_queue_recovery_cmd(struct scsi_cmnd *cmd, scb_flag flag)
2344 printf("Device is disconnected, re-queuing SCB\n"); 2336 printf("Device is disconnected, re-queuing SCB\n");
2345 wait = TRUE; 2337 wait = TRUE;
2346 } else { 2338 } else {
2347 printf("%s:%d:%d:%d: Unable to deliver message\n", 2339 scmd_printk(KERN_INFO, cmd, "Unable to deliver message\n");
2348 ahc_name(ahc), cmd->device->channel, cmd->device->id,
2349 cmd->device->lun);
2350 retval = FAILED; 2340 retval = FAILED;
2351 goto done; 2341 goto done;
2352 } 2342 }