diff options
author | bschmidt <bschmidt@FreeBSD.org> | 2012-03-21 19:08:44 +0000 |
---|---|---|
committer | bschmidt <bschmidt@FreeBSD.org> | 2012-03-21 19:08:44 +0000 |
commit | d529ce809ac6c33dce5214535a1676e24488c282 (patch) | |
tree | a1ab95af1b6f07d586487b2f7a0d9e0a91536595 /sys/dev | |
parent | cc444f6cf55f23db4d16615150883d872ffb5bd2 (diff) | |
download | FreeBSD-src-d529ce809ac6c33dce5214535a1676e24488c282.zip FreeBSD-src-d529ce809ac6c33dce5214535a1676e24488c282.tar.gz |
Load the firmware during init not attach, as a root filesystem might
not yet be available. While here, also print the firmware version.
Submitted by: PseudoCylon
MFC after: 3 days
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/usb/wlan/if_run.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/dev/usb/wlan/if_run.c b/sys/dev/usb/wlan/if_run.c index 0a97c79..44bb12b 100644 --- a/sys/dev/usb/wlan/if_run.c +++ b/sys/dev/usb/wlan/if_run.c @@ -600,12 +600,6 @@ run_attach(device_t self) sc->mac_ver, sc->mac_rev, run_get_rf(sc->rf_rev), sc->ntxchains, sc->nrxchains, ether_sprintf(sc->sc_bssid)); - if ((error = run_load_microcode(sc)) != 0) { - device_printf(sc->sc_dev, "could not load 8051 microcode\n"); - RUN_UNLOCK(sc); - goto detach; - } - RUN_UNLOCK(sc); ifp = sc->sc_ifp = if_alloc(IFT_IEEE80211); @@ -1050,8 +1044,9 @@ run_load_microcode(struct run_softc *sc) error = ETIMEDOUT; goto fail; } - device_printf(sc->sc_dev, "firmware %s loaded\n", - (base == fw->data) ? "RT2870" : "RT3071"); + device_printf(sc->sc_dev, "firmware %s ver. %u.%u loaded\n", + (base == fw->data) ? "RT2870" : "RT3071", + *(base + 4092), *(base + 4093)); fail: firmware_put(fw, FIRMWARE_UNLOAD); @@ -4677,6 +4672,11 @@ run_init_locked(struct run_softc *sc) run_stop(sc); + if (run_load_microcode(sc) != 0) { + device_printf(sc->sc_dev, "could not load 8051 microcode\n"); + goto fail; + } + for (ntries = 0; ntries < 100; ntries++) { if (run_read(sc, RT2860_ASIC_VER_ID, &tmp) != 0) goto fail; |