diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2010-03-03 19:08:03 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2010-03-03 19:08:03 +0000 |
commit | 1f6ea70e9dbaf3e5ee32edda96cc83baa841959c (patch) | |
tree | f03ed3d1e6ab60537a17ac1d12dfa52cc30f7704 /sys/dev/usb | |
parent | f873978d2614d7facc059c01f547d338fa9b105b (diff) |
Correctly initialize the command frame in uyurex_write_value_request();
ok yuo@
Diffstat (limited to 'sys/dev/usb')
-rw-r--r-- | sys/dev/usb/uyurex.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/usb/uyurex.c b/sys/dev/usb/uyurex.c index c186a299916..51c9c30e9c4 100644 --- a/sys/dev/usb/uyurex.c +++ b/sys/dev/usb/uyurex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uyurex.c,v 1.1 2010/03/01 07:56:47 yuo Exp $ */ +/* $OpenBSD: uyurex.c,v 1.2 2010/03/03 19:08:02 miod Exp $ */ /* * Copyright (c) 2010 Yojiro UO <yuo@nui.org> @@ -343,11 +343,13 @@ uyurex_write_value_request(struct uyurex_softc *sc, uint32_t val) { uint32_t v; uint8_t req[8]; + req[0] = CMD_WRITE; + req[1] = 0; req[6] = CMD_EOF; req[7] = CMD_PADDING; - v = htonl(val); - memcpy(req+1, &v, sizeof(uint32_t)); + v = htobe32(val); + memcpy(req + 2, &v, sizeof(uint32_t)); sc->issueing_cmd = CMD_WRITE; sc->accepted_cmd = CMD_NONE; |