From owner-freebsd-questions@FreeBSD.ORG Tue Jan 1 05:23:20 2013 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 5BB81304 for ; Tue, 1 Jan 2013 05:23:20 +0000 (UTC) (envelope-from moonlightakkiy@yahoo.ca) Received: from nm37-vm6.bullet.mail.ne1.yahoo.com (nm37-vm6.bullet.mail.ne1.yahoo.com [98.138.229.134]) by mx1.freebsd.org (Postfix) with ESMTP id EE0288FC08 for ; Tue, 1 Jan 2013 05:23:19 +0000 (UTC) Received: from [98.138.90.51] by nm37.bullet.mail.ne1.yahoo.com with NNFMP; 01 Jan 2013 05:19:58 -0000 Received: from [98.138.84.47] by tm4.bullet.mail.ne1.yahoo.com with NNFMP; 01 Jan 2013 05:19:58 -0000 Received: from [127.0.0.1] by smtp115.mail.ne1.yahoo.com with NNFMP; 01 Jan 2013 05:19:58 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.ca; s=s1024; t=1357017598; bh=eBP3PJlab5ApkGESYgt9mlpj+eXtTsX16Pc5PriVyRo=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Received:MIME-Version:Received:Received:Date:Message-ID:Subject:From:To:Content-Type; b=XI+5Mu87E31A62BDObh9IAQPxsyfkGfPax5ROG3MwrsLQQwSgxDHtusl4YMmpI+Y3LbrT7cYNM3jPauBY24VXZ7C6chHwQUAEZzvBmH8CCtOaITHkEo5rr0mO9x8a/y2lNIcPLid95PVAU/g5XaeFwvRl0tanqE96s5vDfmcIMg= X-Yahoo-Newman-Id: 28780.96433.bm@smtp115.mail.ne1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: Bo7grtEVM1nELK9aaWcUozsU_L7euKbxMSMofsA4bjQj.cn 2hYbVLznWVORKJNYSraYtrf5PIPZnWYpCeDGgcSyaUK2DIsP1mYfJlqQjAyq AwzxcPek.8TkCElGcLhuFcDuM._RuDgWiniTjC4l5Dxs_vVM8o3segWL4tCJ OIxuKeg2dFd1n7kK1TPUOKrsZF8B2okWd05CIhzz4f.VPs.BPZOINkr4FKGU pg21AX5CZTs5PMvbbtrZkYsB7MyX.qQ4UmV_FONziCTnajViOgamJTwS1AGN rgtmWz_auib2ci92l7JlB71e3xOQEXe1UO3D7jMWJSwIaQjdcMkmxotkaIFR vTFHCBZ2a1rjE0wYlLYXK0ZHszLe4dwk5MdI_xBkjLYProt6AbhTmRSgLCUn jsRRevyCiQ6FcG_VLP4mbWE51fdQdtr_ih5E49vheev6uIYx7VFSJNjLAa8W Nh1QQJzVbH0upjNFC1A-- X-Yahoo-SMTP: Xr6qjFWswBAEmd20sAvB4Q3keqXvXsIH9TjJ Received: from mail-vb0-f48.google.com (moonlightakkiy@209.85.212.48 with plain) by smtp115.mail.ne1.yahoo.com with SMTP; 31 Dec 2012 21:19:57 -0800 PST Received: by mail-vb0-f48.google.com with SMTP id fc21so13235848vbb.35 for ; Mon, 31 Dec 2012 21:19:57 -0800 (PST) MIME-Version: 1.0 Received: by 10.220.239.14 with SMTP id ku14mr66107687vcb.57.1357017597375; Mon, 31 Dec 2012 21:19:57 -0800 (PST) Received: by 10.58.182.72 with HTTP; Mon, 31 Dec 2012 21:19:57 -0800 (PST) Date: Mon, 31 Dec 2012 22:19:57 -0700 Message-ID: Subject: Re: buffalo wli-uc-gn wireless card sometimes unusable and emit "run0: wcid=xx out of range" From: PseudoCylon To: Jov , freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 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: Tue, 01 Jan 2013 05:23:20 -0000 > 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=xx out of range" > Message-ID: > > Content-Type: text/plain; charset=ISO-8859-1 > > hi experts: > 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. 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 = 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;