Unbreak the ata_atapi() usage. Since r200171 the mode setting functions
get a ata_device type device passed instead of a ata_channel one, thus ata_atapi() has to be adjusted accordingly. Reviewed by: mav MFC after: 3 days
This commit is contained in:
parent
ec897c886d
commit
0966baf709
@ -1150,12 +1150,11 @@ ata_satarev2str(int rev)
|
||||
}
|
||||
|
||||
int
|
||||
ata_atapi(device_t dev)
|
||||
ata_atapi(device_t dev, int target)
|
||||
{
|
||||
struct ata_channel *ch = device_get_softc(device_get_parent(dev));
|
||||
struct ata_device *atadev = device_get_softc(dev);
|
||||
struct ata_channel *ch = device_get_softc(dev);
|
||||
|
||||
return (ch->devices & (ATA_ATAPI_MASTER << atadev->unit));
|
||||
return (ch->devices & (ATA_ATAPI_MASTER << target));
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -622,7 +622,7 @@ void ata_udelay(int interval);
|
||||
char *ata_unit2str(struct ata_device *atadev);
|
||||
const char *ata_mode2str(int mode);
|
||||
const char *ata_satarev2str(int rev);
|
||||
int ata_atapi(device_t dev);
|
||||
int ata_atapi(device_t dev, int target);
|
||||
int ata_pmode(struct ata_params *ap);
|
||||
int ata_wmode(struct ata_params *ap);
|
||||
int ata_umode(struct ata_params *ap);
|
||||
|
@ -212,12 +212,12 @@ ata_ite_8213_setmode(device_t dev, int target, int mode)
|
||||
reg40 |= 0x4033;
|
||||
/* Set PIO/WDMA timings. */
|
||||
if (target == 0) {
|
||||
reg40 |= (ata_atapi(dev) ? 0x04 : 0x00);
|
||||
reg40 |= (ata_atapi(dev, target) ? 0x04 : 0x00);
|
||||
mask40 = 0x3300;
|
||||
new40 = timings[ata_mode2idx(piomode)] << 8;
|
||||
}
|
||||
else {
|
||||
reg40 |= (ata_atapi(dev) ? 0x40 : 0x00);
|
||||
reg40 |= (ata_atapi(dev, target) ? 0x40 : 0x00);
|
||||
mask44 = 0x0f;
|
||||
new44 = ((timings[ata_mode2idx(piomode)] & 0x30) >> 2) |
|
||||
(timings[ata_mode2idx(piomode)] & 0x03);
|
||||
|
Loading…
x
Reference in New Issue
Block a user