&OldCommand\r
);\r
\r
- OldCommand |= Command;\r
+ OldCommand = (UINT16) (OldCommand | Command);\r
\r
return PciIo->Pci.Write (\r
PciIo, \r
&OldCommand\r
);\r
\r
- OldCommand &= ~(Command);\r
+ OldCommand = (UINT16) (OldCommand & ~(Command));\r
\r
return PciIo->Pci.Write (\r
PciIo, \r
&OldCommand\r
);\r
\r
- OldCommand |= Command;\r
+ OldCommand = (UINT16) (OldCommand | Command);\r
\r
return PciIo->Pci.Write (\r
PciIo, \r
&OldCommand\r
);\r
\r
- OldCommand &= ~(Command);\r
+ OldCommand = (UINT16) (OldCommand & ~(Command));\r
\r
return PciIo->Pci.Write (\r
PciIo, \r
UINT8 CapabilityPtr;\r
UINT16 CapabilityEntry;\r
UINT8 CapabilityID;\r
- UINT32 Temp;\r
\r
//\r
// To check the capability of this device supports\r
\r
PciIoDevice->PciIo.Pci.Read (\r
&PciIoDevice->PciIo,\r
- EfiPciIoWidthUint32,\r
+ EfiPciIoWidthUint8,\r
PCI_CAPBILITY_POINTER_OFFSET,\r
1,\r
- &Temp\r
+ &CapabilityPtr\r
);\r
- //\r
- // Do not get byte read directly, because some PCI card will return 0xFF\r
- // when perform PCI-Express byte read, while return correct 0x00 \r
- // when perform PCI-Express dword read, or PCI dword read.\r
- //\r
- CapabilityPtr = (UINT8)Temp;\r
}\r
}\r
\r
- while (CapabilityPtr > 0x3F) {\r
- //\r
- // Mask it to DWORD alignment per PCI spec\r
- //\r
- CapabilityPtr &= 0xFC;\r
+ while ((CapabilityPtr >= 0x40) && ((CapabilityPtr & 0x03) == 0x00)) {\r
PciIoDevice->PciIo.Pci.Read (\r
&PciIoDevice->PciIo,\r
EfiPciIoWidthUint16,\r