34 UINT8 BulkOutEndpoint;
35 UINT8 InterrupEndpoint;
39 UINT32 MaxPacketsPerTransfer;
40 UINT32 MaxTransferSize;
41 UINT32 PacketAlignmentFactor;
45#define USB_RNDIS_DRIVER_VERSION 1
46#define USB_TX_ETHERNET_BULK_TIMEOUT 3000
47#define USB_RX_ETHERNET_BULK_TIMEOUT 3
48#define USB_ETHERNET_TRANSFER_TIMEOUT 200
50#define LAN_BULKIN_CMD_CONTROL 1
51#define MAXIMUM_STOPBULKIN_CNT 300
52#define MINIMUM_STOPBULKIN_CNT 3
53#define BULKIN_CMD_POLLING_CNT 300
54#define RNDIS_RESERVED_BYTE_LENGTH 8
56#define USB_RNDIS_SIGNATURE SIGNATURE_32('r', 'n', 'd', 's')
57#define USB_RNDIS_DEVICE_FROM_THIS(a) CR (a, USB_RNDIS_DEVICE, UsbEth, USB_RNDIS_SIGNATURE)
106 IN UINT8 FunDescriptorType,
120 IN BOOLEAN IsNewTransfer,
195 IN VOID *BulkOutData,
204 IN OUT VOID *BulkInData,
271 IN VOID *PatternFilter
276GetUsbRndisPowerFilter (
279 IN BOOLEAN *PatternActive
305RndisTransmitDataMsg (
308 UINTN *TransferLength
315 UINTN *TransferLength
323#define RNDIS_MAJOR_VERSION 0x00000001
324#define RNDIS_MINOR_VERSION 0x00000000
325#define RNDIS_MAX_TRANSFER_SIZE 0x4000
327#define RNDIS_PACKET_MSG 0x00000001
328#define RNDIS_INITIALIZE_MSG 0x00000002
329#define RNDIS_INITIALIZE_CMPLT 0x80000002
330#define RNDIS_HLT_MSG 0x00000003
331#define RNDIS_QUERY_MSG 0x00000004
332#define RNDIS_QUERY_CMPLT 0x80000004
333#define RNDIS_SET_MSG 0x00000005
334#define RNDIS_SET_CMPLT 0x80000005
335#define RNDIS_RESET_MSG 0x00000006
336#define RNDIS_RESET_CMPLT 0x80000006
337#define RNDIS_INDICATE_STATUS_MSG 0x00000007
338#define RNDIS_KEEPALIVE_MSG 0x00000008
339#define RNDIS_KEEPALIVE_CMPLT 0x80000008
341#define RNDIS_STATUS_SUCCESS 0x00000000
342#define RNDIS_STATUS_FAILURE 0xC0000001
343#define RNDIS_STATUS_INVALID_DATA 0xC0010015
344#define RNDIS_STATUS_NOT_SUPPORTED 0xC00000BB
345#define RNDIS_STATUS_MEDIA_CONNECT 0x4001000B
346#define RNDIS_STATUS_MEDIA_DISCONNECT 0x4001000C
348#define RNDIS_CONTROL_TIMEOUT 10000
349#define RNDIS_KEEPALIVE_TIMEOUT 5000
351#define SEND_ENCAPSULATED_COMMAND 0x00000000
352#define GET_ENCAPSULATED_RESPONSE 0x00000001
358#define OID_GEN_SUPPORTED_LIST 0x00010101
359#define OID_GEN_HARDWARE_STATUS 0x00010102
360#define OID_GEN_MEDIA_SUPPORTED 0x00010103
361#define OID_GEN_MEDIA_IN_USE 0x00010104
362#define OID_GEN_MAXIMUM_LOOKAHEAD 0x00010105
363#define OID_GEN_MAXIMUM_FRAME_SIZE 0x00010106
364#define OID_GEN_LINK_SPEED 0x00010107
365#define OID_GEN_TRANSMIT_BUFFER_SPACE 0x00010108
366#define OID_GEN_RECEIVE_BUFFER_SPACE 0x00010109
367#define OID_GEN_TRANSMIT_BLOCK_SIZE 0x0001010A
368#define OID_GEN_RECEIVE_BLOCK_SIZE 0x0001010B
369#define OID_GEN_VENDOR_ID 0x0001010C
370#define OID_GEN_VENDOR_DESCRIPTION 0x0001010D
371#define OID_GEN_CURRENT_PACKET_FILTER 0x0001010E
372#define OID_GEN_CURRENT_LOOKAHEAD 0x0001010F
373#define OID_GEN_DRIVER_VERSION 0x00010110
374#define OID_GEN_MAXIMUM_TOTAL_SIZE 0x00010111
375#define OID_GEN_PROTOCOL_OPTIONS 0x00010112
376#define OID_GEN_MAC_OPTIONS 0x00010113
377#define OID_GEN_MEDIA_CONNECT_STATUS 0x00010114
378#define OID_GEN_MAXIMUM_SEND_PACKETS 0x00010115
379#define OID_GEN_VENDOR_DRIVER_VERSION 0x00010116
381#define OID_GEN_XMIT_OK 0x00020101
382#define OID_GEN_RCV_OK 0x00020102
383#define OID_GEN_XMIT_ERROR 0x00020103
384#define OID_GEN_RCV_ERROR 0x00020104
385#define OID_GEN_RCV_NO_BUFFER 0x00020105
387#define OID_GEN_DIRECTED_BYTES_XMIT 0x00020201
388#define OID_GEN_DIRECTED_FRAMES_XMIT 0x00020202
389#define OID_GEN_MULTICAST_BYTES_XMIT 0x00020203
390#define OID_GEN_MULTICAST_FRAMES_XMIT 0x00020204
391#define OID_GEN_BROADCAST_BYTES_XMIT 0x00020205
392#define OID_GEN_BROADCAST_FRAMES_XMIT 0x00020206
393#define OID_GEN_DIRECTED_BYTES_RCV 0x00020207
394#define OID_GEN_DIRECTED_FRAMES_RCV 0x00020208
395#define OID_GEN_MULTICAST_BYTES_RCV 0x00020209
396#define OID_GEN_MULTICAST_FRAMES_RCV 0x0002020A
397#define OID_GEN_BROADCAST_BYTES_RCV 0x0002020B
398#define OID_GEN_BROADCAST_FRAMES_RCV 0x0002020C
399#define OID_GEN_RCV_CRC_ERROR 0x0002020D
400#define OID_GEN_TRANSMIT_QUEUE_LENGTH 0x0002020E
402#define OID_802_3_CURRENT_ADDRESS 0x01010102
406#define NDIS_PACKET_TYPE_DIRECTED 0x0001
407#define NDIS_PACKET_TYPE_MULTICAST 0x0002
408#define NDIS_PACKET_TYPE_ALL_MULTICAST 0x0004
409#define NDIS_PACKET_TYPE_BROADCAST 0x0008
410#define NDIS_PACKET_TYPE_SOURCE_ROUTING 0x0010
411#define NDIS_PACKET_TYPE_PROMISCUOUS 0x0020
412#define NDIS_PACKET_TYPE_SMT 0x0040
413#define NDIS_PACKET_TYPE_ALL_LOCAL 0x0080
414#define NDIS_PACKET_TYPE_MAC_FRAME 0x8000
415#define NDIS_PACKET_TYPE_FUNCTIONAL 0x4000
416#define NDIS_PACKET_TYPE_ALL_FUNCTIONAL 0x2000
417#define NDIS_PACKET_TYPE_GROUP 0x1000
423 UINT32 MessageLength;
428 UINT32 MessageLength;
432 UINT32 MaxTransferSize;
437 UINT32 MessageLength;
443 UINT32 MessageLength;
446 UINT32 InformationBufferLength;
447 UINT32 InformationBufferOffset;
463 UINT32 MessageLength;
466 UINT32 InformationBufferLength;
467 UINT32 InformationBufferOffset;
473 UINT32 MessageLength;
479 UINT32 MessageLength;
481 UINT32 StatusBufferLength;
482 UINT32 StatusBufferOffset;
492 UINT32 MessageLength;
498 UINT32 MessageLength;
505 UINT32 MaxPacketsPerTransfer;
506 UINT32 MaxTransferSize;
507 UINT32 PacketAlignmentFactor;
513 UINT32 MessageLength;
516 UINT32 InformationBufferLength;
517 UINT32 InformationBufferOffset;
532 UINT32 MessageLength;
539 UINT32 MessageLength;
541 UINT32 AddressingReset;
546 UINT32 MessageLength;
553 UINT32 MessageLength;
556 UINT32 OutOfBandDataOffset;
557 UINT32 OutOfBandDataLength;
558 UINT32 NumOutOfBandDataElements;
559 UINT32 PerPacketInfoOffset;
560 UINT32 PerPacketInfoLength;
568 UINT32 ClassInformationOffset;
574 UINT32 ClassInformationOffset;
580 UINTN RemainingLength;
581 UINT8 *PacketStartBuffer;
EFI_STATUS EFIAPI GetUsbEthMacAddress(IN EDKII_USB_ETHERNET_PROTOCOL *This, OUT EFI_MAC_ADDRESS *MacAddress)
EFI_STATUS EFIAPI InterruptCallback(IN VOID *Data, IN UINTN DataLength, IN VOID *Context, IN UINT32 Status)
EFI_STATUS GetFunctionalDescriptor(IN EFI_USB_CONFIG_DESCRIPTOR *Config, IN UINT8 FunDescriptorType, OUT VOID *DataBuffer)
EFI_STATUS EFIAPI GetUsbRndisFunDescriptor(IN EDKII_USB_ETHERNET_PROTOCOL *This, OUT USB_ETHERNET_FUN_DESCRIPTOR *UsbEthFunDescriptor)
EFI_STATUS EFIAPI RndisUndiShutdown(IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
EFI_STATUS EFIAPI RndisUndiReceiveFilter(IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
EFI_STATUS EFIAPI UsbRndisDriverSupported(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
EFI_STATUS EFIAPI RndisUndiStop(IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
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 SetUsbRndisPacketFilter(IN EDKII_USB_ETHERNET_PROTOCOL *This, IN UINT16 Value)
EFI_STATUS EFIAPI RndisUndiReset(IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
EFI_STATUS EFIAPI RndisUndiGetConfigInfo(IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
EFI_STATUS LoadAllDescriptor(IN EFI_USB_IO_PROTOCOL *UsbIo, OUT EFI_USB_CONFIG_DESCRIPTOR **ConfigDesc)
EFI_STATUS EFIAPI SetUsbRndisMcastFilter(IN EDKII_USB_ETHERNET_PROTOCOL *This, IN UINT16 Value, IN VOID *McastAddr)
EFI_STATUS EFIAPI UsbRndisDriverStart(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath)
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 UsbEthBulkSize(IN EDKII_USB_ETHERNET_PROTOCOL *This, OUT UINTN *BulkSize)
EFI_STATUS EFIAPI RndisDummyReturn(IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
EFI_STATUS EFIAPI RndisUndiGetStatus(IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
EFI_STATUS EFIAPI RndisUndiInitialize(IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
EFI_STATUS EFIAPI GetUsbHeaderFunDescriptor(IN EDKII_USB_ETHERNET_PROTOCOL *This, OUT USB_HEADER_FUN_DESCRIPTOR *UsbHeaderFunDescriptor)
EFI_STATUS EFIAPI RndisUndiGetInitInfo(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 EFIAPI RndisUndiStart(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 SetUsbRndisPowerFilter(IN EDKII_USB_ETHERNET_PROTOCOL *This, IN UINT16 Value, IN UINT16 Length, IN VOID *PatternFilter)
VOID PrintRndisMsg(IN REMOTE_NDIS_MSG_HEADER *RndisMsg)
VOID GetEndpoint(IN EFI_USB_IO_PROTOCOL *UsbIo, IN OUT USB_RNDIS_DEVICE *UsbRndisDevice)
EFI_STATUS EFIAPI UsbRndisDriverStop(IN EFI_DRIVER_BINDING_PROTOCOL *This, IN EFI_HANDLE ControllerHandle, IN UINTN NumberOfChildren, IN EFI_HANDLE *ChildHandleBuffer)
EFI_STATUS EFIAPI GetUsbUnionFunDescriptor(IN EDKII_USB_ETHERNET_PROTOCOL *This, OUT USB_UNION_FUN_DESCRIPTOR *UsbUnionFunDescriptor)
BOOLEAN NextDescriptor(IN EFI_USB_CONFIG_DESCRIPTOR *Desc, IN OUT UINTN *Offset)