11UINT16 gStopBulkInCnt = 0;
12UINT16 gBlockBulkInCnt = 0;
38 Status = UsbIo->UsbGetConfigDescriptor (UsbIo, &Tmp);
39 if (EFI_ERROR (Status)) {
40 DEBUG ((DEBUG_ERROR,
"%a:UsbGetConfigDescriptor status = %r\n", __func__, Status));
44 Status =
gBS->AllocatePool (
49 if (EFI_ERROR (Status)) {
50 DEBUG ((DEBUG_ERROR,
"%a: AllocatePool status = %r\n", __func__, Status));
56 USB_DESC_TYPE_CONFIG << 8 | (Tmp.ConfigurationValue - 1),
82 if ((Desc ==
NULL) || (*Offset >= Desc->TotalLength)) {
91 if ( *Offset >= Desc->TotalLength ) {
114 IN UINT8 FunDescriptorType,
122 Status = EFI_NOT_FOUND;
126 if (Interface->DescriptorType == USB_DESC_TYPE_CS_INTERFACE) {
128 switch (FunDescriptorType) {
129 case HEADER_FUN_DESCRIPTOR:
136 case UNION_FUN_DESCRIPTOR:
143 case ETHERNET_FUN_DESCRIPTOR:
151 Status = EFI_UNSUPPORTED;
180 Status = UsbIo->UsbGetInterfaceDescriptor (UsbIo, &Interface);
181 if (EFI_ERROR (Status)) {
182 DEBUG ((DEBUG_ERROR,
"%a:UsbGetInterfaceDescriptor status = %r\n", __func__, Status));
186 if (Interface.NumEndpoints == 0 ) {
188 if (EFI_ERROR (Status)) {
189 DEBUG ((DEBUG_ERROR,
"%a:UsbSetInterface status = %r\n", __func__, Status));
193 Status = UsbIo->UsbGetInterfaceDescriptor (UsbIo, &Interface);
194 if (EFI_ERROR (Status)) {
195 DEBUG ((DEBUG_ERROR,
"%a:UsbGetInterfaceDescriptor status = %r\n", __func__, Status));
200 for (Index = 0; Index < Interface.NumEndpoints; Index++) {
201 Status = UsbIo->UsbGetEndpointDescriptor (UsbIo, Index, &Endpoint);
202 if (EFI_ERROR (Status)) {
203 DEBUG ((DEBUG_ERROR,
"%a:UsbGetEndpointDescriptor status = %r\n", __func__, Status));
207 switch ((Endpoint.Attributes & (BIT0 | BIT1))) {
208 case USB_ENDPOINT_BULK:
209 if (Endpoint.EndpointAddress & BIT7) {
210 UsbRndisDevice->BulkInEndpoint = Endpoint.EndpointAddress;
212 UsbRndisDevice->BulkOutEndpoint = Endpoint.EndpointAddress;
216 case USB_ENDPOINT_INTERRUPT:
217 UsbRndisDevice->InterrupEndpoint = Endpoint.EndpointAddress;
246 if ((Data ==
NULL) || (Context ==
NULL)) {
247 return EFI_INVALID_PARAMETER;
282 IN BOOLEAN IsNewTransfer,
291 UsbRndisDevice = USB_RNDIS_DEVICE_FROM_THIS (This);
296 Status = UsbRndisDevice->UsbIo->UsbAsyncInterruptTransfer (
297 UsbRndisDevice->UsbIo,
298 UsbRndisDevice->InterrupEndpoint,
306 if (Status == EFI_INVALID_PARAMETER) {
308 Status = UsbRndisDevice->UsbIo->UsbAsyncInterruptTransfer (
309 UsbRndisDevice->UsbIo,
310 UsbRndisDevice->InterrupEndpoint,
319 Status = UsbRndisDevice->UsbIo->UsbAsyncInterruptTransfer (
320 UsbRndisDevice->UsbIo,
321 UsbRndisDevice->InterrupEndpoint,
357 Status = UsbRndisDevice->UsbIo->UsbSyncInterruptTransfer (
358 UsbRndisDevice->UsbIo,
359 UsbRndisDevice->InterrupEndpoint,
400 UsbRndisDevice = USB_RNDIS_DEVICE_FROM_THIS (This);
405 RndisQueryMsg.QueryMsg.MessageType = RNDIS_QUERY_MSG;
407 RndisQueryMsg.QueryMsg.RequestID = UsbRndisDevice->RequestId;
408 RndisQueryMsg.QueryMsg.Oid = OID_802_3_CURRENT_ADDRESS;
410 RndisQueryMsgCmplt.QueryCmplt.MessageType = RNDIS_QUERY_CMPLT;
418 if (!EFI_ERROR (Status)) {
419 DEBUG ((DEBUG_INFO,
"Success to get Mac address from RNDIS message.\n"));
420 for (Index = 0; Index < PXE_HWADDR_LEN_ETHER; Index++) {
421 MacAddress->Addr[Index] = RndisQueryMsgCmplt.Addr[Index];
424 UsbRndisDevice->RequestId++;
430 Status = This->UsbEthFunDescriptor (This, &UsbEthDescriptor);
431 if (EFI_ERROR (Status)) {
432 DEBUG ((DEBUG_ERROR,
"%a:UsbEthFunDescriptor status = %r\n", __func__, Status));
436 Status = UsbRndisDevice->UsbIo->UsbGetStringDescriptor (
437 UsbRndisDevice->UsbIo,
439 UsbEthDescriptor.MacAddress,
442 if (EFI_ERROR (Status)) {
443 DEBUG ((DEBUG_ERROR,
"%a:UsbGetStringDescriptor status = %r\n", __func__, Status));
448 for (Index = 0; Index < PXE_HWADDR_LEN_ETHER; Index++) {
449 CopyMem (TmpStr, DataPtr,
sizeof (CHAR16));
452 CopyMem (TmpStr, DataPtr,
sizeof (CHAR16));
455 MacAddress->Addr[Index] = (Hi << 4) | Low;
485 UsbRndisDevice = USB_RNDIS_DEVICE_FROM_THIS (This);
490 RndisQueryMsg.QueryMsg.MessageType = RNDIS_QUERY_MSG;
492 RndisQueryMsg.QueryMsg.RequestID = UsbRndisDevice->RequestId;
493 RndisQueryMsg.QueryMsg.Oid = OID_GEN_MAXIMUM_TOTAL_SIZE;
495 RndisQueryMsgCmplt.QueryCmplt.MessageType = RNDIS_QUERY_CMPLT;
503 if (!EFI_ERROR (Status)) {
504 DEBUG ((DEBUG_INFO,
"Success to get Max Total size : %X \n", RndisQueryMsgCmplt.MaxTotalSize));
505 *BulkSize = RndisQueryMsgCmplt.MaxTotalSize;
506 UsbRndisDevice->RequestId++;
510 Status = This->UsbEthFunDescriptor (This, &UsbEthFunDescriptor);
511 if (EFI_ERROR (Status)) {
515 *BulkSize = (
UINTN)UsbEthFunDescriptor.MaxSegmentSize;
540 UsbRndisDevice = USB_RNDIS_DEVICE_FROM_THIS (This);
542 if (UsbHeaderFunDescriptor ==
NULL) {
543 return EFI_INVALID_PARAMETER;
547 UsbRndisDevice->Config,
548 HEADER_FUN_DESCRIPTOR,
549 UsbHeaderFunDescriptor
575 UsbRndisDevice = USB_RNDIS_DEVICE_FROM_THIS (This);
577 if (UsbUnionFunDescriptor ==
NULL) {
578 return EFI_INVALID_PARAMETER;
582 UsbRndisDevice->Config,
583 UNION_FUN_DESCRIPTOR,
584 UsbUnionFunDescriptor
614 UsbRndisDevice = USB_RNDIS_DEVICE_FROM_THIS (This);
616 if (UsbEthFunDescriptor ==
NULL) {
617 return EFI_INVALID_PARAMETER;
621 UsbRndisDevice->Config,
622 ETHERNET_FUN_DESCRIPTOR,
657 UsbRndisDevice = USB_RNDIS_DEVICE_FROM_THIS (This);
659 Status = This->UsbEthFunDescriptor (This, &UsbEthFunDescriptor);
660 if (EFI_ERROR (Status)) {
664 if ((UsbEthFunDescriptor.NumberMcFilters & MAC_FILTERS_MASK) == 0) {
665 return EFI_UNSUPPORTED;
668 Request.RequestType = USB_ETHERNET_SET_REQ_TYPE;
669 Request.Request = SET_ETH_MULTICAST_FILTERS_REQ;
670 Request.Value = Value;
671 Request.Index = UsbRndisDevice->NumOfInterface;
672 Request.Length = Value * 6;
674 return UsbRndisDevice->UsbIo->UsbControlTransfer (
675 UsbRndisDevice->UsbIo,
678 USB_ETHERNET_TRANSFER_TIMEOUT,
707 IN VOID *PatternFilter
714 UsbRndisDevice = USB_RNDIS_DEVICE_FROM_THIS (This);
716 Request.RequestType = USB_ETHERNET_SET_REQ_TYPE;
717 Request.Request = SET_ETH_POWER_MANAGEMENT_PATTERN_FILTER_REQ;
718 Request.Value = Value;
719 Request.Index = UsbRndisDevice->NumOfInterface;
720 Request.Length = Length;
722 return UsbRndisDevice->UsbIo->UsbControlTransfer (
723 UsbRndisDevice->UsbIo,
726 USB_ETHERNET_TRANSFER_TIMEOUT,
753 OUT BOOLEAN *PatternActive
760 UsbRndisDevice = USB_RNDIS_DEVICE_FROM_THIS (This);
762 Request.RequestType = USB_ETHERNET_GET_REQ_TYPE;
763 Request.Request = GET_ETH_POWER_MANAGEMENT_PATTERN_FILTER_REQ;
764 Request.Value = Value;
765 Request.Index = UsbRndisDevice->NumOfInterface;
766 Request.Length = USB_ETH_POWER_FILTER_LENGTH;
768 return UsbRndisDevice->UsbIo->UsbControlTransfer (
769 UsbRndisDevice->UsbIo,
772 USB_ETHERNET_TRANSFER_TIMEOUT,
774 USB_ETH_POWER_FILTER_LENGTH,
798 OUT UINT16 *CdcFilter
804 Count =
sizeof (gTable)/
sizeof (gTable[0]);
806 for (Index = 0; (Index < Count) && (gTable[Index].Src != 0); Index++) {
807 if (gTable[Index].Src & Value) {
808 *CdcFilter |= gTable[Index].Dst;
842 CpbAddr = Cdb->CPBaddr;
843 CpbSize = Cdb->CPBsize;
844 SetFilter = (UINT16)(Cdb->OpFlags & 0x1F);
852 Nic->McastCount = (UINT8)(CpbSize / PXE_MAC_LENGTH);
853 CopyMem (&Nic->McastList, Cpb, Nic->McastCount);
858 Nic->UsbEth->UsbEthFunDescriptor (Nic->UsbEth, &UsbEthFunDescriptor);
859 if ((UsbEthFunDescriptor.NumberMcFilters & MAC_FILTERS_MASK) == 0) {
861 DEBUG ((DEBUG_INFO,
"SetUsbEthPacketFilter Nic %lx Nic->UsbEth %lx ", Nic, Nic->UsbEth));
862 Nic->UsbEth->SetUsbEthPacketFilter (Nic->UsbEth, Nic->RxFilter);
865 if (EFI_ERROR (Status)) {
866 return PXE_STATCODE_INVALID_PARAMETER;
870 for (Index1 = 0; Index1 < Nic->McastCount; Index1++) {
871 for (Index2 = 0; Index2 < 6; Index2++) {
872 McastList[Count++] = Cpb->
MCastList[Index1][Index2];
879 Nic->UsbEth->SetUsbEthMcastFilter (Nic->UsbEth, Nic->McastCount, McastList);
882 Nic->UsbEth->SetUsbEthPacketFilter (Nic->UsbEth, Nic->RxFilter);
931 IN UINT16 FeatureSelector,
956 DEBUG ((DEBUG_INFO,
"RndisUndiStart Nic %lx Cdb %lx Nic State %x\n", Nic, Cdb, Nic->State));
960 if (EFI_ERROR (Status)) {
965 if (EFI_ERROR (Status)) {
989 DEBUG ((DEBUG_INFO,
"RndisUndiStop State %x\n", Nic->State));
1013 DEBUG ((DEBUG_INFO,
"RndisUndiGetInitInfo\n"));
1015 UsbEthDevice = Nic->UsbEth;
1016 UsbRndisDevice = USB_RNDIS_DEVICE_FROM_THIS (UsbEthDevice);
1047 DEBUG ((DEBUG_INFO,
"RndisUndiGetConfigInfo\n"));
1074 DEBUG ((DEBUG_INFO,
"RndisUndiInitialize\n"));
1076 UsbEthDriver = Nic->UsbEth;
1077 UsbRndisDevice = USB_RNDIS_DEVICE_FROM_THIS (UsbEthDriver);
1082 RndisInitMsg.MessageType = RNDIS_INITIALIZE_MSG;
1084 RndisInitMsg.RequestID = UsbRndisDevice->RequestId;
1085 RndisInitMsg.MajorVersion = RNDIS_MAJOR_VERSION;
1086 RndisInitMsg.MinorVersion = RNDIS_MINOR_VERSION;
1087 RndisInitMsg.MaxTransferSize = RNDIS_MAX_TRANSFER_SIZE;
1089 RndisInitMsgCmplt.MessageType = RNDIS_INITIALIZE_CMPLT;
1094 UsbRndisDevice->RequestId++;
1096 if (EFI_ERROR (Status) || (RndisInitMsgCmplt.Status & 0x80000000)) {
1101 if (RndisInitMsgCmplt.Medium) {
1102 return EFI_UNSUPPORTED;
1105 UsbRndisDevice->Medium = RndisInitMsgCmplt.Medium;
1106 UsbRndisDevice->MaxPacketsPerTransfer = RndisInitMsgCmplt.MaxPacketsPerTransfer;
1107 UsbRndisDevice->MaxTransferSize = RndisInitMsgCmplt.MaxTransferSize;
1108 UsbRndisDevice->PacketAlignmentFactor = RndisInitMsgCmplt.PacketAlignmentFactor;
1110 DEBUG ((DEBUG_INFO,
"Medium : %x \n", RndisInitMsgCmplt.Medium));
1111 DEBUG ((DEBUG_INFO,
"MaxPacketsPerTransfer : %x \n", RndisInitMsgCmplt.MaxPacketsPerTransfer));
1112 DEBUG ((DEBUG_INFO,
"MaxTransferSize : %x\n", RndisInitMsgCmplt.MaxTransferSize));
1113 DEBUG ((DEBUG_INFO,
"PacketAlignmentFactor : %x\n", RndisInitMsgCmplt.PacketAlignmentFactor));
1141 DEBUG ((DEBUG_INFO,
"RndisUndiReset\n"));
1143 UsbEthDriver = Nic->UsbEth;
1144 UsbRndisDevice = USB_RNDIS_DEVICE_FROM_THIS (UsbEthDriver);
1149 RndisResetMsg.MessageType = RNDIS_RESET_MSG;
1152 RndisResetCmplt.MessageType = RNDIS_RESET_CMPLT;
1157 UsbRndisDevice->RequestId = 1;
1159 if (EFI_ERROR (Status) || (RndisResetCmplt.Status & 0x80000000)) {
1160 return EFI_DEVICE_ERROR;
1187 DEBUG ((DEBUG_INFO,
"RndisUndiShutdown\n"));
1189 UsbEthDriver = Nic->UsbEth;
1190 UsbRndisDevice = USB_RNDIS_DEVICE_FROM_THIS (UsbEthDriver);
1194 RndisHltMsg.MessageType = RNDIS_HLT_MSG;
1199 if (Status == EFI_DEVICE_ERROR) {
1203 UsbRndisDevice->RequestId = 1;
1244 IN VOID *BulkOutData,
1251 UINTN TransferLength;
1253 DEBUG ((DEBUG_INFO,
"RndisUndiTransmit DataLength : %x\n", *DataLength));
1255 UsbRndisDevice = USB_RNDIS_DEVICE_FROM_THIS (This);
1258 if (RndisPacketMsg ==
NULL) {
1259 return EFI_OUT_OF_RESOURCES;
1262 RndisPacketMsg->MessageType = RNDIS_PACKET_MSG;
1265 RndisPacketMsg->DataLength = (UINT32)*DataLength;
1273 TransferLength = RndisPacketMsg->MessageLength;
1281 DEBUG ((DEBUG_INFO,
"\nRndisUndiTransmit TransferLength %lx\n", TransferLength));
1307 IN OUT VOID *BulkInData,
1314 UINTN TransferLength;
1322 UsbRndisDevice = USB_RNDIS_DEVICE_FROM_THIS (This);
1328 if (Buffer ==
NULL) {
1329 return EFI_OUT_OF_RESOURCES;
1334 PacketList->PacketStartBuffer = (UINT8 *)Buffer +
sizeof (
PACKET_LIST);
1336 PacketList->OrgBuffer = (UINT8 *)Buffer;
1337 TransferLength = UsbRndisDevice->MaxTransferSize;
1345 if (EFI_ERROR (Status) || (TransferLength == 0)) {
1351 if ((RndisPacketMsg->MessageType == RNDIS_PACKET_MSG) &&
1353 (TransferLength >= RndisPacketMsg->MessageLength))
1356 PacketList->RemainingLength = TransferLength;
1363 while (!
IsListEmpty (&UsbRndisDevice->ReceivePacketList)) {
1371 if ((HeadPacket->RemainingLength > sizeof (
REMOTE_NDIS_PACKET_MSG)) && (RndisPacketMsg->MessageType == RNDIS_PACKET_MSG) &&
1373 (HeadPacket->RemainingLength >= RndisPacketMsg->MessageLength))
1375 if (*DataLength >= RndisPacketMsg->DataLength) {
1378 (UINT8 *)RndisPacketMsg + (RndisPacketMsg->DataOffset + RNDIS_RESERVED_BYTE_LENGTH),
1379 RndisPacketMsg->DataLength
1382 *DataLength = RndisPacketMsg->DataLength;
1384 HeadPacket->RemainingLength = HeadPacket->RemainingLength - RndisPacketMsg->MessageLength;
1385 HeadPacket->PacketStartBuffer = (UINT8 *)RndisPacketMsg + RndisPacketMsg->MessageLength;
1389 *DataLength = RndisPacketMsg->DataLength;
1390 return EFI_BUFFER_TOO_SMALL;
1398 return EFI_NOT_FOUND;
1418 DEBUG ((DEBUG_INFO,
"RndisDummyReturn called\n"));
1443 UINT32 SaveResponseType;
1444 UINT32 SaveResponseLength;
1448 UsbIo = UsbRndisDevice->UsbIo;
1449 SaveResponseType = 0;
1450 SaveResponseLength = 0;
1453 if (RndisMsgResponse !=
NULL) {
1454 SaveResponseType = RndisMsgResponse->MessageType;
1455 SaveResponseLength = RndisMsgResponse->MessageLength;
1460 DevReq.RequestType = USB_REQ_TYPE_CLASS | USB_TARGET_INTERFACE;
1461 DevReq.Request = SEND_ENCAPSULATED_COMMAND;
1464 DevReq.Length = (UINT16)RndisMsg->MessageLength;
1468 Status = UsbIo->UsbControlTransfer (
1472 USB_ETHERNET_TRANSFER_TIMEOUT,
1474 RndisMsg->MessageLength,
1478 DEBUG ((DEBUG_INFO,
"RndisControlMsg: UsbStatus : %x Status : %r RndisMsgResponse : %lx\n", UsbStatus, Status, RndisMsgResponse));
1481 if ((EFI_ERROR (Status)) || (RndisMsgResponse ==
NULL)) {
1482 DEBUG ((DEBUG_INFO,
"RndisControlMsg: UsbStatus : %x Status : %r\n", UsbStatus, Status));
1486 for (Index = 0; Index < (RNDIS_CONTROL_TIMEOUT/100); Index++) {
1490 DevReq.RequestType = USB_ENDPOINT_DIR_IN | USB_REQ_TYPE_CLASS | USB_TARGET_INTERFACE;
1491 DevReq.Request = GET_ENCAPSULATED_RESPONSE;
1494 DevReq.Length = (UINT16)RndisMsgResponse->MessageLength;
1496 Status = UsbIo->UsbControlTransfer (
1500 USB_ETHERNET_TRANSFER_TIMEOUT,
1502 RndisMsgResponse->MessageLength,
1506 DEBUG ((DEBUG_INFO,
"RndisControlMsg Response: UsbStatus : %x Status : %r \n", UsbStatus, Status));
1510 if (!EFI_ERROR (Status)) {
1511 if ((RndisInitCmplt->RequestID != ((
REMOTE_NDIS_INITIALIZE_CMPLT *)RndisMsg)->RequestID) || (RndisInitCmplt->MessageType != SaveResponseType)) {
1512 DEBUG ((DEBUG_INFO,
"Retry the response\n"));
1514 RndisMsgResponse->MessageType = SaveResponseType;
1515 RndisMsgResponse->MessageLength = SaveResponseLength;
1523 DEBUG ((DEBUG_INFO,
"RndisControlMsg: TimeOut\n"));
1548 if (UsbRndisDevice->BulkInEndpoint == 0) {
1549 GetEndpoint (UsbRndisDevice->UsbIoCdcData, UsbRndisDevice);
1554 Status = UsbRndisDevice->UsbIoCdcData->UsbBulkTransfer (
1555 UsbRndisDevice->UsbIoCdcData,
1556 UsbRndisDevice->BulkOutEndpoint,
1559 USB_TX_ETHERNET_BULK_TIMEOUT,
1564 gStopBulkInCnt = MAXIMUM_STOPBULKIN_CNT;
1592 if (UsbRndisDevice->BulkInEndpoint == 0) {
1593 GetEndpoint (UsbRndisDevice->UsbIoCdcData, UsbRndisDevice);
1597 if ((gStopBulkInCnt != 0) || LAN_BULKIN_CMD_CONTROL) {
1598 Status = UsbRndisDevice->UsbIoCdcData->UsbBulkTransfer (
1599 UsbRndisDevice->UsbIoCdcData,
1600 UsbRndisDevice->BulkInEndpoint,
1603 USB_RX_ETHERNET_BULK_TIMEOUT,
1607 if (!EFI_ERROR (Status)) {
1608 gStopBulkInCnt = MINIMUM_STOPBULKIN_CNT;
1613 Status = EFI_TIMEOUT;
1614 *TransferLength = 0;
1618 if (gBlockBulkInCnt > BULKIN_CMD_POLLING_CNT) {
1619 gStopBulkInCnt = MINIMUM_STOPBULKIN_CNT;
1620 gBlockBulkInCnt = 0;
1644 switch (RndisMsg->MessageType) {
1645 case RNDIS_PACKET_MSG:
1646 DEBUG ((DEBUG_INFO,
"RNDIS_PACKET_MSG:\n"));
1649 case RNDIS_INITIALIZE_MSG:
1650 DEBUG ((DEBUG_INFO,
"RNDIS_INITIALIZE_MSG:\n"));
1653 case RNDIS_INITIALIZE_CMPLT:
1654 DEBUG ((DEBUG_INFO,
"RNDIS_INITIALIZE_CMPLT:\n"));
1658 DEBUG ((DEBUG_INFO,
"RNDIS_HLT_MSG:\n"));
1661 case RNDIS_QUERY_MSG:
1662 DEBUG ((DEBUG_INFO,
"RNDIS_QUERY_MSG:\n"));
1665 case RNDIS_QUERY_CMPLT:
1666 DEBUG ((DEBUG_INFO,
"RNDIS_QUERY_CMPLT:\n"));
1671 DEBUG ((DEBUG_INFO,
"RNDIS_SET_MSG:\n"));
1674 case RNDIS_SET_CMPLT:
1675 DEBUG ((DEBUG_INFO,
"RNDIS_SET_CMPLT:\n"));
1678 case RNDIS_RESET_MSG:
1679 DEBUG ((DEBUG_INFO,
"RNDIS_RESET_MSG:\n"));
1682 case RNDIS_RESET_CMPLT:
1683 DEBUG ((DEBUG_INFO,
"RNDIS_RESET_CMPLT:\n"));
1686 case RNDIS_INDICATE_STATUS_MSG:
1687 DEBUG ((DEBUG_INFO,
"RNDIS_INDICATE_STATUS_MSG:\n"));
1690 case RNDIS_KEEPALIVE_MSG:
1691 DEBUG ((DEBUG_INFO,
"RNDIS_KEEPALIVE_MSG:\n"));
1694 case RNDIS_KEEPALIVE_CMPLT:
1695 DEBUG ((DEBUG_INFO,
"RNDIS_KEEPALIVE_CMPLT:\n"));
1702 for ( ; Length; Length -= 4, Index++) {
1703 DEBUG ((DEBUG_INFO,
"%8X\t", *((UINT32 *)RndisMsg + Index)));
1704 if (((Index % 4) == 3) && (Index != 0)) {
1705 DEBUG ((DEBUG_INFO,
"\n"));
1708 if ((Length < 8) && (Length > 4)) {
1711 Data32 = *((UINT32 *)RndisMsg + Index);
1712 DEBUG ((DEBUG_INFO,
"%8X\t", Data32));
1717 if ((Index % 4) != 0) {
1718 DEBUG ((DEBUG_INFO,
"\n"));
BOOLEAN EFIAPI IsListEmpty(IN CONST LIST_ENTRY *ListHead)
LIST_ENTRY *EFIAPI GetFirstNode(IN CONST LIST_ENTRY *List)
UINTN EFIAPI StrHexToUintn(IN CONST CHAR16 *String)
LIST_ENTRY *EFIAPI RemoveEntryList(IN CONST LIST_ENTRY *Entry)
LIST_ENTRY *EFIAPI InsertTailList(IN OUT LIST_ENTRY *ListHead, IN OUT LIST_ENTRY *Entry)
VOID *EFIAPI CopyMem(OUT VOID *DestinationBuffer, IN CONST VOID *SourceBuffer, IN UINTN Length)
VOID *EFIAPI ZeroMem(OUT VOID *Buffer, IN UINTN Length)
VOID *EFIAPI AllocateZeroPool(IN UINTN AllocationSize)
VOID EFIAPI FreePool(IN VOID *Buffer)
UINT16 SetFilter(IN NIC_DATA *Nic, IN UINT16 SetFilter, IN UINT64 CpbAddr, IN UINT32 CpbSize)
#define DEBUG(Expression)
#define PXE_OPFLAGS_RECEIVE_FILTER_UNICAST
#define PXE_STATFLAGS_GET_STATUS_NO_MEDIA
#define PXE_OPFLAGS_RECEIVE_FILTER_PROMISCUOUS
#define PXE_OPFLAGS_RECEIVE_FILTER_FILTERED_MULTICAST
#define PXE_OPFLAGS_RECEIVE_FILTER_ALL_MULTICAST
#define PXE_OPFLAGS_RECEIVE_FILTER_BROADCAST
EFI_STATUS EFIAPI UsbSetInterface(IN EFI_USB_IO_PROTOCOL *UsbIo, IN UINT16 Interface, IN UINT16 AlternateSetting, OUT UINT32 *Status)
EFI_STATUS EFIAPI UsbGetDescriptor(IN EFI_USB_IO_PROTOCOL *UsbIo, IN UINT16 Value, IN UINT16 Index, IN UINT16 DescriptorLength, OUT VOID *Descriptor, OUT UINT32 *Status)
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 GetUsbRndisPowerFilter(IN EDKII_USB_ETHERNET_PROTOCOL *This, IN UINT16 Value, OUT BOOLEAN *PatternActive)
EFI_STATUS EFIAPI GetRndisStatistic(IN EDKII_USB_ETHERNET_PROTOCOL *This, IN UINT16 FeatureSelector, OUT VOID *Statistic)
EFI_STATUS EFIAPI RndisUndiReceiveFilter(IN PXE_CDB *Cdb, IN NIC_DATA *Nic)
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 ReadRndisResponseInterrupt(IN USB_RNDIS_DEVICE *UsbRndisDevice)
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 RndisReceiveDataMsg(IN USB_RNDIS_DEVICE *UsbRndisDevice, IN OUT REMOTE_NDIS_MSG_HEADER *RndisMsg, IN OUT UINTN *TransferLength)
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 RndisTransmitDataMsg(IN USB_RNDIS_DEVICE *UsbRndisDevice, IN REMOTE_NDIS_MSG_HEADER *RndisMsg, IN OUT UINTN *TransferLength)
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 GetUsbUnionFunDescriptor(IN EDKII_USB_ETHERNET_PROTOCOL *This, OUT USB_UNION_FUN_DESCRIPTOR *UsbUnionFunDescriptor)
VOID ConvertFilter(IN UINT16 Value, OUT UINT16 *CdcFilter)
BOOLEAN NextDescriptor(IN EFI_USB_CONFIG_DESCRIPTOR *Desc, IN OUT UINTN *Offset)
PXE_MAC_ADDR MCastList[MAX_MCAST_ADDRESS_CNT]