/** @file
Collect IDE information from Native EFI Driver
Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions
of the BSD License which accompanies this distribution. The
full text of the license may be found at
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#include "LegacyBiosInterface.h"
/**
Collect IDE Inquiry data from the IDE disks
@param Private Legacy BIOS Instance data
@param HddInfo Hdd Information
@param Flag Reconnect IdeController or not
@retval EFI_SUCCESS It should always work.
**/
)
{
//
// Only build data once
// We have a problem with GetBbsInfo in that it can be invoked two
// places. Once in BDS, when all EFI drivers are connected and once in
// LegacyBoot after all EFI drivers are disconnected causing this routine
// to hang. In LegacyBoot this function is also called before EFI drivers
// are disconnected.
// Cases covered
// GetBbsInfo invoked in BDS. Both invocations in LegacyBoot ignored.
// GetBbsInfo not invoked in BDS. First invocation of this function
// proceeds normally and second via GetBbsInfo ignored.
//
LocalHddInfo = *HddInfo;
0,
(VOID *) &LocalHddInfo
);
IdeController = HandleBuffer[0];
//
// Force IDE drive spin up!
//
if (Flag != 0) {
NULL,
);
}
//
// Do GetIdeHandle twice since disconnect/reconnect will switch to native mode
// And GetIdeHandle will switch to Legacy mode, if required.
//
0,
(VOID *) &LocalHddInfo
);
}
//
// Get Identity command from all drives
//
NULL,
);
);
//
// Locate which PCI device
//
(VOID *) &DevicePath
);
while (!IsDevicePathEnd (DevicePathNode)) {
break;
}
}
if (PciDevicePath == NULL) {
continue;
}
//
// Find start of PCI device in HddInfo. The assumption of the data
// structure is 2 controllers(channels) per PCI device and each
// controller can have 2 drives(devices).
// HddInfo[PciIndex+0].[0] = Channel[0].Device[0] Primary Master
// HddInfo[PciIndex+0].[1] = Channel[0].Device[1] Primary Slave
// HddInfo[PciIndex+1].[0] = Channel[1].Device[0] Secondary Master
// HddInfo[PciIndex+1].[1] = Channel[1].Device[1] Secondary Slave
// @bug eventually need to pass in max number of entries
// for end of for loop
//
) {
break;
}
}
if (PciIndex == 8) {
continue;
}
Size = sizeof (ATAPI_IDENTIFY);
&Size
);
if (IdeChannel == 0) {
} else if (IdeChannel == 1) {
}
InquiryData = NULL;
InquiryDataSize = 0;
NULL,
);
if (Status == EFI_BUFFER_TOO_SMALL) {
);
if (InquiryData != NULL) {
);
}
} else {
}
//
// If ATAPI device then Inquiry will pass and ATA fail.
//
//
// If IdeDevice = 0 then set master bit, else slave bit
//
if (IdeDevice == 0) {
}
} else {
}
}
} else {
if (IdeDevice == 0) {
} else {
}
}
}
}
}
if (HandleBuffer != NULL) {
}
return EFI_SUCCESS;
}
/**
If the IDE channel is in compatibility (legacy) mode, remove all
PCI I/O BAR addresses from the controller.
@param IdeController The handle of target IDE controller
**/
)
{
//
// If the IDE channel is in compatibility (legacy) mode, remove all
// PCI I/O BAR addresses from the controller. Some software gets
// confused if an IDE controller is in compatibility (legacy) mode
// and has PCI I/O resources allocated
//
);
IOBarClear = 0x00;
if ((Pi & 0x01) == 0) {
}
if ((Pi & 0x04) == 0) {
}
}
return ;
}