]>
Commit | Line | Data |
---|---|---|
1da177e4 LT |
1 | /* |
2 | * sr.h by David Giller | |
3 | * CD-ROM disk driver header file | |
4 | * | |
5 | * adapted from: | |
6 | * sd.h Copyright (C) 1992 Drew Eckhardt | |
7 | * SCSI disk driver header file by | |
8 | * Drew Eckhardt | |
9 | * | |
10 | * <[email protected]> | |
11 | * | |
12 | * Modified by Eric Youngdale [email protected] to | |
13 | * add scatter-gather, multiple outstanding request, and other | |
14 | * enhancements. | |
15 | */ | |
16 | ||
17 | #ifndef _SR_H | |
18 | #define _SR_H | |
19 | ||
20 | #include <linux/genhd.h> | |
21 | #include <linux/kref.h> | |
22 | ||
210ba1d1 JB |
23 | #define MAX_RETRIES 3 |
24 | #define SR_TIMEOUT (30 * HZ) | |
25 | ||
1da177e4 LT |
26 | struct scsi_device; |
27 | ||
28 | /* The CDROM is fairly slow, so we need a little extra time */ | |
29 | /* In fact, it is very slow if it has to spin up first */ | |
30 | #define IOCTL_TIMEOUT 30*HZ | |
31 | ||
32 | ||
33 | typedef struct scsi_cd { | |
34 | struct scsi_driver *driver; | |
35 | unsigned capacity; /* size in blocks */ | |
36 | struct scsi_device *device; | |
37 | unsigned int vendor; /* vendor code, see sr_vendor.c */ | |
38 | unsigned long ms_offset; /* for reading multisession-CD's */ | |
1da177e4 LT |
39 | unsigned use:1; /* is this device still supportable */ |
40 | unsigned xa_flag:1; /* CD has XA sectors ? */ | |
41 | unsigned readcd_known:1; /* drive supports READ_CD (0xbe) */ | |
42 | unsigned readcd_cdda:1; /* reading audio data using READ_CD */ | |
285e9670 | 43 | unsigned previous_state:1; /* media has changed */ |
1da177e4 LT |
44 | struct cdrom_device_info cdi; |
45 | /* We hold gendisk and scsi_device references on probe and use | |
46 | * the refs on this kref to decide when to release them */ | |
47 | struct kref kref; | |
48 | struct gendisk *disk; | |
49 | } Scsi_CD; | |
50 | ||
51 | int sr_do_ioctl(Scsi_CD *, struct packet_command *); | |
52 | ||
53 | int sr_lock_door(struct cdrom_device_info *, int); | |
54 | int sr_tray_move(struct cdrom_device_info *, int); | |
55 | int sr_drive_status(struct cdrom_device_info *, int); | |
56 | int sr_disk_status(struct cdrom_device_info *); | |
57 | int sr_get_last_session(struct cdrom_device_info *, struct cdrom_multisession *); | |
58 | int sr_get_mcn(struct cdrom_device_info *, struct cdrom_mcn *); | |
59 | int sr_reset(struct cdrom_device_info *); | |
60 | int sr_select_speed(struct cdrom_device_info *cdi, int speed); | |
61 | int sr_audio_ioctl(struct cdrom_device_info *, unsigned int, void *); | |
1da177e4 LT |
62 | |
63 | int sr_is_xa(Scsi_CD *); | |
38582a62 | 64 | int sr_test_unit_ready(struct scsi_device *sdev, struct scsi_sense_hdr *sshdr); |
1da177e4 LT |
65 | |
66 | /* sr_vendor.c */ | |
67 | void sr_vendor_init(Scsi_CD *); | |
68 | int sr_cd_check(struct cdrom_device_info *); | |
69 | int sr_set_blocklength(Scsi_CD *, int blocklength); | |
70 | ||
71 | #endif |