Lines Matching refs:cdi
114 static unsigned int sr_check_events(struct cdrom_device_info *cdi,
229 static unsigned int sr_check_events(struct cdrom_device_info *cdi, in sr_check_events() argument
232 struct scsi_cd *cd = cdi->handle; in sr_check_events()
451 cd->cdi.media_written = 1; in sr_prep_fn()
489 cd->cdi.name, in sr_prep_fn()
536 ret = cdrom_open(&cd->cdi, bdev, mode); in sr_block_open()
548 cdrom_release(&cd->cdi, mode); in sr_block_release()
576 ret = cdrom_ioctl(&cd->cdi, bdev, mode, cmd, arg); in sr_block_ioctl()
606 ret = cdrom_check_events(&cd->cdi, clearing); in sr_block_check_events()
626 sr_cd_check(&cd->cdi); in sr_block_revalidate_disk()
647 static int sr_open(struct cdrom_device_info *cdi, int purpose) in sr_open() argument
649 struct scsi_cd *cd = cdi->handle; in sr_open()
667 static void sr_release(struct cdrom_device_info *cdi) in sr_release() argument
669 struct scsi_cd *cd = cdi->handle; in sr_release()
728 cd->cdi.ops = &sr_dops; in sr_probe()
729 cd->cdi.handle = cd; in sr_probe()
730 cd->cdi.mask = 0; in sr_probe()
731 cd->cdi.capacity = 1; in sr_probe()
732 sprintf(cd->cdi.name, "sr%d", minor); in sr_probe()
745 cd->cdi.disk = disk; in sr_probe()
747 if (register_cdrom(&cd->cdi)) in sr_probe()
755 "Attached scsi CD-ROM %s\n", cd->cdi.name); in sr_probe()
807 if (!cdrom_get_last_written(&cd->cdi, &last_written)) in get_sectorsize()
831 cd->cdi.name, sector_size); in get_sectorsize()
886 cd->cdi.speed = 1; in get_capabilities()
887 cd->cdi.mask |= (CDC_CD_R | CDC_CD_RW | CDC_DVD_R | in get_capabilities()
892 printk("%s: scsi-1 drive\n", cd->cdi.name); in get_capabilities()
897 cd->cdi.speed = ((buffer[n + 8] << 8) + buffer[n + 9]) / 176; in get_capabilities()
901 printk("%s: scsi3-mmc drive: %dx/%dx %s%s%s%s%s%s\n", cd->cdi.name, in get_capabilities()
903 cd->cdi.speed, in get_capabilities()
912 cd->cdi.mask |= CDC_CLOSE_TRAY; in get_capabilities()
915 cd->cdi.mask |= CDC_DVD; in get_capabilities()
918 cd->cdi.mask |= CDC_DVD_RAM; in get_capabilities()
921 cd->cdi.mask |= CDC_DVD_R; in get_capabilities()
924 cd->cdi.mask |= CDC_CD_RW; in get_capabilities()
927 cd->cdi.mask |= CDC_CD_R; in get_capabilities()
930 cd->cdi.mask |= CDC_OPEN_TRAY; in get_capabilities()
934 cd->cdi.capacity = in get_capabilities()
935 cdrom_number_of_slots(&cd->cdi); in get_capabilities()
936 if (cd->cdi.capacity <= 1) in get_capabilities()
938 cd->cdi.mask |= CDC_SELECT_DISC; in get_capabilities()
945 if ((cd->cdi.mask & (CDC_DVD_RAM | CDC_MRW_W | CDC_RAM | CDC_CD_RW)) != in get_capabilities()
957 static int sr_packet(struct cdrom_device_info *cdi, in sr_packet() argument
960 struct scsi_cd *cd = cdi->handle; in sr_packet()
992 unregister_cdrom(&cd->cdi); in sr_kref_release()