From owner-svn-src-user@FreeBSD.ORG Fri Apr 17 14:58:03 2009 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 66508106567B; Fri, 17 Apr 2009 14:58:03 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 47E608FC0C; Fri, 17 Apr 2009 14:58:03 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n3HEw3m1025561; Fri, 17 Apr 2009 14:58:03 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n3HEw3ti025559; Fri, 17 Apr 2009 14:58:03 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904171458.n3HEw3ti025559@svn.freebsd.org> From: Andrew Thompson Date: Fri, 17 Apr 2009 14:58:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r191203 - user/thompsa/vaptq/sys/dev/wpi X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 17 Apr 2009 14:58:04 -0000 Author: thompsa Date: Fri Apr 17 14:58:02 2009 New Revision: 191203 URL: http://svn.freebsd.org/changeset/base/191203 Log: Convert wpi(4) to use sync scanning calls, missed in the previous round. Modified: user/thompsa/vaptq/sys/dev/wpi/if_wpi.c user/thompsa/vaptq/sys/dev/wpi/if_wpivar.h Modified: user/thompsa/vaptq/sys/dev/wpi/if_wpi.c ============================================================================== --- user/thompsa/vaptq/sys/dev/wpi/if_wpi.c Fri Apr 17 14:19:18 2009 (r191202) +++ user/thompsa/vaptq/sys/dev/wpi/if_wpi.c Fri Apr 17 14:58:02 2009 (r191203) @@ -3536,7 +3536,9 @@ wpi_scan_start(struct ieee80211com *ic) struct ifnet *ifp = ic->ic_ifp; struct wpi_softc *sc = ifp->if_softc; - wpi_queue_cmd(sc, WPI_SCAN_START, 0, WPI_QUEUE_NORMAL); + WPI_LOCK(sc); + wpi_set_led(sc, WPI_LED_LINK, 20, 2); + WPI_UNLOCK(sc); } /** @@ -3547,10 +3549,7 @@ wpi_scan_start(struct ieee80211com *ic) static void wpi_scan_end(struct ieee80211com *ic) { - struct ifnet *ifp = ic->ic_ifp; - struct wpi_softc *sc = ifp->if_softc; - - wpi_queue_cmd(sc, WPI_SCAN_STOP, 0, WPI_QUEUE_NORMAL); + /* XXX ignore */ } /** @@ -3567,8 +3566,12 @@ wpi_set_channel(struct ieee80211com *ic) * Only need to set the channel in Monitor mode. AP scanning and auth * are already taken care of by their respective firmware commands. */ - if (ic->ic_opmode == IEEE80211_M_MONITOR) - wpi_queue_cmd(sc, WPI_SET_CHAN, 0, WPI_QUEUE_NORMAL); + if (ic->ic_opmode == IEEE80211_M_MONITOR) { + error = wpi_config(sc); + if (error != 0) + device_printf(sc->sc_dev, + "error %d settting channel\n", error); + } } /** @@ -3583,7 +3586,10 @@ wpi_scan_curchan(struct ieee80211_scan_s struct ifnet *ifp = vap->iv_ic->ic_ifp; struct wpi_softc *sc = ifp->if_softc; - wpi_queue_cmd(sc, WPI_SCAN_CURCHAN, 0, WPI_QUEUE_NORMAL); + WPI_LOCK(sc); + if (wpi_scan(sc)) + ieee80211_cancel_scan(vap); + WPI_UNLOCK(sc); } /** @@ -3634,47 +3640,11 @@ again: switch (cmd) { case WPI_RESTART: wpi_init_locked(sc, 0); - WPI_UNLOCK(sc); - return; case WPI_RF_RESTART: wpi_rfkill_resume(sc); - WPI_UNLOCK(sc); - return; - } - - if (!(sc->sc_ifp->if_drv_flags & IFF_DRV_RUNNING)) { - WPI_UNLOCK(sc); - return; - } - - switch (cmd) { - case WPI_SCAN_START: - /* make the link LED blink while we're scanning */ - wpi_set_led(sc, WPI_LED_LINK, 20, 2); - sc->flags |= WPI_FLAG_SCANNING; - break; - - case WPI_SCAN_STOP: - sc->flags &= ~WPI_FLAG_SCANNING; - break; - - case WPI_SCAN_CURCHAN: - if (wpi_scan(sc)) - ieee80211_cancel_scan(vap); - break; - - case WPI_SET_CHAN: - error = wpi_config(sc); - if (error != 0) - device_printf(sc->sc_dev, - "error %d settting channel\n", error); - break; } WPI_UNLOCK(sc); - - /* Take another pass */ - goto again; } /** Modified: user/thompsa/vaptq/sys/dev/wpi/if_wpivar.h ============================================================================== --- user/thompsa/vaptq/sys/dev/wpi/if_wpivar.h Fri Apr 17 14:19:18 2009 (r191202) +++ user/thompsa/vaptq/sys/dev/wpi/if_wpivar.h Fri Apr 17 14:58:02 2009 (r191203) @@ -194,12 +194,8 @@ struct wpi_softc { struct wpi_dma_info fw_dma; /* command queue related variables */ -#define WPI_SCAN_START (1<<0) -#define WPI_SCAN_CURCHAN (1<<1) -#define WPI_SCAN_STOP (1<<2) -#define WPI_SET_CHAN (1<<3) -#define WPI_RESTART (1<<4) -#define WPI_RF_RESTART (1<<5) +#define WPI_RESTART (1<<0) +#define WPI_RF_RESTART (1<<1) #define WPI_CMD_MAXOPS 10 /* command queuing request type */ #define WPI_QUEUE_NORMAL 0