Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 114163
b: refs/heads/master
c: b14c721
h: refs/heads/master
i:
  114161: c8e04a6
  114159: 9373f1b
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Oct 13, 2008
1 parent 116b39b commit cd62801
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 22 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: 9b5a18e19f8c610c270ee9a0ba03177d737f6aa5
refs/heads/master: b14c72127fbe8f97e49de7437520175673f7306a
16 changes: 7 additions & 9 deletions trunk/drivers/ide/ide-atapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ EXPORT_SYMBOL_GPL(ide_set_media_lock);
ide_startstop_t ide_pc_intr(ide_drive_t *drive, struct ide_atapi_pc *pc,
ide_handler_t *handler, unsigned int timeout, ide_expiry_t *expiry,
void (*update_buffers)(ide_drive_t *, struct ide_atapi_pc *),
void (*retry_pc)(ide_drive_t *), void (*dsc_handle)(ide_drive_t *),
void (*retry_pc)(ide_drive_t *),
int (*io_buffers)(ide_drive_t *, struct ide_atapi_pc *, unsigned, int))
{
ide_hwif_t *hwif = drive->hwif;
Expand All @@ -216,12 +216,12 @@ ide_startstop_t ide_pc_intr(ide_drive_t *drive, struct ide_atapi_pc *pc,
xfer_func_t *xferfunc;
unsigned int temp;
u16 bcount;
u8 stat, ireason, scsi = drive->scsi;
u8 stat, ireason, scsi = drive->scsi, dsc = 0;

debug_log("Enter %s - interrupt handler\n", __func__);

if (pc->flags & PC_FLAG_TIMEDOUT) {
drive->pc_callback(drive);
drive->pc_callback(drive, 0);
return ide_stopped;
}

Expand Down Expand Up @@ -283,14 +283,12 @@ ide_startstop_t ide_pc_intr(ide_drive_t *drive, struct ide_atapi_pc *pc,
}
cmd_finished:
pc->error = 0;
if ((pc->flags & PC_FLAG_WAIT_FOR_DSC) &&
(stat & ATA_DSC) == 0) {
dsc_handle(drive);
return ide_stopped;
}

if ((pc->flags & PC_FLAG_WAIT_FOR_DSC) && (stat & ATA_DSC) == 0)
dsc = 1;

/* Command finished - Call the callback function */
drive->pc_callback(drive);
drive->pc_callback(drive, dsc);

return ide_stopped;
}
Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/ide/ide-floppy.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ static void idefloppy_update_buffers(ide_drive_t *drive,
idefloppy_end_request(drive, 1, 0);
}

static void ide_floppy_callback(ide_drive_t *drive)
static void ide_floppy_callback(ide_drive_t *drive, int dsc)
{
idefloppy_floppy_t *floppy = drive->driver_data;
struct ide_atapi_pc *pc = floppy->pc;
Expand Down Expand Up @@ -223,7 +223,7 @@ static ide_startstop_t idefloppy_pc_intr(ide_drive_t *drive)

return ide_pc_intr(drive, floppy->pc, idefloppy_pc_intr,
WAIT_FLOPPY_CMD, NULL, idefloppy_update_buffers,
idefloppy_retry_pc, NULL, ide_io_buffers);
idefloppy_retry_pc, ide_io_buffers);
}

/*
Expand Down Expand Up @@ -308,7 +308,7 @@ static ide_startstop_t idefloppy_issue_pc(ide_drive_t *drive,
pc->error = IDEFLOPPY_ERROR_GENERAL;

floppy->failed_pc = NULL;
drive->pc_callback(drive);
drive->pc_callback(drive, 0);
return ide_stopped;
}

Expand Down
13 changes: 9 additions & 4 deletions trunk/drivers/ide/ide-tape.c
Original file line number Diff line number Diff line change
Expand Up @@ -522,14 +522,19 @@ static int idetape_end_request(ide_drive_t *drive, int uptodate, int nr_sects)
return 0;
}

static void ide_tape_callback(ide_drive_t *drive)
static void ide_tape_handle_dsc(ide_drive_t *);

static void ide_tape_callback(ide_drive_t *drive, int dsc)
{
idetape_tape_t *tape = drive->driver_data;
struct ide_atapi_pc *pc = tape->pc;
int uptodate = pc->error ? 0 : 1;

debug_log(DBG_PROCS, "Enter %s\n", __func__);

if (dsc)
ide_tape_handle_dsc(drive);

if (tape->failed_pc == pc)
tape->failed_pc = NULL;

Expand Down Expand Up @@ -658,7 +663,7 @@ static ide_startstop_t idetape_pc_intr(ide_drive_t *drive)

return ide_pc_intr(drive, tape->pc, idetape_pc_intr, WAIT_TAPE_CMD,
NULL, idetape_update_buffers, idetape_retry_pc,
ide_tape_handle_dsc, ide_tape_io_buffers);
ide_tape_io_buffers);
}

/*
Expand Down Expand Up @@ -743,7 +748,7 @@ static ide_startstop_t idetape_issue_pc(ide_drive_t *drive,
pc->error = IDETAPE_ERROR_GENERAL;
}
tape->failed_pc = NULL;
drive->pc_callback(drive);
drive->pc_callback(drive, 0);
return ide_stopped;
}
debug_log(DBG_SENSE, "Retry #%d, cmd = %02X\n", pc->retries, pc->c[0]);
Expand Down Expand Up @@ -805,7 +810,7 @@ static ide_startstop_t idetape_media_access_finished(ide_drive_t *drive)
pc->error = IDETAPE_ERROR_GENERAL;
tape->failed_pc = NULL;
}
drive->pc_callback(drive);
drive->pc_callback(drive, 0);
return ide_stopped;
}

Expand Down
5 changes: 2 additions & 3 deletions trunk/drivers/scsi/ide-scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ static void ide_scsi_hex_dump(u8 *data, int len)

static int idescsi_end_request(ide_drive_t *, int, int);

static void ide_scsi_callback(ide_drive_t *drive)
static void ide_scsi_callback(ide_drive_t *drive, int dsc)
{
idescsi_scsi_t *scsi = drive_to_idescsi(drive);
struct ide_atapi_pc *pc = scsi->pc;
Expand Down Expand Up @@ -298,8 +298,7 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive)
struct ide_atapi_pc *pc = scsi->pc;

return ide_pc_intr(drive, pc, idescsi_pc_intr, get_timeout(pc),
idescsi_expiry, NULL, NULL, NULL,
ide_io_buffers);
idescsi_expiry, NULL, NULL, ide_io_buffers);
}

static ide_startstop_t idescsi_transfer_pc(ide_drive_t *drive)
Expand Down
4 changes: 2 additions & 2 deletions trunk/include/linux/ide.h
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ struct ide_drive_s {
struct completion gendev_rel_comp; /* to deal with device release() */

/* callback for packet commands */
void (*pc_callback)(struct ide_drive_s *);
void (*pc_callback)(struct ide_drive_s *, int);

unsigned long atapi_flags;
};
Expand Down Expand Up @@ -1174,7 +1174,7 @@ int ide_set_media_lock(ide_drive_t *, struct gendisk *, int);
ide_startstop_t ide_pc_intr(ide_drive_t *drive, struct ide_atapi_pc *pc,
ide_handler_t *handler, unsigned int timeout, ide_expiry_t *expiry,
void (*update_buffers)(ide_drive_t *, struct ide_atapi_pc *),
void (*retry_pc)(ide_drive_t *), void (*dsc_handle)(ide_drive_t *),
void (*retry_pc)(ide_drive_t *),
int (*io_buffers)(ide_drive_t *, struct ide_atapi_pc *, unsigned int,
int));
ide_startstop_t ide_transfer_pc(ide_drive_t *, struct ide_atapi_pc *,
Expand Down

0 comments on commit cd62801

Please sign in to comment.