-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
yaml --- r: 101254 b: refs/heads/master c: 594c16d h: refs/heads/master v: v3
- Loading branch information
Bartlomiej Zolnierkiewicz
committed
Jul 15, 2008
1 parent
f0b2528
commit dccb7bf
Showing
8 changed files
with
86 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
--- | ||
refs/heads/master: f83cbc77b0d5521b4f0f591ede4870316944481a | ||
refs/heads/master: 594c16d8dd54cd7b1c5ef1ec3ac0f6bf34301dad |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/* | ||
* ATAPI support. | ||
*/ | ||
|
||
#include <linux/kernel.h> | ||
#include <linux/delay.h> | ||
#include <linux/ide.h> | ||
|
||
static u8 ide_wait_ireason(ide_drive_t *drive, u8 ireason) | ||
{ | ||
ide_hwif_t *hwif = drive->hwif; | ||
int retries = 100; | ||
|
||
while (retries-- && ((ireason & CD) == 0 || (ireason & IO))) { | ||
printk(KERN_ERR "%s: (IO,CoD != (0,1) while issuing " | ||
"a packet command, retrying\n", drive->name); | ||
udelay(100); | ||
ireason = hwif->INB(hwif->io_ports.nsect_addr); | ||
if (retries == 0) { | ||
printk(KERN_ERR "%s: (IO,CoD != (0,1) while issuing " | ||
"a packet command, ignoring\n", | ||
drive->name); | ||
ireason |= CD; | ||
ireason &= ~IO; | ||
} | ||
} | ||
|
||
return ireason; | ||
} | ||
|
||
ide_startstop_t ide_transfer_pc(ide_drive_t *drive, struct ide_atapi_pc *pc, | ||
ide_handler_t *handler, unsigned int timeout, | ||
ide_expiry_t *expiry) | ||
{ | ||
ide_hwif_t *hwif = drive->hwif; | ||
ide_startstop_t startstop; | ||
u8 ireason; | ||
|
||
if (ide_wait_stat(&startstop, drive, DRQ_STAT, BUSY_STAT, WAIT_READY)) { | ||
printk(KERN_ERR "%s: Strange, packet command initiated yet " | ||
"DRQ isn't asserted\n", drive->name); | ||
return startstop; | ||
} | ||
|
||
ireason = hwif->INB(hwif->io_ports.nsect_addr); | ||
if (drive->media == ide_tape && !drive->scsi) | ||
ireason = ide_wait_ireason(drive, ireason); | ||
|
||
if ((ireason & CD) == 0 || (ireason & IO)) { | ||
printk(KERN_ERR "%s: (IO,CoD) != (0,1) while issuing " | ||
"a packet command\n", drive->name); | ||
return ide_do_reset(drive); | ||
} | ||
|
||
/* Set the interrupt routine */ | ||
ide_set_handler(drive, handler, timeout, expiry); | ||
|
||
/* Begin DMA, if necessary */ | ||
if (pc->flags & PC_FLAG_DMA_OK) { | ||
pc->flags |= PC_FLAG_DMA_IN_PROGRESS; | ||
hwif->dma_ops->dma_start(drive); | ||
} | ||
|
||
/* Send the actual packet */ | ||
if ((pc->flags & PC_FLAG_ZIP_DRIVE) == 0) | ||
hwif->output_data(drive, NULL, pc->c, 12); | ||
|
||
return ide_started; | ||
} | ||
EXPORT_SYMBOL_GPL(ide_transfer_pc); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters