X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=drivers%2Fscsi%2Fips.c;h=86c546164da9f1dc78b98d4f2982e9b45d602d0c;hb=27ee6e0592c7d624836835dd8d2f0f74e9d289f6;hp=cd9b95db5a7d419ba29f82d6fd8aa45233d2b146;hpb=24bfb00123e82a2e70bd115277d922438813515b;p=linux-2.6-omap-h63xx.git diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c index cd9b95db5a7..86c546164da 100644 --- a/drivers/scsi/ips.c +++ b/drivers/scsi/ips.c @@ -139,6 +139,7 @@ /* - Remove 3 unused "inline" functions */ /* 7.12.xx - Use STATIC functions whereever possible */ /* - Clean up deprecated MODULE_PARM calls */ +/* 7.12.05 - Remove Version Matching per IBM request */ /*****************************************************************************/ /* @@ -210,7 +211,7 @@ module_param(ips, charp, 0); * DRIVER_VER */ #define IPS_VERSION_HIGH "7.12" -#define IPS_VERSION_LOW ".02 " +#define IPS_VERSION_LOW ".05 " #if !defined(__i386__) && !defined(__ia64__) && !defined(__x86_64__) #warning "This driver has only been tested on the x86/ia64/x86_64 platforms" @@ -247,7 +248,7 @@ module_param(ips, charp, 0); /* * Function prototypes */ -static int ips_detect(Scsi_Host_Template *); +static int ips_detect(struct scsi_host_template *); static int ips_release(struct Scsi_Host *); static int ips_eh_abort(Scsi_Cmnd *); static int ips_eh_reset(Scsi_Cmnd *); @@ -347,8 +348,6 @@ static int ips_proc_info(struct Scsi_Host *, char *, char **, off_t, int, int); static int ips_host_info(ips_ha_t *, char *, off_t, int); static void copy_mem_info(IPS_INFOSTR *, char *, int); static int copy_info(IPS_INFOSTR *, char *, ...); -static int ips_get_version_info(ips_ha_t * ha, dma_addr_t, int intr); -static void ips_version_check(ips_ha_t * ha, int intr); static int ips_abort_init(ips_ha_t * ha, int index); static int ips_init_phase2(int index); @@ -378,7 +377,7 @@ static char *ips_FlashData = NULL; /* CD Boot - Flash Data Buffer */ static dma_addr_t ips_flashbusaddr; static long ips_FlashDataInUse; /* CD Boot - Flash Data In Use Flag */ static uint32_t MaxLiteCmds = 32; /* Max Active Cmds for a Lite Adapter */ -static Scsi_Host_Template ips_driver_template = { +static struct scsi_host_template ips_driver_template = { .detect = ips_detect, .release = ips_release, .info = ips_info, @@ -406,8 +405,6 @@ static Scsi_Host_Template ips_driver_template = { #endif }; -static IPS_DEFINE_COMPAT_TABLE( Compatable ); /* Version Compatability Table */ - /* This table describes all ServeRAID Adapters */ static struct pci_device_id ips_pci_table[] = { @@ -590,7 +587,7 @@ __setup("ips=", ips_setup); /* */ /****************************************************************************/ static int -ips_detect(Scsi_Host_Template * SHT) +ips_detect(struct scsi_host_template * SHT) { int i; @@ -1265,9 +1262,9 @@ ips_proc24_info(char *buffer, char **start, off_t offset, int length, /* */ /****************************************************************************/ static void -ips_select_queue_depth(struct Scsi_Host *host, Scsi_Device * scsi_devs) +ips_select_queue_depth(struct Scsi_Host *host, struct scsi_device * scsi_devs) { - Scsi_Device *device; + struct scsi_device *device; ips_ha_t *ha; int count = 0; int min; @@ -1310,7 +1307,7 @@ ips_select_queue_depth(struct Scsi_Host *host, Scsi_Device * scsi_devs) /* */ /****************************************************************************/ static int -ips_slave_configure(Scsi_Device * SDptr) +ips_slave_configure(struct scsi_device * SDptr) { ips_ha_t *ha; int min; @@ -1322,6 +1319,9 @@ ips_slave_configure(Scsi_Device * SDptr) min = ha->max_cmds - 1; scsi_adjust_queue_depth(SDptr, MSG_ORDERED_TAG, min); } + + SDptr->skip_ms_page_8 = 1; + SDptr->skip_ms_page_3f = 1; return 0; } #endif @@ -3499,6 +3499,7 @@ ips_map_status(ips_ha_t * ha, ips_scb_t * scb, ips_stat_t * sp) int device_error; uint32_t transfer_len; IPS_DCDB_TABLE_TAPE *tapeDCDB; + IPS_SCSI_INQ_DATA inquiryData; METHOD_TRACE("ips_map_status", 1); @@ -3557,13 +3558,13 @@ ips_map_status(ips_ha_t * ha, ips_scb_t * scb, ips_stat_t * sp) errcode = DID_OK; /* Restrict access to physical DASD */ - if ((scb->scsi_cmd->cmnd[0] == INQUIRY) && - ((((char *) scb->scsi_cmd-> - buffer)[0] & 0x1f) == TYPE_DISK)) { - /* underflow -- no error */ - /* restrict access to physical DASD */ - errcode = DID_TIME_OUT; - break; + if (scb->scsi_cmd->cmnd[0] == INQUIRY) { + ips_scmd_buf_read(scb->scsi_cmd, + &inquiryData, sizeof (inquiryData)); + if ((inquiryData.DeviceType & 0x1f) == TYPE_DISK) { + errcode = DID_TIME_OUT; + break; + } } } else errcode = DID_ERROR; @@ -4135,6 +4136,7 @@ ips_chkstatus(ips_ha_t * ha, IPS_STATUS * pstatus) uint8_t basic_status; uint8_t ext_status; int errcode; + IPS_SCSI_INQ_DATA inquiryData; METHOD_TRACE("ips_chkstatus", 1); @@ -4255,11 +4257,11 @@ ips_chkstatus(ips_ha_t * ha, IPS_STATUS * pstatus) scb->scsi_cmd->result = errcode << 16; } else { /* bus == 0 */ /* restrict access to physical drives */ - if ((scb->scsi_cmd->cmnd[0] == INQUIRY) && - ((((char *) scb->scsi_cmd->buffer)[0] & 0x1f) == - TYPE_DISK)) { - - scb->scsi_cmd->result = DID_TIME_OUT << 16; + if (scb->scsi_cmd->cmnd[0] == INQUIRY) { + ips_scmd_buf_read(scb->scsi_cmd, + &inquiryData, sizeof (inquiryData)); + if ((inquiryData.DeviceType & 0x1f) == TYPE_DISK) + scb->scsi_cmd->result = DID_TIME_OUT << 16; } } /* else */ } else { /* recovered error / success */ @@ -5012,7 +5014,7 @@ ips_init_copperhead(ips_ha_t * ha) break; /* Delay for 1 Second */ - MDELAY(IPS_ONE_SEC); + msleep(IPS_ONE_SEC); } if (j >= 45) @@ -5038,7 +5040,7 @@ ips_init_copperhead(ips_ha_t * ha) break; /* Delay for 1 Second */ - MDELAY(IPS_ONE_SEC); + msleep(IPS_ONE_SEC); } if (j >= 240) @@ -5056,7 +5058,7 @@ ips_init_copperhead(ips_ha_t * ha) break; /* Delay for 1 Second */ - MDELAY(IPS_ONE_SEC); + msleep(IPS_ONE_SEC); } if (i >= 240) @@ -5106,7 +5108,7 @@ ips_init_copperhead_memio(ips_ha_t * ha) break; /* Delay for 1 Second */ - MDELAY(IPS_ONE_SEC); + msleep(IPS_ONE_SEC); } if (j >= 45) @@ -5132,7 +5134,7 @@ ips_init_copperhead_memio(ips_ha_t * ha) break; /* Delay for 1 Second */ - MDELAY(IPS_ONE_SEC); + msleep(IPS_ONE_SEC); } if (j >= 240) @@ -5150,7 +5152,7 @@ ips_init_copperhead_memio(ips_ha_t * ha) break; /* Delay for 1 Second */ - MDELAY(IPS_ONE_SEC); + msleep(IPS_ONE_SEC); } if (i >= 240) @@ -5202,7 +5204,7 @@ ips_init_morpheus(ips_ha_t * ha) break; /* Delay for 1 Second */ - MDELAY(IPS_ONE_SEC); + msleep(IPS_ONE_SEC); } if (i >= 45) { @@ -5228,7 +5230,7 @@ ips_init_morpheus(ips_ha_t * ha) if (Post != 0x4F00) break; /* Delay for 1 Second */ - MDELAY(IPS_ONE_SEC); + msleep(IPS_ONE_SEC); } if (i >= 120) { @@ -5258,7 +5260,7 @@ ips_init_morpheus(ips_ha_t * ha) break; /* Delay for 1 Second */ - MDELAY(IPS_ONE_SEC); + msleep(IPS_ONE_SEC); } if (i >= 240) { @@ -5318,12 +5320,12 @@ ips_reset_copperhead(ips_ha_t * ha) outb(IPS_BIT_RST, ha->io_addr + IPS_REG_SCPR); /* Delay for 1 Second */ - MDELAY(IPS_ONE_SEC); + msleep(IPS_ONE_SEC); outb(0, ha->io_addr + IPS_REG_SCPR); /* Delay for 1 Second */ - MDELAY(IPS_ONE_SEC); + msleep(IPS_ONE_SEC); if ((*ha->func.init) (ha)) break; @@ -5363,12 +5365,12 @@ ips_reset_copperhead_memio(ips_ha_t * ha) writeb(IPS_BIT_RST, ha->mem_ptr + IPS_REG_SCPR); /* Delay for 1 Second */ - MDELAY(IPS_ONE_SEC); + msleep(IPS_ONE_SEC); writeb(0, ha->mem_ptr + IPS_REG_SCPR); /* Delay for 1 Second */ - MDELAY(IPS_ONE_SEC); + msleep(IPS_ONE_SEC); if ((*ha->func.init) (ha)) break; @@ -5409,7 +5411,7 @@ ips_reset_morpheus(ips_ha_t * ha) writel(0x80000000, ha->mem_ptr + IPS_REG_I960_IDR); /* Delay for 5 Seconds */ - MDELAY(5 * IPS_ONE_SEC); + msleep(5 * IPS_ONE_SEC); /* Do a PCI config read to wait for adapter */ pci_read_config_byte(ha->pcidev, 4, &junk); @@ -5930,7 +5932,7 @@ ips_write_driver_status(ips_ha_t * ha, int intr) strncpy((char *) ha->nvram->bios_high, ha->bios_version, 4); strncpy((char *) ha->nvram->bios_low, ha->bios_version + 4, 4); - ips_version_check(ha, intr); /* Check BIOS/FW/Driver Versions */ + ha->nvram->versioning = 0; /* Indicate the Driver Does Not Support Versioning */ /* now update the page */ if (!ips_readwrite_page5(ha, TRUE, intr)) { @@ -6847,135 +6849,6 @@ ips_verify_bios_memio(ips_ha_t * ha, char *buffer, uint32_t buffersize, return (0); } -/*---------------------------------------------------------------------------*/ -/* Routine Name: ips_version_check */ -/* */ -/* Dependencies: */ -/* Assumes that ips_read_adapter_status() is called first filling in */ -/* the data for SubSystem Parameters. */ -/* Called from ips_write_driver_status() so it also assumes NVRAM Page 5 */ -/* Data is available. */ -/* */ -/*---------------------------------------------------------------------------*/ -static void -ips_version_check(ips_ha_t * ha, int intr) -{ - IPS_VERSION_DATA *VersionInfo; - uint8_t FirmwareVersion[IPS_COMPAT_ID_LENGTH + 1]; - uint8_t BiosVersion[IPS_COMPAT_ID_LENGTH + 1]; - int MatchError; - int rc; - char BiosString[10]; - char FirmwareString[10]; - - METHOD_TRACE("ips_version_check", 1); - - VersionInfo = ( IPS_VERSION_DATA * ) ha->ioctl_data; - - memset(FirmwareVersion, 0, IPS_COMPAT_ID_LENGTH + 1); - memset(BiosVersion, 0, IPS_COMPAT_ID_LENGTH + 1); - - /* Get the Compatible BIOS Version from NVRAM Page 5 */ - memcpy(BiosVersion, ha->nvram->BiosCompatibilityID, - IPS_COMPAT_ID_LENGTH); - - rc = IPS_FAILURE; - if (ha->subsys->param[4] & IPS_GET_VERSION_SUPPORT) { /* If Versioning is Supported */ - /* Get the Version Info with a Get Version Command */ - memset( VersionInfo, 0, sizeof (IPS_VERSION_DATA)); - rc = ips_get_version_info(ha, ha->ioctl_busaddr, intr); - if (rc == IPS_SUCCESS) - memcpy(FirmwareVersion, VersionInfo->compatibilityId, - IPS_COMPAT_ID_LENGTH); - } - - if (rc != IPS_SUCCESS) { /* If Data Not Obtainable from a GetVersion Command */ - /* Get the Firmware Version from Enquiry Data */ - memcpy(FirmwareVersion, ha->enq->CodeBlkVersion, - IPS_COMPAT_ID_LENGTH); - } - - /* printk(KERN_WARNING "Adapter's BIOS Version = %s\n", BiosVersion); */ - /* printk(KERN_WARNING "BIOS Compatible Version = %s\n", IPS_COMPAT_BIOS); */ - /* printk(KERN_WARNING "Adapter's Firmware Version = %s\n", FirmwareVersion); */ - /* printk(KERN_WARNING "Firmware Compatible Version = %s \n", Compatable[ ha->nvram->adapter_type ]); */ - - MatchError = 0; - - if (strncmp - (FirmwareVersion, Compatable[ha->nvram->adapter_type], - IPS_COMPAT_ID_LENGTH) != 0) - MatchError = 1; - - if (strncmp(BiosVersion, IPS_COMPAT_BIOS, IPS_COMPAT_ID_LENGTH) != 0) - MatchError = 1; - - ha->nvram->versioning = 1; /* Indicate the Driver Supports Versioning */ - - if (MatchError) { - ha->nvram->version_mismatch = 1; - if (ips_cd_boot == 0) { - strncpy(&BiosString[0], ha->nvram->bios_high, 4); - strncpy(&BiosString[4], ha->nvram->bios_low, 4); - BiosString[8] = 0; - - strncpy(&FirmwareString[0], ha->enq->CodeBlkVersion, 8); - FirmwareString[8] = 0; - - IPS_PRINTK(KERN_WARNING, ha->pcidev, - "Warning ! ! ! ServeRAID Version Mismatch\n"); - IPS_PRINTK(KERN_WARNING, ha->pcidev, - "Bios = %s, Firmware = %s, Device Driver = %s%s\n", - BiosString, FirmwareString, IPS_VERSION_HIGH, - IPS_VERSION_LOW); - IPS_PRINTK(KERN_WARNING, ha->pcidev, - "These levels should match to avoid possible compatibility problems.\n"); - } - } else { - ha->nvram->version_mismatch = 0; - } - - return; -} - -/*---------------------------------------------------------------------------*/ -/* Routine Name: ips_get_version_info */ -/* */ -/* Routine Description: */ -/* Issue an internal GETVERSION Command */ -/* */ -/* Return Value: */ -/* 0 if Successful, else non-zero */ -/*---------------------------------------------------------------------------*/ -static int -ips_get_version_info(ips_ha_t * ha, dma_addr_t Buffer, int intr) -{ - ips_scb_t *scb; - int rc; - - METHOD_TRACE("ips_get_version_info", 1); - - scb = &ha->scbs[ha->max_cmds - 1]; - - ips_init_scb(ha, scb); - - scb->timeout = ips_cmd_timeout; - scb->cdb[0] = IPS_CMD_GET_VERSION_INFO; - scb->cmd.version_info.op_code = IPS_CMD_GET_VERSION_INFO; - scb->cmd.version_info.command_id = IPS_COMMAND_ID(ha, scb); - scb->cmd.version_info.reserved = 0; - scb->cmd.version_info.count = sizeof (IPS_VERSION_DATA); - scb->cmd.version_info.reserved2 = 0; - scb->data_len = sizeof (IPS_VERSION_DATA); - scb->data_busaddr = Buffer; - scb->cmd.version_info.buffer_addr = Buffer; - scb->flags = 0; - - /* issue command */ - rc = ips_send_wait(ha, scb, ips_cmd_timeout, intr); - return (rc); -} - /****************************************************************************/ /* */ /* Routine Name: ips_abort_init */