svn commit: r191203 - user/thompsa/vaptq/sys/dev/wpi
Andrew Thompson
thompsa at FreeBSD.org
Fri Apr 17 07:58:04 PDT 2009
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
More information about the svn-src-user
mailing list