TianoCore EDK2 master
Loading...
Searching...
No Matches
UsbRndisFunction.c File Reference
#include "UsbRndis.h"

Go to the source code of this file.

Functions

EFI_STATUS LoadAllDescriptor (IN EFI_USB_IO_PROTOCOL *UsbIo, OUT EFI_USB_CONFIG_DESCRIPTOR **ConfigDesc)
 
BOOLEAN NextDescriptor (IN EFI_USB_CONFIG_DESCRIPTOR *Desc, IN OUT UINTN *Offset)
 
EFI_STATUS GetFunctionalDescriptor (IN EFI_USB_CONFIG_DESCRIPTOR *Config, IN UINT8 FunDescriptorType, OUT VOID *DataBuffer)
 
VOID GetEndpoint (IN EFI_USB_IO_PROTOCOL *UsbIo, IN OUT USB_RNDIS_DEVICE *UsbRndisDevice)
 
EFI_STATUS EFIAPI InterruptCallback (IN VOID *Data, IN UINTN DataLength, IN VOID *Context, IN UINT32 Status)
 
EFI_STATUS EFIAPI UsbRndisInterrupt (IN EDKII_USB_ETHERNET_PROTOCOL *This, IN BOOLEAN IsNewTransfer, IN UINTN PollingInterval, IN EFI_USB_DEVICE_REQUEST *Requst)
 
EFI_STATUS EFIAPI ReadRndisResponseInterrupt (IN USB_RNDIS_DEVICE *UsbRndisDevice)
 
EFI_STATUS EFIAPI GetUsbEthMacAddress (IN EDKII_USB_ETHERNET_PROTOCOL *This, OUT EFI_MAC_ADDRESS *MacAddress)
 
EFI_STATUS EFIAPI UsbEthBulkSize (IN EDKII_USB_ETHERNET_PROTOCOL *This, OUT UINTN *BulkSize)
 
EFI_STATUS EFIAPI GetUsbHeaderFunDescriptor (IN EDKII_USB_ETHERNET_PROTOCOL *This, OUT USB_HEADER_FUN_DESCRIPTOR *UsbHeaderFunDescriptor)
 
EFI_STATUS EFIAPI GetUsbUnionFunDescriptor (IN EDKII_USB_ETHERNET_PROTOCOL *This, OUT USB_UNION_FUN_DESCRIPTOR *UsbUnionFunDescriptor)
 
EFI_STATUS EFIAPI GetUsbRndisFunDescriptor (IN EDKII_USB_ETHERNET_PROTOCOL *This, OUT USB_ETHERNET_FUN_DESCRIPTOR *UsbEthFunDescriptor)
 
EFI_STATUS EFIAPI SetUsbRndisMcastFilter (IN EDKII_USB_ETHERNET_PROTOCOL *This, IN UINT16 Value, IN VOID *McastAddr)
 
EFI_STATUS EFIAPI SetUsbRndisPowerFilter (IN EDKII_USB_ETHERNET_PROTOCOL *This, IN UINT16 Value, IN UINT16 Length, IN VOID *PatternFilter)
 
EFI_STATUS EFIAPI GetUsbRndisPowerFilter (IN EDKII_USB_ETHERNET_PROTOCOL *This, IN UINT16 Value, OUT BOOLEAN *PatternActive)
 
VOID ConvertFilter (IN UINT16 Value, OUT UINT16 *CdcFilter)
 
EFI_STATUS EFIAPI RndisUndiReceiveFilter (IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
 
EFI_STATUS EFIAPI SetUsbRndisPacketFilter (IN EDKII_USB_ETHERNET_PROTOCOL *This, IN UINT16 Value)
 
EFI_STATUS EFIAPI GetRndisStatistic (IN EDKII_USB_ETHERNET_PROTOCOL *This, IN UINT16 FeatureSelector, OUT VOID *Statistic)
 
EFI_STATUS EFIAPI RndisUndiStart (IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
 
EFI_STATUS EFIAPI RndisUndiStop (IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
 
EFI_STATUS EFIAPI RndisUndiGetInitInfo (IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
 
EFI_STATUS EFIAPI RndisUndiGetConfigInfo (IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
 
EFI_STATUS EFIAPI RndisUndiInitialize (IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
 
EFI_STATUS EFIAPI RndisUndiReset (IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
 
EFI_STATUS EFIAPI RndisUndiShutdown (IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
 
EFI_STATUS EFIAPI RndisUndiGetStatus (IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
 
EFI_STATUS EFIAPI RndisUndiTransmit (IN PXE_CDB *Cdb, IN EDKII_USB_ETHERNET_PROTOCOL *This, IN VOID *BulkOutData, IN OUT UINTN *DataLength)
 
EFI_STATUS EFIAPI RndisUndiReceive (IN PXE_CDB *Cdb, IN EDKII_USB_ETHERNET_PROTOCOL *This, IN OUT VOID *BulkInData, IN OUT UINTN *DataLength)
 
EFI_STATUS EFIAPI RndisDummyReturn (IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
 
EFI_STATUS RndisControlMsg (IN USB_RNDIS_DEVICE *UsbRndisDevice, IN REMOTE_NDIS_MSG_HEADER *RndisMsg, OUT REMOTE_NDIS_MSG_HEADER *RndisMsgResponse)
 
EFI_STATUS RndisTransmitDataMsg (IN USB_RNDIS_DEVICE *UsbRndisDevice, IN REMOTE_NDIS_MSG_HEADER *RndisMsg, IN OUT UINTN *TransferLength)
 
EFI_STATUS RndisReceiveDataMsg (IN USB_RNDIS_DEVICE *UsbRndisDevice, IN OUT REMOTE_NDIS_MSG_HEADER *RndisMsg, IN OUT UINTN *TransferLength)
 
VOID PrintRndisMsg (IN REMOTE_NDIS_MSG_HEADER *RndisMsg)
 

Variables

UINT16 gStopBulkInCnt = 0
 
UINT16 gBlockBulkInCnt = 0
 
BIT_MAP gTable []
 

Detailed Description

This file contains code for USB Ethernet descriptor and specific requests implement.

Copyright (c) 2023, American Megatrends International LLC. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent

Definition in file UsbRndisFunction.c.

Function Documentation

◆ ConvertFilter()

VOID ConvertFilter ( IN UINT16  Value,
OUT UINT16 *  CdcFilter 
)

Converts PXE filter settings to RNDIS values

Parameters
[in]ValuePXE filter data.
[out]CdcFilterA pointer to the Ethernet Packet Filter Bitmap value converted by PXE_OPFLAGS.

Definition at line 796 of file UsbRndisFunction.c.

◆ GetEndpoint()

VOID GetEndpoint ( IN EFI_USB_IO_PROTOCOL UsbIo,
IN OUT USB_RNDIS_DEVICE UsbRndisDevice 
)

Get USB Ethernet IO endpoint and USB CDC data IO endpoint.

Parameters
[in]UsbIoA pointer to the EFI_USB_IO_PROTOCOL instance.
[in,out]UsbRndisDeviceA pointer to the USB_RNDIS_DEVICE instance.

Definition at line 169 of file UsbRndisFunction.c.

◆ GetFunctionalDescriptor()

EFI_STATUS GetFunctionalDescriptor ( IN EFI_USB_CONFIG_DESCRIPTOR Config,
IN UINT8  FunDescriptorType,
OUT VOID *  DataBuffer 
)

Read Function descriptor

Parameters
[in]ConfigA pointer to all of configuration.
[in]FunDescriptorTypeUSB CDC class descriptor SubType.
[out]DataBufferA pointer to the Data of corresponding to device capability.
Return values
EFI_SUCCESSThe device capability descriptor was retrieved successfully.
EFI_UNSUPPORTEDNo supported.
EFI_NOT_FOUNDThe device capability descriptor was not found.

Definition at line 112 of file UsbRndisFunction.c.

◆ GetRndisStatistic()

EFI_STATUS EFIAPI GetRndisStatistic ( IN EDKII_USB_ETHERNET_PROTOCOL This,
IN UINT16  FeatureSelector,
OUT VOID *  Statistic 
)

This request is used to retrieve a statistic based on the feature selector.

Parameters
[in]ThisA pointer to the EDKII_USB_ETHERNET_PROTOCOL instance.
[in]FeatureSelectorValue of the feature selector.
[out]StatisticA pointer to the 32 bit unsigned integer.
Return values
EFI_SUCCESSThe request executed successfully.
EFI_TIMEOUTA timeout occurred executing the request.
EFI_DEVICE_ERRORThe request failed due to a device error.
EFI_INVALID_PARAMETEROne of the parameters has an invalid value.
EFI_UNSUPPORTEDNot supported.

Definition at line 929 of file UsbRndisFunction.c.

◆ GetUsbEthMacAddress()

EFI_STATUS EFIAPI GetUsbEthMacAddress ( IN EDKII_USB_ETHERNET_PROTOCOL This,
OUT EFI_MAC_ADDRESS MacAddress 
)

Retrieves the USB Ethernet Mac Address.

Parameters
[in]ThisA pointer to the EDKII_USB_ETHERNET_PROTOCOL instance.
[out]MacAddressA pointer to the caller allocated USB Ethernet Mac Address.
Return values
EFI_SUCCESSThe USB Header Functional descriptor was retrieved successfully.
EFI_INVALID_PARAMETERUsbHeaderFunDescriptor is NULL.
EFI_NOT_FOUNDThe USB Header Functional descriptor was not found.

Definition at line 382 of file UsbRndisFunction.c.

◆ GetUsbHeaderFunDescriptor()

EFI_STATUS EFIAPI GetUsbHeaderFunDescriptor ( IN EDKII_USB_ETHERNET_PROTOCOL This,
OUT USB_HEADER_FUN_DESCRIPTOR UsbHeaderFunDescriptor 
)

Retrieves the USB Header functional Descriptor.

Parameters
[in]ThisA pointer to the EDKII_USB_ETHERNET_PROTOCOL instance.
[out]UsbHeaderFunDescriptorA pointer to the caller allocated USB Header Functional Descriptor.
Return values
EFI_SUCCESSThe USB Header Functional descriptor was retrieved successfully.
EFI_INVALID_PARAMETERUsbHeaderFunDescriptor is NULL.
EFI_NOT_FOUNDThe USB Header Functional descriptor was not found.

Definition at line 532 of file UsbRndisFunction.c.

◆ GetUsbRndisFunDescriptor()

EFI_STATUS EFIAPI GetUsbRndisFunDescriptor ( IN EDKII_USB_ETHERNET_PROTOCOL This,
OUT USB_ETHERNET_FUN_DESCRIPTOR UsbEthFunDescriptor 
)

Retrieves the USB Ethernet functional Descriptor.

This function get the Mac Address, Ethernet statistics, maximum segment size, number of multicast filters, and number of pattern filters from Ethernet functional Descriptor.

Parameters
[in]ThisA pointer to the EDKII_USB_ETHERNET_PROTOCOL instance.
[out]UsbEthFunDescriptorA pointer to the caller allocated USB Ethernet Functional Descriptor.
Return values
EFI_SUCCESSThe USB Ethernet Functional descriptor was retrieved successfully.
EFI_INVALID_PARAMETERUsbEthFunDescriptor is NULL.
EFI_NOT_FOUNDThe USB Ethernet Functional descriptor was not found.

Definition at line 606 of file UsbRndisFunction.c.

◆ GetUsbRndisPowerFilter()

EFI_STATUS EFIAPI GetUsbRndisPowerFilter ( IN EDKII_USB_ETHERNET_PROTOCOL This,
IN UINT16  Value,
OUT BOOLEAN *  PatternActive 
)

This request retrieves the status of the specified Ethernet power management pattern filter from the device.

Parameters
[in]ThisA pointer to the EDKII_USB_ETHERNET_PROTOCOL instance.
[in]ValueThe filter number.
[out]PatternActiveA pointer to the pattern active boolean.
Return values
EFI_SUCCESSThe request executed successfully.
EFI_TIMEOUTA timeout occurred executing the request.
EFI_DEVICE_ERRORThe request failed due to a device error.
EFI_INVALID_PARAMETEROne of the parameters has an invalid value.
EFI_UNSUPPORTEDNot supported.

Definition at line 750 of file UsbRndisFunction.c.

◆ GetUsbUnionFunDescriptor()

EFI_STATUS EFIAPI GetUsbUnionFunDescriptor ( IN EDKII_USB_ETHERNET_PROTOCOL This,
OUT USB_UNION_FUN_DESCRIPTOR UsbUnionFunDescriptor 
)

Retrieves the USB Union functional Descriptor.

Parameters
[in]ThisA pointer to the EDKII_USB_ETHERNET_PROTOCOL instance.
[out]UsbUnionFunDescriptorA pointer to the caller allocated USB Union Functional Descriptor.
Return values
EFI_SUCCESSThe USB Union Functional descriptor was retrieved successfully.
EFI_INVALID_PARAMETERUsbUnionFunDescriptor is NULL.
EFI_NOT_FOUNDThe USB Union Functional descriptor was not found.

Definition at line 567 of file UsbRndisFunction.c.

◆ InterruptCallback()

EFI_STATUS EFIAPI InterruptCallback ( IN VOID *  Data,
IN UINTN  DataLength,
IN VOID *  Context,
IN UINT32  Status 
)

Async USB transfer callback routine.

Parameters
[in]DataData received or sent via the USB Asynchronous Transfer, if the transfer completed successfully.
[in]DataLengthThe length of Data received or sent via the Asynchronous Transfer, if transfer successfully completes.
[in]ContextData passed from UsbAsyncInterruptTransfer() request.
[in]StatusIndicates the result of the asynchronous transfer.
Return values
EFI_SUCCESSThe asynchronous USB transfer request has been successfully executed.
EFI_DEVICE_ERRORThe asynchronous USB transfer request failed.

Definition at line 239 of file UsbRndisFunction.c.

◆ LoadAllDescriptor()

EFI_STATUS LoadAllDescriptor ( IN EFI_USB_IO_PROTOCOL UsbIo,
OUT EFI_USB_CONFIG_DESCRIPTOR **  ConfigDesc 
)

Load All of device descriptor.

Parameters
[in]UsbIoA pointer to the EFI_USB_IO_PROTOCOL instance.
[out]ConfigDescA pointer to the configuration descriptor.
Return values
EFI_SUCCESSThe request executed successfully.
EFI_OUT_OF_RESOURCESThe request could not be completed because the buffer specified by DescriptorLength and Descriptor is not large enough to hold the result of the request.
EFI_TIMEOUTA timeout occurred executing the request.
EFI_DEVICE_ERRORThe request failed due to a device error. The transfer status is returned in Status.

Definition at line 29 of file UsbRndisFunction.c.

◆ NextDescriptor()

BOOLEAN NextDescriptor ( IN EFI_USB_CONFIG_DESCRIPTOR Desc,
IN OUT UINTN Offset 
)

Returns pointer to the next descriptor for the pack of USB descriptors located in continues memory segment

Parameters
[in]DescA pointer to the CONFIG_DESCRIPTOR instance.
[in,out]OffsetA pointer to the sum of descriptor length.
Return values
TRUEThe request executed successfully.
FALSENo next descriptor.

Definition at line 77 of file UsbRndisFunction.c.

◆ PrintRndisMsg()

VOID PrintRndisMsg ( IN REMOTE_NDIS_MSG_HEADER RndisMsg)

Prints RNDIS Header and Data

Parameters
[in]RndisMsgA pointer to the REMOTE_NDIS_MSG_HEADER data.

Definition at line 1635 of file UsbRndisFunction.c.

◆ ReadRndisResponseInterrupt()

EFI_STATUS EFIAPI ReadRndisResponseInterrupt ( IN USB_RNDIS_DEVICE UsbRndisDevice)

This function is used to read USB interrupt transfer before the response RNDIS message.

Parameters
[in]UsbRndisDeviceA pointer to the USB_RNDIS_DEVICE instance.
Return values
EFI_SUCCESSThe USB interrupt transfer has been successfully executed.
EFI_DEVICE_ERRORThe USB interrupt transfer failed.

Definition at line 344 of file UsbRndisFunction.c.

◆ RndisControlMsg()

EFI_STATUS RndisControlMsg ( IN USB_RNDIS_DEVICE UsbRndisDevice,
IN REMOTE_NDIS_MSG_HEADER RndisMsg,
OUT REMOTE_NDIS_MSG_HEADER RndisMsgResponse 
)

This function send the RNDIS command through the device's control endpoint

Parameters
[in]UsbRndisDeviceA pointer to the USB_RNDIS_DEVICE instance.
[in]RndisMsgA pointer to the REMOTE_NDIS_MSG_HEADER data.
[out]RndisMsgResponseA pointer to the REMOTE_NDIS_MSG_HEADER data for getting responses.
Return values
EFI_SUCCESSThe bulk transfer has been successfully executed.

Definition at line 1433 of file UsbRndisFunction.c.

◆ RndisDummyReturn()

EFI_STATUS EFIAPI RndisDummyReturn ( IN PXE_CDB Cdb,
IN NIC_DATA Nic 
)

This is a dummy function which just returns. Unimplemented EDKII_USB_ETHERNET_PROTOCOL functions point to this function.

Parameters
[in]CdbA pointer to the command descriptor block.
[in]NicA pointer to the Network interface controller data.
Return values
EFI_SUCCESSThe request executed successfully.

Definition at line 1413 of file UsbRndisFunction.c.

◆ RndisReceiveDataMsg()

EFI_STATUS RndisReceiveDataMsg ( IN USB_RNDIS_DEVICE UsbRndisDevice,
IN OUT REMOTE_NDIS_MSG_HEADER RndisMsg,
IN OUT UINTN TransferLength 
)

This function send the RNDIS command through the device's Data endpoint

Parameters
[in]UsbRndisDeviceA pointer to the USB_RNDIS_DEVICE instance.
[in,out]RndisMsgA pointer to the REMOTE_NDIS_MSG_HEADER to send out.
[in,out]TransferLengthThe length of the RndisMsg data to transfer.
Return values
EFI_SUCCESSThe request executed successfully.

Definition at line 1581 of file UsbRndisFunction.c.

◆ RndisTransmitDataMsg()

EFI_STATUS RndisTransmitDataMsg ( IN USB_RNDIS_DEVICE UsbRndisDevice,
IN REMOTE_NDIS_MSG_HEADER RndisMsg,
IN OUT UINTN TransferLength 
)

This function send the RNDIS command through the device's Data endpoint

Parameters
[in]UsbRndisDeviceA pointer to the USB_RNDIS_DEVICE instance.
[in]RndisMsgA pointer to the REMOTE_NDIS_MSG_HEADER to send out.
[in,out]TransferLengthThe length of the RndisMsg data to transfer.
Return values
EFI_SUCCESSThe request executed successfully.

Definition at line 1539 of file UsbRndisFunction.c.

◆ RndisUndiGetConfigInfo()

EFI_STATUS EFIAPI RndisUndiGetConfigInfo ( IN PXE_CDB Cdb,
IN NIC_DATA Nic 
)

This function is called when RndisUndiGetConfigInfo is invoked.

Parameters
[in]CdbA pointer to the command descriptor block.
[in]NicA pointer to the Network interface controller data.
Return values
EFI_SUCCESSThe request executed successfully.

Definition at line 1042 of file UsbRndisFunction.c.

◆ RndisUndiGetInitInfo()

EFI_STATUS EFIAPI RndisUndiGetInitInfo ( IN PXE_CDB Cdb,
IN NIC_DATA Nic 
)

This function is called when UndiGetInitInfo is invoked.

Parameters
[in]CdbA pointer to the command descriptor block.
[in]NicA pointer to the Network interface controller data.
Return values
EFI_SUCCESSThe request executed successfully.

Definition at line 1004 of file UsbRndisFunction.c.

◆ RndisUndiGetStatus()

EFI_STATUS EFIAPI RndisUndiGetStatus ( IN PXE_CDB Cdb,
IN NIC_DATA Nic 
)

Update the Media connection.

Parameters
[in]CdbA pointer to the command descriptor block.
[in]NicA pointer to the Network interface controller data.
Return values
EFI_SUCCESSThe request executed successfully.

Definition at line 1218 of file UsbRndisFunction.c.

◆ RndisUndiInitialize()

EFI_STATUS EFIAPI RndisUndiInitialize ( IN PXE_CDB Cdb,
IN NIC_DATA Nic 
)

This function is called when UndiInitialize is invoked.

Parameters
[in]CdbA pointer to the command descriptor block.
[in]NicA pointer to the Network interface controller data.
Return values
EFI_SUCCESSThe request executed successfully.
EFI_UNSUPPORTEDNot supported.

Definition at line 1063 of file UsbRndisFunction.c.

◆ RndisUndiReceive()

EFI_STATUS EFIAPI RndisUndiReceive ( IN PXE_CDB Cdb,
IN EDKII_USB_ETHERNET_PROTOCOL This,
IN OUT VOID *  BulkInData,
IN OUT UINTN DataLength 
)

Receives and removes RNDIS header and returns the raw data.

Parameters
[in]CdbA pointer to the command descriptor block.
[in]ThisA pointer to the EDKII_USB_ETHERNET_PROTOCOL instance.
[in,out]BulkInDataA pointer to the buffer of data that will be transmitted to USB device or received from USB device.
[in,out]DataLengthA pointer to the PacketLength.
Return values
EFI_SUCCESSThe request executed successfully.
EFI_BUFFER_TOO_SMALLThe user provided buffer is too small
EFI_NOT_FOUNDNo buffer was found in the list.

Definition at line 1304 of file UsbRndisFunction.c.

◆ RndisUndiReceiveFilter()

EFI_STATUS EFIAPI RndisUndiReceiveFilter ( IN PXE_CDB Cdb,
IN NIC_DATA Nic 
)

Updates Filter settings on the device.

Parameters
[in]CdbA pointer to the command descriptor block.
[in]NicA pointer to the Network interface controller data.
Return values
EFI_STATUS

Definition at line 825 of file UsbRndisFunction.c.

◆ RndisUndiReset()

EFI_STATUS EFIAPI RndisUndiReset ( IN PXE_CDB Cdb,
IN NIC_DATA Nic 
)

This function is called when UndiReset is invoked.

Parameters
[in]CdbA pointer to the command descriptor block.
[in]NicA pointer to the Network interface controller data.
Return values
EFI_SUCCESSThe request executed successfully.
EFI_DEVICE_ERRORThe request failed due to a device error.

Definition at line 1130 of file UsbRndisFunction.c.

◆ RndisUndiShutdown()

EFI_STATUS EFIAPI RndisUndiShutdown ( IN PXE_CDB Cdb,
IN NIC_DATA Nic 
)

This function is called when UndiShutdown is invoked.

Parameters
[in]CdbA pointer to the command descriptor block.
[in]NicA pointer to the Network interface controller data.
Return values
EFI_SUCCESSThe request executed successfully.

Definition at line 1177 of file UsbRndisFunction.c.

◆ RndisUndiStart()

EFI_STATUS EFIAPI RndisUndiStart ( IN PXE_CDB Cdb,
IN NIC_DATA Nic 
)

This function is called when UndiStart is invoked.

Parameters
[in]CdbA pointer to the command descriptor block.
[in]NicA pointer to the Network interface controller data.
Return values
EFI_SUCCESSThe request executed successfully.

Definition at line 949 of file UsbRndisFunction.c.

◆ RndisUndiStop()

EFI_STATUS EFIAPI RndisUndiStop ( IN PXE_CDB Cdb,
IN NIC_DATA Nic 
)

This function is called when Undistop is invoked.

Parameters
[in]CdbA pointer to the command descriptor block.
[in]NicA pointer to the Network interface controller data.
Return values
EFI_SUCCESSThe request executed successfully.

Definition at line 984 of file UsbRndisFunction.c.

◆ RndisUndiTransmit()

EFI_STATUS EFIAPI RndisUndiTransmit ( IN PXE_CDB Cdb,
IN EDKII_USB_ETHERNET_PROTOCOL This,
IN VOID *  BulkOutData,
IN OUT UINTN DataLength 
)

Transmit the data after appending RNDIS header.

Parameters
[in]CdbA pointer to the command descriptor block.
[in]ThisA pointer to the EDKII_USB_ETHERNET_PROTOCOL instance.
[in]BulkOutDataA pointer to the buffer of data that will be transmitted to USB device or received from USB device.
[in,out]DataLengthA pointer to the PacketLength.
Return values
EFI_SUCCESSThe request executed successfully.

Definition at line 1241 of file UsbRndisFunction.c.

◆ SetUsbRndisMcastFilter()

EFI_STATUS EFIAPI SetUsbRndisMcastFilter ( IN EDKII_USB_ETHERNET_PROTOCOL This,
IN UINT16  Value,
IN VOID *  McastAddr 
)

This request sets the Ethernet device multicast filters as specified in the sequential list of 48 bit Ethernet multicast addresses.

Parameters
[in]ThisA pointer to the EDKII_USB_ETHERNET_PROTOCOL instance.
[in]ValueNumber of filters.
[in]McastAddrA pointer to the value of the multicast addresses.
Return values
EFI_SUCCESSThe request executed successfully.
EFI_TIMEOUTA timeout occurred executing the request.
EFI_DEVICE_ERRORThe request failed due to a device error.
EFI_INVALID_PARAMETEROne of the parameters has an invalid value.
EFI_UNSUPPORTEDNot supported.

Definition at line 645 of file UsbRndisFunction.c.

◆ SetUsbRndisPacketFilter()

EFI_STATUS EFIAPI SetUsbRndisPacketFilter ( IN EDKII_USB_ETHERNET_PROTOCOL This,
IN UINT16  Value 
)

This request is used to configure device Ethernet packet filter settings.

Parameters
[in]ThisA pointer to the EDKII_USB_ETHERNET_PROTOCOL instance.
[in]ValuePacket Filter Bitmap.
Return values
EFI_SUCCESSThe request executed successfully.
EFI_TIMEOUTA timeout occurred executing the request.
EFI_DEVICE_ERRORThe request failed due to a device error.
EFI_INVALID_PARAMETEROne of the parameters has an invalid value.
EFI_UNSUPPORTEDNot supported.

Definition at line 905 of file UsbRndisFunction.c.

◆ SetUsbRndisPowerFilter()

EFI_STATUS EFIAPI SetUsbRndisPowerFilter ( IN EDKII_USB_ETHERNET_PROTOCOL This,
IN UINT16  Value,
IN UINT16  Length,
IN VOID *  PatternFilter 
)

This request sets up the specified Ethernet power management pattern filter as described in the data structure.

Parameters
[in]ThisA pointer to the EDKII_USB_ETHERNET_PROTOCOL instance.
[in]ValueNumber of filters.
[in]LengthSize of the power management pattern filter data.
[in]PatternFilterA pointer to the power management pattern filter structure.
Return values
EFI_SUCCESSThe request executed successfully.
EFI_TIMEOUTA timeout occurred executing the request.
EFI_DEVICE_ERRORThe request failed due to a device error.
EFI_INVALID_PARAMETEROne of the parameters has an invalid value.
EFI_UNSUPPORTEDNot supported.

Definition at line 703 of file UsbRndisFunction.c.

◆ UsbEthBulkSize()

EFI_STATUS EFIAPI UsbEthBulkSize ( IN EDKII_USB_ETHERNET_PROTOCOL This,
OUT UINTN BulkSize 
)

Retrieves the USB Ethernet Bulk transfer data size.

Parameters
[in]ThisA pointer to the EDKII_USB_ETHERNET_PROTOCOL instance.
[out]BulkSizeA pointer to the Bulk transfer data size.
Return values
EFI_SUCCESSThe bulk transfer data size was retrieved successfully.
otherFailed to retrieve the bulk transfer data size.

Definition at line 473 of file UsbRndisFunction.c.

◆ UsbRndisInterrupt()

EFI_STATUS EFIAPI UsbRndisInterrupt ( IN EDKII_USB_ETHERNET_PROTOCOL This,
IN BOOLEAN  IsNewTransfer,
IN UINTN  PollingInterval,
IN EFI_USB_DEVICE_REQUEST Requst 
)

This function is used to manage a USB device with an interrupt transfer pipe.

Parameters
[in]ThisA pointer to the EDKII_USB_ETHERNET_PROTOCOL instance.
[in]IsNewTransferIf TRUE, a new transfer will be submitted to USB controller. If FALSE, the interrupt transfer is deleted from the device's interrupt transfer queue.
[in]PollingIntervalIndicates the periodic rate, in milliseconds, that the transfer is to be executed.This parameter is required when IsNewTransfer is TRUE. The value must be between 1 to 255, otherwise EFI_INVALID_PARAMETER is returned. The units are in milliseconds.
[in]RequstA pointer to the EFI_USB_DEVICE_REQUEST data.
Return values
EFI_SUCCESSThe asynchronous USB transfer request transfer has been successfully executed.
EFI_DEVICE_ERRORThe asynchronous USB transfer request failed.

Definition at line 280 of file UsbRndisFunction.c.

Variable Documentation

◆ gBlockBulkInCnt

UINT16 gBlockBulkInCnt = 0

Definition at line 12 of file UsbRndisFunction.c.

◆ gStopBulkInCnt

UINT16 gStopBulkInCnt = 0

Definition at line 11 of file UsbRndisFunction.c.

◆ gTable

BIT_MAP gTable[]
Initial value:
= {
{ PXE_OPFLAGS_RECEIVE_FILTER_UNICAST, NDIS_PACKET_TYPE_DIRECTED },
{ PXE_OPFLAGS_RECEIVE_FILTER_BROADCAST, NDIS_PACKET_TYPE_BROADCAST },
{ PXE_OPFLAGS_RECEIVE_FILTER_FILTERED_MULTICAST, NDIS_PACKET_TYPE_MULTICAST },
{ PXE_OPFLAGS_RECEIVE_FILTER_PROMISCUOUS, NDIS_PACKET_TYPE_PROMISCUOUS },
{ PXE_OPFLAGS_RECEIVE_FILTER_ALL_MULTICAST, NDIS_PACKET_TYPE_ALL_MULTICAST },
}
#define PXE_OPFLAGS_RECEIVE_FILTER_UNICAST
Definition: UefiPxe.h:284
#define PXE_OPFLAGS_RECEIVE_FILTER_PROMISCUOUS
Definition: UefiPxe.h:302
#define PXE_OPFLAGS_RECEIVE_FILTER_FILTERED_MULTICAST
Definition: UefiPxe.h:297
#define PXE_OPFLAGS_RECEIVE_FILTER_ALL_MULTICAST
Definition: UefiPxe.h:308
#define PXE_OPFLAGS_RECEIVE_FILTER_BROADCAST
Definition: UefiPxe.h:290

Definition at line 779 of file UsbRndisFunction.c.