From owner-svn-src-head@FreeBSD.ORG Sat Apr 4 08:41:03 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id DD67CE9E; Sat, 4 Apr 2015 08:41:03 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C82C6ADF; Sat, 4 Apr 2015 08:41:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t348f3YH014964; Sat, 4 Apr 2015 08:41:03 GMT (envelope-from rpaulo@FreeBSD.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t348f3Fl014948; Sat, 4 Apr 2015 08:41:03 GMT (envelope-from rpaulo@FreeBSD.org) Message-Id: <201504040841.t348f3Fl014948@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: rpaulo set sender to rpaulo@FreeBSD.org using -f From: Rui Paulo Date: Sat, 4 Apr 2015 08:41:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r281070 - head/sys/dev/usb/wlan X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 Apr 2015 08:41:04 -0000 Author: rpaulo Date: Sat Apr 4 08:41:02 2015 New Revision: 281070 URL: https://svnweb.freebsd.org/changeset/base/281070 Log: urtwn: blink the LED when scanning. Previously, the driver was trying to blink the LED in the newstate function, but that only gets called once (unlike OpenBSD's net80211 stack). Move the LED blinking to set_channel(). While there, don't try to set the channel when we switch to the SCAN state. This is already accomplished by the set_channel() function. MFC after: 1 week Modified: head/sys/dev/usb/wlan/if_urtwn.c Modified: head/sys/dev/usb/wlan/if_urtwn.c ============================================================================== --- head/sys/dev/usb/wlan/if_urtwn.c Sat Apr 4 08:36:02 2015 (r281069) +++ head/sys/dev/usb/wlan/if_urtwn.c Sat Apr 4 08:41:02 2015 (r281070) @@ -1568,14 +1568,9 @@ urtwn_newstate(struct ieee80211vap *vap, urtwn_bb_write(sc, R92C_OFDM0_AGCCORE1(1), reg); } } - /* Make link LED blink during scan. */ - urtwn_set_led(sc, URTWN_LED_LINK, !sc->ledlink); - /* Pause AC Tx queues. */ urtwn_write_1(sc, R92C_TXPAUSE, urtwn_read_1(sc, R92C_TXPAUSE) | 0x0f); - - urtwn_set_chan(sc, ic->ic_curchan, NULL); break; case IEEE80211_S_AUTH: /* Set initial gain under link. */ @@ -3131,8 +3126,13 @@ static void urtwn_set_channel(struct ieee80211com *ic) { struct urtwn_softc *sc = ic->ic_ifp->if_softc; + struct ieee80211vap *vap = TAILQ_FIRST(&ic->ic_vaps); URTWN_LOCK(sc); + if (vap->iv_state == IEEE80211_S_SCAN) { + /* Make link LED blink during scan. */ + urtwn_set_led(sc, URTWN_LED_LINK, !sc->ledlink); + } urtwn_set_chan(sc, ic->ic_curchan, NULL); URTWN_UNLOCK(sc); }