diff options
author | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-08-23 02:19:41 +0000 |
---|---|---|
committer | vanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524> | 2007-08-23 02:19:41 +0000 |
commit | 687a2e5f6902fa26c7a1d7a7705e0747c4095125 (patch) | |
tree | bcdcba327f17dd1fe3306d8ed04a98ca1e18f1cf /MdeModulePkg/Universal/Network/Mtftp4Dxe | |
parent | 4a8f7cceccde9f40f55cae415e10d80906a84919 (diff) | |
download | edk2-platforms-687a2e5f6902fa26c7a1d7a7705e0747c4095125.tar.xz |
1. Enable Network stack to pass SCT, currently MNP, ARP, IP4, TCP4 and DHCP4 have passed SCT.
2. Enable Network stack to pass ICC build.
3. Sync Network library instances' module names with their filenames.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@3692 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/Network/Mtftp4Dxe')
5 files changed, 27 insertions, 20 deletions
diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Driver.c b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Driver.c index 9b30b3d730..5a15f9a6f1 100644 --- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Driver.c +++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Driver.c @@ -34,8 +34,6 @@ EFI_SERVICE_BINDING_PROTOCOL gMtftp4ServiceBindingTemplete = { Mtftp4ServiceBindingDestroyChild
};
-//@MT: EFI_DRIVER_ENTRY_POINT (Mtftp4DriverEntryPoint)
-
EFI_STATUS
EFIAPI
Mtftp4DriverEntryPoint (
@@ -429,7 +427,7 @@ Mtftp4InitProtocol ( Instance->Signature = MTFTP4_PROTOCOL_SIGNATURE;
NetListInit (&Instance->Link);
- CopyMem (&Instance->Mtftp4, &gMtftp4ProtocolTemplate, sizeof (EFI_MTFTP4_PROTOCOL));
+ CopyMem (&Instance->Mtftp4, &gMtftp4ProtocolTemplate, sizeof (Instance->Mtftp4));
Instance->State = MTFTP4_STATE_UNCONFIGED;
Instance->Indestory = FALSE;
Instance->Service = MtftpSb;
diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.h b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.h index 9bf5bd59f7..22ba7dd705 100644 --- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.h +++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Impl.h @@ -61,10 +61,10 @@ enum { MTFTP4_STATE_UNCONFIGED = 0, MTFTP4_STATE_CONFIGED, - MTFTP4_STATE_DESTORY, + MTFTP4_STATE_DESTORY }; -typedef struct _MTFTP4_SERVICE { +struct _MTFTP4_SERVICE { UINT32 Signature; EFI_SERVICE_BINDING_PROTOCOL ServiceBinding; @@ -92,7 +92,7 @@ typedef struct { EFI_STATUS Status; } MTFTP4_GETINFO_STATE; -typedef struct _MTFTP4_PROTOCOL { +struct _MTFTP4_PROTOCOL { UINT32 Signature; NET_LIST_ENTRY Link; EFI_MTFTP4_PROTOCOL Mtftp4; diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Option.h b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Option.h index a136304df4..3bd7574eb2 100644 --- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Option.h +++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Option.h @@ -33,7 +33,7 @@ enum { MTFTP4_BLKSIZE_EXIST = 0x01, MTFTP4_TIMEOUT_EXIST = 0x02, MTFTP4_TSIZE_EXIST = 0x04, - MTFTP4_MCAST_EXIST = 0x08, + MTFTP4_MCAST_EXIST = 0x08 }; typedef struct { diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.c b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.c index af61c0bf69..903494ecb7 100644 --- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.c +++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Support.c @@ -229,7 +229,7 @@ Mtftp4RemoveBlockNum ( if (Range->End == Num) {
Range->End--;
} else {
- NewRange = Mtftp4AllocateRange (Num + 1, (UINT16) Range->End);
+ NewRange = Mtftp4AllocateRange ((UINT16) (Num + 1), (UINT16) Range->End);
if (NewRange == NULL) {
return EFI_OUT_OF_RESOURCES;
@@ -270,6 +270,8 @@ Mtftp4SendRequest ( UINT8 *Cur;
UINT32 Len;
UINTN Index;
+ UINT32 Len1;
+ UINT32 Len2;
Token = Instance->Token;
Options = Token->OptionList;
@@ -282,11 +284,14 @@ Mtftp4SendRequest ( //
// Compute the packet length
//
- Len = (UINT32) (AsciiStrLen (Token->Filename) + AsciiStrLen (Mode) + 4);
+ Len1 = (UINT32) AsciiStrLen ((CHAR8 *) Token->Filename);
+ Len2 = (UINT32) AsciiStrLen ((CHAR8 *) Mode);
+ Len = (Len1 + Len2 + 4);
for (Index = 0; Index < Token->OptionCount; Index++) {
- Len += (UINT32) (AsciiStrLen (Options[Index].OptionStr) +
- AsciiStrLen (Options[Index].ValueStr) + 2);
+ Len1 = (UINT32) AsciiStrLen ((CHAR8 *) Options[Index].OptionStr);
+ Len2 = (UINT32) AsciiStrLen ((CHAR8 *) Options[Index].ValueStr);
+ Len += Len1 + Len2 + 2;
}
//
@@ -299,12 +304,12 @@ Mtftp4SendRequest ( Packet = (EFI_MTFTP4_PACKET *) NetbufAllocSpace (Nbuf, Len, FALSE);
Packet->OpCode = HTONS (Instance->Operation);
Cur = Packet->Rrq.Filename;
- Cur = AsciiStrCpy (Cur, Token->Filename);
- Cur = AsciiStrCpy (Cur, Mode);
+ Cur = (UINT8 *) AsciiStrCpy ((CHAR8 *) Cur, (CHAR8 *) Token->Filename);
+ Cur = (UINT8 *) AsciiStrCpy ((CHAR8 *) Cur, (CHAR8 *) Mode);
for (Index = 0; Index < Token->OptionCount; ++Index) {
- Cur = AsciiStrCpy (Cur, Options[Index].OptionStr);
- Cur = AsciiStrCpy (Cur, Options[Index].ValueStr);
+ Cur = (UINT8 *) AsciiStrCpy ((CHAR8 *) Cur, (CHAR8 *) Options[Index].OptionStr);
+ Cur = (UINT8 *) AsciiStrCpy ((CHAR8 *) Cur, (CHAR8 *) Options[Index].ValueStr);
}
return Mtftp4SendPacket (Instance, Nbuf);
@@ -333,7 +338,7 @@ Mtftp4SendError ( EFI_MTFTP4_PACKET *TftpError;
UINT32 Len;
- Len = (UINT32) (AsciiStrLen (ErrInfo) + sizeof (EFI_MTFTP4_ERROR_HEADER));
+ Len = (UINT32) (AsciiStrLen ((CHAR8 *) ErrInfo) + sizeof (EFI_MTFTP4_ERROR_HEADER));
Packet = NetbufAlloc (Len);
if (Packet == NULL) {
@@ -344,7 +349,7 @@ Mtftp4SendError ( TftpError->OpCode = HTONS (EFI_MTFTP4_OPCODE_ERROR);
TftpError->Error.ErrorCode = HTONS (ErrCode);
- AsciiStrCpy (TftpError->Error.ErrorMessage, ErrInfo);
+ AsciiStrCpy ((CHAR8 *) TftpError->Error.ErrorMessage, (CHAR8 *) ErrInfo);
return Mtftp4SendPacket (Instance, Packet);
}
@@ -419,6 +424,7 @@ Mtftp4SendPacket ( UDP_POINTS UdpPoint;
EFI_STATUS Status;
UINT16 OpCode;
+ UINT16 Value;
//
// Save the packet for retransmission
@@ -440,7 +446,8 @@ Mtftp4SendPacket ( // Send the requests to the listening port, other packets
// to the connected port
//
- OpCode = NTOHS (*((UINT16 *) NetbufGetByte (Packet, 0, NULL)));
+ Value = *((UINT16 *) NetbufGetByte (Packet, 0, NULL));
+ OpCode = NTOHS (Value);
if ((OpCode == EFI_MTFTP4_OPCODE_RRQ) || (OpCode == EFI_MTFTP4_OPCODE_DIR) ||
(OpCode == EFI_MTFTP4_OPCODE_WRQ)) {
@@ -485,6 +492,7 @@ Mtftp4Retransmit ( UDP_POINTS UdpPoint;
EFI_STATUS Status;
UINT16 OpCode;
+ UINT16 Value;
ASSERT (Instance->LastPacket != NULL);
@@ -495,7 +503,8 @@ Mtftp4Retransmit ( //
// Set the requests to the listening port, other packets to the connected port
//
- OpCode = NTOHS (*(UINT16 *) NetbufGetByte (Instance->LastPacket, 0, NULL));
+ Value = *(UINT16 *) NetbufGetByte (Instance->LastPacket, 0, NULL);
+ OpCode = NTOHS (Value);
if ((OpCode == EFI_MTFTP4_OPCODE_RRQ) || (OpCode == EFI_MTFTP4_OPCODE_DIR) ||
(OpCode == EFI_MTFTP4_OPCODE_WRQ)) {
diff --git a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Wrq.c b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Wrq.c index 5ac5dc8ec0..a3b308f266 100644 --- a/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Wrq.c +++ b/MdeModulePkg/Universal/Network/Mtftp4Dxe/Mtftp4Wrq.c @@ -139,7 +139,7 @@ Mtftp4WrqSendBlock ( // Get data from PacketNeeded
//
DataBuf = NULL;
- Status = Token->PacketNeeded (&Instance->Mtftp4, Token, &DataLen, &DataBuf);
+ Status = Token->PacketNeeded (&Instance->Mtftp4, Token, &DataLen, (VOID **) &DataBuf);
if (EFI_ERROR (Status) || (DataLen > Instance->BlkSize)) {
if (DataBuf != NULL) {
|