diff options
author | 2015-02-07 21:21:44 +0000 | |
---|---|---|
committer | 2015-02-07 21:21:44 +0000 | |
commit | ae90c0743cd94c2b8d630adc06de3313313b4190 (patch) | |
tree | 177020f4590dc55696178165dcbdab28eef14328 | |
parent | Don't panic on unhandled net80211 state transitions in iwm(4). (diff) | |
download | wireguard-openbsd-ae90c0743cd94c2b8d630adc06de3313313b4190.tar.xz wireguard-openbsd-ae90c0743cd94c2b8d630adc06de3313313b4190.zip |
Fix a logic error when enabling MAC and reset the checksum report bit
before loading page, from FreBSD r262822 and r263154.
ok stsp@
-rw-r--r-- | sys/dev/usb/if_urtwn.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/usb/if_urtwn.c b/sys/dev/usb/if_urtwn.c index 56ef2b820ab..5ae276fd39f 100644 --- a/sys/dev/usb/if_urtwn.c +++ b/sys/dev/usb/if_urtwn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_urtwn.c,v 1.40 2014/12/22 02:28:52 tedu Exp $ */ +/* $OpenBSD: if_urtwn.c,v 1.41 2015/02/07 21:21:44 mpi Exp $ */ /*- * Copyright (c) 2010 Damien Bergamini <damien.bergamini@free.fr> @@ -2058,8 +2058,8 @@ urtwn_power_on(struct urtwn_softc *sc) urtwn_write_2(sc, R92C_APS_FSMCO, urtwn_read_2(sc, R92C_APS_FSMCO) | R92C_APS_FSMCO_APFM_ONMAC); for (ntries = 0; ntries < 1000; ntries++) { - if (urtwn_read_2(sc, R92C_APS_FSMCO) & - R92C_APS_FSMCO_APFM_ONMAC) + if (!(urtwn_read_2(sc, R92C_APS_FSMCO) & + R92C_APS_FSMCO_APFM_ONMAC)) break; DELAY(5); } @@ -2229,6 +2229,10 @@ urtwn_load_firmware(struct urtwn_softc *sc) urtwn_write_1(sc, R92C_MCUFWDL + 2, urtwn_read_1(sc, R92C_MCUFWDL + 2) & ~0x08); + /* Reset the FWDL checksum. */ + urtwn_write_1(sc, R92C_MCUFWDL, + urtwn_read_1(sc, R92C_MCUFWDL) | R92C_MCUFWDL_CHKSUM_RPT); + for (page = 0; len > 0; page++) { mlen = MIN(len, R92C_FW_PAGE_SIZE); error = urtwn_fw_loadpage(sc, page, ptr, mlen); |