aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aacraid/aachba.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-06-21 14:18:25 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-21 14:18:25 -0400
commit28e4b224955cbe30275b2a7842e729023a4f4b03 (patch)
treeab4d28fecc06070fc2a2742f4b4550b29de44912 /drivers/scsi/aacraid/aachba.c
parent22ae813b85df7c0b0fc7c8d6f336d6a9f566ff97 (diff)
parent67d59dfdeb21df2c16dcd478b66177e91178ecd0 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (85 commits) [SCSI] 53c700: remove reliance on deprecated cmnd fields [SCSI] hptiop: don't use cmnd->bufflen [SCSI] hptiop: HighPoint RocketRAID 3xxx controller driver [SCSI] aacraid: small misc. cleanups [SCSI] aacraid: Update supported product information [SCSI] aacraid: Fix return code interpretation [SCSI] scsi_transport_sas: fix panic in sas_free_rphy [SCSI] remove RQ_SCSI_* flags [SCSI] remove scsi_request infrastructure [SCSI] mptfusion: change driver revision to 3.03.10 [SCSI] mptfc: abort of board reset leaves port dead requiring reboot [SCSI] mptfc: fix fibre channel infinite request/response loop [SCSI] mptfc: set fibre channel fw target missing timers to one second [SCSI] mptfusion: move fc event/reset handling to mptfc [SCSI] spi transport: don't allow dt to be set on SE or HVD buses [SCSI] aic7xxx: expose the bus setting to sysfs [SCSI] scsi: remove Documentation/scsi/cpqfc.txt [SCSI] drivers/scsi: Use ARRAY_SIZE macro [SCSI] Remove last page_address from dc395x.c [SCSI] hptiop: HighPoint RocketRAID 3xxx controller driver ... Fixed up conflicts in drivers/message/fusion/mptbase.c manually (due to the sparc interrupt cleanups)
Diffstat (limited to 'drivers/scsi/aacraid/aachba.c')
-rw-r--r--drivers/scsi/aacraid/aachba.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c
index 642a3b4e5937..ea9e038813eb 100644
--- a/drivers/scsi/aacraid/aachba.c
+++ b/drivers/scsi/aacraid/aachba.c
@@ -148,6 +148,8 @@ static int nondasd = -1;
148static int dacmode = -1; 148static int dacmode = -1;
149 149
150static int commit = -1; 150static int commit = -1;
151int startup_timeout = 180;
152int aif_timeout = 120;
151 153
152module_param(nondasd, int, S_IRUGO|S_IWUSR); 154module_param(nondasd, int, S_IRUGO|S_IWUSR);
153MODULE_PARM_DESC(nondasd, "Control scanning of hba for nondasd devices. 0=off, 1=on"); 155MODULE_PARM_DESC(nondasd, "Control scanning of hba for nondasd devices. 0=off, 1=on");
@@ -155,6 +157,10 @@ module_param(dacmode, int, S_IRUGO|S_IWUSR);
155MODULE_PARM_DESC(dacmode, "Control whether dma addressing is using 64 bit DAC. 0=off, 1=on"); 157MODULE_PARM_DESC(dacmode, "Control whether dma addressing is using 64 bit DAC. 0=off, 1=on");
156module_param(commit, int, S_IRUGO|S_IWUSR); 158module_param(commit, int, S_IRUGO|S_IWUSR);
157MODULE_PARM_DESC(commit, "Control whether a COMMIT_CONFIG is issued to the adapter for foreign arrays.\nThis is typically needed in systems that do not have a BIOS. 0=off, 1=on"); 159MODULE_PARM_DESC(commit, "Control whether a COMMIT_CONFIG is issued to the adapter for foreign arrays.\nThis is typically needed in systems that do not have a BIOS. 0=off, 1=on");
160module_param(startup_timeout, int, S_IRUGO|S_IWUSR);
161MODULE_PARM_DESC(startup_timeout, "The duration of time in seconds to wait for adapter to have it's kernel up and\nrunning. This is typically adjusted for large systems that do not have a BIOS.");
162module_param(aif_timeout, int, S_IRUGO|S_IWUSR);
163MODULE_PARM_DESC(aif_timeout, "The duration of time in seconds to wait for applications to pick up AIFs before\nderegistering them. This is typically adjusted for heavily burdened systems.");
158 164
159int numacb = -1; 165int numacb = -1;
160module_param(numacb, int, S_IRUGO|S_IWUSR); 166module_param(numacb, int, S_IRUGO|S_IWUSR);
@@ -635,13 +641,13 @@ static void setinqstr(struct aac_dev *dev, void *data, int tindex)
635 cp[sizeof(str->pid)] = c; 641 cp[sizeof(str->pid)] = c;
636 } else { 642 } else {
637 struct aac_driver_ident *mp = aac_get_driver_ident(dev->cardtype); 643 struct aac_driver_ident *mp = aac_get_driver_ident(dev->cardtype);
638 644
639 inqstrcpy (mp->vname, str->vid); 645 inqstrcpy (mp->vname, str->vid);
640 /* last six chars reserved for vol type */ 646 /* last six chars reserved for vol type */
641 inqstrcpy (mp->model, str->pid); 647 inqstrcpy (mp->model, str->pid);
642 } 648 }
643 649
644 if (tindex < (sizeof(container_types)/sizeof(char *))){ 650 if (tindex < ARRAY_SIZE(container_types)){
645 char *findit = str->pid; 651 char *findit = str->pid;
646 652
647 for ( ; *findit != ' '; findit++); /* walk till we find a space */ 653 for ( ; *findit != ' '; findit++); /* walk till we find a space */
@@ -955,7 +961,7 @@ static void io_callback(void *context, struct fib * fibptr)
955 961
956 if(scsicmd->use_sg) 962 if(scsicmd->use_sg)
957 pci_unmap_sg(dev->pdev, 963 pci_unmap_sg(dev->pdev,
958 (struct scatterlist *)scsicmd->buffer, 964 (struct scatterlist *)scsicmd->request_buffer,
959 scsicmd->use_sg, 965 scsicmd->use_sg,
960 scsicmd->sc_data_direction); 966 scsicmd->sc_data_direction);
961 else if(scsicmd->request_bufflen) 967 else if(scsicmd->request_bufflen)
@@ -1570,7 +1576,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd)
1570 * see: <vendor>.c i.e. aac.c 1576 * see: <vendor>.c i.e. aac.c
1571 */ 1577 */
1572 if (scmd_id(scsicmd) == host->this_id) { 1578 if (scmd_id(scsicmd) == host->this_id) {
1573 setinqstr(dev, (void *) (inq_data.inqd_vid), (sizeof(container_types)/sizeof(char *))); 1579 setinqstr(dev, (void *) (inq_data.inqd_vid), ARRAY_SIZE(container_types));
1574 inq_data.inqd_pdt = INQD_PDT_PROC; /* Processor device */ 1580 inq_data.inqd_pdt = INQD_PDT_PROC; /* Processor device */
1575 aac_internal_transfer(scsicmd, &inq_data, 0, sizeof(inq_data)); 1581 aac_internal_transfer(scsicmd, &inq_data, 0, sizeof(inq_data));
1576 scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_GOOD; 1582 scsicmd->result = DID_OK << 16 | COMMAND_COMPLETE << 8 | SAM_STAT_GOOD;
@@ -1913,7 +1919,7 @@ static void aac_srb_callback(void *context, struct fib * fibptr)
1913 1919
1914 if(scsicmd->use_sg) 1920 if(scsicmd->use_sg)
1915 pci_unmap_sg(dev->pdev, 1921 pci_unmap_sg(dev->pdev,
1916 (struct scatterlist *)scsicmd->buffer, 1922 (struct scatterlist *)scsicmd->request_buffer,
1917 scsicmd->use_sg, 1923 scsicmd->use_sg,
1918 scsicmd->sc_data_direction); 1924 scsicmd->sc_data_direction);
1919 else if(scsicmd->request_bufflen) 1925 else if(scsicmd->request_bufflen)
@@ -2218,15 +2224,15 @@ static unsigned long aac_build_sg(struct scsi_cmnd* scsicmd, struct sgmap* psg)
2218 } 2224 }
2219 } 2225 }
2220 else if(scsicmd->request_bufflen) { 2226 else if(scsicmd->request_bufflen) {
2221 dma_addr_t addr; 2227 u32 addr;
2222 addr = pci_map_single(dev->pdev, 2228 scsicmd->SCp.dma_handle = pci_map_single(dev->pdev,
2223 scsicmd->request_buffer, 2229 scsicmd->request_buffer,
2224 scsicmd->request_bufflen, 2230 scsicmd->request_bufflen,
2225 scsicmd->sc_data_direction); 2231 scsicmd->sc_data_direction);
2232 addr = scsicmd->SCp.dma_handle;
2226 psg->count = cpu_to_le32(1); 2233 psg->count = cpu_to_le32(1);
2227 psg->sg[0].addr = cpu_to_le32(addr); 2234 psg->sg[0].addr = cpu_to_le32(addr);
2228 psg->sg[0].count = cpu_to_le32(scsicmd->request_bufflen); 2235 psg->sg[0].count = cpu_to_le32(scsicmd->request_bufflen);
2229 scsicmd->SCp.dma_handle = addr;
2230 byte_count = scsicmd->request_bufflen; 2236 byte_count = scsicmd->request_bufflen;
2231 } 2237 }
2232 return byte_count; 2238 return byte_count;
@@ -2375,7 +2381,7 @@ static struct aac_srb_status_info srb_status_info[] = {
2375 { SRB_STATUS_SUCCESS, "Success"}, 2381 { SRB_STATUS_SUCCESS, "Success"},
2376 { SRB_STATUS_ABORTED, "Aborted Command"}, 2382 { SRB_STATUS_ABORTED, "Aborted Command"},
2377 { SRB_STATUS_ABORT_FAILED, "Abort Failed"}, 2383 { SRB_STATUS_ABORT_FAILED, "Abort Failed"},
2378 { SRB_STATUS_ERROR, "Error Event"}, 2384 { SRB_STATUS_ERROR, "Error Event"},
2379 { SRB_STATUS_BUSY, "Device Busy"}, 2385 { SRB_STATUS_BUSY, "Device Busy"},
2380 { SRB_STATUS_INVALID_REQUEST, "Invalid Request"}, 2386 { SRB_STATUS_INVALID_REQUEST, "Invalid Request"},
2381 { SRB_STATUS_INVALID_PATH_ID, "Invalid Path ID"}, 2387 { SRB_STATUS_INVALID_PATH_ID, "Invalid Path ID"},
@@ -2394,7 +2400,7 @@ static struct aac_srb_status_info srb_status_info[] = {
2394 { SRB_STATUS_BAD_SRB_BLOCK_LENGTH,"Bad Srb Block Length"}, 2400 { SRB_STATUS_BAD_SRB_BLOCK_LENGTH,"Bad Srb Block Length"},
2395 { SRB_STATUS_REQUEST_FLUSHED, "Request Flushed"}, 2401 { SRB_STATUS_REQUEST_FLUSHED, "Request Flushed"},
2396 { SRB_STATUS_DELAYED_RETRY, "Delayed Retry"}, 2402 { SRB_STATUS_DELAYED_RETRY, "Delayed Retry"},
2397 { SRB_STATUS_INVALID_LUN, "Invalid LUN"}, 2403 { SRB_STATUS_INVALID_LUN, "Invalid LUN"},
2398 { SRB_STATUS_INVALID_TARGET_ID, "Invalid TARGET ID"}, 2404 { SRB_STATUS_INVALID_TARGET_ID, "Invalid TARGET ID"},
2399 { SRB_STATUS_BAD_FUNCTION, "Bad Function"}, 2405 { SRB_STATUS_BAD_FUNCTION, "Bad Function"},
2400 { SRB_STATUS_ERROR_RECOVERY, "Error Recovery"}, 2406 { SRB_STATUS_ERROR_RECOVERY, "Error Recovery"},
@@ -2409,11 +2415,9 @@ char *aac_get_status_string(u32 status)
2409{ 2415{
2410 int i; 2416 int i;
2411 2417
2412 for(i=0; i < (sizeof(srb_status_info)/sizeof(struct aac_srb_status_info)); i++ ){ 2418 for (i = 0; i < ARRAY_SIZE(srb_status_info); i++)
2413 if(srb_status_info[i].status == status){ 2419 if (srb_status_info[i].status == status)
2414 return srb_status_info[i].str; 2420 return srb_status_info[i].str;
2415 }
2416 }
2417 2421
2418 return "Bad Status Code"; 2422 return "Bad Status Code";
2419} 2423}