summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMarcus Glocker <mglocker@cvs.openbsd.org>2007-05-03 15:06:10 +0000
committerMarcus Glocker <mglocker@cvs.openbsd.org>2007-05-03 15:06:10 +0000
commitb9d7cc502aad101142775d9c2635fefde68a77ec (patch)
tree055a62e35e5cf6618a0a31f02debf8c3f93a4dd9 /sys
parent6e1300f357ee8185b9c6fe9fb560a232531e13ac (diff)
Enable fast channel switching in monitor mode, which makes apps like
kismet happy. Previously system got very slow because at every channel switch an ENETRESET was issued. Reported and diff by Steffen Schuetz <st.sch@gmx.net>. Closes PR 5452. OK claudio@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/malo.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/sys/dev/ic/malo.c b/sys/dev/ic/malo.c
index 4458e2c7408..35d45634ab6 100644
--- a/sys/dev/ic/malo.c
+++ b/sys/dev/ic/malo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: malo.c,v 1.66 2007/04/20 17:08:34 claudio Exp $ */
+/* $OpenBSD: malo.c,v 1.67 2007/05/03 15:06:09 mglocker Exp $ */
/*
* Copyright (c) 2006 Claudio Jeker <claudio@openbsd.org>
@@ -974,6 +974,7 @@ malo_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
struct ifaddr *ifa;
struct ifreq *ifr;
int s, error = 0;
+ uint8_t chan;
s = splnet();
@@ -1005,6 +1006,21 @@ malo_ioctl(struct ifnet *ifp, u_long cmd, caddr_t data)
if (error == ENETRESET)
error = 0;
break;
+ case SIOCS80211CHANNEL:
+ /* allow fast channel switching in monitor mode */
+ error = ieee80211_ioctl(ifp, cmd, data);
+ if (error == ENETRESET &&
+ ic->ic_opmode == IEEE80211_M_MONITOR) {
+ if ((ifp->if_flags & (IFF_UP | IFF_RUNNING)) ==
+ (IFF_UP | IFF_RUNNING)) {
+ ic->ic_bss->ni_chan = ic->ic_ibss_chan;
+ chan = ieee80211_chan2ieee(ic,
+ ic->ic_bss->ni_chan);
+ malo_cmd_set_channel(sc, chan);
+ }
+ error = 0;
+ }
+ break;
default:
error = ieee80211_ioctl(ifp, cmd, data);
break;