From owner-svn-src-stable-9@FreeBSD.ORG Sun Mar 25 10:59:42 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 19B951065865; Sun, 25 Mar 2012 10:59:40 +0000 (UTC) (envelope-from bschmidt@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AF1668FC1E; Sun, 25 Mar 2012 10:59:40 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q2PAxeER078443; Sun, 25 Mar 2012 10:59:40 GMT (envelope-from bschmidt@svn.freebsd.org) Received: (from bschmidt@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q2PAxeAh078441; Sun, 25 Mar 2012 10:59:40 GMT (envelope-from bschmidt@svn.freebsd.org) Message-Id: <201203251059.q2PAxeAh078441@svn.freebsd.org> From: Bernhard Schmidt Date: Sun, 25 Mar 2012 10:59:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r233460 - stable/9/sys/dev/usb/wlan X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Mar 2012 10:59:42 -0000 Author: bschmidt Date: Sun Mar 25 10:59:40 2012 New Revision: 233460 URL: http://svn.freebsd.org/changeset/base/233460 Log: MFC r233283: 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 Modified: stable/9/sys/dev/usb/wlan/if_run.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/dev/usb/wlan/if_run.c ============================================================================== --- stable/9/sys/dev/usb/wlan/if_run.c Sun Mar 25 09:23:10 2012 (r233459) +++ stable/9/sys/dev/usb/wlan/if_run.c Sun Mar 25 10:59:40 2012 (r233460) @@ -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;