/* No more interrupts */
if ((stat & ATA_DRQ) == 0) {
+ int uptodate;
+
debug_log("Packet command completed, %d bytes transferred\n",
pc->xferred);
dsc = 1;
/* Command finished - Call the callback function */
- drive->pc_callback(drive, dsc);
+ uptodate = drive->pc_callback(drive, dsc);
+
+ if (uptodate == 0)
+ drive->failed_pc = NULL;
+
+ if (blk_special_request(rq))
+ ide_complete_rq(drive, 0);
+ else
+ ide_end_request(drive, uptodate, 0);
return ide_stopped;
}
ide_end_request(drive, 1, 0);
}
-static void ide_floppy_callback(ide_drive_t *drive, int dsc)
+static int ide_floppy_callback(ide_drive_t *drive, int dsc)
{
struct ide_disk_obj *floppy = drive->driver_data;
struct ide_atapi_pc *pc = drive->pc;
"Aborting request!\n");
}
- if (uptodate == 0)
- drive->failed_pc = NULL;
-
- if (blk_special_request(rq)) {
+ if (blk_special_request(rq))
rq->errors = uptodate ? 0 : IDE_DRV_ERROR_GENERAL;
- ide_complete_rq(drive, 0);
- } else
- ide_end_request(drive, uptodate, 0);
+
+ return uptodate;
}
static void ide_floppy_report_error(struct ide_disk_obj *floppy,
static void ide_tape_handle_dsc(ide_drive_t *);
-static void ide_tape_callback(ide_drive_t *drive, int dsc)
+static int ide_tape_callback(ide_drive_t *drive, int dsc)
{
idetape_tape_t *tape = drive->driver_data;
struct ide_atapi_pc *pc = drive->pc;
rq->errors = err;
- if (uptodate == 0)
- drive->failed_pc = NULL;
-
- if (blk_special_request(rq))
- ide_complete_rq(drive, 0);
- else
- ide_end_request(drive, uptodate, 0);
+ return uptodate;
}
/*
struct ide_atapi_pc *failed_pc;
/* callback for packet commands */
- void (*pc_callback)(struct ide_drive_s *, int);
+ int (*pc_callback)(struct ide_drive_s *, int);
void (*pc_update_buffers)(struct ide_drive_s *, struct ide_atapi_pc *);
int (*pc_io_buffers)(struct ide_drive_s *, struct ide_atapi_pc *,