aboutsummaryrefslogtreecommitdiff
path: root/drivers/ide/ide-cd.c
AgeCommit message (Collapse)Author
2008-04-27ide: remove obsoleted "hdx=noautotune" kernel parameterBartlomiej Zolnierkiewicz
Remove obsoleted "hdx=noautotune" kernel parameter (it has been obsoleted since 1 Nov 2004). Then make ide_hwif_t.autotune a single bit flag and remove no longer needed IDE_TUNE_* defines. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-26ide: add struct ide_dma_ops (take 3)Bartlomiej Zolnierkiewicz
Add struct ide_dma_ops and convert core code + drivers to use it. While at it: * Drop "ide_" prefix from ->ide_dma_end and ->ide_dma_test_irq methods. * Drop "ide_" "infixes" from DMA methods. * au1xxx-ide.c: - use auide_dma_{test_irq,end}() directly in auide_dma_timeout() * pdc202xx_old.c: - drop "old_" "infixes" from DMA methods * siimage.c: - add siimage_dma_test_irq() helper - print SATA warning in siimage_init_one() * Remove no longer needed ->init_hwif implementations. v2: * Changes based on review from Sergei: - s/siimage_ide_dma_test_irq/siimage_dma_test_irq/ - s/drive->hwif/hwif/ in idefloppy_pc_intr(). - fix patch description w.r.t. au1xxx-ide changes - fix au1xxx-ide build - fix naming for cmd64*_dma_ops - drop "ide_" and "old_" infixes - s/hpt3xxx_dma_ops/hpt37x_dma_ops/ - s/hpt370x_dma_ops/hpt370_dma_ops/ - use correct DMA ops for HPT302/N, HPT371/N and HPT374 - s/it821x_smart_dma_ops/it821x_pass_through_dma_ops/ v3: * Two bugs slipped in v2 (noticed by Sergei): - use correct DMA ops for HPT374 (for real this time) - handle HPT370/HPT370A properly Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-26ide-cd: fix remaining checkpatch.pl issuesBorislav Petkov
Some of them are: WARNING: braces {} are not necessary for single statement blocks CHECK: multiple assignments should be avoided WARNING: printk() should include KERN_ facility level WARNING: no space between function name and open parenthesis '(' [bart: minor fixups] Signed-off-by: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-26ide-cd: shorten lines longer than 80 columnsBorislav Petkov
[bart: minor fixups] Signed-off-by: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-26ide-cd: fixup commentsBorislav Petkov
[bart: minor fixups, md5sum checked] Signed-off-by: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-26ide-cd: put all proc-related code at one placeBorislav Petkov
Signed-off-by: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-26ide-cd: include proper headersBorislav Petkov
Signed-off-by: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-26ide-cd: put proc-related functions together under single ifdefBorislav Petkov
[bart: ported it over Paolo's patch] Signed-off-by: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-26ide-cd: Replace __FUNCTION__ with __func__Paolo Ciarrocchi
[bart: md5sum checked] Signed-off-by: Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-26IDE: Coding Style fixes to drivers/ide/ide-cd.cPaolo Ciarrocchi
Before: total: 43 errors, 66 warnings, 2183 lines checked After: total: 0 errors, 36 warnings, 2192 lines checked I didn't (and I don't plan to) fix the warnings: WARNING: line over 80 characters [bart: minor fixes, md5sum checked (modulo s/"ignore = NULL;"/"ignore;"/ fix)] Signed-off-by: Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-26ide-cd: remove the internal 64k bufferBorislav Petkov
This removes the internal ide-cd buffer and falls back to read-ahead block layer capabilities. Thorough testing (cd burning, dvd read, raw read) gives with the bufferless mode marginally better performance in addition to simplified code. bufferless: dd: reading `/dev/hdc': Input/output error 6238+0 records in 6238+0 records out 204406784 bytes (204 MB) copied, 259.891 s, 787 kB/s real 4m21.598s user 0m0.014s sys 0m0.744s with the old buffer (2.6.25-rc1): dd: reading `/dev/hdc': Input/output error 6238+0 records in 6238+0 records out 204406784 bytes (204 MB) copied, 262.893 s, 778 kB/s real 4m22.938s user 0m0.009s sys 0m0.771s Signed-off-by: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-04-21cdrom: make unregister_cdrom() return voidAkinobu Mita
Now unregister_cdrom() always returns 0. Make it return void and update all callers that check the return value. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Cc: Adrian McMenamin <adrian@mcmen.demon.co.uk> Cc: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
2008-04-18ide: remove IDE_*_REG macrosBartlomiej Zolnierkiewicz
* Add IDE_{ALTSTATUS,IREASON,BCOUNTL,BCOUNTH}_OFFSET defines. * Remove IDE_*_REG macros - this results in more readable and slightly smaller code. There should be no functional changes caused by this patch. Cc: Borislav Petkov <petkovbb@gmail.com> Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-26ide-cd: fix CD/DVD burningAndreas Schwab
Move counting of sense bytes into the transfer loop. Signed-off-by: Andreas Schwab <schwab@suse.de> Acked-by: Borislav Petkov <petkovbb@gmail.com> Cc: Kiyoshi Ueda <k-ueda@ct.jp.nec.com> Cc: Jens Axboe <jens.axboe@oracle.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-26ide-cd: fix 'ireason' handling for REQ_TYPE_ATA_PC requestsBartlomiej Zolnierkiewicz
Pass 'struct request *rq' to ide_cd_check_ireason() from cdrom_newpc_intr() and use ide_cd_check_ireason() also for REQ_TYPE_ATA_PC requests. This fixes some hangs caused by not finishing the transfer before ending the request and also makes use of 'ireason == 1' quirk for spurious IRQs. Tested-by: Brad Rosser <brad.rosser@gmail.com> Cc: Borislav Petkov <petkovbb@googlemail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-26ide-cd: Enable audio play quirk for Optiarc DVD RW AD-5200A driveBorislav Petkov
Reported-by: Stefan Bader <stefan.bader@canonical.com> Signed-off-by: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-19ide-cd: fix missing residual count setting in DMA modeKiyoshi Ueda
This patch fixes the missing residual count setting in DMA mode, which was introduced during the conversion to blk-end-request. The residual count could be used by the request submitter. So if it isn't set correctly, some upper layers does not work. (e.g. wodim for CD burning.) The bug is in only DMA mode. In PIO mode, we are setting the residual count correctly, so no need to fix. Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com> Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com> Reported-by: Andreas Schwab <schwab@suse.de> Tested-by: Andreas Schwab <schwab@suse.de> Tested-by: Laura Garcia <nevola@gmail.com> Tested-by: Borislav Petkov <petkovbb@googlemail.com> Cc: Jens Axboe <jens.axboe@oracle.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-11ide-cd: replace ntohs with generic byteorder macro be16_to_cpuBorislav Petkov
Signed-off-by: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-06ide: add ide_read_error() inline helperBartlomiej Zolnierkiewicz
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-06ide: add ide_read_[alt]status() inline helpersBartlomiej Zolnierkiewicz
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-02ide-floppy: use an xfer_func_t and io_buf_t typedefs in order to unify rwBorislav Petkov
Also, move xfer_func_t typedef to the ide.h since it is used by two drivers now (more coming). Bart: - use __func__ while at it Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01ide: update/add my CopyrightsBartlomiej Zolnierkiewicz
The last years stuff and a trip down memory lane... Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01ide-cd: move the remaining cdrom.c ioctl handling code to ide-cd_ioctl.cBorislav Petkov
There should be no functional changes from this. Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01ide-cd: update driver version, comments and copyrightsBartlomiej Zolnierkiewicz
* Bump driver version. * Remove filename and stale TODO from comments. * Add my copyrights. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01ide-cd: unify request end exit path in cdrom_decode_status()Bartlomiej Zolnierkiewicz
There should be no functionality changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01ide-cd: merge cdrom_write_check_ireason() and cdrom_read_check_ireason()Bartlomiej Zolnierkiewicz
Add 'rw' parameter to cdrom_read_check_ireason(), make it handle both read and write checking, rename it to ide_cd_check_ireason(), finally remove no longer needed cdrom_write_check_ireason(). There should be no functionality changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01ide-cd: merge cdrom_rw_intr() and cdrom_newpc_intr()Bartlomiej Zolnierkiewicz
Add handling of fs read/write requests to cdrom_nepwc_intr() and remove no longer needed cdrom_rw_intr(). There should be no functionality changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01ide-cd: call blk_dump_rq_flags() on "missing data" in cdrom_rw_intr()Bartlomiej Zolnierkiewicz
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01ide-cd: prepare cdrom_rw_intr() and cdrom_newpc_intr() to be mergedBartlomiej Zolnierkiewicz
In cdrom_newpc_intr(): * cleanup variables in the 'transfer data' loop In cdrom_rw_intr(): * rename 'sectors_to_transfer' to 'thislen' * rename 'this_transfer' to 'blen' * keep number of bytes (instead of sectors) in 'thislen' and 'blen' * call 'xferfunc' only once for 'blen' * cache 'rq->buffer' in 'ptr' variable * check for 'rq->bio' before setting 'ptr' and 'blen' * check for 'ptr' instead of 'rq->current_nr_sectors' There should be no functionality changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01ide-cd: unify moving to the next buffer in cdrom_rw_intr()Bartlomiej Zolnierkiewicz
Use the fact that for the first loop rq->current_nr_sectors is always set and unify moving to the next buffer for read/write requests. There should be no functionality changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01ide-cd: merge cdrom_start_read() and cdrom_start_write()Bartlomiej Zolnierkiewicz
Add handling of read requests to cdrom_start_write(), rename it to cdrom_start_rw() and remove no longer needed cdrom_start_read(). There should be no functionality changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01ide-cd: merge cdrom_start_read_continuation() and cdrom_start_rw_cont()Bartlomiej Zolnierkiewicz
* Add handling of write requests to cdrom_start_read_continuation(), rename it to cdrom_start_rw_cont() and remove no longer needed cdrom_start_write_cont(). * Remove redundant '(rq->sector & (sectors_per_frame - 1)' check. There should be no functionality changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01ide-cd: merge cdrom_read_intr() and cdrom_write_intr()Bartlomiej Zolnierkiewicz
Add handling of read requests to cdrom_write_intr(), rename it to cdrom_rw_intr() and remove no longer needed cdrom_read_intr(). There should be no functionality changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01ide-cd: factor out transfer size checking from cdrom_read_intr()Bartlomiej Zolnierkiewicz
This is a preparation for cdrom_read_intr() and cdrom_write_intr() merge. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01ide-cd: add ide_cd_drain_data() helperBartlomiej Zolnierkiewicz
Add ide_cd_drain_data() and use it in cdrom_{buffer_sectors,read_intr}() (as a nice side-effect this cuts 0.5kB of code from ide-cd.o). There should be no functionality changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01ide-cd: merge cdrom_do_packet_command() and cdrom_do_block_pc()Bartlomiej Zolnierkiewicz
Add REQ_TYPE_{SENSE,ATA_PC} requests handling to cdrom_do_block_pc() and remove cdrom_do_packet_command(). There should be no functionality changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01ide-cd: remove cdrom_do_pc_continuation()Bartlomiej Zolnierkiewicz
cdrom_do_pc_continuation() is now identical to cdrom_do_newpc_cont() so just always use the latter function. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01ide-cd: merge cdrom_pc_intr() and cdrom_newpc_intr()Bartlomiej Zolnierkiewicz
Add handling of REQ_TYPE_{SENSE,ATA_PC} requests to cdrom_newpc_intr() (please note that these requests never have 'bio' attached to them and they never use DMA), then remove no longer needed cdrom_pc_intr(). There should be no functionality changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01ide-cd: unify request end exit path in cdrom_pc_intr()Bartlomiej Zolnierkiewicz
This is a preparation for cdrom_pc_intr() and cdrom_newpc_intr() merge. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01ide-cd: factor out request sense fixup from cdrom_pc_intr()Bartlomiej Zolnierkiewicz
This is a preparation for cdrom_pc_intr() and cdrom_newpc_intr() merge. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01ide-cd: call blk_dump_rq_flags() on "missing data" in cdrom_newpc_intr()Bartlomiej Zolnierkiewicz
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01ide-cd: remove BUG_ON() from cdrom_newpc_intr()Bartlomiej Zolnierkiewicz
There is no need for it anylonger and ide_set_handler() complains if ->handler is not NULL anyway. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01ide-cd: move code handling cdrom.c IOCTLs to ide-cd_ioctl.cBartlomiej Zolnierkiewicz
There should be no functionality changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01ide-cd: rename cdrom_* functions to ide_cd_*Bartlomiej Zolnierkiewicz
* cdrom_prepare_request() -> ide_cd_init_rq() * cdrom_queue_packet_command() -> ide_cd_queue_pc() * cdrom_lockdoor() -> ide_cd_lockdoor() * cdrom_read_toc() -> ide_cd_read_toc() * cdrom_get_toc_entry() -> ide_cd_get_toc_entry() This is a preparation to move code handling cdrom.c IOCTLs out of ide-cd.c. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01ide-cd: coding style fixes for cdrom_get_toc_entry()Bartlomiej Zolnierkiewicz
This is a preparation to move code handling cdrom.c IOCTLs out of ide-cd.c. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01ide-cd: move lba_to_msf() and msf_to_lba() to <linux/cdrom.h>Bartlomiej Zolnierkiewicz
* Move lba_to_msf() and msf_to_lba() to <linux/cdrom.h> (use 'u8' type instead of 'byte' while at it). * Remove msf_to_lba() copy from drivers/cdrom/cdrom.c. Acked-by: Jens Axboe <jens.axboe@oracle.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01ide-cd: merge cdrom_select_speed() into ide_cdrom_select_speed()Bartlomiej Zolnierkiewicz
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01ide-cd: merge cdrom_read_subchannel() into ide_cdrom_get_mcn()Bartlomiej Zolnierkiewicz
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01ide-cd: merge cdrom_play_audio() into ide_cd_fake_play_trkind()Bartlomiej Zolnierkiewicz
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
2008-02-01ide-cd: factor out ioctl handlers from ide_cdrom_audio_ioctl()Bartlomiej Zolnierkiewicz
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>