2 Declaration of structures and functions of MnpDxe driver.
4 Copyright (c) 2005 - 2010, Intel Corporation.<BR>
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions
7 of the BSD License which accompanies this distribution. The full
8 text of the license may be found at<BR>
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.
19 #include "MnpDriver.h"
21 #define NET_ETHER_FCS_SIZE 4
23 #define MNP_SYS_POLL_INTERVAL (10 * TICKS_PER_MS) // 10 milliseconds
24 #define MNP_TIMEOUT_CHECK_INTERVAL (50 * TICKS_PER_MS) // 50 milliseconds
25 #define MNP_MEDIA_DETECT_INTERVAL (500 * TICKS_PER_MS) // 500 milliseconds
26 #define MNP_TX_TIMEOUT_TIME (500 * TICKS_PER_MS) // 500 milliseconds
27 #define MNP_INIT_NET_BUFFER_NUM 512
28 #define MNP_NET_BUFFER_INCREASEMENT 64
29 #define MNP_MAX_NET_BUFFER_NUM 65536
31 #define MNP_MAX_RCVD_PACKET_QUE_SIZE 256
33 #define MNP_RECEIVE_UNICAST 0x01
34 #define MNP_RECEIVE_BROADCAST 0x02
36 #define UNICAST_PACKET MNP_RECEIVE_UNICAST
37 #define BROADCAST_PACKET MNP_RECEIVE_BROADCAST
39 #define MNP_INSTANCE_DATA_SIGNATURE SIGNATURE_32 ('M', 'n', 'p', 'I')
41 #define MNP_INSTANCE_DATA_FROM_THIS(a) \
46 MNP_INSTANCE_DATA_SIGNATURE \
52 MNP_SERVICE_DATA
*MnpServiceData
;
58 EFI_MANAGED_NETWORK_PROTOCOL ManagedNetwork
;
63 LIST_ENTRY GroupCtrlBlkList
;
67 LIST_ENTRY RxDeliveredPacketQueue
;
68 LIST_ENTRY RcvdPacketQueue
;
69 UINTN RcvdPacketQueueSize
;
71 EFI_MANAGED_NETWORK_CONFIG_DATA ConfigData
;
78 EFI_MAC_ADDRESS Address
;
83 LIST_ENTRY CtrlBlkEntry
;
84 MNP_GROUP_ADDRESS
*GroupAddress
;
85 } MNP_GROUP_CONTROL_BLOCK
;
89 MNP_INSTANCE_DATA
*Instance
;
90 EFI_MANAGED_NETWORK_RECEIVE_DATA RxData
;
97 Initialize the mnp device context data.
99 @param[in, out] MnpDeviceData Pointer to the mnp device context data.
100 @param[in] ImageHandle The driver image handle.
101 @param[in] ControllerHandle Handle of device to bind driver to.
103 @retval EFI_SUCCESS The mnp service context is initialized.
104 @retval EFI_UNSUPPORTED ControllerHandle does not support Simple Network Protocol.
105 @retval Others Other errors as indicated.
109 MnpInitializeDeviceData (
110 IN OUT MNP_DEVICE_DATA
*MnpDeviceData
,
111 IN EFI_HANDLE ImageHandle
,
112 IN EFI_HANDLE ControllerHandle
116 Destroy the MNP device context data.
118 @param[in, out] MnpDeviceData Pointer to the mnp device context data.
119 @param[in] ImageHandle The driver image handle.
123 MnpDestroyDeviceData (
124 IN OUT MNP_DEVICE_DATA
*MnpDeviceData
,
125 IN EFI_HANDLE ImageHandle
129 Create mnp service context data.
131 @param[in] MnpDeviceData Pointer to the mnp device context data.
132 @param[in] VlanId The VLAN ID.
133 @param[in] Priority The VLAN priority. If VlanId is 0,
136 @return A pointer to MNP_SERVICE_DATA or NULL if failed to create MNP service context.
140 MnpCreateServiceData (
141 IN MNP_DEVICE_DATA
*MnpDeviceData
,
143 IN UINT8 Priority OPTIONAL
147 Initialize the mnp service context data.
149 @param[in, out] MnpServiceData Pointer to the mnp service context data.
150 @param[in] ImageHandle The driver image handle.
151 @param[in] ControllerHandle Handle of device to bind driver to.
153 @retval EFI_SUCCESS The mnp service context is initialized.
154 @retval EFI_UNSUPPORTED ControllerHandle does not support Simple Network Protocol.
155 @retval Others Other errors as indicated.
159 MnpInitializeServiceData (
160 IN OUT MNP_SERVICE_DATA
*MnpServiceData
,
161 IN EFI_HANDLE ImageHandle
,
162 IN EFI_HANDLE ControllerHandle
166 Destroy the MNP service context data.
168 @param[in, out] MnpServiceData Pointer to the mnp service context data.
170 @retval EFI_SUCCESS The mnp service context is destroyed.
171 @retval Others Errors as indicated.
175 MnpDestroyServiceData (
176 IN OUT MNP_SERVICE_DATA
*MnpServiceData
180 Destroy all child of the MNP service data.
182 @param[in, out] MnpServiceData Pointer to the mnp service context data.
184 @retval EFI_SUCCESS All child are destroyed.
185 @retval Others Failed to destroy all child.
189 MnpDestroyServiceChild (
190 IN OUT MNP_SERVICE_DATA
*MnpServiceData
194 Find the MNP Service Data for given VLAN ID.
196 @param[in] MnpDeviceData Pointer to the mnp device context data.
197 @param[in] VlanId The VLAN ID.
199 @return A pointer to MNP_SERVICE_DATA or NULL if not found.
204 IN MNP_DEVICE_DATA
*MnpDeviceData
,
209 Initialize the mnp instance context data.
211 @param[in] MnpServiceData Pointer to the mnp service context data.
212 @param[in, out] Instance Pointer to the mnp instance context data
217 MnpInitializeInstanceData (
218 IN MNP_SERVICE_DATA
*MnpServiceData
,
219 IN OUT MNP_INSTANCE_DATA
*Instance
223 Check whether the token specified by Arg matches the token in Item.
225 @param[in] Map Pointer to the NET_MAP.
226 @param[in] Item Pointer to the NET_MAP_ITEM.
227 @param[in] Arg Pointer to the Arg, it's a pointer to the token to
230 @retval EFI_SUCCESS The token specified by Arg is different from the
232 @retval EFI_ACCESS_DENIED The token specified by Arg is the same as that in
240 IN NET_MAP_ITEM
*Item
,
245 Cancel the token specified by Arg if it matches the token in Item.
247 @param[in, out] Map Pointer to the NET_MAP.
248 @param[in, out] Item Pointer to the NET_MAP_ITEM.
249 @param[in] Arg Pointer to the Arg, it's a pointer to the
252 @retval EFI_SUCCESS The Arg is NULL, and the token in Item is cancelled,
253 or the Arg isn't NULL, and the token in Item is
254 different from the Arg.
255 @retval EFI_ABORTED The Arg isn't NULL, the token in Item mathces the
256 Arg, and the token is cancelled.
263 IN OUT NET_MAP_ITEM
*Item
,
268 Flush the instance's received data.
270 @param[in, out] Instance Pointer to the mnp instance context data.
274 MnpFlushRcvdDataQueue (
275 IN OUT MNP_INSTANCE_DATA
*Instance
279 Configure the Instance using ConfigData.
281 @param[in, out] Instance Pointer to the mnp instance context data.
282 @param[in] ConfigData Pointer to the configuration data used to configure
285 @retval EFI_SUCCESS The Instance is configured.
286 @retval EFI_UNSUPPORTED EnableReceiveTimestamps is on and the
287 implementation doesn't support it.
288 @retval Others Other errors as indicated.
292 MnpConfigureInstance (
293 IN OUT MNP_INSTANCE_DATA
*Instance
,
294 IN EFI_MANAGED_NETWORK_CONFIG_DATA
*ConfigData OPTIONAL
298 Do the group operations for this instance.
300 @param[in, out] Instance Pointer to the instance context data.
301 @param[in] JoinFlag Set to TRUE to join a group. Set to TRUE to
302 leave a group/groups.
303 @param[in] MacAddress Pointer to the group address to join or leave.
304 @param[in] CtrlBlk Pointer to the group control block if JoinFlag
307 @retval EFI_SUCCESS The group operation finished.
308 @retval EFI_OUT_OF_RESOURCES Failed due to lack of memory resources.
309 @retval Others Other errors as indicated.
314 IN OUT MNP_INSTANCE_DATA
*Instance
,
316 IN EFI_MAC_ADDRESS
*MacAddress OPTIONAL
,
317 IN MNP_GROUP_CONTROL_BLOCK
*CtrlBlk OPTIONAL
321 Validates the Mnp transmit token.
323 @param[in] Instance Pointer to the Mnp instance context data.
324 @param[in] Token Pointer to the transmit token to check.
326 @return The Token is valid or not.
331 IN MNP_INSTANCE_DATA
*Instance
,
332 IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN
*Token
336 Build the packet to transmit from the TxData passed in.
338 @param[in] MnpServiceData Pointer to the mnp service context data.
339 @param[in] TxData Pointer to the transmit data containing the information
341 @param[out] PktBuf Pointer to record the address of the packet.
342 @param[out] PktLen Pointer to a UINT32 variable used to record the packet's
348 IN MNP_SERVICE_DATA
*MnpServiceData
,
349 IN EFI_MANAGED_NETWORK_TRANSMIT_DATA
*TxData
,
355 Synchronously send out the packet.
357 @param[in] MnpServiceData Pointer to the mnp service context data.
358 @param[in] Packet Pointer to the pakcet buffer.
359 @param[in] Length The length of the packet.
360 @param[in, out] Token Pointer to the token the packet generated from.
362 @retval EFI_SUCCESS The packet is sent out.
363 @retval EFI_TIMEOUT Time out occurs, the packet isn't sent.
364 @retval EFI_DEVICE_ERROR An unexpected network error occurs.
369 IN MNP_SERVICE_DATA
*MnpServiceData
,
372 IN OUT EFI_MANAGED_NETWORK_COMPLETION_TOKEN
*Token
376 Try to deliver the received packet to the instance.
378 @param[in, out] Instance Pointer to the mnp instance context data.
380 @retval EFI_SUCCESS The received packet is delivered, or there is no
381 packet to deliver, or there is no available receive
383 @retval EFI_OUT_OF_RESOURCES The deliver fails due to lack of memory resource.
387 MnpInstanceDeliverPacket (
388 IN OUT MNP_INSTANCE_DATA
*Instance
392 Recycle the RxData and other resources used to hold and deliver the received
395 @param[in] Event The event this notify function registered to.
396 @param[in] Context Pointer to the context data registerd to the Event.
407 Try to receive a packet and deliver it.
409 @param[in, out] MnpDeviceData Pointer to the mnp device context data.
411 @retval EFI_SUCCESS add return value to function comment
412 @retval EFI_NOT_STARTED The simple network protocol is not started.
413 @retval EFI_NOT_READY No packet received.
414 @retval EFI_DEVICE_ERROR An unexpected error occurs.
419 IN OUT MNP_DEVICE_DATA
*MnpDeviceData
423 Allocate a free NET_BUF from MnpDeviceData->FreeNbufQue. If there is none
424 in the queue, first try to allocate some and add them into the queue, then
425 fetch the NET_BUF from the updated FreeNbufQue.
427 @param[in, out] MnpDeviceData Pointer to the MNP_DEVICE_DATA.
429 @return Pointer to the allocated free NET_BUF structure, if NULL the
435 IN OUT MNP_DEVICE_DATA
*MnpDeviceData
439 Try to reclaim the Nbuf into the buffer pool.
441 @param[in, out] MnpDeviceData Pointer to the mnp device context data.
442 @param[in, out] Nbuf Pointer to the NET_BUF to free.
447 IN OUT MNP_DEVICE_DATA
*MnpDeviceData
,
452 Remove the received packets if timeout occurs.
454 @param[in] Event The event this notify function registered to.
455 @param[in] Context Pointer to the context data registered to the event.
460 MnpCheckPacketTimeout (
466 Poll to update MediaPresent field in SNP ModeData by Snp.GetStatus().
468 @param[in] Event The event this notify function registered to.
469 @param[in] Context Pointer to the context data registered to the event.
474 MnpCheckMediaStatus (
480 Poll to receive the packets from Snp. This function is either called by upperlayer
481 protocols/applications or the system poll timer notify mechanism.
483 @param[in] Event The event this notify function registered to.
484 @param[in] Context Pointer to the context data registered to the event.
495 Returns the operational parameters for the current MNP child driver. May also
496 support returning the underlying SNP driver mode data.
498 The GetModeData() function is used to read the current mode data (operational
499 parameters) from the MNP or the underlying SNP.
501 @param[in] This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
502 @param[out] MnpConfigData Pointer to storage for MNP operational parameters. Type
503 EFI_MANAGED_NETWORK_CONFIG_DATA is defined in "Related
505 @param[out] SnpModeData Pointer to storage for SNP operational parameters. This
506 feature may be unsupported. Type EFI_SIMPLE_NETWORK_MODE
507 is defined in the EFI_SIMPLE_NETWORK_PROTOCOL.
509 @retval EFI_SUCCESS The operation completed successfully.
510 @retval EFI_INVALID_PARAMETER This is NULL.
511 @retval EFI_UNSUPPORTED The requested feature is unsupported in this
513 @retval EFI_NOT_STARTED This MNP child driver instance has not been
514 configured. The default values are returned in
515 MnpConfigData if it is not NULL.
516 @retval Others The mode data could not be read.
522 IN EFI_MANAGED_NETWORK_PROTOCOL
*This
,
523 OUT EFI_MANAGED_NETWORK_CONFIG_DATA
*MnpConfigData OPTIONAL
,
524 OUT EFI_SIMPLE_NETWORK_MODE
*SnpModeData OPTIONAL
528 Sets or clears the operational parameters for the MNP child driver.
530 The Configure() function is used to set, change, or reset the operational
531 parameters for the MNP child driver instance. Until the operational parameters
532 have been set, no network traffic can be sent or received by this MNP child
533 driver instance. Once the operational parameters have been reset, no more
534 traffic can be sent or received until the operational parameters have been set
536 Each MNP child driver instance can be started and stopped independently of
537 each other by setting or resetting their receive filter settings with the
538 Configure() function.
539 After any successful call to Configure(), the MNP child driver instance is
540 started. The internal periodic timer (if supported) is enabled. Data can be
541 transmitted and may be received if the receive filters have also been enabled.
542 Note: If multiple MNP child driver instances will receive the same packet
543 because of overlapping receive filter settings, then the first MNP child
544 driver instance will receive the original packet and additional instances will
545 receive copies of the original packet.
546 Note: Warning: Receive filter settings that overlap will consume extra
547 processor and/or DMA resources and degrade system and network performance.
549 @param[in] This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
550 @param[in] MnpConfigData Pointer to configuration data that will be assigned
551 to the MNP child driver instance. If NULL, the MNP
552 child driver instance is reset to startup defaults
553 and all pending transmit and receive requests are
554 flushed. Type EFI_MANAGED_NETWORK_CONFIG_DATA is
555 defined in EFI_MANAGED_NETWORK_PROTOCOL.GetModeData().
557 @retval EFI_SUCCESS The operation completed successfully.
558 @retval EFI_INVALID_PARAMETER One or more of the following conditions is
561 * MnpConfigData.ProtocolTypeFilter is not
563 The operational data for the MNP child driver
564 instance is unchanged.
565 @retval EFI_OUT_OF_RESOURCES Required system resources (usually memory)
566 could not be allocated.
567 The MNP child driver instance has been reset to
569 @retval EFI_UNSUPPORTED The requested feature is unsupported in
570 this [MNP] implementation. The operational data
571 for the MNP child driver instance is unchanged.
572 @retval EFI_DEVICE_ERROR An unexpected network or system error
573 occurred. The MNP child driver instance has
574 been reset to startup defaults.
575 @retval Others The MNP child driver instance has been reset to
582 IN EFI_MANAGED_NETWORK_PROTOCOL
*This
,
583 IN EFI_MANAGED_NETWORK_CONFIG_DATA
*MnpConfigData OPTIONAL
587 Translates an IP multicast address to a hardware (MAC) multicast address. This
588 function may be unsupported in some MNP implementations.
590 The McastIpToMac() function translates an IP multicast address to a hardware
591 (MAC) multicast address. This function may be implemented by calling the
592 underlying EFI_SIMPLE_NETWORK. MCastIpToMac() function, which may also be
593 unsupported in some MNP implementations.
595 @param[in] This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
596 @param[in] Ipv6Flag Set to TRUE to if IpAddress is an IPv6 multicast address.
597 Set to FALSE if IpAddress is an IPv4 multicast address.
598 @param[in] IpAddress Pointer to the multicast IP address (in network byte
600 @param[out] MacAddress Pointer to the resulting multicast MAC address.
602 @retval EFI_SUCCESS The operation completed successfully.
603 @retval EFI_INVALID_PARAMETER One of the following conditions is TRUE:
606 * IpAddress is not a valid multicast IP
608 * MacAddress is NULL.
609 @retval EFI_NOT_STARTED This MNP child driver instance has not been
611 @retval EFI_UNSUPPORTED The requested feature is unsupported in this
613 @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.
614 @retval Others The address could not be converted.
619 IN EFI_MANAGED_NETWORK_PROTOCOL
*This
,
621 IN EFI_IP_ADDRESS
*IpAddress
,
622 OUT EFI_MAC_ADDRESS
*MacAddress
626 Enables and disables receive filters for multicast address. This function may
627 be unsupported in some MNP implementations.
629 The Groups() function only adds and removes multicast MAC addresses from the
630 filter list. The MNP driver does not transmit or process Internet Group
631 Management Protocol (IGMP) packets. If JoinFlag is FALSE and MacAddress is
632 NULL, then all joined groups are left.
634 @param[in] This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
635 @param[in] JoinFlag Set to TRUE to join this multicast group.
636 Set to FALSE to leave this multicast group.
637 @param[in] MacAddress Pointer to the multicast MAC group (address) to join or
640 @retval EFI_SUCCESS The requested operation completed successfully.
641 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
643 * JoinFlag is TRUE and MacAddress is NULL.
644 * MacAddress is not a valid multicast MAC
646 * The MNP multicast group settings are
648 @retval EFI_NOT_STARTED This MNP child driver instance has not been
650 @retval EFI_ALREADY_STARTED The supplied multicast group is already joined.
651 @retval EFI_NOT_FOUND The supplied multicast group is not joined.
652 @retval EFI_DEVICE_ERROR An unexpected network or system error occurred.
653 The MNP child driver instance has been reset to
655 @retval EFI_UNSUPPORTED The requested feature is unsupported in this MNP
657 @retval Others The requested operation could not be completed.
658 The MNP multicast group settings are unchanged.
664 IN EFI_MANAGED_NETWORK_PROTOCOL
*This
,
666 IN EFI_MAC_ADDRESS
*MacAddress OPTIONAL
670 Places asynchronous outgoing data packets into the transmit queue.
672 The Transmit() function places a completion token into the transmit packet
673 queue. This function is always asynchronous.
674 The caller must fill in the Token.Event and Token.TxData fields in the
675 completion token, and these fields cannot be NULL. When the transmit operation
676 completes, the MNP updates the Token.Status field and the Token.Event is
678 Note: There may be a performance penalty if the packet needs to be
679 defragmented before it can be transmitted by the network device. Systems in
680 which performance is critical should review the requirements and features of
681 the underlying communications device and drivers.
684 @param[in] This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
685 @param[in] Token Pointer to a token associated with the transmit data
686 descriptor. Type EFI_MANAGED_NETWORK_COMPLETION_TOKEN
687 is defined in "Related Definitions" below.
689 @retval EFI_SUCCESS The transmit completion token was cached.
690 @retval EFI_NOT_STARTED This MNP child driver instance has not been
692 @retval EFI_INVALID_PARAMETER One or more of the following conditions is
696 * Token.Event is NULL.
697 * Token.TxData is NULL.
698 * Token.TxData.DestinationAddress is not
699 NULL and Token.TxData.HeaderLength is zero.
700 * Token.TxData.FragmentCount is zero.
701 * (Token.TxData.HeaderLength +
702 Token.TxData.DataLength) is not equal to the
704 Token.TxData.FragmentTable[].FragmentLength
707 Token.TxData.FragmentTable[].FragmentLength
710 Token.TxData.FragmentTable[].FragmentBufferfields
712 * Token.TxData.DataLength is greater than MTU.
713 @retval EFI_ACCESS_DENIED The transmit completion token is already in the
715 @retval EFI_OUT_OF_RESOURCES The transmit data could not be queued due to a
716 lack of system resources (usually memory).
717 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
718 The MNP child driver instance has been reset to
720 @retval EFI_NOT_READY The transmit request could not be queued because
721 the transmit queue is full.
727 IN EFI_MANAGED_NETWORK_PROTOCOL
*This
,
728 IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN
*Token
732 Aborts an asynchronous transmit or receive request.
734 The Cancel() function is used to abort a pending transmit or receive request.
735 If the token is in the transmit or receive request queues, after calling this
736 function, Token.Status will be set to EFI_ABORTED and then Token.Event will be
737 signaled. If the token is not in one of the queues, which usually means that
738 the asynchronous operation has completed, this function will not signal the
739 token and EFI_NOT_FOUND is returned.
741 @param[in] This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
742 @param[in] Token Pointer to a token that has been issued by
743 EFI_MANAGED_NETWORK_PROTOCOL.Transmit() or
744 EFI_MANAGED_NETWORK_PROTOCOL.Receive(). If NULL, all
745 pending tokens are aborted.
747 @retval EFI_SUCCESS The asynchronous I/O request was aborted and
748 Token.Event was signaled. When Token is NULL,
749 all pending requests were aborted and their
750 events were signaled.
751 @retval EFI_NOT_STARTED This MNP child driver instance has not been
753 @retval EFI_INVALID_PARAMETER This is NULL.
754 @retval EFI_NOT_FOUND When Token is not NULL, the asynchronous I/O
755 request was not found in the transmit or
756 receive queue. It has either completed or was
757 not issued by Transmit() and Receive().
763 IN EFI_MANAGED_NETWORK_PROTOCOL
*This
,
764 IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN
*Token OPTIONAL
768 Places an asynchronous receiving request into the receiving queue.
770 The Receive() function places a completion token into the receive packet
771 queue. This function is always asynchronous.
772 The caller must fill in the Token.Event field in the completion token, and
773 this field cannot be NULL. When the receive operation completes, the MNP
774 updates the Token.Status and Token.RxData fields and the Token.Event is
777 @param[in] This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
778 @param[in] Token Pointer to a token associated with the receive
779 data descriptor. Type
780 EFI_MANAGED_NETWORK_COMPLETION_TOKEN is defined in
781 EFI_MANAGED_NETWORK_PROTOCOL.Transmit().
783 @retval EFI_SUCCESS The receive completion token was cached.
784 @retval EFI_NOT_STARTED This MNP child driver instance has not been
786 @retval EFI_INVALID_PARAMETER One or more of the following conditions is
790 * Token.Event is NULL
791 @retval EFI_OUT_OF_RESOURCES The transmit data could not be queued due to a
792 lack of system resources (usually memory).
793 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred.
794 The MNP child driver instance has been reset to
796 @retval EFI_ACCESS_DENIED The receive completion token was already in the
798 @retval EFI_NOT_READY The receive request could not be queued because
799 the receive queue is full.
805 IN EFI_MANAGED_NETWORK_PROTOCOL
*This
,
806 IN EFI_MANAGED_NETWORK_COMPLETION_TOKEN
*Token
810 Polls for incoming data packets and processes outgoing data packets.
812 The Poll() function can be used by network drivers and applications to
813 increase the rate that data packets are moved between the communications
814 device and the transmit and receive queues.
815 Normally, a periodic timer event internally calls the Poll() function. But, in
816 some systems, the periodic timer event may not call Poll() fast enough to
817 transmit and/or receive all data packets without missing packets. Drivers and
818 applications that are experiencing packet loss should try calling the Poll()
821 @param[in] This Pointer to the EFI_MANAGED_NETWORK_PROTOCOL instance.
823 @retval EFI_SUCCESS Incoming or outgoing data was processed.
824 @retval EFI_NOT_STARTED This MNP child driver instance has not been
826 @retval EFI_DEVICE_ERROR An unexpected system or network error occurred. The
827 MNP child driver instance has been reset to startup
829 @retval EFI_NOT_READY No incoming or outgoing data was processed. Consider
830 increasing the polling rate.
831 @retval EFI_TIMEOUT Data was dropped out of the transmit and/or receive
832 queue. Consider increasing the polling rate.
838 IN EFI_MANAGED_NETWORK_PROTOCOL
*This
842 Configure the Snp receive filters according to the instances' receive filter
845 @param[in] MnpDeviceData Pointer to the mnp device context data.
847 @retval EFI_SUCCESS The receive filters is configured.
848 @retval EFI_OUT_OF_RESOURCES The receive filters can't be configured due
849 to lack of memory resource.
853 MnpConfigReceiveFilters (
854 IN MNP_DEVICE_DATA
*MnpDeviceData