diff options
Diffstat (limited to 'drivers/scsi/ips.c')
-rw-r--r-- | drivers/scsi/ips.c | 54 |
1 files changed, 28 insertions, 26 deletions
diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c index e5e1ca44e1ee..86c546164da9 100644 --- a/drivers/scsi/ips.c +++ b/drivers/scsi/ips.c | |||
@@ -3499,6 +3499,7 @@ ips_map_status(ips_ha_t * ha, ips_scb_t * scb, ips_stat_t * sp) | |||
3499 | int device_error; | 3499 | int device_error; |
3500 | uint32_t transfer_len; | 3500 | uint32_t transfer_len; |
3501 | IPS_DCDB_TABLE_TAPE *tapeDCDB; | 3501 | IPS_DCDB_TABLE_TAPE *tapeDCDB; |
3502 | IPS_SCSI_INQ_DATA inquiryData; | ||
3502 | 3503 | ||
3503 | METHOD_TRACE("ips_map_status", 1); | 3504 | METHOD_TRACE("ips_map_status", 1); |
3504 | 3505 | ||
@@ -3557,13 +3558,13 @@ ips_map_status(ips_ha_t * ha, ips_scb_t * scb, ips_stat_t * sp) | |||
3557 | errcode = DID_OK; | 3558 | errcode = DID_OK; |
3558 | 3559 | ||
3559 | /* Restrict access to physical DASD */ | 3560 | /* Restrict access to physical DASD */ |
3560 | if ((scb->scsi_cmd->cmnd[0] == INQUIRY) && | 3561 | if (scb->scsi_cmd->cmnd[0] == INQUIRY) { |
3561 | ((((char *) scb->scsi_cmd-> | 3562 | ips_scmd_buf_read(scb->scsi_cmd, |
3562 | buffer)[0] & 0x1f) == TYPE_DISK)) { | 3563 | &inquiryData, sizeof (inquiryData)); |
3563 | /* underflow -- no error */ | 3564 | if ((inquiryData.DeviceType & 0x1f) == TYPE_DISK) { |
3564 | /* restrict access to physical DASD */ | 3565 | errcode = DID_TIME_OUT; |
3565 | errcode = DID_TIME_OUT; | 3566 | break; |
3566 | break; | 3567 | } |
3567 | } | 3568 | } |
3568 | } else | 3569 | } else |
3569 | errcode = DID_ERROR; | 3570 | errcode = DID_ERROR; |
@@ -4135,6 +4136,7 @@ ips_chkstatus(ips_ha_t * ha, IPS_STATUS * pstatus) | |||
4135 | uint8_t basic_status; | 4136 | uint8_t basic_status; |
4136 | uint8_t ext_status; | 4137 | uint8_t ext_status; |
4137 | int errcode; | 4138 | int errcode; |
4139 | IPS_SCSI_INQ_DATA inquiryData; | ||
4138 | 4140 | ||
4139 | METHOD_TRACE("ips_chkstatus", 1); | 4141 | METHOD_TRACE("ips_chkstatus", 1); |
4140 | 4142 | ||
@@ -4255,11 +4257,11 @@ ips_chkstatus(ips_ha_t * ha, IPS_STATUS * pstatus) | |||
4255 | scb->scsi_cmd->result = errcode << 16; | 4257 | scb->scsi_cmd->result = errcode << 16; |
4256 | } else { /* bus == 0 */ | 4258 | } else { /* bus == 0 */ |
4257 | /* restrict access to physical drives */ | 4259 | /* restrict access to physical drives */ |
4258 | if ((scb->scsi_cmd->cmnd[0] == INQUIRY) && | 4260 | if (scb->scsi_cmd->cmnd[0] == INQUIRY) { |
4259 | ((((char *) scb->scsi_cmd->buffer)[0] & 0x1f) == | 4261 | ips_scmd_buf_read(scb->scsi_cmd, |
4260 | TYPE_DISK)) { | 4262 | &inquiryData, sizeof (inquiryData)); |
4261 | 4263 | if ((inquiryData.DeviceType & 0x1f) == TYPE_DISK) | |
4262 | scb->scsi_cmd->result = DID_TIME_OUT << 16; | 4264 | scb->scsi_cmd->result = DID_TIME_OUT << 16; |
4263 | } | 4265 | } |
4264 | } /* else */ | 4266 | } /* else */ |
4265 | } else { /* recovered error / success */ | 4267 | } else { /* recovered error / success */ |
@@ -5012,7 +5014,7 @@ ips_init_copperhead(ips_ha_t * ha) | |||
5012 | break; | 5014 | break; |
5013 | 5015 | ||
5014 | /* Delay for 1 Second */ | 5016 | /* Delay for 1 Second */ |
5015 | MDELAY(IPS_ONE_SEC); | 5017 | msleep(IPS_ONE_SEC); |
5016 | } | 5018 | } |
5017 | 5019 | ||
5018 | if (j >= 45) | 5020 | if (j >= 45) |
@@ -5038,7 +5040,7 @@ ips_init_copperhead(ips_ha_t * ha) | |||
5038 | break; | 5040 | break; |
5039 | 5041 | ||
5040 | /* Delay for 1 Second */ | 5042 | /* Delay for 1 Second */ |
5041 | MDELAY(IPS_ONE_SEC); | 5043 | msleep(IPS_ONE_SEC); |
5042 | } | 5044 | } |
5043 | 5045 | ||
5044 | if (j >= 240) | 5046 | if (j >= 240) |
@@ -5056,7 +5058,7 @@ ips_init_copperhead(ips_ha_t * ha) | |||
5056 | break; | 5058 | break; |
5057 | 5059 | ||
5058 | /* Delay for 1 Second */ | 5060 | /* Delay for 1 Second */ |
5059 | MDELAY(IPS_ONE_SEC); | 5061 | msleep(IPS_ONE_SEC); |
5060 | } | 5062 | } |
5061 | 5063 | ||
5062 | if (i >= 240) | 5064 | if (i >= 240) |
@@ -5106,7 +5108,7 @@ ips_init_copperhead_memio(ips_ha_t * ha) | |||
5106 | break; | 5108 | break; |
5107 | 5109 | ||
5108 | /* Delay for 1 Second */ | 5110 | /* Delay for 1 Second */ |
5109 | MDELAY(IPS_ONE_SEC); | 5111 | msleep(IPS_ONE_SEC); |
5110 | } | 5112 | } |
5111 | 5113 | ||
5112 | if (j >= 45) | 5114 | if (j >= 45) |
@@ -5132,7 +5134,7 @@ ips_init_copperhead_memio(ips_ha_t * ha) | |||
5132 | break; | 5134 | break; |
5133 | 5135 | ||
5134 | /* Delay for 1 Second */ | 5136 | /* Delay for 1 Second */ |
5135 | MDELAY(IPS_ONE_SEC); | 5137 | msleep(IPS_ONE_SEC); |
5136 | } | 5138 | } |
5137 | 5139 | ||
5138 | if (j >= 240) | 5140 | if (j >= 240) |
@@ -5150,7 +5152,7 @@ ips_init_copperhead_memio(ips_ha_t * ha) | |||
5150 | break; | 5152 | break; |
5151 | 5153 | ||
5152 | /* Delay for 1 Second */ | 5154 | /* Delay for 1 Second */ |
5153 | MDELAY(IPS_ONE_SEC); | 5155 | msleep(IPS_ONE_SEC); |
5154 | } | 5156 | } |
5155 | 5157 | ||
5156 | if (i >= 240) | 5158 | if (i >= 240) |
@@ -5202,7 +5204,7 @@ ips_init_morpheus(ips_ha_t * ha) | |||
5202 | break; | 5204 | break; |
5203 | 5205 | ||
5204 | /* Delay for 1 Second */ | 5206 | /* Delay for 1 Second */ |
5205 | MDELAY(IPS_ONE_SEC); | 5207 | msleep(IPS_ONE_SEC); |
5206 | } | 5208 | } |
5207 | 5209 | ||
5208 | if (i >= 45) { | 5210 | if (i >= 45) { |
@@ -5228,7 +5230,7 @@ ips_init_morpheus(ips_ha_t * ha) | |||
5228 | if (Post != 0x4F00) | 5230 | if (Post != 0x4F00) |
5229 | break; | 5231 | break; |
5230 | /* Delay for 1 Second */ | 5232 | /* Delay for 1 Second */ |
5231 | MDELAY(IPS_ONE_SEC); | 5233 | msleep(IPS_ONE_SEC); |
5232 | } | 5234 | } |
5233 | 5235 | ||
5234 | if (i >= 120) { | 5236 | if (i >= 120) { |
@@ -5258,7 +5260,7 @@ ips_init_morpheus(ips_ha_t * ha) | |||
5258 | break; | 5260 | break; |
5259 | 5261 | ||
5260 | /* Delay for 1 Second */ | 5262 | /* Delay for 1 Second */ |
5261 | MDELAY(IPS_ONE_SEC); | 5263 | msleep(IPS_ONE_SEC); |
5262 | } | 5264 | } |
5263 | 5265 | ||
5264 | if (i >= 240) { | 5266 | if (i >= 240) { |
@@ -5318,12 +5320,12 @@ ips_reset_copperhead(ips_ha_t * ha) | |||
5318 | outb(IPS_BIT_RST, ha->io_addr + IPS_REG_SCPR); | 5320 | outb(IPS_BIT_RST, ha->io_addr + IPS_REG_SCPR); |
5319 | 5321 | ||
5320 | /* Delay for 1 Second */ | 5322 | /* Delay for 1 Second */ |
5321 | MDELAY(IPS_ONE_SEC); | 5323 | msleep(IPS_ONE_SEC); |
5322 | 5324 | ||
5323 | outb(0, ha->io_addr + IPS_REG_SCPR); | 5325 | outb(0, ha->io_addr + IPS_REG_SCPR); |
5324 | 5326 | ||
5325 | /* Delay for 1 Second */ | 5327 | /* Delay for 1 Second */ |
5326 | MDELAY(IPS_ONE_SEC); | 5328 | msleep(IPS_ONE_SEC); |
5327 | 5329 | ||
5328 | if ((*ha->func.init) (ha)) | 5330 | if ((*ha->func.init) (ha)) |
5329 | break; | 5331 | break; |
@@ -5363,12 +5365,12 @@ ips_reset_copperhead_memio(ips_ha_t * ha) | |||
5363 | writeb(IPS_BIT_RST, ha->mem_ptr + IPS_REG_SCPR); | 5365 | writeb(IPS_BIT_RST, ha->mem_ptr + IPS_REG_SCPR); |
5364 | 5366 | ||
5365 | /* Delay for 1 Second */ | 5367 | /* Delay for 1 Second */ |
5366 | MDELAY(IPS_ONE_SEC); | 5368 | msleep(IPS_ONE_SEC); |
5367 | 5369 | ||
5368 | writeb(0, ha->mem_ptr + IPS_REG_SCPR); | 5370 | writeb(0, ha->mem_ptr + IPS_REG_SCPR); |
5369 | 5371 | ||
5370 | /* Delay for 1 Second */ | 5372 | /* Delay for 1 Second */ |
5371 | MDELAY(IPS_ONE_SEC); | 5373 | msleep(IPS_ONE_SEC); |
5372 | 5374 | ||
5373 | if ((*ha->func.init) (ha)) | 5375 | if ((*ha->func.init) (ha)) |
5374 | break; | 5376 | break; |
@@ -5409,7 +5411,7 @@ ips_reset_morpheus(ips_ha_t * ha) | |||
5409 | writel(0x80000000, ha->mem_ptr + IPS_REG_I960_IDR); | 5411 | writel(0x80000000, ha->mem_ptr + IPS_REG_I960_IDR); |
5410 | 5412 | ||
5411 | /* Delay for 5 Seconds */ | 5413 | /* Delay for 5 Seconds */ |
5412 | MDELAY(5 * IPS_ONE_SEC); | 5414 | msleep(5 * IPS_ONE_SEC); |
5413 | 5415 | ||
5414 | /* Do a PCI config read to wait for adapter */ | 5416 | /* Do a PCI config read to wait for adapter */ |
5415 | pci_read_config_byte(ha->pcidev, 4, &junk); | 5417 | pci_read_config_byte(ha->pcidev, 4, &junk); |