BOOLEAN PromiscRecv;\r
};\r
\r
+/**\r
+ Create an IP4_INTERFACE. Delay the creation of ARP instance until\r
+ the interface is configured.\r
+\r
+ @param Mnp The shared MNP child of this IP4 service binding\r
+ instance\r
+ @param Controller The controller this IP4 service binding instance\r
+ is installed. Most like the UNDI handle.\r
+ @param ImageHandle This driver's image handle\r
+\r
+ @return Point to the created IP4_INTERFACE, otherwise NULL.\r
+\r
+**/\r
IP4_INTERFACE *\r
Ip4CreateInterface (\r
IN EFI_MANAGED_NETWORK_PROTOCOL *Mnp,\r
IN EFI_HANDLE ImageHandle\r
);\r
\r
+/**\r
+ Set the interface's address, create and configure\r
+ the ARP child if necessary.\r
+\r
+ @param Interface The interface to set the address\r
+ @param IpAddr The interface's IP address\r
+ @param SubnetMask The interface's netmask\r
+\r
+ @retval EFI_SUCCESS The interface is configured with Ip/netmask pair,\r
+ and a ARP is created for it.\r
+ @retval Others Failed to set the interface's address.\r
+\r
+**/\r
EFI_STATUS\r
Ip4SetAddress (\r
- IN IP4_INTERFACE *Interface,\r
- IN IP4_ADDR IpAddr,\r
- IN IP4_ADDR SubnetMask\r
+ IN OUT IP4_INTERFACE *Interface,\r
+ IN IP4_ADDR IpAddr,\r
+ IN IP4_ADDR SubnetMask\r
);\r
\r
+/**\r
+ Free the interface used by IpInstance. All the IP instance with\r
+ the same Ip/Netmask pair share the same interface. It is reference\r
+ counted. All the frames haven't been sent will be cancelled.\r
+ Because the IpInstance is optional, the caller must remove\r
+ IpInstance from the interface's instance list itself.\r
+\r
+ @param Interface The interface used by the IpInstance\r
+ @param IpInstance The Ip instance that free the interface. NULL if\r
+ the Ip driver is releasing the default interface.\r
+\r
+ @retval EFI_SUCCESS The interface use IpInstance is freed.\r
+\r
+**/\r
EFI_STATUS\r
Ip4FreeInterface (\r
IN IP4_INTERFACE *Interface,\r
- IN IP4_PROTOCOL *IpInstance OPTIONAL\r
+ IN IP4_PROTOCOL *IpInstance OPTIONAL\r
);\r
\r
+/**\r
+ Send a frame from the interface. If the next hop is broadcast or\r
+ multicast address, it is transmitted immediately. If the next hop\r
+ is a unicast, it will consult ARP to resolve the NextHop's MAC.\r
+ If some error happened, the CallBack won't be called. So, the caller\r
+ must test the return value, and take action when there is an error.\r
+\r
+ @param Interface The interface to send the frame from\r
+ @param IpInstance The IP child that request the transmission. NULL\r
+ if it is the IP4 driver itself.\r
+ @param Packet The packet to transmit.\r
+ @param NextHop The immediate destination to transmit the packet\r
+ to.\r
+ @param CallBack Function to call back when transmit finished.\r
+ @param Context Opaque parameter to the call back.\r
+\r
+ @retval EFI_OUT_OF_RESOURCES Failed to allocate resource to send the frame\r
+ @retval EFI_NO_MAPPING Can't resolve the MAC for the nexthop\r
+ @retval EFI_SUCCESS The packet is successfully transmitted.\r
+ @retval other Other error occurs.\r
+\r
+**/\r
EFI_STATUS\r
Ip4SendFrame (\r
IN IP4_INTERFACE *Interface,\r
IN VOID *Context\r
);\r
\r
+/**\r
+ Remove all the frames on the interface that pass the FrameToCancel,\r
+ either queued on ARP queues or that have already been delivered to\r
+ MNP and not yet recycled.\r
+\r
+ @param Interface Interface to remove the frames from\r
+ @param IoStatus The transmit status returned to the frames'\r
+ callback\r
+ @param FrameToCancel Function to select the frame to cancel, NULL to\r
+ select all\r
+ @param Context Opaque parameters passed to FrameToCancel\r
+\r
+ @return NONE\r
+\r
+**/\r
VOID\r
Ip4CancelFrames (\r
IN IP4_INTERFACE *Interface,\r
IN VOID *Context\r
);\r
\r
+/**\r
+ If there is a pending receive request, cancel it. Don't call\r
+ the receive request's callback because this function can be only\r
+ called if the instance or driver is tearing itself down. It\r
+ doesn't make sense to call it back. But it is necessary to call\r
+ the transmit token's callback to give it a chance to free the\r
+ packet and update the upper layer's transmit request status, say\r
+ that from the UDP.\r
+\r
+ @param Interface The interface used by the IpInstance\r
+\r
+ @return None\r
+\r
+**/\r
VOID\r
Ip4CancelReceive (\r
IN IP4_INTERFACE *Interface\r
);\r
\r
+/**\r
+ Request to receive the packet from the interface.\r
+\r
+ @param Interface The interface to receive the frames from\r
+ @param IpInstance The instance that requests the receive. NULL for\r
+ the driver itself.\r
+ @param CallBack Function to call when receive finished.\r
+ @param Context Opaque parameter to the callback\r
+\r
+ @retval EFI_ALREADY_STARTED There is already a pending receive request.\r
+ @retval EFI_OUT_OF_RESOURCES Failed to allocate resource to receive\r
+ @retval EFI_SUCCESS The recieve request has been started.\r
+ @retval other Other error occurs.\r
+\r
+**/\r
EFI_STATUS\r
Ip4ReceiveFrame (\r
IN IP4_INTERFACE *Interface,\r