Commit cbd0b5b7 authored by Arjan van de Ven's avatar Arjan van de Ven Committed by Bartlomiej Zolnierkiewicz

[ide] unexport atapi_*_bytes() and ide_read_24()

From: Arjan van de Ven <arjan@infradead.org>

* make atapi_{input,output}_bytes() static, fix users to use drive->hwif
* remove ide_read_24() export; it's unused since the ide-io.c reorganization
* add a FIXME comment to the ide_fix_driveid() export

slightly changed by me (bart)
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
parent 4d1a957a
...@@ -585,7 +585,7 @@ static void idefloppy_input_buffers (ide_drive_t *drive, idefloppy_pc_t *pc, uns ...@@ -585,7 +585,7 @@ static void idefloppy_input_buffers (ide_drive_t *drive, idefloppy_pc_t *pc, uns
count = min(bvec->bv_len, bcount); count = min(bvec->bv_len, bcount);
data = bvec_kmap_irq(bvec, &flags); data = bvec_kmap_irq(bvec, &flags);
atapi_input_bytes(drive, data, count); drive->hwif->atapi_input_bytes(drive, data, count);
bvec_kunmap_irq(data, &flags); bvec_kunmap_irq(data, &flags);
bcount -= count; bcount -= count;
...@@ -619,7 +619,7 @@ static void idefloppy_output_buffers (ide_drive_t *drive, idefloppy_pc_t *pc, un ...@@ -619,7 +619,7 @@ static void idefloppy_output_buffers (ide_drive_t *drive, idefloppy_pc_t *pc, un
count = min(bvec->bv_len, bcount); count = min(bvec->bv_len, bcount);
data = bvec_kmap_irq(bvec, &flags); data = bvec_kmap_irq(bvec, &flags);
atapi_output_bytes(drive, data, count); drive->hwif->atapi_output_bytes(drive, data, count);
bvec_kunmap_irq(data, &flags); bvec_kunmap_irq(data, &flags);
bcount -= count; bcount -= count;
......
...@@ -184,16 +184,6 @@ void default_hwif_mmiops (ide_hwif_t *hwif) ...@@ -184,16 +184,6 @@ void default_hwif_mmiops (ide_hwif_t *hwif)
EXPORT_SYMBOL(default_hwif_mmiops); EXPORT_SYMBOL(default_hwif_mmiops);
void default_hwif_transport (ide_hwif_t *hwif)
{
hwif->ata_input_data = ata_input_data;
hwif->ata_output_data = ata_output_data;
hwif->atapi_input_bytes = atapi_input_bytes;
hwif->atapi_output_bytes = atapi_output_bytes;
}
EXPORT_SYMBOL(default_hwif_transport);
u32 ide_read_24 (ide_drive_t *drive) u32 ide_read_24 (ide_drive_t *drive)
{ {
u8 hcyl = HWIF(drive)->INB(IDE_HCYL_REG); u8 hcyl = HWIF(drive)->INB(IDE_HCYL_REG);
...@@ -202,8 +192,6 @@ u32 ide_read_24 (ide_drive_t *drive) ...@@ -202,8 +192,6 @@ u32 ide_read_24 (ide_drive_t *drive)
return (hcyl<<16)|(lcyl<<8)|sect; return (hcyl<<16)|(lcyl<<8)|sect;
} }
EXPORT_SYMBOL(ide_read_24);
void SELECT_DRIVE (ide_drive_t *drive) void SELECT_DRIVE (ide_drive_t *drive)
{ {
if (HWIF(drive)->selectproc) if (HWIF(drive)->selectproc)
...@@ -299,7 +287,7 @@ void ata_output_data (ide_drive_t *drive, void *buffer, u32 wcount) ...@@ -299,7 +287,7 @@ void ata_output_data (ide_drive_t *drive, void *buffer, u32 wcount)
* extra byte allocated for the buffer. * extra byte allocated for the buffer.
*/ */
void atapi_input_bytes (ide_drive_t *drive, void *buffer, u32 bytecount) static void atapi_input_bytes(ide_drive_t *drive, void *buffer, u32 bytecount)
{ {
ide_hwif_t *hwif = HWIF(drive); ide_hwif_t *hwif = HWIF(drive);
...@@ -316,9 +304,7 @@ void atapi_input_bytes (ide_drive_t *drive, void *buffer, u32 bytecount) ...@@ -316,9 +304,7 @@ void atapi_input_bytes (ide_drive_t *drive, void *buffer, u32 bytecount)
hwif->INSW(IDE_DATA_REG, ((u8 *)buffer)+(bytecount & ~0x03), 1); hwif->INSW(IDE_DATA_REG, ((u8 *)buffer)+(bytecount & ~0x03), 1);
} }
EXPORT_SYMBOL(atapi_input_bytes); static void atapi_output_bytes(ide_drive_t *drive, void *buffer, u32 bytecount)
void atapi_output_bytes (ide_drive_t *drive, void *buffer, u32 bytecount)
{ {
ide_hwif_t *hwif = HWIF(drive); ide_hwif_t *hwif = HWIF(drive);
...@@ -335,7 +321,15 @@ void atapi_output_bytes (ide_drive_t *drive, void *buffer, u32 bytecount) ...@@ -335,7 +321,15 @@ void atapi_output_bytes (ide_drive_t *drive, void *buffer, u32 bytecount)
hwif->OUTSW(IDE_DATA_REG, ((u8*)buffer)+(bytecount & ~0x03), 1); hwif->OUTSW(IDE_DATA_REG, ((u8*)buffer)+(bytecount & ~0x03), 1);
} }
EXPORT_SYMBOL(atapi_output_bytes); void default_hwif_transport(ide_hwif_t *hwif)
{
hwif->ata_input_data = ata_input_data;
hwif->ata_output_data = ata_output_data;
hwif->atapi_input_bytes = atapi_input_bytes;
hwif->atapi_output_bytes = atapi_output_bytes;
}
EXPORT_SYMBOL(default_hwif_transport);
/* /*
* Beginning of Taskfile OPCODE Library and feature sets. * Beginning of Taskfile OPCODE Library and feature sets.
...@@ -437,6 +431,7 @@ void ide_fix_driveid (struct hd_driveid *id) ...@@ -437,6 +431,7 @@ void ide_fix_driveid (struct hd_driveid *id)
#endif #endif
} }
/* FIXME: exported for use by the USB storage (isd200.c) code only */
EXPORT_SYMBOL(ide_fix_driveid); EXPORT_SYMBOL(ide_fix_driveid);
void ide_fixstring (u8 *s, const int bytecount, const int byteswap) void ide_fixstring (u8 *s, const int bytecount, const int byteswap)
......
...@@ -152,7 +152,7 @@ static void idescsi_input_buffers (ide_drive_t *drive, idescsi_pc_t *pc, unsigne ...@@ -152,7 +152,7 @@ static void idescsi_input_buffers (ide_drive_t *drive, idescsi_pc_t *pc, unsigne
} }
count = min(pc->sg->length - pc->b_count, bcount); count = min(pc->sg->length - pc->b_count, bcount);
buf = page_address(pc->sg->page) + pc->sg->offset; buf = page_address(pc->sg->page) + pc->sg->offset;
atapi_input_bytes (drive, buf + pc->b_count, count); drive->hwif->atapi_input_bytes(drive, buf + pc->b_count, count);
bcount -= count; pc->b_count += count; bcount -= count; pc->b_count += count;
if (pc->b_count == pc->sg->length) { if (pc->b_count == pc->sg->length) {
pc->sg++; pc->sg++;
...@@ -174,7 +174,7 @@ static void idescsi_output_buffers (ide_drive_t *drive, idescsi_pc_t *pc, unsign ...@@ -174,7 +174,7 @@ static void idescsi_output_buffers (ide_drive_t *drive, idescsi_pc_t *pc, unsign
} }
count = min(pc->sg->length - pc->b_count, bcount); count = min(pc->sg->length - pc->b_count, bcount);
buf = page_address(pc->sg->page) + pc->sg->offset; buf = page_address(pc->sg->page) + pc->sg->offset;
atapi_output_bytes (drive, buf + pc->b_count, count); drive->hwif->atapi_output_bytes(drive, buf + pc->b_count, count);
bcount -= count; pc->b_count += count; bcount -= count; pc->b_count += count;
if (pc->b_count == pc->sg->length) { if (pc->b_count == pc->sg->length) {
pc->sg++; pc->sg++;
...@@ -481,7 +481,7 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive) ...@@ -481,7 +481,7 @@ static ide_startstop_t idescsi_pc_intr (ide_drive_t *drive)
if (pc->sg) if (pc->sg)
idescsi_input_buffers(drive, pc, temp); idescsi_input_buffers(drive, pc, temp);
else else
atapi_input_bytes(drive, pc->current_position, temp); drive->hwif->atapi_input_bytes(drive, pc->current_position, temp);
printk(KERN_ERR "ide-scsi: transferred %d of %d bytes\n", temp, bcount.all); printk(KERN_ERR "ide-scsi: transferred %d of %d bytes\n", temp, bcount.all);
} }
pc->actually_transferred += temp; pc->actually_transferred += temp;
...@@ -541,7 +541,7 @@ static ide_startstop_t idescsi_transfer_pc(ide_drive_t *drive) ...@@ -541,7 +541,7 @@ static ide_startstop_t idescsi_transfer_pc(ide_drive_t *drive)
/* Set the interrupt routine */ /* Set the interrupt routine */
ide_set_handler(drive, &idescsi_pc_intr, get_timeout(pc), idescsi_expiry); ide_set_handler(drive, &idescsi_pc_intr, get_timeout(pc), idescsi_expiry);
/* Send the actual packet */ /* Send the actual packet */
atapi_output_bytes(drive, scsi->pc->c, 12); drive->hwif->atapi_output_bytes(drive, scsi->pc->c, 12);
if (test_bit (PC_DMA_OK, &pc->flags)) { if (test_bit (PC_DMA_OK, &pc->flags)) {
set_bit (PC_DMA_IN_PROGRESS, &pc->flags); set_bit (PC_DMA_IN_PROGRESS, &pc->flags);
hwif->dma_start(drive); hwif->dma_start(drive);
......
...@@ -1295,8 +1295,6 @@ extern void QUIRK_LIST(ide_drive_t *); ...@@ -1295,8 +1295,6 @@ extern void QUIRK_LIST(ide_drive_t *);
extern void ata_input_data(ide_drive_t *, void *, u32); extern void ata_input_data(ide_drive_t *, void *, u32);
extern void ata_output_data(ide_drive_t *, void *, u32); extern void ata_output_data(ide_drive_t *, void *, u32);
extern void atapi_input_bytes(ide_drive_t *, void *, u32);
extern void atapi_output_bytes(ide_drive_t *, void *, u32);
extern int drive_is_ready(ide_drive_t *); extern int drive_is_ready(ide_drive_t *);
extern int wait_for_ready(ide_drive_t *, int /* timeout */); extern int wait_for_ready(ide_drive_t *, int /* timeout */);
......
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