Lines Matching refs:sr_template

72 static struct Scsi_Device_Template sr_template =  variable
107 if (sr_template.module) in sr_release()
108 __MOD_DEC_USE_COUNT(sr_template.module); in sr_release()
278 if (MINOR(dev) >= sr_template.dev_max || !scsi_CDs[MINOR(dev)].device) in sr_find_queue()
395 if (dev >= sr_template.nr_dev || in sr_init_command()
523 if (MINOR(cdi->dev) >= sr_template.dev_max in sr_open()
537 if (sr_template.module) in sr_open()
538 __MOD_INC_USE_COUNT(sr_template.module); in sr_open()
556 sr_template.dev_noticed++; in sr_detect()
568 if (sr_template.nr_dev >= sr_template.dev_max) { in sr_attach()
572 for (cpnt = scsi_CDs, i = 0; i < sr_template.dev_max; i++, cpnt++) in sr_attach()
576 if (i >= sr_template.dev_max) in sr_attach()
582 sr_template.nr_dev++; in sr_attach()
583 if (sr_template.nr_dev > sr_template.dev_max) in sr_attach()
809 if (sr_template.dev_noticed == 0) in sr_init()
815 sr_template.dev_noticed = 0; in sr_init()
823 sr_template.dev_max = sr_template.dev_noticed + SR_EXTRA_DEVS; in sr_init()
824 scsi_CDs = kmalloc(sr_template.dev_max * sizeof(Scsi_CD), GFP_ATOMIC); in sr_init()
827 memset(scsi_CDs, 0, sr_template.dev_max * sizeof(Scsi_CD)); in sr_init()
829 sr_sizes = kmalloc(sr_template.dev_max * sizeof(int), GFP_ATOMIC); in sr_init()
832 memset(sr_sizes, 0, sr_template.dev_max * sizeof(int)); in sr_init()
834 sr_blocksizes = kmalloc(sr_template.dev_max * sizeof(int), GFP_ATOMIC); in sr_init()
838 sr_hardsizes = kmalloc(sr_template.dev_max * sizeof(int), GFP_ATOMIC); in sr_init()
844 for (i = 0; i < sr_template.dev_max; i++) { in sr_init()
860 sr_template.dev_noticed = 0; in sr_init()
873 for (i = 0; i < sr_template.nr_dev; ++i) { in sr_finish()
936 for (cpnt = scsi_CDs, i = 0; i < sr_template.dev_max; i++, cpnt++) in sr_detach()
952 sr_template.nr_dev--; in sr_detach()
953 sr_template.dev_noticed--; in sr_detach()
962 sr_template.module = THIS_MODULE; in init_sr()
963 return scsi_register_module(MODULE_SCSI_DEV, &sr_template); in init_sr()
968 scsi_unregister_module(MODULE_SCSI_DEV, &sr_template); in exit_sr()
987 sr_template.dev_max = 0; in exit_sr()