diff options
Diffstat (limited to 'drivers/scsi/aacraid/aachba.c')
-rw-r--r-- | drivers/scsi/aacraid/aachba.c | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/drivers/scsi/aacraid/aachba.c b/drivers/scsi/aacraid/aachba.c index 90d1d0878cb8..21964aaebca5 100644 --- a/drivers/scsi/aacraid/aachba.c +++ b/drivers/scsi/aacraid/aachba.c | |||
@@ -143,7 +143,7 @@ static char *aac_get_status_string(u32 status); | |||
143 | */ | 143 | */ |
144 | 144 | ||
145 | static int nondasd = -1; | 145 | static int nondasd = -1; |
146 | static int aac_cache; | 146 | static int aac_cache = 2; /* WCE=0 to avoid performance problems */ |
147 | static int dacmode = -1; | 147 | static int dacmode = -1; |
148 | int aac_msi; | 148 | int aac_msi; |
149 | int aac_commit = -1; | 149 | int aac_commit = -1; |
@@ -157,7 +157,7 @@ module_param_named(cache, aac_cache, int, S_IRUGO|S_IWUSR); | |||
157 | MODULE_PARM_DESC(cache, "Disable Queue Flush commands:\n" | 157 | MODULE_PARM_DESC(cache, "Disable Queue Flush commands:\n" |
158 | "\tbit 0 - Disable FUA in WRITE SCSI commands\n" | 158 | "\tbit 0 - Disable FUA in WRITE SCSI commands\n" |
159 | "\tbit 1 - Disable SYNCHRONIZE_CACHE SCSI command\n" | 159 | "\tbit 1 - Disable SYNCHRONIZE_CACHE SCSI command\n" |
160 | "\tbit 2 - Disable only if Battery not protecting Cache"); | 160 | "\tbit 2 - Disable only if Battery is protecting Cache"); |
161 | module_param(dacmode, int, S_IRUGO|S_IWUSR); | 161 | module_param(dacmode, int, S_IRUGO|S_IWUSR); |
162 | MODULE_PARM_DESC(dacmode, "Control whether dma addressing is using 64 bit DAC." | 162 | MODULE_PARM_DESC(dacmode, "Control whether dma addressing is using 64 bit DAC." |
163 | " 0=off, 1=on"); | 163 | " 0=off, 1=on"); |
@@ -217,6 +217,14 @@ int aac_reset_devices; | |||
217 | module_param_named(reset_devices, aac_reset_devices, int, S_IRUGO|S_IWUSR); | 217 | module_param_named(reset_devices, aac_reset_devices, int, S_IRUGO|S_IWUSR); |
218 | MODULE_PARM_DESC(reset_devices, "Force an adapter reset at initialization."); | 218 | MODULE_PARM_DESC(reset_devices, "Force an adapter reset at initialization."); |
219 | 219 | ||
220 | int aac_wwn = 1; | ||
221 | module_param_named(wwn, aac_wwn, int, S_IRUGO|S_IWUSR); | ||
222 | MODULE_PARM_DESC(wwn, "Select a WWN type for the arrays:\n" | ||
223 | "\t0 - Disable\n" | ||
224 | "\t1 - Array Meta Data Signature (default)\n" | ||
225 | "\t2 - Adapter Serial Number"); | ||
226 | |||
227 | |||
220 | static inline int aac_valid_context(struct scsi_cmnd *scsicmd, | 228 | static inline int aac_valid_context(struct scsi_cmnd *scsicmd, |
221 | struct fib *fibptr) { | 229 | struct fib *fibptr) { |
222 | struct scsi_device *device; | 230 | struct scsi_device *device; |
@@ -1206,9 +1214,8 @@ static int aac_scsi_32(struct fib * fib, struct scsi_cmnd * cmd) | |||
1206 | 1214 | ||
1207 | static int aac_scsi_32_64(struct fib * fib, struct scsi_cmnd * cmd) | 1215 | static int aac_scsi_32_64(struct fib * fib, struct scsi_cmnd * cmd) |
1208 | { | 1216 | { |
1209 | if ((sizeof(dma_addr_t) > 4) && | 1217 | if ((sizeof(dma_addr_t) > 4) && fib->dev->needs_dac && |
1210 | (num_physpages > (0xFFFFFFFFULL >> PAGE_SHIFT)) && | 1218 | (fib->dev->adapter_info.options & AAC_OPT_SGMAP_HOST64)) |
1211 | (fib->dev->adapter_info.options & AAC_OPT_SGMAP_HOST64)) | ||
1212 | return FAILED; | 1219 | return FAILED; |
1213 | return aac_scsi_32(fib, cmd); | 1220 | return aac_scsi_32(fib, cmd); |
1214 | } | 1221 | } |
@@ -1371,8 +1378,11 @@ int aac_get_adapter_info(struct aac_dev* dev) | |||
1371 | if (dev->nondasd_support && !dev->in_reset) | 1378 | if (dev->nondasd_support && !dev->in_reset) |
1372 | printk(KERN_INFO "%s%d: Non-DASD support enabled.\n",dev->name, dev->id); | 1379 | printk(KERN_INFO "%s%d: Non-DASD support enabled.\n",dev->name, dev->id); |
1373 | 1380 | ||
1381 | if (dma_get_required_mask(&dev->pdev->dev) > DMA_32BIT_MASK) | ||
1382 | dev->needs_dac = 1; | ||
1374 | dev->dac_support = 0; | 1383 | dev->dac_support = 0; |
1375 | if( (sizeof(dma_addr_t) > 4) && (dev->adapter_info.options & AAC_OPT_SGMAP_HOST64)){ | 1384 | if ((sizeof(dma_addr_t) > 4) && dev->needs_dac && |
1385 | (dev->adapter_info.options & AAC_OPT_SGMAP_HOST64)) { | ||
1376 | if (!dev->in_reset) | 1386 | if (!dev->in_reset) |
1377 | printk(KERN_INFO "%s%d: 64bit support enabled.\n", | 1387 | printk(KERN_INFO "%s%d: 64bit support enabled.\n", |
1378 | dev->name, dev->id); | 1388 | dev->name, dev->id); |
@@ -1382,6 +1392,15 @@ int aac_get_adapter_info(struct aac_dev* dev) | |||
1382 | if(dacmode != -1) { | 1392 | if(dacmode != -1) { |
1383 | dev->dac_support = (dacmode!=0); | 1393 | dev->dac_support = (dacmode!=0); |
1384 | } | 1394 | } |
1395 | |||
1396 | /* avoid problems with AAC_QUIRK_SCSI_32 controllers */ | ||
1397 | if (dev->dac_support && (aac_get_driver_ident(dev->cardtype)->quirks | ||
1398 | & AAC_QUIRK_SCSI_32)) { | ||
1399 | dev->nondasd_support = 0; | ||
1400 | dev->jbod = 0; | ||
1401 | expose_physicals = 0; | ||
1402 | } | ||
1403 | |||
1385 | if(dev->dac_support != 0) { | 1404 | if(dev->dac_support != 0) { |
1386 | if (!pci_set_dma_mask(dev->pdev, DMA_64BIT_MASK) && | 1405 | if (!pci_set_dma_mask(dev->pdev, DMA_64BIT_MASK) && |
1387 | !pci_set_consistent_dma_mask(dev->pdev, DMA_64BIT_MASK)) { | 1406 | !pci_set_consistent_dma_mask(dev->pdev, DMA_64BIT_MASK)) { |
@@ -2058,7 +2077,7 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd) | |||
2058 | dprintk((KERN_DEBUG "INQUIRY command, ID: %d.\n", cid)); | 2077 | dprintk((KERN_DEBUG "INQUIRY command, ID: %d.\n", cid)); |
2059 | memset(&inq_data, 0, sizeof (struct inquiry_data)); | 2078 | memset(&inq_data, 0, sizeof (struct inquiry_data)); |
2060 | 2079 | ||
2061 | if (scsicmd->cmnd[1] & 0x1) { | 2080 | if ((scsicmd->cmnd[1] & 0x1) && aac_wwn) { |
2062 | char *arr = (char *)&inq_data; | 2081 | char *arr = (char *)&inq_data; |
2063 | 2082 | ||
2064 | /* EVPD bit set */ | 2083 | /* EVPD bit set */ |
@@ -2081,7 +2100,12 @@ int aac_scsi_cmd(struct scsi_cmnd * scsicmd) | |||
2081 | arr[1] = scsicmd->cmnd[2]; | 2100 | arr[1] = scsicmd->cmnd[2]; |
2082 | scsi_sg_copy_from_buffer(scsicmd, &inq_data, | 2101 | scsi_sg_copy_from_buffer(scsicmd, &inq_data, |
2083 | sizeof(inq_data)); | 2102 | sizeof(inq_data)); |
2084 | return aac_get_container_serial(scsicmd); | 2103 | if (aac_wwn != 2) |
2104 | return aac_get_container_serial( | ||
2105 | scsicmd); | ||
2106 | /* SLES 10 SP1 special */ | ||
2107 | scsicmd->result = DID_OK << 16 | | ||
2108 | COMMAND_COMPLETE << 8 | SAM_STAT_GOOD; | ||
2085 | } else { | 2109 | } else { |
2086 | /* vpd page not implemented */ | 2110 | /* vpd page not implemented */ |
2087 | scsicmd->result = DID_OK << 16 | | 2111 | scsicmd->result = DID_OK << 16 | |