aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ips.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/ips.c')
-rw-r--r--drivers/scsi/ips.c49
1 files changed, 25 insertions, 24 deletions
diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c
index 595a91afca0e..0da3dfa3150a 100644
--- a/drivers/scsi/ips.c
+++ b/drivers/scsi/ips.c
@@ -389,17 +389,17 @@ static struct pci_device_id ips_pci_table[] = {
389MODULE_DEVICE_TABLE( pci, ips_pci_table ); 389MODULE_DEVICE_TABLE( pci, ips_pci_table );
390 390
391static char ips_hot_plug_name[] = "ips"; 391static char ips_hot_plug_name[] = "ips";
392 392
393static int __devinit ips_insert_device(struct pci_dev *pci_dev, const struct pci_device_id *ent); 393static int __devinit ips_insert_device(struct pci_dev *pci_dev, const struct pci_device_id *ent);
394static void __devexit ips_remove_device(struct pci_dev *pci_dev); 394static void __devexit ips_remove_device(struct pci_dev *pci_dev);
395 395
396static struct pci_driver ips_pci_driver = { 396static struct pci_driver ips_pci_driver = {
397 .name = ips_hot_plug_name, 397 .name = ips_hot_plug_name,
398 .id_table = ips_pci_table, 398 .id_table = ips_pci_table,
399 .probe = ips_insert_device, 399 .probe = ips_insert_device,
400 .remove = __devexit_p(ips_remove_device), 400 .remove = __devexit_p(ips_remove_device),
401}; 401};
402 402
403 403
404/* 404/*
405 * Necessary forward function protoypes 405 * Necessary forward function protoypes
@@ -587,7 +587,7 @@ static void
587ips_setup_funclist(ips_ha_t * ha) 587ips_setup_funclist(ips_ha_t * ha)
588{ 588{
589 589
590 /* 590 /*
591 * Setup Functions 591 * Setup Functions
592 */ 592 */
593 if (IPS_IS_MORPHEUS(ha) || IPS_IS_MARCO(ha)) { 593 if (IPS_IS_MORPHEUS(ha) || IPS_IS_MARCO(ha)) {
@@ -2081,7 +2081,7 @@ ips_host_info(ips_ha_t * ha, char *ptr, off_t offset, int len)
2081 /* That keeps everything happy for "text" operations on the proc file. */ 2081 /* That keeps everything happy for "text" operations on the proc file. */
2082 2082
2083 if (le32_to_cpu(ha->nvram->signature) == IPS_NVRAM_P5_SIG) { 2083 if (le32_to_cpu(ha->nvram->signature) == IPS_NVRAM_P5_SIG) {
2084 if (ha->nvram->bios_low[3] == 0) { 2084 if (ha->nvram->bios_low[3] == 0) {
2085 copy_info(&info, 2085 copy_info(&info,
2086 "\tBIOS Version : %c%c%c%c%c%c%c\n", 2086 "\tBIOS Version : %c%c%c%c%c%c%c\n",
2087 ha->nvram->bios_high[0], ha->nvram->bios_high[1], 2087 ha->nvram->bios_high[0], ha->nvram->bios_high[1],
@@ -2780,10 +2780,11 @@ ips_next(ips_ha_t * ha, int intr)
2780 scb->dcdb.cmd_attribute = 2780 scb->dcdb.cmd_attribute =
2781 ips_command_direction[scb->scsi_cmd->cmnd[0]]; 2781 ips_command_direction[scb->scsi_cmd->cmnd[0]];
2782 2782
2783 /* Allow a WRITE BUFFER Command to Have no Data */ 2783 /* Allow a WRITE BUFFER Command to Have no Data */
2784 /* This is Used by Tape Flash Utilites */ 2784 /* This is Used by Tape Flash Utilites */
2785 if ((scb->scsi_cmd->cmnd[0] == WRITE_BUFFER) && (scb->data_len == 0)) 2785 if ((scb->scsi_cmd->cmnd[0] == WRITE_BUFFER) &&
2786 scb->dcdb.cmd_attribute = 0; 2786 (scb->data_len == 0))
2787 scb->dcdb.cmd_attribute = 0;
2787 2788
2788 if (!(scb->dcdb.cmd_attribute & 0x3)) 2789 if (!(scb->dcdb.cmd_attribute & 0x3))
2789 scb->dcdb.transfer_length = 0; 2790 scb->dcdb.transfer_length = 0;
@@ -3404,7 +3405,7 @@ ips_map_status(ips_ha_t * ha, ips_scb_t * scb, ips_stat_t * sp)
3404 3405
3405 /* Restrict access to physical DASD */ 3406 /* Restrict access to physical DASD */
3406 if (scb->scsi_cmd->cmnd[0] == INQUIRY) { 3407 if (scb->scsi_cmd->cmnd[0] == INQUIRY) {
3407 ips_scmd_buf_read(scb->scsi_cmd, 3408 ips_scmd_buf_read(scb->scsi_cmd,
3408 &inquiryData, sizeof (inquiryData)); 3409 &inquiryData, sizeof (inquiryData));
3409 if ((inquiryData.DeviceType & 0x1f) == TYPE_DISK) { 3410 if ((inquiryData.DeviceType & 0x1f) == TYPE_DISK) {
3410 errcode = DID_TIME_OUT; 3411 errcode = DID_TIME_OUT;
@@ -4090,10 +4091,10 @@ ips_chkstatus(ips_ha_t * ha, IPS_STATUS * pstatus)
4090 scb->scsi_cmd->result = errcode << 16; 4091 scb->scsi_cmd->result = errcode << 16;
4091 } else { /* bus == 0 */ 4092 } else { /* bus == 0 */
4092 /* restrict access to physical drives */ 4093 /* restrict access to physical drives */
4093 if (scb->scsi_cmd->cmnd[0] == INQUIRY) { 4094 if (scb->scsi_cmd->cmnd[0] == INQUIRY) {
4094 ips_scmd_buf_read(scb->scsi_cmd, 4095 ips_scmd_buf_read(scb->scsi_cmd,
4095 &inquiryData, sizeof (inquiryData)); 4096 &inquiryData, sizeof (inquiryData));
4096 if ((inquiryData.DeviceType & 0x1f) == TYPE_DISK) 4097 if ((inquiryData.DeviceType & 0x1f) == TYPE_DISK)
4097 scb->scsi_cmd->result = DID_TIME_OUT << 16; 4098 scb->scsi_cmd->result = DID_TIME_OUT << 16;
4098 } 4099 }
4099 } /* else */ 4100 } /* else */
@@ -4661,8 +4662,8 @@ ips_isinit_morpheus(ips_ha_t * ha)
4661 uint32_t bits; 4662 uint32_t bits;
4662 4663
4663 METHOD_TRACE("ips_is_init_morpheus", 1); 4664 METHOD_TRACE("ips_is_init_morpheus", 1);
4664 4665
4665 if (ips_isintr_morpheus(ha)) 4666 if (ips_isintr_morpheus(ha))
4666 ips_flush_and_reset(ha); 4667 ips_flush_and_reset(ha);
4667 4668
4668 post = readl(ha->mem_ptr + IPS_REG_I960_MSG0); 4669 post = readl(ha->mem_ptr + IPS_REG_I960_MSG0);
@@ -4686,7 +4687,7 @@ ips_isinit_morpheus(ips_ha_t * ha)
4686/* state ( was trying to INIT and an interrupt was already pending ) ... */ 4687/* state ( was trying to INIT and an interrupt was already pending ) ... */
4687/* */ 4688/* */
4688/****************************************************************************/ 4689/****************************************************************************/
4689static void 4690static void
4690ips_flush_and_reset(ips_ha_t *ha) 4691ips_flush_and_reset(ips_ha_t *ha)
4691{ 4692{
4692 ips_scb_t *scb; 4693 ips_scb_t *scb;
@@ -4718,9 +4719,9 @@ ips_flush_and_reset(ips_ha_t *ha)
4718 if (ret == IPS_SUCCESS) { 4719 if (ret == IPS_SUCCESS) {
4719 time = 60 * IPS_ONE_SEC; /* Max Wait time is 60 seconds */ 4720 time = 60 * IPS_ONE_SEC; /* Max Wait time is 60 seconds */
4720 done = 0; 4721 done = 0;
4721 4722
4722 while ((time > 0) && (!done)) { 4723 while ((time > 0) && (!done)) {
4723 done = ips_poll_for_flush_complete(ha); 4724 done = ips_poll_for_flush_complete(ha);
4724 /* This may look evil, but it's only done during extremely rare start-up conditions ! */ 4725 /* This may look evil, but it's only done during extremely rare start-up conditions ! */
4725 udelay(1000); 4726 udelay(1000);
4726 time--; 4727 time--;
@@ -4749,17 +4750,17 @@ static int
4749ips_poll_for_flush_complete(ips_ha_t * ha) 4750ips_poll_for_flush_complete(ips_ha_t * ha)
4750{ 4751{
4751 IPS_STATUS cstatus; 4752 IPS_STATUS cstatus;
4752 4753
4753 while (TRUE) { 4754 while (TRUE) {
4754 cstatus.value = (*ha->func.statupd) (ha); 4755 cstatus.value = (*ha->func.statupd) (ha);
4755 4756
4756 if (cstatus.value == 0xffffffff) /* If No Interrupt to process */ 4757 if (cstatus.value == 0xffffffff) /* If No Interrupt to process */
4757 break; 4758 break;
4758 4759
4759 /* Success is when we see the Flush Command ID */ 4760 /* Success is when we see the Flush Command ID */
4760 if (cstatus.fields.command_id == IPS_MAX_CMDS ) 4761 if (cstatus.fields.command_id == IPS_MAX_CMDS)
4761 return 1; 4762 return 1;
4762 } 4763 }
4763 4764
4764 return 0; 4765 return 0;
4765} 4766}
@@ -5920,7 +5921,7 @@ ips_read_config(ips_ha_t * ha, int intr)
5920 5921
5921 return (0); 5922 return (0);
5922 } 5923 }
5923 5924
5924 memcpy(ha->conf, ha->ioctl_data, sizeof(*ha->conf)); 5925 memcpy(ha->conf, ha->ioctl_data, sizeof(*ha->conf));
5925 return (1); 5926 return (1);
5926} 5927}
@@ -5959,7 +5960,7 @@ ips_readwrite_page5(ips_ha_t * ha, int write, int intr)
5959 scb->cmd.nvram.buffer_addr = ha->ioctl_busaddr; 5960 scb->cmd.nvram.buffer_addr = ha->ioctl_busaddr;
5960 if (write) 5961 if (write)
5961 memcpy(ha->ioctl_data, ha->nvram, sizeof(*ha->nvram)); 5962 memcpy(ha->ioctl_data, ha->nvram, sizeof(*ha->nvram));
5962 5963
5963 /* issue the command */ 5964 /* issue the command */
5964 if (((ret = 5965 if (((ret =
5965 ips_send_wait(ha, scb, ips_cmd_timeout, intr)) == IPS_FAILURE) 5966 ips_send_wait(ha, scb, ips_cmd_timeout, intr)) == IPS_FAILURE)