diff options
author | Yunhong Jiang <yunhong.jiang@intel.com> | 2015-08-04 12:17:53 -0700 |
---|---|---|
committer | Yunhong Jiang <yunhong.jiang@intel.com> | 2015-08-04 15:44:42 -0700 |
commit | 9ca8dbcc65cfc63d6f5ef3312a33184e1d726e00 (patch) | |
tree | 1c9cafbcd35f783a87880a10f85d1a060db1a563 /kernel/drivers/scsi/sr.h | |
parent | 98260f3884f4a202f9ca5eabed40b1354c489b29 (diff) |
Add the rt linux 4.1.3-rt3 as base
Import the rt linux 4.1.3-rt3 as OPNFV kvm base.
It's from git://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git linux-4.1.y-rt and
the base is:
commit 0917f823c59692d751951bf5ea699a2d1e2f26a2
Author: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: Sat Jul 25 12:13:34 2015 +0200
Prepare v4.1.3-rt3
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
We lose all the git history this way and it's not good. We
should apply another opnfv project repo in future.
Change-Id: I87543d81c9df70d99c5001fbdf646b202c19f423
Signed-off-by: Yunhong Jiang <yunhong.jiang@intel.com>
Diffstat (limited to 'kernel/drivers/scsi/sr.h')
-rw-r--r-- | kernel/drivers/scsi/sr.h | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/kernel/drivers/scsi/sr.h b/kernel/drivers/scsi/sr.h new file mode 100644 index 000000000..1de33719a --- /dev/null +++ b/kernel/drivers/scsi/sr.h @@ -0,0 +1,81 @@ +/* + * sr.h by David Giller + * CD-ROM disk driver header file + * + * adapted from: + * sd.h Copyright (C) 1992 Drew Eckhardt + * SCSI disk driver header file by + * Drew Eckhardt + * + * <drew@colorado.edu> + * + * Modified by Eric Youngdale eric@andante.org to + * add scatter-gather, multiple outstanding request, and other + * enhancements. + */ + +#ifndef _SR_H +#define _SR_H + +#include <linux/genhd.h> +#include <linux/kref.h> + +#define MAX_RETRIES 3 +#define SR_TIMEOUT (30 * HZ) + +struct scsi_device; + +/* The CDROM is fairly slow, so we need a little extra time */ +/* In fact, it is very slow if it has to spin up first */ +#define IOCTL_TIMEOUT 30*HZ + + +typedef struct scsi_cd { + struct scsi_driver *driver; + unsigned capacity; /* size in blocks */ + struct scsi_device *device; + unsigned int vendor; /* vendor code, see sr_vendor.c */ + unsigned long ms_offset; /* for reading multisession-CD's */ + unsigned writeable : 1; + unsigned use:1; /* is this device still supportable */ + unsigned xa_flag:1; /* CD has XA sectors ? */ + unsigned readcd_known:1; /* drive supports READ_CD (0xbe) */ + unsigned readcd_cdda:1; /* reading audio data using READ_CD */ + unsigned media_present:1; /* media is present */ + + /* GET_EVENT spurious event handling, blk layer guarantees exclusion */ + int tur_mismatch; /* nr of get_event TUR mismatches */ + bool tur_changed:1; /* changed according to TUR */ + bool get_event_changed:1; /* changed according to GET_EVENT */ + bool ignore_get_event:1; /* GET_EVENT is unreliable, use TUR */ + + struct cdrom_device_info cdi; + /* We hold gendisk and scsi_device references on probe and use + * the refs on this kref to decide when to release them */ + struct kref kref; + struct gendisk *disk; +} Scsi_CD; + +#define sr_printk(prefix, cd, fmt, a...) \ + sdev_prefix_printk(prefix, (cd)->device, (cd)->cdi.name, fmt, ##a) + +int sr_do_ioctl(Scsi_CD *, struct packet_command *); + +int sr_lock_door(struct cdrom_device_info *, int); +int sr_tray_move(struct cdrom_device_info *, int); +int sr_drive_status(struct cdrom_device_info *, int); +int sr_disk_status(struct cdrom_device_info *); +int sr_get_last_session(struct cdrom_device_info *, struct cdrom_multisession *); +int sr_get_mcn(struct cdrom_device_info *, struct cdrom_mcn *); +int sr_reset(struct cdrom_device_info *); +int sr_select_speed(struct cdrom_device_info *cdi, int speed); +int sr_audio_ioctl(struct cdrom_device_info *, unsigned int, void *); + +int sr_is_xa(Scsi_CD *); + +/* sr_vendor.c */ +void sr_vendor_init(Scsi_CD *); +int sr_cd_check(struct cdrom_device_info *); +int sr_set_blocklength(Scsi_CD *, int blocklength); + +#endif |