Skip to content

Commit

Permalink
MdeModulePkg UsbNetwork: Use USB class definition from MdePkg
Browse files Browse the repository at this point in the history
- 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 <[email protected]>
  • Loading branch information
olegilyasov authored and mergify[bot] committed Oct 22, 2024
1 parent e2ab098 commit 7b3969c
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion MdeModulePkg/Bus/Usb/UsbNetwork/UsbCdcEcm/UsbEcmFunction.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion MdeModulePkg/Bus/Usb/UsbNetwork/UsbCdcNcm/UsbNcmFunction.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 0 additions & 4 deletions MdeModulePkg/Include/Protocol/UsbEthernetProtocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7b3969c

Please sign in to comment.