Lines Matching refs:gd
105 } gd; variable
213 gdrom_hardreset(gd.cd_info); in gdrom_execute_diagnostic()
236 gd.pending = 1; in gdrom_preparedisk_cmd()
237 gdrom_packetcommand(gd.cd_info, spin_command); in gdrom_preparedisk_cmd()
239 wait_event_interruptible_timeout(command_queue, gd.pending == 0, in gdrom_preparedisk_cmd()
241 gd.pending = 0; in gdrom_preparedisk_cmd()
243 if (gd.status & 0x01) { in gdrom_preparedisk_cmd()
273 if (gd.pending) { in gdrom_readtoc_cmd()
277 gd.pending = 1; in gdrom_readtoc_cmd()
278 gdrom_packetcommand(gd.cd_info, toc_command); in gdrom_readtoc_cmd()
279 wait_event_interruptible_timeout(command_queue, gd.pending == 0, in gdrom_readtoc_cmd()
281 if (gd.pending) { in gdrom_readtoc_cmd()
286 if (gd.status & 0x01) in gdrom_readtoc_cmd()
290 gd.pending = 0; in gdrom_readtoc_cmd()
317 if (!gd.toc) in gdrom_get_last_session()
321 err = gdrom_readtoc_cmd(gd.toc, 1); in gdrom_get_last_session()
324 err = gdrom_readtoc_cmd(gd.toc, 0); in gdrom_get_last_session()
331 fentry = get_entry_track(gd.toc->first); in gdrom_get_last_session()
332 lentry = get_entry_track(gd.toc->last); in gdrom_get_last_session()
334 track = get_entry_track(gd.toc->last); in gdrom_get_last_session()
336 data = gd.toc->entry[track - 1]; in gdrom_get_last_session()
342 if ((track > 100) || (track < get_entry_track(gd.toc->first))) { in gdrom_get_last_session()
426 if (gd.pending && !gdrom_wait_clrbusy()) { in gdrom_getsense()
430 gd.pending = 1; in gdrom_getsense()
431 gdrom_packetcommand(gd.cd_info, sense_command); in gdrom_getsense()
432 wait_event_interruptible_timeout(command_queue, gd.pending == 0, in gdrom_getsense()
434 if (gd.pending) in gdrom_getsense()
452 gd.pending = 0; in gdrom_getsense()
484 ret = cdrom_open(gd.cd_info, mode); in gdrom_bdops_open()
492 cdrom_release(gd.cd_info); in gdrom_bdops_release()
499 return cdrom_check_events(gd.cd_info, clearing); in gdrom_bdops_check_events()
508 ret = cdrom_ioctl(gd.cd_info, bdev, cmd, arg); in gdrom_bdops_ioctl()
527 gd.status = __raw_readb(GDROM_STATUSCOMMAND_REG); in gdrom_command_interrupt()
528 if (gd.pending != 1) in gdrom_command_interrupt()
530 gd.pending = 0; in gdrom_command_interrupt()
537 gd.status = __raw_readb(GDROM_STATUSCOMMAND_REG); in gdrom_dma_interrupt()
538 if (gd.transfer != 1) in gdrom_dma_interrupt()
540 gd.transfer = 0; in gdrom_dma_interrupt()
550 0, "gdrom_command", &gd); in gdrom_set_interrupt_handlers()
554 0, "gdrom_dma", &gd); in gdrom_set_interrupt_handlers()
556 free_irq(HW_EVENT_GDROM_CMD, &gd); in gdrom_set_interrupt_handlers()
613 gd.pending = 1; in gdrom_readdisk_dma()
614 gd.transfer = 1; in gdrom_readdisk_dma()
624 gd.transfer == 0, GDROM_DEFAULT_TIMEOUT); in gdrom_readdisk_dma()
625 err = gd.transfer ? BLK_STS_IOERR : BLK_STS_OK; in gdrom_readdisk_dma()
626 gd.transfer = 0; in gdrom_readdisk_dma()
627 gd.pending = 0; in gdrom_readdisk_dma()
709 gd.cd_info->ops = &gdrom_ops; in probe_gdrom_setupcd()
710 gd.cd_info->capacity = 1; in probe_gdrom_setupcd()
711 strcpy(gd.cd_info->name, GDROM_DEV_NAME); in probe_gdrom_setupcd()
712 gd.cd_info->mask = CDC_CLOSE_TRAY|CDC_OPEN_TRAY|CDC_LOCK| in probe_gdrom_setupcd()
718 gd.disk->major = gdrom_major; in probe_gdrom_setupdisk()
719 gd.disk->first_minor = 1; in probe_gdrom_setupdisk()
720 gd.disk->minors = 1; in probe_gdrom_setupdisk()
721 gd.disk->flags |= GENHD_FL_NO_PART; in probe_gdrom_setupdisk()
722 strcpy(gd.disk->disk_name, GDROM_DEV_NAME); in probe_gdrom_setupdisk()
727 blk_queue_logical_block_size(gd.gdrom_rq, GDROM_HARD_SECTOR); in probe_gdrom_setupqueue()
729 blk_queue_max_segments(gd.gdrom_rq, 1); in probe_gdrom_setupqueue()
731 blk_queue_max_segment_size(gd.gdrom_rq, 0x40000); in probe_gdrom_setupqueue()
732 gd.disk->queue = gd.gdrom_rq; in probe_gdrom_setupqueue()
752 memset(&gd, 0, sizeof(gd)); in probe_gdrom()
769 gd.cd_info = kzalloc(sizeof(struct cdrom_device_info), GFP_KERNEL); in probe_gdrom()
770 if (!gd.cd_info) { in probe_gdrom()
776 err = blk_mq_alloc_sq_tag_set(&gd.tag_set, &gdrom_mq_ops, 1, in probe_gdrom()
781 gd.disk = blk_mq_alloc_disk(&gd.tag_set, NULL); in probe_gdrom()
782 if (IS_ERR(gd.disk)) { in probe_gdrom()
783 err = PTR_ERR(gd.disk); in probe_gdrom()
786 gd.gdrom_rq = gd.disk->queue; in probe_gdrom()
788 if (register_cdrom(gd.disk, gd.cd_info)) { in probe_gdrom()
792 gd.disk->fops = &gdrom_bdops; in probe_gdrom()
793 gd.disk->events = DISK_EVENT_MEDIA_CHANGE; in probe_gdrom()
803 gd.toc = kzalloc(sizeof(struct gdromtoc), GFP_KERNEL); in probe_gdrom()
804 if (!gd.toc) { in probe_gdrom()
808 err = add_disk(gd.disk); in probe_gdrom()
815 kfree(gd.toc); in probe_gdrom()
817 free_irq(HW_EVENT_GDROM_DMA, &gd); in probe_gdrom()
818 free_irq(HW_EVENT_GDROM_CMD, &gd); in probe_gdrom()
820 put_disk(gd.disk); in probe_gdrom()
822 blk_mq_free_tag_set(&gd.tag_set); in probe_gdrom()
824 kfree(gd.cd_info); in probe_gdrom()
834 blk_mq_free_tag_set(&gd.tag_set); in remove_gdrom()
835 free_irq(HW_EVENT_GDROM_CMD, &gd); in remove_gdrom()
836 free_irq(HW_EVENT_GDROM_DMA, &gd); in remove_gdrom()
837 del_gendisk(gd.disk); in remove_gdrom()
840 unregister_cdrom(gd.cd_info); in remove_gdrom()
841 kfree(gd.cd_info); in remove_gdrom()
842 kfree(gd.toc); in remove_gdrom()