summaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-iops.c
Commit message (Collapse)AuthorAgeFilesLines
* ide: remove ide_task_t typedefBartlomiej Zolnierkiewicz2009-03-271-15/+15
| | | | | | | | | | | | | | While at it: - rename struct ide_task_s to struct ide_cmd - remove stale comments from idedisk_{read_native,set}_max_address() - drop unused 'cmd' argument from ide_{cmd,task}_ioctl() - drop unused 'task' argument from tx4939ide_tf_load_fixup() - rename ide_complete_task() to ide_complete_cmd() - use consistent naming for struct ide_cmd variables There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: use try_to_identify() in ide_driveid_update()Bartlomiej Zolnierkiewicz2009-03-241-50/+4
| | | | | | | | | | | | | * Pass pointer to buffer for IDENTIFY data to do_identify() and try_to_identify(). * Un-static try_to_identify() and use it in ide_driveid_update(). * Rename try_to_identify() to ide_dev_read_id(). There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: clear drive IRQ after re-enabling local IRQs in ide_driveid_update()Bartlomiej Zolnierkiewicz2009-03-241-2/+2
| | | | | | | | | Clear drive IRQ after re-enabling local IRQs in ide_driveid_update() to match try_to_identify(). Also remove superfluous local_irq_enable() call while at it. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: sanitize SELECT_MASK() usage in ide_driveid_update()Bartlomiej Zolnierkiewicz2009-03-241-1/+3
| | | | | | Call SELECT_MASK() after ide_fix_driveid(). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: shorten timeout value in ide_driveid_update()Bartlomiej Zolnierkiewicz2009-03-241-1/+1
| | | | | | | Shorten timeout value in ide_driveid_update() (30s -> 15s) to match try_to_identify(). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: propagate AltStatus workarounds to ide_driveid_update()Bartlomiej Zolnierkiewicz2009-03-241-3/+18
| | | | | | | Propagate AltStatus workarounds from try_to_identify() to ide_driveid_update(). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: fix kmalloc() failure handling in ide_driveid_update()Bartlomiej Zolnierkiewicz2009-03-241-13/+20
| | | | | | | | | | | | | | | * Doing kmalloc() in the middle of command execution is not only ugly but leaves drive waiting to send data on kmalloc() failure. Fix it. While at it: * Unify error code paths. * Fixup error message to be more useful and add missing KERN_ERR level. * Rename 'stat' variable to 's'. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: move error handling code to ide-eh.c (v2)Bartlomiej Zolnierkiewicz2009-03-241-297/+2
| | | | | | | | | Do some CodingStyle fixups in <linux/ide.h> while at it. v2: Add missing <linux/delay.h> include (reported by Stephen Rothwell). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: checkpatch.pl fixes for ide-iops.cBartlomiej Zolnierkiewicz2009-03-241-25/+23
| | | | | | | | | | | Fix following checkpatch.pl warnings/errors: - WARNING: space prohibited between function name and open parenthesis '(' - WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable - WARNING: line over 80 characters - ERROR: trailing whitespace - ERROR: space required before the open parenthesis '(' Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: fix comments in ide_config_drive_speed()Bartlomiej Zolnierkiewicz2009-03-241-6/+3
| | | | | Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: fix printk() levels in [atapi_]reset_pollfunc()Bartlomiej Zolnierkiewicz2009-03-241-4/+5
| | | | | Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: move standard I/O code to ide-io-std.cBartlomiej Zolnierkiewicz2009-03-241-313/+0
| | | | | Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: move ide_read_bcount_and_ireason() to ide-atapi.cBartlomiej Zolnierkiewicz2009-03-241-15/+0
| | | | Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: move drive_is_ready() to ide-io.cBartlomiej Zolnierkiewicz2009-03-241-25/+0
| | | | | | | | | Move drive_is_ready() to ide-io.c, then make it static. Also make some minor CodingStyle fixups while at it. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: remove stale comments from drive_is_ready()Bartlomiej Zolnierkiewicz2009-03-241-9/+0
| | | | Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: add ide_for_each_present_dev() iteratorBartlomiej Zolnierkiewicz2009-03-241-3/+2
| | | | | | | | | | * Add ide_for_each_present_dev() iterator and convert IDE code to use it. * Do some drive-by CodingStyle fixups in ide-acpi.c while at it. There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide-iops: fix odd-length ATAPI PIO transfersSergei Shtylyov2009-03-051-0/+2
| | | | | | | | | Commit 9567b349f7e7dd7e2483db99ee8e4a6fe0caca38 (ide: merge ->atapi_*put_bytes and ->ata_*put_data methods) introduced a regression WRT the odd-length ATAPI PIO transfers -- the final word didn't get written (causing command timeouts). Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: fix accidental LOCKDEP breakage caused by local_irq_set() removalBartlomiej Zolnierkiewicz2009-01-141-1/+1
| | | | | | | | | | | commit 54cc1428cfa619e16d75baae8cb041a2eff015f0 ("ide: remove local_irq_set() macro") accidentally replaced local_save_flags() by local_irq_set() in ide_probe_port() and __ide_wait_stat() which resulted in LOCKDEP breakage. Reported-by: Larry Finger <Larry.Finger@lwfinger.net> Tested-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: move read_sff_dma_status() method to 'struct ide_dma_ops'Sergei Shtylyov2009-01-061-10/+0
| | | | | | | | | | | | Move apparently misplaced read_sff_dma_status() method from 'struct ide_tp_ops' to 'struct ide_dma_ops', renaming it to dma_sff_read_status() and making only required for SFF-8038i compatible IDE controller drivers (greatly cutting down the number of initializers) as its only user (outside ide-dma-sff.c and such drivers) appears to be ide_pci_check_simplex() which is only called for such controllers... Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: add port and host iteratorsBartlomiej Zolnierkiewicz2009-01-061-6/+5
| | | | | | | | | | | | | | | Add ide_port_for_each_dev() / ide_host_for_each_port() iterators and update IDE code to use them. While at it: - s/unit/i/ variable in ide_port_wait_ready(), ide_probe_port(), ide_port_tune_devices(), ide_port_init_devices_data(), do_reset1(), ide_acpi_set_state() and scc_dma_end() - s/d/i/ variable in ide_proc_port_register_devices() There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: dynamic allocation of device structuresBartlomiej Zolnierkiewicz2009-01-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Allocate device structures dynamically instead of having them embedded in ide_hwif_t: * Remove needless zeroing of port structure from ide_init_port_data(). * Add ide_hwif_t.devices[MAX_DRIVES] (table of pointers to the devices). * Add ide_port_{alloc,free}_devices() helpers and use them respectively in ide_{host,free}_alloc(). * Convert all users of ->drives[] to use ->devices[] instead. While at it: * Use drive->dn for the slave device check in scc_pata.c. As a nice side-effect this patch cuts ~1kB (x86-32) from the resulting code size: text data bss dec hex filename 53963 1244 237 55444 d894 drivers/ide/ide-core.o.before 52981 1244 237 54462 d4be drivers/ide/ide-core.o.after Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: unexport ide_wait_not_busy()Bartlomiej Zolnierkiewicz2009-01-061-3/+0
| | | | Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: remove local_irq_set() macroBartlomiej Zolnierkiewicz2009-01-061-1/+2
| | | | Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: remove HWIF() macroBartlomiej Zolnierkiewicz2009-01-061-2/+2
| | | | Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: merge ide_hwgroup_t with ide_hwif_t (v2)Bartlomiej Zolnierkiewicz2009-01-061-37/+32
| | | | | | | | | | | | | | | | | | | * Merge ide_hwgroup_t with ide_hwif_t. * Cleanup init_irq() accordingly, then remove no longer needed ide_remove_port_from_hwgroup() and ide_ports[]. * Remove now unused HWGROUP() macro. While at it: * ide_dump_ata_error() fixups v2: * Fix ->quirk_list check in do_ide_request() (s/hwif->cur_dev/prev_port->cur_dev). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: replace the global ide_lock spinlock by per-hwgroup spinlocks (v2)Bartlomiej Zolnierkiewicz2008-12-291-25/+23
| | | | | | | | | | | | | | | | | | | | | | Now that (almost) all host drivers have been fixed not to abuse ide_lock and core code usage of ide_lock has been sanitized we may safely replace ide_lock by per-hwgroup locks. This patch is partially based on earlier patch from Ravikiran G Thirumalai. While at it: - don't use deprecated HWIF() and HWGROUP() macros - update locking documentation in ide.h v2: Add missing spin_lock_init(&hwgroup->lock). (Noticed by Elias Oltmanns) Cc: Vaibhav V. Nivargi <vaibhav.nivargi@gmail.com> Cc: Alok N. Kataria <alokk@calsoftinc.com> Cc: Shai Fultheim <shai@scalex86.org> Signed-off-by: Ravikiran Thirumalai <kiran@scalex86.org> Cc: Elias Oltmanns <eo@nebensachen.de> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: remove dead code from drive_is_ready()Bartlomiej Zolnierkiewicz2008-12-021-5/+0
| | | | | | | We guarantee 400ns delay at the time of issuing the command. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: add SAMSUNG SP0822N with firmware WA100-10 to ivb_list[]Bartlomiej Zolnierkiewicz2008-12-021-0/+1
| | | | | | | | | | Should fix kernel.org bug #10225: http://bugzilla.kernel.org/show_bug.cgi?id=10225 Reported-by: Matthias B. <haferfrost@web.de> Cc: Alan Cox <alan@lxorguk.ukuu.org.uk> Acked-by: Sergei Shtyltov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* amd74xx: workaround unreliable AltStatus register for nVidia controllersBartlomiej Zolnierkiewicz2008-12-021-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It seems that on some nVidia controllers using AltStatus register can be unreliable so default to Status register if the PCI device is in Compatibility Mode. In order to achieve this: * Add ide_pci_is_in_compatibility_mode() inline helper to <linux/ide.h>. * Add IDE_HFLAG_BROKEN_ALTSTATUS host flag and set it in amd74xx host driver for nVidia controllers in Compatibility Mode. * Teach actual_try_to_identify() and drive_is_ready() about the new flag. This fixes the regression caused by removal of CONFIG_IDEPCI_SHARE_IRQ config option in 2.6.25 and using AltStatus register unconditionally when available (kernel.org bugs #11659 and #10216). [ Moreover for CONFIG_IDEPCI_SHARE_IRQ=y (which is what most people and distributions use) it never worked correctly. ] Thanks to Remy LABENE and Lars Winterfeld for help with debugging the problem. More info at: http://bugzilla.kernel.org/show_bug.cgi?id=11659 http://bugzilla.kernel.org/show_bug.cgi?id=10216 Reported-by: Remy LABENE <remy.labene@free.fr> Tested-by: Remy LABENE <remy.labene@free.fr> Tested-by: Lars Winterfeld <lars.winterfeld@tu-ilmenau.de> Acked-by: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: Switch to a common addressAlan Cox2008-11-021-1/+1
| | | | | Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: mask interrupt in ide_config_drive_speed()Sergei Shtylyov2008-10-171-1/+1
| | | | | | | | | | Apparently, there is no sense in unmasking IRQ on the controller when you call disable_irq_nosync() before doing this, set the nIEN bit afterwards, and then unmask IRQ again after the command completion, hence 0 passed to SELECT_MASK() before issuing the command in ide_config_drive_speed() is probably just a typo. Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: Implement disk shock protection support (v4)Elias Oltmanns2008-10-131-1/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On user request (through sysfs), the IDLE IMMEDIATE command with UNLOAD FEATURE as specified in ATA-7 is issued to the device and processing of the request queue is stopped thereafter until the specified timeout expires or user space asks to resume normal operation. This is supposed to prevent the heads of a hard drive from accidentally crashing onto the platter when a heavy shock is anticipated (like a falling laptop expected to hit the floor). Port resets are deferred whenever a device on that port is in the parked state. v3: Elias Oltmanns <eo@nebensachen.de> wrote: [...] > >> 1. Make sure that no negative value is being passed to > >> jiffies_to_msecs() in ide_park_show(). > >> 2. Drop the superfluous variable hwif in ide_special_rq(). > >> 3. Skip initialisation of task and tf in ide_special_rq() if we are not > >> handling a (un)park request. > > > > Well, #3 should have been done differently because we donn't want to > > check for REQ_(UN)?PARK_HEADS more often than is necessary. > > While preparing the backport to 2.6.27, it has just occurred to me that > we need to clear the IDE_DFLAG_PARKED flag in ide_disk_pre_reset() > because this flag must not be set after *any* sort of access to the > device. v4: Fix a memory leak due to a missing blk_put_request() in issue_park_cmd(). Additionally, we should plug the queue when enqueueing the unpark request because there is no guarantee that the park timeout has not expired by then. Even though the chance for that to happen is very slim, the request might end up hanging in the queue until the next I/O operation is queued up. While at it, clean up the code a little: - make issue_park_cmd() a function of type void since nobody cares for the return value anyway; - use blk_start_queueing() instead of __blk_run_queue() since we don't have to worry about recursion; - remove a superfluous pointer deference in task_no_data_intr(). Signed-off-by: Elias Oltmanns <eo@nebensachen.de> Cc: Jeff Garzik <jeff@garzik.org>, Cc: Randy Dunlap <randy.dunlap@oracle.com> Cc: Tejun Heo <htejun@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: factor out reset error reporting from reset_pollfunc()Bartlomiej Zolnierkiewicz2008-10-131-19/+21
| | | | | | | | | | | | Factor out reset error reporting from reset_pollfunc() to ide_reset_report_error() helper. While at it: - fix KERN_* printk() levels - remove 'switch ()' Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: remove [ata_]select_tBartlomiej Zolnierkiewicz2008-10-131-1/+1
| | | | | | | | | | | | | * Use 'drive->dn & 1' in ide_init_disk(). * remove [ata_]select_t. While at it: * Use ATA_DEVICE_OBS define in ide_port_init_devices_data(). Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: add device flagsBartlomiej Zolnierkiewicz2008-10-131-10/+14
| | | | | | | | | | | | | | Add 'unsigned long dev_flags' to ide_drive_t and convert bitfields to IDE_DFLAG_* flags. While at it: - IDE_DFLAG_ADDRESSING -> IDE_DFLAG_LBA48 - fixup some comments - remove needless g->flags zeroing from ide*_probe() There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: ide_dev_is_sata() -> ata_id_is_sata()Bartlomiej Zolnierkiewicz2008-10-101-1/+1
| | | | | | | | | | * Use optimized ATA version check from Sergei in ata_id_is_sata(). * ide_dev_is_sata() -> ata_id_is_sata() Cc: Jeff Garzik <jgarzik@pobox.com> Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: remove SECTOR_WORDS defineBartlomiej Zolnierkiewicz2008-10-101-1/+1
| | | | | | Just use SECTOR_SIZE instead. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: include <linux/hdreg.h> only when neededBartlomiej Zolnierkiewicz2008-10-101-1/+0
| | | | | | | | | | * Include <linux/ata.h> directly in <linux/ide.h> instead of through <linux/hdreg.h>. * Include <linux/hdreg.h> only when needed. Cc: Christoph Hellwig <hch@infradead.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: enhance ide_busy_sleep()Bartlomiej Zolnierkiewicz2008-10-101-10/+5
| | | | | | | | | | | | | * Make ide_busy_sleep() take timeout value as a parameter and also allow use of AltStatus Register if requested with altstatus parameter. Update existing users accordingly. * Convert ide_driveid_update() and actual_try_to_identify() to use ide_busy_sleep(). There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: re-code ide_fixstring() loop to be less evilLinus Torvalds2008-10-101-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On Friday 25 July 2008, Linus Torvalds wrote: > > On Fri, 25 Jul 2008, Ben Dooks wrote: > > > > personally, i would much prefer to see the loop being less evil > > like: > > > > for (p = s; p < end; p += 2) > > be16_to_cpus((u16 *)p); > > Well, in this case, the code actually depends on 'p' being back at the > start of the buffer by the end of it all, so it would need some more > changes than that. > > But yes, I applied David's patch, but I _also_ suspect that we would be > better off without code that does horrid things like casts and assignments > inside the function arguments. > > So it would be nice to re-code that loop to be more readable. But due to > the reliance of 'p' being 's' after the loop, the minimal patch would be > something like the appended. > > Bartlomiej - take this or not, I'm not going to commit it - I haven't > tested it, nor do I even have any machines that would trigger it. So this > is more a "maybe something like this" than anything else. From: Linus Torvalds <torvalds@linux-foundation.org> CC: Ben Dooks <ben-linux@fluff.org> Cc: David Miller <davem@davemloft.net> Cc: harvey.harrison@gmail.com Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: use ATA_* defines instead of *_STAT and *_ERR onesBartlomiej Zolnierkiewicz2008-10-101-11/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ERR_STAT -> ATA_ERR * INDEX_STAT -> ATA_IDX * ECC_STAT -> ATA_CORR * DRQ_STAT -> ATA_DRQ * SEEK_STAT -> ATA_DSC * WRERR_STAT -> ATA_DF * READY_STAT -> ATA_DRDY * BUSY_STAT -> ATA_BUSY * MARK_ERR -> ATA_AMNF * TRK0_ERR -> ATA_TRK0NF * ABRT_ERR -> ATA_ABORTED * MCR_ERR -> ATA_MCR * ID_ERR -> ATA_IDNF * MC_ERR -> ATA_MC * ECC_ERR -> ATA_UNC * ICRC_ERR -> ATA_ICRC * BBD_ERR -> ATA_BBK Also: * ILI_ERR -> ATAPI_ILI * EOM_ERR -> ATAPI_EOM * LFS_ERR -> ATAPI_LFS * CD -> ATAPI_COD * IO -> ATAPI_IO Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: WIN_* -> ATA_CMD_*Bartlomiej Zolnierkiewicz2008-10-101-5/+5
| | | | | | | | | | | | | | | | | | | | | * Use ATA_CMD_* defines instead of WIN_* ones. While at it: * EXABYTE_ENABLE_NEXT -> ATA_EXABYTE_ENABLE_NEST * SETFEATURES_{EN,DIS}_WCACHE -> SETFEATURES_WC_{ON,OFF} * SETFEATURES_{EN,DIS}_AAM -> SETFEATURES_AAM_{ON,OFF} * SMART_* -> ATA_SMART_* * Remove stale comment from ide-proc.c. Partially based on earlier work by Chris Wedgwood. Acked-by: Chris Wedgwood <cw@f00f.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: remove drive->driveidBartlomiej Zolnierkiewicz2008-10-101-18/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Factor out HDIO_[OBSOLETE,GET]_IDENTITY ioctls handling to ide_get_identity_ioctl(). * Use temporary buffer in ide_get_identity_ioctl() instead of accessing drive->id directly. * Add ide_id_to_hd_driveid() inline to convert raw id into struct hd_driveid format (needed on big-endian). * Use ide_id_to_hd_driveid() in ide_get_identity_ioctl(), cleanup ide_fix_driveid() and switch ide to use use raw id. * Remove no longer needed drive->driveid. This leaves us with 3 users of struct hd_driveid in tree: - arch/um/drivers/ubd_kern.c - drivers/block/xsysace.c - drivers/usb/storage/isd200.c While at it: * Use ata_id_u{32,64}() and ata_id_has_{dma,lba,iordy}() macros. There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: make drive->id an union (take 2)Bartlomiej Zolnierkiewicz2008-10-101-42/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make drive->id an unnamed union so id can be accessed either by using 'u16 *id' or 'struct hd_driveid *driveid'. Then convert all existing drive->id users accordingly (using 'u16 *id' when possible). This is an intermediate step to make ide 'struct hd_driveid'-free. While at it: - Add missing KERN_CONTs in it821x.c. - Use ATA_ID_WORDS and ATA_ID_*_LEN defines. - Remove unnecessary checks for drive->id. - s/drive_table/table/ in ide_in_drive_list(). - Cleanup ide_config_drive_speed() a bit. - s/drive1/dev1/ & s/drive0/dev0/ in ide_undecoded_slave(). v2: Fix typo in drivers/ide/ppc/pmac.c. (From Stephen Rothwell) There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: cleanup ide_fix_driveid()Bartlomiej Zolnierkiewicz2008-10-101-87/+20
| | | | | | Do all __le16_to_cpu() swapping in one loop. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: fix ide_fix_driveid()Bartlomiej Zolnierkiewicz2008-08-051-3/+3
| | | | | | | | | | | Fix byte-swapping for id->words161_175[], id->words206_254[] and id->words206_254[]. Luckily all words previously left in little-endian byte-order are marked as reserved so this fix shouldn't affect user-space applications. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: trivial sparse annotationsHarvey Harrison2008-07-241-4/+2
| | | | | Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: add struct ide_tp_ops (take 2)Bartlomiej Zolnierkiewicz2008-07-231-54/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add struct ide_tp_ops for transport methods. * Add 'const struct ide_tp_ops *tp_ops' to struct ide_port_info and ide_hwif_t. * Set the default hwif->tp_ops in ide_init_port_data(). * Set host driver specific hwif->tp_ops in ide_init_port(). * Export ide_exec_command(), ide_read_status(), ide_read_altstatus(), ide_read_sff_dma_status(), ide_set_irq(), ide_tf_{load,read}() and ata_{in,out}put_data(). * Convert host drivers and core code to use struct ide_tp_ops. * Remove no longer needed default_hwif_transport(). * Cleanup ide_hwif_t from methods that are now in struct ide_tp_ops. While at it: * Use struct ide_port_info in falconide.c and q40ide.c. * Rename ata_{in,out}put_data() to ide_{in,out}put_data(). v2: * Fix missing convertion in ns87415.c. There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: remove dead Virtual DMA supportBartlomiej Zolnierkiewicz2008-07-231-2/+1
| | | | | | | | | | | | | | | | | Lets remove dead Virtual DMA support for now so it doesn't clutter core IDE code (it can be bring back when there is a need for it): * Remove IDE_HFLAG_VDMA host flag. * Remove ide_drive_t.vdma flag. * cs5520.c: remove stale FIXMEs, cs5520_dma_host_set() and cs5520_dma_ops (also there is no longer a need to set IDE_HFLAG_NO_ATAPI_DMA). There should be no functional changes caused by this patch. Cc: TAKADA Yoshihito <takada@mbf.nifty.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: remove ->INB, ->OUTB and ->OUTBSYNC methodsBartlomiej Zolnierkiewicz2008-07-231-28/+0
| | | | | | | | | | | | | | * Remove no longer needed ->INB, ->OUTB and ->OUTBSYNC methods. Then: * Remove no longer used default_hwif_[mm]iops() and ide_[mm_]outbsync(). * Cleanup SuperIO handling in ns87415.c. There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
OpenPOWER on IntegriCloud