Commit 21aecbc3 authored by Martin Dalecki's avatar Martin Dalecki Committed by Linus Torvalds

[PATCH] 2.5.8 IDE 34

- Synchronize with 2.5.8.

- Eliminate the cdrom_log_sense() function.

- Pass a struct request to cdrom_analyze_sense_data() since this is the entity
   this function is working on. This shows nicely that this function is broken.

- Use CDROM_PACKET_SIZE where appropriate.

- Kill the obfuscating cmd_buf and cmd_len local variables from
   cdrom_transfer_packet_command(). This made it obvious that the parameters of
   this function where not adequate - to say the least. Fix this.

- Pass a packed command array directly to cdrom_queue_packed_command().  This
   is reducing the number of places where we have to deal with the c member of
   struct packet_command.

- Never pass NULL as sense to cdrom_lockdoor().

- Eliminate cdrom_do_block_pc().

- Eliminate the c member of struct packet_command. Pass them through struct
   request cmd member.

- Don't enable TCQ unconditionally if there is a TCQ queue depth defined.

- Fix small think in ide_cmd_ioctl() rewrite. (My appologies to everyone who
   has to use hdparm to setup his system...)

- Fix compilation without PCI support.
parent e9dc26cd
This diff is collapsed.
......@@ -15,7 +15,7 @@
memory, though. */
#ifndef VERBOSE_IDE_CD_ERRORS
#define VERBOSE_IDE_CD_ERRORS 1
# define VERBOSE_IDE_CD_ERRORS 1
#endif
......@@ -24,7 +24,7 @@
this will give you a slightly smaller kernel. */
#ifndef STANDARD_ATAPI
#define STANDARD_ATAPI 0
# define STANDARD_ATAPI 0
#endif
......@@ -32,14 +32,14 @@
This is apparently needed for supermount. */
#ifndef NO_DOOR_LOCKING
#define NO_DOOR_LOCKING 0
# define NO_DOOR_LOCKING 0
#endif
/************************************************************************/
#define SECTOR_BITS 9
#define SECTOR_BITS 9
#ifndef SECTOR_SIZE
#define SECTOR_SIZE (1 << SECTOR_BITS)
# define SECTOR_SIZE (1 << SECTOR_BITS)
#endif
#define SECTORS_PER_FRAME (CD_FRAMESIZE >> SECTOR_BITS)
#define SECTOR_BUFFER_SIZE (CD_FRAMESIZE * 32)
......@@ -50,12 +50,6 @@
#define MIN(a,b) ((a) < (b) ? (a) : (b))
/* special command codes for strategy routine. */
#define PACKET_COMMAND 4315
#define REQUEST_SENSE_COMMAND 4316
#define RESET_DRIVE_COMMAND 4317
/* Configuration flags. These describe the capabilities of the drive.
They generally do not change after initialization, unless we learn
more about the drive from stuff failing. */
......@@ -90,7 +84,6 @@ struct ide_cd_config_flags {
};
#define CDROM_CONFIG_FLAGS(drive) (&(((struct cdrom_info *)(drive->driver_data))->config_flags))
/* State flags. These give information about the current state of the
drive, and will change during normal operation. */
struct ide_cd_state_flags {
......@@ -111,24 +104,23 @@ struct packet_command {
int quiet;
int timeout;
struct request_sense *sense;
unsigned char c[12];
};
/* Structure of a MSF cdrom address. */
struct atapi_msf {
byte reserved;
byte minute;
byte second;
byte frame;
};
u8 __reserved;
u8 minute;
u8 second;
u8 frame;
} __attribute__((packed));
/* Space to hold the disk TOC. */
#define MAX_TRACKS 99
struct atapi_toc_header {
unsigned short toc_length;
byte first_track;
byte last_track;
};
u16 toc_length;
u8 first_track;
u8 last_track;
} __attribute__((packed));
struct atapi_toc_entry {
byte reserved1;
......@@ -162,17 +154,17 @@ struct atapi_toc {
/* This structure is annoyingly close to, but not identical with,
the cdrom_subchnl structure from cdrom.h. */
struct atapi_cdrom_subchnl {
u_char acdsc_reserved;
u_char acdsc_audiostatus;
u_short acdsc_length;
u_char acdsc_format;
u8 acdsc_reserved;
u8 acdsc_audiostatus;
u16 acdsc_length;
u8 acdsc_format;
#if defined(__BIG_ENDIAN_BITFIELD)
u_char acdsc_ctrl: 4;
u_char acdsc_adr: 4;
u8 acdsc_ctrl: 4;
u8 acdsc_adr: 4;
#elif defined(__LITTLE_ENDIAN_BITFIELD)
u_char acdsc_adr: 4;
u_char acdsc_ctrl: 4;
u8 acdsc_adr: 4;
u8 acdsc_ctrl: 4;
#else
#error "Please fix <asm/byteorder.h>"
#endif
......
......@@ -980,7 +980,7 @@ int ide_cmd_ioctl(ide_drive_t *drive, unsigned long arg)
/* FIXME: Do we really have to zero out the buffer?
*/
memset(argbuf, 0, 4 + SECTOR_WORDS * 4 * vals[3]);
memset(argbuf, 4, SECTOR_WORDS * 4 * vals[3]);
ide_init_drive_cmd(&rq);
rq.buffer = argbuf;
memcpy(argbuf, vals, 4);
......
......@@ -2701,7 +2701,11 @@ static int ide_ioctl (struct inode *inode, struct file *file,
void ide_teardown_commandlist(ide_drive_t *drive)
{
struct pci_dev *pdev= drive->channel->pci_dev;
#ifdef CONFIG_BLK_DEV_IDEPCI
struct pci_dev *pdev = drive->channel->pci_dev;
#else
struct pci_dev *pdev = NULL;
#endif
struct list_head *entry;
list_for_each(entry, &drive->free_req) {
......@@ -2716,7 +2720,11 @@ void ide_teardown_commandlist(ide_drive_t *drive)
int ide_build_commandlist(ide_drive_t *drive)
{
struct pci_dev *pdev= drive->channel->pci_dev;
#ifdef CONFIG_BLK_DEV_IDEPCI
struct pci_dev *pdev = drive->channel->pci_dev;
#else
struct pci_dev *pdev = NULL;
#endif
struct ata_request *ar;
ide_tag_info_t *tcq;
int i, err;
......@@ -2764,9 +2772,9 @@ int ide_build_commandlist(ide_drive_t *drive)
if (i) {
drive->queue_depth = i;
if (i >= 1) {
drive->using_tcq = 1;
drive->tcq->queued = 0;
drive->tcq->active_tag = -1;
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment