summaryrefslogtreecommitdiff
path: root/sys/dev/usb/if_udavreg.h
diff options
context:
space:
mode:
authorMichael Knudsen <mk@cvs.openbsd.org>2011-03-31 17:06:26 +0000
committerMichael Knudsen <mk@cvs.openbsd.org>2011-03-31 17:06:26 +0000
commit4224e4b777f716b64dec8ecae9f63e6456a3cd7d (patch)
treec307156336a0eeb83bf386cccd05f29263c3c9e8 /sys/dev/usb/if_udavreg.h
parent7a16c72e8c7a64ac7fea50c52bb65bf25e597258 (diff)
Don't process packets where the USB xfer length is shorter than a packet
header, and don't process packets where the packet header length field says the packet is longer than the size of the USB xfer. While there, fix a debug print that was missing the device name from the parameter list, causing it to crash when enabled. Also, use correct MTU from datasheet. From Loganaden Velvindrom with input from me. Tested by kili. ok jasper sthen (with a whitespace nit)
Diffstat (limited to 'sys/dev/usb/if_udavreg.h')
-rw-r--r--sys/dev/usb/if_udavreg.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/dev/usb/if_udavreg.h b/sys/dev/usb/if_udavreg.h
index f3034334c78..40694c4233e 100644
--- a/sys/dev/usb/if_udavreg.h
+++ b/sys/dev/usb/if_udavreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_udavreg.h,v 1.11 2010/12/06 04:41:39 jakemsr Exp $ */
+/* $OpenBSD: if_udavreg.h,v 1.12 2011/03/31 17:06:25 mk Exp $ */
/* $NetBSD: if_udavreg.h,v 1.2 2003/09/04 15:17:39 tsutsui Exp $ */
/* $nabe: if_udavreg.h,v 1.2 2003/08/21 16:26:40 nabe Exp $ */
/*
@@ -200,6 +200,6 @@ struct udav_rx_hdr {
#define UDAV_RX_HDRLEN sizeof(struct udav_rx_hdr)
/* Packet length */
-#define UDAV_MAX_MTU 1536 /* XXX: max frame size is unknown */
+#define UDAV_MAX_MTU 1522 /* According to datasheet */
#define UDAV_MIN_FRAME_LEN 60
#define UDAV_BUFSZ UDAV_MAX_MTU + UDAV_RX_HDRLEN