Zyxel NWD210N not accepted at boot time but after plugging it in again

PseudoCylon moonlightakkiy at yahoo.ca
Sun Dec 18 05:45:32 UTC 2011


On Sat, Dec 17, 2011 at 5:59 PM, Erich Dollansky
<erichfreebsdlist at 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 at 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;


More information about the freebsd-wireless mailing list