summaryrefslogtreecommitdiff
path: root/drivers/scsi
AgeCommit message (Collapse)Author
2007-10-12[SCSI] advansys: Remove `active' queue and all remaining internal queueing codeMatthew Wilcox
The `active' list was used in the reset handler -- but the midlayer guarantees that list is empty by the time the reset handler is invoked. It was also checked in the interrupt routines to be sure that this command belonged to this board, but we don't need to check that either. We can then delete the asc_prt_target_stats() function as it will never print anything, along with asc_enqueue(), asc_dequeue_list(), asc_rmqueue(), asc_scsi_done_list(), struct asc_queue, ASC_QUEUE_EMPTY, ASC_TID_ALL, ASC_FRONT, ASC_BACK, and all the REQ* macros. Also remove this item from the todo list. Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] advansys: Remove `done' queueMatthew Wilcox
- Move the guts of asc_scsi_done_list() into a new function, asc_scsi_done. - Call asc_scsi_done() in asc_isr_callback() and adv_isr_callback(). The comment was wrong; scsi_done cannot enable interrupts. - All other places which queued an scp on the done list are error paths for queuecommand, and so we can just call asc_scsi_done() in queuecommand if we receive an error. - We no longer need to keep a list of done requests in advansys_interrupt Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] advansys: Remove a check for an impossible conditionMatthew Wilcox
The midlayer guarantees it won't call ->queuecommand for a host which is handling a reset condition. Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] advansys: Remove `waiting' queueMatthew Wilcox
If the adapter is busy, return the request to the midlayer rather than queueing it in the driver. asc_execute_queue() and asc_dequeue() become unused, and we don't need to print out stats on the waiting queue any more. Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] advansys: Shrink advansys_board_found a little moreMatthew Wilcox
Move the error reporting into AscInitGetConfig, AdvInitGetConfig and AscInitSetConfig. Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] advansys: Reformat microcodeMatthew Wilcox
It's just data, so format it to something that looks more visually appealing (and saves some lines) Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] advansys: Create AdvLoadMicrocodeMatthew Wilcox
Split AdvLoadMicrocode out of AdvInitAsc3550Driver, AdvInitAsc38C0800Driver and AdvInitAsc38C1600Driver. Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] advansys: Create AdvBuildCarrierFreelistMatthew Wilcox
Split AdvBuildCarrierFreelist out of AdvInitAsc3550Driver, AdvInitAsc38C0800Driver and AdvInitAsc38C1600Driver. Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] advansys: Fix VLB driver nameMatthew Wilcox
You can't have two drivers for the same bus type with the same name. Since ISA and VLB are both isa_drivers, rename the VLB one to advansys_vlb. Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] srp_transport: convert to use supported_mode attributeFUJITA Tomonori
srp transport works for target drivers without supported_mode attribute but it would be better to use it explicitly. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] fc_transport: add target driver supportFUJITA Tomonori
This adds minimum target driver support like the srp transport does: - fc_remote_port_{rolechg,delete} calls scsi_tgt_it_nexus_{create,destroy} for target drivers. - add callbacks to notify target drivers of the nexus and tmf operation results to fc_function_template. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] add supported_mode and active_mode attributes to the hostFUJITA Tomonori
This adds supported_mode and active_mode attributes to /sys/class/sys_host/hostX/ for specifying the mode that a lld supports and the currently activated mode. The output format is similar to fc rport roles: luce:/sys/class/scsi_host/host0$ cat supported_mode Initiator luce:/sys/class/scsi_host/host0$ cat active_mode Initiator The mode values uses bitmap since we would support dual-mode llds in the future like this: luce:/sys/class/scsi_host/host0$ cat supported_mode Initiator, Target The supported_mode attribute looks at a scsi_host_template and the active_mode attribute looks at a scsi_host. We would add a hook to a scsi_host_template to change the active_mode attribute dynamically. But now there is no hook since no lld supports that feature. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] tgt: fix can_queue bugFUJITA Tomonori
should use host->can_queue instead of host->hostt->can_queue. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Signed-off-by: Mike Christie <michaelc@cs.wisc.edu> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] aic94xx: Add new PCI ID for ASC58300Gilbert Wu
Add new HBA PCI ID (0x416) for ASC58300 which has eight port SAS and SATA PCI-X 133MHz low profile host bus adapter with two mini SAS 4x external connectors. Signed-off-by: Gilbert Wu <gilbert_wu@adaptec.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] hptiop: adding new firmware interface and more PCI device IDsHighPoint Linux Team
updated patch based on Jeff Garzik's comments. - check adapter firmware version and use appropriate interface accordingly - add new PCI device IDs and use PCI_VDEVICE macro - update driver version string - remove unused data structures - remove unnecessary typecasts Signed-off-by: HighPoint Linux Team <linux@highpoint-tech.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] scsi_transport_fc: Introduce disable_target_scan flagChristof Schmitt
This change has already been discussed on linux-scsi: http://marc.info/?t=118771096400003 http://marc.info/?t=118760913100005 Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> Signed-off-by: Swen Schillig <swen@vnet.ibm.com> Acked-by: James Smart <James.Smart@Emulex.Com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] kmalloc + memset conversion to kzallocMariusz Kozlowski
In NCR_D700, a4000t, aic7xxx_old, bvme6000, dpt_i2o, gdth, lpfc, megaraid, mvme16x osst, pluto, qla2xxx, zorro7xx Signed-off-by: Mariusz Kozlowski <m.kozlowski@tuxland.pl> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] dtc: clean up indent damage and add printk levelsAlan Cox
Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] make scsi_decode_sense_buffer and scsi_decode_sense_extras staticAdrian Bunk
Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] NCR5380: fix NCR53C400_PSEUDO_DMA is not definedGabriel C
In file included from drivers/scsi/g_NCR5380_mmio.c:9: drivers/scsi/g_NCR5380.c:559:5: warning: "NCR53C400_PSEUDO_DMA" is not defined Signed-off-by: Gabriel Craciunescu <nix.or.die@googlemail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] scsi_error.c should #include "scsi_transport_api.h"Adrian Bunk
Every file should #include the headers containing the prototypes for its global functions (in this case for scsi_schedule_eh()). Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] ips: warning fixAndrew Morton
drivers/scsi/ips.c: In function 'ips_insert_device': drivers/scsi/ips.c:6957: warning: 'index' may be used uninitialized in this function Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] NCR_D700, lpfc: Clean up duplicate includesJesper Juhl
Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Acked-by: James Smart <james.smart@emulex.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] aacraid: rename check_resetAndrew Morton
Too generic, clashes with ISDN. Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Acked-by: Mark Salyzyn <aacraid@adaptec.com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] lpfc: fix potential overflow of hbqs arrayJesper Juhl
The Coverity checker noticed that we may overrun a statically allocated array in drivers/scsi/lpfc/lpfc_sli.c::lpfc_sli_hbqbuf_find(). The case is this; In 'struct lpfc_hba' we have #define LPFC_MAX_HBQS 4 ... struct lpfc_hba { ... struct hbq_s hbqs[LPFC_MAX_HBQS]; ... }; But then in lpfc_sli_hbqbuf_find() we have this code hbqno = tag >> 16; if (hbqno > LPFC_MAX_HBQS) return NULL; if 'hbqno' ends up as exactely 4, then we won't return, and then this list_for_each_entry(d_buf, &phba->hbqs[hbqno].hbq_buffer_list, list) { will cause an overflow of the statically allocated array at index 4, since the valid indices are only 0-3. I propose this patch, that simply changes the 'hbqno > LPFC_MAX_HBQS' into 'hbqno >= LPFC_MAX_HBQS' as a possible fix. Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Acked-by: James Smart <James.Smart@Emulex.Com> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] advansys: Move documentation to Documentation/scsiMatthew Wilcox
The 700+-line comment at the top of the advansys driver fits more comfortably in Documentation/scsi. Delete the sections on: - kernels supported - other files modified (obsolete) - source comments (obsolete) - tests to run - release history (that's what a VCS is for) - contacting connectcom (the domain has expired and the phone number is now in use by another organisation) Known problems/fix list is moved down to the section where jejb put his FIXME. Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] advansys: use memcpy instead of open-coded loopMatthew Wilcox
Use memcpy to initialise eep_config instead of a loop. For AdvInitFrom38C1600EEP where we need to modify the default EEPROM configuration, do it after the loop, and do it using the structure definition, not by finding the right byte. I think it was wrong for big-endian machines. Also delete some non-useful comments and prototypes. Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] advansys: Remove pci_slot_infoMatthew Wilcox
The driver kept a copy of the PCI config address; refer to the pci_dev associated with the card instead. Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] advansys: Remove library-style callback routinesMatthew Wilcox
Convert adv_isr_callback, adv_async_callback and asc_isr_callback into direct calls. Remove the unused asc_exe_callback. Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] advansys: Move struct device out of the cfg structuresMatthew Wilcox
The cfg structures are supposed to be disposable after initialisation; with the 'dev' used for DMA mapping in there, that's not possible. Move the dev to the board. Also inline AscInitFromAscDvcVar into its only caller, remove some unnecessary prototypes and sort out a few minor formatting issues. Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] advansys: Stop using n_io_port in Scsi_Host structureMatthew Wilcox
n_io_port isn't suitable for advansys because some of the boards have more than 255 bytes of io port space. There's already a driver-private replacement, asc_n_io_port, but for some reason the driver was still setting and occasionally reporting n_io_port. Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] advansys: ioremap no longer needs page-aligned addressesMatthew Wilcox
At some point during Linux 2.1 development, ioremap() gained the ability to handle addresses which weren't page-aligned. Also expand the CONFIG_PCI range to encompass that entire section of wide board initialisation, since all wide boards are PCI. Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] advansys: delete AscGetChipBusTypeMatthew Wilcox
By moving a test from AscGetChipBusType into its only caller, we can delete the whole function Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] advansys: misc reformattingMatthew Wilcox
Remove some useless forward declarations Reformat some comments, debug messages, and the occasional piece of real code Removal of unnecessary braces Remove duplicate setting of shost->irq Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] advansys: remove INQUIRY sniffingMatthew Wilcox
Use slave_configure() to do all the work that used to be done in AscInquiryHandling and AdvInquiryHandling. Split slave_configure into two functions, one for wide and one for narrow controllers. Remove some unused definitions, duplicate definitions, unnecessary declarations, and scsireqq, cap_info and inquiry from struct asc_board. Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] Add QUANTUM XP34301 to the blacklistMatthew Wilcox
According to the AdvanSys driver, this device has a problem with tagged queueing. Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] advansys: remove AscCompareString()Matthew Wilcox
AscCompareString() is just another name for strncmp Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] advansys: More PCI cleanupsMatthew Wilcox
- Remove wrappers around the PCI configuration space accessors - Call pci_set_master() instead of poking at config space directly - Move the latency setting into one function called for both narrow and wide boards. - Tidy up AdvInitGetConfig() a little. - Delete a few unused prototypes and definitions. Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] advansys: Update resource managementMatthew Wilcox
Make sure the resources are reserved and released by all the callers of advansys_board_found(). This eliminates the check_region-style race. It also allows us to use the pci_request_regions() API. Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] advansys: Convert to ISA driver modelMatthew Wilcox
Register two isa_drivers, one for ISA and one for VLB, in order to preserve detection order. When deleting advansys_detect, we lose the last vestiges of the code that limited IO port scanning. This code has been effectively disabled for many years anyway; I'll restore it in a module_param later. We also lose the code that placed all ISA PnP cards into WaitForKey state -- drivers shouldn't be doing this anyway. The asc_host array goes away too. Also remove some IOADR and other definitions, such as ASC_NUM_BOARD_SUPPORTED. Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] advansys: Convert to EISA driver modelMatthew Wilcox
- Switch EISA probing to the driver model - Remove some now-unused macros and functions - Update the FIXME now that we use the correct driver model probing API Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] advansys: Convert to PCI driver modelMatthew Wilcox
- Add a pci_driver interface for the PCI advansys devices (for ISA/EISA/VLB devices, we still call advansys_detect). - Many functions are converted from __init to __devinit to allow hotplug PCI to work. - Only keep devices found by advansys_detect in the asc_host list. - Rename asc_board_count to asc_legacy_count. New asc_board_count is only used to generate a unique name for each device. - Remove some now-unused macros and struct definitions Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] advansys: Move to scsi hotplug initialisation modelMatthew Wilcox
- Switch from scsi_register/scsi_unregister to scsi_host_alloc, scsi_add_host, scsi_scan_host and scsi_host_put. - Rename the scsi_host_template to advansys_template - Use module_init and module_exit instead of scsi_module.c - Remove protection against advansys_detect being called twice Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] advansys: Make advansys_board_found a little more readableMatthew Wilcox
- Put all the error cleanup at the end of the function and goto the appropriate label - Split advansys_wide_init_chip out of advansys_board_found - Split advansys_wide_free_mem out of advansys_board_found. Use it from advansys_release - Use GFP_KERNEL, not GFP_ATOMIC, when allocating memory during initialisation - Eliminate lots of PROC_FS ifdefs by removing the ifdefs around the prtbuf struct member Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] advansys: Stop checking the scsi_cmnd belongs to our Scsi_HostMatthew Wilcox
The interrupt routines used to walk the list of Scsi_Hosts belonging to this driver to make sure that the scsi_cmnd belonged to one of them. This is a waste of time and gets in the way of later cleanups, so delete it. Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] advansys: Improve interrupt handlerMatthew Wilcox
Pass the Scsi_Host to the interrupt handler, rather than polling all hosts for each interrupt. Return IRQ_NONE if we didn't handle this interrupt Don't set the IRQF_DISABLED flag; this is not a fast-executing interrupt handler. Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] advansys: Clean up proc_info implementationMatthew Wilcox
Just use the Scsi_Host passed in, rather than looking through the driver's own array of boards for one that matches it. Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] advansys: undate version, copyright, etcMatthew Wilcox
Update the version to 3.4 Add my copyright Add myself to MAINTAINERS Exercise my right to change the license from dual BSD/GPL to GPL Don't force the definition of CONFIG_ISA on x86 Always include pci.h Stop including stat.h Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] sg: increase sglist_len of the sg_scatter_hold structureFUJITA Tomonori
unsigned short is too small for sizeof(struct scatterlist) * min(q->max_hw_segments, q->max_phys_segments). This fixes memory leak with 4096 segments since 16 (likely sg size with x86) * 4096 sets sglist_len to zero. This might not happen without sg chaining support. Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Acked-by: Douglas Gilbert <dougg@torque.net> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
2007-10-12[SCSI] Fix async scanning double-add problemsMatthew Wilcox
Stress-testing and some thought has revealed some places where asynchronous scanning needs some more attention to locking. - Since async_scan is a bit, we need to hold the host_lock while modifying it to prevent races against other CPUs modifying the word that bit is in. This is probably a theoretical race for the moment, but other patches may change that. - The async_scan bit means not only that this host is being scanned asynchronously, but that all the devices attached to this host are not yet added to sysfs. So we must ensure that this bit is always in sync. I've chosen to do this with the scan_mutex since it's already acquired in most of the right places. - If the host changes state to deleted while we're in the middle of a scan, we'll end up with some devices on the host's list which must be deleted. Add a check to scsi_sysfs_add_devices() to ensure the host is still running. - To avoid the async_scan bit being protected by three locks, the async_scan_lock now only protects the scanning_list. Signed-off-by: Matthew Wilcox <matthew@wil.cx> Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>