From owner-freebsd-usb@FreeBSD.ORG Fri Jan 4 05:30:00 2013 Return-Path: Delivered-To: freebsd-usb@smarthost.ysv.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 BF7E81AD for ; Fri, 4 Jan 2013 05:30:00 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id A6F77A3C for ; Fri, 4 Jan 2013 05:30:00 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id r045U0wf000562 for ; Fri, 4 Jan 2013 05:30:00 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id r045U0qM000557; Fri, 4 Jan 2013 05:30:00 GMT (envelope-from gnats) Resent-Date: Fri, 4 Jan 2013 05:30:00 GMT Resent-Message-Id: <201301040530.r045U0qM000557@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-usb@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, jov Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 882BA19E for ; Fri, 4 Jan 2013 05:25:32 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22]) by mx1.freebsd.org (Postfix) with ESMTP id 6FD00A32 for ; Fri, 4 Jan 2013 05:25:32 +0000 (UTC) Received: from red.freebsd.org (localhost [127.0.0.1]) by red.freebsd.org (8.14.5/8.14.5) with ESMTP id r045PWAE047250 for ; Fri, 4 Jan 2013 05:25:32 GMT (envelope-from nobody@red.freebsd.org) Received: (from nobody@localhost) by red.freebsd.org (8.14.5/8.14.5/Submit) id r045PW02047249; Fri, 4 Jan 2013 05:25:32 GMT (envelope-from nobody) Message-Id: <201301040525.r045PW02047249@red.freebsd.org> Date: Fri, 4 Jan 2013 05:25:32 GMT From: jov To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Subject: usb/174963: buffalo wli-uc-gn wireless card sometimes unusable and emit "run0: wcid=xx out of range" X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2013 05:30:00 -0000 >Number: 174963 >Category: usb >Synopsis: buffalo wli-uc-gn wireless card sometimes unusable and emit "run0: wcid=xx out of range" >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-usb >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Fri Jan 04 05:30:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: jov >Release: 9.1 release >Organization: >Environment: fresh system,no custom kernel.but now I can't get it because I rebuild the kernel with the patch. >Description: I think the hardware is ok because I can use it in Win7. And in Freebsd 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=xx out of range" where xx is 91,87 and etc. it seams the wifi is connected because ifconfig wlan0 cmd shows the right ssid and bssid ,but inet addr is always 0.0.0.0 >How-To-Repeat: I plug out & plug in the card some times >Fix: thanks for PseudoCylon 's help, his patch solves the problem. 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 = 0; /* NB: update WCID0 for group keys */ base = RT2860_SKEY(RUN_VAP(vap)->rvp_id, k->wk_keyix); } else { - wcid = RUN_AID2WCID(associd); + wcid = (vap->iv_opmode == IEEE80211_M_STA) ? + 1 : RUN_AID2WCID(associd); base = RT2860_PKEY(wcid); } @@ -2374,9 +2375,12 @@ run_newassoc(struct ieee80211_node *ni, int isnew) struct run_softc *sc = ic->ic_ifp->if_softc; uint8_t rate; uint8_t ridx; - uint8_t wcid = RUN_AID2WCID(ni->ni_associd); + uint8_t wcid; int i, j; + wcid = (vap->iv_opmode == IEEE80211_M_STA) ? + 1 : RUN_AID2WCID(ni->ni_associd); + if (wcid > RT2870_WCID_MAX) { device_printf(sc->sc_dev, "wcid=%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 = qflags; txwi = (struct rt2860_txwi *)(txd + 1); txwi->xflags = xflags; - txwi->wcid = IEEE80211_IS_MULTICAST(wh->i_addr1) ? - 0 : RUN_AID2WCID(ni->ni_associd); + if (IEEE80211_IS_MULTICAST(wh->i_addr1)) + txwi->wcid = 0; + else { + txwi->wcid = (vap->iv_opmode == IEEE80211_M_STA) ? + 1 : RUN_AID2WCID(ni->ni_associd); + } /* clear leftover garbage bits */ txwi->flags = 0; txwi->txop = 0; >Release-Note: >Audit-Trail: >Unformatted: