Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: sys/dev/usb/if_axen.c



Could you please try this patch?

--- src/sys/dev/usb/if_axen.c.orig	2022-08-20 23:30:49.194557768 +0000
+++ src/sys/dev/usb/if_axen.c	2023-11-15 23:23:29.684547881 +0000
@@ -52,6 +52,7 @@ struct axen_type {
 	uint16_t		axen_flags;
 #define AX178A	0x0001		/* AX88178a */
 #define AX179	0x0002		/* AX88179 */
+#define AX179A	0x0004		/* AX88179A */
 };
 
 /*
@@ -605,6 +606,8 @@ axen_attach(device_t parent, device_t se
 	}
 
 	axen_flags = axen_lookup(uaa->uaa_vendor, uaa->uaa_product)->axen_flags;
+	if (UGETW(usbd_get_device_descriptor(dev)->bcdDevice) == 0x0200)
+		axen_flags = AX179A;
 
 	err = usbd_device2interface_handle(dev, AXEN_IFACE_IDX, &un->un_iface);
 	if (err) {
@@ -663,11 +666,20 @@ axen_attach(device_t parent, device_t se
 
 	axen_ax88179_init(un);
 
+#define   AXEN_FW_MODE				0x08
+#define     AXEN_FW_MODE_178A179		0x00
+	if (axen_flags & AX179A) {
+		uint8_t val = AXEN_FW_MODE_178A179;
+		axen_cmd(un, AXEN_CMD_MAC_WRITE, 1, AXEN_FW_MODE, &val);
+	}
+
 	/* An ASIX chip was detected. Inform the world.  */
 	if (axen_flags & AX178A)
 		aprint_normal_dev(self, "AX88178a\n");
 	else if (axen_flags & AX179)
 		aprint_normal_dev(self, "AX88179\n");
+	else if (axen_flags & AX179A)
+		aprint_normal_dev(self, "AX88179A\n");
 	else
 		aprint_normal_dev(self, "(unknown)\n");
 


Home | Main Index | Thread Index | Old Index