X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fscsi%2Fmegaraid%2Fmegaraid_mbox.c;h=70a0f11f48b235d769b1efb088d1c9bd2c98f949;hb=dc7c65db2845a8d17432d89252c4227a9a7cb15f;hp=24e32e446e76048ed461c105539e730a9376ad98;hpb=8561b089afbaed2651591e5a4574fdca451d82f2;p=linux-2.6 diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c index 24e32e446e..70a0f11f48 100644 --- a/drivers/scsi/megaraid/megaraid_mbox.c +++ b/drivers/scsi/megaraid/megaraid_mbox.c @@ -125,7 +125,7 @@ static irqreturn_t megaraid_isr(int, void *); static void megaraid_mbox_dpc(unsigned long); -static ssize_t megaraid_sysfs_show_app_hndl(struct class_device *, char *); +static ssize_t megaraid_sysfs_show_app_hndl(struct device *, struct device_attribute *attr, char *); static ssize_t megaraid_sysfs_show_ldnum(struct device *, struct device_attribute *attr, char *); static int megaraid_cmm_register(adapter_t *); @@ -313,12 +313,12 @@ static struct pci_driver megaraid_pci_driver = { // definitions for the device attributes for exporting logical drive number // for a scsi address (Host, Channel, Id, Lun) -CLASS_DEVICE_ATTR(megaraid_mbox_app_hndl, S_IRUSR, megaraid_sysfs_show_app_hndl, +DEVICE_ATTR(megaraid_mbox_app_hndl, S_IRUSR, megaraid_sysfs_show_app_hndl, NULL); // Host template initializer for megaraid mbox sysfs device attributes -static struct class_device_attribute *megaraid_shost_attrs[] = { - &class_device_attr_megaraid_mbox_app_hndl, +static struct device_attribute *megaraid_shost_attrs[] = { + &dev_attr_megaraid_mbox_app_hndl, NULL, }; @@ -361,7 +361,6 @@ static struct scsi_host_template megaraid_template_g = { .eh_host_reset_handler = megaraid_reset_handler, .change_queue_depth = megaraid_change_queue_depth, .use_clustering = ENABLE_CLUSTERING, - .use_sg_chaining = ENABLE_SG_CHAINING, .sdev_attrs = megaraid_sdev_attrs, .shost_attrs = megaraid_shost_attrs, }; @@ -3169,6 +3168,23 @@ megaraid_mbox_support_random_del(adapter_t *adapter) uint8_t raw_mbox[sizeof(mbox_t)]; int rval; + /* + * Newer firmware on Dell CERC expect a different + * random deletion handling, so disable it. + */ + if (adapter->pdev->vendor == PCI_VENDOR_ID_AMI && + adapter->pdev->device == PCI_DEVICE_ID_AMI_MEGARAID3 && + adapter->pdev->subsystem_vendor == PCI_VENDOR_ID_DELL && + adapter->pdev->subsystem_device == PCI_SUBSYS_ID_CERC_ATA100_4CH && + (adapter->fw_version[0] > '6' || + (adapter->fw_version[0] == '6' && + adapter->fw_version[2] > '6') || + (adapter->fw_version[0] == '6' + && adapter->fw_version[2] == '6' + && adapter->fw_version[3] > '1'))) { + con_log(CL_DLEVEL1, ("megaraid: disable random deletion\n")); + return 0; + } mbox = (mbox_t *)raw_mbox; @@ -3465,12 +3481,12 @@ megaraid_mbox_setup_device_map(adapter_t *adapter) /* * START: Interface for the common management module * - * This is the module, which interfaces with the common mangement module to + * This is the module, which interfaces with the common management module to * provide support for ioctl and sysfs */ /** - * megaraid_cmm_register - register with the mangement module + * megaraid_cmm_register - register with the management module * @adapter : HBA soft state * * Register with the management module, which allows applications to issue @@ -3558,7 +3574,7 @@ megaraid_cmm_register(adapter_t *adapter) /** - * megaraid_cmm_unregister - un-register with the mangement module + * megaraid_cmm_unregister - un-register with the management module * @adapter : HBA soft state * * Un-register with the management module. @@ -3580,7 +3596,7 @@ megaraid_cmm_unregister(adapter_t *adapter) * @kioc : CMM interface packet * @action : command action * - * This routine is invoked whenever the Common Mangement Module (CMM) has a + * This routine is invoked whenever the Common Management Module (CMM) has a * command for us. The 'action' parameter specifies if this is a new command * or otherwise. */ @@ -3945,7 +3961,7 @@ megaraid_sysfs_get_ldmap_timeout(unsigned long data) * * This routine will be called whenever user reads the logical drive * attributes, go get the current logical drive mapping table from the - * firmware. We use the managment API's to issue commands to the controller. + * firmware. We use the management API's to issue commands to the controller. * * NOTE: The commands issuance functionality is not generalized and * implemented in context of "get ld map" command only. If required, the @@ -4064,9 +4080,10 @@ megaraid_sysfs_get_ldmap(adapter_t *adapter) * handle, since we do not interface with applications directly. */ static ssize_t -megaraid_sysfs_show_app_hndl(struct class_device *cdev, char *buf) +megaraid_sysfs_show_app_hndl(struct device *dev, struct device_attribute *attr, + char *buf) { - struct Scsi_Host *shost = class_to_shost(cdev); + struct Scsi_Host *shost = class_to_shost(dev); adapter_t *adapter = (adapter_t *)SCSIHOST2ADAP(shost); uint32_t app_hndl;