Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 82109
b: refs/heads/master
c: 8ee69f5
h: refs/heads/master
i:
  82107: 3a58af0
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Feb 1, 2008
1 parent b254261 commit af92aff
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 03f537d50af7381317351396480411b3e00e6c7e
refs/heads/master: 8ee69f5a83660796ffa1d33e67d0064db44cfc23
25 changes: 15 additions & 10 deletions trunk/drivers/ide/ide-cd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1047,6 +1047,20 @@ static ide_startstop_t cdrom_start_read (ide_drive_t *drive, unsigned int block)
* Execute all other packet commands.
*/

static void ide_cd_request_sense_fixup(struct request *rq)
{
/*
* Some of the trailing request sense fields are optional,
* and some drives don't send them. Sigh.
*/
if (rq->cmd[0] == GPCMD_REQUEST_SENSE &&
rq->data_len > 0 && rq->data_len <= 5)
while (rq->data_len > 0) {
*(u8 *)rq->data++ = 0;
--rq->data_len;
}
}

/* Interrupt routine for packet command completion. */
static ide_startstop_t cdrom_pc_intr (ide_drive_t *drive)
{
Expand All @@ -1069,16 +1083,7 @@ static ide_startstop_t cdrom_pc_intr (ide_drive_t *drive)
/* If DRQ is clear, the command has completed.
Complain if we still have data left to transfer. */
if ((stat & DRQ_STAT) == 0) {
/* Some of the trailing request sense fields are optional, and
some drives don't send them. Sigh. */
if (rq->cmd[0] == GPCMD_REQUEST_SENSE &&
rq->data_len > 0 &&
rq->data_len <= 5) {
while (rq->data_len > 0) {
*(unsigned char *)rq->data++ = 0;
--rq->data_len;
}
}
ide_cd_request_sense_fixup(rq);

if (rq->data_len == 0)
cdrom_end_request(drive, 1);
Expand Down

0 comments on commit af92aff

Please sign in to comment.