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