summaryrefslogtreecommitdiff
path: root/EdkModulePkg/Bus/Pci
diff options
context:
space:
mode:
Diffstat (limited to 'EdkModulePkg/Bus/Pci')
-rw-r--r--EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciMem.c6
-rw-r--r--EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciSched.c2
-rw-r--r--EdkModulePkg/Bus/Pci/Undi/RuntimeDxe/Decode.c17
-rw-r--r--EdkModulePkg/Bus/Pci/Undi/RuntimeDxe/E100b.c60
-rw-r--r--EdkModulePkg/Bus/Pci/Undi/RuntimeDxe/E100b.h4
-rw-r--r--EdkModulePkg/Bus/Pci/Undi/RuntimeDxe/Init.c8
-rw-r--r--EdkModulePkg/Bus/Pci/Undi/RuntimeDxe/Undi32.h125
7 files changed, 147 insertions, 75 deletions
diff --git a/EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciMem.c b/EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciMem.c
index 9eef0537d0..24a4616a23 100644
--- a/EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciMem.c
+++ b/EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciMem.c
@@ -388,7 +388,7 @@ Returns:
for (Index = StartBytePos, Index2 = StartBitPos, Count = 0; Count < (RealAllocSize / MEM_UNIT_SIZE); Count++) {
ASSERT ((TempHeaderPtr->BitArrayPtr[Index] & bit (Index2) )== bit (Index2));
- TempHeaderPtr->BitArrayPtr[Index] ^= (UINT8) (bit (Index2));
+ TempHeaderPtr->BitArrayPtr[Index] = (UINT8) (TempHeaderPtr->BitArrayPtr[Index] ^ (bit (Index2)));
Index2++;
if (Index2 == 8) {
Index += 1;
@@ -516,7 +516,7 @@ Returns:
//
// right shift the byte
//
- ByteValue = ByteValue >> 1;
+ ByteValue = (UINT8) (ByteValue >> 1);
if (BitValue == 0) {
//
@@ -604,7 +604,7 @@ Returns:
for (TempBytePos = FoundBytePos, Index = FoundBitPos, Count = 0; Count < NumberOfMemoryUnit; Count++) {
ASSERT ((MemoryHeader->BitArrayPtr[TempBytePos] & bit (Index) )== 0);
- MemoryHeader->BitArrayPtr[TempBytePos] |= bit (Index);
+ MemoryHeader->BitArrayPtr[TempBytePos] = (UINT8) (MemoryHeader->BitArrayPtr[TempBytePos] | bit (Index));
Index++;
if (Index == 8) {
TempBytePos += 1;
diff --git a/EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciSched.c b/EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciSched.c
index 34e31a896f..448fe206d3 100644
--- a/EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciSched.c
+++ b/EdkModulePkg/Bus/Pci/Ehci/Dxe/EhciSched.c
@@ -21,7 +21,7 @@ Revision History
#include "Ehci.h"
-
+STATIC
EFI_STATUS
SetAndWaitDoorBell (
IN USB2_HC_DEV *HcDev,
diff --git a/EdkModulePkg/Bus/Pci/Undi/RuntimeDxe/Decode.c b/EdkModulePkg/Bus/Pci/Undi/RuntimeDxe/Decode.c
index f851b9b961..90c6713666 100644
--- a/EdkModulePkg/Bus/Pci/Undi/RuntimeDxe/Decode.c
+++ b/EdkModulePkg/Bus/Pci/Undi/RuntimeDxe/Decode.c
@@ -89,7 +89,7 @@ Returns:
--*/
{
- CdbPtr->StatFlags |= AdapterInfo->State;
+ CdbPtr->StatFlags = (PXE_STATFLAGS) (CdbPtr->StatFlags | AdapterInfo->State);
return ;
}
@@ -377,7 +377,6 @@ Returns:
--*/
{
PXE_CPB_INITIALIZE *CpbPtr;
- PXE_DB_INITIALIZE *DbPtr;
if ((CdbPtr->OpFlags != PXE_OPFLAGS_INITIALIZE_DETECT_CABLE) &&
(CdbPtr->OpFlags != PXE_OPFLAGS_INITIALIZE_DO_NOT_DETECT_CABLE)) {
@@ -396,7 +395,6 @@ Returns:
}
CpbPtr = (PXE_CPB_INITIALIZE *) (UINTN) CdbPtr->CPBaddr;
- DbPtr = (PXE_DB_INITIALIZE *) (UINTN) CdbPtr->DBaddr;
if (CpbPtr->MemoryLength < (UINT32) MEMORY_NEEDED) {
CdbPtr->StatFlags = PXE_STATFLAGS_COMMAND_FAILED;
@@ -553,7 +551,7 @@ Returns:
case PXE_OPFLAGS_INTERRUPT_DISABLE:
if (IntMask != 0) {
- AdapterInfo->int_mask &= ~(IntMask);
+ AdapterInfo->int_mask = (UINT16) (AdapterInfo->int_mask & ~(IntMask));
E100bSetInterruptState (AdapterInfo);
break;
}
@@ -633,7 +631,7 @@ Returns:
}
- NewFilter |= AdapterInfo->Rx_Filter;
+ NewFilter = (UINT16) (NewFilter | AdapterInfo->Rx_Filter);
//
// all other flags are ignored except mcast_reset
//
@@ -695,7 +693,7 @@ Returns:
// if you want to enable anything, you got to have unicast
// and you have what you already enabled!
//
- NewFilter |= (PXE_OPFLAGS_RECEIVE_FILTER_UNICAST | AdapterInfo->Rx_Filter);
+ NewFilter = (UINT16) (NewFilter | (PXE_OPFLAGS_RECEIVE_FILTER_UNICAST | AdapterInfo->Rx_Filter));
break;
@@ -754,7 +752,7 @@ JustRead:
// give the stat flags here
//
if (AdapterInfo->Receive_Started) {
- CdbPtr->StatFlags |= AdapterInfo->Rx_Filter;
+ CdbPtr->StatFlags = (PXE_STATFLAGS) (CdbPtr->StatFlags | AdapterInfo->Rx_Filter);
}
@@ -1112,7 +1110,7 @@ Returns:
if ((CdbPtr->OpFlags & PXE_OPFLAGS_GET_INTERRUPT_STATUS) != 0) {
Status = InWord (AdapterInfo, AdapterInfo->ioaddr + SCBStatus);
- AdapterInfo->Int_Status |= Status;
+ AdapterInfo->Int_Status = (UINT16) (AdapterInfo->Int_Status | Status);
//
// acknoledge the interrupts
@@ -1282,7 +1280,6 @@ Returns:
--*/
{
- PXE_CPB_RECEIVE *cpbptr;
//
// check if RU has started...
@@ -1293,7 +1290,6 @@ Returns:
return ;
}
- cpbptr = (PXE_CPB_RECEIVE *) (UINTN) CdbPtr->CPBaddr;
CdbPtr->StatCode = (UINT16) E100bReceive (AdapterInfo, CdbPtr->CPBaddr, CdbPtr->DBaddr);
if (CdbPtr->StatCode != PXE_STATCODE_SUCCESS) {
@@ -1513,6 +1509,7 @@ badcdb:
return ;
}
+STATIC
UINT8
ChkSum (
IN VOID *Buffer,
diff --git a/EdkModulePkg/Bus/Pci/Undi/RuntimeDxe/E100b.c b/EdkModulePkg/Bus/Pci/Undi/RuntimeDxe/E100b.c
index 5b69a46ac4..ed396fd342 100644
--- a/EdkModulePkg/Bus/Pci/Undi/RuntimeDxe/E100b.c
+++ b/EdkModulePkg/Bus/Pci/Undi/RuntimeDxe/E100b.c
@@ -43,10 +43,10 @@ static UINT8 basic_config_cmd[22] = {
//
#define wait_for_cmd_done(cmd_ioaddr) \
{ \
- INT16 wait = 2000; \
- while ((InByte (AdapterInfo, cmd_ioaddr) != 0) && --wait >= 0) \
+ INT16 wait_count = 2000; \
+ while ((InByte (AdapterInfo, cmd_ioaddr) != 0) && --wait_count >= 0) \
DelayIt (AdapterInfo, 10); \
- if (wait == 0) \
+ if (wait_count == 0) \
DelayIt (AdapterInfo, 50); \
}
@@ -269,6 +269,7 @@ Returns:
return ;
}
+STATIC
UINTN
MapIt (
IN NIC_DATA_INSTANCE *AdapterInfo,
@@ -337,6 +338,7 @@ Returns:
return PXE_STATCODE_SUCCESS;
}
+STATIC
VOID
UnMapIt (
IN NIC_DATA_INSTANCE *AdapterInfo,
@@ -384,6 +386,7 @@ Returns:
return ;
}
+STATIC
VOID
DelayIt (
IN NIC_DATA_INSTANCE *AdapterInfo,
@@ -409,6 +412,7 @@ Returns:
}
}
+STATIC
VOID
BlockIt (
IN NIC_DATA_INSTANCE *AdapterInfo,
@@ -434,6 +438,7 @@ Returns:
}
}
+STATIC
UINT8
Load_Base_Regs (
NIC_DATA_INSTANCE *AdapterInfo
@@ -483,6 +488,7 @@ Returns:
return 0;
}
+STATIC
UINT8
IssueCB (
NIC_DATA_INSTANCE *AdapterInfo,
@@ -549,6 +555,7 @@ Returns:
return 0;
}
+STATIC
UINT8
Configure (
NIC_DATA_INSTANCE *AdapterInfo
@@ -588,9 +595,9 @@ Returns:
}
my_filter = (UINT8) ((AdapterInfo->Rx_Filter & PXE_OPFLAGS_RECEIVE_FILTER_PROMISCUOUS) ? 1 : 0);
- my_filter |= (AdapterInfo->Rx_Filter & PXE_OPFLAGS_RECEIVE_FILTER_BROADCAST) ? 0 : 2;
+ my_filter = (UINT8) ((my_filter | (AdapterInfo->Rx_Filter & PXE_OPFLAGS_RECEIVE_FILTER_BROADCAST) ? 0 : 2));
- data_ptr[15] |= my_filter;
+ data_ptr[15] = (UINT8) (data_ptr[15] | my_filter);
data_ptr[19] = (UINT8) (AdapterInfo->Duplex ? 0xC0 : 0x80);
data_ptr[21] = (UINT8) ((AdapterInfo->Rx_Filter & PXE_OPFLAGS_RECEIVE_FILTER_ALL_MULTICAST) ? 0x0D : 0x05);
@@ -686,6 +693,7 @@ Returns:
return 0;
}
+STATIC
VOID
StopRU (
IN NIC_DATA_INSTANCE *AdapterInfo
@@ -721,6 +729,7 @@ Returns:
return ;
}
+STATIC
INT8
StartRU (
NIC_DATA_INSTANCE *AdapterInfo
@@ -1049,7 +1058,7 @@ Returns:
//
// enable unicast and start the RU
//
- AdapterInfo->Rx_Filter |= (new_filter | PXE_OPFLAGS_RECEIVE_FILTER_UNICAST);
+ AdapterInfo->Rx_Filter = (UINT8) (AdapterInfo->Rx_Filter | (new_filter | PXE_OPFLAGS_RECEIVE_FILTER_UNICAST));
StartRU (AdapterInfo);
} else {
//
@@ -1290,7 +1299,7 @@ Returns:
ret_code = PXE_STATCODE_NO_DATA;
pkt_type = PXE_FRAME_TYPE_NONE;
status = InWord (AdapterInfo, AdapterInfo->ioaddr + SCBStatus);
- AdapterInfo->Int_Status |= status;
+ AdapterInfo->Int_Status = (UINT16) (AdapterInfo->Int_Status | status);
//
// acknoledge the interrupts
//
@@ -1774,7 +1783,6 @@ Returns:
--*/
{
RxFD *rx_ptr;
- RxFD *head_ptr;
RxFD *tail_ptr;
UINT16 Index;
@@ -1804,7 +1812,6 @@ Returns:
}
}
- head_ptr = (&AdapterInfo->rx_ring[0]);
tail_ptr = (&AdapterInfo->rx_ring[AdapterInfo->RxBufCnt - 1]);
tail_ptr->cb_header.link = (UINT32) AdapterInfo->rx_phy_addr;
@@ -1890,6 +1897,7 @@ Returns:
#define EE_READ_CMD 6 // 110b
#define EE_ERASE_CMD (7 << 6)
+STATIC
VOID
shift_bits_out (
IN NIC_DATA_INSTANCE *AdapterInfo,
@@ -1932,7 +1940,7 @@ Returns:
// mask off the data_in bit
//
Tmp = (UINT8) (InByte (AdapterInfo, EEAddr) &~EE_DI);
- Tmp |= dataval;
+ Tmp = (UINT8) (Tmp | dataval);
OutByte (AdapterInfo, Tmp, EEAddr);
eeprom_delay (100);
//
@@ -1948,6 +1956,7 @@ Returns:
}
}
+STATIC
UINT16
shift_bits_in (
IN NIC_DATA_INSTANCE *AdapterInfo
@@ -1999,6 +2008,7 @@ Returns:
return retval;
}
+STATIC
BOOLEAN
E100bSetEepromLockOut (
IN NIC_DATA_INSTANCE *AdapterInfo
@@ -2047,6 +2057,7 @@ Returns:
return TRUE;
}
+STATIC
VOID
E100bReSetEepromLockOut (
IN NIC_DATA_INSTANCE *AdapterInfo
@@ -3199,17 +3210,6 @@ Returns:
MdiMiscReg |= (NSC_TX_CONG_TXREADY | NSC_TX_CONG_F_CONNECT);
-#if CONGESTION_CONTROL
- //
- // If we are configured to do congestion control, then enable the
- // congestion control bit in the National Phy
- //
- if (AdapterInfo->Congest) {
- MdiMiscReg |= NSC_TX_CONG_ENABLE;
- } else {
- MdiMiscReg &= ~NSC_TX_CONG_ENABLE;
- }
-#endif
MdiWrite (
AdapterInfo,
NSC_CONG_CONTROL_REG,
@@ -3226,21 +3226,6 @@ Returns:
// to attempt a software workaround to the PHY_100 A/B step problem.
//
-#if DO_PHY_100B_SOFTWARE_FIX
- //
- // Handle the Intel PHY_100 (A and B steps)
- //
- if ((PhyId == PHY_100_A) && (AdapterInfo->LinkSpeed == 100)) {
- //
- // The PHY_100 is very sensitive to collisions at 100mb, so increase
- // the Adaptive IFS value with the intention of reducing the number of
- // collisions that the adapter generates.
- //
- AdapterInfo->CurrentIFSValue = 0x18;
- AdapterInfo->AdaptiveIFS = 0;
- }
-#endif
-
return (TRUE);
}
@@ -3395,7 +3380,7 @@ Returns:
// AND the two advertisement registers together, and get rid of any
// extraneous bits.
//
- MdiOwnAdReg &= (MdiLinkPartnerAdReg & NWAY_LP_ABILITY);
+ MdiOwnAdReg = (UINT16) (MdiOwnAdReg & (MdiLinkPartnerAdReg & NWAY_LP_ABILITY));
//
// Get speed setting
@@ -3540,6 +3525,7 @@ Returns:
return 0;
}
+STATIC
INT8
SoftwareReset (
NIC_DATA_INSTANCE *AdapterInfo
diff --git a/EdkModulePkg/Bus/Pci/Undi/RuntimeDxe/E100b.h b/EdkModulePkg/Bus/Pci/Undi/RuntimeDxe/E100b.h
index 3a4127c4e5..e832cb250f 100644
--- a/EdkModulePkg/Bus/Pci/Undi/RuntimeDxe/E100b.h
+++ b/EdkModulePkg/Bus/Pci/Undi/RuntimeDxe/E100b.h
@@ -124,7 +124,7 @@ enum speedo_offsets {
SCBEarlyRx = 20, // Early receive byte count.
SCBEarlyRxInt = 24, SCBFlowCtrlReg = 25, SCBPmdr = 27,
// offsets for general control registers (GCRs)
- SCBGenCtrl = 28, SCBGenStatus = 29, SCBGenCtrl2 = 30, SCBRsvd = 31,
+ SCBGenCtrl = 28, SCBGenStatus = 29, SCBGenCtrl2 = 30, SCBRsvd = 31
};
#define GCR2_EEPROM_ACCESS_SEMAPHORE 0x80 // bit offset into the gcr2
@@ -137,7 +137,7 @@ enum commands {
CmdTx = 4, CmdTDR = 5, CmdDump = 6, CmdDiagnose = 7,
CmdSuspend = 0x4000, /* Suspend after completion. */
CmdIntr = 0x2000, /* Interrupt after completion. */
- CmdTxFlex = 0x0008, /* Use "Flexible mode" for CmdTx command. */
+ CmdTxFlex = 0x0008 /* Use "Flexible mode" for CmdTx command. */
};
//-------------------------------------------------------------------------
diff --git a/EdkModulePkg/Bus/Pci/Undi/RuntimeDxe/Init.c b/EdkModulePkg/Bus/Pci/Undi/RuntimeDxe/Init.c
index a5692f4dbd..ad91d75726 100644
--- a/EdkModulePkg/Bus/Pci/Undi/RuntimeDxe/Init.c
+++ b/EdkModulePkg/Bus/Pci/Undi/RuntimeDxe/Init.c
@@ -864,19 +864,19 @@ Returns:
EFI_PCI_IO_PROTOCOL_WIDTH Width;
NIC_DATA_INSTANCE *AdapterInfo;
- Width = 0;
+ Width = (EFI_PCI_IO_PROTOCOL_WIDTH) 0;
AdapterInfo = (NIC_DATA_INSTANCE *) (UINTN) UnqId;
switch (Len) {
case 2:
- Width = 1;
+ Width = (EFI_PCI_IO_PROTOCOL_WIDTH) 1;
break;
case 4:
- Width = 2;
+ Width = (EFI_PCI_IO_PROTOCOL_WIDTH) 2;
break;
case 8:
- Width = 3;
+ Width = (EFI_PCI_IO_PROTOCOL_WIDTH) 3;
break;
}
diff --git a/EdkModulePkg/Bus/Pci/Undi/RuntimeDxe/Undi32.h b/EdkModulePkg/Bus/Pci/Undi/RuntimeDxe/Undi32.h
index 0262ad78af..d4ad6b65c1 100644
--- a/EdkModulePkg/Bus/Pci/Undi/RuntimeDxe/Undi32.h
+++ b/EdkModulePkg/Bus/Pci/Undi/RuntimeDxe/Undi32.h
@@ -176,24 +176,113 @@ TmpMemIo (
//
// functions defined in decode.c
//
-VOID UNDI_GetState();
-VOID UNDI_Start();
-VOID UNDI_Stop();
-VOID UNDI_GetInitInfo();
-VOID UNDI_GetConfigInfo();
-VOID UNDI_Initialize();
-VOID UNDI_Reset();
-VOID UNDI_Shutdown();
-VOID UNDI_Interrupt();
-VOID UNDI_RecFilter();
-VOID UNDI_StnAddr();
-VOID UNDI_Statistics();
-VOID UNDI_ip2mac();
-VOID UNDI_NVData();
-VOID UNDI_Status();
-VOID UNDI_FillHeader();
-VOID UNDI_Transmit();
-VOID UNDI_Receive();
+VOID
+UNDI_GetState (
+ IN PXE_CDB *CdbPtr,
+ IN NIC_DATA_INSTANCE *AdapterInfo
+ );
+
+VOID
+UNDI_Start (
+ IN PXE_CDB *CdbPtr,
+ IN NIC_DATA_INSTANCE *AdapterInfo
+ );
+
+VOID
+UNDI_Stop (
+ IN PXE_CDB *CdbPtr,
+ IN NIC_DATA_INSTANCE *AdapterInfo
+ );
+
+VOID
+UNDI_GetInitInfo (
+ IN PXE_CDB *CdbPtr,
+ IN NIC_DATA_INSTANCE *AdapterInfo
+ );
+
+VOID
+UNDI_GetConfigInfo (
+ IN PXE_CDB *CdbPtr,
+ IN NIC_DATA_INSTANCE *AdapterInfo
+ );
+
+VOID
+UNDI_Initialize (
+ IN PXE_CDB *CdbPtr,
+ NIC_DATA_INSTANCE *AdapterInfo
+ );
+
+VOID
+UNDI_Reset (
+ IN PXE_CDB *CdbPtr,
+ IN NIC_DATA_INSTANCE *AdapterInfo
+ );
+
+VOID
+UNDI_Shutdown (
+ IN PXE_CDB *CdbPtr,
+ IN NIC_DATA_INSTANCE *AdapterInfo
+ );
+
+VOID
+UNDI_Interrupt (
+ IN PXE_CDB *CdbPtr,
+ IN NIC_DATA_INSTANCE *AdapterInfo
+ );
+
+VOID
+UNDI_RecFilter (
+ IN PXE_CDB *CdbPtr,
+ IN NIC_DATA_INSTANCE *AdapterInfo
+ );
+
+VOID
+UNDI_StnAddr (
+ IN PXE_CDB *CdbPtr,
+ IN NIC_DATA_INSTANCE *AdapterInfo
+ );
+
+VOID
+UNDI_Statistics (
+ IN PXE_CDB *CdbPtr,
+ IN NIC_DATA_INSTANCE *AdapterInfo
+ );
+
+VOID
+UNDI_ip2mac (
+ IN PXE_CDB *CdbPtr,
+ IN NIC_DATA_INSTANCE *AdapterInfo
+ );
+
+VOID
+UNDI_NVData (
+ IN PXE_CDB *CdbPtr,
+ IN NIC_DATA_INSTANCE *AdapterInfo
+ );
+
+VOID
+UNDI_Status (
+ IN PXE_CDB *CdbPtr,
+ IN NIC_DATA_INSTANCE *AdapterInfo
+ );
+
+VOID
+UNDI_FillHeader (
+ IN PXE_CDB *CdbPtr,
+ IN NIC_DATA_INSTANCE *AdapterInfo
+ );
+
+VOID
+UNDI_Transmit (
+ IN PXE_CDB *CdbPtr,
+ IN NIC_DATA_INSTANCE *AdapterInfo
+ );
+
+VOID
+UNDI_Receive (
+ IN PXE_CDB *CdbPtr,
+ IN NIC_DATA_INSTANCE *AdapterInfo
+ );
VOID UNDI_APIEntry_new(UINT64);
VOID UNDI_APIEntry_old(UINT64);