Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Dec 2011 22:32:46 -0700
From:      PseudoCylon <moonlightakkiy@yahoo.ca>
To:        Erich Dollansky <erichfreebsdlist@ovitrap.com>
Cc:        freebsd-wireless@freebsd.org, Bernhard Schmidt <bschmidt@freebsd.org>
Subject:   Re: Zyxel NWD210N not accepted at boot time but after plugging it in again
Message-ID:  <CAFZ_MYJdKCW6h%2BTPWNfZWEvUnSNuujGrm0HEZ927fuY3pZoFqA@mail.gmail.com>
In-Reply-To: <201112180759.03722.erichfreebsdlist@ovitrap.com>
References:  <201112171258.56891.erichfreebsdlist@ovitrap.com> <201112171411.05872.bschmidt@freebsd.org> <CAFZ_MYK5nU-Lqun9b8NVmgHODQQj9W5Hww2DXZJjLkt3g7fkNw@mail.gmail.com> <201112180759.03722.erichfreebsdlist@ovitrap.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--14dae934046101921104b4572a7b
Content-Type: text/plain; charset=ISO-8859-1

On Sat, Dec 17, 2011 at 5:59 PM, Erich Dollansky
<erichfreebsdlist@ovitrap.com> wrote:
> Hi,
>
> On Sunday 18 December 2011 06:45:18 PseudoCylon wrote:
>> On Sat, Dec 17, 2011 at 6:11 AM, Bernhard Schmidt <bschmidt@freebsd.org> wrote:
>> > On Saturday 17 December 2011 06:58:56 Erich Dollansky wrote:
>> >
>> > run(4) tries to load the firmware on attach at which point the root
>> > filesystem isn't yet mounted. Actually I think the prefered behaviour
>> > is to load it during init, not sure this is possible for run(4)
>> > though. Someone should check this. :)
>> >
>> mmm... It seems "someone" is me.
>>
>> At the quick look, the firmware could be loaded during the init. Give
>> me a few days, I will try to change.
>>
> if you need more information, just ask me. Please do not wonder if you do not get them at the spot. I am in a very remote location where electricity is cut off during the day.
>
Actually, it was quite straight forward. The patch follows.

Also, a tarball is attached which include patch to man.4/run.4 and new
firmware. I don't know what has been changed, but I'd appreciate if
you try new firmware out.


AK

## begin patch ##

diff --git a/dev/usb/wlan/if_run.c b/dev/usb/wlan/if_run.c
index b2c3c19..ef7c62c 100644
--- a/dev/usb/wlan/if_run.c
+++ b/dev/usb/wlan/if_run.c
@@ -17,7 +17,7 @@
  */

 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/usb/wlan/if_run.c,v 1.29 2011/12/17
10:23:17 bschmidt Exp $");
+__FBSDID("$FreeBSD$");

 /*-
  * Ralink Technology RT2700U/RT2800U/RT3000U chipset driver.
@@ -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;

--14dae934046101921104b4572a7b--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFZ_MYJdKCW6h%2BTPWNfZWEvUnSNuujGrm0HEZ927fuY3pZoFqA>