GIT ace4e7185d565cab057139e8927659bd072bf25a master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git --- Index: Documentation/scsi/scsi_mid_low_api.txt =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/Documentation/scsi/scsi_mid_low_api.txt (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/Documentation/scsi/scsi_mid_low_api.txt (mode:100644) @@ -388,7 +388,6 @@ scsi_remove_device - detach and remove a SCSI device scsi_remove_host - detach and remove all SCSI devices owned by host scsi_report_bus_reset - report scsi _bus_ reset observed - scsi_set_device - place device reference in host structure scsi_track_queue_full - track successive QUEUE_FULL events scsi_unblock_requests - allow further commands to be queued to given host scsi_unregister - [calls scsi_host_put()] @@ -741,20 +740,6 @@ /** - * scsi_set_device - place device reference in host structure - * @shost: a pointer to a scsi host instance - * @pdev: pointer to device instance to assign - * - * Returns nothing - * - * Might block: no - * - * Defined in: include/scsi/scsi_host.h . - **/ -void scsi_set_device(struct Scsi_Host * shost, struct device * dev) - - -/** * scsi_track_queue_full - track successive QUEUE_FULL events on given * device to determine if and when there is a need * to adjust the queue depth on the device. Index: drivers/fc4/fc.c =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/fc4/fc.c (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/fc4/fc.c (mode:100644) @@ -365,6 +365,7 @@ kfree (fc->scsi_bitmap); kfree (fc->cmd_slots); FCND(("Unregistering\n")); +#if 0 if (fc->rst_pkt) { if (fc->rst_pkt->eh_state == SCSI_STATE_UNUSED) kfree(fc->rst_pkt); @@ -373,6 +374,7 @@ printk("FC: Reset in progress. Now?!"); } } +#endif FCND(("Unregistered\n")); } } else @@ -915,6 +917,7 @@ } } +#if 0 void fcp_scsi_reset_done(Scsi_Cmnd *SCpnt) { fc_channel *fc = FC_SCMND(SCpnt); @@ -922,11 +925,13 @@ fc->rst_pkt->eh_state = SCSI_STATE_FINISHED; up(fc->rst_pkt->device->host->eh_action); } +#endif #define FCP_RESET_TIMEOUT (2*HZ) int fcp_scsi_dev_reset(Scsi_Cmnd *SCpnt) { +#if 0 /* broken junk, but if davem wants to compile this driver, let him.. */ unsigned long flags; fcp_cmd *cmd; fcp_cmnd *fcmd; @@ -1000,6 +1005,7 @@ } fc->rst_pkt->eh_state = SCSI_STATE_UNUSED; return SUCCESS; +#endif } static int __fcp_scsi_host_reset(Scsi_Cmnd *SCpnt) Index: drivers/message/fusion/mptfc.c =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/message/fusion/mptfc.c (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/message/fusion/mptfc.c (mode:100644) @@ -83,19 +83,6 @@ static int mptfcTaskCtx = -1; static int mptfcInternalCtx = -1; /* Used only for internal commands */ -static struct device_attribute mptfc_queue_depth_attr = { - .attr = { - .name = "queue_depth", - .mode = S_IWUSR, - }, - .store = mptscsih_store_queue_depth, -}; - -static struct device_attribute *mptfc_dev_attrs[] = { - &mptfc_queue_depth_attr, - NULL, -}; - static struct scsi_host_template mptfc_driver_template = { .proc_name = "mptfc", .proc_info = mptscsih_proc_info, @@ -105,6 +92,7 @@ .slave_alloc = mptscsih_slave_alloc, .slave_configure = mptscsih_slave_configure, .slave_destroy = mptscsih_slave_destroy, + .change_queue_depth = mptscsih_change_queue_depth, .eh_abort_handler = mptscsih_abort, .eh_device_reset_handler = mptscsih_dev_reset, .eh_bus_reset_handler = mptscsih_bus_reset, @@ -116,7 +104,6 @@ .max_sectors = 8192, .cmd_per_lun = 7, .use_clustering = ENABLE_CLUSTERING, - .sdev_attrs = mptfc_dev_attrs, }; /**************************************************************************** @@ -267,10 +254,6 @@ sh->sg_tablesize = numSGE; } - /* Set the pci device pointer in Scsi_Host structure. - */ - scsi_set_device(sh, &ioc->pcidev->dev); - spin_unlock_irqrestore(&ioc->FreeQlock, flags); hd = (MPT_SCSI_HOST *) sh->hostdata; Index: drivers/message/fusion/mptscsih.c =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/message/fusion/mptscsih.c (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/message/fusion/mptscsih.c (mode:100644) @@ -2234,13 +2234,27 @@ } } -static void -mptscsih_set_queue_depth(struct scsi_device *device, MPT_SCSI_HOST *hd, - VirtDevice *pTarget, int qdepth) +/*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ +/* + * mptscsih_change_queue_depth - This function will set a devices queue depth + * @sdev: per scsi_device pointer + * @qdepth: requested queue depth + * + * Adding support for new 'change_queue_depth' api. +*/ +int +mptscsih_change_queue_depth(struct scsi_device *sdev, int qdepth) { + MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *)sdev->host->hostdata; + VirtDevice *pTarget; int max_depth; int tagged; + if (hd == NULL) + return 0; + if (!(pTarget = hd->Targets[sdev->id])) + return 0; + if (hd->ioc->bus_type == SCSI) { if (pTarget->tflags & MPT_TARGET_FLAGS_VALID_INQUIRY) { if (!(pTarget->tflags & MPT_TARGET_FLAGS_Q_YES)) @@ -2264,10 +2278,10 @@ else tagged = MSG_SIMPLE_TAG; - scsi_adjust_queue_depth(device, tagged, qdepth); + scsi_adjust_queue_depth(sdev, tagged, qdepth); + return sdev->queue_depth; } - /* * OS entry point to adjust the queue_depths on a per-device basis. * Called once per device the bus scan. Use it to force the queue_depth @@ -2317,7 +2331,7 @@ mptscsih_initTarget(hd, device->channel, device->id, device->lun, device->inquiry, device->inquiry_len ); - mptscsih_set_queue_depth(device, hd, pTarget, MPT_SCSI_CMD_PER_DEV_HIGH); + mptscsih_change_queue_depth(device, MPT_SCSI_CMD_PER_DEV_HIGH); dsprintk((MYIOC_s_INFO_FMT "Queue depth=%d, tflags=%x\n", @@ -2337,25 +2351,6 @@ return 0; } -ssize_t -mptscsih_store_queue_depth(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) -{ - int depth; - struct scsi_device *sdev = to_scsi_device(dev); - MPT_SCSI_HOST *hd = (MPT_SCSI_HOST *) sdev->host->hostdata; - VirtDevice *pTarget; - - depth = simple_strtoul(buf, NULL, 0); - if (depth == 0) - return -EINVAL; - pTarget = hd->Targets[sdev->id]; - if (pTarget == NULL) - return -EINVAL; - mptscsih_set_queue_depth(sdev, (MPT_SCSI_HOST *) sdev->host->hostdata, - pTarget, depth); - return count; -} - /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ /* * Private routines... @@ -5586,7 +5581,7 @@ EXPORT_SYMBOL(mptscsih_scandv_complete); EXPORT_SYMBOL(mptscsih_event_process); EXPORT_SYMBOL(mptscsih_ioc_reset); -EXPORT_SYMBOL(mptscsih_store_queue_depth); +EXPORT_SYMBOL(mptscsih_change_queue_depth); EXPORT_SYMBOL(mptscsih_timer_expired); /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/ Index: drivers/message/fusion/mptscsih.h =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/message/fusion/mptscsih.h (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/message/fusion/mptscsih.h (mode:100644) @@ -103,5 +103,5 @@ extern int mptscsih_scandv_complete(MPT_ADAPTER *ioc, MPT_FRAME_HDR *mf, MPT_FRAME_HDR *r); extern int mptscsih_event_process(MPT_ADAPTER *ioc, EventNotificationReply_t *pEvReply); extern int mptscsih_ioc_reset(MPT_ADAPTER *ioc, int post_reset); -extern ssize_t mptscsih_store_queue_depth(struct device *dev, struct device_attribute *attr, const char *buf, size_t count); +extern int mptscsih_change_queue_depth(struct scsi_device *sdev, int qdepth); extern void mptscsih_timer_expired(unsigned long data); Index: drivers/message/fusion/mptspi.c =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/message/fusion/mptspi.c (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/message/fusion/mptspi.c (mode:100644) @@ -102,19 +102,6 @@ static int mptspiTaskCtx = -1; static int mptspiInternalCtx = -1; /* Used only for internal commands */ -static struct device_attribute mptspi_queue_depth_attr = { - .attr = { - .name = "queue_depth", - .mode = S_IWUSR, - }, - .store = mptscsih_store_queue_depth, -}; - -static struct device_attribute *mptspi_dev_attrs[] = { - &mptspi_queue_depth_attr, - NULL, -}; - static struct scsi_host_template mptspi_driver_template = { .proc_name = "mptspi", .proc_info = mptscsih_proc_info, @@ -124,6 +111,7 @@ .slave_alloc = mptscsih_slave_alloc, .slave_configure = mptscsih_slave_configure, .slave_destroy = mptscsih_slave_destroy, + .change_queue_depth = mptscsih_change_queue_depth, .eh_abort_handler = mptscsih_abort, .eh_device_reset_handler = mptscsih_dev_reset, .eh_bus_reset_handler = mptscsih_bus_reset, @@ -135,7 +123,6 @@ .max_sectors = 8192, .cmd_per_lun = 7, .use_clustering = ENABLE_CLUSTERING, - .sdev_attrs = mptspi_dev_attrs, }; @@ -287,10 +274,6 @@ sh->sg_tablesize = numSGE; } - /* Set the pci device pointer in Scsi_Host structure. - */ - scsi_set_device(sh, &ioc->pcidev->dev); - spin_unlock_irqrestore(&ioc->FreeQlock, flags); hd = (MPT_SCSI_HOST *) sh->hostdata; Index: drivers/scsi/aacraid/README =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/aacraid/README (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/aacraid/README (mode:100644) @@ -13,6 +13,7 @@ Adaptec 2020S Adaptec 2025S Adaptec 2120S + Adaptec 2130S Adaptec 2200S Adaptec 2230S Adaptec 2240S @@ -35,6 +36,13 @@ HP NetRAID-4M Legend S220 Legend S230 + IBM ServeRAID 8i + ICP 9014R0 + ICP 9024R0 + ICP 9047MA + ICP 9087MA + ICP 9085LI + ICP 5085AU People ------------------------- Index: drivers/scsi/aacraid/TODO =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/aacraid/TODO (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/aacraid/TODO (mode:100644) @@ -1,6 +1,4 @@ o Testing o More testing -o Feature request: display the firmware/bios/etc revisions in the - /proc info o Drop irq_mask, basically unused o I/O size increase Index: drivers/scsi/aacraid/aachba.c =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/aacraid/aachba.c (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/aacraid/aachba.c (mode:100644) @@ -276,7 +276,6 @@ if (maximum_num_containers < MAXIMUM_NUM_CONTAINERS) maximum_num_containers = MAXIMUM_NUM_CONTAINERS; - fsa_dev_ptr = (struct fsa_dev_info *) kmalloc( sizeof(*fsa_dev_ptr) * maximum_num_containers, GFP_KERNEL); if (!fsa_dev_ptr) { @@ -527,6 +526,11 @@ "V-MIRRORS", "PSEUDO R4", "RAID50", + "RAID5D", + "RAID5D0", + "RAID1E", + "RAID6", + "RAID60", "Unknown" }; @@ -610,7 +614,9 @@ struct fib* fibptr; int rcode; u32 tmp; - struct aac_adapter_info * info; + struct aac_adapter_info *info; + struct aac_bus_info *command; + struct aac_bus_info_response *bus_info; if (!(fibptr = fib_alloc(dev))) return -ENOMEM; @@ -655,6 +661,36 @@ memcpy(&dev->supplement_adapter_info, info, sizeof(*info)); } + + /* + * GetBusInfo + */ + + fib_init(fibptr); + + bus_info = (struct aac_bus_info_response *) fib_data(fibptr); + + memset(bus_info, 0, sizeof(*bus_info)); + + command = (struct aac_bus_info *)bus_info; + + command->Command = cpu_to_le32(VM_Ioctl); + command->ObjType = cpu_to_le32(FT_DRIVE); + command->MethodId = cpu_to_le32(1); + command->CtlCmd = cpu_to_le32(GetBusInfo); + + rcode = fib_send(ContainerCommand, + fibptr, + sizeof (*bus_info), + FsaNormal, + 1, 1, + NULL, NULL); + + if (rcode >= 0 && le32_to_cpu(bus_info->Status) == ST_OK) { + dev->maximum_num_physicals = le32_to_cpu(bus_info->TargetsPerBus); + dev->maximum_num_channels = le32_to_cpu(bus_info->BusCount); + } + tmp = le32_to_cpu(dev->adapter_info.kernelrev); printk(KERN_INFO "%s%d: kernel %d.%d-%d[%d] %.*s\n", dev->name, @@ -1818,7 +1854,9 @@ u32 flag; u32 timeout; - if( scsicmd->device->id > 15 || scsicmd->device->lun > 7) { + dev = (struct aac_dev *)scsicmd->device->host->hostdata; + if (scsicmd->device->id >= dev->maximum_num_physicals || + scsicmd->device->lun > 7) { scsicmd->result = DID_NO_CONNECT << 16; scsicmd->scsi_done(scsicmd); return 0; Index: drivers/scsi/aacraid/aacraid.h =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/aacraid/aacraid.h (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/aacraid/aacraid.h (mode:100644) @@ -845,6 +845,28 @@ #define AAC_SIS_VERSION_V3 3 #define AAC_SIS_SLOT_UNKNOWN 0xFF +#define GetBusInfo 0x00000009 +struct aac_bus_info { + __le32 Command; /* VM_Ioctl */ + __le32 ObjType; /* FT_DRIVE */ + __le32 MethodId; /* 1 = SCSI Layer */ + __le32 ObjectId; /* Handle */ + __le32 CtlCmd; /* GetBusInfo */ +}; + +struct aac_bus_info_response { + __le32 Status; /* ST_OK */ + __le32 ObjType; + __le32 MethodId; /* unused */ + __le32 ObjectId; /* unused */ + __le32 CtlCmd; /* unused */ + __le32 ProbeComplete; + __le32 BusCount; + __le32 TargetsPerBus; + u8 InitiatorBusId[10]; + u8 BusValid[10]; +}; + /* * Battery platforms */ @@ -934,6 +956,8 @@ struct Scsi_Host *scsi_host_ptr; int maximum_num_containers; + int maximum_num_physicals; + int maximum_num_channels; struct fsa_dev_info *fsa_dev; pid_t thread_pid; int cardtype; Index: drivers/scsi/aacraid/linit.c =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/aacraid/linit.c (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/aacraid/linit.c (mode:100644) @@ -102,32 +102,43 @@ { 0x9005, 0x0286, 0x9005, 0x029b, 0, 0, 22 }, /* AAR-2820SA (Intruder) */ { 0x9005, 0x0286, 0x9005, 0x029c, 0, 0, 23 }, /* AAR-2620SA (Intruder) */ { 0x9005, 0x0286, 0x9005, 0x029d, 0, 0, 24 }, /* AAR-2420SA (Intruder) */ - { 0x9005, 0x0286, 0x9005, 0x0800, 0, 0, 25 }, /* Callisto Jupiter Platform */ - { 0x9005, 0x0285, 0x9005, 0x028e, 0, 0, 26 }, /* ASR-2020SA SATA PCI-X ZCR (Skyhawk) */ - { 0x9005, 0x0285, 0x9005, 0x028f, 0, 0, 27 }, /* ASR-2025SA SATA SO-DIMM PCI-X ZCR (Terminator) */ - { 0x9005, 0x0285, 0x9005, 0x0290, 0, 0, 28 }, /* AAR-2410SA PCI SATA 4ch (Jaguar II) */ - { 0x9005, 0x0285, 0x1028, 0x0291, 0, 0, 29 }, /* CERC SATA RAID 2 PCI SATA 6ch (DellCorsair) */ - { 0x9005, 0x0285, 0x9005, 0x0292, 0, 0, 30 }, /* AAR-2810SA PCI SATA 8ch (Corsair-8) */ - { 0x9005, 0x0285, 0x9005, 0x0293, 0, 0, 31 }, /* AAR-21610SA PCI SATA 16ch (Corsair-16) */ - { 0x9005, 0x0285, 0x9005, 0x0294, 0, 0, 32 }, /* ESD SO-DIMM PCI-X SATA ZCR (Prowler) */ - { 0x9005, 0x0285, 0x103C, 0x3227, 0, 0, 33 }, /* AAR-2610SA PCI SATA 6ch */ - { 0x9005, 0x0285, 0x9005, 0x0296, 0, 0, 34 }, /* ASR-2240S (SabreExpress) */ - { 0x9005, 0x0285, 0x9005, 0x0297, 0, 0, 35 }, /* ASR-4005SAS */ - { 0x9005, 0x0285, 0x1014, 0x02F2, 0, 0, 36 }, /* IBM 8i (AvonPark) */ - { 0x9005, 0x0285, 0x9005, 0x0298, 0, 0, 37 }, /* ASR-4000SAS (BlackBird) */ - { 0x9005, 0x0285, 0x9005, 0x0299, 0, 0, 38 }, /* ASR-4800SAS (Marauder-X) */ - { 0x9005, 0x0285, 0x9005, 0x029A, 0, 0, 39 }, /* ASR-4805SAS (Marauder-E) */ - - { 0x9005, 0x0285, 0x1028, 0x0287, 0, 0, 40 }, /* Perc 320/DC*/ - { 0x1011, 0x0046, 0x9005, 0x0365, 0, 0, 41 }, /* Adaptec 5400S (Mustang)*/ - { 0x1011, 0x0046, 0x9005, 0x0364, 0, 0, 42 }, /* Adaptec 5400S (Mustang)*/ - { 0x1011, 0x0046, 0x9005, 0x1364, 0, 0, 43 }, /* Dell PERC2/QC */ - { 0x1011, 0x0046, 0x103c, 0x10c2, 0, 0, 44 }, /* HP NetRAID-4M */ - - { 0x9005, 0x0285, 0x1028, PCI_ANY_ID, 0, 0, 45 }, /* Dell Catchall */ - { 0x9005, 0x0285, 0x17aa, PCI_ANY_ID, 0, 0, 46 }, /* Legend Catchall */ - { 0x9005, 0x0285, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 47 }, /* Adaptec Catch All */ - { 0x9005, 0x0286, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 48 }, /* Adaptec Rocket Catch All */ + { 0x9005, 0x0286, 0x9005, 0x029e, 0, 0, 25 }, /* ICP9024R0 (Lancer) */ + { 0x9005, 0x0286, 0x9005, 0x029f, 0, 0, 26 }, /* ICP9014R0 (Lancer) */ + { 0x9005, 0x0286, 0x9005, 0x02a0, 0, 0, 27 }, /* ICP9047MA (Lancer) */ + { 0x9005, 0x0286, 0x9005, 0x02a1, 0, 0, 28 }, /* ICP9087MA (Lancer) */ + { 0x9005, 0x0286, 0x9005, 0x02a3, 0, 0, 29 }, /* ICP5085AU (Hurricane) */ + { 0x9005, 0x0285, 0x9005, 0x02a4, 0, 0, 30 }, /* ICP9085LI (Marauder-X) */ + { 0x9005, 0x0285, 0x9005, 0x02a5, 0, 0, 31 }, /* ICP5085BR (Marauder-E) */ + { 0x9005, 0x0287, 0x9005, 0x0800, 0, 0, 32 }, /* Themisto Jupiter Platform */ + { 0x9005, 0x0200, 0x9005, 0x0200, 0, 0, 32 }, /* Themisto Jupiter Platform */ + { 0x9005, 0x0286, 0x9005, 0x0800, 0, 0, 33 }, /* Callisto Jupiter Platform */ + { 0x9005, 0x0285, 0x9005, 0x028e, 0, 0, 34 }, /* ASR-2020SA SATA PCI-X ZCR (Skyhawk) */ + { 0x9005, 0x0285, 0x9005, 0x028f, 0, 0, 35 }, /* ASR-2025SA SATA SO-DIMM PCI-X ZCR (Terminator) */ + { 0x9005, 0x0285, 0x9005, 0x0290, 0, 0, 36 }, /* AAR-2410SA PCI SATA 4ch (Jaguar II) */ + { 0x9005, 0x0285, 0x1028, 0x0291, 0, 0, 37 }, /* CERC SATA RAID 2 PCI SATA 6ch (DellCorsair) */ + { 0x9005, 0x0285, 0x9005, 0x0292, 0, 0, 38 }, /* AAR-2810SA PCI SATA 8ch (Corsair-8) */ + { 0x9005, 0x0285, 0x9005, 0x0293, 0, 0, 39 }, /* AAR-21610SA PCI SATA 16ch (Corsair-16) */ + { 0x9005, 0x0285, 0x9005, 0x0294, 0, 0, 40 }, /* ESD SO-DIMM PCI-X SATA ZCR (Prowler) */ + { 0x9005, 0x0285, 0x103C, 0x3227, 0, 0, 41 }, /* AAR-2610SA PCI SATA 6ch */ + { 0x9005, 0x0285, 0x9005, 0x0296, 0, 0, 42 }, /* ASR-2240S (SabreExpress) */ + { 0x9005, 0x0285, 0x9005, 0x0297, 0, 0, 43 }, /* ASR-4005SAS */ + { 0x9005, 0x0285, 0x1014, 0x02F2, 0, 0, 44 }, /* IBM 8i (AvonPark) */ + { 0x9005, 0x0285, 0x1014, 0x0312, 0, 0, 44 }, /* IBM 8i (AvonPark Lite) */ + { 0x9005, 0x0285, 0x9005, 0x0298, 0, 0, 45 }, /* ASR-4000SAS (BlackBird) */ + { 0x9005, 0x0285, 0x9005, 0x0299, 0, 0, 46 }, /* ASR-4800SAS (Marauder-X) */ + { 0x9005, 0x0285, 0x9005, 0x029a, 0, 0, 47 }, /* ASR-4805SAS (Marauder-E) */ + { 0x9005, 0x0286, 0x9005, 0x02a2, 0, 0, 48 }, /* ASR-4810SAS (Hurricane */ + + { 0x9005, 0x0285, 0x1028, 0x0287, 0, 0, 49 }, /* Perc 320/DC*/ + { 0x1011, 0x0046, 0x9005, 0x0365, 0, 0, 50 }, /* Adaptec 5400S (Mustang)*/ + { 0x1011, 0x0046, 0x9005, 0x0364, 0, 0, 51 }, /* Adaptec 5400S (Mustang)*/ + { 0x1011, 0x0046, 0x9005, 0x1364, 0, 0, 52 }, /* Dell PERC2/QC */ + { 0x1011, 0x0046, 0x103c, 0x10c2, 0, 0, 53 }, /* HP NetRAID-4M */ + + { 0x9005, 0x0285, 0x1028, PCI_ANY_ID, 0, 0, 54 }, /* Dell Catchall */ + { 0x9005, 0x0285, 0x17aa, PCI_ANY_ID, 0, 0, 55 }, /* Legend Catchall */ + { 0x9005, 0x0285, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 56 }, /* Adaptec Catch All */ + { 0x9005, 0x0286, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 57 }, /* Adaptec Rocket Catch All */ { 0,} }; MODULE_DEVICE_TABLE(pci, aac_pci_tbl); @@ -164,6 +175,14 @@ { aac_rkt_init, "aacraid", "ADAPTEC ", "AAR-2820SA ", 1 }, /* AAR-2820SA (Intruder) */ { aac_rkt_init, "aacraid", "ADAPTEC ", "AAR-2620SA ", 1 }, /* AAR-2620SA (Intruder) */ { aac_rkt_init, "aacraid", "ADAPTEC ", "AAR-2420SA ", 1 }, /* AAR-2420SA (Intruder) */ + { aac_rkt_init, "aacraid", "ICP ", "ICP9024R0 ", 2 }, /* ICP9024R0 (Lancer) */ + { aac_rkt_init, "aacraid", "ICP ", "ICP9014R0 ", 1 }, /* ICP9014R0 (Lancer) */ + { aac_rkt_init, "aacraid", "ICP ", "ICP9047MA ", 1 }, /* ICP9047MA (Lancer) */ + { aac_rkt_init, "aacraid", "ICP ", "ICP9087MA ", 1 }, /* ICP9087MA (Lancer) */ + { aac_rkt_init, "aacraid", "ICP ", "ICP5085AU ", 1 }, /* ICP5085AU (Hurricane) */ + { aac_rkt_init, "aacraid", "ICP ", "ICP9085LI ", 1 }, /* ICP9085LI (Marauder-X) */ + { aac_rkt_init, "aacraid", "ICP ", "ICP5085BR ", 1 }, /* ICP5085BR (Marauder-E) */ + { NULL , "aacraid", "ADAPTEC ", "Themisto ", 0, AAC_QUIRK_SLAVE }, /* Jupiter Platform */ { aac_rkt_init, "aacraid", "ADAPTEC ", "Callisto ", 2, AAC_QUIRK_MASTER }, /* Jupiter Platform */ { aac_rx_init, "aacraid", "ADAPTEC ", "ASR-2020SA ", 1 }, /* ASR-2020SA SATA PCI-X ZCR (Skyhawk) */ { aac_rx_init, "aacraid", "ADAPTEC ", "ASR-2025SA ", 1 }, /* ASR-2025SA SATA SO-DIMM PCI-X ZCR (Terminator) */ @@ -175,10 +194,11 @@ { aac_rx_init, "aacraid", "ADAPTEC ", "AAR-2610SA ", 1 }, /* SATA 6Ch (Bearcat) */ { aac_rx_init, "aacraid", "ADAPTEC ", "ASR-2240S ", 1 }, /* ASR-2240S (SabreExpress) */ { aac_rx_init, "aacraid", "ADAPTEC ", "ASR-4005SAS ", 1 }, /* ASR-4005SAS */ - { aac_rx_init, "aacraid", "IBM ", "ServeRAID 8i ", 1 }, /* IBM 8i (AvonPark) */ + { aac_rx_init, "ServeRAID","IBM ", "ServeRAID 8i ", 1 }, /* IBM 8i (AvonPark) */ { aac_rx_init, "aacraid", "ADAPTEC ", "ASR-4000SAS ", 1 }, /* ASR-4000SAS (BlackBird & AvonPark) */ { aac_rx_init, "aacraid", "ADAPTEC ", "ASR-4800SAS ", 1 }, /* ASR-4800SAS (Marauder-X) */ { aac_rx_init, "aacraid", "ADAPTEC ", "ASR-4805SAS ", 1 }, /* ASR-4805SAS (Marauder-E) */ + { aac_rx_init, "aacraid", "ADAPTEC ", "ASR-4810SAS ", 1 }, /* ASR-4810SAS (Hurricane) */ { aac_rx_init, "percraid", "DELL ", "PERC 320/DC ", 2, AAC_QUIRK_31BIT | AAC_QUIRK_34SG }, /* Perc 320/DC*/ { aac_sa_init, "aacraid", "ADAPTEC ", "Adaptec 5400S ", 4, AAC_QUIRK_34SG }, /* Adaptec 5400S (Mustang)*/ @@ -681,7 +701,7 @@ .slave_configure = aac_slave_configure, .eh_host_reset_handler = aac_eh_reset, .can_queue = AAC_NUM_IO_FIB, - .this_id = 16, + .this_id = MAXIMUM_NUM_CONTAINERS, .sg_tablesize = 16, .max_sectors = 128, #if (AAC_NUM_IO_FIB > 256) @@ -760,6 +780,7 @@ if (pci_set_dma_mask(pdev, 0xFFFFFFFFULL)) goto out_free_fibs; + aac->maximum_num_channels = aac_drivers[index].channels; aac_get_adapter_info(aac); /* @@ -786,7 +807,7 @@ * physical channels are address by their actual physical number+1 */ if (aac->nondasd_support == 1) - shost->max_channel = aac_drivers[index].channels+1; + shost->max_channel = aac->maximum_num_channels + 1; else shost->max_channel = 1; @@ -795,6 +816,8 @@ list_add(&aac->entry, insert); shost->max_id = aac->maximum_num_containers; + if (shost->max_id < aac->maximum_num_physicals) + shost->max_id = aac->maximum_num_physicals; if (shost->max_id < MAXIMUM_NUM_CONTAINERS) shost->max_id = MAXIMUM_NUM_CONTAINERS; else Index: drivers/scsi/advansys.c =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/advansys.c (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/advansys.c (mode:100644) @@ -4556,8 +4556,6 @@ continue; } - scsi_set_device(shp, dev); - /* Save a pointer to the Scsi_Host of each board found. */ asc_host[asc_board_count++] = shp; @@ -9194,8 +9192,8 @@ s->sc_data_direction, s->resid); printk( -" use_sg %u, sglist_len %u, abort_reason 0x%x\n", - s->use_sg, s->sglist_len, s->abort_reason); +" use_sg %u, sglist_len %u\n", + s->use_sg, s->sglist_len); printk( " serial_number 0x%x, retries %d, allowed %d\n", Index: drivers/scsi/aic7xxx/aic7xxx_osm.c =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/aic7xxx/aic7xxx_osm.c (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/aic7xxx/aic7xxx_osm.c (mode:100644) @@ -2633,6 +2633,11 @@ ahc_unlock(ahc, &flags); } +#if 0 +/* FIXME: This code claims to support IU and QAS. However, the actual + * sequencer code and aic7xxx_core have no support for these parameters and + * will get into a bad state if they're negotiated. Do not enable this + * unless you know what you're doing */ static void ahc_linux_set_qas(struct scsi_target *starget, int qas) { struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); @@ -2688,6 +2693,7 @@ ppr_options, AHC_TRANS_GOAL, FALSE); ahc_unlock(ahc, &flags); } +#endif static struct spi_function_template ahc_linux_transport_functions = { .set_offset = ahc_linux_set_offset, @@ -2698,10 +2704,12 @@ .show_width = 1, .set_dt = ahc_linux_set_dt, .show_dt = 1, +#if 0 .set_iu = ahc_linux_set_iu, .show_iu = 1, .set_qas = ahc_linux_set_qas, .show_qas = 1, +#endif }; Index: drivers/scsi/aic7xxx/aic7xxx_proc.c =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/aic7xxx/aic7xxx_proc.c (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/aic7xxx/aic7xxx_proc.c (mode:100644) @@ -155,9 +155,9 @@ copy_info(info, "\tUser: "); ahc_format_transinfo(info, &tinfo->user); starget = ahc->platform_data->starget[target_offset]; - targ = scsi_transport_target_data(starget); - if (targ == NULL) + if (!starget) return; + targ = scsi_transport_target_data(starget); copy_info(info, "\tGoal: "); ahc_format_transinfo(info, &tinfo->goal); Index: drivers/scsi/aic7xxx_old.c =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/aic7xxx_old.c (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/aic7xxx_old.c (mode:100644) @@ -8448,7 +8448,6 @@ } p->host_no = host->host_no; } - scsi_set_device(host, &p->pdev->dev); return (p); } Index: drivers/scsi/cpqfcTSinit.c =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/cpqfcTSinit.c (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/cpqfcTSinit.c (mode:100644) @@ -336,7 +336,6 @@ DEBUG_PCI(printk(" PciDev->baseaddress[3]= %lx\n", PciDev->resource[3].start)); - scsi_set_device(HostAdapter, &PciDev->dev); HostAdapter->irq = PciDev->irq; // copy for Scsi layers // HP Tachlite uses two (255-byte) ranges of Port I/O (lower & upper), Index: drivers/scsi/dpt_i2o.c =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/dpt_i2o.c (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/dpt_i2o.c (mode:100644) @@ -418,11 +418,6 @@ return 1; } - if(cmd->eh_state != SCSI_STATE_QUEUED){ - // If we are not doing error recovery - mod_timer(&cmd->eh_timeout, timeout); - } - // TODO if the cmd->device if offline then I may need to issue a bus rescan // followed by a get_lct to see if the device is there anymore if((pDev = (struct adpt_device*) (cmd->device->hostdata)) == NULL) { Index: drivers/scsi/eata.c =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/eata.c (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/eata.c (mode:100644) @@ -1899,16 +1899,6 @@ printk("%s: abort, mbox %d, interrupt pending.\n", ha->board_name, i); - if (SCarg->eh_state == SCSI_STATE_TIMEOUT) { - unmap_dma(i, ha); - SCarg->host_scribble = NULL; - ha->cp_stat[i] = FREE; - printk - ("%s, abort, mbox %d, eh_state timeout, pid %ld.\n", - ha->board_name, i, SCarg->pid); - return SUCCESS; - } - return FAILED; } Index: drivers/scsi/eata_pio.c =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/eata_pio.c (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/eata_pio.c (mode:100644) @@ -449,7 +449,7 @@ { uint loop = HZ; - DBG(DBG_ABNORM, printk(KERN_WARNING "eata_pio_abort called pid: %ld " "target: %x lun: %x reason %x\n", cmd->pid, cmd->device->id, cmd->device->lun, cmd->abort_reason)); + DBG(DBG_ABNORM, printk(KERN_WARNING "eata_pio_abort called pid: %ld " "target: %x lun: %x\n", cmd->pid, cmd->device->id, cmd->device->lun)); while (inb(cmd->device->host->base + HA_RAUXSTAT) & HA_ABUSY) @@ -484,7 +484,7 @@ struct scsi_cmnd *sp; struct Scsi_Host *host = cmd->device->host; - DBG(DBG_ABNORM, printk(KERN_WARNING "eata_pio_reset called pid:%ld target:" " %x lun: %x reason %x\n", cmd->pid, cmd->device->id, cmd->device->lun, cmd->abort_reason)); + DBG(DBG_ABNORM, printk(KERN_WARNING "eata_pio_reset called pid:%ld target:" " %x lun: %x\n", cmd->pid, cmd->device->id, cmd->device->lun)); spin_lock_irq(host->host_lock); Index: drivers/scsi/fdomain.c =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/fdomain.c (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/fdomain.c (mode:100644) @@ -938,7 +938,6 @@ } shpnt->irq = interrupt_level; shpnt->io_port = port_base; - scsi_set_device(shpnt, &pdev->dev); shpnt->n_io_port = 0x10; print_banner( shpnt ); Index: drivers/scsi/gdth.c =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/gdth.c (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/gdth.c (mode:100644) @@ -4521,9 +4521,7 @@ ha->virt_bus = hdr_channel; -#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) - scsi_set_device(shp, &pcistr[ctr].pdev->dev); -#else +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,0) scsi_set_pci_device(shp, pcistr[ctr].pdev); #endif if (!(ha->cache_feat & ha->raw_feat & ha->screen_feat &GDT_64BIT)|| Index: drivers/scsi/hosts.c =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/hosts.c (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/hosts.c (mode:100644) @@ -180,11 +180,6 @@ scsi_destroy_command_freelist(shost); kfree(shost->shost_data); - /* - * Some drivers (eg aha1542) do scsi_register()/scsi_unregister() - * during probing without performing a scsi_set_device() in between. - * In this case dev->parent is NULL. - */ if (parent) put_device(parent); kfree(shost); Index: drivers/scsi/ibmvscsi/ibmvscsi.c =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/ibmvscsi/ibmvscsi.c (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/ibmvscsi/ibmvscsi.c (mode:100644) @@ -87,7 +87,7 @@ static int init_timeout = 5; static int max_requests = 50; -#define IBMVSCSI_VERSION "1.5.5" +#define IBMVSCSI_VERSION "1.5.6" MODULE_DESCRIPTION("IBM Virtual SCSI"); MODULE_AUTHOR("Dave Boutcher"); @@ -675,8 +675,6 @@ struct viosrp_adapter_info *req; struct srp_event_struct *evt_struct; - memset(&hostdata->madapter_info, 0x00, sizeof(hostdata->madapter_info)); - evt_struct = get_event_struct(&hostdata->pool); if (!evt_struct) { printk(KERN_ERR "ibmvscsi: couldn't allocate an event " Index: drivers/scsi/ibmvscsi/rpa_vscsi.c =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/ibmvscsi/rpa_vscsi.c (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/ibmvscsi/rpa_vscsi.c (mode:100644) @@ -33,6 +33,10 @@ #include #include #include "ibmvscsi.h" +#include "srp.h" + +static char partition_name[97] = "UNKNOWN"; +static unsigned int partition_number = -1; /* ------------------------------------------------------------ * Routines for managing the command/response queue @@ -148,6 +152,48 @@ } } +static void gather_partition_info(void) +{ + struct device_node *rootdn; + + char *ppartition_name; + unsigned int *p_number_ptr; + + /* Retrieve information about this partition */ + rootdn = find_path_device("/"); + if (!rootdn) { + return; + } + + ppartition_name = + get_property(rootdn, "ibm,partition-name", NULL); + if (ppartition_name) + strncpy(partition_name, ppartition_name, + sizeof(partition_name)); + p_number_ptr = + (unsigned int *)get_property(rootdn, "ibm,partition-no", + NULL); + if (p_number_ptr) + partition_number = *p_number_ptr; +} + +static void set_adapter_info(struct ibmvscsi_host_data *hostdata) +{ + memset(&hostdata->madapter_info, 0x00, + sizeof(hostdata->madapter_info)); + + printk(KERN_INFO "rpa_vscsi: SPR_VERSION: %s\n", SRP_VERSION); + strcpy(hostdata->madapter_info.srp_version, SRP_VERSION); + + strncpy(hostdata->madapter_info.partition_name, partition_name, + sizeof(hostdata->madapter_info.partition_name)); + + hostdata->madapter_info.partition_number = partition_number; + + hostdata->madapter_info.mad_version = 1; + hostdata->madapter_info.os_type = 2; +} + /** * initialize_crq_queue: - Initializes and registers CRQ with hypervisor * @queue: crq_queue to initialize and register @@ -177,6 +223,9 @@ if (dma_mapping_error(queue->msg_token)) goto map_failed; + gather_partition_info(); + set_adapter_info(hostdata); + rc = plpar_hcall_norets(H_REG_CRQ, vdev->unit_address, queue->msg_token, PAGE_SIZE); @@ -246,6 +295,8 @@ memset(queue->msgs, 0x00, PAGE_SIZE); queue->cur = 0; + set_adapter_info(hostdata); + /* And re-open it again */ rc = plpar_hcall_norets(H_REG_CRQ, vdev->unit_address, Index: drivers/scsi/ibmvscsi/srp.h =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/ibmvscsi/srp.h (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/ibmvscsi/srp.h (mode:100644) @@ -28,6 +28,8 @@ #ifndef SRP_H #define SRP_H +#define SRP_VERSION "16.a" + #define PACKED __attribute__((packed)) enum srp_types { Index: drivers/scsi/ips.h =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/ips.h (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/ips.h (mode:100644) @@ -111,7 +111,7 @@ #define IPS_UNREGISTER_HOSTS(SHT) #define IPS_ADD_HOST(shost,device) do { scsi_add_host(shost,device); scsi_scan_host(shost); } while (0) #define IPS_REMOVE_HOST(shost) scsi_remove_host(shost) - #define IPS_SCSI_SET_DEVICE(sh,ha) scsi_set_device(sh, &(ha)->pcidev->dev) + #define IPS_SCSI_SET_DEVICE(sh,ha) do { } while (0) #define IPS_PRINTK(level, pcidev, format, arg...) \ dev_printk(level , &((pcidev)->dev) , format , ## arg) #endif Index: drivers/scsi/libata-core.c =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/libata-core.c (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/libata-core.c (mode:100644) @@ -2864,7 +2864,7 @@ if (qc->dev->class == ATA_DEV_ATAPI && qc->scsicmd) { struct scsi_cmnd *cmd = qc->scsicmd; - if (!scsi_eh_eflags_chk(cmd, SCSI_EH_CANCEL_CMD)) { + if (!(cmd->eh_eflags & SCSI_EH_CANCEL_CMD)) { /* finish completing original command */ __ata_qc_complete(qc); @@ -3748,7 +3748,7 @@ host->max_channel = 1; host->unique_id = ata_unique_id++; host->max_cmd_len = 12; - scsi_set_device(host, ent->dev); + scsi_assign_lock(host, &host_set->lock); ap->flags = ATA_FLAG_PORT_DISABLED; Index: drivers/scsi/lpfc/Makefile =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/lpfc/Makefile (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/lpfc/Makefile (mode:100644) @@ -1,26 +1,24 @@ #/******************************************************************* # * This file is part of the Emulex Linux Device Driver for * -# * Enterprise Fibre Channel Host Bus Adapters. * -# * Refer to the README file included with this package for * -# * driver version and adapter support. * -# * Copyright (C) 2004 Emulex Corporation. * +# * Fibre Channel Host Bus Adapters. * +# * Copyright (C) 2004-2005 Emulex. All rights reserved. * +# * EMULEX and SLI are trademarks of Emulex. * # * www.emulex.com * # * * # * This program is free software; you can redistribute it and/or * -# * modify it under the terms of the GNU General Public License * -# * as published by the Free Software Foundation; either version 2 * -# * of the License, or (at your option) any later version. * -# * * -# * This program is distributed in the hope that it will be useful, * -# * but WITHOUT ANY WARRANTY; without even the implied warranty of * -# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * -# * GNU General Public License for more details, a copy of which * -# * can be found in the file COPYING included with this package. * +# * modify it under the terms of version 2 of the GNU General * +# * Public License as published by the Free Software Foundation. * +# * This program is distributed in the hope that it will be useful. * +# * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND * +# * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, * +# * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE * +# * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD * +# * TO BE LEGALLY INVALID. See the GNU General Public License for * +# * more details, a copy of which can be found in the file COPYING * +# * included with this package. * # *******************************************************************/ ###################################################################### -#$Id: Makefile 1.58 2005/01/23 19:00:32EST sf_support Exp $ - ifneq ($(GCOV),) EXTRA_CFLAGS += -fprofile-arcs -ftest-coverage EXTRA_CFLAGS += -O0 Index: drivers/scsi/lpfc/lpfc.h =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/lpfc/lpfc.h (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/lpfc/lpfc.h (mode:100644) @@ -1,27 +1,24 @@ /******************************************************************* * This file is part of the Emulex Linux Device Driver for * - * Enterprise Fibre Channel Host Bus Adapters. * - * Refer to the README file included with this package for * - * driver version and adapter support. * - * Copyright (C) 2004 Emulex Corporation. * + * Fibre Channel Host Bus Adapters. * + * Copyright (C) 2004-2005 Emulex. All rights reserved. * + * EMULEX and SLI are trademarks of Emulex. * * www.emulex.com * + * Portions Copyright (C) 2004-2005 Christoph Hellwig * * * * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License * - * as published by the Free Software Foundation; either version 2 * - * of the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details, a copy of which * - * can be found in the file COPYING included with this package. * + * modify it under the terms of version 2 of the GNU General * + * Public License as published by the Free Software Foundation. * + * This program is distributed in the hope that it will be useful. * + * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND * + * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, * + * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE * + * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD * + * TO BE LEGALLY INVALID. See the GNU General Public License for * + * more details, a copy of which can be found in the file COPYING * + * included with this package. * *******************************************************************/ -/* - * $Id: lpfc.h 1.167 2005/04/07 08:47:05EDT sf_support Exp $ - */ - struct lpfc_sli2_slim; #define LPFC_MAX_TARGET 256 /* max targets supported */ Index: drivers/scsi/lpfc/lpfc_attr.c =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/lpfc/lpfc_attr.c (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/lpfc/lpfc_attr.c (mode:100644) @@ -1,27 +1,24 @@ /******************************************************************* * This file is part of the Emulex Linux Device Driver for * - * Enterprise Fibre Channel Host Bus Adapters. * - * Refer to the README file included with this package for * - * driver version and adapter support. * - * Copyright (C) 2004 Emulex Corporation. * + * Fibre Channel Host Bus Adapters. * + * Copyright (C) 2004-2005 Emulex. All rights reserved. * + * EMULEX and SLI are trademarks of Emulex. * * www.emulex.com * + * Portions Copyright (C) 2004-2005 Christoph Hellwig * * * * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License * - * as published by the Free Software Foundation; either version 2 * - * of the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details, a copy of which * - * can be found in the file COPYING included with this package. * + * modify it under the terms of version 2 of the GNU General * + * Public License as published by the Free Software Foundation. * + * This program is distributed in the hope that it will be useful. * + * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND * + * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, * + * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE * + * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD * + * TO BE LEGALLY INVALID. See the GNU General Public License for * + * more details, a copy of which can be found in the file COPYING * + * included with this package. * *******************************************************************/ -/* - * $Id: lpfc_attr.c 1.24 2005/04/13 11:58:55EDT sf_support Exp $ - */ - #include #include #include Index: drivers/scsi/lpfc/lpfc_compat.h =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/lpfc/lpfc_compat.h (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/lpfc/lpfc_compat.h (mode:100644) @@ -1,26 +1,24 @@ /******************************************************************* * This file is part of the Emulex Linux Device Driver for * - * Enterprise Fibre Channel Host Bus Adapters. * - * Refer to the README file included with this package for * - * driver version and adapter support. * - * Copyright (C) 2004 Emulex Corporation. * + * Fibre Channel Host Bus Adapters. * + * Copyright (C) 2004-2005 Emulex. All rights reserved. * + * EMULEX and SLI are trademarks of Emulex. * * www.emulex.com * * * * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License * - * as published by the Free Software Foundation; either version 2 * - * of the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details, a copy of which * - * can be found in the file COPYING included with this package. * + * modify it under the terms of version 2 of the GNU General * + * Public License as published by the Free Software Foundation. * + * This program is distributed in the hope that it will be useful. * + * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND * + * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, * + * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE * + * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD * + * TO BE LEGALLY INVALID. See the GNU General Public License for * + * more details, a copy of which can be found in the file COPYING * + * included with this package. * *******************************************************************/ /* - * $Id: lpfc_compat.h 1.32 2005/01/25 17:51:45EST sf_support Exp $ - * * This file provides macros to aid compilation in the Linux 2.4 kernel * over various platform architectures. */ Index: drivers/scsi/lpfc/lpfc_crtn.h =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/lpfc/lpfc_crtn.h (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/lpfc/lpfc_crtn.h (mode:100644) @@ -1,27 +1,23 @@ /******************************************************************* * This file is part of the Emulex Linux Device Driver for * - * Enterprise Fibre Channel Host Bus Adapters. * - * Refer to the README file included with this package for * - * driver version and adapter support. * - * Copyright (C) 2004 Emulex Corporation. * + * Fibre Channel Host Bus Adapters. * + * Copyright (C) 2004-2005 Emulex. All rights reserved. * + * EMULEX and SLI are trademarks of Emulex. * * www.emulex.com * * * * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License * - * as published by the Free Software Foundation; either version 2 * - * of the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details, a copy of which * - * can be found in the file COPYING included with this package. * + * modify it under the terms of version 2 of the GNU General * + * Public License as published by the Free Software Foundation. * + * This program is distributed in the hope that it will be useful. * + * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND * + * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, * + * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE * + * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD * + * TO BE LEGALLY INVALID. See the GNU General Public License for * + * more details, a copy of which can be found in the file COPYING * + * included with this package. * *******************************************************************/ -/* - * $Id: lpfc_crtn.h 1.166 2005/04/07 08:46:47EDT sf_support Exp $ - */ - void lpfc_dump_mem(struct lpfc_hba *, LPFC_MBOXQ_t *, uint16_t); void lpfc_read_nv(struct lpfc_hba *, LPFC_MBOXQ_t *); int lpfc_read_la(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmb, @@ -195,6 +191,9 @@ void lpfc_sli_wake_iocb_high_priority(struct lpfc_hba * phba, struct lpfc_iocbq * queue1, struct lpfc_iocbq * queue2); +void lpfc_sli_abort_fcp_cmpl(struct lpfc_hba * phba, + struct lpfc_iocbq * cmdiocb, + struct lpfc_iocbq * rspiocb); void *lpfc_mbuf_alloc(struct lpfc_hba *, int, dma_addr_t *); void lpfc_mbuf_free(struct lpfc_hba *, void *, dma_addr_t); Index: drivers/scsi/lpfc/lpfc_ct.c =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/lpfc/lpfc_ct.c (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/lpfc/lpfc_ct.c (mode:100644) @@ -1,26 +1,24 @@ /******************************************************************* * This file is part of the Emulex Linux Device Driver for * - * Enterprise Fibre Channel Host Bus Adapters. * - * Refer to the README file included with this package for * - * driver version and adapter support. * - * Copyright (C) 2004 Emulex Corporation. * + * Fibre Channel Host Bus Adapters. * + * Copyright (C) 2004-2005 Emulex. All rights reserved. * + * EMULEX and SLI are trademarks of Emulex. * * www.emulex.com * * * * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License * - * as published by the Free Software Foundation; either version 2 * - * of the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details, a copy of which * - * can be found in the file COPYING included with this package. * + * modify it under the terms of version 2 of the GNU General * + * Public License as published by the Free Software Foundation. * + * This program is distributed in the hope that it will be useful. * + * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND * + * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, * + * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE * + * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD * + * TO BE LEGALLY INVALID. See the GNU General Public License for * + * more details, a copy of which can be found in the file COPYING * + * included with this package. * *******************************************************************/ /* - * $Id: lpfc_ct.c 1.161 2005/04/13 11:59:01EDT sf_support Exp $ - * * Fibre Channel SCSI LAN Device Driver CT support */ Index: drivers/scsi/lpfc/lpfc_disc.h =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/lpfc/lpfc_disc.h (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/lpfc/lpfc_disc.h (mode:100644) @@ -1,27 +1,23 @@ /******************************************************************* * This file is part of the Emulex Linux Device Driver for * - * Enterprise Fibre Channel Host Bus Adapters. * - * Refer to the README file included with this package for * - * driver version and adapter support. * - * Copyright (C) 2004 Emulex Corporation. * + * Fibre Channel Host Bus Adapters. * + * Copyright (C) 2004-2005 Emulex. All rights reserved. * + * EMULEX and SLI are trademarks of Emulex. * * www.emulex.com * * * * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License * - * as published by the Free Software Foundation; either version 2 * - * of the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details, a copy of which * - * can be found in the file COPYING included with this package. * + * modify it under the terms of version 2 of the GNU General * + * Public License as published by the Free Software Foundation. * + * This program is distributed in the hope that it will be useful. * + * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND * + * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, * + * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE * + * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD * + * TO BE LEGALLY INVALID. See the GNU General Public License for * + * more details, a copy of which can be found in the file COPYING * + * included with this package. * *******************************************************************/ -/* - * $Id: lpfc_disc.h 1.61 2005/04/07 08:46:52EDT sf_support Exp $ - */ - #define FC_MAX_HOLD_RSCN 32 /* max number of deferred RSCNs */ #define FC_MAX_NS_RSP 65536 /* max size NameServer rsp */ #define FC_MAXLOOP 126 /* max devices supported on a fc loop */ Index: drivers/scsi/lpfc/lpfc_els.c =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/lpfc/lpfc_els.c (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/lpfc/lpfc_els.c (mode:100644) @@ -1,27 +1,24 @@ /******************************************************************* * This file is part of the Emulex Linux Device Driver for * - * Enterprise Fibre Channel Host Bus Adapters. * - * Refer to the README file included with this package for * - * driver version and adapter support. * - * Copyright (C) 2004 Emulex Corporation. * + * Fibre Channel Host Bus Adapters. * + * Copyright (C) 2004-2005 Emulex. All rights reserved. * + * EMULEX and SLI are trademarks of Emulex. * * www.emulex.com * + * Portions Copyright (C) 2004-2005 Christoph Hellwig * * * * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License * - * as published by the Free Software Foundation; either version 2 * - * of the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details, a copy of which * - * can be found in the file COPYING included with this package. * + * modify it under the terms of version 2 of the GNU General * + * Public License as published by the Free Software Foundation. * + * This program is distributed in the hope that it will be useful. * + * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND * + * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, * + * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE * + * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD * + * TO BE LEGALLY INVALID. See the GNU General Public License for * + * more details, a copy of which can be found in the file COPYING * + * included with this package. * *******************************************************************/ -/* - * $Id: lpfc_els.c 1.186 2005/04/13 14:26:55EDT sf_support Exp $ - */ - #include #include #include @@ -3139,7 +3136,7 @@ case ELS_CMD_PLOGI: phba->fc_stat.elsRcvPLOGI++; if (phba->hba_state < LPFC_DISC_AUTH) { - rjt_err = LSEXP_NOTHING_MORE; + rjt_err = 1; break; } lpfc_disc_state_machine(phba, ndlp, elsiocb, NLP_EVT_RCV_PLOGI); @@ -3154,7 +3151,7 @@ case ELS_CMD_LOGO: phba->fc_stat.elsRcvLOGO++; if (phba->hba_state < LPFC_DISC_AUTH) { - rjt_err = LSEXP_NOTHING_MORE; + rjt_err = 1; break; } lpfc_disc_state_machine(phba, ndlp, elsiocb, NLP_EVT_RCV_LOGO); @@ -3162,7 +3159,7 @@ case ELS_CMD_PRLO: phba->fc_stat.elsRcvPRLO++; if (phba->hba_state < LPFC_DISC_AUTH) { - rjt_err = LSEXP_NOTHING_MORE; + rjt_err = 1; break; } lpfc_disc_state_machine(phba, ndlp, elsiocb, NLP_EVT_RCV_PRLO); @@ -3177,7 +3174,7 @@ case ELS_CMD_ADISC: phba->fc_stat.elsRcvADISC++; if (phba->hba_state < LPFC_DISC_AUTH) { - rjt_err = LSEXP_NOTHING_MORE; + rjt_err = 1; break; } lpfc_disc_state_machine(phba, ndlp, elsiocb, NLP_EVT_RCV_ADISC); @@ -3185,7 +3182,7 @@ case ELS_CMD_PDISC: phba->fc_stat.elsRcvPDISC++; if (phba->hba_state < LPFC_DISC_AUTH) { - rjt_err = LSEXP_NOTHING_MORE; + rjt_err = 1; break; } lpfc_disc_state_machine(phba, ndlp, elsiocb, NLP_EVT_RCV_PDISC); @@ -3209,7 +3206,7 @@ case ELS_CMD_PRLI: phba->fc_stat.elsRcvPRLI++; if (phba->hba_state < LPFC_DISC_AUTH) { - rjt_err = LSEXP_NOTHING_MORE; + rjt_err = 1; break; } lpfc_disc_state_machine(phba, ndlp, elsiocb, NLP_EVT_RCV_PRLI); @@ -3220,7 +3217,7 @@ break; default: /* Unsupported ELS command, reject */ - rjt_err = LSEXP_NOTHING_MORE; + rjt_err = 1; /* Unknown ELS command received from NPORT */ lpfc_printf_log(phba, KERN_ERR, LOG_ELS, @@ -3236,7 +3233,7 @@ if (rjt_err) { stat.un.b.lsRjtRsvd0 = 0; stat.un.b.lsRjtRsnCode = LSRJT_UNABLE_TPC; - stat.un.b.lsRjtRsnCodeExp = rjt_err; + stat.un.b.lsRjtRsnCodeExp = LSEXP_NOTHING_MORE; stat.un.b.vendorUnique = 0; lpfc_els_rsp_reject(phba, stat.un.lsRjtError, elsiocb, ndlp); } Index: drivers/scsi/lpfc/lpfc_hbadisc.c =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/lpfc/lpfc_hbadisc.c (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/lpfc/lpfc_hbadisc.c (mode:100644) @@ -1,27 +1,24 @@ /******************************************************************* * This file is part of the Emulex Linux Device Driver for * - * Enterprise Fibre Channel Host Bus Adapters. * - * Refer to the README file included with this package for * - * driver version and adapter support. * - * Copyright (C) 2004 Emulex Corporation. * + * Fibre Channel Host Bus Adapters. * + * Copyright (C) 2004-2005 Emulex. All rights reserved. * + * EMULEX and SLI are trademarks of Emulex. * * www.emulex.com * + * Portions Copyright (C) 2004-2005 Christoph Hellwig * * * * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License * - * as published by the Free Software Foundation; either version 2 * - * of the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details, a copy of which * - * can be found in the file COPYING included with this package. * + * modify it under the terms of version 2 of the GNU General * + * Public License as published by the Free Software Foundation. * + * This program is distributed in the hope that it will be useful. * + * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND * + * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, * + * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE * + * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD * + * TO BE LEGALLY INVALID. See the GNU General Public License for * + * more details, a copy of which can be found in the file COPYING * + * included with this package. * *******************************************************************/ -/* - * $Id: lpfc_hbadisc.c 1.266 2005/04/13 11:59:06EDT sf_support Exp $ - */ - #include #include #include @@ -61,14 +58,7 @@ static void lpfc_process_nodev_timeout(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp) { - if (!(ndlp->nlp_type & NLP_FABRIC)) { - /* Nodev timeout on NPort */ - lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, - "%d:0203 Nodev timeout on NPort x%x " - "Data: x%x x%x x%x\n", - phba->brd_no, ndlp->nlp_DID, ndlp->nlp_flag, - ndlp->nlp_state, ndlp->nlp_rpi); - } + int warn_on = 0; spin_lock_irq(phba->host->host_lock); if (!(ndlp->nlp_flag & NLP_NODEV_TMO)) { @@ -79,12 +69,27 @@ ndlp->nlp_flag &= ~NLP_NODEV_TMO; if (ndlp->nlp_sid != NLP_NO_SID) { + warn_on = 1; /* flush the target */ lpfc_sli_abort_iocb(phba, &phba->sli.ring[phba->sli.fcp_ring], ndlp->nlp_sid, 0, 0, LPFC_CTX_TGT); } spin_unlock_irq(phba->host->host_lock); + if (warn_on) { + lpfc_printf_log(phba, KERN_ERR, LOG_DISCOVERY, + "%d:0203 Nodev timeout on NPort x%x " + "Data: x%x x%x x%x\n", + phba->brd_no, ndlp->nlp_DID, ndlp->nlp_flag, + ndlp->nlp_state, ndlp->nlp_rpi); + } else { + lpfc_printf_log(phba, KERN_INFO, LOG_DISCOVERY, + "%d:0204 Nodev timeout on NPort x%x " + "Data: x%x x%x x%x\n", + phba->brd_no, ndlp->nlp_DID, ndlp->nlp_flag, + ndlp->nlp_state, ndlp->nlp_rpi); + } + lpfc_disc_state_machine(phba, ndlp, NULL, NLP_EVT_DEVICE_RM); return; } Index: drivers/scsi/lpfc/lpfc_hw.h =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/lpfc/lpfc_hw.h (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/lpfc/lpfc_hw.h (mode:100644) @@ -1,27 +1,23 @@ /******************************************************************* * This file is part of the Emulex Linux Device Driver for * - * Enterprise Fibre Channel Host Bus Adapters. * - * Refer to the README file included with this package for * - * driver version and adapter support. * - * Copyright (C) 2004 Emulex Corporation. * + * Fibre Channel Host Bus Adapters. * + * Copyright (C) 2004-2005 Emulex. All rights reserved. * + * EMULEX and SLI are trademarks of Emulex. * * www.emulex.com * * * * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License * - * as published by the Free Software Foundation; either version 2 * - * of the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details, a copy of which * - * can be found in the file COPYING included with this package. * + * modify it under the terms of version 2 of the GNU General * + * Public License as published by the Free Software Foundation. * + * This program is distributed in the hope that it will be useful. * + * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND * + * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, * + * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE * + * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD * + * TO BE LEGALLY INVALID. See the GNU General Public License for * + * more details, a copy of which can be found in the file COPYING * + * included with this package. * *******************************************************************/ -/* - * $Id: lpfc_hw.h 1.37 2005/03/29 19:51:45EST sf_support Exp $ - */ - #define FDMI_DID 0xfffffaU #define NameServer_DID 0xfffffcU #define SCR_DID 0xfffffdU @@ -2214,20 +2210,20 @@ * SLI-2 specific structures */ -typedef struct { - uint32_t cmdPutInx; - uint32_t rspGetInx; -} HGP; +struct lpfc_hgp { + __le32 cmdPutInx; + __le32 rspGetInx; +}; -typedef struct { - uint32_t cmdGetInx; - uint32_t rspPutInx; -} PGP; +struct lpfc_pgp { + __le32 cmdGetInx; + __le32 rspPutInx; +}; typedef struct _SLI2_DESC { - HGP host[MAX_RINGS]; + struct lpfc_hgp host[MAX_RINGS]; uint32_t unused1[16]; - PGP port[MAX_RINGS]; + struct lpfc_pgp port[MAX_RINGS]; } SLI2_DESC; typedef union { Index: drivers/scsi/lpfc/lpfc_init.c =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/lpfc/lpfc_init.c (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/lpfc/lpfc_init.c (mode:100644) @@ -1,27 +1,24 @@ /******************************************************************* * This file is part of the Emulex Linux Device Driver for * - * Enterprise Fibre Channel Host Bus Adapters. * - * Refer to the README file included with this package for * - * driver version and adapter support. * - * Copyright (C) 2004 Emulex Corporation. * + * Fibre Channel Host Bus Adapters. * + * Copyright (C) 2004-2005 Emulex. All rights reserved. * + * EMULEX and SLI are trademarks of Emulex. * * www.emulex.com * + * Portions Copyright (C) 2004-2005 Christoph Hellwig * * * * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License * - * as published by the Free Software Foundation; either version 2 * - * of the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details, a copy of which * - * can be found in the file COPYING included with this package. * + * modify it under the terms of version 2 of the GNU General * + * Public License as published by the Free Software Foundation. * + * This program is distributed in the hope that it will be useful. * + * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND * + * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, * + * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE * + * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD * + * TO BE LEGALLY INVALID. See the GNU General Public License for * + * more details, a copy of which can be found in the file COPYING * + * included with this package. * *******************************************************************/ -/* - * $Id: lpfc_init.c 1.233 2005/04/13 11:59:09EDT sf_support Exp $ - */ - #include #include #include @@ -780,6 +777,9 @@ pci_read_config_dword(phba->pcidev, PCI_VENDOR_ID, &id); switch ((id >> 16) & 0xffff) { + case PCI_DEVICE_ID_FIREFLY: + strcpy(str, "LP6000 1"); + break; case PCI_DEVICE_ID_SUPERFLY: if (vp->rev.biuRev >= 1 && vp->rev.biuRev <= 3) strcpy(str, "LP7000 1"); @@ -837,6 +837,9 @@ case PCI_DEVICE_ID_LP10000S: strcpy(str, "LP10000-S 2"); break; + default: + memset(str, 0, 16); + break; } if (mdp) sscanf(str, "%s", mdp); @@ -1662,6 +1665,8 @@ static struct pci_device_id lpfc_id_table[] = { {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_VIPER, PCI_ANY_ID, PCI_ANY_ID, }, + {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_FIREFLY, + PCI_ANY_ID, PCI_ANY_ID, }, {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_THOR, PCI_ANY_ID, PCI_ANY_ID, }, {PCI_VENDOR_ID_EMULEX, PCI_DEVICE_ID_PEGASUS, @@ -1712,6 +1717,7 @@ int error = 0; printk(LPFC_MODULE_DESC "\n"); + printk(LPFC_COPYRIGHT "\n"); lpfc_transport_template = fc_attach_transport(&lpfc_transport_functions); Index: drivers/scsi/lpfc/lpfc_logmsg.h =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/lpfc/lpfc_logmsg.h (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/lpfc/lpfc_logmsg.h (mode:100644) @@ -1,27 +1,23 @@ /******************************************************************* * This file is part of the Emulex Linux Device Driver for * - * Enterprise Fibre Channel Host Bus Adapters. * - * Refer to the README file included with this package for * - * driver version and adapter support. * - * Copyright (C) 2004 Emulex Corporation. * + * Fibre Channel Host Bus Adapters. * + * Copyright (C) 2004-2005 Emulex. All rights reserved. * + * EMULEX and SLI are trademarks of Emulex. * * www.emulex.com * * * * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License * - * as published by the Free Software Foundation; either version 2 * - * of the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details, a copy of which * - * can be found in the file COPYING included with this package. * + * modify it under the terms of version 2 of the GNU General * + * Public License as published by the Free Software Foundation. * + * This program is distributed in the hope that it will be useful. * + * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND * + * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, * + * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE * + * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD * + * TO BE LEGALLY INVALID. See the GNU General Public License for * + * more details, a copy of which can be found in the file COPYING * + * included with this package. * *******************************************************************/ -/* - * $Id: lpfc_logmsg.h 1.32 2005/01/25 17:52:01EST sf_support Exp $ - */ - #define LOG_ELS 0x1 /* ELS events */ #define LOG_DISCOVERY 0x2 /* Link discovery events */ #define LOG_MBOX 0x4 /* Mailbox events */ Index: drivers/scsi/lpfc/lpfc_mbox.c =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/lpfc/lpfc_mbox.c (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/lpfc/lpfc_mbox.c (mode:100644) @@ -1,27 +1,24 @@ /******************************************************************* * This file is part of the Emulex Linux Device Driver for * - * Enterprise Fibre Channel Host Bus Adapters. * - * Refer to the README file included with this package for * - * driver version and adapter support. * - * Copyright (C) 2004 Emulex Corporation. * + * Fibre Channel Host Bus Adapters. * + * Copyright (C) 2004-2005 Emulex. All rights reserved. * + * EMULEX and SLI are trademarks of Emulex. * * www.emulex.com * + * Portions Copyright (C) 2004-2005 Christoph Hellwig * * * * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License * - * as published by the Free Software Foundation; either version 2 * - * of the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details, a copy of which * - * can be found in the file COPYING included with this package. * + * modify it under the terms of version 2 of the GNU General * + * Public License as published by the Free Software Foundation. * + * This program is distributed in the hope that it will be useful. * + * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND * + * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, * + * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE * + * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD * + * TO BE LEGALLY INVALID. See the GNU General Public License for * + * more details, a copy of which can be found in the file COPYING * + * included with this package. * *******************************************************************/ -/* - * $Id: lpfc_mbox.c 1.85 2005/04/13 11:59:11EDT sf_support Exp $ - */ - #include #include #include @@ -422,7 +419,6 @@ uint32_t iocbCnt; int i; - psli->MBhostaddr = (uint32_t *)&phba->slim2p->mbx; pcbp->maxRing = (psli->num_rings - 1); iocbCnt = 0; @@ -528,7 +524,7 @@ dma_addr_t pdma_addr; uint32_t bar_low, bar_high; size_t offset; - HGP hgp; + struct lpfc_hgp hgp; void __iomem *to_slim; memset(pmb, 0, sizeof(LPFC_MBOXQ_t)); @@ -584,9 +580,9 @@ else phba->slim2p->pcb.hgpAddrHigh = 0; /* write HGP data to SLIM at the required longword offset */ - memset(&hgp, 0, sizeof(HGP)); + memset(&hgp, 0, sizeof(struct lpfc_hgp)); to_slim = phba->MBslimaddr + (SLIMOFF*sizeof (uint32_t)); - lpfc_memcpy_to_slim(to_slim, &hgp, sizeof (HGP)); + lpfc_memcpy_to_slim(to_slim, &hgp, sizeof(struct lpfc_hgp)); /* Setup Port Group ring pointer */ offset = (uint8_t *)&phba->slim2p->mbx.us.s2.port - Index: drivers/scsi/lpfc/lpfc_mem.c =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/lpfc/lpfc_mem.c (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/lpfc/lpfc_mem.c (mode:100644) @@ -1,27 +1,24 @@ /******************************************************************* * This file is part of the Emulex Linux Device Driver for * - * Enterprise Fibre Channel Host Bus Adapters. * - * Refer to the README file included with this package for * - * driver version and adapter support. * - * Copyright (C) 2004 Emulex Corporation. * + * Fibre Channel Host Bus Adapters. * + * Copyright (C) 2004-2005 Emulex. All rights reserved. * + * EMULEX and SLI are trademarks of Emulex. * * www.emulex.com * + * Portions Copyright (C) 2004-2005 Christoph Hellwig * * * * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License * - * as published by the Free Software Foundation; either version 2 * - * of the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details, a copy of which * - * can be found in the file COPYING included with this package. * + * modify it under the terms of version 2 of the GNU General * + * Public License as published by the Free Software Foundation. * + * This program is distributed in the hope that it will be useful. * + * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND * + * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, * + * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE * + * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD * + * TO BE LEGALLY INVALID. See the GNU General Public License for * + * more details, a copy of which can be found in the file COPYING * + * included with this package. * *******************************************************************/ -/* - * $Id: lpfc_mem.c 1.79 2005/04/13 14:25:50EDT sf_support Exp $ - */ - #include #include #include Index: drivers/scsi/lpfc/lpfc_nportdisc.c =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/lpfc/lpfc_nportdisc.c (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/lpfc/lpfc_nportdisc.c (mode:100644) @@ -1,27 +1,24 @@ /******************************************************************* * This file is part of the Emulex Linux Device Driver for * - * Enterprise Fibre Channel Host Bus Adapters. * - * Refer to the README file included with this package for * - * driver version and adapter support. * - * Copyright (C) 2004 Emulex Corporation. * + * Fibre Channel Host Bus Adapters. * + * Copyright (C) 2004-2005 Emulex. All rights reserved. * + * EMULEX and SLI are trademarks of Emulex. * * www.emulex.com * + * Portions Copyright (C) 2004-2005 Christoph Hellwig * * * * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License * - * as published by the Free Software Foundation; either version 2 * - * of the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details, a copy of which * - * can be found in the file COPYING included with this package. * + * modify it under the terms of version 2 of the GNU General * + * Public License as published by the Free Software Foundation. * + * This program is distributed in the hope that it will be useful. * + * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND * + * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, * + * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE * + * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD * + * TO BE LEGALLY INVALID. See the GNU General Public License for * + * more details, a copy of which can be found in the file COPYING * + * included with this package. * *******************************************************************/ -/* - * $Id: lpfc_nportdisc.c 1.179 2005/04/13 11:59:13EDT sf_support Exp $ - */ - #include #include #include @@ -950,8 +947,13 @@ lpfc_unreg_rpi(phba, ndlp); return (ndlp->nlp_state); } - ndlp->nlp_state = NLP_STE_MAPPED_NODE; - lpfc_nlp_list(phba, ndlp, NLP_MAPPED_LIST); + if (ndlp->nlp_type & NLP_FCP_TARGET) { + ndlp->nlp_state = NLP_STE_MAPPED_NODE; + lpfc_nlp_list(phba, ndlp, NLP_MAPPED_LIST); + } else { + ndlp->nlp_state = NLP_STE_UNMAPPED_NODE; + lpfc_nlp_list(phba, ndlp, NLP_UNMAPPED_LIST); + } return (ndlp->nlp_state); } Index: drivers/scsi/lpfc/lpfc_scsi.c =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/lpfc/lpfc_scsi.c (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/lpfc/lpfc_scsi.c (mode:100644) @@ -1,27 +1,24 @@ /******************************************************************* * This file is part of the Emulex Linux Device Driver for * - * Enterprise Fibre Channel Host Bus Adapters. * - * Refer to the README file included with this package for * - * driver version and adapter support. * - * Copyright (C) 2004 Emulex Corporation. * + * Fibre Channel Host Bus Adapters. * + * Copyright (C) 2004-2005 Emulex. All rights reserved. * + * EMULEX and SLI are trademarks of Emulex. * * www.emulex.com * + * Portions Copyright (C) 2004-2005 Christoph Hellwig * * * * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License * - * as published by the Free Software Foundation; either version 2 * - * of the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details, a copy of which * - * can be found in the file COPYING included with this package. * + * modify it under the terms of version 2 of the GNU General * + * Public License as published by the Free Software Foundation. * + * This program is distributed in the hope that it will be useful. * + * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND * + * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, * + * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE * + * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD * + * TO BE LEGALLY INVALID. See the GNU General Public License for * + * more details, a copy of which can be found in the file COPYING * + * included with this package. * *******************************************************************/ -/* - * $Id: lpfc_scsi.c 1.37 2005/04/13 14:27:09EDT sf_support Exp $ - */ - #include #include @@ -874,6 +871,7 @@ else icmd->ulpCommand = CMD_CLOSE_XRI_CN; + abtsiocb->iocb_cmpl = lpfc_sli_abort_fcp_cmpl; if (lpfc_sli_issue_iocb(phba, pring, abtsiocb, 0) == IOCB_ERROR) { list_add_tail(&abtsiocb->list, lpfc_iocb_list); @@ -1273,4 +1271,5 @@ .cmd_per_lun = LPFC_CMD_PER_LUN, .use_clustering = ENABLE_CLUSTERING, .shost_attrs = lpfc_host_attrs, + .max_sectors = 0xFFFF, }; Index: drivers/scsi/lpfc/lpfc_scsi.h =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/lpfc/lpfc_scsi.h (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/lpfc/lpfc_scsi.h (mode:100644) @@ -1,27 +1,23 @@ /******************************************************************* * This file is part of the Emulex Linux Device Driver for * - * Enterprise Fibre Channel Host Bus Adapters. * - * Refer to the README file included with this package for * - * driver version and adapter support. * - * Copyright (C) 2004 Emulex Corporation. * + * Fibre Channel Host Bus Adapters. * + * Copyright (C) 2004-2005 Emulex. All rights reserved. * + * EMULEX and SLI are trademarks of Emulex. * * www.emulex.com * * * * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License * - * as published by the Free Software Foundation; either version 2 * - * of the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details, a copy of which * - * can be found in the file COPYING included with this package. * + * modify it under the terms of version 2 of the GNU General * + * Public License as published by the Free Software Foundation. * + * This program is distributed in the hope that it will be useful. * + * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND * + * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, * + * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE * + * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD * + * TO BE LEGALLY INVALID. See the GNU General Public License for * + * more details, a copy of which can be found in the file COPYING * + * included with this package. * *******************************************************************/ -/* - * $Id: lpfc_scsi.h 1.83 2005/04/07 08:47:43EDT sf_support Exp $ - */ - struct lpfc_hba; #define list_remove_head(list, entry, type, member) \ Index: drivers/scsi/lpfc/lpfc_sli.c =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/lpfc/lpfc_sli.c (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/lpfc/lpfc_sli.c (mode:100644) @@ -1,27 +1,24 @@ /******************************************************************* * This file is part of the Emulex Linux Device Driver for * - * Enterprise Fibre Channel Host Bus Adapters. * - * Refer to the README file included with this package for * - * driver version and adapter support. * - * Copyright (C) 2004 Emulex Corporation. * + * Fibre Channel Host Bus Adapters. * + * Copyright (C) 2004-2005 Emulex. All rights reserved. * + * EMULEX and SLI are trademarks of Emulex. * * www.emulex.com * + * Portions Copyright (C) 2004-2005 Christoph Hellwig * * * * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License * - * as published by the Free Software Foundation; either version 2 * - * of the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details, a copy of which * - * can be found in the file COPYING included with this package. * + * modify it under the terms of version 2 of the GNU General * + * Public License as published by the Free Software Foundation. * + * This program is distributed in the hope that it will be useful. * + * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND * + * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, * + * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE * + * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD * + * TO BE LEGALLY INVALID. See the GNU General Public License for * + * more details, a copy of which can be found in the file COPYING * + * included with this package. * *******************************************************************/ -/* - * $Id: lpfc_sli.c 1.232 2005/04/13 11:59:16EDT sf_support Exp $ - */ - #include #include #include @@ -225,8 +222,7 @@ static IOCB_t * lpfc_sli_next_iocb_slot (struct lpfc_hba *phba, struct lpfc_sli_ring *pring) { - MAILBOX_t *mbox = (MAILBOX_t *)phba->sli.MBhostaddr; - PGP *pgp = (PGP *)&mbox->us.s2.port[pring->ringno]; + struct lpfc_pgp *pgp = &phba->slim2p->mbx.us.s2.port[pring->ringno]; uint32_t max_cmd_idx = pring->numCiocb; IOCB_t *iocb = NULL; @@ -411,9 +407,7 @@ static void lpfc_sli_turn_on_ring(struct lpfc_hba * phba, int ringno) { - PGP *pgp = - ((PGP *) & - (((MAILBOX_t *)phba->sli.MBhostaddr)->us.s2.port[ringno])); + struct lpfc_pgp *pgp = &phba->slim2p->mbx.us.s2.port[ringno]; /* If the ring is active, flag it */ if (phba->sli.ring[ringno].cmdringaddr) { @@ -537,7 +531,7 @@ /* Get a Mailbox buffer to setup mailbox commands for callback */ if ((pmb = phba->sli.mbox_active)) { pmbox = &pmb->mb; - mbox = (MAILBOX_t *) phba->sli.MBhostaddr; + mbox = &phba->slim2p->mbx; /* First check out the status word */ lpfc_sli_pcimem_bcopy(mbox, pmbox, sizeof (uint32_t)); @@ -905,10 +899,11 @@ lpfc_sli_handle_fast_ring_event(struct lpfc_hba * phba, struct lpfc_sli_ring * pring, uint32_t mask) { + struct lpfc_pgp *pgp = &phba->slim2p->mbx.us.s2.port[pring->ringno]; IOCB_t *irsp = NULL; + IOCB_t *entry = NULL; struct lpfc_iocbq *cmdiocbq = NULL; struct lpfc_iocbq rspiocbq; - PGP *pgp; uint32_t status; uint32_t portRspPut, portRspMax; int rc = 1; @@ -920,10 +915,6 @@ spin_lock_irqsave(phba->host->host_lock, iflag); pring->stats.iocb_event++; - /* The driver assumes SLI-2 mode */ - pgp = (PGP *) &((MAILBOX_t *) phba->sli.MBhostaddr) - ->us.s2.port[pring->ringno]; - /* * The next available response entry should never exceed the maximum * entries. If it does, treat it as an adapter hardware error. @@ -955,7 +946,17 @@ rmb(); while (pring->rspidx != portRspPut) { - irsp = (IOCB_t *) IOCB_ENTRY(pring->rspringaddr, pring->rspidx); + /* + * Fetch an entry off the ring and copy it into a local data + * structure. The copy involves a byte-swap since the + * network byte order and pci byte orders are different. + */ + entry = (IOCB_t *) IOCB_ENTRY(pring->rspringaddr, pring->rspidx); + lpfc_sli_pcimem_bcopy((uint32_t *) entry, + (uint32_t *) &rspiocbq.iocb, + sizeof (IOCB_t)); + irsp = &rspiocbq.iocb; + type = lpfc_sli_iocb_cmd_type(irsp->ulpCommand & CMD_IOCB_MASK); pring->stats.iocb_rsp++; rsp_cmpl++; @@ -987,10 +988,6 @@ break; } - rspiocbq.iocb.un.ulpWord[4] = irsp->un.ulpWord[4]; - rspiocbq.iocb.ulpStatus = irsp->ulpStatus; - rspiocbq.iocb.ulpContext = irsp->ulpContext; - rspiocbq.iocb.ulpIoTag = irsp->ulpIoTag; cmdiocbq = lpfc_sli_txcmpl_ring_iotag_lookup(phba, pring, &rspiocbq); @@ -1075,9 +1072,7 @@ struct lpfc_iocbq *cmdiocbp; struct lpfc_iocbq *saveq; struct list_head *lpfc_iocb_list = &phba->lpfc_iocb_list; - HGP *hgp; - PGP *pgp; - MAILBOX_t *mbox; + struct lpfc_pgp *pgp = &phba->slim2p->mbx.us.s2.port[pring->ringno]; uint8_t iocb_cmd_type; lpfc_iocb_type type; uint32_t status, free_saveq; @@ -1089,11 +1084,6 @@ spin_lock_irqsave(phba->host->host_lock, iflag); pring->stats.iocb_event++; - /* The driver assumes SLI-2 mode */ - mbox = (MAILBOX_t *) phba->sli.MBhostaddr; - pgp = (PGP *) & mbox->us.s2.port[pring->ringno]; - hgp = (HGP *) & mbox->us.s2.host[pring->ringno]; - /* * The next available response entry should never exceed the maximum * entries. If it does, treat it as an adapter hardware error. @@ -1738,6 +1728,8 @@ return; } + phba->work_hba_events &= ~WORKER_MBOX_TMO; + pmbox = phba->sli.mbox_active; mb = &pmbox->mb; @@ -1752,16 +1744,14 @@ phba->sli.sli_flag, phba->sli.mbox_active); - if (phba->sli.mbox_active == pmbox) { - phba->sli.mbox_active = NULL; - if (pmbox->mbox_cmpl) { - mb->mbxStatus = MBX_NOT_FINISHED; - spin_unlock_irq(phba->host->host_lock); - (pmbox->mbox_cmpl) (phba, pmbox); - spin_lock_irq(phba->host->host_lock); - } - phba->sli.sli_flag &= ~LPFC_SLI_MBOX_ACTIVE; + phba->sli.mbox_active = NULL; + if (pmbox->mbox_cmpl) { + mb->mbxStatus = MBX_NOT_FINISHED; + spin_unlock_irq(phba->host->host_lock); + (pmbox->mbox_cmpl) (phba, pmbox); + spin_lock_irq(phba->host->host_lock); } + phba->sli.sli_flag &= ~LPFC_SLI_MBOX_ACTIVE; spin_unlock_irq(phba->host->host_lock); lpfc_mbox_abort(phba); @@ -1771,7 +1761,6 @@ int lpfc_sli_issue_mbox(struct lpfc_hba * phba, LPFC_MBOXQ_t * pmbox, uint32_t flag) { - MAILBOX_t *mbox; MAILBOX_t *mb; struct lpfc_sli *psli; uint32_t status, evtctr; @@ -1901,15 +1890,13 @@ mb->mbxOwner = OWN_CHIP; if (psli->sli_flag & LPFC_SLI2_ACTIVE) { - /* First copy command data to host SLIM area */ - mbox = (MAILBOX_t *) psli->MBhostaddr; - lpfc_sli_pcimem_bcopy(mb, mbox, MAILBOX_CMD_SIZE); + lpfc_sli_pcimem_bcopy(mb, &phba->slim2p->mbx, MAILBOX_CMD_SIZE); } else { if (mb->mbxCommand == MBX_CONFIG_PORT) { /* copy command data into host mbox for cmpl */ - mbox = (MAILBOX_t *) psli->MBhostaddr; - lpfc_sli_pcimem_bcopy(mb, mbox, MAILBOX_CMD_SIZE); + lpfc_sli_pcimem_bcopy(mb, &phba->slim2p->mbx, + MAILBOX_CMD_SIZE); } /* First copy mbox command data to HBA SLIM, skip past first @@ -1946,8 +1933,7 @@ psli->mbox_active = NULL; if (psli->sli_flag & LPFC_SLI2_ACTIVE) { /* First read mbox status word */ - mbox = (MAILBOX_t *) psli->MBhostaddr; - word0 = *((volatile uint32_t *)mbox); + word0 = *((volatile uint32_t *)&phba->slim2p->mbx); word0 = le32_to_cpu(word0); } else { /* First read mbox status word */ @@ -1984,8 +1970,8 @@ if (psli->sli_flag & LPFC_SLI2_ACTIVE) { /* First copy command data */ - mbox = (MAILBOX_t *) psli->MBhostaddr; - word0 = *((volatile uint32_t *)mbox); + word0 = *((volatile uint32_t *) + &phba->slim2p->mbx); word0 = le32_to_cpu(word0); if (mb->mbxCommand == MBX_CONFIG_PORT) { MAILBOX_t *slimmb; @@ -2009,10 +1995,9 @@ } if (psli->sli_flag & LPFC_SLI2_ACTIVE) { - /* First copy command data */ - mbox = (MAILBOX_t *) psli->MBhostaddr; /* copy results back to user */ - lpfc_sli_pcimem_bcopy(mbox, mb, MAILBOX_CMD_SIZE); + lpfc_sli_pcimem_bcopy(&phba->slim2p->mbx, mb, + MAILBOX_CMD_SIZE); } else { /* First copy command data */ lpfc_memcpy_from_slim(mb, phba->MBslimaddr, @@ -2089,8 +2074,6 @@ switch (piocb->iocb.ulpCommand) { case CMD_QUE_RING_BUF_CN: case CMD_QUE_RING_BUF64_CN: - case CMD_CLOSE_XRI_CN: - case CMD_ABORT_XRI_CN: /* * For IOCBs, like QUE_RING_BUF, that have no rsp ring * completion, iocb_cmpl MUST be 0. @@ -2573,6 +2556,16 @@ return sum; } +void +lpfc_sli_abort_fcp_cmpl(struct lpfc_hba * phba, struct lpfc_iocbq * cmdiocb, + struct lpfc_iocbq * rspiocb) +{ + spin_lock_irq(phba->host->host_lock); + list_add_tail(&cmdiocb->list, &phba->lpfc_iocb_list); + spin_unlock_irq(phba->host->host_lock); + return; +} + int lpfc_sli_abort_iocb(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, uint16_t tgt_id, uint64_t lun_id, uint32_t ctx, @@ -2622,6 +2615,8 @@ else abtsiocb->iocb.ulpCommand = CMD_CLOSE_XRI_CN; + /* Setup callback routine and issue the command. */ + abtsiocb->iocb_cmpl = lpfc_sli_abort_fcp_cmpl; ret_val = lpfc_sli_issue_iocb(phba, pring, abtsiocb, 0); if (ret_val == IOCB_ERROR) { list_add_tail(&abtsiocb->list, lpfc_iocb_list); Index: drivers/scsi/lpfc/lpfc_sli.h =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/lpfc/lpfc_sli.h (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/lpfc/lpfc_sli.h (mode:100644) @@ -1,27 +1,23 @@ /******************************************************************* * This file is part of the Emulex Linux Device Driver for * - * Enterprise Fibre Channel Host Bus Adapters. * - * Refer to the README file included with this package for * - * driver version and adapter support. * - * Copyright (C) 2004 Emulex Corporation. * + * Fibre Channel Host Bus Adapters. * + * Copyright (C) 2004-2005 Emulex. All rights reserved. * + * EMULEX and SLI are trademarks of Emulex. * * www.emulex.com * * * * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License * - * as published by the Free Software Foundation; either version 2 * - * of the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details, a copy of which * - * can be found in the file COPYING included with this package. * + * modify it under the terms of version 2 of the GNU General * + * Public License as published by the Free Software Foundation. * + * This program is distributed in the hope that it will be useful. * + * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND * + * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, * + * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE * + * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD * + * TO BE LEGALLY INVALID. See the GNU General Public License for * + * more details, a copy of which can be found in the file COPYING * + * included with this package. * *******************************************************************/ -/* - * $Id: lpfc_sli.h 1.42 2005/03/21 02:01:28EST sf_support Exp $ - */ - /* forward declaration for LPFC_IOCB_t's use */ struct lpfc_hba; Index: drivers/scsi/lpfc/lpfc_version.h =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/lpfc/lpfc_version.h (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/lpfc/lpfc_version.h (mode:100644) @@ -1,32 +1,29 @@ /******************************************************************* * This file is part of the Emulex Linux Device Driver for * - * Enterprise Fibre Channel Host Bus Adapters. * - * Refer to the README file included with this package for * - * driver version and adapter support. * - * Copyright (C) 2004 Emulex Corporation. * + * Fibre Channel Host Bus Adapters. * + * Copyright (C) 2004-2005 Emulex. All rights reserved. * + * EMULEX and SLI are trademarks of Emulex. * * www.emulex.com * * * * This program is free software; you can redistribute it and/or * - * modify it under the terms of the GNU General Public License * - * as published by the Free Software Foundation; either version 2 * - * of the License, or (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details, a copy of which * - * can be found in the file COPYING included with this package. * + * modify it under the terms of version 2 of the GNU General * + * Public License as published by the Free Software Foundation. * + * This program is distributed in the hope that it will be useful. * + * ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND * + * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY, * + * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE * + * DISCLAIMED, EXCEPT TO THE EXTENT THAT SUCH DISCLAIMERS ARE HELD * + * TO BE LEGALLY INVALID. See the GNU General Public License for * + * more details, a copy of which can be found in the file COPYING * + * included with this package. * *******************************************************************/ -/* - * $Id: lpfc_version.h 1.49 2005/04/13 15:07:19EDT sf_support Exp $ - */ - -#define LPFC_DRIVER_VERSION "8.0.28" +#define LPFC_DRIVER_VERSION "8.0.29" #define LPFC_DRIVER_NAME "lpfc" #define LPFC_MODULE_DESC "Emulex LightPulse Fibre Channel SCSI driver " \ LPFC_DRIVER_VERSION +#define LPFC_COPYRIGHT "Copyright(c) 2004-2005 Emulex. All rights reserved." #define DFC_API_VERSION "0.0.0" Index: drivers/scsi/megaraid.c =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/megaraid.c (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/megaraid.c (mode:100644) @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include @@ -1938,7 +1939,7 @@ static int -__megaraid_reset(Scsi_Cmnd *cmd) +megaraid_reset(struct scsi_cmnd *cmd) { adapter_t *adapter; megacmd_t mc; @@ -1950,7 +1951,6 @@ mc.cmd = MEGA_CLUSTER_CMD; mc.opcode = MEGA_RESET_RESERVATIONS; - spin_unlock_irq(&adapter->lock); if( mega_internal_command(adapter, LOCK_INT, &mc, NULL) != 0 ) { printk(KERN_WARNING "megaraid: reservation reset failed.\n"); @@ -1958,9 +1958,10 @@ else { printk(KERN_INFO "megaraid: reservation reset.\n"); } - spin_lock_irq(&adapter->lock); #endif + spin_lock_irq(&adapter->lock); + rval = megaraid_abort_and_reset(adapter, cmd, SCB_RESET); /* @@ -1968,24 +1969,11 @@ * to be communicated over to the mid layer. */ mega_rundoneq(adapter); - - return rval; -} - -static int -megaraid_reset(Scsi_Cmnd *cmd) -{ - adapter_t *adapter = (adapter_t *)cmd->device->host->hostdata; - int rc; - - spin_lock_irq(&adapter->lock); - rc = __megaraid_reset(cmd); spin_unlock_irq(&adapter->lock); - return rc; + return rval; } - /** * megaraid_abort_and_reset() * @adapter - megaraid soft state @@ -4490,8 +4478,6 @@ scb->idx = CMDID_INT_CMDS; - scmd->state = 0; - /* * Get the lock only if the caller has not acquired it already */ @@ -4501,15 +4487,7 @@ if( ls == LOCK_INT ) spin_unlock_irqrestore(&adapter->lock, flags); - /* - * Wait till this command finishes. Do not use - * wait_event_interruptible(). It causes panic if CTRL-C is hit when - * dumping e.g., physical disk information through /proc interface. - */ -#if 0 - wait_event_interruptible(adapter->int_waitq, scmd->state); -#endif - wait_event(adapter->int_waitq, scmd->state); + wait_for_completion(&adapter->int_waitq); rval = scmd->result; mc->status = scmd->result; @@ -4543,16 +4521,7 @@ adapter = (adapter_t *)scmd->device->host->hostdata; - scmd->state = 1; /* thread waiting for its command to complete */ - - /* - * See comment in mega_internal_command() routine for - * wait_event_interruptible() - */ -#if 0 - wake_up_interruptible(&adapter->int_waitq); -#endif - wake_up(&adapter->int_waitq); + complete(&adapter->int_waitq); } @@ -4874,7 +4843,7 @@ } init_MUTEX(&adapter->int_mtx); - init_waitqueue_head(&adapter->int_waitq); + init_completion(&adapter->int_waitq); adapter->this_id = DEFAULT_INITIATOR_ID; adapter->host->this_id = DEFAULT_INITIATOR_ID; Index: drivers/scsi/megaraid.h =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/megaraid.h (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/megaraid.h (mode:100644) @@ -891,7 +891,7 @@ Scsi_Cmnd int_scmd; struct semaphore int_mtx; /* To synchronize the internal commands */ - wait_queue_head_t int_waitq; /* wait queue for internal + struct completion int_waitq; /* wait queue for internal cmds */ int has_cluster; /* cluster support on this HBA */ Index: drivers/scsi/megaraid/megaraid_mbox.c =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/megaraid/megaraid_mbox.c (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/megaraid/megaraid_mbox.c (mode:100644) @@ -719,7 +719,6 @@ // export the parameters required by the mid-layer scsi_assign_lock(host, adapter->host_lock); - scsi_set_device(host, &adapter->pdev->dev); host->irq = adapter->irq; host->unique_id = adapter->unique_id; Index: drivers/scsi/ncr53c8xx.c =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/ncr53c8xx.c (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/ncr53c8xx.c (mode:100644) @@ -7756,7 +7756,6 @@ * your module_init */ BUG_ON(!ncr53c8xx_transport_template); instance->transportt = ncr53c8xx_transport_template; - scsi_set_device(instance, device->dev); /* Patch script to physical addresses */ ncr_script_fill(&script0, &scripth0); Index: drivers/scsi/nsp32.c =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/nsp32.c (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/nsp32.c (mode:100644) @@ -2719,9 +2719,7 @@ host->unique_id = data->BaseAddress; host->n_io_port = data->NumAddress; host->base = (unsigned long)data->MmioAddress; -#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,63)) - scsi_set_device(host, &PCIDEV->dev); -#else +#if (LINUX_VERSION_CODE <= KERNEL_VERSION(2,5,63)) scsi_set_pci_device(host, PCIDEV); #endif Index: drivers/scsi/qla1280.c =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/qla1280.c (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/qla1280.c (mode:100644) @@ -2853,7 +2853,7 @@ ha->bus_settings[bus].failed_reset_count++; } else { spin_unlock_irq(HOST_LOCK); - schedule_timeout(reset_delay * HZ); + ssleep(reset_delay); spin_lock_irq(HOST_LOCK); ha->bus_settings[bus].scsi_bus_dead = 0; Index: drivers/scsi/qlogicfc.c =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/qlogicfc.c (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/qlogicfc.c (mode:100644) @@ -746,7 +746,6 @@ printk("qlogicfc%d : could not register host.\n", hosts); continue; } - scsi_set_device(host, &pdev->dev); host->max_id = QLOGICFC_MAX_ID + 1; host->max_lun = QLOGICFC_MAX_LUN; hostdata = (struct isp2x00_hostdata *) host->hostdata; Index: drivers/scsi/qlogicisp.c =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/qlogicisp.c (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/qlogicisp.c (mode:100644) @@ -694,7 +694,6 @@ memset(hostdata, 0, sizeof(struct isp1020_hostdata)); hostdata->pci_dev = pdev; - scsi_set_device(host, &pdev->dev); if (isp1020_init(host)) goto fail_and_unregister; Index: drivers/scsi/scsi.c =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/scsi.c (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/scsi.c (mode:100644) @@ -259,8 +259,6 @@ memset(cmd, 0, sizeof(*cmd)); cmd->device = dev; - cmd->state = SCSI_STATE_UNUSED; - cmd->owner = SCSI_OWNER_NOBODY; init_timer(&cmd->eh_timeout); INIT_LIST_HEAD(&cmd->list); spin_lock_irqsave(&dev->list_lock, flags); @@ -610,10 +608,6 @@ * We will use a queued command if possible, otherwise we will * emulate the queuing and calling of completion function ourselves. */ - - cmd->state = SCSI_STATE_QUEUED; - cmd->owner = SCSI_OWNER_LOWLEVEL; - atomic_inc(&cmd->device->iorequest_cnt); /* @@ -683,7 +677,6 @@ { sreq->sr_command = cmd; - cmd->owner = SCSI_OWNER_MIDLEVEL; cmd->cmd_len = sreq->sr_cmd_len; cmd->use_sg = sreq->sr_use_sg; @@ -719,7 +712,6 @@ /* * Start the timer ticking. */ - cmd->abort_reason = 0; cmd->result = 0; SCSI_LOG_MLQUEUE(3, printk("Leaving scsi_init_cmd_from_req()\n")); @@ -768,8 +760,6 @@ * Set the serial numbers back to zero */ cmd->serial_number = 0; - cmd->state = SCSI_STATE_BHQUEUE; - cmd->owner = SCSI_OWNER_BH_HANDLER; atomic_inc(&cmd->device->iodone_cnt); if (cmd->result) @@ -890,9 +880,6 @@ SCSI_LOG_MLCOMPLETE(4, printk("Notifying upper driver of completion " "for device %d %x\n", sdev->id, cmd->result)); - cmd->owner = SCSI_OWNER_HIGHLEVEL; - cmd->state = SCSI_STATE_FINISHED; - /* * We can get here with use_sg=0, causing a panic in the upper level */ Index: drivers/scsi/scsi_error.c =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/scsi_error.c (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/scsi_error.c (mode:100644) @@ -73,12 +73,7 @@ spin_lock_irqsave(shost->host_lock, flags); - scsi_eh_eflags_set(scmd, eh_flag); - /* - * FIXME: Can we stop setting owner and state. - */ - scmd->owner = SCSI_OWNER_ERROR_HANDLER; - scmd->state = SCSI_STATE_FAILED; + scmd->eh_eflags |= eh_flag; list_add_tail(&scmd->eh_entry, &shost->eh_cmd_q); set_bit(SHOST_RECOVERY, &shost->shost_state); shost->host_failed++; @@ -233,8 +228,7 @@ list_for_each_entry(scmd, work_q, eh_entry) { if (scmd->device == sdev) { ++total_failures; - if (scsi_eh_eflags_chk(scmd, - SCSI_EH_CANCEL_CMD)) + if (scmd->eh_eflags & SCSI_EH_CANCEL_CMD) ++cmd_cancel; else ++cmd_failed; @@ -430,7 +424,7 @@ **/ static void scsi_eh_times_out(struct scsi_cmnd *scmd) { - scsi_eh_eflags_set(scmd, SCSI_EH_REC_TIMEOUT); + scmd->eh_eflags |= SCSI_EH_REC_TIMEOUT; SCSI_LOG_ERROR_RECOVERY(3, printk("%s: scmd:%p\n", __FUNCTION__, scmd)); @@ -451,7 +445,6 @@ */ if (del_timer(&scmd->eh_timeout)) { scmd->request->rq_status = RQ_SCSI_DONE; - scmd->owner = SCSI_OWNER_ERROR_HANDLER; SCSI_LOG_ERROR_RECOVERY(3, printk("%s scmd: %p result: %x\n", __FUNCTION__, scmd, scmd->result)); @@ -484,8 +477,6 @@ * we will use a queued command if possible, otherwise we will * emulate the queuing and calling of completion function ourselves. */ - scmd->owner = SCSI_OWNER_LOWLEVEL; - if (sdev->scsi_level <= SCSI_2) scmd->cmnd[1] = (scmd->cmnd[1] & 0x1f) | (sdev->lun << 5 & 0xe0); @@ -512,9 +503,8 @@ * see if timeout. if so, tell the host to forget about it. * in other words, we don't want a callback any more. */ - if (scsi_eh_eflags_chk(scmd, SCSI_EH_REC_TIMEOUT)) { - scsi_eh_eflags_clr(scmd, SCSI_EH_REC_TIMEOUT); - scmd->owner = SCSI_OWNER_LOWLEVEL; + if (scmd->eh_eflags & SCSI_EH_REC_TIMEOUT) { + scmd->eh_eflags &= ~SCSI_EH_REC_TIMEOUT; /* * as far as the low level driver is @@ -530,8 +520,6 @@ shost->hostt->eh_abort_handler(scmd); scmd->request->rq_status = RQ_SCSI_DONE; - scmd->owner = SCSI_OWNER_ERROR_HANDLER; - rtn = FAILED; } @@ -641,9 +629,7 @@ struct list_head *done_q) { scmd->device->host->host_failed--; - scmd->state = SCSI_STATE_BHQUEUE; - - scsi_eh_eflags_clr_all(scmd); + scmd->eh_eflags = 0; /* * set this back so that the upper level can correctly free up @@ -676,13 +662,11 @@ static int scsi_eh_get_sense(struct list_head *work_q, struct list_head *done_q) { - struct list_head *lh, *lh_sf; - struct scsi_cmnd *scmd; + struct scsi_cmnd *scmd, *next; int rtn; - list_for_each_safe(lh, lh_sf, work_q) { - scmd = list_entry(lh, struct scsi_cmnd, eh_entry); - if (scsi_eh_eflags_chk(scmd, SCSI_EH_CANCEL_CMD) || + list_for_each_entry_safe(scmd, next, work_q, eh_entry) { + if ((scmd->eh_eflags & SCSI_EH_CANCEL_CMD) || SCSI_SENSE_VALID(scmd)) continue; @@ -742,9 +726,6 @@ */ if (scmd->serial_number == 0) return SUCCESS; - - scmd->owner = SCSI_OWNER_LOWLEVEL; - return scmd->device->host->hostt->eh_abort_handler(scmd); } @@ -815,20 +796,18 @@ static int scsi_eh_abort_cmds(struct list_head *work_q, struct list_head *done_q) { - struct list_head *lh, *lh_sf; - struct scsi_cmnd *scmd; + struct scsi_cmnd *scmd, *next; int rtn; - list_for_each_safe(lh, lh_sf, work_q) { - scmd = list_entry(lh, struct scsi_cmnd, eh_entry); - if (!scsi_eh_eflags_chk(scmd, SCSI_EH_CANCEL_CMD)) + list_for_each_entry_safe(scmd, next, work_q, eh_entry) { + if (!(scmd->eh_eflags & SCSI_EH_CANCEL_CMD)) continue; SCSI_LOG_ERROR_RECOVERY(3, printk("%s: aborting cmd:" "0x%p\n", current->comm, scmd)); rtn = scsi_try_to_abort_cmd(scmd); if (rtn == SUCCESS) { - scsi_eh_eflags_clr(scmd, SCSI_EH_CANCEL_CMD); + scmd->eh_eflags &= ~SCSI_EH_CANCEL_CMD; if (!scsi_device_online(scmd->device) || !scsi_eh_tur(scmd)) { scsi_eh_finish_cmd(scmd, done_q); @@ -862,10 +841,7 @@ if (!scmd->device->host->hostt->eh_device_reset_handler) return FAILED; - scmd->owner = SCSI_OWNER_LOWLEVEL; - rtn = scmd->device->host->hostt->eh_device_reset_handler(scmd); - if (rtn == SUCCESS) { scmd->device->was_reset = 1; scmd->device->expecting_cc_ua = 1; @@ -938,8 +914,7 @@ struct list_head *work_q, struct list_head *done_q) { - struct list_head *lh, *lh_sf; - struct scsi_cmnd *scmd, *stu_scmd; + struct scsi_cmnd *scmd, *stu_scmd, *next; struct scsi_device *sdev; shost_for_each_device(sdev, shost) { @@ -960,8 +935,8 @@ if (!scsi_eh_try_stu(stu_scmd)) { if (!scsi_device_online(sdev) || !scsi_eh_tur(stu_scmd)) { - list_for_each_safe(lh, lh_sf, work_q) { - scmd = list_entry(lh, struct scsi_cmnd, eh_entry); + list_for_each_entry_safe(scmd, next, + work_q, eh_entry) { if (scmd->device == sdev) scsi_eh_finish_cmd(scmd, done_q); } @@ -992,8 +967,7 @@ struct list_head *work_q, struct list_head *done_q) { - struct list_head *lh, *lh_sf; - struct scsi_cmnd *scmd, *bdr_scmd; + struct scsi_cmnd *scmd, *bdr_scmd, *next; struct scsi_device *sdev; int rtn; @@ -1015,11 +989,8 @@ if (rtn == SUCCESS) { if (!scsi_device_online(sdev) || !scsi_eh_tur(bdr_scmd)) { - list_for_each_safe(lh, lh_sf, - work_q) { - scmd = list_entry(lh, struct - scsi_cmnd, - eh_entry); + list_for_each_entry_safe(scmd, next, + work_q, eh_entry) { if (scmd->device == sdev) scsi_eh_finish_cmd(scmd, done_q); @@ -1048,7 +1019,6 @@ SCSI_LOG_ERROR_RECOVERY(3, printk("%s: Snd Bus RST\n", __FUNCTION__)); - scmd->owner = SCSI_OWNER_LOWLEVEL; if (!scmd->device->host->hostt->eh_bus_reset_handler) return FAILED; @@ -1077,7 +1047,6 @@ SCSI_LOG_ERROR_RECOVERY(3, printk("%s: Snd Host RST\n", __FUNCTION__)); - scmd->owner = SCSI_OWNER_LOWLEVEL; if (!scmd->device->host->hostt->eh_host_reset_handler) return FAILED; @@ -1104,9 +1073,7 @@ struct list_head *work_q, struct list_head *done_q) { - struct list_head *lh, *lh_sf; - struct scsi_cmnd *scmd; - struct scsi_cmnd *chan_scmd; + struct scsi_cmnd *scmd, *chan_scmd, *next; unsigned int channel; int rtn; @@ -1137,9 +1104,7 @@ channel)); rtn = scsi_try_bus_reset(chan_scmd); if (rtn == SUCCESS) { - list_for_each_safe(lh, lh_sf, work_q) { - scmd = list_entry(lh, struct scsi_cmnd, - eh_entry); + list_for_each_entry_safe(scmd, next, work_q, eh_entry) { if (channel == scmd->device->channel) if (!scsi_device_online(scmd->device) || !scsi_eh_tur(scmd)) @@ -1164,9 +1129,8 @@ static int scsi_eh_host_reset(struct list_head *work_q, struct list_head *done_q) { + struct scsi_cmnd *scmd, *next; int rtn; - struct list_head *lh, *lh_sf; - struct scsi_cmnd *scmd; if (!list_empty(work_q)) { scmd = list_entry(work_q->next, @@ -1177,8 +1141,7 @@ rtn = scsi_try_host_reset(scmd); if (rtn == SUCCESS) { - list_for_each_safe(lh, lh_sf, work_q) { - scmd = list_entry(lh, struct scsi_cmnd, eh_entry); + list_for_each_entry_safe(scmd, next, work_q, eh_entry) { if (!scsi_device_online(scmd->device) || (!scsi_eh_try_stu(scmd) && !scsi_eh_tur(scmd)) || !scsi_eh_tur(scmd)) @@ -1202,11 +1165,9 @@ static void scsi_eh_offline_sdevs(struct list_head *work_q, struct list_head *done_q) { - struct list_head *lh, *lh_sf; - struct scsi_cmnd *scmd; + struct scsi_cmnd *scmd, *next; - list_for_each_safe(lh, lh_sf, work_q) { - scmd = list_entry(lh, struct scsi_cmnd, eh_entry); + list_for_each_entry_safe(scmd, next, work_q, eh_entry) { printk(KERN_INFO "scsi: Device offlined - not" " ready after error recovery: host" " %d channel %d id %d lun %d\n", @@ -1215,7 +1176,7 @@ scmd->device->id, scmd->device->lun); scsi_device_set_state(scmd->device, SDEV_OFFLINE); - if (scsi_eh_eflags_chk(scmd, SCSI_EH_CANCEL_CMD)) { + if (scmd->eh_eflags & SCSI_EH_CANCEL_CMD) { /* * FIXME: Handle lost cmds. */ @@ -1534,12 +1495,10 @@ **/ static void scsi_eh_flush_done_q(struct list_head *done_q) { - struct list_head *lh, *lh_sf; - struct scsi_cmnd *scmd; + struct scsi_cmnd *scmd, *next; - list_for_each_safe(lh, lh_sf, done_q) { - scmd = list_entry(lh, struct scsi_cmnd, eh_entry); - list_del_init(lh); + list_for_each_entry_safe(scmd, next, done_q, eh_entry) { + list_del_init(&scmd->eh_entry); if (scsi_device_online(scmd->device) && !blk_noretry_request(scmd->request) && (++scmd->retries < scmd->allowed)) { @@ -1818,9 +1777,7 @@ scmd->request = &req; memset(&scmd->eh_timeout, 0, sizeof(scmd->eh_timeout)); scmd->request->rq_status = RQ_SCSI_BUSY; - scmd->state = SCSI_STATE_INITIALIZING; - scmd->owner = SCSI_OWNER_MIDLEVEL; - + memset(&scmd->cmnd, '\0', sizeof(scmd->cmnd)); scmd->scsi_done = scsi_reset_provider_done_command; @@ -1829,7 +1786,6 @@ scmd->bufflen = 0; scmd->request_buffer = NULL; scmd->request_bufflen = 0; - scmd->abort_reason = DID_ABORT; scmd->cmd_len = 0; Index: drivers/scsi/scsi_lib.c =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/scsi_lib.c (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/scsi_lib.c (mode:100644) @@ -146,12 +146,6 @@ device->device_blocked = device->max_device_blocked; /* - * Register the fact that we own the thing for now. - */ - cmd->state = SCSI_STATE_MLQUEUE; - cmd->owner = SCSI_OWNER_MIDLEVEL; - - /* * Decrement the counters, since these commands are no longer * active on the host/device. */ @@ -299,9 +293,7 @@ */ static int scsi_init_cmd_errh(struct scsi_cmnd *cmd) { - cmd->owner = SCSI_OWNER_MIDLEVEL; cmd->serial_number = 0; - cmd->abort_reason = 0; memset(cmd->sense_buffer, 0, sizeof cmd->sense_buffer); @@ -322,7 +314,6 @@ memcpy(cmd->data_cmnd, cmd->cmnd, sizeof(cmd->cmnd)); cmd->buffer = cmd->request_buffer; cmd->bufflen = cmd->request_bufflen; - cmd->abort_reason = 0; return 1; } Index: drivers/scsi/scsi_priv.h =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/scsi_priv.h (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/scsi_priv.h (mode:100644) @@ -13,17 +13,6 @@ /* - * These are the values that the owner field can take. - * They are used as an indication of who the command belongs to. - */ -#define SCSI_OWNER_HIGHLEVEL 0x100 -#define SCSI_OWNER_MIDLEVEL 0x101 -#define SCSI_OWNER_LOWLEVEL 0x102 -#define SCSI_OWNER_ERROR_HANDLER 0x103 -#define SCSI_OWNER_BH_HANDLER 0x104 -#define SCSI_OWNER_NOBODY 0x105 - -/* * Magic values for certain scsi structs. Shouldn't ever be used. */ #define SCSI_CMND_MAGIC 0xE25C23A5 @@ -32,15 +21,6 @@ /* * Scsi Error Handler Flags */ -#define scsi_eh_eflags_chk(scp, flags) \ - ((scp)->eh_eflags & (flags)) -#define scsi_eh_eflags_set(scp, flags) \ - do { (scp)->eh_eflags |= (flags); } while(0) -#define scsi_eh_eflags_clr(scp, flags) \ - do { (scp)->eh_eflags &= ~(flags); } while(0) -#define scsi_eh_eflags_clr_all(scp) \ - (scp->eh_eflags = 0) - #define SCSI_EH_CANCEL_CMD 0x0001 /* Cancel this cmd */ #define SCSI_EH_REC_TIMEOUT 0x0002 /* EH retry timed out */ Index: drivers/scsi/u14-34f.c =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/drivers/scsi/u14-34f.c (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/drivers/scsi/u14-34f.c (mode:100644) @@ -1372,15 +1372,6 @@ if (inb(sh[j]->io_port + REG_SYS_INTR) & IRQ_ASSERTED) printk("%s: abort, mbox %d, interrupt pending.\n", BN(j), i); - if (SCarg->eh_state == SCSI_STATE_TIMEOUT) { - unmap_dma(i, j); - SCarg->host_scribble = NULL; - HD(j)->cp_stat[i] = FREE; - printk("%s, abort, mbox %d, eh_state timeout, pid %ld.\n", - BN(j), i, SCarg->pid); - return SUCCESS; - } - return FAILED; } Index: include/scsi/scsi_cmnd.h =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/include/scsi/scsi_cmnd.h (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/include/scsi/scsi_cmnd.h (mode:100644) @@ -31,14 +31,11 @@ int sc_magic; struct scsi_device *device; - unsigned short state; - unsigned short owner; struct scsi_request *sc_request; struct list_head list; /* scsi_cmnd participates in queue lists */ struct list_head eh_entry; /* entry for the host eh_cmd_q */ - int eh_state; /* Used for state tracking in error handlr */ int eh_eflags; /* Used by error handlr */ void (*done) (struct scsi_cmnd *); /* Mid-level done function */ @@ -80,8 +77,6 @@ * sense info */ unsigned short use_sg; /* Number of pieces of scatter-gather */ unsigned short sglist_len; /* size of malloc'd scatter-gather list */ - unsigned short abort_reason; /* If the mid-level code requests an - * abort, this is the reason. */ unsigned bufflen; /* Size of data buffer */ void *buffer; /* Data buffer */ Index: include/scsi/scsi_host.h =================================================================== --- d1d56a4a3295f62a01fc06ffc764da474d2aa9b1/include/scsi/scsi_host.h (mode:100644) +++ bfabfde5f511dfb58f1b2cad2e3e5406c5a9cbb2/include/scsi/scsi_host.h (mode:100644) @@ -641,12 +641,6 @@ shost->host_lock = lock; } -static inline void scsi_set_device(struct Scsi_Host *shost, - struct device *dev) -{ - shost->shost_gendev.parent = dev; -} - static inline struct device *scsi_get_device(struct Scsi_Host *shost) { return shost->shost_gendev.parent;