diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/linux/pg.h |
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.
Let it rip!
Diffstat (limited to 'include/linux/pg.h')
-rw-r--r-- | include/linux/pg.h | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/include/linux/pg.h b/include/linux/pg.h new file mode 100644 index 000000000000..db994bb0c794 --- /dev/null +++ b/include/linux/pg.h | |||
@@ -0,0 +1,63 @@ | |||
1 | /* pg.h (c) 1998 Grant R. Guenther <grant@torque.net> | ||
2 | Under the terms of the GNU General Public License | ||
3 | |||
4 | |||
5 | pg.h defines the user interface to the generic ATAPI packet | ||
6 | command driver for parallel port ATAPI devices (pg). The | ||
7 | driver is loosely modelled after the generic SCSI driver, sg, | ||
8 | although the actual interface is different. | ||
9 | |||
10 | The pg driver provides a simple character device interface for | ||
11 | sending ATAPI commands to a device. With the exception of the | ||
12 | ATAPI reset operation, all operations are performed by a pair | ||
13 | of read and write operations to the appropriate /dev/pgN device. | ||
14 | A write operation delivers a command and any outbound data in | ||
15 | a single buffer. Normally, the write will succeed unless the | ||
16 | device is offline or malfunctioning, or there is already another | ||
17 | command pending. If the write succeeds, it should be followed | ||
18 | immediately by a read operation, to obtain any returned data and | ||
19 | status information. A read will fail if there is no operation | ||
20 | in progress. | ||
21 | |||
22 | As a special case, the device can be reset with a write operation, | ||
23 | and in this case, no following read is expected, or permitted. | ||
24 | |||
25 | There are no ioctl() operations. Any single operation | ||
26 | may transfer at most PG_MAX_DATA bytes. Note that the driver must | ||
27 | copy the data through an internal buffer. In keeping with all | ||
28 | current ATAPI devices, command packets are assumed to be exactly | ||
29 | 12 bytes in length. | ||
30 | |||
31 | To permit future changes to this interface, the headers in the | ||
32 | read and write buffers contain a single character "magic" flag. | ||
33 | Currently this flag must be the character "P". | ||
34 | |||
35 | */ | ||
36 | |||
37 | #define PG_MAGIC 'P' | ||
38 | #define PG_RESET 'Z' | ||
39 | #define PG_COMMAND 'C' | ||
40 | |||
41 | #define PG_MAX_DATA 32768 | ||
42 | |||
43 | struct pg_write_hdr { | ||
44 | |||
45 | char magic; /* == PG_MAGIC */ | ||
46 | char func; /* PG_RESET or PG_COMMAND */ | ||
47 | int dlen; /* number of bytes expected to transfer */ | ||
48 | int timeout; /* number of seconds before timeout */ | ||
49 | char packet[12]; /* packet command */ | ||
50 | |||
51 | }; | ||
52 | |||
53 | struct pg_read_hdr { | ||
54 | |||
55 | char magic; /* == PG_MAGIC */ | ||
56 | char scsi; /* "scsi" status == sense key */ | ||
57 | int dlen; /* size of device transfer request */ | ||
58 | int duration; /* time in seconds command took */ | ||
59 | char pad[12]; /* not used */ | ||
60 | |||
61 | }; | ||
62 | |||
63 | /* end of pg.h */ | ||