2 Contains all EFI_UDP6_PROTOCOL interfaces.
4 Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php.
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 EFI_UDP6_PROTOCOL mUdp6Protocol
= {
30 This function copies the current operational settings of this EFI UDPv6 Protocol
31 instance into user-supplied buffers. This function is used optionally to retrieve
32 the operational mode data of underlying networks or drivers.
34 @param[in] This Pointer to the EFI_UDP6_PROTOCOL instance.
35 @param[out] Udp6ConfigData The buffer in which the current UDP configuration
36 data is returned. This parameter is optional and
38 @param[out] Ip6ModeData The buffer in which the current EFI IPv6 Protocol
39 mode data is returned. This parameter is optional
41 @param[out] MnpConfigData The buffer in which the current managed network
42 configuration data is returned. This parameter is
43 optional and may be NULL.
44 @param[out] SnpModeData The buffer in which the simple network mode data
45 is returned. This parameter is optional and may be NULL.
47 @retval EFI_SUCCESS The mode data was read.
48 @retval EFI_NOT_STARTED When Udp6ConfigData is queried, no configuration
49 data is available because this instance has not
51 @retval EFI_INVALID_PARAMETER This is NULL.
57 IN EFI_UDP6_PROTOCOL
*This
,
58 OUT EFI_UDP6_CONFIG_DATA
*Udp6ConfigData OPTIONAL
,
59 OUT EFI_IP6_MODE_DATA
*Ip6ModeData OPTIONAL
,
60 OUT EFI_MANAGED_NETWORK_CONFIG_DATA
*MnpConfigData OPTIONAL
,
61 OUT EFI_SIMPLE_NETWORK_MODE
*SnpModeData OPTIONAL
64 UDP6_INSTANCE_DATA
*Instance
;
70 return EFI_INVALID_PARAMETER
;
73 Instance
= UDP6_INSTANCE_DATA_FROM_THIS (This
);
75 if (!Instance
->Configured
&& (Udp6ConfigData
!= NULL
)) {
76 return EFI_NOT_STARTED
;
79 OldTpl
= gBS
->RaiseTPL (TPL_CALLBACK
);
81 if (Udp6ConfigData
!= NULL
) {
83 // Set the Udp6ConfigData.
85 CopyMem (Udp6ConfigData
, &Instance
->ConfigData
, sizeof (EFI_UDP6_CONFIG_DATA
));
88 Ip
= Instance
->IpInfo
->Ip
.Ip6
;
91 // Get the underlying Ip6ModeData, MnpConfigData and SnpModeData.
93 Status
= Ip
->GetModeData (Ip
, Ip6ModeData
, MnpConfigData
, SnpModeData
);
95 gBS
->RestoreTPL (OldTpl
);
102 This function is used to do the following:
103 Initialize and start this instance of the EFI UDPv6 Protocol.
104 Change the filtering rules and operational parameters.
105 Reset this instance of the EFI UDPv6 Protocol.
107 @param[in] This Pointer to the EFI_UDP6_PROTOCOL instance.
108 @param[in] UdpConfigData Pointer to the buffer to set the configuration
109 data. This parameter is optional and may be NULL.
111 @retval EFI_SUCCESS The configuration settings were set, changed, or
113 @retval EFI_NO_MAPPING When the UdpConifgData.UseAnyStationAddress is set
114 to true and there is no address available for the IP6
115 driver to bind a source address to this instance.
116 @retval EFI_INVALID_PARAMETER One or more following conditions are TRUE:
118 UdpConfigData.StationAddress is not a valid
119 unicast IPv6 address.
120 UdpConfigData.RemoteAddress is not a valid unicast
121 IPv6 address if it is not zero.
122 @retval EFI_ALREADY_STARTED The EFI UDPv6 Protocol instance is already
123 started/configured and must be stopped/reset
124 before it can be reconfigured. Only TrafficClass,
125 HopLimit, ReceiveTimeout, and TransmitTimeout can
126 be reconfigured without stopping the current
127 instance of the EFI UDPv6 Protocol.
128 @retval EFI_ACCESS_DENIED UdpConfigData.AllowDuplicatePort is FALSE and
129 UdpConfigData.StationPort is already used by another
131 @retval EFI_OUT_OF_RESOURCES The EFI UDPv6 Protocol driver cannot allocate
132 memory for this EFI UDPv6 Protocol instance.
133 @retval EFI_DEVICE_ERROR An unexpected network or system error occurred, and
134 this instance was not opened.
140 IN EFI_UDP6_PROTOCOL
*This
,
141 IN EFI_UDP6_CONFIG_DATA
*UdpConfigData OPTIONAL
145 UDP6_INSTANCE_DATA
*Instance
;
146 UDP6_SERVICE_DATA
*Udp6Service
;
148 EFI_IPv6_ADDRESS StationAddress
;
149 EFI_IPv6_ADDRESS RemoteAddress
;
150 EFI_IP6_CONFIG_DATA Ip6ConfigData
;
151 EFI_IPv6_ADDRESS LocalAddr
;
152 EFI_IPv6_ADDRESS RemoteAddr
;
155 return EFI_INVALID_PARAMETER
;
158 Instance
= UDP6_INSTANCE_DATA_FROM_THIS (This
);
160 if (!Instance
->Configured
&& (UdpConfigData
== NULL
)) {
164 Udp6Service
= Instance
->Udp6Service
;
165 Status
= EFI_SUCCESS
;
166 ASSERT (Udp6Service
!= NULL
);
168 OldTpl
= gBS
->RaiseTPL (TPL_CALLBACK
);
170 if (UdpConfigData
!= NULL
) {
172 IP6_COPY_ADDRESS (&StationAddress
, &UdpConfigData
->StationAddress
);
173 IP6_COPY_ADDRESS (&RemoteAddress
, &UdpConfigData
->RemoteAddress
);
175 if ((!NetIp6IsUnspecifiedAddr (&StationAddress
) && !NetIp6IsValidUnicast (&StationAddress
)) ||
176 (!NetIp6IsUnspecifiedAddr (&RemoteAddress
) && !NetIp6IsValidUnicast (&RemoteAddress
))
179 // If not use default address, and StationAddress is not a valid unicast
180 // if it is not IPv6 address or RemoteAddress is not a valid unicast IPv6
181 // address if it is not 0.
183 Status
= EFI_INVALID_PARAMETER
;
187 if (Instance
->Configured
) {
189 // The instance is already configured, try to do the re-configuration.
191 if (!Udp6IsReconfigurable (&Instance
->ConfigData
, UdpConfigData
)) {
193 // If the new configuration data wants to change some unreconfigurable
194 // settings, return EFI_ALREADY_STARTED.
196 Status
= EFI_ALREADY_STARTED
;
201 // Save the reconfigurable parameters.
203 Instance
->ConfigData
.TrafficClass
= UdpConfigData
->TrafficClass
;
204 Instance
->ConfigData
.HopLimit
= UdpConfigData
->HopLimit
;
205 Instance
->ConfigData
.ReceiveTimeout
= UdpConfigData
->ReceiveTimeout
;
206 Instance
->ConfigData
.TransmitTimeout
= UdpConfigData
->TransmitTimeout
;
209 // Construct the Ip configuration data from the UdpConfigData.
211 Udp6BuildIp6ConfigData (UdpConfigData
, &Ip6ConfigData
);
214 // Configure the Ip instance wrapped in the IpInfo.
216 Status
= IpIoConfigIp (Instance
->IpInfo
, &Ip6ConfigData
);
217 if (EFI_ERROR (Status
)) {
218 if (Status
== EFI_NO_MAPPING
) {
219 Instance
->IsNoMapping
= TRUE
;
225 Instance
->IsNoMapping
= FALSE
;
228 // Save the configuration data.
231 &Instance
->ConfigData
,
233 sizeof (EFI_UDP6_CONFIG_DATA
)
235 IP6_COPY_ADDRESS (&Instance
->ConfigData
.StationAddress
, &Ip6ConfigData
.StationAddress
);
237 // Try to allocate the required port resource.
239 Status
= Udp6Bind (&Udp6Service
->ChildrenList
, &Instance
->ConfigData
);
240 if (EFI_ERROR (Status
)) {
242 // Reset the ip instance if bind fails.
244 IpIoConfigIp (Instance
->IpInfo
, NULL
);
249 // Pre calculate the checksum for the pseudo head, ignore the UDP length first.
251 IP6_COPY_ADDRESS (&LocalAddr
, &Instance
->ConfigData
.StationAddress
);
252 IP6_COPY_ADDRESS (&RemoteAddr
, &Instance
->ConfigData
.RemoteAddress
);
254 Instance
->HeadSum
= NetIp6PseudoHeadChecksum (
261 Instance
->Configured
= TRUE
;
265 // UdpConfigData is NULL, reset the instance.
267 Instance
->Configured
= FALSE
;
268 Instance
->IsNoMapping
= FALSE
;
271 // Reset the Ip instance wrapped in the IpInfo.
273 IpIoConfigIp (Instance
->IpInfo
, NULL
);
276 // Cancel all the user tokens.
278 Instance
->Udp6Proto
.Cancel (&Instance
->Udp6Proto
, NULL
);
281 // Remove the buffered RxData for this instance.
283 Udp6FlushRcvdDgram (Instance
);
285 ASSERT (IsListEmpty (&Instance
->DeliveredDgramQue
));
290 gBS
->RestoreTPL (OldTpl
);
297 This function is used to enable and disable the multicast group filtering.
299 @param[in] This Pointer to the EFI_UDP6_PROTOCOL instance.
300 @param[in] JoinFlag Set to TRUE to join a multicast group. Set to
301 FALSE to leave one or all multicast groups.
302 @param[in] MulticastAddress Pointer to multicast group address to join or
303 leave. This parameter is optional and may be NULL.
305 @retval EFI_SUCCESS The operation completed successfully.
306 @retval EFI_NOT_STARTED The EFI UDPv6 Protocol instance has not been
308 @retval EFI_OUT_OF_RESOURCES Could not allocate resources to join the group.
309 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
311 JoinFlag is TRUE and MulticastAddress is NULL.
312 JoinFlag is TRUE and *MulticastAddress is not a
313 valid multicast address.
314 @retval EFI_ALREADY_STARTED The group address is already in the group table
315 (when JoinFlag is TRUE).
316 @retval EFI_NOT_FOUND The group address is not in the group table (when
318 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
324 IN EFI_UDP6_PROTOCOL
*This
,
326 IN EFI_IPv6_ADDRESS
*MulticastAddress OPTIONAL
330 UDP6_INSTANCE_DATA
*Instance
;
331 EFI_IP6_PROTOCOL
*Ip
;
333 EFI_IPv6_ADDRESS
*McastIp
;
335 if ((This
== NULL
) || (JoinFlag
&& (MulticastAddress
== NULL
))) {
336 return EFI_INVALID_PARAMETER
;
342 if (!IP6_IS_MULTICAST (MulticastAddress
)) {
343 return EFI_INVALID_PARAMETER
;
346 McastIp
= AllocateCopyPool (sizeof (EFI_IPv6_ADDRESS
), MulticastAddress
);
347 if (McastIp
== NULL
) {
348 return EFI_OUT_OF_RESOURCES
;
352 Instance
= UDP6_INSTANCE_DATA_FROM_THIS (This
);
353 if (!Instance
->Configured
) {
354 if (McastIp
!= NULL
) {
357 return EFI_NOT_STARTED
;
360 Ip
= Instance
->IpInfo
->Ip
.Ip6
;
362 OldTpl
= gBS
->RaiseTPL (TPL_CALLBACK
);
365 // Invoke the Ip instance the Udp6 instance consumes to do the group operation.
367 Status
= Ip
->Groups (Ip
, JoinFlag
, MulticastAddress
);
369 if (EFI_ERROR (Status
)) {
374 // Keep a local copy of the configured multicast IPs because IpIo receives
375 // datagrams from the 0 station address IP instance and then UDP delivers to
376 // the matched instance. This copy of multicast IPs is used to avoid receive
377 // the mutlicast datagrams destinated to multicast IPs the other instances configured.
381 Status
= NetMapInsertTail (&Instance
->McastIps
, (VOID
*) McastIp
, NULL
);
384 Status
= NetMapIterate (&Instance
->McastIps
, Udp6LeaveGroup
, MulticastAddress
);
385 if ((MulticastAddress
!= NULL
) && (Status
== EFI_ABORTED
)) {
386 Status
= EFI_SUCCESS
;
392 gBS
->RestoreTPL (OldTpl
);
394 if (EFI_ERROR (Status
)) {
395 if (McastIp
!= NULL
) {
406 This function places a sending request to this instance of the EFI UDPv6 Protocol,
407 alongside the transmit data that was filled by the user.
409 @param[in] This Pointer to the EFI_UDP6_PROTOCOL instance.
410 @param[in] Token Pointer to the completion token that will be
411 placed into the transmit queue.
413 @retval EFI_SUCCESS The data was queued for transmission.
414 @retval EFI_NOT_STARTED This EFI UDPv6 Protocol instance has not been
416 @retval EFI_NO_MAPPING The under-layer IPv6 driver was responsible for
417 choosing a source address for this instance, but
418 no source address was available for use.
419 @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
421 Token is NULL. Token.Event is NULL.
422 Token.Packet.TxData is NULL.
423 Token.Packet.TxData.FragmentCount is zero.
424 Token.Packet.TxData.DataLength is not equal to the
425 sum of fragment lengths.
427 Token.Packet.TxData.FragmentTable[].FragmentLength
430 Token.Packet.TxData.FragmentTable[].FragmentBuffer
431 fields is NULL. One or more of the
432 Token.Packet.TxData.UdpSessionData.DestinationAddres
433 are not valid unicast IPv6
434 addresses if the UdpSessionData is not NULL.
435 Token.Packet.TxData.UdpSessionData.
436 DestinationAddress is NULL
437 Token.Packet.TxData.UdpSessionData.
440 Token.Packet.TxData.UdpSessionData is NULL and this
441 instance's UdpConfigData.RemoteAddress is unspecified.
442 @retval EFI_ACCESS_DENIED The transmit completion token with the same
443 Token.Event is already in the transmit queue.
444 @retval EFI_NOT_READY The completion token could not be queued because
445 the transmit queue is full.
446 @retval EFI_OUT_OF_RESOURCES Could not queue the transmit data.
447 @retval EFI_NOT_FOUND There is no route to the destination network or
449 @retval EFI_BAD_BUFFER_SIZE The data length is greater than the maximum UDP
450 packet size. Or, the length of the IP header + UDP
451 header + data length is greater than MTU if
452 DoNotFragment is TRUE.
458 IN EFI_UDP6_PROTOCOL
*This
,
459 IN EFI_UDP6_COMPLETION_TOKEN
*Token
463 UDP6_INSTANCE_DATA
*Instance
;
466 EFI_UDP_HEADER
*Udp6Header
;
467 EFI_UDP6_CONFIG_DATA
*ConfigData
;
468 EFI_IPv6_ADDRESS Source
;
469 EFI_IPv6_ADDRESS Destination
;
470 EFI_UDP6_TRANSMIT_DATA
*TxData
;
471 EFI_UDP6_SESSION_DATA
*UdpSessionData
;
472 UDP6_SERVICE_DATA
*Udp6Service
;
473 IP_IO_OVERRIDE Override
;
475 EFI_IP_ADDRESS IpDestAddr
;
477 if ((This
== NULL
) || (Token
== NULL
)) {
478 return EFI_INVALID_PARAMETER
;
481 Instance
= UDP6_INSTANCE_DATA_FROM_THIS (This
);
483 if (!Instance
->Configured
) {
484 return EFI_NOT_STARTED
;
487 OldTpl
= gBS
->RaiseTPL (TPL_CALLBACK
);
490 // Validate the Token, if the token is invalid return the error code.
492 Status
= Udp6ValidateTxToken (Instance
, Token
);
493 if (EFI_ERROR (Status
)) {
497 if (EFI_ERROR (NetMapIterate (&Instance
->TxTokens
, Udp6TokenExist
, Token
)) ||
498 EFI_ERROR (NetMapIterate (&Instance
->RxTokens
, Udp6TokenExist
, Token
))
501 // Try to find a duplicate token in the two token maps, if found, return
502 // EFI_ACCESS_DENIED.
504 Status
= EFI_ACCESS_DENIED
;
508 TxData
= Token
->Packet
.TxData
;
511 // Create a net buffer to hold the user buffer and the udp header.
513 Packet
= NetbufFromExt (
514 (NET_FRAGMENT
*) TxData
->FragmentTable
,
515 TxData
->FragmentCount
,
518 Udp6NetVectorExtFree
,
521 if (Packet
== NULL
) {
522 Status
= EFI_OUT_OF_RESOURCES
;
527 // Store the IpIo in ProtoData.
529 Udp6Service
= Instance
->Udp6Service
;
530 *((UINTN
*) &Packet
->ProtoData
[0]) = (UINTN
) (Udp6Service
->IpIo
);
532 Udp6Header
= (EFI_UDP_HEADER
*) NetbufAllocSpace (Packet
, UDP6_HEADER_SIZE
, TRUE
);
533 ASSERT (Udp6Header
!= NULL
);
534 if (Udp6Header
== NULL
) {
535 Status
= EFI_OUT_OF_RESOURCES
;
539 ConfigData
= &Instance
->ConfigData
;
542 // Fill the udp header.
544 Udp6Header
->SrcPort
= HTONS (ConfigData
->StationPort
);
545 Udp6Header
->DstPort
= HTONS (ConfigData
->RemotePort
);
546 Udp6Header
->Length
= HTONS ((UINT16
) Packet
->TotalSize
);
547 Udp6Header
->Checksum
= 0;
549 // Set the UDP Header in NET_BUF, this UDP header is for IP6 can fast get the
550 // Udp header for pseudoHeadCheckSum.
552 Packet
->Udp
= Udp6Header
;
553 UdpSessionData
= TxData
->UdpSessionData
;
555 if (UdpSessionData
!= NULL
) {
557 // Set the Destination according to the specified
561 if (UdpSessionData
->DestinationPort
!= 0) {
562 Udp6Header
->DstPort
= HTONS (UdpSessionData
->DestinationPort
);
565 IP6_COPY_ADDRESS (&Source
, &ConfigData
->StationAddress
);
566 if (!NetIp6IsUnspecifiedAddr (&UdpSessionData
->DestinationAddress
)) {
567 IP6_COPY_ADDRESS (&Destination
, &UdpSessionData
->DestinationAddress
);
569 IP6_COPY_ADDRESS (&Destination
, &ConfigData
->RemoteAddress
);
573 //Calculate the pseudo head checksum using the overridden parameters.
575 if (!NetIp6IsUnspecifiedAddr (&ConfigData
->StationAddress
)) {
576 HeadSum
= NetIp6PseudoHeadChecksum (
584 // calculate the checksum.
586 Udp6Header
->Checksum
= Udp6Checksum (Packet
, HeadSum
);
587 if (Udp6Header
->Checksum
== 0) {
589 // If the calculated checksum is 0, fill the Checksum field with all ones.
591 Udp6Header
->Checksum
= 0xffff;
595 // Set the checksum is zero if the ConfigData->StationAddress is unspcified
596 // and the Ipv6 will fill the correct value of this checksum.
598 Udp6Header
->Checksum
= 0;
603 // UdpSessionData is NULL, use the address and port information previously configured.
605 IP6_COPY_ADDRESS (&Destination
, &ConfigData
->RemoteAddress
);
607 HeadSum
= Instance
->HeadSum
;
609 // calculate the checksum.
611 Udp6Header
->Checksum
= Udp6Checksum (Packet
, HeadSum
);
612 if (Udp6Header
->Checksum
== 0) {
614 // If the calculated checksum is 0, fill the Checksum field with all ones.
616 Udp6Header
->Checksum
= 0xffff;
623 // Fill the IpIo Override data.
625 Override
.Ip6OverrideData
.Protocol
= EFI_IP_PROTO_UDP
;
626 Override
.Ip6OverrideData
.HopLimit
= ConfigData
->HopLimit
;
627 Override
.Ip6OverrideData
.FlowLabel
= 0;
630 // Save the token into the TxToken map.
632 Status
= NetMapInsertTail (&Instance
->TxTokens
, Token
, Packet
);
633 if (EFI_ERROR (Status
)) {
638 // Send out this datagram through IpIo.
640 if (UdpSessionData
!= NULL
){
641 IP6_COPY_ADDRESS (&(IpDestAddr
.v6
), &Destination
);
643 ZeroMem (&IpDestAddr
.v6
, sizeof (EFI_IPv6_ADDRESS
));
655 if (EFI_ERROR (Status
)) {
657 // Remove this token from the TxTokens.
659 Udp6RemoveToken (&Instance
->TxTokens
, Token
);
668 gBS
->RestoreTPL (OldTpl
);
675 This function places a completion token into the receive packet queue. This function
676 is always asynchronous.
678 @param[in] This Pointer to the EFI_UDP6_PROTOCOL instance.
679 @param[in] Token Pointer to a token that is associated with the
680 receive data descriptor.
682 @retval EFI_SUCCESS The receive completion token was cached.
683 @retval EFI_NOT_STARTED This EFI UDPv6 Protocol instance has not been
685 @retval EFI_NO_MAPPING When using a default address, configuration (DHCP,
686 BOOTP, RARP, etc.) is not finished yet.
687 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
688 This is NULL. Token is NULL. Token.Event is NULL.
689 @retval EFI_OUT_OF_RESOURCES The receive completion token could not be queued
690 due to a lack of system resources (usually
692 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
693 The EFI UDPv6 Protocol instance has been reset to
695 @retval EFI_ACCESS_DENIED A receive completion token with the same
696 Token.Event is already in the receive queue.
697 @retval EFI_NOT_READY The receive request could not be queued because
698 the receive queue is full.
704 IN EFI_UDP6_PROTOCOL
*This
,
705 IN EFI_UDP6_COMPLETION_TOKEN
*Token
709 UDP6_INSTANCE_DATA
*Instance
;
712 if ((This
== NULL
) || (Token
== NULL
) || (Token
->Event
== NULL
)) {
713 return EFI_INVALID_PARAMETER
;
716 Instance
= UDP6_INSTANCE_DATA_FROM_THIS (This
);
718 if (!Instance
->Configured
) {
719 return EFI_NOT_STARTED
;
722 OldTpl
= gBS
->RaiseTPL (TPL_CALLBACK
);
724 if (EFI_ERROR (NetMapIterate (&Instance
->RxTokens
, Udp6TokenExist
, Token
)) ||
725 EFI_ERROR (NetMapIterate (&Instance
->TxTokens
, Udp6TokenExist
, Token
))
728 // Return EFI_ACCESS_DENIED if the specified token is already in the TxTokens or
731 Status
= EFI_ACCESS_DENIED
;
735 Token
->Packet
.RxData
= NULL
;
738 // Save the token into the RxTokens map.
740 Status
= NetMapInsertTail (&Instance
->RxTokens
, Token
, NULL
);
741 if (EFI_ERROR (Status
)) {
742 Status
= EFI_NOT_READY
;
747 // If there is an icmp error, report it.
749 Udp6ReportIcmpError (Instance
);
752 // Try to delivered the received datagrams.
754 Udp6InstanceDeliverDgram (Instance
);
757 // Dispatch the DPC queued by the NotifyFunction of Token->Event.
763 gBS
->RestoreTPL (OldTpl
);
770 This function is used to abort a pending transmit or receive request.
772 @param[in] This Pointer to the EFI_UDP6_PROTOCOL instance.
773 @param[in] Token Pointer to a token that has been issued by
774 EFI_UDP6_PROTOCOL.Transmit() or
775 EFI_UDP6_PROTOCOL.Receive(). This parameter is
776 optional and may be NULL.
778 @retval EFI_SUCCESS The asynchronous I/O request was aborted, and
779 Token.Event was signaled. When Token is NULL, all
780 pending requests are aborted and their events are
782 @retval EFI_INVALID_PARAMETER This is NULL.
783 @retval EFI_NOT_STARTED This instance has not been started.
784 @retval EFI_NO_MAPPING When using the default address, configuration
785 (DHCP, BOOTP, RARP, etc.) is not finished yet.
786 @retval EFI_NOT_FOUND When Token is not NULL, the asynchronous I/O
787 request is not found in the transmit or receive
788 queue. It is either completed or not issued by
789 Transmit() or Receive().
795 IN EFI_UDP6_PROTOCOL
*This
,
796 IN EFI_UDP6_COMPLETION_TOKEN
*Token OPTIONAL
800 UDP6_INSTANCE_DATA
*Instance
;
804 return EFI_INVALID_PARAMETER
;
807 Instance
= UDP6_INSTANCE_DATA_FROM_THIS (This
);
809 if (!Instance
->Configured
) {
810 return EFI_NOT_STARTED
;
813 OldTpl
= gBS
->RaiseTPL (TPL_CALLBACK
);
816 // Cancle the tokens specified by Token for this instance.
818 Status
= Udp6InstanceCancelToken (Instance
, Token
);
821 // Dispatch the DPC queued by the NotifyFunction of the canceled token's events.
825 gBS
->RestoreTPL (OldTpl
);
832 This function can be used by network drivers and applications to increase the rate that
833 data packets are moved between the communications device and the transmit/receive queues.
835 @param[in] This Pointer to the EFI_UDP6_PROTOCOL instance.
837 @retval EFI_SUCCESS Incoming or outgoing data was processed.
838 @retval EFI_INVALID_PARAMETER This is NULL.
839 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
840 @retval EFI_TIMEOUT Data was dropped out of the transmit and/or
847 IN EFI_UDP6_PROTOCOL
*This
850 UDP6_INSTANCE_DATA
*Instance
;
851 EFI_IP6_PROTOCOL
*Ip
;
854 return EFI_INVALID_PARAMETER
;
857 Instance
= UDP6_INSTANCE_DATA_FROM_THIS (This
);
858 Ip
= Instance
->IpInfo
->Ip
.Ip6
;
861 // Invode the Ip instance consumed by the udp instance to do the poll operation.
863 return Ip
->Poll (Ip
);