Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
0002 /*
0003  * Copyright (C) 2000 Jens Axboe <axboe@suse.de>
0004  * Copyright (C) 2001-2004 Peter Osterlund <petero2@telia.com>
0005  *
0006  * May be copied or modified under the terms of the GNU General Public
0007  * License.  See linux/COPYING for more information.
0008  *
0009  * Packet writing layer for ATAPI and SCSI CD-R, CD-RW, DVD-R, and
0010  * DVD-RW devices.
0011  *
0012  */
0013 #ifndef _UAPI__PKTCDVD_H
0014 #define _UAPI__PKTCDVD_H
0015 
0016 #include <linux/types.h>
0017 
0018 /*
0019  * 1 for normal debug messages, 2 is very verbose. 0 to turn it off.
0020  */
0021 #define PACKET_DEBUG        1
0022 
0023 #define MAX_WRITERS     8
0024 
0025 #define PKT_RB_POOL_SIZE    512
0026 
0027 /*
0028  * How long we should hold a non-full packet before starting data gathering.
0029  */
0030 #define PACKET_WAIT_TIME    (HZ * 5 / 1000)
0031 
0032 /*
0033  * use drive write caching -- we need deferred error handling to be
0034  * able to successfully recover with this option (drive will return good
0035  * status as soon as the cdb is validated).
0036  */
0037 #if defined(CONFIG_CDROM_PKTCDVD_WCACHE)
0038 #define USE_WCACHING        1
0039 #else
0040 #define USE_WCACHING        0
0041 #endif
0042 
0043 /*
0044  * No user-servicable parts beyond this point ->
0045  */
0046 
0047 /*
0048  * device types
0049  */
0050 #define PACKET_CDR      1
0051 #define PACKET_CDRW     2
0052 #define PACKET_DVDR     3
0053 #define PACKET_DVDRW        4
0054 
0055 /*
0056  * flags
0057  */
0058 #define PACKET_WRITABLE     1   /* pd is writable */
0059 #define PACKET_NWA_VALID    2   /* next writable address valid */
0060 #define PACKET_LRA_VALID    3   /* last recorded address valid */
0061 #define PACKET_MERGE_SEGS   4   /* perform segment merging to keep */
0062                     /* underlying cdrom device happy */
0063 
0064 /*
0065  * Disc status -- from READ_DISC_INFO
0066  */
0067 #define PACKET_DISC_EMPTY   0
0068 #define PACKET_DISC_INCOMPLETE  1
0069 #define PACKET_DISC_COMPLETE    2
0070 #define PACKET_DISC_OTHER   3
0071 
0072 /*
0073  * write type, and corresponding data block type
0074  */
0075 #define PACKET_MODE1        1
0076 #define PACKET_MODE2        2
0077 #define PACKET_BLOCK_MODE1  8
0078 #define PACKET_BLOCK_MODE2  10
0079 
0080 /*
0081  * Last session/border status
0082  */
0083 #define PACKET_SESSION_EMPTY        0
0084 #define PACKET_SESSION_INCOMPLETE   1
0085 #define PACKET_SESSION_RESERVED     2
0086 #define PACKET_SESSION_COMPLETE     3
0087 
0088 #define PACKET_MCN          "4a656e734178626f65323030300000"
0089 
0090 #undef PACKET_USE_LS
0091 
0092 #define PKT_CTRL_CMD_SETUP  0
0093 #define PKT_CTRL_CMD_TEARDOWN   1
0094 #define PKT_CTRL_CMD_STATUS 2
0095 
0096 struct pkt_ctrl_command {
0097     __u32 command;              /* in: Setup, teardown, status */
0098     __u32 dev_index;            /* in/out: Device index */
0099     __u32 dev;              /* in/out: Device nr for cdrw device */
0100     __u32 pkt_dev;              /* in/out: Device nr for packet device */
0101     __u32 num_devices;          /* out: Largest device index + 1 */
0102     __u32 padding;              /* Not used */
0103 };
0104 
0105 /*
0106  * packet ioctls
0107  */
0108 #define PACKET_IOCTL_MAGIC  ('X')
0109 #define PACKET_CTRL_CMD     _IOWR(PACKET_IOCTL_MAGIC, 1, struct pkt_ctrl_command)
0110 
0111 
0112 #endif /* _UAPI__PKTCDVD_H */