Lines Matching refs:scsi_CDs

87 Scsi_CD *scsi_CDs;  variable
102 if (scsi_CDs[MINOR(cdi->dev)].device->sector_size > 2048) in sr_release()
104 scsi_CDs[MINOR(cdi->dev)].device->access_count--; in sr_release()
105 if (scsi_CDs[MINOR(cdi->dev)].device->host->hostt->module) in sr_release()
106 __MOD_DEC_USE_COUNT(scsi_CDs[MINOR(cdi->dev)].device->host->hostt->module); in sr_release()
153 retval = scsi_ioctl(scsi_CDs[MINOR(cdi->dev)].device, in sr_media_change()
162 scsi_CDs[MINOR(cdi->dev)].device->changed = 1; in sr_media_change()
167 retval = scsi_CDs[MINOR(cdi->dev)].device->changed; in sr_media_change()
168 scsi_CDs[MINOR(cdi->dev)].device->changed = 0; in sr_media_change()
182 scsi_CDs[MINOR(cdi->dev)].needs_sector_size = 1; in sr_media_change()
184 scsi_CDs[MINOR(cdi->dev)].device->sector_size = 2048; in sr_media_change()
229 if (scsi_CDs[device_nr].device->sector_size == 2048) in rw_intr()
243 scsi_CDs[device_nr].capacity - error_sector < 4 *75) in rw_intr()
278 if (MINOR(dev) >= sr_template.dev_max || !scsi_CDs[MINOR(dev)].device) in sr_find_queue()
281 return &scsi_CDs[MINOR(dev)].device->request_queue; in sr_find_queue()
396 !scsi_CDs[dev].device || in sr_init_command()
397 !scsi_CDs[dev].device->online) { in sr_init_command()
402 if (scsi_CDs[dev].device->changed) { in sr_init_command()
410 if ((SCpnt->request.cmd == WRITE) && !scsi_CDs[dev].device->writeable) in sr_init_command()
417 s_size = scsi_CDs[dev].device->sector_size; in sr_init_command()
479 SCpnt->transfersize = scsi_CDs[dev].device->sector_size; in sr_init_command()
524 || !scsi_CDs[MINOR(cdi->dev)].device) { in sr_open()
531 if (!scsi_block_when_processing_errors(scsi_CDs[MINOR(cdi->dev)].device)) { in sr_open()
534 scsi_CDs[MINOR(cdi->dev)].device->access_count++; in sr_open()
535 if (scsi_CDs[MINOR(cdi->dev)].device->host->hostt->module) in sr_open()
536 __MOD_INC_USE_COUNT(scsi_CDs[MINOR(cdi->dev)].device->host->hostt->module); in sr_open()
545 if (scsi_CDs[MINOR(cdi->dev)].needs_sector_size) in sr_open()
572 for (cpnt = scsi_CDs, i = 0; i < sr_template.dev_max; i++, cpnt++) in sr_attach()
580 scsi_CDs[i].device = SDp; in sr_attach()
601 SRpnt = scsi_allocate_request(scsi_CDs[i].device); in get_sectorsize()
605 scsi_CDs[i].capacity = 0x1fffff; in get_sectorsize()
607 scsi_CDs[i].needs_sector_size = 1; in get_sectorsize()
618 cmd[1] = (scsi_CDs[i].device->scsi_level <= SCSI_2) ? in get_sectorsize()
619 ((scsi_CDs[i].device->lun << 5) & 0xe0) : 0; in get_sectorsize()
642 scsi_CDs[i].capacity = 0x1fffff; in get_sectorsize()
644 scsi_CDs[i].needs_sector_size = 1; in get_sectorsize()
648 &scsi_CDs[i].capacity)) in get_sectorsize()
650 scsi_CDs[i].capacity = 1 + ((buffer[0] << 24) | in get_sectorsize()
669 scsi_CDs[i].capacity *= 4; in get_sectorsize()
676 scsi_CDs[i].capacity = 0; in get_sectorsize()
677 scsi_CDs[i].needs_sector_size = 1; in get_sectorsize()
680 scsi_CDs[i].device->sector_size = sector_size; in get_sectorsize()
686 scsi_CDs[i].needs_sector_size = 0; in get_sectorsize()
687 sr_sizes[i] = scsi_CDs[i].capacity >> (BLOCK_SIZE_BITS - 9); in get_sectorsize()
717 cmd[1] = (scsi_CDs[i].device->scsi_level <= SCSI_2) ? in get_capabilities()
718 ((scsi_CDs[i].device->lun << 5) & 0xe0) : 0; in get_capabilities()
726 scsi_CDs[i].cdi.speed = 1; in get_capabilities()
727 scsi_CDs[i].cdi.mask |= (CDC_CD_R | CDC_CD_RW | CDC_DVD_R | in get_capabilities()
735 scsi_CDs[i].cdi.speed = ((buffer[n + 8] << 8) + buffer[n + 9]) / 176; in get_capabilities()
736 scsi_CDs[i].readcd_known = 1; in get_capabilities()
737 scsi_CDs[i].readcd_cdda = buffer[n + 5] & 0x01; in get_capabilities()
741 scsi_CDs[i].cdi.speed, in get_capabilities()
750 scsi_CDs[i].cdi.mask |= CDC_CLOSE_TRAY; in get_capabilities()
753 scsi_CDs[i].cdi.mask |= CDC_DVD; in get_capabilities()
756 scsi_CDs[i].cdi.mask |= CDC_DVD_RAM; in get_capabilities()
758 scsi_CDs[i].device->writeable = 1; in get_capabilities()
762 scsi_CDs[i].cdi.mask |= CDC_DVD_R; in get_capabilities()
765 scsi_CDs[i].cdi.mask |= CDC_CD_RW; in get_capabilities()
768 scsi_CDs[i].cdi.mask |= CDC_CD_R; in get_capabilities()
771 scsi_CDs[i].cdi.mask |= CDC_OPEN_TRAY; in get_capabilities()
775 scsi_CDs[i].cdi.capacity = in get_capabilities()
776 cdrom_number_of_slots(&(scsi_CDs[i].cdi)); in get_capabilities()
777 if (scsi_CDs[i].cdi.capacity <= 1) in get_capabilities()
779 scsi_CDs[i].cdi.mask |= CDC_SELECT_DISC; in get_capabilities()
792 Scsi_Device *device = scsi_CDs[MINOR(cdi->dev)].device; in sr_packet()
820 if (scsi_CDs) in sr_init()
824 scsi_CDs = kmalloc(sr_template.dev_max * sizeof(Scsi_CD), GFP_ATOMIC); in sr_init()
825 if (!scsi_CDs) in sr_init()
827 memset(scsi_CDs, 0, sr_template.dev_max * sizeof(Scsi_CD)); in sr_init()
856 kfree(scsi_CDs); in sr_init()
857 scsi_CDs = NULL; in sr_init()
876 if (scsi_CDs[i].capacity) in sr_finish()
878 scsi_CDs[i].capacity = 0x1fffff; in sr_finish()
879 scsi_CDs[i].device->sector_size = 2048; /* A guess, just in case */ in sr_finish()
880 scsi_CDs[i].needs_sector_size = 1; in sr_finish()
881 scsi_CDs[i].device->changed = 1; /* force recheck CD type */ in sr_finish()
885 printk("Scd sectorsize = %d bytes.\n", scsi_CDs[i].sector_size); in sr_finish()
887 scsi_CDs[i].use = 1; in sr_finish()
889 scsi_CDs[i].device->ten = 1; in sr_finish()
890 scsi_CDs[i].device->remap = 1; in sr_finish()
891 scsi_CDs[i].readcd_known = 0; in sr_finish()
892 scsi_CDs[i].readcd_cdda = 0; in sr_finish()
893 sr_sizes[i] = scsi_CDs[i].capacity >> (BLOCK_SIZE_BITS - 9); in sr_finish()
895 scsi_CDs[i].cdi.ops = &sr_dops; in sr_finish()
896 scsi_CDs[i].cdi.handle = &scsi_CDs[i]; in sr_finish()
897 scsi_CDs[i].cdi.dev = MKDEV(MAJOR_NR, i); in sr_finish()
898 scsi_CDs[i].cdi.mask = 0; in sr_finish()
899 scsi_CDs[i].cdi.capacity = 1; in sr_finish()
908 strcpy(scsi_CDs[i].cdi.name, name); in sr_finish()
909 scsi_CDs[i].cdi.de = in sr_finish()
910 devfs_register (scsi_CDs[i].device->de, "cd", in sr_finish()
914 register_cdrom(&scsi_CDs[i].cdi); in sr_finish()
921 if (scsi_CDs[0].device && scsi_CDs[0].device->host->sg_tablesize) in sr_finish()
934 if (scsi_CDs == NULL) in sr_detach()
936 for (cpnt = scsi_CDs, i = 0; i < sr_template.dev_max; i++, cpnt++) in sr_detach()
971 if (scsi_CDs != NULL) { in exit_sr()
972 kfree(scsi_CDs); in exit_sr()