]> git.proxmox.com Git - mirror_edk2.git/blobdiff - OptionRomPkg/Bus/Usb/UsbNetworking/Ax88772b/DriverBinding.c
OptionRomPkg: Ax88772b: support for multiple dongles and chips
[mirror_edk2.git] / OptionRomPkg / Bus / Usb / UsbNetworking / Ax88772b / DriverBinding.c
index 3b7304047813858290a1e9255c805a9e82679352..d64bc739c1aea53f4078dbc26e5c2ef6178546de 100644 (file)
 \r
 #include "Ax88772.h"\r
 \r
+ASIX_DONGLE ASIX_DONGLES[] = {\r
+  { 0x05AC, 0x1402, FLAG_TYPE_AX88772 }, // Apple USB Ethernet Adapter\r
+  // ASIX 88772B\r
+  { 0x0B95, 0x772B, FLAG_TYPE_AX88772B | FLAG_EEPROM_MAC },\r
+  { 0x0000, 0x0000, FLAG_NONE }   // END - Do not remove\r
+};\r
+\r
 /**\r
   Verify the controller type\r
 \r
@@ -36,6 +43,8 @@ DriverSupported (
   EFI_USB_DEVICE_DESCRIPTOR Device;\r
   EFI_USB_IO_PROTOCOL * pUsbIo;\r
   EFI_STATUS Status;\r
+  UINT32 Index;\r
+\r
   //\r
   //  Connect to the USB stack\r
   //\r
@@ -60,19 +69,17 @@ DriverSupported (
     else {\r
       //\r
       //  Validate the adapter\r
-      //   \r
-      if ( VENDOR_ID == Device.IdVendor ) {\r
-\r
-        if (PRODUCT_ID == Device.IdProduct) {\r
-            DEBUG ((EFI_D_INFO, "Found the AX88772B\r\n"));\r
+      //\r
+      for (Index = 0; ASIX_DONGLES[Index].VendorId != 0; Index++) {\r
+        if (ASIX_DONGLES[Index].VendorId == Device.IdVendor &&\r
+            ASIX_DONGLES[Index].ProductId == Device.IdProduct) {\r
+              DEBUG ((EFI_D_INFO, "Found the AX88772B\r\n"));\r
+              break;\r
         }\r
-                   else  {\r
-                            Status = EFI_UNSUPPORTED;\r
-                   }\r
       }\r
-           else {\r
-                     Status = EFI_UNSUPPORTED;\r
-       }   \r
+\r
+      if (ASIX_DONGLES[Index].VendorId == 0)\r
+         Status = EFI_UNSUPPORTED;\r
     }\r
    \r
     //\r