From owner-freebsd-questions@FreeBSD.ORG Fri Jan 4 05:56:24 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D79A7B2C for ; Fri, 4 Jan 2013 05:56:24 +0000 (UTC) (envelope-from zhao6014@gmail.com) Received: from mail-wg0-f48.google.com (mail-wg0-f48.google.com [74.125.82.48]) by mx1.freebsd.org (Postfix) with ESMTP id 43C95D00 for ; Fri, 4 Jan 2013 05:56:23 +0000 (UTC) Received: by mail-wg0-f48.google.com with SMTP id dt10so7237899wgb.15 for ; Thu, 03 Jan 2013 21:56:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=3bWMNK5zAYUJLRBB7pP6zO/jB/Ov85YhX2RicWtHfO0=; b=Vg+POTbNjr+dr9DnEX1q6DXoH3q1z1R3UnIvETZQXhmovLfwxQkNSjZsRHNpL7wCpt jXSpP31HYB122Z2tGNVLtEjpMu4CZXRoS6W9CY2yb72ob+ANVqIagJ5gd6wStLeeyH6f k96L1miqg8/plhabvEOQpzkhbczLfVi9/XvwgUMB6N+57T4i+2tcIGCX3110jtdPbOq2 v5l+8gziIc2KH+vBMxxKA1qiJy9neHhcZl7pxcjFMGIoPG0aPuFpUf6m7tl8C6evwt0J iN0+29GNG01F4ZXpoaj4CKV80Qr8GfjlUQiFxXApny846VufgMVmfxZ8+SZVNnsvC9Jm wMKg== Received: by 10.194.76.99 with SMTP id j3mr82371114wjw.47.1357278982926; Thu, 03 Jan 2013 21:56:22 -0800 (PST) MIME-Version: 1.0 Received: by 10.194.47.71 with HTTP; Thu, 3 Jan 2013 21:56:02 -0800 (PST) In-Reply-To: References: From: Jov Date: Fri, 4 Jan 2013 13:56:02 +0800 Message-ID: Subject: Re: buffalo wli-uc-gn wireless card sometimes unusable and emit "run0: wcid=xx out of range" To: PseudoCylon Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2013 05:56:24 -0000 PR url:http://www.freebsd.org/cgi/ query-pr.cgi?pr=3D174963 thanks! 2013/1/4 Jov > feedback: > the patch is fine for me=EF=BC=8Cit works great! Thank you very much! > > do I need send a PR for this problem? > > 2013/1/1 Jov > >> thanks very much=EF=BC=8Ci will try the patch. >> >> jov >> =E5=9C=A8 2013-1-1 =E4=B8=8B=E5=8D=881:19=EF=BC=8C"PseudoCylon" =E5=86=99=E9=81=93=EF=BC=9A >> >> > Message: 13 >>> > Date: Mon, 31 Dec 2012 18:11:04 +0800 >>> > From: Jov >>> > To: freebsd-questions@freebsd.org >>> > Subject: buffalo wli-uc-gn wireless card sometimes unusable and emit >>> > "run0: wcid=3Dxx out of range" >>> > Message-ID: >>> > < >>> CADyrUxPrP6OS2mpK51yiwoG-jKwTQ+XpOP48uZQ+Y15_oUr9Sg@mail.gmail.com> >>> > Content-Type: text/plain; charset=3DISO-8859-1 >>> > >>> > hi experts: >>> > I think the hardware is ok because I can use it in Win7. And in Freeb= sd >>> > 9.1,it works for sometime,but sometimes after system reboot or I plug >>> out & >>> > plug in the card it my unusable.on the console it emmit: >>> > "run0: wcid=3Dxx out of range" where xx is 91,87 and etc. >>> >>> Please try attached patch. >>> >>> Reboot or re-plug-in shouldn't be a cause of the problem. Receiving an >>> association ID larger than device's max (64) is the problem. You must >>> be using a high-end AP. Reboot or re-plug-in initiate re-association >>> and just happen to receive a large association ID. >>> >>> >>> AK >>> >>> >>> --begin patch-- >>> >>> diff --git a/dev/usb/wlan/if_run.c b/dev/usb/wlan/if_run.c >>> index 3d2577f..ed11d97 100644 >>> --- a/dev/usb/wlan/if_run.c >>> +++ b/dev/usb/wlan/if_run.c >>> @@ -2019,7 +2019,8 @@ run_key_set_cb(void *arg) >>> wcid =3D 0; /* NB: update WCID0 for group keys */ >>> base =3D RT2860_SKEY(RUN_VAP(vap)->rvp_id, k->wk_keyix)= ; >>> } else { >>> - wcid =3D RUN_AID2WCID(associd); >>> + wcid =3D (vap->iv_opmode =3D=3D IEEE80211_M_STA) ? >>> + 1 : RUN_AID2WCID(associd); >>> base =3D RT2860_PKEY(wcid); >>> } >>> >>> @@ -2374,9 +2375,12 @@ run_newassoc(struct ieee80211_node *ni, int isne= w) >>> struct run_softc *sc =3D ic->ic_ifp->if_softc; >>> uint8_t rate; >>> uint8_t ridx; >>> - uint8_t wcid =3D RUN_AID2WCID(ni->ni_associd); >>> + uint8_t wcid; >>> int i, j; >>> >>> + wcid =3D (vap->iv_opmode =3D=3D IEEE80211_M_STA) ? >>> + 1 : RUN_AID2WCID(ni->ni_associd); >>> + >>> if (wcid > RT2870_WCID_MAX) { >>> device_printf(sc->sc_dev, "wcid=3D%d out of range\n", >>> wcid); >>> return; >>> @@ -3044,8 +3048,12 @@ run_tx(struct run_softc *sc, struct mbuf *m, >>> struct ieee80211_node *ni) >>> txd->flags =3D qflags; >>> txwi =3D (struct rt2860_txwi *)(txd + 1); >>> txwi->xflags =3D xflags; >>> - txwi->wcid =3D IEEE80211_IS_MULTICAST(wh->i_addr1) ? >>> - 0 : RUN_AID2WCID(ni->ni_associd); >>> + if (IEEE80211_IS_MULTICAST(wh->i_addr1)) >>> + txwi->wcid =3D 0; >>> + else { >>> + txwi->wcid =3D (vap->iv_opmode =3D=3D IEEE80211_M_STA) = ? >>> + 1 : RUN_AID2WCID(ni->ni_associd); >>> + } >>> /* clear leftover garbage bits */ >>> txwi->flags =3D 0; >>> txwi->txop =3D 0; >>> >> > > > -- > jov > blog: http:amutu.com/blog > --=20 jov blog: http:amutu.com/blog