2 Contains all EFI_UDP6_PROTOCOL interfaces.
4 Copyright (c) 2009 - 2018, Intel Corporation. All rights reserved.<BR>
6 SPDX-License-Identifier: BSD-2-Clause-Patent
12 EFI_UDP6_PROTOCOL mUdp6Protocol
= {
23 This function copies the current operational settings of this EFI UDPv6 Protocol
24 instance into user-supplied buffers. This function is used optionally to retrieve
25 the operational mode data of underlying networks or drivers.
27 @param[in] This Pointer to the EFI_UDP6_PROTOCOL instance.
28 @param[out] Udp6ConfigData The buffer in which the current UDP configuration
29 data is returned. This parameter is optional and
31 @param[out] Ip6ModeData The buffer in which the current EFI IPv6 Protocol
32 mode data is returned. This parameter is optional
34 @param[out] MnpConfigData The buffer in which the current managed network
35 configuration data is returned. This parameter is
36 optional and may be NULL.
37 @param[out] SnpModeData The buffer in which the simple network mode data
38 is returned. This parameter is optional and may be NULL.
40 @retval EFI_SUCCESS The mode data was read.
41 @retval EFI_NOT_STARTED When Udp6ConfigData is queried, no configuration
42 data is available because this instance has not
44 @retval EFI_INVALID_PARAMETER This is NULL.
50 IN EFI_UDP6_PROTOCOL
*This
,
51 OUT EFI_UDP6_CONFIG_DATA
*Udp6ConfigData OPTIONAL
,
52 OUT EFI_IP6_MODE_DATA
*Ip6ModeData OPTIONAL
,
53 OUT EFI_MANAGED_NETWORK_CONFIG_DATA
*MnpConfigData OPTIONAL
,
54 OUT EFI_SIMPLE_NETWORK_MODE
*SnpModeData OPTIONAL
57 UDP6_INSTANCE_DATA
*Instance
;
63 return EFI_INVALID_PARAMETER
;
66 Instance
= UDP6_INSTANCE_DATA_FROM_THIS (This
);
68 if (!Instance
->Configured
&& (Udp6ConfigData
!= NULL
)) {
69 return EFI_NOT_STARTED
;
72 OldTpl
= gBS
->RaiseTPL (TPL_CALLBACK
);
74 if (Udp6ConfigData
!= NULL
) {
76 // Set the Udp6ConfigData.
78 CopyMem (Udp6ConfigData
, &Instance
->ConfigData
, sizeof (EFI_UDP6_CONFIG_DATA
));
81 Ip
= Instance
->IpInfo
->Ip
.Ip6
;
84 // Get the underlying Ip6ModeData, MnpConfigData and SnpModeData.
86 Status
= Ip
->GetModeData (Ip
, Ip6ModeData
, MnpConfigData
, SnpModeData
);
88 gBS
->RestoreTPL (OldTpl
);
94 This function is used to do the following:
95 Initialize and start this instance of the EFI UDPv6 Protocol.
96 Change the filtering rules and operational parameters.
97 Reset this instance of the EFI UDPv6 Protocol.
99 @param[in] This Pointer to the EFI_UDP6_PROTOCOL instance.
100 @param[in] UdpConfigData Pointer to the buffer to set the configuration
101 data. This parameter is optional and may be NULL.
103 @retval EFI_SUCCESS The configuration settings were set, changed, or
105 @retval EFI_NO_MAPPING When the UdpConfigData.UseAnyStationAddress is set
106 to true and there is no address available for the IP6
107 driver to bind a source address to this instance.
108 @retval EFI_INVALID_PARAMETER One or more following conditions are TRUE:
110 UdpConfigData.StationAddress is not a valid
111 unicast IPv6 address.
112 UdpConfigData.RemoteAddress is not a valid unicast
113 IPv6 address if it is not zero.
114 @retval EFI_ALREADY_STARTED The EFI UDPv6 Protocol instance is already
115 started/configured and must be stopped/reset
116 before it can be reconfigured. Only TrafficClass,
117 HopLimit, ReceiveTimeout, and TransmitTimeout can
118 be reconfigured without stopping the current
119 instance of the EFI UDPv6 Protocol.
120 @retval EFI_ACCESS_DENIED UdpConfigData.AllowDuplicatePort is FALSE and
121 UdpConfigData.StationPort is already used by another
123 @retval EFI_OUT_OF_RESOURCES The EFI UDPv6 Protocol driver cannot allocate
124 memory for this EFI UDPv6 Protocol instance.
125 @retval EFI_DEVICE_ERROR An unexpected network or system error occurred, and
126 this instance was not opened.
132 IN EFI_UDP6_PROTOCOL
*This
,
133 IN EFI_UDP6_CONFIG_DATA
*UdpConfigData OPTIONAL
137 UDP6_INSTANCE_DATA
*Instance
;
138 UDP6_SERVICE_DATA
*Udp6Service
;
140 EFI_IPv6_ADDRESS StationAddress
;
141 EFI_IPv6_ADDRESS RemoteAddress
;
142 EFI_IP6_CONFIG_DATA Ip6ConfigData
;
143 EFI_IPv6_ADDRESS LocalAddr
;
144 EFI_IPv6_ADDRESS RemoteAddr
;
147 return EFI_INVALID_PARAMETER
;
150 Instance
= UDP6_INSTANCE_DATA_FROM_THIS (This
);
152 if (!Instance
->Configured
&& (UdpConfigData
== NULL
)) {
156 Udp6Service
= Instance
->Udp6Service
;
157 Status
= EFI_SUCCESS
;
158 ASSERT (Udp6Service
!= NULL
);
160 OldTpl
= gBS
->RaiseTPL (TPL_CALLBACK
);
162 if (UdpConfigData
!= NULL
) {
163 IP6_COPY_ADDRESS (&StationAddress
, &UdpConfigData
->StationAddress
);
164 IP6_COPY_ADDRESS (&RemoteAddress
, &UdpConfigData
->RemoteAddress
);
166 if ((!NetIp6IsUnspecifiedAddr (&StationAddress
) && !NetIp6IsValidUnicast (&StationAddress
)) ||
167 (!NetIp6IsUnspecifiedAddr (&RemoteAddress
) && !NetIp6IsValidUnicast (&RemoteAddress
))
171 // If not use default address, and StationAddress is not a valid unicast
172 // if it is not IPv6 address or RemoteAddress is not a valid unicast IPv6
173 // address if it is not 0.
175 Status
= EFI_INVALID_PARAMETER
;
179 if (Instance
->Configured
) {
181 // The instance is already configured, try to do the re-configuration.
183 if (!Udp6IsReconfigurable (&Instance
->ConfigData
, UdpConfigData
)) {
185 // If the new configuration data wants to change some unreconfigurable
186 // settings, return EFI_ALREADY_STARTED.
188 Status
= EFI_ALREADY_STARTED
;
193 // Save the reconfigurable parameters.
195 Instance
->ConfigData
.TrafficClass
= UdpConfigData
->TrafficClass
;
196 Instance
->ConfigData
.HopLimit
= UdpConfigData
->HopLimit
;
197 Instance
->ConfigData
.ReceiveTimeout
= UdpConfigData
->ReceiveTimeout
;
198 Instance
->ConfigData
.TransmitTimeout
= UdpConfigData
->TransmitTimeout
;
201 // Construct the Ip configuration data from the UdpConfigData.
203 Udp6BuildIp6ConfigData (UdpConfigData
, &Ip6ConfigData
);
206 // Configure the Ip instance wrapped in the IpInfo.
208 Status
= IpIoConfigIp (Instance
->IpInfo
, &Ip6ConfigData
);
209 if (EFI_ERROR (Status
)) {
210 if (Status
== EFI_NO_MAPPING
) {
211 Instance
->IsNoMapping
= TRUE
;
217 Instance
->IsNoMapping
= FALSE
;
220 // Save the configuration data.
223 &Instance
->ConfigData
,
225 sizeof (EFI_UDP6_CONFIG_DATA
)
227 IP6_COPY_ADDRESS (&Instance
->ConfigData
.StationAddress
, &Ip6ConfigData
.StationAddress
);
229 // Try to allocate the required port resource.
231 Status
= Udp6Bind (&Udp6Service
->ChildrenList
, &Instance
->ConfigData
);
232 if (EFI_ERROR (Status
)) {
234 // Reset the ip instance if bind fails.
236 IpIoConfigIp (Instance
->IpInfo
, NULL
);
241 // Pre calculate the checksum for the pseudo head, ignore the UDP length first.
243 IP6_COPY_ADDRESS (&LocalAddr
, &Instance
->ConfigData
.StationAddress
);
244 IP6_COPY_ADDRESS (&RemoteAddr
, &Instance
->ConfigData
.RemoteAddress
);
246 Instance
->HeadSum
= NetIp6PseudoHeadChecksum (
253 Instance
->Configured
= TRUE
;
257 // UdpConfigData is NULL, reset the instance.
259 Instance
->Configured
= FALSE
;
260 Instance
->IsNoMapping
= FALSE
;
263 // Reset the Ip instance wrapped in the IpInfo.
265 IpIoConfigIp (Instance
->IpInfo
, NULL
);
268 // Cancel all the user tokens.
270 Instance
->Udp6Proto
.Cancel (&Instance
->Udp6Proto
, NULL
);
273 // Remove the buffered RxData for this instance.
275 Udp6FlushRcvdDgram (Instance
);
277 ASSERT (IsListEmpty (&Instance
->DeliveredDgramQue
));
282 gBS
->RestoreTPL (OldTpl
);
288 This function is used to enable and disable the multicast group filtering.
290 @param[in] This Pointer to the EFI_UDP6_PROTOCOL instance.
291 @param[in] JoinFlag Set to TRUE to join a multicast group. Set to
292 FALSE to leave one or all multicast groups.
293 @param[in] MulticastAddress Pointer to multicast group address to join or
294 leave. This parameter is optional and may be NULL.
296 @retval EFI_SUCCESS The operation completed successfully.
297 @retval EFI_NOT_STARTED The EFI UDPv6 Protocol instance has not been
299 @retval EFI_OUT_OF_RESOURCES Could not allocate resources to join the group.
300 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
302 JoinFlag is TRUE and MulticastAddress is NULL.
303 JoinFlag is TRUE and *MulticastAddress is not a
304 valid multicast address.
305 @retval EFI_ALREADY_STARTED The group address is already in the group table
306 (when JoinFlag is TRUE).
307 @retval EFI_NOT_FOUND The group address is not in the group table (when
309 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
315 IN EFI_UDP6_PROTOCOL
*This
,
317 IN EFI_IPv6_ADDRESS
*MulticastAddress OPTIONAL
321 UDP6_INSTANCE_DATA
*Instance
;
322 EFI_IP6_PROTOCOL
*Ip
;
324 EFI_IPv6_ADDRESS
*McastIp
;
326 if ((This
== NULL
) || (JoinFlag
&& (MulticastAddress
== NULL
))) {
327 return EFI_INVALID_PARAMETER
;
333 if (!IP6_IS_MULTICAST (MulticastAddress
)) {
334 return EFI_INVALID_PARAMETER
;
337 McastIp
= AllocateCopyPool (sizeof (EFI_IPv6_ADDRESS
), MulticastAddress
);
338 if (McastIp
== NULL
) {
339 return EFI_OUT_OF_RESOURCES
;
343 Instance
= UDP6_INSTANCE_DATA_FROM_THIS (This
);
344 if (!Instance
->Configured
) {
345 if (McastIp
!= NULL
) {
349 return EFI_NOT_STARTED
;
352 Ip
= Instance
->IpInfo
->Ip
.Ip6
;
354 OldTpl
= gBS
->RaiseTPL (TPL_CALLBACK
);
357 // Invoke the Ip instance the Udp6 instance consumes to do the group operation.
359 Status
= Ip
->Groups (Ip
, JoinFlag
, MulticastAddress
);
361 if (EFI_ERROR (Status
)) {
366 // Keep a local copy of the configured multicast IPs because IpIo receives
367 // datagrams from the 0 station address IP instance and then UDP delivers to
368 // the matched instance. This copy of multicast IPs is used to avoid receive
369 // the multicast datagrams destinated to multicast IPs the other instances configured.
372 Status
= NetMapInsertTail (&Instance
->McastIps
, (VOID
*)McastIp
, NULL
);
374 Status
= NetMapIterate (&Instance
->McastIps
, Udp6LeaveGroup
, MulticastAddress
);
375 if ((MulticastAddress
!= NULL
) && (Status
== EFI_ABORTED
)) {
376 Status
= EFI_SUCCESS
;
382 gBS
->RestoreTPL (OldTpl
);
384 if (EFI_ERROR (Status
)) {
385 if (McastIp
!= NULL
) {
394 This function places a sending request to this instance of the EFI UDPv6 Protocol,
395 alongside the transmit data that was filled by the user.
397 @param[in] This Pointer to the EFI_UDP6_PROTOCOL instance.
398 @param[in] Token Pointer to the completion token that will be
399 placed into the transmit queue.
401 @retval EFI_SUCCESS The data was queued for transmission.
402 @retval EFI_NOT_STARTED This EFI UDPv6 Protocol instance has not been
404 @retval EFI_NO_MAPPING The under-layer IPv6 driver was responsible for
405 choosing a source address for this instance, but
406 no source address was available for use.
407 @retval EFI_INVALID_PARAMETER One or more of the following are TRUE:
409 Token is NULL. Token.Event is NULL.
410 Token.Packet.TxData is NULL.
411 Token.Packet.TxData.FragmentCount is zero.
412 Token.Packet.TxData.DataLength is not equal to the
413 sum of fragment lengths.
415 Token.Packet.TxData.FragmentTable[].FragmentLength
418 Token.Packet.TxData.FragmentTable[].FragmentBuffer
419 fields is NULL. One or more of the
420 Token.Packet.TxData.UdpSessionData.DestinationAddress
421 are not valid unicast IPv6
422 addresses if the UdpSessionData is not NULL.
423 Token.Packet.TxData.UdpSessionData.
424 DestinationAddress is NULL
425 Token.Packet.TxData.UdpSessionData.
428 Token.Packet.TxData.UdpSessionData is NULL and this
429 instance's UdpConfigData.RemoteAddress is unspecified.
430 @retval EFI_ACCESS_DENIED The transmit completion token with the same
431 Token.Event is already in the transmit queue.
432 @retval EFI_NOT_READY The completion token could not be queued because
433 the transmit queue is full.
434 @retval EFI_OUT_OF_RESOURCES Could not queue the transmit data.
435 @retval EFI_NOT_FOUND There is no route to the destination network or
437 @retval EFI_BAD_BUFFER_SIZE The data length is greater than the maximum UDP
438 packet size. Or, the length of the IP header + UDP
439 header + data length is greater than MTU if
440 DoNotFragment is TRUE.
446 IN EFI_UDP6_PROTOCOL
*This
,
447 IN EFI_UDP6_COMPLETION_TOKEN
*Token
451 UDP6_INSTANCE_DATA
*Instance
;
454 EFI_UDP_HEADER
*Udp6Header
;
455 EFI_UDP6_CONFIG_DATA
*ConfigData
;
456 EFI_IPv6_ADDRESS Source
;
457 EFI_IPv6_ADDRESS Destination
;
458 EFI_UDP6_TRANSMIT_DATA
*TxData
;
459 EFI_UDP6_SESSION_DATA
*UdpSessionData
;
460 UDP6_SERVICE_DATA
*Udp6Service
;
461 IP_IO_OVERRIDE Override
;
463 EFI_IP_ADDRESS IpDestAddr
;
465 if ((This
== NULL
) || (Token
== NULL
)) {
466 return EFI_INVALID_PARAMETER
;
469 Instance
= UDP6_INSTANCE_DATA_FROM_THIS (This
);
471 if (!Instance
->Configured
) {
472 return EFI_NOT_STARTED
;
475 OldTpl
= gBS
->RaiseTPL (TPL_CALLBACK
);
478 // Validate the Token, if the token is invalid return the error code.
480 Status
= Udp6ValidateTxToken (Instance
, Token
);
481 if (EFI_ERROR (Status
)) {
485 if (EFI_ERROR (NetMapIterate (&Instance
->TxTokens
, Udp6TokenExist
, Token
)) ||
486 EFI_ERROR (NetMapIterate (&Instance
->RxTokens
, Udp6TokenExist
, Token
))
490 // Try to find a duplicate token in the two token maps, if found, return
491 // EFI_ACCESS_DENIED.
493 Status
= EFI_ACCESS_DENIED
;
497 TxData
= Token
->Packet
.TxData
;
500 // Create a net buffer to hold the user buffer and the udp header.
502 Packet
= NetbufFromExt (
503 (NET_FRAGMENT
*)TxData
->FragmentTable
,
504 TxData
->FragmentCount
,
507 Udp6NetVectorExtFree
,
510 if (Packet
== NULL
) {
511 Status
= EFI_OUT_OF_RESOURCES
;
516 // Store the IpIo in ProtoData.
518 Udp6Service
= Instance
->Udp6Service
;
519 *((UINTN
*)&Packet
->ProtoData
[0]) = (UINTN
)(Udp6Service
->IpIo
);
521 Udp6Header
= (EFI_UDP_HEADER
*)NetbufAllocSpace (Packet
, UDP6_HEADER_SIZE
, TRUE
);
522 ASSERT (Udp6Header
!= NULL
);
523 if (Udp6Header
== NULL
) {
524 Status
= EFI_OUT_OF_RESOURCES
;
528 ConfigData
= &Instance
->ConfigData
;
531 // Fill the udp header.
533 Udp6Header
->SrcPort
= HTONS (ConfigData
->StationPort
);
534 Udp6Header
->DstPort
= HTONS (ConfigData
->RemotePort
);
535 Udp6Header
->Length
= HTONS ((UINT16
)Packet
->TotalSize
);
536 Udp6Header
->Checksum
= 0;
538 // Set the UDP Header in NET_BUF, this UDP header is for IP6 can fast get the
539 // Udp header for pseudoHeadCheckSum.
541 Packet
->Udp
= Udp6Header
;
542 UdpSessionData
= TxData
->UdpSessionData
;
544 if (UdpSessionData
!= NULL
) {
546 // Set the Destination according to the specified
550 if (UdpSessionData
->DestinationPort
!= 0) {
551 Udp6Header
->DstPort
= HTONS (UdpSessionData
->DestinationPort
);
554 IP6_COPY_ADDRESS (&Source
, &ConfigData
->StationAddress
);
555 if (!NetIp6IsUnspecifiedAddr (&UdpSessionData
->DestinationAddress
)) {
556 IP6_COPY_ADDRESS (&Destination
, &UdpSessionData
->DestinationAddress
);
558 IP6_COPY_ADDRESS (&Destination
, &ConfigData
->RemoteAddress
);
562 // Calculate the pseudo head checksum using the overridden parameters.
564 if (!NetIp6IsUnspecifiedAddr (&ConfigData
->StationAddress
)) {
565 HeadSum
= NetIp6PseudoHeadChecksum (
573 // calculate the checksum.
575 Udp6Header
->Checksum
= Udp6Checksum (Packet
, HeadSum
);
576 if (Udp6Header
->Checksum
== 0) {
578 // If the calculated checksum is 0, fill the Checksum field with all ones.
580 Udp6Header
->Checksum
= 0xffff;
584 // Set the checksum is zero if the ConfigData->StationAddress is unspecified
585 // and the Ipv6 will fill the correct value of this checksum.
587 Udp6Header
->Checksum
= 0;
591 // UdpSessionData is NULL, use the address and port information previously configured.
593 IP6_COPY_ADDRESS (&Destination
, &ConfigData
->RemoteAddress
);
595 HeadSum
= Instance
->HeadSum
;
597 // calculate the checksum.
599 Udp6Header
->Checksum
= Udp6Checksum (Packet
, HeadSum
);
600 if (Udp6Header
->Checksum
== 0) {
602 // If the calculated checksum is 0, fill the Checksum field with all ones.
604 Udp6Header
->Checksum
= 0xffff;
609 // Fill the IpIo Override data.
611 Override
.Ip6OverrideData
.Protocol
= EFI_IP_PROTO_UDP
;
612 Override
.Ip6OverrideData
.HopLimit
= ConfigData
->HopLimit
;
613 Override
.Ip6OverrideData
.FlowLabel
= 0;
616 // Save the token into the TxToken map.
618 Status
= NetMapInsertTail (&Instance
->TxTokens
, Token
, Packet
);
619 if (EFI_ERROR (Status
)) {
624 // Send out this datagram through IpIo.
626 if (UdpSessionData
!= NULL
) {
627 IP6_COPY_ADDRESS (&(IpDestAddr
.v6
), &Destination
);
629 ZeroMem (&IpDestAddr
.v6
, sizeof (EFI_IPv6_ADDRESS
));
641 if (EFI_ERROR (Status
)) {
643 // Remove this token from the TxTokens.
645 Udp6RemoveToken (&Instance
->TxTokens
, Token
);
654 gBS
->RestoreTPL (OldTpl
);
660 This function places a completion token into the receive packet queue. This function
661 is always asynchronous.
663 @param[in] This Pointer to the EFI_UDP6_PROTOCOL instance.
664 @param[in] Token Pointer to a token that is associated with the
665 receive data descriptor.
667 @retval EFI_SUCCESS The receive completion token was cached.
668 @retval EFI_NOT_STARTED This EFI UDPv6 Protocol instance has not been
670 @retval EFI_NO_MAPPING When using a default address, configuration (DHCP,
671 BOOTP, RARP, etc.) is not finished yet.
672 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
673 This is NULL. Token is NULL. Token.Event is NULL.
674 @retval EFI_OUT_OF_RESOURCES The receive completion token could not be queued
675 due to a lack of system resources (usually
677 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
678 The EFI UDPv6 Protocol instance has been reset to
680 @retval EFI_ACCESS_DENIED A receive completion token with the same
681 Token.Event is already in the receive queue.
682 @retval EFI_NOT_READY The receive request could not be queued because
683 the receive queue is full.
689 IN EFI_UDP6_PROTOCOL
*This
,
690 IN EFI_UDP6_COMPLETION_TOKEN
*Token
694 UDP6_INSTANCE_DATA
*Instance
;
697 if ((This
== NULL
) || (Token
== NULL
) || (Token
->Event
== NULL
)) {
698 return EFI_INVALID_PARAMETER
;
701 Instance
= UDP6_INSTANCE_DATA_FROM_THIS (This
);
703 if (!Instance
->Configured
) {
704 return EFI_NOT_STARTED
;
707 OldTpl
= gBS
->RaiseTPL (TPL_CALLBACK
);
709 if (EFI_ERROR (NetMapIterate (&Instance
->RxTokens
, Udp6TokenExist
, Token
)) ||
710 EFI_ERROR (NetMapIterate (&Instance
->TxTokens
, Udp6TokenExist
, Token
))
714 // Return EFI_ACCESS_DENIED if the specified token is already in the TxTokens or
717 Status
= EFI_ACCESS_DENIED
;
721 Token
->Packet
.RxData
= NULL
;
724 // Save the token into the RxTokens map.
726 Status
= NetMapInsertTail (&Instance
->RxTokens
, Token
, NULL
);
727 if (EFI_ERROR (Status
)) {
728 Status
= EFI_NOT_READY
;
733 // If there is an icmp error, report it.
735 Udp6ReportIcmpError (Instance
);
738 // Try to delivered the received datagrams.
740 Udp6InstanceDeliverDgram (Instance
);
743 // Dispatch the DPC queued by the NotifyFunction of Token->Event.
749 gBS
->RestoreTPL (OldTpl
);
755 This function is used to abort a pending transmit or receive request.
757 @param[in] This Pointer to the EFI_UDP6_PROTOCOL instance.
758 @param[in] Token Pointer to a token that has been issued by
759 EFI_UDP6_PROTOCOL.Transmit() or
760 EFI_UDP6_PROTOCOL.Receive(). This parameter is
761 optional and may be NULL.
763 @retval EFI_SUCCESS The asynchronous I/O request was aborted, and
764 Token.Event was signaled. When Token is NULL, all
765 pending requests are aborted and their events are
767 @retval EFI_INVALID_PARAMETER This is NULL.
768 @retval EFI_NOT_STARTED This instance has not been started.
769 @retval EFI_NO_MAPPING When using the default address, configuration
770 (DHCP, BOOTP, RARP, etc.) is not finished yet.
771 @retval EFI_NOT_FOUND When Token is not NULL, the asynchronous I/O
772 request is not found in the transmit or receive
773 queue. It is either completed or not issued by
774 Transmit() or Receive().
780 IN EFI_UDP6_PROTOCOL
*This
,
781 IN EFI_UDP6_COMPLETION_TOKEN
*Token OPTIONAL
785 UDP6_INSTANCE_DATA
*Instance
;
789 return EFI_INVALID_PARAMETER
;
792 Instance
= UDP6_INSTANCE_DATA_FROM_THIS (This
);
794 if (!Instance
->Configured
) {
795 return EFI_NOT_STARTED
;
798 OldTpl
= gBS
->RaiseTPL (TPL_CALLBACK
);
801 // Cancel the tokens specified by Token for this instance.
803 Status
= Udp6InstanceCancelToken (Instance
, Token
);
806 // Dispatch the DPC queued by the NotifyFunction of the canceled token's events.
810 gBS
->RestoreTPL (OldTpl
);
816 This function can be used by network drivers and applications to increase the rate that
817 data packets are moved between the communications device and the transmit/receive queues.
819 @param[in] This Pointer to the EFI_UDP6_PROTOCOL instance.
821 @retval EFI_SUCCESS Incoming or outgoing data was processed.
822 @retval EFI_INVALID_PARAMETER This is NULL.
823 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
824 @retval EFI_TIMEOUT Data was dropped out of the transmit and/or
831 IN EFI_UDP6_PROTOCOL
*This
834 UDP6_INSTANCE_DATA
*Instance
;
835 EFI_IP6_PROTOCOL
*Ip
;
838 return EFI_INVALID_PARAMETER
;
841 Instance
= UDP6_INSTANCE_DATA_FROM_THIS (This
);
842 Ip
= Instance
->IpInfo
->Ip
.Ip6
;
845 // Invode the Ip instance consumed by the udp instance to do the poll operation.
847 return Ip
->Poll (Ip
);