summaryrefslogtreecommitdiff
path: root/include/linux/ide.h
AgeCommit message (Collapse)Author
2005-05-26[PATCH] convert IDE device drivers to driver-modelBartlomiej Zolnierkiewicz
* add ide_bus_match() and export ide_bus_type * split ide_remove_driver_from_hwgroup() out of ide_unregister() * move device cleanup from ide_unregister() to drive_release_dev() * convert ide_driver_t->name to driver->name * convert ide_driver_t->{attach,cleanup} to driver->{probe,remove} * remove ide_driver_t->busy as ide_bus_type->subsys.rwsem protects against concurrent ->{probe,remove} calls * make ide_{un}register_driver() void as it cannot fail now * use driver_{un}register() directly, remove ide_{un}register_driver() * use device_register() instead of ata_attach(), remove ata_attach() * add proc_print_driver() and ide_drivers_show(), remove ide_drivers_op * fix ide_replace_subdriver() and move it to ide-proc.c * remove ide_driver_t->drives, ide_drives and drives_lock * remove ide_driver_t->drivers, drivers and drivers_lock * remove ide_drive_t->driver and DRIVER() macro Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl>
2005-04-02[ide] kill ide_drive_t->diskBartlomiej Zolnierkiewicz
* move ->disk from ide_drive_t to driver specific objects * make drivers allocate struct gendisk and setup rq->rq_disk (there is no need to do this for REQ_DRIVE_TASKFILE requests) * add ide_init_disk() helper and kill alloc_disks() in ide-probe.c * kill no longer needed ide_open() and ide_fops[] in ide.c ide_init_disk() fixed by Andrew Morton <akpm@osdl.org>. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2005-04-02[ide] add ide_{un}register_region()Bartlomiej Zolnierkiewicz
Add ide_{un}register_region() and fix ide-{tape,scsi}.c to register block device number ranges. In ata_probe() only probe for modules. Behavior is unchanged because: * if driver is already loaded and attached to drive ata_probe() is not called et all * if driver is loaded by ata_probe() it will register new number range for a drive and this range will be found by kobj_lookup() If this is not clear please read http://lwn.net/Articles/25711/ and see drivers/base/map.c. This patch makes it possible to move drive->disk allocation from ide-probe.c to device drivers. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2005-03-18[ide] make ide_generic_ioctl() take ide_drive_t * as an argumentBartlomiej Zolnierkiewicz
As a result disk->private_data can be used by device drivers now. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2005-03-10[ide] kill ide_driver_t->capacityBartlomiej Zolnierkiewicz
* add private /proc/ide/hd?/capacity handlers to ide-{cd,disk,floppy}.c * use generic proc_ide_read_capacity() for ide-{scsi,tape}.c * kill ->capacity, default_capacity() and generic_subdriver_entries[] Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2005-03-10[ide] kill ide_driver_t->pre_resetBartlomiej Zolnierkiewicz
Add ide_drive_t->post_reset flag and use it to signal post reset condition to the ide-tape driver (the only user of ->pre_reset). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2005-03-10[ide] fix some rare ide-default vs ide-disk racesBartlomiej Zolnierkiewicz
Some rare races between ide-default and ide-disk are possible, i.e.: * ide-default is used, I/O request is triggered (ie. /proc/ide/hd?/identify), drive->special is cleared silently (so CHS is not initialized properly), ide-disk is loaded and fails if drive uses CHS * ide-disk is used, drive is resetted, ide-disk is unloaded, ide-default takes control over drive and on the first I/O request silently clears drive->special without restoring settings Fix them by moving idedisk_{special,pre_reset}() and company to IDE core. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2005-03-10[ide] generic Power Management for IDE devicesBartlomiej Zolnierkiewicz
Move PM code from ide-cd.c and ide-disk.c to IDE core so: * PM is supported for other ATAPI devices (floppy, tape) * PM is supported even if specific driver is not loaded Also s/HWIF(drive)/drive->hwif/ while at it. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2005-03-07[PATCH] rework core barrier supportJens Axboe
This reworks the core barrier support to be a lot nicer, so that all the nasty code resides outside of drivers/ide. It requires minimal changes to support in a driver, I've added SCSI support as an example. The ide code is adapted to the new code. With this patch, we support full barriers on sata now. Bart has acked the addition to -mm, I would like for this to be submitted as soon as 2.6.12 opens. Signed-off-by: Jens Axboe <axboe@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-02-24[ide] fix build for built-in hpt366 and modular ide-diskBartlomiej Zolnierkiewicz
* always call __ide_do_rw_disk() in ide_do_rw_disk() * modify ide_hwif_t->rw_disk hook accordingly * update and cleanup hpt372n_rw_disk() (the only user of ide_hwif_t->rw_disk hook) * make __ide_do_rw_disk() static + fix comment Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2005-02-24[ide] make 1-bit fields unsignedRandy Dunlap
It's a bit difficult to have a value and a sign bit in a 1-bit field. Fix (90) boolean/bitfield sparse warnings: include/linux/ide.h:937:18: warning: dubious one-bit signed bitfield include/linux/ide.h:939:17: warning: dubious one-bit signed bitfield Signed-off-by: Randy Dunlap <rddunlap@osdl.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2005-02-06[ide] remove unused pkt_task_t definition from ide.hTejun Heo
Signed-off-by: Tejun Heo <tj@home-tj.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2005-02-03[ide] add ide_hwgroup_t.pollingTejun Heo
ide_hwgroup_t.polling field added. 0 in poll_timeout field used to indicate inactive polling but because 0 is a valid jiffy value, though slim, there's a chance that something weird can happen. Signed-off-by: Tejun Heo <tj@home-tj.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2005-02-03[ide] add ide_drive_t.sleepingTejun Heo
ide_drive_t.sleeping field added. 0 in sleep field used to indicate inactive sleeping but because 0 is a valid jiffy value, though slim, there's a chance that something can go weird. And while at it, explicit jiffy comparisons are converted to use time_before() macros. Signed-off-by: Tejun Heo <tj@home-tj.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2005-02-03[ide] possible cleanupsAdrian Bunk
This patch contains the following possible cleanups: - make some needlessly global code static - ide-dma.c: remove the unneeded EXPORT_SYMBOL(__ide_dma_test_irq) slightly changed by me (bart) Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2005-02-03[ide] unexport atapi_*_bytes() and ide_read_24()Arjan van de Ven
From: Arjan van de Ven <arjan@infradead.org> * make atapi_{input,output}_bytes() static, fix users to use drive->hwif * remove ide_read_24() export; it's unused since the ide-io.c reorganization * add a FIXME comment to the ide_fix_driveid() export slightly changed by me (bart) Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2005-02-03[ide] remove WAIT_READY dependency on APMAdrian Bunk
On the one hand APM isn't enabled on all laptops. On the other hand, this also affects regular PCs with APM support (or using a distribution kernel with APM support). The time for the !APM case was already increased from 30msec in 2.4 . Isn't there a timeout that is suitable for all cases? Alan Cox answered: > The five seconds should be just fine for all cases. The smaller value > with no > power manglement should help speed up recovery however. It probably > doesn't belong CONFIG_APM now ACPI and friends are involved either. Until someone has a real good solution (consider e.g. that most PC users might have ACPI support enabled), this patch unconditionally sets WAIT_READY to 5 seconds. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2005-01-15[ide] icside: use ide_dma_intr()Bartlomiej Zolnierkiewicz
Make ide_dma_intr() always available if CONFIG_BLK_DEV_IDEDMA=y and use it instead of icside_dmaintr(). Acked by Russell. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2005-01-15[ide] kill ide_drive_t->suspend_resetBartlomiej Zolnierkiewicz
This cruft pre-dates benh's PowerManagement code. Moreover ->suspend_reset is always equal to zero. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2005-01-15[ide] make try_to_flush_leftover_data() staticBartlomiej Zolnierkiewicz
Hi, now that you cleaned up the ide-io.c code to be all in the right file, try_to_flush_leftover_data can become static since all users are in this file now. bart: also remove declaration from <linux/ide.h> Signed-off-by: Arjan van de Ven <arjan@infradead.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2005-01-07[ide] kill current_capacity()Bartlomiej Zolnierkiewicz
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2005-01-07[ide] ide_driver_t->abort() cleanupBartlomiej Zolnierkiewicz
* add drive->media != ide_disk check to ide_abort() * kill ide_cdrom_abort() and idedisk_abort() * split __ide_abort() out of ide_abort() * call driver->abort() inside ide_abort() * convert the only user of driver->abort() * fix default_abort() and idescsi_atapi_abort() * make idescsi_atapi_abort() static Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2005-01-07[ide] rework ide_driver_t->errorBartlomiej Zolnierkiewicz
* split __ide_error() out of ide_error() * call driver->error() inside ide_error() * convert all users of driver->error() * fix default_cleanup() and idescsi_atapi_error() * make idescsi_atapi_error() static Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2005-01-07[ide] cleanup ide_dump_status()Bartlomiej Zolnierkiewicz
* move idedisk_dump_status() and ide_dump_status() to ide-lib.c * rename idedisk_dump_status() to ide_dump_ata_status() * use ide_dump_{ata,atapi}_status() in ide_dump_status() * use ide_dump_status() in ide-cd.c, ide-disk.c and ide-scsi.c * make ide_dump_opcode() and ide_dump_atapi_status)() static Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2005-01-07[ide] add ide_dump_opcode()Bartlomiej Zolnierkiewicz
* add it to ide-lib.c and cleanup ide{disk}_dump_status() * as a bonus it fixes unknown opcode reporting in ide_dump_status() * use ide_dump_opcode() in ide_dump_atapi_status() Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2005-01-07[ide] kill write-only ide_driver_t->senseBartlomiej Zolnierkiewicz
also kill default_sense() in ide.c Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2004-12-30[ide] make host drivers aware of the changes made to ide_setup_pci_device{s}Bartlomiej Zolnierkiewicz
- nothing clever here: the most noticeable change is the change of returned value for (*init_setup) in struct ide_pci_device_s which goes from void to int. Anything else is editing and checking for errors in the output of the compiler; - pci_disable_device() added for the error path in pci_init_sgiioc4(); - BUG() removed in amd74xx_probe(): good old printk() is enough. Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2004-12-30[ide] propagation of error code in PCI IDE setupBartlomiej Zolnierkiewicz
- Change the return value and the prototype of do_ide_setup_pci_device Due to lack of appropriate return status code, the current clients of do_ide_setup_pci_device() can not distinguish a failing invocation from a successfull one. The patch modify do_ide_setup_pci_device() so that it can propagate some of the errors from the lower layers. - Make ide_setup_pci_device() aware of the change and propagate the news itself. I only gave a quick sight to create_proc_ide_interfaces() (and ide_remove_proc_entries()) but they do seem sane and it should not matter if it fails or not. - ide_setup_pci_devices(): mostly the same thing than ide_setup_pci_device(). do not look trivially suspect. Signed-off-by: Francois Romieu <romieu@fr.zoreil.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2004-11-06[ide] siimage: fix the various SI3112 hangsBartlomiej Zolnierkiewicz
From: Alan Cox <alan@lxorguk.ukuu.org.uk> (some changes by me - bart) The current driver looks at fields before it is safe to, we move the mod15rm bug handler to be a fixup and this ensures the probe has been completed before we use the ident data. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2004-11-06[ide] apply undecoded slave fixup only for ide-csBartlomiej Zolnierkiewicz
From: Alan Cox <alan@lxorguk.ukuu.org.uk> (some changes by me - bart) We add probe_hwif_init_with_fixup (seperate naming as requested by Bartlomiej). This runs a fixup on present interfaces before attaching the drives. In order to be useful we need also an _with_fixup version of ide_register_hw function. The sometimes troublesome undecoded slave detector is moved to its own function and exported so that ide-cs and the upcoming delkin_cb can both use it (along with any arch specific cf/pcmcia drivers I don't know about). The non-relevant checks for this scenario are removed. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2004-11-06[ide] remove some cruft from ide.hBartlomiej Zolnierkiewicz
From: Chris Wedgwood <cw@f00f.org> (minor changes by me - bart) Remove some accumulated (unused) cruft from ide.h Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2004-11-05[ide] shrink hw_regs_tBartlomiej Zolnierkiewicz
sata_[misc,scr] and priv are write-only Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2004-11-01[ide] remove more dead ide exportsBartlomiej Zolnierkiewicz
From: Christoph Hellwig <hch@lst.de> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2004-10-29[ide] ide-disk: enable stroke by defaultBartlomiej Zolnierkiewicz
From: Jens Axboe <axboe@suse.de> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2004-10-29[ide] kill IDEPCI_FLAG_FORCE_MASTERBartlomiej Zolnierkiewicz
cs5530 overrides hwif->autodma anyway. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2004-10-29[ide] setup-pci: simplify autodma logicBartlomiej Zolnierkiewicz
Do not set hwif->autodma in ide_pci_setup_ports(). All DMA capable PCI host drivers override it. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2004-10-29[ide] remove hwif from /proc/ide/ as part of ide_unregister_hwif()Bartlomiej Zolnierkiewicz
Original patch from Mark Lord <lkml@rtr.ca>. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2004-10-27[ide] remove needless exports from ide-taskfile.cBartlomiej Zolnierkiewicz
Also remove unused MAX_DMA define. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2004-10-27[ide] add ide_use_dma()Bartlomiej Zolnierkiewicz
Should prevent bugs like the recent piix one in the future. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2004-10-22[ide] kill ide_hwif_t->ide_dma_verboseBartlomiej Zolnierkiewicz
* make __ide_dma_verbose() void and drop "__" prefix * ide_dma_verbose() is always available now * use it instead of ide_hwif_t->ide_dma_verbose * sgiioc4.c version reported wrong mode * icside.c version repeated info given by ->ide_dma_check() Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2004-10-22[ide] ide-scsi: simplify+speedup DMA supportBartlomiej Zolnierkiewicz
* add hwif->sg_mapped flag * add idescsi_map_sg() converting scsi_cmd->sg into hwif->sg_table (this removes need for rq->bio) * remove code (de)allocating rq->bio Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2004-10-22[ide] kill ide_raw_build_sglist()Bartlomiej Zolnierkiewicz
ide_build_sglist() can be now used for REQ_DRIVE_TASKFILE requests. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2004-10-21[ide] remove broken pdc4030 driverBartlomiej Zolnierkiewicz
Sigh, I broke it by accident 16 months ago and nobody has noticed (I suspect that it was non-functional even earlier). Additionally, this driver: * should be converted to use scatterlists * has verbose debugging enabled by default * needs hacks all over IDE code * is guilty of crimes against ide_hwifs[] Just remove it for now. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2004-10-20[ide] unify PIO codeBartlomiej Zolnierkiewicz
Use PIO code from ide-taskfile.c in ide-disk.c so: * drive status is checked after PIO read * request is failed if invalid data phase is detected during PIO write Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2004-10-20[ide] sg PIO for fs requestsBartlomiej Zolnierkiewicz
Convert CONFIG_IDE_TASKFILE_IO=n code to use scatterlists for PIO transfers. Fixes longstanding 'data integrity on error' issue and makes barriers work with PIO. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2004-10-20[ide] sg PIO for taskfile requestsBartlomiej Zolnierkiewicz
Use scatterlists for taskfile based PIO transfers instead of directly walking rq->[bio,cbio] lists. If CONFIG_IDE_TASKFILE_IO is defined this code will be used for fs requests. ide_pio_sector() is based on ata_pio_sector() from libata-core.c so kudos to Jeff. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2004-10-20[ide] always allocate hwif->sg_tableBartlomiej Zolnierkiewicz
Allocate hwif->sg_table in hwif_init() so it can also be used for PIO. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2004-10-20[ide] convert ide_hwif_t->ide_dma_begin() to ->dma_start()Bartlomiej Zolnierkiewicz
Make ->ide_dma_begin() functions void and rename them to ->dma_start(). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2004-10-20[ide] add ide_hwif_t->dma_exec_cmd()Bartlomiej Zolnierkiewicz
* split off ->dma_exec_cmd() from ->ide_dma_[read,write] functions * choose command to execute by ->dma_exec_cmd() in higher layers and remove ->ide_dma_[read,write] * in Etrax ide.c driver REQ_DRIVE_TASKFILE requests weren't handled properly for drive->addressing == 0 * in trm290.c read and write commands were interchanged * in sgiioc4.c commands weren't sent to disk devices Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2004-10-20[ide] add ide_hwif_t->dma_setup()Bartlomiej Zolnierkiewicz
* tag REQ_DRIVE_TASKFILE write requests with REQ_RW * split off ->dma_setup() from ->ide_dma_[read,write] functions * use ->dma_setup() directly in ATAPI drivers and remove media checks from ->ide_dma_[read,write] * ->ide_dma_[read,write,begin] cannot fail now * in Etrax ide.c setup DMA for ATAPI devices before sending command to drive (so setup order is the same as for disks) Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>