1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 #ifndef _SR_H
19 #define _SR_H
20
21 #include <linux/genhd.h>
22 #include <linux/kref.h>
23
24 #define MAX_RETRIES 3
25 #define SR_TIMEOUT (30 * HZ)
26
27 struct scsi_device;
28
29
30
31 #define IOCTL_TIMEOUT 30*HZ
32
33
34 typedef struct scsi_cd {
35 struct scsi_driver *driver;
36 unsigned capacity;
37 struct scsi_device *device;
38 unsigned int vendor;
39 unsigned long ms_offset;
40 unsigned writeable : 1;
41 unsigned use:1;
42 unsigned xa_flag:1;
43 unsigned readcd_known:1;
44 unsigned readcd_cdda:1;
45 unsigned media_present:1;
46
47
48 int tur_mismatch;
49 bool tur_changed:1;
50 bool get_event_changed:1;
51 bool ignore_get_event:1;
52
53 struct cdrom_device_info cdi;
54
55
56 struct kref kref;
57 struct gendisk *disk;
58 } Scsi_CD;
59
60 #define sr_printk(prefix, cd, fmt, a...) \
61 sdev_prefix_printk(prefix, (cd)->device, (cd)->cdi.name, fmt, ##a)
62
63 int sr_do_ioctl(Scsi_CD *, struct packet_command *);
64
65 int sr_lock_door(struct cdrom_device_info *, int);
66 int sr_tray_move(struct cdrom_device_info *, int);
67 int sr_drive_status(struct cdrom_device_info *, int);
68 int sr_disk_status(struct cdrom_device_info *);
69 int sr_get_last_session(struct cdrom_device_info *, struct cdrom_multisession *);
70 int sr_get_mcn(struct cdrom_device_info *, struct cdrom_mcn *);
71 int sr_reset(struct cdrom_device_info *);
72 int sr_select_speed(struct cdrom_device_info *cdi, int speed);
73 int sr_audio_ioctl(struct cdrom_device_info *, unsigned int, void *);
74
75 int sr_is_xa(Scsi_CD *);
76
77
78 void sr_vendor_init(Scsi_CD *);
79 int sr_cd_check(struct cdrom_device_info *);
80 int sr_set_blocklength(Scsi_CD *, int blocklength);
81
82 #endif