summaryrefslogtreecommitdiff
path: root/sys/dev/usb
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2003-12-05 02:23:43 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2003-12-05 02:23:43 +0000
commit34c1fa05176ed493fccdf3c136c1ce35184ae01c (patch)
tree5340d787308ade9670464d7c8a71d13abd4f1690 /sys/dev/usb
parentac0f5cfe3a8e9ecab2b4e0561895eca10aee861d (diff)
consistently treat wi_keylen as le16, fixes wicontrol crash for if_wi
and if_wi_usb ok millert@
Diffstat (limited to 'sys/dev/usb')
-rw-r--r--sys/dev/usb/if_wi_usb.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/dev/usb/if_wi_usb.c b/sys/dev/usb/if_wi_usb.c
index 84e14aa72ce..418e594d451 100644
--- a/sys/dev/usb/if_wi_usb.c
+++ b/sys/dev/usb/if_wi_usb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wi_usb.c,v 1.4 2003/11/09 20:54:19 drahn Exp $ */
+/* $OpenBSD: if_wi_usb.c,v 1.5 2003/12/05 02:23:42 drahn Exp $ */
/*
* Copyright (c) 2003 Dale Rahn. All rights reserved.
@@ -796,8 +796,11 @@ wi_write_record_usb(struct wi_softc *wsc, struct wi_ltv_gen *ltv)
int error;
int keylen;
struct wi_ltv_str ws;
- struct wi_ltv_keys *wk = (struct wi_ltv_keys *)ltv;
+ struct wi_ltv_keys *wk;
+
+ wk = (struct wi_ltv_keys *)ltv;
keylen = wk->wi_keys[wsc->wi_tx_key].wi_keylen;
+ keylen = letoh16(keylen);
for (i = 0; i < 4; i++) {
bzero(&ws, sizeof(ws));
@@ -1393,8 +1396,8 @@ wi_usb_rxeof(usbd_xfer_handle xfer, usbd_private_handle priv, usbd_status status
case WI_USB_ERROR:
printf("wi_usb: received USB_ERROR packet\n"); /* XXX */
break;
- default:
#if 0
+ default:
printf("wi_usb: received Unknown packet 0x%x len %x\n",
rtype, total_len);
wi_dump_data(c->wi_usb_buf, total_len);