summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorReyk Floeter <reyk@cvs.openbsd.org>2006-06-27 20:55:52 +0000
committerReyk Floeter <reyk@cvs.openbsd.org>2006-06-27 20:55:52 +0000
commitecc659c5fc44a1aedeab96ad777ecbe242dc948b (patch)
treedda2582d044b87c245476cbef360b7a62a3bb2ad /sys/dev
parent5046f1f7e79cb5ed4b71d01dfe3a049622849a58 (diff)
add the net80211 hostap options "nwflag hidenwid" for hidden SSID mode
and "nwflag nobridge" to prevent inter-station communications. "hidenwid" will also work with wi(4) to replace the old -E 3 option of wicontrol. ok damien@ jmc@
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/if_wi.c36
-rw-r--r--sys/dev/ic/if_wi_ieee.h5
2 files changed, 38 insertions, 3 deletions
diff --git a/sys/dev/ic/if_wi.c b/sys/dev/ic/if_wi.c
index 52e2b024479..be80a746fa4 100644
--- a/sys/dev/ic/if_wi.c
+++ b/sys/dev/ic/if_wi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wi.c,v 1.130 2006/06/27 09:48:02 reyk Exp $ */
+/* $OpenBSD: if_wi.c,v 1.131 2006/06/27 20:55:51 reyk Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -127,7 +127,7 @@ u_int32_t widebug = WIDEBUG;
#if !defined(lint) && !defined(__OpenBSD__)
static const char rcsid[] =
- "$OpenBSD: if_wi.c,v 1.130 2006/06/27 09:48:02 reyk Exp $";
+ "$OpenBSD: if_wi.c,v 1.131 2006/06/27 20:55:51 reyk Exp $";
#endif /* lint */
#ifdef foo
@@ -1550,6 +1550,7 @@ wi_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
struct wi_scan_res *res;
struct wi_scan_p2_hdr *p2;
struct wi_req wreq;
+ u_int32_t flags;
struct ieee80211_nwid nwid;
struct ieee80211_nodereq nr;
@@ -1984,6 +1985,37 @@ wi_ioctl(struct ifnet *ifp, u_long command, caddr_t data)
na->na_nodes++;
}
break;
+ case SIOCG80211FLAGS:
+ if (sc->wi_ptype != WI_PORTTYPE_HOSTAP)
+ break;
+ ifr->ifr_flags = 0;
+ if (sc->wi_flags & WI_FLAGS_HAS_ENH_SECURITY) {
+ wreq.wi_len = WI_MAX_DATALEN;
+ wreq.wi_type = WI_RID_ENH_SECURITY;
+ if (wi_read_record(sc, (struct wi_ltv_gen *)&wreq)) {
+ error = EINVAL;
+ break;
+ }
+ sc->wi_enh_security = letoh16(wreq.wi_val[0]);
+ if (sc->wi_enh_security == WI_HIDESSID_IGNPROBES)
+ ifr->ifr_flags |= IEEE80211_F_HIDENWID >>
+ IEEE80211_F_USERSHIFT;
+ }
+ break;
+ case SIOCS80211FLAGS:
+ if ((error = suser(curproc, 0)) != 0)
+ break;
+ if (sc->wi_ptype != WI_PORTTYPE_HOSTAP) {
+ error = EINVAL;
+ break;
+ }
+ flags = (u_int32_t)ifr->ifr_flags << IEEE80211_F_USERSHIFT;
+ if (sc->wi_flags & WI_FLAGS_HAS_ENH_SECURITY) {
+ sc->wi_enh_security = (flags & IEEE80211_F_HIDENWID) ?
+ WI_HIDESSID_IGNPROBES : 0;
+ WI_SETVAL(WI_RID_ENH_SECURITY, sc->wi_enh_security);
+ }
+ break;
case SIOCHOSTAP_ADD:
case SIOCHOSTAP_DEL:
case SIOCHOSTAP_GET:
diff --git a/sys/dev/ic/if_wi_ieee.h b/sys/dev/ic/if_wi_ieee.h
index aa084f199fa..140e1577235 100644
--- a/sys/dev/ic/if_wi_ieee.h
+++ b/sys/dev/ic/if_wi_ieee.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wi_ieee.h,v 1.28 2006/06/27 09:48:02 reyk Exp $ */
+/* $OpenBSD: if_wi_ieee.h,v 1.29 2006/06/27 20:55:51 reyk Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -226,6 +226,9 @@ struct wi_counters {
#define WI_RID_ROAMING_MODE 0xFC2D /* Roaming mode (1:firm,3:disable) */
#define WI_RID_CUR_BEACON_INT 0xFC33 /* beacon xmit time for BSS creation */
#define WI_RID_ENH_SECURITY 0xFC43 /* hide SSID name (prism fw >= 1.6.3) */
+#define WI_HIDESSID 0x01
+#define WI_IGNPROBES 0x02
+#define WI_HIDESSID_IGNPROBES 0x03
#define WI_RID_DBM_ADJUST 0xFC46 /* Get DBM adjustment factor */
#define WI_RID_SYMBOL_PREAMBLE 0xFC8C /* Enable/disable short preamble */
#define WI_RID_P2_SHORT_PREAMBLE 0xFCB0 /* Short preamble support */