diff options
Diffstat (limited to 'drivers/scsi/ips.c')
| -rw-r--r-- | drivers/scsi/ips.c | 150 |
1 files changed, 9 insertions, 141 deletions
diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c index cd9b95db5a7d..3882d48a42bf 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" |
| @@ -247,7 +248,7 @@ module_param(ips, charp, 0); | |||
| 247 | /* | 248 | /* |
| 248 | * Function prototypes | 249 | * Function prototypes |
| 249 | */ | 250 | */ |
| 250 | static int ips_detect(Scsi_Host_Template *); | 251 | static int ips_detect(struct scsi_host_template *); |
| 251 | static int ips_release(struct Scsi_Host *); | 252 | static int ips_release(struct Scsi_Host *); |
| 252 | static int ips_eh_abort(Scsi_Cmnd *); | 253 | static int ips_eh_abort(Scsi_Cmnd *); |
| 253 | static int ips_eh_reset(Scsi_Cmnd *); | 254 | 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); | |||
| 347 | static int ips_host_info(ips_ha_t *, char *, off_t, int); | 348 | static int ips_host_info(ips_ha_t *, char *, off_t, int); |
| 348 | static void copy_mem_info(IPS_INFOSTR *, char *, int); | 349 | static void copy_mem_info(IPS_INFOSTR *, char *, int); |
| 349 | static int copy_info(IPS_INFOSTR *, char *, ...); | 350 | static int copy_info(IPS_INFOSTR *, char *, ...); |
| 350 | static int ips_get_version_info(ips_ha_t * ha, dma_addr_t, int intr); | ||
| 351 | static void ips_version_check(ips_ha_t * ha, int intr); | ||
| 352 | static int ips_abort_init(ips_ha_t * ha, int index); | 351 | static int ips_abort_init(ips_ha_t * ha, int index); |
| 353 | static int ips_init_phase2(int index); | 352 | static int ips_init_phase2(int index); |
| 354 | 353 | ||
| @@ -378,7 +377,7 @@ static char *ips_FlashData = NULL; /* CD Boot - Flash Data Buffer */ | |||
| 378 | static dma_addr_t ips_flashbusaddr; | 377 | static dma_addr_t ips_flashbusaddr; |
| 379 | static long ips_FlashDataInUse; /* CD Boot - Flash Data In Use Flag */ | 378 | static long ips_FlashDataInUse; /* CD Boot - Flash Data In Use Flag */ |
| 380 | static uint32_t MaxLiteCmds = 32; /* Max Active Cmds for a Lite Adapter */ | 379 | static uint32_t MaxLiteCmds = 32; /* Max Active Cmds for a Lite Adapter */ |
| 381 | static Scsi_Host_Template ips_driver_template = { | 380 | static struct scsi_host_template ips_driver_template = { |
| 382 | .detect = ips_detect, | 381 | .detect = ips_detect, |
| 383 | .release = ips_release, | 382 | .release = ips_release, |
| 384 | .info = ips_info, | 383 | .info = ips_info, |
| @@ -406,8 +405,6 @@ static Scsi_Host_Template ips_driver_template = { | |||
| 406 | #endif | 405 | #endif |
| 407 | }; | 406 | }; |
| 408 | 407 | ||
| 409 | static 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 */ |
| 413 | static struct pci_device_id ips_pci_table[] = { | 410 | static struct pci_device_id ips_pci_table[] = { |
| @@ -590,7 +587,7 @@ __setup("ips=", ips_setup); | |||
| 590 | /* */ | 587 | /* */ |
| 591 | /****************************************************************************/ | 588 | /****************************************************************************/ |
| 592 | static int | 589 | static int |
| 593 | ips_detect(Scsi_Host_Template * SHT) | 590 | ips_detect(struct scsi_host_template * SHT) |
| 594 | { | 591 | { |
| 595 | int i; | 592 | int i; |
| 596 | 593 | ||
| @@ -1265,9 +1262,9 @@ ips_proc24_info(char *buffer, char **start, off_t offset, int length, | |||
| 1265 | /* */ | 1262 | /* */ |
| 1266 | /****************************************************************************/ | 1263 | /****************************************************************************/ |
| 1267 | static void | 1264 | static void |
| 1268 | ips_select_queue_depth(struct Scsi_Host *host, Scsi_Device * scsi_devs) | 1265 | ips_select_queue_depth(struct Scsi_Host *host, struct scsi_device * scsi_devs) |
| 1269 | { | 1266 | { |
| 1270 | Scsi_Device *device; | 1267 | struct scsi_device *device; |
| 1271 | ips_ha_t *ha; | 1268 | ips_ha_t *ha; |
| 1272 | int count = 0; | 1269 | int count = 0; |
| 1273 | int min; | 1270 | int min; |
| @@ -1310,7 +1307,7 @@ ips_select_queue_depth(struct Scsi_Host *host, Scsi_Device * scsi_devs) | |||
| 1310 | /* */ | 1307 | /* */ |
| 1311 | /****************************************************************************/ | 1308 | /****************************************************************************/ |
| 1312 | static int | 1309 | static int |
| 1313 | ips_slave_configure(Scsi_Device * SDptr) | 1310 | ips_slave_configure(struct scsi_device * SDptr) |
| 1314 | { | 1311 | { |
| 1315 | ips_ha_t *ha; | 1312 | ips_ha_t *ha; |
| 1316 | int min; | 1313 | int min; |
| @@ -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 | /*---------------------------------------------------------------------------*/ | ||
| 6860 | static void | ||
| 6861 | ips_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 | /*---------------------------------------------------------------------------*/ | ||
| 6950 | static int | ||
| 6951 | ips_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 */ |
