//\r
// The BARs should be of IO type\r
//\r
- if ((PciData.Device.Bar[0] & bit0) == 0 ||\r
- (PciData.Device.Bar[1] & bit0) == 0) {\r
+ if ((PciData.Device.Bar[0] & BIT0) == 0 ||\r
+ (PciData.Device.Bar[1] & BIT0) == 0) {\r
return EFI_UNSUPPORTED;\r
}\r
\r
//\r
// The BARs should be of IO type\r
//\r
- if ((PciData.Device.Bar[2] & bit0) == 0 ||\r
- (PciData.Device.Bar[3] & bit0) == 0) {\r
+ if ((PciData.Device.Bar[2] & BIT0) == 0 ||\r
+ (PciData.Device.Bar[3] & BIT0) == 0) {\r
return EFI_UNSUPPORTED;\r
}\r
\r
// NOTE: This workaround doesn't apply to ATAPI.\r
//\r
if (MasterDeviceExist && SlaveDeviceExist &&\r
- (StatusReg & DRDY) == 0 &&\r
- (InitStatusReg & DRDY) == 0 &&\r
+ (StatusReg & ATA_STSREG_DRDY) == 0 &&\r
+ (InitStatusReg & ATA_STSREG_DRDY) == 0 &&\r
MasterDeviceType == SlaveDeviceType &&\r
SlaveDeviceType != ATAPI_DEVICE_TYPE) {\r
SlaveDeviceExist = FALSE;\r
//\r
// wait for BSY == 0 and DRQ == 0\r
//\r
- if ((StatusRegister & (DRQ | BSY)) == 0) {\r
+ if ((StatusRegister & (ATA_STSREG_DRQ | ATA_STSREG_BSY)) == 0) {\r
break;\r
}\r
\r
- if ((StatusRegister & (BSY | ERR)) == ERR) {\r
+ if ((StatusRegister & (ATA_STSREG_BSY | ATA_STSREG_ERR)) == ATA_STSREG_ERR) {\r
\r
ErrorRegister = IDEReadPortB (IdeDev->PciIo, IdeDev->IoPort->Reg1.Error);\r
- if ((ErrorRegister & ABRT_ERR) == ABRT_ERR) {\r
+ if ((ErrorRegister & ATA_ERRREG_ABRT) == ATA_ERRREG_ABRT) {\r
return EFI_ABORTED;\r
}\r
}\r
//\r
// wait for BSY == 0 and DRQ == 0\r
//\r
- if ((AltRegister & (DRQ | BSY)) == 0) {\r
+ if ((AltRegister & (ATA_STSREG_DRQ | ATA_STSREG_BSY)) == 0) {\r
break;\r
}\r
\r
- if ((AltRegister & (BSY | ERR)) == ERR) {\r
+ if ((AltRegister & (ATA_STSREG_BSY | ATA_STSREG_ERR)) == ATA_STSREG_ERR) {\r
\r
ErrorRegister = IDEReadPortB (IdeDev->PciIo, IdeDev->IoPort->Reg1.Error);\r
- if ((ErrorRegister & ABRT_ERR) == ABRT_ERR) {\r
+ if ((ErrorRegister & ATA_ERRREG_ABRT) == ATA_ERRREG_ABRT) {\r
return EFI_ABORTED;\r
}\r
}\r
//\r
// BSY==0,DRQ==1\r
//\r
- if ((StatusRegister & (BSY | DRQ)) == DRQ) {\r
+ if ((StatusRegister & (ATA_STSREG_BSY | ATA_STSREG_DRQ)) == ATA_STSREG_DRQ) {\r
break;\r
}\r
\r
- if ((StatusRegister & (BSY | ERR)) == ERR) {\r
+ if ((StatusRegister & (ATA_STSREG_BSY | ATA_STSREG_ERR)) == ATA_STSREG_ERR) {\r
\r
ErrorRegister = IDEReadPortB (IdeDev->PciIo, IdeDev->IoPort->Reg1.Error);\r
- if ((ErrorRegister & ABRT_ERR) == ABRT_ERR) {\r
+ if ((ErrorRegister & ATA_ERRREG_ABRT) == ATA_ERRREG_ABRT) {\r
return EFI_ABORTED;\r
}\r
}\r
//\r
// BSY == 0 , DRQ == 1\r
//\r
- if ((AltRegister & (BSY | DRQ)) == DRQ) {\r
+ if ((AltRegister & (ATA_STSREG_BSY | ATA_STSREG_DRQ)) == ATA_STSREG_DRQ) {\r
break;\r
}\r
\r
- if ((AltRegister & (BSY | ERR)) == ERR) {\r
+ if ((AltRegister & (ATA_STSREG_BSY | ATA_STSREG_ERR)) == ATA_STSREG_ERR) {\r
\r
ErrorRegister = IDEReadPortB (IdeDev->PciIo, IdeDev->IoPort->Reg1.Error);\r
- if ((ErrorRegister & ABRT_ERR) == ABRT_ERR) {\r
+ if ((ErrorRegister & ATA_ERRREG_ABRT) == ATA_ERRREG_ABRT) {\r
return EFI_ABORTED;\r
}\r
}\r
do {\r
\r
StatusRegister = IDEReadPortB (IdeDev->PciIo, IdeDev->IoPort->Reg.Status);\r
- if ((StatusRegister & BSY) == 0x00) {\r
+ if ((StatusRegister & ATA_STSREG_BSY) == 0x00) {\r
break;\r
}\r
\r
Delay = (UINT32) (((TimeoutInMilliSeconds * STALL_1_MILLI_SECOND) / 30) + 1);\r
do {\r
AltRegister = IDEReadPortB (IdeDev->PciIo, IdeDev->IoPort->Alt.AltStatus);\r
- if ((AltRegister & BSY) == 0x00) {\r
+ if ((AltRegister & ATA_STSREG_BSY) == 0x00) {\r
break;\r
}\r
\r
//\r
// BSY == 0 , DRDY == 1\r
//\r
- if ((StatusRegister & (DRDY | BSY)) == DRDY) {\r
+ if ((StatusRegister & (ATA_STSREG_DRDY | ATA_STSREG_BSY)) == ATA_STSREG_DRDY) {\r
break;\r
}\r
\r
- if ((StatusRegister & (BSY | ERR)) == ERR) {\r
+ if ((StatusRegister & (ATA_STSREG_BSY | ATA_STSREG_ERR)) == ATA_STSREG_ERR) {\r
\r
ErrorRegister = IDEReadPortB (IdeDev->PciIo, IdeDev->IoPort->Reg1.Error);\r
- if ((ErrorRegister & ABRT_ERR) == ABRT_ERR) {\r
+ if ((ErrorRegister & ATA_ERRREG_ABRT) == ATA_ERRREG_ABRT) {\r
return EFI_ABORTED;\r
}\r
}\r
//\r
// BSY == 0 , DRDY == 1\r
//\r
- if ((AltRegister & (DRDY | BSY)) == DRDY) {\r
+ if ((AltRegister & (ATA_STSREG_DRDY | ATA_STSREG_BSY)) == ATA_STSREG_DRDY) {\r
break;\r
}\r
\r
- if ((AltRegister & (BSY | ERR)) == ERR) {\r
+ if ((AltRegister & (ATA_STSREG_BSY | ATA_STSREG_ERR)) == ATA_STSREG_ERR) {\r
\r
ErrorRegister = IDEReadPortB (IdeDev->PciIo, IdeDev->IoPort->Reg1.Error);\r
- if ((ErrorRegister & ABRT_ERR) == ABRT_ERR) {\r
+ if ((ErrorRegister & ATA_ERRREG_ABRT) == ATA_ERRREG_ABRT) {\r
return EFI_ABORTED;\r
}\r
}\r
name by sending ATA command called ATA Identify Command or ATAPI\r
Identify Command to the specified IDE device. The module name returned\r
is a string of ASCII characters: the first character is bit8--bit15\r
- of the first word, the second character is bit0--bit7 of the first word\r
+ of the first word, the second character is BIT0--bit7 of the first word\r
and so on. Thus the string can not be print directly before it is\r
preprocessed by this func to change the order of characters in\r
each word in the string.\r
//\r
Status = AtaNonDataCommandIn (\r
IdeDev,\r
- SET_FEATURES_CMD,\r
+ ATA_CMD_SET_FEATURES,\r
DeviceSelect,\r
0x03,\r
SectorCount,\r
\r
//\r
// Wait for command completion\r
- // For ATA_SMART_CMD, we may need more timeout to let device\r
+ // For ATAPI_SMART_CMD, we may need more timeout to let device\r
// adjust internal states.\r
//\r
- if (AtaCommand == ATA_SMART_CMD) {\r
+ if (AtaCommand == ATA_CMD_SMART) {\r
Status = WaitForBSYClear (IdeDev, ATASMARTTIMEOUT);\r
} else {\r
Status = WaitForBSYClear (IdeDev, ATATIMEOUT);\r
}\r
\r
StatusRegister = IDEReadPortB (IdeDev->PciIo, IdeDev->IoPort->Reg.Status);\r
- if ((StatusRegister & ERR) == ERR) {\r
+ if ((StatusRegister & ATA_STSREG_ERR) == ATA_STSREG_ERR) {\r
//\r
// Failed to execute command, abort operation\r
//\r
}\r
\r
StatusRegister = IDEReadPortB (IdeDev->PciIo, IdeDev->IoPort->Reg.Status);\r
- if ((StatusRegister & ERR) == ERR) {\r
+ if ((StatusRegister & ATA_STSREG_ERR) == ATA_STSREG_ERR) {\r
//\r
// Failed to execute command, abort operation\r
//\r
//\r
Status = AtaNonDataCommandIn (\r
IdeDev,\r
- INIT_DRIVE_PARAM_CMD,\r
+ ATA_CMD_INIT_DRIVE_PARAM,\r
(UINT8) (DeviceSelect + DriveParameters->Heads),\r
0,\r
DriveParameters->Sector,\r
//\r
Status = AtaNonDataCommandIn (\r
IdeDev,\r
- SET_MULTIPLE_MODE_CMD,\r
+ ATA_CMD_SET_MULTIPLE_MODE,\r
DeviceSelect,\r
0,\r
DriveParameters->MultipleSector,\r