Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb add SIOCS80211CHANNEL special handling in monito...



details:   https://anonhg.NetBSD.org/src/rev/783bb1f56271
branches:  trunk
changeset: 997428:783bb1f56271
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Mar 07 14:55:49 2019 +0000

description:
add SIOCS80211CHANNEL special handling in monitor mode (from OpenBSD)

diffstat:

 sys/dev/usb/if_urtwn.c |  19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diffs (40 lines):

diff -r 344c5c3417b5 -r 783bb1f56271 sys/dev/usb/if_urtwn.c
--- a/sys/dev/usb/if_urtwn.c    Thu Mar 07 14:40:35 2019 +0000
+++ b/sys/dev/usb/if_urtwn.c    Thu Mar 07 14:55:49 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_urtwn.c,v 1.68 2019/02/01 03:20:35 christos Exp $   */
+/*     $NetBSD: if_urtwn.c,v 1.69 2019/03/07 14:55:49 christos Exp $   */
 /*     $OpenBSD: if_urtwn.c,v 1.42 2015/02/10 23:25:46 mpi Exp $       */
 
 /*-
@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.68 2019/02/01 03:20:35 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_urtwn.c,v 1.69 2019/03/07 14:55:49 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -2974,6 +2974,21 @@
                }
                break;
 
+       case SIOCS80211CHANNEL:
+               /*
+                * This allows for fast channel switching in monitor mode
+                * (used by kismet). In IBSS mode, we must explicitly reset
+                * the interface to generate a new beacon frame.
+                */
+               error = ieee80211_ioctl(ic, cmd, data);
+               if (error == ENETRESET &&
+                   ic->ic_opmode == IEEE80211_M_MONITOR) {
+                       urtwn_set_chan(sc, ic->ic_curchan,
+                           IEEE80211_HTINFO_2NDCHAN_NONE);
+                       error = 0;
+               }
+               break;
+
        default:
                error = ieee80211_ioctl(ic, cmd, data);
                break;



Home | Main Index | Thread Index | Old Index