patch-pre2.0.6 linux/drivers/block/ide-cd.c
Next file: linux/drivers/block/ll_rw_blk.c
Previous file: linux/drivers/block/genhd.c
Back to the patch index
Back to the overall index
- Lines: 89
- Date:
Sun May 19 15:16:34 1996
- Orig file:
pre2.0.5/linux/drivers/block/ide-cd.c
- Orig date:
Sat May 11 10:42:05 1996
diff -u --recursive --new-file pre2.0.5/linux/drivers/block/ide-cd.c linux/drivers/block/ide-cd.c
@@ -97,6 +97,7 @@
* 3.12 May 7, 1996 -- Rudimentary changer support. Based on patches
* from Gerhard Zuber <zuber@berlin.snafu.de>.
* Let open succeed even if there's no loaded disc.
+ * 3.13 May 19, 1996 -- Fixes for changer code.
*
* NOTE: Direct audio reads will only work on some types of drive.
* So far, i've received reports of success for Sony and Toshiba drives.
@@ -106,6 +107,7 @@
* uses a different protocol.
*
* ATAPI cd-rom driver. To be used with ide.c.
+ * See Documentation/cdrom/ide-cd for usage information.
*
* Copyright (C) 1994, 1995, 1996 scott snyder <snyder@fnald0.fnal.gov>
* May be copied or modified under the terms of the GNU General Public License
@@ -130,9 +132,7 @@
#include <asm/io.h>
#include <asm/byteorder.h>
#include <asm/segment.h>
-#ifdef __alpha__
-# include <asm/unaligned.h>
-#endif
+#include <asm/unaligned.h>
#include "ide.h"
@@ -1149,11 +1149,7 @@
pc.c[0] = READ_10;
pc.c[7] = (nframes >> 8);
pc.c[8] = (nframes & 0xff);
-#ifdef __alpha__
- stl_u (htonl (frame), (unsigned int *) &pc.c[2]);
-#else
- *(int *)(&pc.c[2]) = htonl (frame);
-#endif
+ put_unaligned(htonl (frame), (unsigned int *) &pc.c[2]);
/* Send the command to the drive and return. */
(void) cdrom_transfer_packet_command (drive, pc.c, sizeof (pc.c),
@@ -1937,11 +1933,7 @@
pc.c[0] = READ_CD;
pc.c[1] = (format << 2);
-#ifdef __alpha__
- stl_u(htonl (lba), (unsigned int *) &pc.c[2]);
-#else
- *(int *)(&pc.c[2]) = htonl (lba);
-#endif
+ put_unaligned(htonl(lba), (unsigned int *) &pc.c[2]);
pc.c[8] = 1; /* one block */
pc.c[9] = 0x10;
@@ -1968,7 +1960,7 @@
/* If SLOT<0, unload the current slot. Otherwise, try to load SLOT. */
static int
-cdrom_load_unload (ide_drive_t *drive, unsigned long slot,
+cdrom_load_unload (ide_drive_t *drive, int slot,
struct atapi_request_sense *reqbuf)
{
struct packet_command pc;
@@ -2403,16 +2395,14 @@
if (drive->usage > 1)
return -EBUSY;
- stat = cdrom_load_unload (drive, -1, NULL);
- if (stat) return stat;
+ (void) cdrom_load_unload (drive, -1, NULL);
cdrom_saw_media_change (drive);
if (arg == -1) {
(void) cdrom_lockdoor (drive, 0, NULL);
return 0;
}
- stat = cdrom_load_unload (drive, arg, NULL);
- if (stat) return stat;
+ (void) cdrom_load_unload (drive, (int)arg, NULL);
stat = cdrom_check_status (drive, &my_reqbuf);
if (stat && my_reqbuf.sense_key == NOT_READY) {
@@ -2642,7 +2632,6 @@
* Establish interfaces for an IDE port driver, and break out the cdrom
* code into a loadable module.
* Support changers better.
- * Write some real documentation.
*/
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov
with Sam's (original) version of this