From 0fa2bdbc987065052bacf2398cc60e9f56c8e250 Mon Sep 17 00:00:00 2001 From: hastings Date: Tue, 8 Mar 2022 06:05:58 +0000 Subject: [PATCH] Add missing byteswap to mtw_write_cfg(). Fixes loading firmware on big-endian machines. ok stsp@, jmatthew@ --- sys/dev/usb/if_mtw.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/usb/if_mtw.c b/sys/dev/usb/if_mtw.c index 4c11ab16769..3ecc7a033c1 100644 --- a/sys/dev/usb/if_mtw.c +++ b/sys/dev/usb/if_mtw.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_mtw.c,v 1.3 2021/12/30 15:09:49 kevlo Exp $ */ +/* $OpenBSD: if_mtw.c,v 1.4 2022/03/08 06:05:58 hastings Exp $ */ /* * Copyright (c) 2008-2010 Damien Bergamini * Copyright (c) 2013-2014 Kevin Lo @@ -917,6 +917,7 @@ mtw_write_cfg(struct mtw_softc *sc, uint16_t reg, uint32_t val) USETW(req.wValue, 0); USETW(req.wIndex, reg); USETW(req.wLength, 4); + val = htole32(val); error = usbd_do_request(sc->sc_udev, &req, &val); return error; } -- 2.20.1