#include <linux/module.h>
#include <linux/fs.h>
#include <linux/kernel.h>
#include <linux/mm.h>
#include <linux/bio.h>
#include <linux/compat.h>
#include <linux/string.h>
#include <linux/errno.h>
#include <linux/cdrom.h>
#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/major.h>
#include <linux/blkdev.h>
#include <linux/blk-pm.h>
#include <linux/mutex.h>
#include <linux/slab.h>
#include <linux/pm_runtime.h>
#include <linux/uaccess.h>
#include <asm/unaligned.h>
#include <scsi/scsi.h>
#include <scsi/scsi_dbg.h>
#include <scsi/scsi_device.h>
#include <scsi/scsi_driver.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_eh.h>
#include <scsi/scsi_host.h>
#include <scsi/scsi_ioctl.h>
#include "scsi_logging.h"
#include "sr.h"
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
MODULE_ALIAS_BLOCKDEV_MAJOR(…);
MODULE_ALIAS_SCSI_DEVICE(…);
MODULE_ALIAS_SCSI_DEVICE(…);
#define SR_DISKS …
#define SR_CAPABILITIES …
static int sr_probe(struct device *);
static int sr_remove(struct device *);
static blk_status_t sr_init_command(struct scsi_cmnd *SCpnt);
static int sr_done(struct scsi_cmnd *);
static int sr_runtime_suspend(struct device *dev);
static const struct dev_pm_ops sr_pm_ops = …;
static struct scsi_driver sr_template = …;
static unsigned long sr_index_bits[SR_DISKS / BITS_PER_LONG];
static DEFINE_SPINLOCK(sr_index_lock);
static struct lock_class_key sr_bio_compl_lkclass;
static int sr_open(struct cdrom_device_info *, int);
static void sr_release(struct cdrom_device_info *);
static int get_sectorsize(struct scsi_cd *);
static int get_capabilities(struct scsi_cd *);
static unsigned int sr_check_events(struct cdrom_device_info *cdi,
unsigned int clearing, int slot);
static int sr_packet(struct cdrom_device_info *, struct packet_command *);
static int sr_read_cdda_bpc(struct cdrom_device_info *cdi, void __user *ubuf,
u32 lba, u32 nr, u8 *last_sense);
static const struct cdrom_device_ops sr_dops = …;
static inline struct scsi_cd *scsi_cd(struct gendisk *disk)
{ … }
static int sr_runtime_suspend(struct device *dev)
{ … }
static unsigned int sr_get_events(struct scsi_device *sdev)
{ … }
static unsigned int sr_check_events(struct cdrom_device_info *cdi,
unsigned int clearing, int slot)
{ … }
static int sr_done(struct scsi_cmnd *SCpnt)
{ … }
static blk_status_t sr_init_command(struct scsi_cmnd *SCpnt)
{ … }
static int sr_revalidate_disk(struct scsi_cd *cd)
{ … }
static int sr_block_open(struct gendisk *disk, blk_mode_t mode)
{ … }
static void sr_block_release(struct gendisk *disk)
{ … }
static int sr_block_ioctl(struct block_device *bdev, blk_mode_t mode,
unsigned cmd, unsigned long arg)
{ … }
static unsigned int sr_block_check_events(struct gendisk *disk,
unsigned int clearing)
{ … }
static void sr_free_disk(struct gendisk *disk)
{ … }
static const struct block_device_operations sr_bdops = …;
static int sr_open(struct cdrom_device_info *cdi, int purpose)
{ … }
static void sr_release(struct cdrom_device_info *cdi)
{ … }
static int sr_probe(struct device *dev)
{ … }
static int get_sectorsize(struct scsi_cd *cd)
{ … }
static int get_capabilities(struct scsi_cd *cd)
{ … }
static int sr_packet(struct cdrom_device_info *cdi,
struct packet_command *cgc)
{ … }
static int sr_read_cdda_bpc(struct cdrom_device_info *cdi, void __user *ubuf,
u32 lba, u32 nr, u8 *last_sense)
{ … }
static int sr_remove(struct device *dev)
{ … }
static int __init init_sr(void)
{ … }
static void __exit exit_sr(void)
{ … }
module_init(…) …;
module_exit(exit_sr);
MODULE_LICENSE(…) …;