Hi,
This patch does:
- Fix axen won't work after interface down.
- Fix definitions and comments that differ from linux ones.
regards,
--- sys/dev/usb/if_axen.c Fri Mar 3 15:04:52 2017
+++ sys/dev/usb/if_axen.c Mon Jun 19 16:05:09 2017
@@ -1256,6 +1256,14 @@ axen_init(void *xsc)
*/
axen_reset(sc);
+#define AXEN_CONFIG_NO 1
+#define AXEN_IFACE_IDX 0
+ if (usbd_set_config_no(sc->axen_udev, AXEN_CONFIG_NO, 1) ||
+ usbd_device2interface_handle(sc->axen_udev, AXEN_IFACE_IDX,
+ &sc->axen_iface))
+ printf("%s: set_config failed\n", sc->axen_dev.dv_xname);
+ usbd_delay_ms(sc->axen_udev, 10);
+
/* XXX: ? */
bval = 0x01;
axen_lock_mii(sc);
--- sys/dev/usb/if_axenreg.h Fri Sep 16 22:17:07 2016
+++ sys/dev/usb/if_axenreg.h Mon Jun 19 10:54:28 2017
@@ -26,8 +26,8 @@
* | | ++-----L3_type (1:ipv4, 0/2:ipv6)
* pkt_len(13) | | ||+ ++-L4_type(0: icmp, 1: UDP, 4: TCP)
* |765|43210 76543210|7654 3210 7654 3210|
- * ||+-crc_err |+-L4_err |+-L4_CSUM_ERR
- * |+-mii_err +--L3_err +--L3_CSUM_ERR
+ * ||+-crc_err |+-L4_err |+-L4_CSUM_ERR
+ * |+-mii_err +--L3_err +--L3_CSUM_ERR
* +-drop_err
*
* ex) pkt_hdr 0x00680820
@@ -70,7 +70,7 @@
#define AXEN_RXHDR_L4_TYPE_TCP 0x4
/* L3 packet type (2bit) */
-#define AXEN_RXHDR_L3_TYPE_MASK 0x00000600
+#define AXEN_RXHDR_L3_TYPE_MASK 0x00000060
#define AXEN_RXHDR_L3_TYPE_OFFSET 5
#define AXEN_RXHDR_L3_TYPE_UNDEF 0x0
#define AXEN_RXHDR_L3_TYPE_IPV4 0x1