From owner-freebsd-wireless@FreeBSD.ORG Sun Dec 18 05:45:32 2011 Return-Path: Delivered-To: freebsd-wireless@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 200631065673 for ; Sun, 18 Dec 2011 05:45:32 +0000 (UTC) (envelope-from moonlightakkiy@yahoo.ca) Received: from nm40-vm1.bullet.mail.ne1.yahoo.com (nm40-vm1.bullet.mail.ne1.yahoo.com [98.138.229.177]) by mx1.freebsd.org (Postfix) with SMTP id B64148FC13 for ; Sun, 18 Dec 2011 05:45:31 +0000 (UTC) Received: from [98.138.90.56] by nm40.bullet.mail.ne1.yahoo.com with NNFMP; 18 Dec 2011 05:32:47 -0000 Received: from [98.138.226.56] by tm9.bullet.mail.ne1.yahoo.com with NNFMP; 18 Dec 2011 05:32:47 -0000 Received: from [127.0.0.1] by smtp207.mail.ne1.yahoo.com with NNFMP; 18 Dec 2011 05:32:47 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.ca; s=s1024; t=1324186367; bh=8CNYcE77Po8f47uYMzTY5pzLHP23C2ppW95wp7iFadE=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Received:MIME-Version:Received:Received:In-Reply-To:References:Date:Message-ID:Subject:From:To:Cc:Content-Type; b=00nmnDW6fkdtBePn/xmGrfSldGUVyc8Gv282V1YW4PwfzwO5O4Q+o9Hn/F/kf11BUZqItOClaNUnXo728cwBu/4JxD7IeSQXxfDCl6IPvcGOjQ9EmOt1H824kVKH0NnESY/cX/8A+hj1useXeXIXVSV4+XvUS9O2P6PlzjMcTZ4= X-Yahoo-Newman-Id: 316131.14232.bm@smtp207.mail.ne1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: bbra69AVM1lS5P4IUYHJp.gVF6wCabUOqWOHcvkgaZhyoeL .msenusc9Qoiqz8z4V5STEJU1mGmREZLFSLnhTn9pjC1SRkhnmi2VdNXtGTM e3fujrFS31qTxHvXyVgWHDL8.clIk40ge_qV.xCXVCpoe80CZeOdk0fMqWjU PVs3ojVIyxUDMe9o3SHP_p18x93YB8l3Fiyzw9_f6LOUEVfK2Z26ehPEM..G .691VM143VTIsBOA2NHEnpocujnwi.RcHmYB7gRPuVsQVTPzm9MdD3XVPanJ AdQ_5n8F22AHjd2WhrEhSonJ_snfHTRe1KFsCstK6QX_xBFcC0cRuhWYkpCl CBSa4f_fEs22AQacm6tIhwp3K3yxttZFOf7gCi27TTHppPnurBDZoDseicGC gGu2cp6Lk0Zv8zBohb0BfqWQ7xhuM2lg_nXI- X-Yahoo-SMTP: Xr6qjFWswBAEmd20sAvB4Q3keqXvXsIH9TjJ Received: from mail-iy0-f182.google.com (moonlightakkiy@209.85.210.182 with plain) by smtp207.mail.ne1.yahoo.com with SMTP; 17 Dec 2011 21:32:47 -0800 PST Received: by iadj38 with SMTP id j38so3950189iad.13 for ; Sat, 17 Dec 2011 21:32:46 -0800 (PST) MIME-Version: 1.0 Received: by 10.50.236.5 with SMTP id uq5mr19685250igc.47.1324186366742; Sat, 17 Dec 2011 21:32:46 -0800 (PST) Received: by 10.231.190.81 with HTTP; Sat, 17 Dec 2011 21:32:46 -0800 (PST) In-Reply-To: <201112180759.03722.erichfreebsdlist@ovitrap.com> References: <201112171258.56891.erichfreebsdlist@ovitrap.com> <201112171411.05872.bschmidt@freebsd.org> <201112180759.03722.erichfreebsdlist@ovitrap.com> Date: Sat, 17 Dec 2011 22:32:46 -0700 Message-ID: From: PseudoCylon To: Erich Dollansky Content-Type: multipart/mixed; boundary=14dae934046101921104b4572a7b X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: freebsd-wireless@freebsd.org, Bernhard Schmidt Subject: Re: Zyxel NWD210N not accepted at boot time but after plugging it in again X-BeenThere: freebsd-wireless@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussions of 802.11 stack, tools device driver development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Dec 2011 05:45:32 -0000 --14dae934046101921104b4572a7b Content-Type: text/plain; charset=ISO-8859-1 On Sat, Dec 17, 2011 at 5:59 PM, Erich Dollansky wrote: > Hi, > > On Sunday 18 December 2011 06:45:18 PseudoCylon wrote: >> On Sat, Dec 17, 2011 at 6:11 AM, Bernhard Schmidt 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 -__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--