summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2002-03-28 18:23:08 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2002-03-28 18:23:08 +0000
commitd59def876bbe41324bc247f84a23d89d5fdb4b7e (patch)
tree7fb4c686a15c7fd0ce892de32fdf91a2802b0552
parent289dfc780967b4da0f7dd57c6a47f8467d6ff6a3 (diff)
i forgot these for if_wi
-rw-r--r--sys/conf/files3
-rw-r--r--sys/net/if_ieee80211.h120
-rw-r--r--sys/net/if_media.h4
3 files changed, 116 insertions, 11 deletions
diff --git a/sys/conf/files b/sys/conf/files
index 16a6d5f56da..44ee0d9404e 100644
--- a/sys/conf/files
+++ b/sys/conf/files
@@ -1,4 +1,4 @@
-# $OpenBSD: files,v 1.244 2002/03/19 02:49:20 millert Exp $
+# $OpenBSD: files,v 1.245 2002/03/28 18:23:07 mickey Exp $
# $NetBSD: files,v 1.87 1996/05/19 17:17:50 jonathan Exp $
# @(#)files.newconf 7.5 (Berkeley) 5/10/93
@@ -176,6 +176,7 @@ file dev/ic/lemac.c lc
# WaveLan
device wi: ether, ifnet, ifmedia
file dev/ic/if_wi.c wi
+file dev/ic/if_wi_hostap.c wi
# Aironet 802.11 DS Ethernet controller
device an: ether, ifnet, ifmedia
diff --git a/sys/net/if_ieee80211.h b/sys/net/if_ieee80211.h
index 93c53f44761..b9a70bd15b8 100644
--- a/sys/net/if_ieee80211.h
+++ b/sys/net/if_ieee80211.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_ieee80211.h,v 1.5 2002/02/22 05:30:43 mickey Exp $ */
+/* $OpenBSD: if_ieee80211.h,v 1.6 2002/03/28 18:23:07 mickey Exp $ */
/* $NetBSD: if_ieee80211.h,v 1.6 2000/12/12 04:03:38 thorpej Exp $ */
@@ -57,9 +57,14 @@ struct ieee80211_frame_addr4 {
#define IEEE80211_FC0_SUBTYPE_CF_END 0xe0
#define IEEE80211_FC0_SUBTYPE_CF_END_ACK 0xf0
/* for TYPE_DATA (bit combination) */
+#define IEEE80211_FC0_SUBTYPE_DATA 0x00
#define IEEE80211_FC0_SUBTYPE_CF_ACK 0x10
#define IEEE80211_FC0_SUBTYPE_CF_POLL 0x20
+#define IEEE80211_FC0_SUBTYPE_CF_ACPL 0x30
#define IEEE80211_FC0_SUBTYPE_NODATA 0x40
+#define IEEE80211_FC0_SUBTYPE_CFACK 0x50
+#define IEEE80211_FC0_SUBTYPE_CFPOLL 0x60
+#define IEEE80211_FC0_SUBTYPE_CF_ACK_CF_ACK 0x70
#define IEEE80211_FC1_DIR_MASK 0x03
#define IEEE80211_FC1_DIR_NODS 0x00 /* STA->STA */
@@ -74,9 +79,69 @@ struct ieee80211_frame_addr4 {
#define IEEE80211_FC1_WEP 0x40
#define IEEE80211_FC1_ORDER 0x80
+#define IEEE80211_NWID_LEN 32
+
/*
- * Management Frames
+ * BEACON management packets
+ *
+ * octect timestamp[8]
+ * octect beacon interval[2]
+ * octect capability information[2]
+ * information element
+ * octect elemid
+ * octect length
+ * octect information[length[
*/
+typedef u_int8_t *ieee80211_mgt_beacon_t;
+
+#define IEEE80211_BEACON_INTERVAL(beacon) (beacon[8] + (beacon[9] << 8))
+#define IEEE80211_BEACON_CAPABILITY(beacon) (beacon[10] + (beacon[11] << 8))
+
+#define IEEE80211_CAPINFO_ESS 0x01
+#define IEEE80211_CAPINFO_IBSS 0x02
+#define IEEE80211_CAPINFO_CF_POLLABLE 0x04
+#define IEEE80211_CAPINFO_CF_POLLREQ 0x08
+#define IEEE80211_CAPINFO_PRIVACY 0x10
+
+
+/*
+ * Management information elements
+ */
+
+struct ieee80211_information {
+ char ssid[IEEE80211_NWID_LEN+1];
+ struct rates {
+ u_int8_t *p;
+ } rates;
+ struct fh {
+ u_int16_t dwell;
+ u_int8_t set;
+ u_int8_t pattern;
+ u_int8_t index;
+ } fh;
+ struct ds {
+ u_int8_t channel;
+ } ds;
+ struct cf {
+ u_int8_t count;
+ u_int8_t period;
+ u_int8_t maxdur[2];
+ u_int8_t dur[2];
+ } cf;
+ struct tim {
+ u_int8_t count;
+ u_int8_t period;
+ u_int8_t bitctl;
+ /* u_int8_t pvt[251]; The driver never needs to use this */
+ } tim;
+ struct ibss {
+ u_int16_t atim;
+ } ibss;
+ struct challenge {
+ u_int8_t *p;
+ u_int8_t len;
+ } challenge;
+};
#define IEEE80211_ELEMID_SSID 0
#define IEEE80211_ELEMID_RATES 1
@@ -87,14 +152,38 @@ struct ieee80211_frame_addr4 {
#define IEEE80211_ELEMID_IBSSPARMS 6
#define IEEE80211_ELEMID_CHALLENGE 16
+/*
+ * AUTH management packets
+ *
+ * octect algo[2]
+ * octect seq[2]
+ * octect status[2]
+ * octect chal.id
+ * octect chal.length
+ * octect chal.text[253]
+ */
+typedef u_int8_t *ieee80211_mgt_auth_t;
+
+#define IEEE80211_AUTH_ALGORITHM(auth) (auth[0] + (auth[1] << 8))
+#define IEEE80211_AUTH_TRANSACTION(auth) (auth[2] + (auth[3] << 8))
+#define IEEE80211_AUTH_STATUS(auth) (auth[4] + (auth[5] << 8))
+
#define IEEE80211_AUTH_ALG_OPEN 0x0000
#define IEEE80211_AUTH_ALG_SHARED 0x0001
-#define IEEE80211_CAPINFO_ESS 0x01
-#define IEEE80211_CAPINFO_IBSS 0x02
-#define IEEE80211_CAPINFO_CF_POLLABLE 0x04
-#define IEEE80211_CAPINFO_CF_POLLREQ 0x08
-#define IEEE80211_CAPINFO_PRIVACY 0x10
+#define IEEE80211_AUTH_OPEN_REQUEST 1
+#define IEEE80211_AUTH_OPEN_RESPONSE 2
+
+#define IEEE80211_AUTH_SHARED_REQUEST 1
+#define IEEE80211_AUTH_SHARED_CHALLENGE 2
+#define IEEE80211_AUTH_SHARED_RESPONSE 3
+#define IEEE80211_AUTH_SHARED_PASS 4
+
+/*
+ * Reason codes
+ *
+ * Unlisted codes are reserved
+ */
#define IEEE80211_REASON_UNSPECIFIED 1
#define IEEE80211_REASON_AUTH_EXPIRE 2
@@ -106,6 +195,7 @@ struct ieee80211_frame_addr4 {
#define IEEE80211_REASON_ASSOC_LEAVE 8
#define IEEE80211_REASON_ASSOC_NOT_AUTHED 9
+#define IEEE80211_STATUS_SUCCESS 0
#define IEEE80211_STATUS_UNSPECIFIED 1
#define IEEE80211_STATUS_CAPINFO 10
#define IEEE80211_STATUS_NOT_ASSOCED 11
@@ -114,6 +204,8 @@ struct ieee80211_frame_addr4 {
#define IEEE80211_STATUS_SEQUENCE 14
#define IEEE80211_STATUS_CHALLENGE 15
#define IEEE80211_STATUS_TIMEOUT 16
+#define IEEE80211_STATUS_TOO_MANY_STATIONS 17
+#define IEEE80211_STATUS_RATES 18
#define IEEE80211_WEP_KEYLEN 5 /* 40bit */
#define IEEE80211_WEP_IVLEN 3 /* 24bit */
@@ -121,8 +213,6 @@ struct ieee80211_frame_addr4 {
#define IEEE80211_WEP_CRCLEN 4 /* CRC-32 */
#define IEEE80211_WEP_NKID 4 /* number of key ids */
-#define IEEE80211_NWID_LEN 32
-
/* nwid is pointed at by ifr.ifr_data */
struct ieee80211_nwid {
u_int8_t i_len;
@@ -159,4 +249,16 @@ struct ieee80211_power {
#define SIOCS80211POWER _IOW('i', 234, struct ieee80211_power)
#define SIOCG80211POWER _IOWR('i', 235, struct ieee80211_power)
+struct ieee80211_auth {
+ char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */
+ int i_authtype;
+};
+
+#define IEEE80211_AUTH_NONE 0
+#define IEEE80211_AUTH_OPEN 1
+#define IEEE80211_AUTH_SHARED 2
+
+#define SIOCS80211AUTH _IOW('i', 240, struct ieee80211_auth)
+#define SIOCG80211AUTH _IOWR('i', 240, struct ieee80211_auth)
+
#endif /* _NET_IF_IEEE80211_H_ */
diff --git a/sys/net/if_media.h b/sys/net/if_media.h
index 4ab75610aa1..8726a19fb66 100644
--- a/sys/net/if_media.h
+++ b/sys/net/if_media.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_media.h,v 1.8 2002/03/14 01:27:09 millert Exp $ */
+/* $OpenBSD: if_media.h,v 1.9 2002/03/28 18:23:07 mickey Exp $ */
/* $NetBSD: if_media.h,v 1.22 2000/02/17 21:53:16 sommerfeld Exp $ */
/*-
@@ -213,6 +213,7 @@ int ifmedia_baudrate(int);
#define IFM_IEEE80211_DS11 7 /* Direct Sequence 11Mbps*/
#define IFM_IEEE80211_DS1 8 /* Direct Sequence 1Mbps*/
#define IFM_IEEE80211_ADHOC 0x100 /* Operate in Adhoc mode */
+#define IFM_IEEE80211_HOSTAP 0x200 /* Operate in Host AP mode */
/*
* Shared media sub-types
@@ -402,6 +403,7 @@ struct ifmedia_description {
{ IFM_FDDI|IFM_FDDI_DA, "das" }, \
\
{ IFM_IEEE80211|IFM_IEEE80211_ADHOC, "adhoc" }, \
+ { IFM_IEEE80211|IFM_IEEE80211_HOSTAP, "hostap" }, \
\
{ 0, NULL }, \
}