Udp6Poll\r
};\r
\r
-\r
/**\r
This function copies the current operational settings of this EFI UDPv6 Protocol\r
instance into user-supplied buffers. This function is used optionally to retrieve\r
return Status;\r
}\r
\r
-\r
/**\r
This function is used to do the following:\r
Initialize and start this instance of the EFI UDPv6 Protocol.\r
Status = EFI_SUCCESS;\r
ASSERT (Udp6Service != NULL);\r
\r
- OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
\r
if (UdpConfigData != NULL) {\r
-\r
IP6_COPY_ADDRESS (&StationAddress, &UdpConfigData->StationAddress);\r
IP6_COPY_ADDRESS (&RemoteAddress, &UdpConfigData->RemoteAddress);\r
\r
if ((!NetIp6IsUnspecifiedAddr (&StationAddress) && !NetIp6IsValidUnicast (&StationAddress)) ||\r
(!NetIp6IsUnspecifiedAddr (&RemoteAddress) && !NetIp6IsValidUnicast (&RemoteAddress))\r
- ){\r
+ )\r
+ {\r
//\r
// If not use default address, and StationAddress is not a valid unicast\r
// if it is not IPv6 address or RemoteAddress is not a valid unicast IPv6\r
return Status;\r
}\r
\r
-\r
/**\r
This function is used to enable and disable the multicast group filtering.\r
\r
if (McastIp != NULL) {\r
FreePool (McastIp);\r
}\r
+\r
return EFI_NOT_STARTED;\r
}\r
\r
- Ip = Instance->IpInfo->Ip.Ip6;\r
+ Ip = Instance->IpInfo->Ip.Ip6;\r
\r
- OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
+ OldTpl = gBS->RaiseTPL (TPL_CALLBACK);\r
\r
//\r
// Invoke the Ip instance the Udp6 instance consumes to do the group operation.\r
// the multicast datagrams destinated to multicast IPs the other instances configured.\r
//\r
if (JoinFlag) {\r
-\r
- Status = NetMapInsertTail (&Instance->McastIps, (VOID *) McastIp, NULL);\r
+ Status = NetMapInsertTail (&Instance->McastIps, (VOID *)McastIp, NULL);\r
} else {\r
-\r
Status = NetMapIterate (&Instance->McastIps, Udp6LeaveGroup, MulticastAddress);\r
if ((MulticastAddress != NULL) && (Status == EFI_ABORTED)) {\r
Status = EFI_SUCCESS;\r
return Status;\r
}\r
\r
-\r
-\r
/**\r
This function places a sending request to this instance of the EFI UDPv6 Protocol,\r
alongside the transmit data that was filled by the user.\r
\r
if (EFI_ERROR (NetMapIterate (&Instance->TxTokens, Udp6TokenExist, Token)) ||\r
EFI_ERROR (NetMapIterate (&Instance->RxTokens, Udp6TokenExist, Token))\r
- ){\r
+ )\r
+ {\r
//\r
// Try to find a duplicate token in the two token maps, if found, return\r
// EFI_ACCESS_DENIED.\r
// Create a net buffer to hold the user buffer and the udp header.\r
//\r
Packet = NetbufFromExt (\r
- (NET_FRAGMENT *) TxData->FragmentTable,\r
+ (NET_FRAGMENT *)TxData->FragmentTable,\r
TxData->FragmentCount,\r
UDP6_HEADER_SIZE,\r
0,\r
//\r
// Store the IpIo in ProtoData.\r
//\r
- Udp6Service = Instance->Udp6Service;\r
- *((UINTN *) &Packet->ProtoData[0]) = (UINTN) (Udp6Service->IpIo);\r
+ Udp6Service = Instance->Udp6Service;\r
+ *((UINTN *)&Packet->ProtoData[0]) = (UINTN)(Udp6Service->IpIo);\r
\r
- Udp6Header = (EFI_UDP_HEADER *) NetbufAllocSpace (Packet, UDP6_HEADER_SIZE, TRUE);\r
+ Udp6Header = (EFI_UDP_HEADER *)NetbufAllocSpace (Packet, UDP6_HEADER_SIZE, TRUE);\r
ASSERT (Udp6Header != NULL);\r
if (Udp6Header == NULL) {\r
Status = EFI_OUT_OF_RESOURCES;\r
//\r
// Fill the udp header.\r
//\r
- Udp6Header->SrcPort = HTONS (ConfigData->StationPort);\r
- Udp6Header->DstPort = HTONS (ConfigData->RemotePort);\r
- Udp6Header->Length = HTONS ((UINT16) Packet->TotalSize);\r
- Udp6Header->Checksum = 0;\r
+ Udp6Header->SrcPort = HTONS (ConfigData->StationPort);\r
+ Udp6Header->DstPort = HTONS (ConfigData->RemotePort);\r
+ Udp6Header->Length = HTONS ((UINT16)Packet->TotalSize);\r
+ Udp6Header->Checksum = 0;\r
//\r
// Set the UDP Header in NET_BUF, this UDP header is for IP6 can fast get the\r
// Udp header for pseudoHeadCheckSum.\r
}\r
\r
//\r
- //Calculate the pseudo head checksum using the overridden parameters.\r
+ // Calculate the pseudo head checksum using the overridden parameters.\r
//\r
if (!NetIp6IsUnspecifiedAddr (&ConfigData->StationAddress)) {\r
HeadSum = NetIp6PseudoHeadChecksum (\r
// and the Ipv6 will fill the correct value of this checksum.\r
//\r
Udp6Header->Checksum = 0;\r
-\r
}\r
} else {\r
//\r
}\r
}\r
\r
-\r
-\r
//\r
// Fill the IpIo Override data.\r
//\r
//\r
// Send out this datagram through IpIo.\r
//\r
- if (UdpSessionData != NULL){\r
+ if (UdpSessionData != NULL) {\r
IP6_COPY_ADDRESS (&(IpDestAddr.v6), &Destination);\r
} else {\r
ZeroMem (&IpDestAddr.v6, sizeof (EFI_IPv6_ADDRESS));\r
return Status;\r
}\r
\r
-\r
/**\r
This function places a completion token into the receive packet queue. This function\r
is always asynchronous.\r
\r
if (EFI_ERROR (NetMapIterate (&Instance->RxTokens, Udp6TokenExist, Token)) ||\r
EFI_ERROR (NetMapIterate (&Instance->TxTokens, Udp6TokenExist, Token))\r
- ){\r
+ )\r
+ {\r
//\r
// Return EFI_ACCESS_DENIED if the specified token is already in the TxTokens or\r
// RxTokens map.\r
return Status;\r
}\r
\r
-\r
/**\r
This function is used to abort a pending transmit or receive request.\r
\r
return Status;\r
}\r
\r
-\r
/**\r
This function can be used by network drivers and applications to increase the rate that\r
data packets are moved between the communications device and the transmit/receive queues.\r