1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
3 * Copyright (C) 2000 Jens Axboe <axboe@suse.de>
4 * Copyright (C) 2001-2004 Peter Osterlund <petero2@telia.com>
6 * May be copied or modified under the terms of the GNU General Public
7 * License. See linux/COPYING for more information.
9 * Packet writing layer for ATAPI and SCSI CD-R, CD-RW, DVD-R, and
13 #ifndef _UAPI__PKTCDVD_H
14 #define _UAPI__PKTCDVD_H
16 #include <linux/types.h>
19 * 1 for normal debug messages, 2 is very verbose. 0 to turn it off.
21 #define PACKET_DEBUG 1
25 #define PKT_RB_POOL_SIZE 512
28 * How long we should hold a non-full packet before starting data gathering.
30 #define PACKET_WAIT_TIME (HZ * 5 / 1000)
33 * use drive write caching -- we need deferred error handling to be
34 * able to successfully recover with this option (drive will return good
35 * status as soon as the cdb is validated).
37 #if defined(CONFIG_CDROM_PKTCDVD_WCACHE)
38 #define USE_WCACHING 1
40 #define USE_WCACHING 0
44 * No user-servicable parts beyond this point ->
53 #define PACKET_DVDRW 4
58 #define PACKET_WRITABLE 1 /* pd is writable */
59 #define PACKET_NWA_VALID 2 /* next writable address valid */
60 #define PACKET_LRA_VALID 3 /* last recorded address valid */
61 #define PACKET_MERGE_SEGS 4 /* perform segment merging to keep */
62 /* underlying cdrom device happy */
65 * Disc status -- from READ_DISC_INFO
67 #define PACKET_DISC_EMPTY 0
68 #define PACKET_DISC_INCOMPLETE 1
69 #define PACKET_DISC_COMPLETE 2
70 #define PACKET_DISC_OTHER 3
73 * write type, and corresponding data block type
75 #define PACKET_MODE1 1
76 #define PACKET_MODE2 2
77 #define PACKET_BLOCK_MODE1 8
78 #define PACKET_BLOCK_MODE2 10
81 * Last session/border status
83 #define PACKET_SESSION_EMPTY 0
84 #define PACKET_SESSION_INCOMPLETE 1
85 #define PACKET_SESSION_RESERVED 2
86 #define PACKET_SESSION_COMPLETE 3
88 #define PACKET_MCN "4a656e734178626f65323030300000"
92 #define PKT_CTRL_CMD_SETUP 0
93 #define PKT_CTRL_CMD_TEARDOWN 1
94 #define PKT_CTRL_CMD_STATUS 2
96 struct pkt_ctrl_command
{
97 __u32 command
; /* in: Setup, teardown, status */
98 __u32 dev_index
; /* in/out: Device index */
99 __u32 dev
; /* in/out: Device nr for cdrw device */
100 __u32 pkt_dev
; /* in/out: Device nr for packet device */
101 __u32 num_devices
; /* out: Largest device index + 1 */
102 __u32 padding
; /* Not used */
108 #define PACKET_IOCTL_MAGIC ('X')
109 #define PACKET_CTRL_CMD _IOWR(PACKET_IOCTL_MAGIC, 1, struct pkt_ctrl_command)
112 #endif /* _UAPI__PKTCDVD_H */