diff options
author | Shivamurthy Shastri <shivamurthy.shastri@linaro.org> | 2016-03-23 23:09:27 +0800 |
---|---|---|
committer | Ruiyu Ni <ruiyu.ni@intel.com> | 2016-03-30 12:13:04 +0800 |
commit | 9a1c4beca0463066660635c2494bb8cf66d4c4bd (patch) | |
tree | a6d2cc41c0fa098fef1e715aecc7e33d83e205f2 /OptionRomPkg/Bus/Usb/UsbNetworking/Ax88772b/DriverBinding.c | |
parent | 48555339beb65f90bd42995a15bd38cd45e378f5 (diff) | |
download | edk2-9a1c4beca0463066660635c2494bb8cf66d4c4bd.tar.gz edk2-9a1c4beca0463066660635c2494bb8cf66d4c4bd.tar.bz2 edk2-9a1c4beca0463066660635c2494bb8cf66d4c4bd.zip |
OptionRomPkg: Ax88772b: support for multiple dongles and chips
Driver code is modified to support multiple ethernet dongles, which uses
similar ASIX chips. Also, it can be used for multiple ASIX chips with
similar register map.
Enabled support for Apple Ethernet Adapter
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Shivamurthy Shastri <shivamurthy.shastri@linaro.org>
Reviewed-by: Ruiyu Ni <ruiyu.ni@intel.com>
Diffstat (limited to 'OptionRomPkg/Bus/Usb/UsbNetworking/Ax88772b/DriverBinding.c')
-rw-r--r-- | OptionRomPkg/Bus/Usb/UsbNetworking/Ax88772b/DriverBinding.c | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/OptionRomPkg/Bus/Usb/UsbNetworking/Ax88772b/DriverBinding.c b/OptionRomPkg/Bus/Usb/UsbNetworking/Ax88772b/DriverBinding.c index 3b73040478..d64bc739c1 100644 --- a/OptionRomPkg/Bus/Usb/UsbNetworking/Ax88772b/DriverBinding.c +++ b/OptionRomPkg/Bus/Usb/UsbNetworking/Ax88772b/DriverBinding.c @@ -14,6 +14,13 @@ #include "Ax88772.h"
+ASIX_DONGLE ASIX_DONGLES[] = {
+ { 0x05AC, 0x1402, FLAG_TYPE_AX88772 }, // Apple USB Ethernet Adapter
+ // ASIX 88772B
+ { 0x0B95, 0x772B, FLAG_TYPE_AX88772B | FLAG_EEPROM_MAC },
+ { 0x0000, 0x0000, FLAG_NONE } // END - Do not remove
+};
+
/**
Verify the controller type
@@ -36,6 +43,8 @@ DriverSupported ( EFI_USB_DEVICE_DESCRIPTOR Device;
EFI_USB_IO_PROTOCOL * pUsbIo;
EFI_STATUS Status;
+ UINT32 Index;
+
//
// Connect to the USB stack
//
@@ -60,19 +69,17 @@ DriverSupported ( else {
//
// Validate the adapter
- //
- if ( VENDOR_ID == Device.IdVendor ) {
-
- if (PRODUCT_ID == Device.IdProduct) {
- DEBUG ((EFI_D_INFO, "Found the AX88772B\r\n"));
+ //
+ for (Index = 0; ASIX_DONGLES[Index].VendorId != 0; Index++) {
+ if (ASIX_DONGLES[Index].VendorId == Device.IdVendor &&
+ ASIX_DONGLES[Index].ProductId == Device.IdProduct) {
+ DEBUG ((EFI_D_INFO, "Found the AX88772B\r\n"));
+ break;
}
- else {
- Status = EFI_UNSUPPORTED;
- }
}
- else {
- Status = EFI_UNSUPPORTED;
- }
+
+ if (ASIX_DONGLES[Index].VendorId == 0)
+ Status = EFI_UNSUPPORTED;
}
//
|