Search
lxdream.org :: lxdream/src/gdrom/ide.c :: diff
lxdream 0.9.1
released Jun 29
Download Now
filename src/gdrom/ide.c
changeset 149:d88dd2e9a190
prev143:9446fb6df0c5
next152:d42a4c5cc709
author nkeynes
date Sat May 20 06:24:49 2006 +0000 (14 years ago)
permissions -rw-r--r--
last change Add disc info + spin up (probably seek) commands
file annotate diff log raw
1.1 --- a/src/gdrom/ide.c Wed May 03 12:52:38 2006 +0000
1.2 +++ b/src/gdrom/ide.c Sat May 20 06:24:49 2006 +0000
1.3 @@ -1,5 +1,5 @@
1.4 /**
1.5 - * $Id: ide.c,v 1.12 2006-05-03 12:52:38 nkeynes Exp $
1.6 + * $Id: ide.c,v 1.13 2006-05-20 06:24:49 nkeynes Exp $
1.7 *
1.8 * IDE interface implementation
1.9 *
1.10 @@ -187,6 +187,7 @@
1.11 ide_reset();
1.12 break;
1.13 case IDE_CMD_PACKET:
1.14 + idereg.count = 0x01;
1.15 ide_set_write_buffer(command_buffer,12);
1.16 break;
1.17 case IDE_CMD_SET_FEATURE:
1.18 @@ -278,15 +279,27 @@
1.19 ide_set_read_buffer( data_buffer, length , blocksize );
1.20 break;
1.21 case PKT_CMD_READ_TOC:
1.22 - if( !gdrom_get_toc( data_buffer ) ) {
1.23 - ide_set_packet_error( PKT_ERR_NODISC ); /* No disc in drive */
1.24 + status = gdrom_get_toc( data_buffer );
1.25 + if( status != PKT_ERR_OK ) {
1.26 + ide_set_packet_error( status );
1.27 return;
1.28 - }
1.29 + }
1.30 length = (cmd[3]<<8) | cmd[4];
1.31 if( length > sizeof(struct gdrom_toc) )
1.32 length = sizeof(struct gdrom_toc);
1.33 ide_set_read_buffer( data_buffer, length, blocksize );
1.34 break;
1.35 + case PKT_CMD_DISC_INFO:
1.36 + status = gdrom_get_info( data_buffer );
1.37 + if( status != PKT_ERR_OK ) {
1.38 + ide_set_packet_error( status );
1.39 + return;
1.40 + }
1.41 + length = cmd[4];
1.42 + if( length > 6 )
1.43 + length = 6;
1.44 + ide_set_read_buffer( data_buffer, length, blocksize );
1.45 + break;
1.46 case PKT_CMD_READ_SECTOR:
1.47 lba = cmd[2] << 16 | cmd[3] << 8 | cmd[4];
1.48 length = cmd[8] << 16 | cmd[9] << 8 | cmd[10]; /* blocks */
1.49 @@ -317,6 +330,9 @@
1.50 }
1.51 ide_set_read_buffer( data_buffer, datalen, blocksize );
1.52 break;
1.53 + case PKT_CMD_SPIN_UP:
1.54 + /* do nothing? */
1.55 + break;
1.56 default:
1.57 ide_set_packet_error( PKT_ERR_BADCMD ); /* Invalid command */
1.58 return;
.