aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/ips.c
diff options
context:
space:
mode:
authorJames Bottomley <jejb@mulgrave.(none)>2005-11-08 12:50:26 -0500
committerJames Bottomley <jejb@mulgrave.(none)>2005-11-08 12:50:26 -0500
commit383f9749505cef0a30dbd7109db7fe469aa64753 (patch)
tree9e88d648396ac99a90d12ccf5471d001e87c65ae /drivers/scsi/ips.c
parentf093182d313edde9b1f86dbdaf40ba4da2dbd0e7 (diff)
parent3da8b713da723e78a03f0404beedf3cc6f4f860b (diff)
Merge by hand (conflicts between pending drivers and kfree cleanups)
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/ips.c')
-rw-r--r--drivers/scsi/ips.c138
1 files changed, 3 insertions, 135 deletions
diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c
index cd9b95db5a7..cae3262a295 100644
--- a/drivers/scsi/ips.c
+++ b/drivers/scsi/ips.c
@@ -139,6 +139,7 @@
139/* - Remove 3 unused "inline" functions */ 139/* - Remove 3 unused "inline" functions */
140/* 7.12.xx - Use STATIC functions whereever possible */ 140/* 7.12.xx - Use STATIC functions whereever possible */
141/* - Clean up deprecated MODULE_PARM calls */ 141/* - Clean up deprecated MODULE_PARM calls */
142/* 7.12.05 - Remove Version Matching per IBM request */
142/*****************************************************************************/ 143/*****************************************************************************/
143 144
144/* 145/*
@@ -210,7 +211,7 @@ module_param(ips, charp, 0);
210 * DRIVER_VER 211 * DRIVER_VER
211 */ 212 */
212#define IPS_VERSION_HIGH "7.12" 213#define IPS_VERSION_HIGH "7.12"
213#define IPS_VERSION_LOW ".02 " 214#define IPS_VERSION_LOW ".05 "
214 215
215#if !defined(__i386__) && !defined(__ia64__) && !defined(__x86_64__) 216#if !defined(__i386__) && !defined(__ia64__) && !defined(__x86_64__)
216#warning "This driver has only been tested on the x86/ia64/x86_64 platforms" 217#warning "This driver has only been tested on the x86/ia64/x86_64 platforms"
@@ -347,8 +348,6 @@ static int ips_proc_info(struct Scsi_Host *, char *, char **, off_t, int, int);
347static int ips_host_info(ips_ha_t *, char *, off_t, int); 348static int ips_host_info(ips_ha_t *, char *, off_t, int);
348static void copy_mem_info(IPS_INFOSTR *, char *, int); 349static void copy_mem_info(IPS_INFOSTR *, char *, int);
349static int copy_info(IPS_INFOSTR *, char *, ...); 350static int copy_info(IPS_INFOSTR *, char *, ...);
350static int ips_get_version_info(ips_ha_t * ha, dma_addr_t, int intr);
351static void ips_version_check(ips_ha_t * ha, int intr);
352static int ips_abort_init(ips_ha_t * ha, int index); 351static int ips_abort_init(ips_ha_t * ha, int index);
353static int ips_init_phase2(int index); 352static int ips_init_phase2(int index);
354 353
@@ -406,8 +405,6 @@ static Scsi_Host_Template ips_driver_template = {
406#endif 405#endif
407}; 406};
408 407
409static IPS_DEFINE_COMPAT_TABLE( Compatable ); /* Version Compatability Table */
410
411 408
412/* This table describes all ServeRAID Adapters */ 409/* This table describes all ServeRAID Adapters */
413static struct pci_device_id ips_pci_table[] = { 410static struct pci_device_id ips_pci_table[] = {
@@ -5930,7 +5927,7 @@ ips_write_driver_status(ips_ha_t * ha, int intr)
5930 strncpy((char *) ha->nvram->bios_high, ha->bios_version, 4); 5927 strncpy((char *) ha->nvram->bios_high, ha->bios_version, 4);
5931 strncpy((char *) ha->nvram->bios_low, ha->bios_version + 4, 4); 5928 strncpy((char *) ha->nvram->bios_low, ha->bios_version + 4, 4);
5932 5929
5933 ips_version_check(ha, intr); /* Check BIOS/FW/Driver Versions */ 5930 ha->nvram->versioning = 0; /* Indicate the Driver Does Not Support Versioning */
5934 5931
5935 /* now update the page */ 5932 /* now update the page */
5936 if (!ips_readwrite_page5(ha, TRUE, intr)) { 5933 if (!ips_readwrite_page5(ha, TRUE, intr)) {
@@ -6847,135 +6844,6 @@ ips_verify_bios_memio(ips_ha_t * ha, char *buffer, uint32_t buffersize,
6847 return (0); 6844 return (0);
6848} 6845}
6849 6846
6850/*---------------------------------------------------------------------------*/
6851/* Routine Name: ips_version_check */
6852/* */
6853/* Dependencies: */
6854/* Assumes that ips_read_adapter_status() is called first filling in */
6855/* the data for SubSystem Parameters. */
6856/* Called from ips_write_driver_status() so it also assumes NVRAM Page 5 */
6857/* Data is available. */
6858/* */
6859/*---------------------------------------------------------------------------*/
6860static void
6861ips_version_check(ips_ha_t * ha, int intr)
6862{
6863 IPS_VERSION_DATA *VersionInfo;
6864 uint8_t FirmwareVersion[IPS_COMPAT_ID_LENGTH + 1];
6865 uint8_t BiosVersion[IPS_COMPAT_ID_LENGTH + 1];
6866 int MatchError;
6867 int rc;
6868 char BiosString[10];
6869 char FirmwareString[10];
6870
6871 METHOD_TRACE("ips_version_check", 1);
6872
6873 VersionInfo = ( IPS_VERSION_DATA * ) ha->ioctl_data;
6874
6875 memset(FirmwareVersion, 0, IPS_COMPAT_ID_LENGTH + 1);
6876 memset(BiosVersion, 0, IPS_COMPAT_ID_LENGTH + 1);
6877
6878 /* Get the Compatible BIOS Version from NVRAM Page 5 */
6879 memcpy(BiosVersion, ha->nvram->BiosCompatibilityID,
6880 IPS_COMPAT_ID_LENGTH);
6881
6882 rc = IPS_FAILURE;
6883 if (ha->subsys->param[4] & IPS_GET_VERSION_SUPPORT) { /* If Versioning is Supported */
6884 /* Get the Version Info with a Get Version Command */
6885 memset( VersionInfo, 0, sizeof (IPS_VERSION_DATA));
6886 rc = ips_get_version_info(ha, ha->ioctl_busaddr, intr);
6887 if (rc == IPS_SUCCESS)
6888 memcpy(FirmwareVersion, VersionInfo->compatibilityId,
6889 IPS_COMPAT_ID_LENGTH);
6890 }
6891
6892 if (rc != IPS_SUCCESS) { /* If Data Not Obtainable from a GetVersion Command */
6893 /* Get the Firmware Version from Enquiry Data */
6894 memcpy(FirmwareVersion, ha->enq->CodeBlkVersion,
6895 IPS_COMPAT_ID_LENGTH);
6896 }
6897
6898 /* printk(KERN_WARNING "Adapter's BIOS Version = %s\n", BiosVersion); */
6899 /* printk(KERN_WARNING "BIOS Compatible Version = %s\n", IPS_COMPAT_BIOS); */
6900 /* printk(KERN_WARNING "Adapter's Firmware Version = %s\n", FirmwareVersion); */
6901 /* printk(KERN_WARNING "Firmware Compatible Version = %s \n", Compatable[ ha->nvram->adapter_type ]); */
6902
6903 MatchError = 0;
6904
6905 if (strncmp
6906 (FirmwareVersion, Compatable[ha->nvram->adapter_type],
6907 IPS_COMPAT_ID_LENGTH) != 0)
6908 MatchError = 1;
6909
6910 if (strncmp(BiosVersion, IPS_COMPAT_BIOS, IPS_COMPAT_ID_LENGTH) != 0)
6911 MatchError = 1;
6912
6913 ha->nvram->versioning = 1; /* Indicate the Driver Supports Versioning */
6914
6915 if (MatchError) {
6916 ha->nvram->version_mismatch = 1;
6917 if (ips_cd_boot == 0) {
6918 strncpy(&BiosString[0], ha->nvram->bios_high, 4);
6919 strncpy(&BiosString[4], ha->nvram->bios_low, 4);
6920 BiosString[8] = 0;
6921
6922 strncpy(&FirmwareString[0], ha->enq->CodeBlkVersion, 8);
6923 FirmwareString[8] = 0;
6924
6925 IPS_PRINTK(KERN_WARNING, ha->pcidev,
6926 "Warning ! ! ! ServeRAID Version Mismatch\n");
6927 IPS_PRINTK(KERN_WARNING, ha->pcidev,
6928 "Bios = %s, Firmware = %s, Device Driver = %s%s\n",
6929 BiosString, FirmwareString, IPS_VERSION_HIGH,
6930 IPS_VERSION_LOW);
6931 IPS_PRINTK(KERN_WARNING, ha->pcidev,
6932 "These levels should match to avoid possible compatibility problems.\n");
6933 }
6934 } else {
6935 ha->nvram->version_mismatch = 0;
6936 }
6937
6938 return;
6939}
6940
6941/*---------------------------------------------------------------------------*/
6942/* Routine Name: ips_get_version_info */
6943/* */
6944/* Routine Description: */
6945/* Issue an internal GETVERSION Command */
6946/* */
6947/* Return Value: */
6948/* 0 if Successful, else non-zero */
6949/*---------------------------------------------------------------------------*/
6950static int
6951ips_get_version_info(ips_ha_t * ha, dma_addr_t Buffer, int intr)
6952{
6953 ips_scb_t *scb;
6954 int rc;
6955
6956 METHOD_TRACE("ips_get_version_info", 1);
6957
6958 scb = &ha->scbs[ha->max_cmds - 1];
6959
6960 ips_init_scb(ha, scb);
6961
6962 scb->timeout = ips_cmd_timeout;
6963 scb->cdb[0] = IPS_CMD_GET_VERSION_INFO;
6964 scb->cmd.version_info.op_code = IPS_CMD_GET_VERSION_INFO;
6965 scb->cmd.version_info.command_id = IPS_COMMAND_ID(ha, scb);
6966 scb->cmd.version_info.reserved = 0;
6967 scb->cmd.version_info.count = sizeof (IPS_VERSION_DATA);
6968 scb->cmd.version_info.reserved2 = 0;
6969 scb->data_len = sizeof (IPS_VERSION_DATA);
6970 scb->data_busaddr = Buffer;
6971 scb->cmd.version_info.buffer_addr = Buffer;
6972 scb->flags = 0;
6973
6974 /* issue command */
6975 rc = ips_send_wait(ha, scb, ips_cmd_timeout, intr);
6976 return (rc);
6977}
6978
6979/****************************************************************************/ 6847/****************************************************************************/
6980/* */ 6848/* */
6981/* Routine Name: ips_abort_init */ 6849/* Routine Name: ips_abort_init */