From 7b3969c95160a35255743c6220572401b64c6eb7 Mon Sep 17 00:00:00 2001 From: Oleg Ilyasov Date: Wed, 16 Oct 2024 14:27:11 -0400 Subject: MdeModulePkg UsbNetwork: Use USB class definition from MdePkg - Class specific types for interface and endpoint are generic - Definitions are in IndustryStandard/Usb.h - Remove type redefinitions - Update references to the descriptor types Signed-off-by: Oleg Ilyasov --- MdeModulePkg/Bus/Usb/UsbNetwork/UsbCdcEcm/UsbEcmFunction.c | 2 +- MdeModulePkg/Bus/Usb/UsbNetwork/UsbCdcNcm/UsbNcmFunction.c | 2 +- MdeModulePkg/Bus/Usb/UsbNetwork/UsbRndis/UsbRndisFunction.c | 2 +- MdeModulePkg/Include/Protocol/UsbEthernetProtocol.h | 4 ---- 4 files changed, 3 insertions(+), 7 deletions(-) diff --git a/MdeModulePkg/Bus/Usb/UsbNetwork/UsbCdcEcm/UsbEcmFunction.c b/MdeModulePkg/Bus/Usb/UsbNetwork/UsbCdcEcm/UsbEcmFunction.c index 0c1f252..dc78466 100644 --- a/MdeModulePkg/Bus/Usb/UsbNetwork/UsbCdcEcm/UsbEcmFunction.c +++ b/MdeModulePkg/Bus/Usb/UsbNetwork/UsbCdcEcm/UsbEcmFunction.c @@ -111,7 +111,7 @@ GetFunctionalDescriptor ( for (Offset = 0; NextDescriptor (Config, &Offset);) { Interface = (EFI_USB_INTERFACE_DESCRIPTOR *)((UINT8 *)Config + Offset); - if (Interface->DescriptorType == CS_INTERFACE) { + if (Interface->DescriptorType == USB_DESC_TYPE_CS_INTERFACE) { if (((USB_HEADER_FUN_DESCRIPTOR *)Interface)->DescriptorSubtype == FunDescriptorType) { switch (FunDescriptorType) { case HEADER_FUN_DESCRIPTOR: diff --git a/MdeModulePkg/Bus/Usb/UsbNetwork/UsbCdcNcm/UsbNcmFunction.c b/MdeModulePkg/Bus/Usb/UsbNetwork/UsbCdcNcm/UsbNcmFunction.c index ef01a6f..4b6e0d2 100644 --- a/MdeModulePkg/Bus/Usb/UsbNetwork/UsbCdcNcm/UsbNcmFunction.c +++ b/MdeModulePkg/Bus/Usb/UsbNetwork/UsbCdcNcm/UsbNcmFunction.c @@ -111,7 +111,7 @@ GetFunctionalDescriptor ( for (Offset = 0; NextDescriptor (Config, &Offset);) { Interface = (EFI_USB_INTERFACE_DESCRIPTOR *)((UINT8 *)Config + Offset); - if (Interface->DescriptorType == CS_INTERFACE) { + if (Interface->DescriptorType == USB_DESC_TYPE_CS_INTERFACE) { if (((USB_HEADER_FUN_DESCRIPTOR *)Interface)->DescriptorSubtype == FunDescriptorType) { switch (FunDescriptorType) { case HEADER_FUN_DESCRIPTOR: diff --git a/MdeModulePkg/Bus/Usb/UsbNetwork/UsbRndis/UsbRndisFunction.c b/MdeModulePkg/Bus/Usb/UsbNetwork/UsbRndis/UsbRndisFunction.c index 6d45a1b..8723a82 100644 --- a/MdeModulePkg/Bus/Usb/UsbNetwork/UsbRndis/UsbRndisFunction.c +++ b/MdeModulePkg/Bus/Usb/UsbNetwork/UsbRndis/UsbRndisFunction.c @@ -123,7 +123,7 @@ GetFunctionalDescriptor ( for (Offset = 0; NextDescriptor (Config, &Offset);) { Interface = (EFI_USB_INTERFACE_DESCRIPTOR *)((UINT8 *)Config + Offset); - if (Interface->DescriptorType == CS_INTERFACE) { + if (Interface->DescriptorType == USB_DESC_TYPE_CS_INTERFACE) { if (((USB_HEADER_FUN_DESCRIPTOR *)Interface)->DescriptorSubtype == FunDescriptorType) { switch (FunDescriptorType) { case HEADER_FUN_DESCRIPTOR: diff --git a/MdeModulePkg/Include/Protocol/UsbEthernetProtocol.h b/MdeModulePkg/Include/Protocol/UsbEthernetProtocol.h index 250de0b..43ccca3 100644 --- a/MdeModulePkg/Include/Protocol/UsbEthernetProtocol.h +++ b/MdeModulePkg/Include/Protocol/UsbEthernetProtocol.h @@ -28,10 +28,6 @@ typedef struct _EDKII_USB_ETHERNET_PROTOCOL EDKII_USB_ETHERNET_PROTOCOL; #define USB_RNDIS_SUBCLASS 0x04 #define USB_RNDIS_ETHERNET_PROTOCOL 0x01 -// Type Values for the DescriptorType Field -#define CS_INTERFACE 0x24 -#define CS_ENDPOINT 0x25 - // Descriptor SubType in Functional Descriptors #define HEADER_FUN_DESCRIPTOR 0x00 #define UNION_FUN_DESCRIPTOR 0x06 -- cgit v1.1