aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-cd.c
Commit message (Collapse)AuthorAge
* ide-cd: fix CD/DVD burningAndreas Schwab2008-02-26
| | | | | | | | | | 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>
* ide-cd: fix 'ireason' handling for REQ_TYPE_ATA_PC requestsBartlomiej Zolnierkiewicz2008-02-26
| | | | | | | | | | | | 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>
* ide-cd: Enable audio play quirk for Optiarc DVD RW AD-5200A driveBorislav Petkov2008-02-26
| | | | | | Reported-by: Stefan Bader <stefan.bader@canonical.com> Signed-off-by: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide-cd: fix missing residual count setting in DMA modeKiyoshi Ueda2008-02-18
| | | | | | | | | | | | | | | | | | | | | 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>
* ide-cd: replace ntohs with generic byteorder macro be16_to_cpuBorislav Petkov2008-02-10
| | | | | Signed-off-by: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: add ide_read_error() inline helperBartlomiej Zolnierkiewicz2008-02-05
| | | | | Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide: add ide_read_[alt]status() inline helpersBartlomiej Zolnierkiewicz2008-02-05
| | | | | Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide-floppy: use an xfer_func_t and io_buf_t typedefs in order to unify rwBorislav Petkov2008-02-02
| | | | | | | | | | | 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>
* ide: update/add my CopyrightsBartlomiej Zolnierkiewicz2008-02-01
| | | | | | The last years stuff and a trip down memory lane... Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide-cd: move the remaining cdrom.c ioctl handling code to ide-cd_ioctl.cBorislav Petkov2008-02-01
| | | | | | | There should be no functional changes from this. Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide-cd: update driver version, comments and copyrightsBartlomiej Zolnierkiewicz2008-02-01
| | | | | | | | | | | * 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>
* ide-cd: unify request end exit path in cdrom_decode_status()Bartlomiej Zolnierkiewicz2008-02-01
| | | | | | There should be no functionality changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide-cd: merge cdrom_write_check_ireason() and cdrom_read_check_ireason()Bartlomiej Zolnierkiewicz2008-02-01
| | | | | | | | | | 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>
* ide-cd: merge cdrom_rw_intr() and cdrom_newpc_intr()Bartlomiej Zolnierkiewicz2008-02-01
| | | | | | | | | 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>
* ide-cd: call blk_dump_rq_flags() on "missing data" in cdrom_rw_intr()Bartlomiej Zolnierkiewicz2008-02-01
| | | | | Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide-cd: prepare cdrom_rw_intr() and cdrom_newpc_intr() to be mergedBartlomiej Zolnierkiewicz2008-02-01
| | | | | | | | | | | | | | | | | | 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>
* ide-cd: unify moving to the next buffer in cdrom_rw_intr()Bartlomiej Zolnierkiewicz2008-02-01
| | | | | | | | | 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>
* ide-cd: merge cdrom_start_read() and cdrom_start_write()Bartlomiej Zolnierkiewicz2008-02-01
| | | | | | | | | 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>
* ide-cd: merge cdrom_start_read_continuation() and cdrom_start_rw_cont()Bartlomiej Zolnierkiewicz2008-02-01
| | | | | | | | | | | | * 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>
* ide-cd: merge cdrom_read_intr() and cdrom_write_intr()Bartlomiej Zolnierkiewicz2008-02-01
| | | | | | | | | 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>
* ide-cd: factor out transfer size checking from cdrom_read_intr()Bartlomiej Zolnierkiewicz2008-02-01
| | | | | | This is a preparation for cdrom_read_intr() and cdrom_write_intr() merge. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide-cd: add ide_cd_drain_data() helperBartlomiej Zolnierkiewicz2008-02-01
| | | | | | | | | 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>
* ide-cd: merge cdrom_do_packet_command() and cdrom_do_block_pc()Bartlomiej Zolnierkiewicz2008-02-01
| | | | | | | | | 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>
* ide-cd: remove cdrom_do_pc_continuation()Bartlomiej Zolnierkiewicz2008-02-01
| | | | | | | 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>
* ide-cd: merge cdrom_pc_intr() and cdrom_newpc_intr()Bartlomiej Zolnierkiewicz2008-02-01
| | | | | | | | | | 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>
* ide-cd: unify request end exit path in cdrom_pc_intr()Bartlomiej Zolnierkiewicz2008-02-01
| | | | | | This is a preparation for cdrom_pc_intr() and cdrom_newpc_intr() merge. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide-cd: factor out request sense fixup from cdrom_pc_intr()Bartlomiej Zolnierkiewicz2008-02-01
| | | | | | This is a preparation for cdrom_pc_intr() and cdrom_newpc_intr() merge. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide-cd: call blk_dump_rq_flags() on "missing data" in cdrom_newpc_intr()Bartlomiej Zolnierkiewicz2008-02-01
| | | | | Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide-cd: remove BUG_ON() from cdrom_newpc_intr()Bartlomiej Zolnierkiewicz2008-02-01
| | | | | | | 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>
* ide-cd: move code handling cdrom.c IOCTLs to ide-cd_ioctl.cBartlomiej Zolnierkiewicz2008-02-01
| | | | | | There should be no functionality changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide-cd: rename cdrom_* functions to ide_cd_*Bartlomiej Zolnierkiewicz2008-02-01
| | | | | | | | | | | | * 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>
* ide-cd: coding style fixes for cdrom_get_toc_entry()Bartlomiej Zolnierkiewicz2008-02-01
| | | | | | | 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>
* ide-cd: move lba_to_msf() and msf_to_lba() to <linux/cdrom.h>Bartlomiej Zolnierkiewicz2008-02-01
| | | | | | | | | | * 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>
* ide-cd: merge cdrom_select_speed() into ide_cdrom_select_speed()Bartlomiej Zolnierkiewicz2008-02-01
| | | | Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide-cd: merge cdrom_read_subchannel() into ide_cdrom_get_mcn()Bartlomiej Zolnierkiewicz2008-02-01
| | | | Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide-cd: merge cdrom_play_audio() into ide_cd_fake_play_trkind()Bartlomiej Zolnierkiewicz2008-02-01
| | | | Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide-cd: factor out ioctl handlers from ide_cdrom_audio_ioctl()Bartlomiej Zolnierkiewicz2008-02-01
| | | | Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide-cd: move VERBOSE_IDE_CD_ERRORS code to ide-cd_verbose.cBartlomiej Zolnierkiewicz2008-02-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Rename ide-cd kernel module to ide-cd_mod in preparation to moving code out from ide-cd.[c,h]. Add MODULE_ALIAS("ide-cd") to preserve compatibility. * Move VERBOSE_IDE_CD_ERRORS code from ide-cd.[c,h] to ide-cd_verbose.c. ide-cd_verbose.c is IDE subsystem independent and may be easily converted into generic library usable by other drivers (i.e. libata) if needed. * Add CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS config option to drivers/ide/Kconfig replacing VERBOSE_IDE_CD_ERRORS define. Make this config option enabled by default and visible only if CONFIG_EMBEDDED is defined. before the patch: text data bss dec hex filename 22841 360 1056 24257 5ec1 drivers/ide/ide-cd.o after the patch w/ CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS=y: text data bss dec hex filename 22857 360 1056 24273 5ed1 drivers/ide/ide-cd_mod.o after the patch w/ CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS=n: text data bss dec hex filename 15091 360 1056 16507 407b drivers/ide/ide-cd_mod.o Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide-cd: coding style fixes for VERBOSE_IDE_CD_ERRORS codeBartlomiej Zolnierkiewicz2008-02-01
| | | | | | | | | | * Coding style fixes for VERBOSE_IDE_CD_ERRORS code. * Add KERN_{ERR,CONT} printk() levels where needed. This is a preparation for moving this code out of ide-cd.[c,h]. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide-cd: re-organize handling of quirky devicesBartlomiej Zolnierkiewicz2008-02-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Re-organize handling of quirky devices: * Add struct cd_list_entry, ide_cd_quirks_list[] and ide_cd_flags() helper. * Set flags returned by ide_cd_flags() in ide_cdrom_setup(). * Add IDE_CD_FLAG_VERTOS_{300_SDD,600_ESD} and IDE_CD_FLAG_SANYO_3CD flags. * Move device quirks from ide_cdrom_setup() to ide_cd_quirks_list[]. * Rename IDE_CD_FLAG_NEC260 to IDE_CD_FLAG_PRE_ATAPI12 and handle quirky Stingray 8X CD-ROM using ide_cd_quirks_list[]. * Add IDE_CD_FLAG_FULL_CAPS_PAGE flag and handle quirky ACER 50X CD-ROM / WPI 32X CD-ROM using ide_cd_quirk_list[]. * Add IDE_CD_FLAG_PLAY_AUDIO_OK flag and handle quirky MATSHITA DVD-ROMs using ide_cd_quirks_list[]. * Add IDE_CD_FLAG_LE_SPEED_FIELDS flag and handle quirky ACER/AOpen 24X CD-ROM using ide_cd_quirk_list[]. * Fix some comments about quirky devices while at it. There should be no functionality changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide-cd: use BCD2BIN()/BIN2BCD() macros from <linux/bcd.h>Bartlomiej Zolnierkiewicz2008-02-01
| | | | | | | Use BCD2BIN()/BIN2BCD() macros from <linux/bcd.h> and remove the local bcd2bin()/bin2bcd() inlines. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide-cd: remove STANDARD_ATAPI defineBartlomiej Zolnierkiewicz2008-02-01
| | | | | | Remove STANDARD_ATAPI define + drive-by coding style fixes. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide-cd: remove NO_DOOR_LOCKING defineBartlomiej Zolnierkiewicz2008-02-01
| | | | | Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide-cd: remove struct ide_cd_{config,state}_flagsBartlomiej Zolnierkiewicz2008-02-01
| | | | | | | | | | | | | | | | | * Remove unused ->{writing,reserved} fields from struct ide_cd_config_flags. * Move ->max_speed from struct ide_cd_config_flags to struct cdrom_info. * Move ->current_speed from struct ide_cd_state_flags to struct cdrom_info. * Add defines for config and state flags. * Add 'unsigned int cd_flags' to struct cdrom_info and use ->cd_flags instead of ->{config,state}_flags. * Remove no longer needed struct ide_cd_{config,state}_flags. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide-cd: remove struct atapi_capabilities_page (take 2)Bartlomiej Zolnierkiewicz2008-02-01
| | | | | | | | | | | | | * Remove struct atapi_capabilities_page. * Add ATAPI_CAPABILITIES_PAGE[_PAD]_SIZE define. v2: * The buf[] array access indexes were swapped between 'curspeed'/'maxspeed'. (Noticed by Borislav Petkov). Cc: Borislav Petkov <bbpetkov@yahoo.de> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide-cd: kill CDROM_STATE_FLAGS() macroBartlomiej Zolnierkiewicz2008-02-01
| | | | | | While at it rename 'info' variable to 'cd' in cdrom_saw_media_change(). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide-cd: kill CDROM_CONFIG_FLAGS() macroBartlomiej Zolnierkiewicz2008-02-01
| | | | | | | While at it rename 'info' variable to 'cd' in ide_cdrom_probe_capabilities() and ide_cdrom_setup(). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide-cd: remove redundant config flagsBartlomiej Zolnierkiewicz2008-02-01
| | | | | | | | | * Use CDC_* flags directly and remove redundant flags from ->config_flags. While at it: * Add KERN_CONT to printk()-s in ide_cdrom_probe_capabilities(). Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide-cd: add IDE_CD_CAPABILITIES defineBartlomiej Zolnierkiewicz2008-02-01
| | | | | | While at it remove stale/incorrect comment. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
* ide-cd: cleanup ide_cdrom_update_speed()Bartlomiej Zolnierkiewicz2008-02-01
| | | | | Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>