Search
lxdream.org :: lxdream/src/gdrom/packet.h :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/gdrom/packet.h
changeset 142:2f631c3a3946
next143:9446fb6df0c5
author nkeynes
date Tue May 02 14:09:11 2006 +0000 (14 years ago)
permissions -rw-r--r--
last change Add packet.h
Implement read toc, request sense, test ready commands.
Fix failure to clear error status on new command
file annotate diff log raw
1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/src/gdrom/packet.h Tue May 02 14:09:11 2006 +0000
1.3 @@ -0,0 +1,62 @@
1.4 +/**
1.5 + * $Id: packet.h,v 1.1 2006-05-02 14:09:11 nkeynes Exp $
1.6 + *
1.7 + * This file defines the command codes and any other flags used by the
1.8 + * GD-Rom ATAPI packet commands.
1.9 + *
1.10 + * Copyright (c) 2005 Nathan Keynes.
1.11 + *
1.12 + * This program is free software; you can redistribute it and/or modify
1.13 + * it under the terms of the GNU General Public License as published by
1.14 + * the Free Software Foundation; either version 2 of the License, or
1.15 + * (at your option) any later version.
1.16 + *
1.17 + * This program is distributed in the hope that it will be useful,
1.18 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
1.19 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1.20 + * GNU General Public License for more details.
1.21 + */
1.22 +
1.23 +/**
1.24 + * Valid command codes (hex):
1.25 + * 00 Test
1.26 + * 10
1.27 + * 11 Inquiry
1.28 + * 12
1.29 + * 13 Request Sense
1.30 + * 14 Read TOC
1.31 + * 15
1.32 + * 16
1.33 + * 20
1.34 + * 21
1.35 + * 22
1.36 + * 30 Read CD
1.37 + * 31
1.38 + * 40
1.39 + * 50
1.40 + * 51
1.41 + * 52
1.42 + * 53
1.43 + * 54
1.44 + * 55
1.45 + * 70
1.46 + * 71
1.47 + * 72
1.48 + * 73
1.49 + * FE
1.50 + */
1.51 +
1.52 +#define PKT_CMD_TEST_READY 0x00
1.53 +#define PKT_CMD_IDENTIFY 0x11
1.54 +#define PKT_CMD_SENSE 0x13
1.55 +#define PKT_CMD_READ_TOC 0x14
1.56 +#define PKT_CMD_READ_SECTOR 0x30
1.57 +
1.58 +#define PKT_ERR_OK 0x0000
1.59 +#define PKT_ERR_NODISC 0x3A02
1.60 +#define PKT_ERR_BADCMD 0x2005
1.61 +#define PKT_ERR_BADFIELD 0x2405
1.62 +
1.63 +
1.64 +#define IDE_READ_MODE1 0x20
1.65 +#define IDE_READ_RAW 0x30
.