From: Sepherosa Ziehau Date: Sun, 14 May 2006 01:28:54 +0000 (+0000) Subject: Nuke duplicated header files, which restores `buildworld' X-Git-Tag: v2.0.1~4944 X-Git-Url: https://gitweb.dragonflybsd.org/~tuxillo/dragonfly.git/commitdiff_plain/35fc1b9292ed990051cdfa90069b32cf2c01bbdb Nuke duplicated header files, which restores `buildworld' --- diff --git a/sys/netproto/802_11/wlan/ieee80211.h b/sys/netproto/802_11/wlan/ieee80211.h deleted file mode 100644 index a2843621d7..0000000000 --- a/sys/netproto/802_11/wlan/ieee80211.h +++ /dev/null @@ -1,538 +0,0 @@ -/* - * Copyright (c) 2001 Atsushi Onoe - * Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * Alternatively, this software may be distributed under the terms of the - * GNU General Public License ("GPL") version 2 as published by the Free - * Software Foundation. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD: src/sys/net80211/ieee80211.h,v 1.5 2004/04/05 17:47:40 sam Exp $ - * $DragonFly: src/sys/netproto/802_11/wlan/Attic/ieee80211.h,v 1.1 2004/07/26 16:30:17 joerg Exp $ - */ - -#ifndef _NETPROTO_802_11_IEEE80211_H_ -#define _NETPROTO_802_11_IEEE80211_H_ - -/* - * 802.11 protocol definitions. - */ - -#define IEEE80211_ADDR_LEN 6 /* size of 802.11 address */ -/* is 802.11 address multicast/broadcast? */ -#define IEEE80211_IS_MULTICAST(a) ETHER_IS_MULTICAST(a) - -/* IEEE 802.11 PLCP header */ -struct ieee80211_plcp_hdr { - uint16_t i_sfd; - uint8_t i_signal; - uint8_t i_service; - uint16_t i_length; - uint16_t i_crc; -} __attribute__((__packed__)); - -#define IEEE80211_PLCP_SFD 0xF3A0 -#define IEEE80211_PLCP_SERVICE 0x00 - -/* - * generic definitions for IEEE 802.11 frames - */ -struct ieee80211_frame { - uint8_t i_fc[2]; - uint8_t i_dur[2]; - uint8_t i_addr1[IEEE80211_ADDR_LEN]; - uint8_t i_addr2[IEEE80211_ADDR_LEN]; - uint8_t i_addr3[IEEE80211_ADDR_LEN]; - uint8_t i_seq[2]; - /* possibly followed by addr4[IEEE80211_ADDR_LEN]; */ - /* see below */ -} __attribute__((__packed__)); - -struct ieee80211_qosframe { - uint8_t i_fc[2]; - uint8_t i_dur[2]; - uint8_t i_addr1[IEEE80211_ADDR_LEN]; - uint8_t i_addr2[IEEE80211_ADDR_LEN]; - uint8_t i_addr3[IEEE80211_ADDR_LEN]; - uint8_t i_seq[2]; - uint8_t i_qos[2]; - /* possibly followed by addr4[IEEE80211_ADDR_LEN]; */ - /* see below */ -} __attribute__((__packed__)); - -struct ieee80211_qoscntl { - uint8_t i_qos[2]; -}; - -struct ieee80211_frame_addr4 { - uint8_t i_fc[2]; - uint8_t i_dur[2]; - uint8_t i_addr1[IEEE80211_ADDR_LEN]; - uint8_t i_addr2[IEEE80211_ADDR_LEN]; - uint8_t i_addr3[IEEE80211_ADDR_LEN]; - uint8_t i_seq[2]; - uint8_t i_addr4[IEEE80211_ADDR_LEN]; -} __attribute__((__packed__)); - - -struct ieee80211_qosframe_addr4 { - uint8_t i_fc[2]; - uint8_t i_dur[2]; - uint8_t i_addr1[IEEE80211_ADDR_LEN]; - uint8_t i_addr2[IEEE80211_ADDR_LEN]; - uint8_t i_addr3[IEEE80211_ADDR_LEN]; - uint8_t i_seq[2]; - uint8_t i_addr4[IEEE80211_ADDR_LEN]; - uint8_t i_qos[2]; -} __attribute__((__packed__)); - -/* - * Management Notification Frame - */ -struct ieee80211_mnf { - uint8_t mnf_category; - uint8_t mnf_action; - uint8_t mnf_dialog; - uint8_t mnf_status; -} __attribute__((__packed__)); -#define MNF_SETUP_REQ 0 -#define MNF_SETUP_RESP 1 -#define MNF_TEARDOWN 2 - -/* - * WME/802.11e Tspec Element - */ -struct ieee80211_wme_tspec { - uint8_t ts_id; - uint8_t ts_len; - uint8_t ts_oui[3]; - uint8_t ts_oui_type; - uint8_t ts_oui_subtype; - uint8_t ts_version; - uint8_t ts_tsinfo[3]; - uint8_t ts_nom_msdu[2]; - uint8_t ts_max_msdu[2]; - uint8_t ts_min_svc[4]; - uint8_t ts_max_svc[4]; - uint8_t ts_inactv_intv[4]; - uint8_t ts_susp_intv[4]; - uint8_t ts_start_svc[4]; - uint8_t ts_min_rate[4]; - uint8_t ts_mean_rate[4]; - uint8_t ts_max_burst[4]; - uint8_t ts_min_phy[4]; - uint8_t ts_peak_rate[4]; - uint8_t ts_delay[4]; - uint8_t ts_surplus[2]; - uint8_t ts_medium_time[2]; -} __attribute__((__packed__)); - -#define IEEE80211_FC0_VERSION_MASK 0x03 -#define IEEE80211_FC0_VERSION_SHIFT 0 -#define IEEE80211_FC0_VERSION_0 0x00 -#define IEEE80211_FC0_TYPE_MASK 0x0c -#define IEEE80211_FC0_TYPE_SHIFT 2 -#define IEEE80211_FC0_TYPE_MGT 0x00 -#define IEEE80211_FC0_TYPE_CTL 0x04 -#define IEEE80211_FC0_TYPE_DATA 0x08 - -#define IEEE80211_FC0_SUBTYPE_MASK 0xf0 -#define IEEE80211_FC0_SUBTYPE_SHIFT 4 -/* for TYPE_MGT */ -#define IEEE80211_FC0_SUBTYPE_ASSOC_REQ 0x00 -#define IEEE80211_FC0_SUBTYPE_ASSOC_RESP 0x10 -#define IEEE80211_FC0_SUBTYPE_REASSOC_REQ 0x20 -#define IEEE80211_FC0_SUBTYPE_REASSOC_RESP 0x30 -#define IEEE80211_FC0_SUBTYPE_PROBE_REQ 0x40 -#define IEEE80211_FC0_SUBTYPE_PROBE_RESP 0x50 -#define IEEE80211_FC0_SUBTYPE_BEACON 0x80 -#define IEEE80211_FC0_SUBTYPE_ATIM 0x90 -#define IEEE80211_FC0_SUBTYPE_DISASSOC 0xa0 -#define IEEE80211_FC0_SUBTYPE_AUTH 0xb0 -#define IEEE80211_FC0_SUBTYPE_DEAUTH 0xc0 -/* for TYPE_CTL */ -#define IEEE80211_FC0_SUBTYPE_PS_POLL 0xa0 -#define IEEE80211_FC0_SUBTYPE_RTS 0xb0 -#define IEEE80211_FC0_SUBTYPE_CTS 0xc0 -#define IEEE80211_FC0_SUBTYPE_ACK 0xd0 -#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_FC0_SUBTYPE_QOS 0x80 - -#define IEEE80211_FC1_DIR_MASK 0x03 -#define IEEE80211_FC1_DIR_NODS 0x00 /* STA->STA */ -#define IEEE80211_FC1_DIR_TODS 0x01 /* STA->AP */ -#define IEEE80211_FC1_DIR_FROMDS 0x02 /* AP ->STA */ -#define IEEE80211_FC1_DIR_DSTODS 0x03 /* AP ->AP */ - -#define IEEE80211_FC1_MORE_FRAG 0x04 -#define IEEE80211_FC1_RETRY 0x08 -#define IEEE80211_FC1_PWR_MGT 0x10 -#define IEEE80211_FC1_MORE_DATA 0x20 -#define IEEE80211_FC1_WEP 0x40 -#define IEEE80211_FC1_ORDER 0x80 - -#define IEEE80211_SEQ_FRAG_MASK 0x000f -#define IEEE80211_SEQ_FRAG_SHIFT 0 -#define IEEE80211_SEQ_SEQ_MASK 0xfff0 -#define IEEE80211_SEQ_SEQ_SHIFT 4 - -#define IEEE80211_NWID_LEN 32 - -#define IEEE80211_QOS_TXOP 0x00ff -/* bit 8 is reserved */ -#define IEEE80211_QOS_ACKPOLICY 0x0600 -#define IEEE80211_QOS_ESOP 0x0800 -#define IEEE80211_QOS_TID 0xf000 - -/* - * Control frames. - */ -struct ieee80211_frame_min { - uint8_t i_fc[2]; - uint8_t i_dur[2]; - uint8_t i_addr1[IEEE80211_ADDR_LEN]; - uint8_t i_addr2[IEEE80211_ADDR_LEN]; - /* FCS */ -} __attribute__((__packed__)); - -struct ieee80211_frame_rts { - uint8_t i_fc[2]; - uint8_t i_dur[2]; - uint8_t i_ra[IEEE80211_ADDR_LEN]; - uint8_t i_ta[IEEE80211_ADDR_LEN]; - /* FCS */ -} __attribute__((__packed__)); - -struct ieee80211_frame_cts { - uint8_t i_fc[2]; - uint8_t i_dur[2]; - uint8_t i_ra[IEEE80211_ADDR_LEN]; - /* FCS */ -} __attribute__((__packed__)); - -struct ieee80211_frame_ack { - uint8_t i_fc[2]; - uint8_t i_dur[2]; - uint8_t i_ra[IEEE80211_ADDR_LEN]; - /* FCS */ -} __attribute__((__packed__)); - -struct ieee80211_frame_pspoll { - uint8_t i_fc[2]; - uint8_t i_aid[2]; - uint8_t i_bssid[IEEE80211_ADDR_LEN]; - uint8_t i_ta[IEEE80211_ADDR_LEN]; - /* FCS */ -} __attribute__((__packed__)); - -struct ieee80211_frame_cfend { /* NB: also CF-End+CF-Ack */ - uint8_t i_fc[2]; - uint8_t i_dur[2]; /* should be zero */ - uint8_t i_ra[IEEE80211_ADDR_LEN]; - uint8_t i_bssid[IEEE80211_ADDR_LEN]; - /* FCS */ -} __attribute__((__packed__)); - -/* - * BEACON management packets - * - * octet timestamp[8] - * octet beacon interval[2] - * octet capability information[2] - * information element - * octet elemid - * octet length - * octet information[length] - */ - -typedef uint8_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 0x0001 -#define IEEE80211_CAPINFO_IBSS 0x0002 -#define IEEE80211_CAPINFO_CF_POLLABLE 0x0004 -#define IEEE80211_CAPINFO_CF_POLLREQ 0x0008 -#define IEEE80211_CAPINFO_PRIVACY 0x0010 -#define IEEE80211_CAPINFO_SHORT_PREAMBLE 0x0020 -#define IEEE80211_CAPINFO_PBCC 0x0040 -#define IEEE80211_CAPINFO_CHNL_AGILITY 0x0080 -/* bits 8-9 are reserved */ -#define IEEE80211_CAPINFO_SHORT_SLOTTIME 0x0400 -#define IEEE80211_CAPINFO_RSN 0x0800 -/* bit 12 is reserved */ -#define IEEE80211_CAPINFO_DSSSOFDM 0x2000 -/* bits 14-15 are reserved */ - -/* - * 802.11i/WPA information element (maximally sized). - */ -struct ieee80211_ie_wpa { - uint8_t wpa_oui[3]; /* 0x00, 0x50, 0xf2 */ - uint8_t wpa_type; /* OUI type */ - uint16_t wpa_version; /* spec revision */ - uint32_t wpa_mcipher[1]; /* multicast/group key cipher */ - uint16_t wpa_uciphercnt; /* # pairwise key ciphers */ - uint32_t wpa_uciphers[8];/* ciphers */ - uint16_t wpa_authselcnt; /* authentication selector cnt*/ - uint32_t wpa_authsels[8];/* selectors */ -} __attribute__((__packed__)); - -/* - * Management information elements - */ -struct ieee80211_information { - char ssid[IEEE80211_NWID_LEN+1]; - struct rates { - uint8_t *p; - } rates; - struct fh { - uint16_t dwell; - uint8_t set; - uint8_t pattern; - uint8_t index; - } fh; - struct ds { - uint8_t channel; - } ds; - struct cf { - uint8_t count; - uint8_t period; - uint8_t maxdur[2]; - uint8_t dur[2]; - } cf; - struct tim { - uint8_t count; - uint8_t period; - uint8_t bitctl; - /* uint8_t pvt[251]; The driver needs to use this. */ - } tim; - struct ibss { - uint16_t atim; - } ibss; - struct challenge { - uint8_t *p; - uint8_t len; - } challenge; - struct erp { - uint8_t flags; - } erp; - struct country { - uint8_t cc[3]; /* ISO CC+(I)ndoor/(O)utdoor */ - struct { - uint8_t schan; /* starting channel */ - uint8_t nchan; /* number channels */ - uint8_t maxtxpwr; - } band[4]; /* up to 4 sub bands */ - } country; - struct ath { - uint8_t flags; - } ath; - struct ieee80211_ie_wpa wpa; -}; - -enum { - IEEE80211_ELEMID_SSID = 0, - IEEE80211_ELEMID_RATES = 1, - IEEE80211_ELEMID_FHPARMS = 2, - IEEE80211_ELEMID_DSPARMS = 3, - IEEE80211_ELEMID_CFPARMS = 4, - IEEE80211_ELEMID_TIM = 5, - IEEE80211_ELEMID_IBSSPARMS = 6, - IEEE80211_ELEMID_COUNTRY = 7, - IEEE80211_ELEMID_CHALLENGE = 16, - /* 17-31 reserved for challenge text extension */ - IEEE80211_ELEMID_ERP = 42, - IEEE80211_ELEMID_XRATES = 50, - IEEE80211_ELEMID_TPC = 150, - IEEE80211_ELEMID_CCKM = 156, - IEEE80211_ELEMID_VENDOR = 221, /* vendor private */ -}; - -#define IEEE80211_CHALLENGE_LEN 128 - -#define IEEE80211_RATE_BASIC 0x80 -#define IEEE80211_RATE_VAL 0x7f - -/* EPR information element flags */ -#define IEEE80211_ERP_NON_ERP_PRESENT 0x01 -#define IEEE80211_ERP_USE_PROTECTION 0x02 -#define IEEE80211_ERP_BARKER_MODE 0x04 - -/* Atheros private advanced capabilities info */ -#define ATHEROS_CAP_TURBO_PRIME 0x01 -#define ATHEROS_CAP_COMPRESSION 0x02 -#define ATHEROS_CAP_FAST_FRAME 0x04 -/* bits 3-6 reserved */ -#define ATHEROS_CAP_BOOST 0x80 - -#define ATH_OUI 0x7f0300 /* Atheros OUI */ -#define ATH_OUI_TYPE 0x01 -#define ATH_OUI_VERSION 0x01 - -#define WPA_OUI 0xf25000 -#define WPA_OUI_TYPE 0x01 -#define WPA_OUI_VERSION 1 /* current supported version */ - -#define WPA_CSE_NULL 0x00 -#define WPA_CSE_WEP40 0x01 -#define WPA_CSE_TKIP 0x02 -#define WPA_CSE_WRAP 0x03 /* WPA2/802.11i */ -#define WPA_CSE_CCMP 0x04 -#define WPA_CSE_WEP104 0x05 - -#define WPA_ASE_NONE 0x00 -#define WPA_ASE_8021X_UNSPEC 0x01 -#define WPA_ASE_8021X_PSK 0x02 - -/* - * AUTH management packets - * - * octet algo[2] - * octet seq[2] - * octet status[2] - * octet chal.id - * octet chal.length - * octet chal.text[253] - */ - -typedef uint8_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_AUTH_ALG_LEAP 0x0080 - -enum { - IEEE80211_AUTH_OPEN_REQUEST = 1, - IEEE80211_AUTH_OPEN_RESPONSE = 2, -}; - -enum { - IEEE80211_AUTH_SHARED_REQUEST = 1, - IEEE80211_AUTH_SHARED_CHALLENGE = 2, - IEEE80211_AUTH_SHARED_RESPONSE = 3, - IEEE80211_AUTH_SHARED_PASS = 4, -}; - -/* - * Reason codes - * - * Unlisted codes are reserved - */ - -enum { - IEEE80211_REASON_UNSPECIFIED = 1, - IEEE80211_REASON_AUTH_EXPIRE = 2, - IEEE80211_REASON_AUTH_LEAVE = 3, - IEEE80211_REASON_ASSOC_EXPIRE = 4, - IEEE80211_REASON_ASSOC_TOOMANY = 5, - IEEE80211_REASON_NOT_AUTHED = 6, - IEEE80211_REASON_NOT_ASSOCED = 7, - IEEE80211_REASON_ASSOC_LEAVE = 8, - IEEE80211_REASON_ASSOC_NOT_AUTHED = 9, - - IEEE80211_REASON_RSN_REQUIRED = 11, - IEEE80211_REASON_RSN_INCONSISTENT = 12, - IEEE80211_REASON_IE_INVALID = 13, - IEEE80211_REASON_MIC_FAILURE = 14, - - IEEE80211_STATUS_SUCCESS = 0, - IEEE80211_STATUS_UNSPECIFIED = 1, - IEEE80211_STATUS_CAPINFO = 10, - IEEE80211_STATUS_NOT_ASSOCED = 11, - IEEE80211_STATUS_OTHER = 12, - IEEE80211_STATUS_ALG = 13, - IEEE80211_STATUS_SEQUENCE = 14, - IEEE80211_STATUS_CHALLENGE = 15, - IEEE80211_STATUS_TIMEOUT = 16, - IEEE80211_STATUS_TOOMANY = 17, - IEEE80211_STATUS_BASIC_RATE = 18, - IEEE80211_STATUS_SP_REQUIRED = 19, - IEEE80211_STATUS_PBCC_REQUIRED = 20, - IEEE80211_STATUS_CA_REQUIRED = 21, - IEEE80211_STATUS_TOO_MANY_STATIONS = 22, - IEEE80211_STATUS_RATES = 23, - IEEE80211_STATUS_SHORTSLOT_REQUIRED = 25, - IEEE80211_STATUS_DSSSOFDM_REQUIRED = 26, -}; - -#define IEEE80211_WEP_KEYLEN 5 /* 40bit */ -#define IEEE80211_WEP_IVLEN 3 /* 24bit */ -#define IEEE80211_WEP_KIDLEN 1 /* 1 octet */ -#define IEEE80211_WEP_CRCLEN 4 /* CRC-32 */ -#define IEEE80211_WEP_NKID 4 /* number of key ids */ - -#define IEEE80211_CRC_LEN 4 - -/* - * Maximum acceptable MTU is: - * IEEE80211_MAX_LEN - WEP overhead - CRC - - * QoS overhead - RSN/WPA overhead - * Min is arbitrarily chosen > IEEE80211_MIN_LEN. The default - * mtu is Ethernet-compatible; it's set by ether_ifattach. - */ -#define IEEE80211_MTU_MAX 2290 -#define IEEE80211_MTU_MIN 32 - -#define IEEE80211_MAX_LEN (2300 + IEEE80211_CRC_LEN + \ - (IEEE80211_WEP_IVLEN + IEEE80211_WEP_KIDLEN + IEEE80211_WEP_CRCLEN)) -#define IEEE80211_MIN_LEN \ - (sizeof(struct ieee80211_frame_min) + IEEE80211_CRC_LEN) - -/* - * RTS frame length parameters. The default is specified in - * the 802.11 spec. The max may be wrong for jumbo frames. - */ -#define IEEE80211_RTS_DEFAULT 512 -#define IEEE80211_RTS_MIN 1 -#define IEEE80211_RTS_MAX IEEE80211_MAX_LEN - -enum { - IEEE80211_AUTH_NONE = 0, - IEEE80211_AUTH_OPEN = 1, - IEEE80211_AUTH_SHARED = 2, -}; - -#endif /* _NETPROTO_802_11_IEEE80211_H_ */ diff --git a/sys/netproto/802_11/wlan/ieee80211_crypto.h b/sys/netproto/802_11/wlan/ieee80211_crypto.h deleted file mode 100644 index f6d2cb82a7..0000000000 --- a/sys/netproto/802_11/wlan/ieee80211_crypto.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2001 Atsushi Onoe - * Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * Alternatively, this software may be distributed under the terms of the - * GNU General Public License ("GPL") version 2 as published by the Free - * Software Foundation. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD: src/sys/net80211/ieee80211_crypto.h,v 1.2 2003/06/27 05:13:52 sam Exp $ - * $DragonFly: src/sys/netproto/802_11/wlan/Attic/ieee80211_crypto.h,v 1.1 2004/07/26 16:30:17 joerg Exp $ - */ - -#ifndef _NETPROTO_802_11_IEEE80211_CRYPTO_H_ -#define _NETPROTO_802_11_IEEE80211_CRYPTO_H_ - -/* - * 802.11 protocol crypto-related definitions. - */ -#define IEEE80211_KEYBUF_SIZE 16 - -struct ieee80211_wepkey { - int wk_len; - uint8_t wk_key[IEEE80211_KEYBUF_SIZE]; -}; - -void ieee80211_crypto_attach(struct ifnet *); -void ieee80211_crypto_detach(struct ifnet *); -struct mbuf *ieee80211_wep_crypt(struct ifnet *, struct mbuf *, int); -#endif /* _NETPROTO_802_11_IEEE80211_CRYPTO_H_ */ diff --git a/sys/netproto/802_11/wlan/ieee80211_ioctl.h b/sys/netproto/802_11/wlan/ieee80211_ioctl.h deleted file mode 100644 index dff8680fdb..0000000000 --- a/sys/netproto/802_11/wlan/ieee80211_ioctl.h +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (c) 2001 Atsushi Onoe - * Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * Alternatively, this software may be distributed under the terms of the - * GNU General Public License ("GPL") version 2 as published by the Free - * Software Foundation. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD: src/sys/net80211/ieee80211_ioctl.h,v 1.5 2004/03/30 22:57:57 sam Exp $ - * $DragonFly: src/sys/netproto/802_11/wlan/Attic/ieee80211_ioctl.h,v 1.1 2004/07/26 16:30:17 joerg Exp $ - */ - -#ifndef _NETPROTO_802_11_IEEE80211_IOCTL_H_ -#define _NETPROTO_802_11_IEEE80211_IOCTL_H_ - -/* - * IEEE 802.11 ioctls. - */ - -struct ieee80211_stats { - uint32_t is_rx_badversion; /* rx frame with bad version */ - uint32_t is_rx_tooshort; /* rx frame too short */ - uint32_t is_rx_wrongbss; /* rx from wrong bssid */ - uint32_t is_rx_dup; /* rx discard 'cuz dup */ - uint32_t is_rx_wrongdir; /* rx w/ wrong direction */ - uint32_t is_rx_mcastecho; /* rx discard 'cuz mcast echo */ - uint32_t is_rx_notassoc; /* rx discard 'cuz sta !assoc */ - uint32_t is_rx_nowep; /* rx w/ wep but wep !config */ - uint32_t is_rx_wepfail; /* rx wep processing failed */ - uint32_t is_rx_decap; /* rx decapsulation failed */ - uint32_t is_rx_mgtdiscard; /* rx discard mgt frames */ - uint32_t is_rx_ctl; /* rx discard ctrl frames */ - uint32_t is_rx_rstoobig; /* rx rate set truncated */ - uint32_t is_rx_elem_missing; /* rx required element missing*/ - uint32_t is_rx_elem_toobig; /* rx element too big */ - uint32_t is_rx_elem_toosmall; /* rx element too small */ - uint32_t is_rx_elem_unknown; /* rx element unknown */ - uint32_t is_rx_badchan; /* rx frame w/ invalid chan */ - uint32_t is_rx_chanmismatch; /* rx frame chan mismatch */ - uint32_t is_rx_nodealloc; /* rx frame dropped */ - uint32_t is_rx_ssidmismatch; /* rx frame ssid mismatch */ - uint32_t is_rx_auth_unsupported; /* rx w/ unsupported auth alg */ - uint32_t is_rx_auth_fail; /* rx sta auth failure */ - uint32_t is_rx_assoc_bss; /* rx assoc from wrong bssid */ - uint32_t is_rx_assoc_notauth; /* rx assoc w/o auth */ - uint32_t is_rx_assoc_capmismatch;/* rx assoc w/ cap mismatch */ - uint32_t is_rx_assoc_norate; /* rx assoc w/ no rate match */ - uint32_t is_rx_deauth; /* rx deauthentication */ - uint32_t is_rx_disassoc; /* rx disassociation */ - uint32_t is_rx_badsubtype; /* rx frame w/ unknown subtype*/ - uint32_t is_rx_nombuf; /* rx failed for lack of mbuf */ - uint32_t is_rx_decryptcrc; /* rx decrypt failed on crc */ - uint32_t is_rx_ahdemo_mgt; /* rx discard ahdemo mgt frame*/ - uint32_t is_rx_bad_auth; /* rx bad auth request */ - uint32_t is_tx_nombuf; /* tx failed for lack of mbuf */ - uint32_t is_tx_nonode; /* tx failed for no node */ - uint32_t is_tx_unknownmgt; /* tx of unknown mgt frame */ - uint32_t is_scan_active; /* active scans started */ - uint32_t is_scan_passive; /* passive scans started */ - uint32_t is_node_timeout; /* nodes timed out inactivity */ - uint32_t is_crypto_nomem; /* no memory for crypto ctx */ -}; - -/* - * FreeBSD-style ioctls. - */ -/* the first member must be matched with struct ifreq */ -struct ieee80211req { - char i_name[IFNAMSIZ]; /* if_name, e.g. "wi0" */ - uint16_t i_type; /* req type */ - int16_t i_val; /* Index or simple value */ - int16_t i_len; /* Index or simple value */ - void *i_data; /* Extra data */ -}; -#define SIOCS80211 _IOW('i', 234, struct ieee80211req) -#define SIOCG80211 _IOWR('i', 235, struct ieee80211req) - -#define IEEE80211_IOC_SSID 1 -#define IEEE80211_IOC_NUMSSIDS 2 -#define IEEE80211_IOC_WEP 3 -#define IEEE80211_WEP_NOSUP -1 -#define IEEE80211_WEP_OFF 0 -#define IEEE80211_WEP_ON 1 -#define IEEE80211_WEP_MIXED 2 -#define IEEE80211_IOC_WEPKEY 4 -#define IEEE80211_IOC_NUMWEPKEYS 5 -#define IEEE80211_IOC_WEPTXKEY 6 -#define IEEE80211_IOC_AUTHMODE 7 -#define IEEE80211_IOC_STATIONNAME 8 -#define IEEE80211_IOC_CHANNEL 9 -#define IEEE80211_IOC_POWERSAVE 10 -#define IEEE80211_POWERSAVE_NOSUP -1 -#define IEEE80211_POWERSAVE_OFF 0 -#define IEEE80211_POWERSAVE_CAM 1 -#define IEEE80211_POWERSAVE_PSP 2 -#define IEEE80211_POWERSAVE_PSP_CAM 3 -#define IEEE80211_POWERSAVE_ON IEEE80211_POWERSAVE_CAM -#define IEEE80211_IOC_POWERSAVESLEEP 11 -#define IEEE80211_IOC_RTSTHRESHOLD 12 -#define IEEE80211_IOC_PROTMODE 13 -#define IEEE80211_PROTMODE_OFF 0 -#define IEEE80211_PROTMODE_CTS 1 -#define IEEE80211_PROTMODE_RTSCTS 2 -#define IEEE80211_IOC_TXPOWER 14 - -#ifndef IEEE80211_CHAN_ANY -#define IEEE80211_CHAN_ANY 0xffff /* token for ``any channel'' */ -#endif - -#define SIOCG80211STATS _IOWR('i', 236, struct ifreq) - -#endif /* _NETPROTO_802_11_IEEE80211_IOCTL_H_ */ diff --git a/sys/netproto/802_11/wlan/ieee80211_node.h b/sys/netproto/802_11/wlan/ieee80211_node.h deleted file mode 100644 index 2a63ad07f7..0000000000 --- a/sys/netproto/802_11/wlan/ieee80211_node.h +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Copyright (c) 2001 Atsushi Onoe - * Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * Alternatively, this software may be distributed under the terms of the - * GNU General Public License ("GPL") version 2 as published by the Free - * Software Foundation. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD: src/sys/net80211/ieee80211_node.h,v 1.10 2004/04/05 22:10:26 sam Exp $ - * $DragonFly: src/sys/netproto/802_11/wlan/Attic/ieee80211_node.h,v 1.1 2004/07/26 16:30:17 joerg Exp $ - */ - -#ifndef _NETPROTO_802_11_IEEE80211_NODE_H_ -#define _NETPROTO_802_11_IEEE80211_NODE_H_ - -#define IEEE80211_PSCAN_WAIT 5 /* passive scan wait */ -#define IEEE80211_TRANS_WAIT 5 /* transition wait */ -#define IEEE80211_INACT_WAIT 5 /* inactivity timer interval */ -#define IEEE80211_INACT_MAX (300/IEEE80211_INACT_WAIT) - -#define IEEE80211_NODE_HASHSIZE 32 -/* simple hash is enough for variation of macaddr */ -#define IEEE80211_NODE_HASH(addr) \ - (((uint8_t *)(addr))[IEEE80211_ADDR_LEN - 1] % IEEE80211_NODE_HASHSIZE) - -#define IEEE80211_RATE_SIZE 8 /* 802.11 standard */ -#define IEEE80211_RATE_MAXSIZE 15 /* max rates we'll handle */ - -struct ieee80211_rateset { - uint8_t rs_nrates; - uint8_t rs_rates[IEEE80211_RATE_MAXSIZE]; -}; - -/* - * Node specific information. Note that drivers are expected - * to derive from this structure to add device-specific per-node - * state. This is done by overriding the ic_node_* methods in - * the ieee80211com structure. - */ -struct ieee80211_node { - TAILQ_ENTRY(ieee80211_node) ni_list; - LIST_ENTRY(ieee80211_node) ni_hash; - u_int ni_refcnt; - u_int ni_scangen; /* gen# for timeout scan */ - - /* hardware */ - uint32_t ni_rstamp; /* recv timestamp */ - uint8_t ni_rssi; /* recv ssi */ - - /* header */ - uint8_t ni_macaddr[IEEE80211_ADDR_LEN]; - uint8_t ni_bssid[IEEE80211_ADDR_LEN]; - - /* beacon, probe response */ - uint8_t ni_tstamp[8]; /* from last rcv'd beacon */ - uint16_t ni_intval; /* beacon interval */ - uint16_t ni_capinfo; /* capabilities */ - uint8_t ni_esslen; - uint8_t ni_essid[IEEE80211_NWID_LEN]; - struct ieee80211_rateset ni_rates; /* negotiated rate set */ - uint8_t *ni_country; /* country information XXX */ - struct ieee80211_channel *ni_chan; - uint16_t ni_fhdwell; /* FH only */ - uint8_t ni_fhindex; /* FH only */ - uint8_t ni_erp; /* 11g only */ - -#ifdef notyet - /* DTIM and contention free period (CFP) */ - uint8_t ni_dtimperiod; - uint8_t ni_cfpperiod; /* # of DTIMs between CFPs */ - uint16_t ni_cfpduremain; /* remaining cfp duration */ - uint16_t ni_cfpmaxduration;/* max CFP duration in TU */ - uint16_t ni_nextdtim; /* time to next DTIM */ - uint16_t ni_timoffset; -#endif - - /* others */ - uint16_t ni_associd; /* assoc response */ - uint16_t ni_txseq; /* seq to be transmitted */ - uint16_t ni_rxseq; /* seq previous received */ - int ni_fails; /* failure count to associate */ - int ni_inact; /* inactivity mark count */ - int ni_txrate; /* index to ni_rates[] */ -}; - -static __inline struct ieee80211_node * -ieee80211_ref_node(struct ieee80211_node *ni) -{ - atomic_add_int(&ni->ni_refcnt, 1); - return ni; -} - -static __inline void -ieee80211_unref_node(struct ieee80211_node **ni) -{ - atomic_subtract_int(&(*ni)->ni_refcnt, 1); - *ni = NULL; /* guard against use */ -} - -struct ieee80211com; - -#ifdef MALLOC_DECLARE -MALLOC_DECLARE(M_80211_NODE); -#endif - -extern void ieee80211_node_attach(struct ifnet *); -extern void ieee80211_node_lateattach(struct ifnet *); -extern void ieee80211_node_detach(struct ifnet *); - -extern void ieee80211_begin_scan(struct ifnet *); -extern void ieee80211_next_scan(struct ifnet *); -extern void ieee80211_end_scan(struct ifnet *); -extern struct ieee80211_node *ieee80211_alloc_node(struct ieee80211com *, - uint8_t *); -extern struct ieee80211_node *ieee80211_dup_bss(struct ieee80211com *, - uint8_t *); -extern struct ieee80211_node *ieee80211_find_node(struct ieee80211com *, - uint8_t *); -extern struct ieee80211_node *ieee80211_find_txnode(struct ieee80211com *, - uint8_t *); -extern struct ieee80211_node * ieee80211_lookup_node(struct ieee80211com *, - uint8_t *macaddr, struct ieee80211_channel *); -extern void ieee80211_free_node(struct ieee80211com *, - struct ieee80211_node *); -extern void ieee80211_free_allnodes(struct ieee80211com *); -typedef void ieee80211_iter_func(void *, struct ieee80211_node *); -extern void ieee80211_iterate_nodes(struct ieee80211com *ic, - ieee80211_iter_func *, void *); -extern void ieee80211_timeout_nodes(struct ieee80211com *); - -extern void ieee80211_create_ibss(struct ieee80211com* , - struct ieee80211_channel *); -#endif /* _NETPROTO_802_11_IEEE80211_NODE_H_ */ diff --git a/sys/netproto/802_11/wlan/ieee80211_proto.h b/sys/netproto/802_11/wlan/ieee80211_proto.h deleted file mode 100644 index 332f23fd2c..0000000000 --- a/sys/netproto/802_11/wlan/ieee80211_proto.h +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) 2001 Atsushi Onoe - * Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * Alternatively, this software may be distributed under the terms of the - * GNU General Public License ("GPL") version 2 as published by the Free - * Software Foundation. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD: src/sys/net80211/ieee80211_proto.h,v 1.4 2003/08/19 22:17:03 sam Exp $ - * $DragonFly: src/sys/netproto/802_11/wlan/Attic/ieee80211_proto.h,v 1.1 2004/07/26 16:30:17 joerg Exp $ - */ - -#ifndef _NETPROTO_802_11_IEEE80211_PROTO_H_ -#define _NETPROTO_802_11_IEEE80211_PROTO_H_ - -/* - * 802.11 protocol implementation definitions. - */ - -enum ieee80211_state { - IEEE80211_S_INIT = 0, /* default state */ - IEEE80211_S_SCAN = 1, /* scanning */ - IEEE80211_S_AUTH = 2, /* try to authenticate */ - IEEE80211_S_ASSOC = 3, /* try to assoc */ - IEEE80211_S_RUN = 4, /* associated */ -}; -#define IEEE80211_S_MAX (IEEE80211_S_RUN+1) - -#define IEEE80211_SEND_MGMT(_ic,_ni,_type,_arg) \ - ((*(_ic)->ic_send_mgmt)(_ic, _ni, _type, _arg)) - -extern const char *ieee80211_mgt_subtype_name[]; - -extern void ieee80211_proto_attach(struct ifnet *); -extern void ieee80211_proto_detach(struct ifnet *); - -struct ieee80211_node; -extern void ieee80211_input(struct ifnet *, struct mbuf *, - struct ieee80211_node *, int, uint32_t); -extern void ieee80211_recv_mgmt(struct ieee80211com *, struct mbuf *, - struct ieee80211_node *, int, int, uint32_t); -extern int ieee80211_send_mgmt(struct ieee80211com *, struct ieee80211_node *, - int, int); -extern struct mbuf *ieee80211_encap(struct ifnet *, struct mbuf *, - struct ieee80211_node **); -extern struct mbuf *ieee80211_decap(struct ifnet *, struct mbuf *); -extern uint8_t *ieee80211_add_rates(uint8_t *frm, - const struct ieee80211_rateset *); -#define ieee80211_new_state(_ic, _nstate, _arg) \ - (((_ic)->ic_newstate)((_ic), (_nstate), (_arg))) -extern uint8_t *ieee80211_add_xrates(uint8_t *frm, - const struct ieee80211_rateset *); -extern void ieee80211_print_essid(uint8_t *, int); -extern void ieee80211_dump_pkt(uint8_t *, int, int, int); - -extern const char *ieee80211_state_name[IEEE80211_S_MAX]; -#endif /* _NETPROTO_802_11_IEEE80211_PROTO_H_ */ diff --git a/sys/netproto/802_11/wlan/ieee80211_radiotap.h b/sys/netproto/802_11/wlan/ieee80211_radiotap.h deleted file mode 100644 index 1bae2cefda..0000000000 --- a/sys/netproto/802_11/wlan/ieee80211_radiotap.h +++ /dev/null @@ -1,209 +0,0 @@ -/* $FreeBSD: src/sys/net80211/ieee80211_radiotap.h,v 1.3 2004/04/05 22:13:21 sam Exp $ */ -/* $NetBSD: ieee80211_radiotap.h,v 1.3 2003/11/16 09:02:42 dyoung Exp $ */ -/* $DragonFly: src/sys/netproto/802_11/wlan/Attic/ieee80211_radiotap.h,v 1.1 2004/07/26 16:30:17 joerg Exp $ */ - -/* - * Copyright (c) 2003, 2004 David Young. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of David Young may not be used to endorse or promote - * products derived from this software without specific prior - * written permission. - * - * THIS SOFTWARE IS PROVIDED BY DAVID YOUNG ``AS IS'' AND ANY - * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DAVID - * YOUNG BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED - * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY - * OF SUCH DAMAGE. - */ - -#ifndef _NETPROTO_802_11_IEEE80211RADIOTAP_H_ -#define _NETPROTO_802_11_IEEE80211RADIOTAP_H_ - -/* A generic radio capture format is desirable. There is one for - * Linux, but it is neither rigidly defined (there were not even - * units given for some fields) nor easily extensible. - * - * I suggest the following extensible radio capture format. It is - * based on a bitmap indicating which fields are present. - * - * I am trying to describe precisely what the application programmer - * should expect in the following, and for that reason I tell the - * units and origin of each measurement (where it applies), or else I - * use sufficiently weaselly language ("is a monotonically nondecreasing - * function of...") that I cannot set false expectations for lawyerly - * readers. - */ -#ifdef _KERNEL -#ifndef DLT_IEEE802_11_RADIO -#define DLT_IEEE802_11_RADIO 127 /* 802.11 plus WLAN header */ -#endif -#endif /* _KERNEL */ - -/* The radio capture header precedes the 802.11 header. */ -struct ieee80211_radiotap_header { - uint8_t it_version; /* Version 0. Only increases - * for drastic changes, - * introduction of compatible - * new fields does not count. - */ - uint8_t it_pad; - uint16_t it_len; /* length of the whole - * header in bytes, including - * it_version, it_pad, - * it_len, and data fields. - */ - uint32_t it_present; /* A bitmap telling which - * fields are present. Set bit 31 - * (0x80000000) to extend the - * bitmap by another 32 bits. - * Additional extensions are made - * by setting bit 31. - */ -} __attribute__((__packed__)); - -/* Name Data type Units - * ---- --------- ----- - * - * IEEE80211_RADIOTAP_TSFT uint64_t microseconds - * - * Value in microseconds of the MAC's 64-bit 802.11 Time - * Synchronization Function timer when the first bit of the - * MPDU arrived at the MAC. For received frames, only. - * - * IEEE80211_RADIOTAP_CHANNEL 2 x uint16_t MHz, bitmap - * - * Tx/Rx frequency in MHz, followed by flags (see below). - * - * IEEE80211_RADIOTAP_FHSS uint16_t see below - * - * For frequency-hopping radios, the hop set (first byte) - * and pattern (second byte). - * - * IEEE80211_RADIOTAP_RATE uint8_t 500kb/s - * - * Tx/Rx data rate - * - * IEEE80211_RADIOTAP_DBM_ANTSIGNAL int8_t decibels from - * one milliwatt (dBm) - * - * RF signal power at the antenna, decibel difference from - * one milliwatt. - * - * IEEE80211_RADIOTAP_DBM_ANTNOISE int8_t decibels from - * one milliwatt (dBm) - * - * RF noise power at the antenna, decibel difference from one - * milliwatt. - * - * IEEE80211_RADIOTAP_DB_ANTSIGNAL uint8_t decibel (dB) - * - * RF signal power at the antenna, decibel difference from an - * arbitrary, fixed reference. - * - * IEEE80211_RADIOTAP_DB_ANTNOISE uint8_t decibel (dB) - * - * RF noise power at the antenna, decibel difference from an - * arbitrary, fixed reference point. - * - * IEEE80211_RADIOTAP_BARKER_CODE_LOCK uint16_t unitless - * - * Quality of Barker code lock. Unitless. Monotonically - * nondecreasing with "better" lock strength. Called "Signal - * Quality" in datasheets. (Is there a standard way to measure - * this?) - * - * IEEE80211_RADIOTAP_TX_ATTENUATION uint16_t unitless - * - * Transmit power expressed as unitless distance from max - * power set at factory calibration. 0 is max power. - * Monotonically nondecreasing with lower power levels. - * - * IEEE80211_RADIOTAP_DB_TX_ATTENUATION uint16_t decibels (dB) - * - * Transmit power expressed as decibel distance from max power - * set at factory calibration. 0 is max power. Monotonically - * nondecreasing with lower power levels. - * - * IEEE80211_RADIOTAP_DBM_TX_POWER int8_t decibels from - * one milliwatt (dBm) - * - * Transmit power expressed as dBm (decibels from a 1 milliwatt - * reference). This is the absolute power level measured at - * the antenna port. - * - * IEEE80211_RADIOTAP_FLAGS uint8_t bitmap - * - * Properties of transmitted and received frames. See flags - * defined below. - * - * IEEE80211_RADIOTAP_ANTENNA uint8_t antenna index - * - * Unitless indication of the Rx/Tx antenna for this packet. - * The first antenna is antenna 0. - * - * IEEE80211_RADIOTAP_FCS uint32_t data - * - * FCS from frame in network byte order. - */ -enum ieee80211_radiotap_type { - IEEE80211_RADIOTAP_TSFT = 0, - IEEE80211_RADIOTAP_FLAGS = 1, - IEEE80211_RADIOTAP_RATE = 2, - IEEE80211_RADIOTAP_CHANNEL = 3, - IEEE80211_RADIOTAP_FHSS = 4, - IEEE80211_RADIOTAP_DBM_ANTSIGNAL = 5, - IEEE80211_RADIOTAP_DBM_ANTNOISE = 6, - IEEE80211_RADIOTAP_LOCK_QUALITY = 7, - IEEE80211_RADIOTAP_TX_ATTENUATION = 8, - IEEE80211_RADIOTAP_DB_TX_ATTENUATION = 9, - IEEE80211_RADIOTAP_DBM_TX_POWER = 10, - IEEE80211_RADIOTAP_ANTENNA = 11, - IEEE80211_RADIOTAP_DB_ANTSIGNAL = 12, - IEEE80211_RADIOTAP_DB_ANTNOISE = 13, - IEEE80211_RADIOTAP_FCS = 14, - IEEE80211_RADIOTAP_EXT = 31, -}; - -#ifndef _KERNEL -/* Channel flags. */ -#define IEEE80211_CHAN_TURBO 0x0010 /* Turbo channel */ -#define IEEE80211_CHAN_CCK 0x0020 /* CCK channel */ -#define IEEE80211_CHAN_OFDM 0x0040 /* OFDM channel */ -#define IEEE80211_CHAN_2GHZ 0x0080 /* 2 GHz spectrum channel. */ -#define IEEE80211_CHAN_5GHZ 0x0100 /* 5 GHz spectrum channel */ -#define IEEE80211_CHAN_PASSIVE 0x0200 /* Only passive scan allowed */ -#define IEEE80211_CHAN_DYN 0x0400 /* Dynamic CCK-OFDM channel */ -#define IEEE80211_CHAN_GFSK 0x0800 /* GFSK channel (FHSS PHY) */ -#endif /* !_KERNEL */ - -/* For IEEE80211_RADIOTAP_FLAGS */ -#define IEEE80211_RADIOTAP_F_CFP 0x01 /* sent/received - * during CFP - */ -#define IEEE80211_RADIOTAP_F_SHORTPRE 0x02 /* sent/received - * with short - * preamble - */ -#define IEEE80211_RADIOTAP_F_WEP 0x04 /* sent/received - * with WEP encryption - */ -#define IEEE80211_RADIOTAP_F_FRAG 0x08 /* sent/received - * with fragmentation - */ - -#endif /* _NETPROTO_802_11_IEEE80211RADIOTAP_H_ */ diff --git a/sys/netproto/802_11/wlan/ieee80211_var.h b/sys/netproto/802_11/wlan/ieee80211_var.h deleted file mode 100644 index 72d410a2be..0000000000 --- a/sys/netproto/802_11/wlan/ieee80211_var.h +++ /dev/null @@ -1,295 +0,0 @@ -/* - * Copyright (c) 2001 Atsushi Onoe - * Copyright (c) 2002, 2003 Sam Leffler, Errno Consulting - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. The name of the author may not be used to endorse or promote products - * derived from this software without specific prior written permission. - * - * Alternatively, this software may be distributed under the terms of the - * GNU General Public License ("GPL") version 2 as published by the Free - * Software Foundation. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR - * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES - * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. - * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, - * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF - * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD: src/sys/net80211/ieee80211_var.h,v 1.15 2004/04/05 22:10:26 sam Exp $ - * $DragonFly: src/sys/netproto/802_11/wlan/Attic/ieee80211_var.h,v 1.2 2005/01/26 00:37:40 joerg Exp $ - */ - -#ifndef _NETPROTO_802_11_IEEE80211_VAR_H_ -#define _NETPROTO_802_11_IEEE80211_VAR_H_ - -/* - * Definitions for IEEE 802.11 drivers. - */ - -#include -#include -#include /* for ieee80211_stats */ -#include -#include - -#define IEEE80211_CHAN_MAX 255 -#define IEEE80211_CHAN_ANY 0xffff /* token for ``any channel'' */ -#define IEEE80211_CHAN_ANYC \ - ((struct ieee80211_channel *) IEEE80211_CHAN_ANY) - -#define IEEE80211_TXPOWER_MAX 100 /* max power */ -#define IEEE80211_TXPOWER_MIN 0 /* kill radio (if possible) */ - -enum ieee80211_phytype { - IEEE80211_T_DS, /* direct sequence spread spectrum */ - IEEE80211_T_FH, /* frequency hopping */ - IEEE80211_T_OFDM, /* frequency division multiplexing */ - IEEE80211_T_TURBO, /* high rate OFDM, aka turbo mode */ -}; -#define IEEE80211_T_CCK IEEE80211_T_DS /* more common nomenclature */ - -/* XXX not really a mode; there are really multiple PHY's */ -enum ieee80211_phymode { - IEEE80211_MODE_AUTO = 0, /* autoselect */ - IEEE80211_MODE_11A = 1, /* 5GHz, OFDM */ - IEEE80211_MODE_11B = 2, /* 2GHz, CCK */ - IEEE80211_MODE_11G = 3, /* 2GHz, OFDM */ - IEEE80211_MODE_FH = 4, /* 2GHz, GFSK */ - IEEE80211_MODE_TURBO = 5, /* 5GHz, OFDM, 2x clock */ -}; -#define IEEE80211_MODE_MAX (IEEE80211_MODE_TURBO+1) - -enum ieee80211_opmode { - IEEE80211_M_STA = 1, /* infrastructure station */ - IEEE80211_M_IBSS = 0, /* IBSS (adhoc) station */ - IEEE80211_M_AHDEMO = 3, /* Old lucent compatible adhoc demo */ - IEEE80211_M_HOSTAP = 6, /* Software Access Point */ - IEEE80211_M_MONITOR = 8 /* Monitor mode */ -}; - -/* - * 802.11g protection mode. - */ -enum ieee80211_protmode { - IEEE80211_PROT_NONE = 0, /* no protection */ - IEEE80211_PROT_CTSONLY = 1, /* CTS to self */ - IEEE80211_PROT_RTSCTS = 2, /* RTS-CTS */ -}; - -/* - * Channels are specified by frequency and attributes. - */ -struct ieee80211_channel { - uint16_t ic_freq; /* setting in Mhz */ - uint16_t ic_flags; /* see below */ -}; - -/* bits 0-3 are for private use by drivers */ -/* channel attributes */ -#define IEEE80211_CHAN_TURBO 0x0010 /* Turbo channel */ -#define IEEE80211_CHAN_CCK 0x0020 /* CCK channel */ -#define IEEE80211_CHAN_OFDM 0x0040 /* OFDM channel */ -#define IEEE80211_CHAN_2GHZ 0x0080 /* 2 GHz spectrum channel. */ -#define IEEE80211_CHAN_5GHZ 0x0100 /* 5 GHz spectrum channel */ -#define IEEE80211_CHAN_PASSIVE 0x0200 /* Only passive scan allowed */ -#define IEEE80211_CHAN_DYN 0x0400 /* Dynamic CCK-OFDM channel */ -#define IEEE80211_CHAN_GFSK 0x0800 /* GFSK channel (FHSS PHY) */ - -/* - * Useful combinations of channel characteristics. - */ -#define IEEE80211_CHAN_FHSS \ - (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_GFSK) -#define IEEE80211_CHAN_A \ - (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_OFDM) -#define IEEE80211_CHAN_B \ - (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_CCK) -#define IEEE80211_CHAN_PUREG \ - (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_OFDM) -#define IEEE80211_CHAN_G \ - (IEEE80211_CHAN_2GHZ | IEEE80211_CHAN_DYN) -#define IEEE80211_CHAN_T \ - (IEEE80211_CHAN_5GHZ | IEEE80211_CHAN_OFDM | IEEE80211_CHAN_TURBO) - -#define IEEE80211_IS_CHAN_FHSS(_c) \ - (((_c)->ic_flags & IEEE80211_CHAN_FHSS) == IEEE80211_CHAN_FHSS) -#define IEEE80211_IS_CHAN_A(_c) \ - (((_c)->ic_flags & IEEE80211_CHAN_A) == IEEE80211_CHAN_A) -#define IEEE80211_IS_CHAN_B(_c) \ - (((_c)->ic_flags & IEEE80211_CHAN_B) == IEEE80211_CHAN_B) -#define IEEE80211_IS_CHAN_PUREG(_c) \ - (((_c)->ic_flags & IEEE80211_CHAN_PUREG) == IEEE80211_CHAN_PUREG) -#define IEEE80211_IS_CHAN_G(_c) \ - (((_c)->ic_flags & IEEE80211_CHAN_G) == IEEE80211_CHAN_G) -#define IEEE80211_IS_CHAN_T(_c) \ - (((_c)->ic_flags & IEEE80211_CHAN_T) == IEEE80211_CHAN_T) - -#define IEEE80211_IS_CHAN_2GHZ(_c) \ - (((_c)->ic_flags & IEEE80211_CHAN_2GHZ) != 0) -#define IEEE80211_IS_CHAN_5GHZ(_c) \ - (((_c)->ic_flags & IEEE80211_CHAN_5GHZ) != 0) -#define IEEE80211_IS_CHAN_OFDM(_c) \ - (((_c)->ic_flags & IEEE80211_CHAN_OFDM) != 0) -#define IEEE80211_IS_CHAN_CCK(_c) \ - (((_c)->ic_flags & IEEE80211_CHAN_CCK) != 0) -#define IEEE80211_IS_CHAN_GFSK(_c) \ - (((_c)->ic_flags & IEEE80211_CHAN_GFSK) != 0) - -/* ni_chan encoding for FH phy */ -#define IEEE80211_FH_CHANMOD 80 -#define IEEE80211_FH_CHAN(set,pat) (((set)-1)*IEEE80211_FH_CHANMOD+(pat)) -#define IEEE80211_FH_CHANSET(chan) ((chan)/IEEE80211_FH_CHANMOD+1) -#define IEEE80211_FH_CHANPAT(chan) ((chan)%IEEE80211_FH_CHANMOD) - -struct ieee80211com { - struct arpcom ic_ac; - void (*ic_recv_mgmt)(struct ieee80211com *, - struct mbuf *, struct ieee80211_node *, - int, int, uint32_t); - int (*ic_send_mgmt)(struct ieee80211com *, - struct ieee80211_node *, int, int); - int (*ic_newstate)(struct ieee80211com *, - enum ieee80211_state, int); - void (*ic_newassoc)(struct ieee80211com *, - struct ieee80211_node *, int); - uint8_t ic_myaddr[IEEE80211_ADDR_LEN]; - struct ieee80211_rateset ic_sup_rates[IEEE80211_MODE_MAX]; - struct ieee80211_channel ic_channels[IEEE80211_CHAN_MAX+1]; - u_char ic_chan_avail[roundup(IEEE80211_CHAN_MAX,NBBY)]; - u_char ic_chan_active[roundup(IEEE80211_CHAN_MAX, NBBY)]; - u_char ic_chan_scan[roundup(IEEE80211_CHAN_MAX,NBBY)]; - struct ifqueue ic_mgtq; - uint32_t ic_flags; /* state flags */ - uint32_t ic_caps; /* capabilities */ - uint16_t ic_modecaps; /* set of mode capabilities */ - uint16_t ic_curmode; /* current mode */ - enum ieee80211_phytype ic_phytype; /* XXX wrong for multi-mode */ - enum ieee80211_opmode ic_opmode; /* operation mode */ - enum ieee80211_state ic_state; /* 802.11 state */ - enum ieee80211_protmode ic_protmode; /* 802.11g protection mode */ - struct ifmedia ic_media; /* interface media config */ - struct bpf_if *ic_rawbpf; /* packet filter structure */ - struct ieee80211_node *ic_bss; /* information for this node */ - struct ieee80211_channel *ic_ibss_chan; - int ic_fixed_rate; /* index to ic_sup_rates[] */ - uint16_t ic_rtsthreshold; - uint16_t ic_fragthreshold; - struct lwkt_token ic_nodetoken; /* on node table */ - u_int ic_scangen; /* gen# for timeout scan */ - struct ieee80211_node *(*ic_node_alloc)(struct ieee80211com *); - void (*ic_node_free)(struct ieee80211com *, - struct ieee80211_node *); - void (*ic_node_copy)(struct ieee80211com *, - struct ieee80211_node *, - const struct ieee80211_node *); - uint8_t (*ic_node_getrssi)(struct ieee80211com *, - struct ieee80211_node *); - TAILQ_HEAD(, ieee80211_node) ic_node; /* information of all nodes */ - LIST_HEAD(, ieee80211_node) ic_hash[IEEE80211_NODE_HASHSIZE]; - uint16_t ic_lintval; /* listen interval */ - uint16_t ic_holdover; /* PM hold over duration */ - uint16_t ic_txmin; /* min tx retry count */ - uint16_t ic_txmax; /* max tx retry count */ - uint16_t ic_txlifetime; /* tx lifetime */ - uint16_t ic_txpower; /* tx power setting (dbM) */ - uint16_t ic_bmisstimeout;/* beacon miss threshold (ms) */ - int ic_mgt_timer; /* mgmt timeout */ - int ic_inact_timer; /* inactivity timer wait */ - int ic_des_esslen; - uint8_t ic_des_essid[IEEE80211_NWID_LEN]; - struct ieee80211_channel *ic_des_chan; /* desired channel */ - uint8_t ic_des_bssid[IEEE80211_ADDR_LEN]; - struct ieee80211_wepkey ic_nw_keys[IEEE80211_WEP_NKID]; - int ic_wep_txkey; /* default tx key index */ - void *ic_wep_ctx; /* wep crypt context */ - uint32_t ic_iv; /* initial vector for wep */ - struct ieee80211_stats ic_stats; /* statistics */ -}; -#define ic_if ic_ac.ac_if -#define ic_softc ic_if.if_softc - -#define IEEE80211_ADDR_EQ(a1,a2) (memcmp(a1,a2,IEEE80211_ADDR_LEN) == 0) -#define IEEE80211_ADDR_COPY(dst,src) memcpy(dst,src,IEEE80211_ADDR_LEN) - -/* ic_flags */ -#define IEEE80211_F_ASCAN 0x00000001 /* STATUS: active scan */ -#define IEEE80211_F_SIBSS 0x00000002 /* STATUS: start IBSS */ -#define IEEE80211_F_WEPON 0x00000100 /* CONF: WEP enabled */ -#define IEEE80211_F_IBSSON 0x00000200 /* CONF: IBSS creation enable */ -#define IEEE80211_F_PMGTON 0x00000400 /* CONF: Power mgmt enable */ -#define IEEE80211_F_DESBSSID 0x00000800 /* CONF: des_bssid is set */ -#define IEEE80211_F_SCANAP 0x00001000 /* CONF: Scanning AP */ -#define IEEE80211_F_ROAMING 0x00002000 /* CONF: roaming enabled */ -#define IEEE80211_F_SWRETRY 0x00004000 /* CONF: sw tx retry enabled */ -#define IEEE80211_F_TXPMGT 0x00018000 /* STATUS: tx power */ -#define IEEE80211_F_TXPOW_OFF 0x00000000 /* TX Power: radio disabled */ -#define IEEE80211_F_TXPOW_FIXED 0x00008000 /* TX Power: fixed rate */ -#define IEEE80211_F_TXPOW_AUTO 0x00010000 /* TX Power: undefined */ -#define IEEE80211_F_SHSLOT 0x00020000 /* CONF: short slot time */ -#define IEEE80211_F_SHPREAMBLE 0x00040000 /* CONF: short preamble */ -#define IEEE80211_F_USEPROT 0x00100000 /* STATUS: protection enabled */ -#define IEEE80211_F_USEBARKER 0x00200000 /* STATUS: use barker preamble*/ - -/* ic_caps */ -#define IEEE80211_C_WEP 0x00000001 /* CAPABILITY: WEP available */ -#define IEEE80211_C_IBSS 0x00000002 /* CAPABILITY: IBSS available */ -#define IEEE80211_C_PMGT 0x00000004 /* CAPABILITY: Power mgmt */ -#define IEEE80211_C_HOSTAP 0x00000008 /* CAPABILITY: HOSTAP avail */ -#define IEEE80211_C_AHDEMO 0x00000010 /* CAPABILITY: Old Adhoc Demo */ -#define IEEE80211_C_SWRETRY 0x00000020 /* CAPABILITY: sw tx retry */ -#define IEEE80211_C_TXPMGT 0x00000040 /* CAPABILITY: tx power mgmt */ -#define IEEE80211_C_SHSLOT 0x00000080 /* CAPABILITY: short slottime */ -#define IEEE80211_C_SHPREAMBLE 0x00000100 /* CAPABILITY: short preamble */ -#define IEEE80211_C_MONITOR 0x00000200 /* CAPABILITY: monitor mode */ - -/* flags for ieee80211_fix_rate() */ -#define IEEE80211_F_DOSORT 0x00000001 /* sort rate list */ -#define IEEE80211_F_DOFRATE 0x00000002 /* use fixed rate */ -#define IEEE80211_F_DONEGO 0x00000004 /* calc negotiated rate */ -#define IEEE80211_F_DODEL 0x00000008 /* delete ignore rate */ - -void ieee80211_ifattach(struct ifnet *); -void ieee80211_ifdetach(struct ifnet *); -void ieee80211_media_init(struct ifnet *, ifm_change_cb_t, ifm_stat_cb_t); -int ieee80211_media_change(struct ifnet *); -void ieee80211_media_status(struct ifnet *, struct ifmediareq *); -int ieee80211_ioctl(struct ifnet *, u_long, caddr_t, struct ucred *); -int ieee80211_cfgget(struct ifnet *, u_long, caddr_t, struct ucred *); -int ieee80211_cfgset(struct ifnet *, u_long, caddr_t); -void ieee80211_watchdog(struct ifnet *); -int ieee80211_fix_rate(struct ieee80211com *, struct ieee80211_node *, int); -int ieee80211_rate2media(struct ieee80211com *, int, - enum ieee80211_phymode); -int ieee80211_media2rate(int); -u_int ieee80211_mhz2ieee(u_int, u_int); -u_int ieee80211_chan2ieee(struct ieee80211com *, struct ieee80211_channel *); -u_int ieee80211_ieee2mhz(u_int, u_int); -int ieee80211_setmode(struct ieee80211com *, enum ieee80211_phymode); -enum ieee80211_phymode ieee80211_chan2mode(struct ieee80211com *, - struct ieee80211_channel *); - -#define IEEE80211_DEBUG -#ifdef IEEE80211_DEBUG -extern int ieee80211_debug; -#define IEEE80211_DPRINTF(X) if (ieee80211_debug) printf X -#define IEEE80211_DPRINTF2(X) if (ieee80211_debug>1) printf X -#else -#define IEEE80211_DPRINTF(X) -#define IEEE80211_DPRINTF2(X) -#endif - -#endif /* _NETPROTO_802_11_IEEE80211_VAR_H_ */ diff --git a/sys/netproto/802_11/wlan/if_wavelan_ieee.h b/sys/netproto/802_11/wlan/if_wavelan_ieee.h deleted file mode 100644 index 5ea589507e..0000000000 --- a/sys/netproto/802_11/wlan/if_wavelan_ieee.h +++ /dev/null @@ -1,748 +0,0 @@ -/* - * Copyright (c) 1997, 1998, 1999 - * Bill Paul . All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by Bill Paul. - * 4. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - * - * $FreeBSD: src/sys/dev/wi/if_wavelan_ieee.h,v 1.18 2003/06/27 00:49:04 sam Exp $ - * $DragonFly: src/sys/netproto/802_11/wlan/Attic/if_wavelan_ieee.h,v 1.1 2004/07/26 16:30:17 joerg Exp $ - */ - -#ifndef _NETPROTO_802_11_IF_WAVELAN_IEEE_H -#define _NETPROTO_802_11_IF_WAVELAN_IEEE_H - -/* - * This header defines a simple command interface to the FreeBSD - * WaveLAN/IEEE driver (wi) driver, which is used to set certain - * device-specific parameters which can't be easily managed through - * ifconfig(8). No, sysctl(2) is not the answer. I said a _simple_ - * interface, didn't I. - */ - -#ifndef SIOCSWAVELAN -#define SIOCSWAVELAN SIOCSIFGENERIC -#endif - -#ifndef SIOCGWAVELAN -#define SIOCGWAVELAN SIOCGIFGENERIC -#endif - -/* - * Technically I don't think there's a limit to a record - * length. The largest record is the one that contains the CIS - * data, which is 240 words long, so 256 should be a safe - * value. - */ -#define WI_MAX_DATALEN 512 - -struct wi_req { - uint16_t wi_len; - uint16_t wi_type; - uint16_t wi_val[WI_MAX_DATALEN]; -}; - -/* - * Private LTV records (interpreted only by the driver). This is - * a minor kludge to allow reading the interface statistics from - * the driver. - */ -#define WI_RID_IFACE_STATS 0x0100 -#define WI_RID_MGMT_XMIT 0x0200 -#define WI_RID_ZERO_CACHE 0x0300 -#define WI_RID_READ_CACHE 0x0400 -#define WI_RID_FWDOWNLOAD 0x0500 -#define WI_RID_MONITOR_MODE 0x0600 -#define WI_RID_MIF 0x0700 -#define WI_RID_SCAN_APS 0x0800 -#define WI_RID_READ_APS 0x0900 - -struct wi_80211_hdr { - uint16_t frame_ctl; - uint16_t dur_id; - uint8_t addr1[6]; - uint8_t addr2[6]; - uint8_t addr3[6]; - uint16_t seq_ctl; - uint8_t addr4[6]; -}; - -#define WI_FCTL_VERS 0x0002 -#define WI_FCTL_FTYPE 0x000C -#define WI_FCTL_STYPE 0x00F0 -#define WI_FCTL_TODS 0x0100 -#define WI_FCTL_FROMDS 0x0200 -#define WI_FCTL_MOREFRAGS 0x0400 -#define WI_FCTL_RETRY 0x0800 -#define WI_FCTL_PM 0x1000 -#define WI_FCTL_MOREDATA 0x2000 -#define WI_FCTL_WEP 0x4000 -#define WI_FCTL_ORDER 0x8000 - -#define WI_FTYPE_MGMT 0x0000 -#define WI_FTYPE_CTL 0x0004 -#define WI_FTYPE_DATA 0x0008 - -#define WI_STYPE_MGMT_ASREQ 0x0000 /* association request */ -#define WI_STYPE_MGMT_ASRESP 0x0010 /* association response */ -#define WI_STYPE_MGMT_REASREQ 0x0020 /* reassociation request */ -#define WI_STYPE_MGMT_REASRESP 0x0030 /* reassociation response */ -#define WI_STYPE_MGMT_PROBEREQ 0x0040 /* probe request */ -#define WI_STYPE_MGMT_PROBERESP 0x0050 /* probe response */ -#define WI_STYPE_MGMT_BEACON 0x0080 /* beacon */ -#define WI_STYPE_MGMT_ATIM 0x0090 /* announcement traffic ind msg */ -#define WI_STYPE_MGMT_DISAS 0x00A0 /* disassociation */ -#define WI_STYPE_MGMT_AUTH 0x00B0 /* authentication */ -#define WI_STYPE_MGMT_DEAUTH 0x00C0 /* deauthentication */ - -#define WI_STYPE_CTL_PSPOLL 0x00A0 -#define WI_STYPE_CTL_RTS 0x00B0 -#define WI_STYPE_CTL_CTS 0x00C0 -#define WI_STYPE_CTL_ACK 0x00D0 -#define WI_STYPE_CTL_CFEND 0x00E0 -#define WI_STYPE_CTL_CFENDACK 0x00F0 - -struct wi_mgmt_hdr { - uint16_t frame_ctl; - uint16_t duration; - uint8_t dst_addr[6]; - uint8_t src_addr[6]; - uint8_t bssid[6]; - uint16_t seq_ctl; -}; - -/* - * Lucent/wavelan IEEE signal strength cache - * - * driver keeps cache of last - * MAXWICACHE packets to arrive including signal strength info. - * daemons may read this via ioctl - * - * Each entry in the wi_sigcache has a unique macsrc. - */ -struct wi_sigcache { - char macsrc[6]; /* unique MAC address for entry */ - int ipsrc; /* ip address associated with packet */ - int signal; /* signal strength of the packet */ - int noise; /* noise value */ - int quality; /* quality of the packet */ -}; - -/* - * Firmware downloading API. We support downloading into RAM and into - * flash. We copy the entire .hex file for both the primary and secondary - * firmware into the kernel, which is minorly gross, but matches the - * format of the compiled in firmware. - */ -struct wi_fwdownload { - int type; /* What type of download. */ -#define WI_FW_RAM 1 -#define WI_FW_FLASH 2 - size_t pri_len; /* Primary firmware length */ - size_t sec_len; /* Secondary firmware length */ - caddr_t pri_data; /* Pointer (user) to primary data */ - caddr_t sec_data; /* Pointer (user) to secondary data */ -}; - -struct wi_counters { - uint32_t wi_tx_unicast_frames; - uint32_t wi_tx_multicast_frames; - uint32_t wi_tx_fragments; - uint32_t wi_tx_unicast_octets; - uint32_t wi_tx_multicast_octets; - uint32_t wi_tx_deferred_xmits; - uint32_t wi_tx_single_retries; - uint32_t wi_tx_multi_retries; - uint32_t wi_tx_retry_limit; - uint32_t wi_tx_discards; - uint32_t wi_rx_unicast_frames; - uint32_t wi_rx_multicast_frames; - uint32_t wi_rx_fragments; - uint32_t wi_rx_unicast_octets; - uint32_t wi_rx_multicast_octets; - uint32_t wi_rx_fcs_errors; - uint32_t wi_rx_discards_nobuf; - uint32_t wi_tx_discards_wrong_sa; - uint32_t wi_rx_WEP_cant_decrypt; - uint32_t wi_rx_msg_in_msg_frags; - uint32_t wi_rx_msg_in_bad_msg_frags; -}; - -/* - * Network parameters, static configuration entities. - */ -#define WI_RID_PORTTYPE 0xFC00 /* Connection control characteristics */ -#define WI_RID_MAC_NODE 0xFC01 /* MAC address of this station */ -#define WI_RID_DESIRED_SSID 0xFC02 /* Service Set ID for connection */ -#define WI_RID_OWN_CHNL 0xFC03 /* Comm channel for BSS creation */ -#define WI_RID_OWN_SSID 0xFC04 /* IBSS creation ID */ -#define WI_RID_OWN_ATIM_WIN 0xFC05 /* ATIM window time for IBSS creation */ -#define WI_RID_SYSTEM_SCALE 0xFC06 /* scale that specifies AP density */ -#define WI_RID_MAX_DATALEN 0xFC07 /* Max len of MAC frame body data */ -#define WI_RID_MAC_WDS 0xFC08 /* MAC addr of corresponding WDS node */ -#define WI_RID_PM_ENABLED 0xFC09 /* ESS power management enable */ -#define WI_RID_PM_EPS 0xFC0A /* PM EPS/PS mode */ -#define WI_RID_MCAST_RX 0xFC0B /* ESS PM mcast reception */ -#define WI_RID_MAX_SLEEP 0xFC0C /* max sleep time for ESS PM */ -#define WI_RID_HOLDOVER 0xFC0D /* holdover time for ESS PM */ -#define WI_RID_NODENAME 0xFC0E /* ID name of this node for diag */ -#define WI_RID_DTIM_PERIOD 0xFC10 /* beacon interval between DTIMs */ -#define WI_RID_WDS_ADDR1 0xFC11 /* port 1 MAC of WDS link node */ -#define WI_RID_WDS_ADDR2 0xFC12 /* port 1 MAC of WDS link node */ -#define WI_RID_WDS_ADDR3 0xFC13 /* port 1 MAC of WDS link node */ -#define WI_RID_WDS_ADDR4 0xFC14 /* port 1 MAC of WDS link node */ -#define WI_RID_WDS_ADDR5 0xFC15 /* port 1 MAC of WDS link node */ -#define WI_RID_WDS_ADDR6 0xFC16 /* port 1 MAC of WDS link node */ -#define WI_RID_MCAST_PM_BUF 0xFC17 /* PM buffering of mcast */ -#define WI_RID_ENCRYPTION 0xFC20 /* enable/disable WEP */ -#define WI_RID_AUTHTYPE 0xFC21 /* specify authentication type */ -#define WI_RID_P2_TX_CRYPT_KEY 0xFC23 -#define WI_RID_P2_CRYPT_KEY0 0xFC24 -#define WI_RID_P2_CRYPT_KEY1 0xFC25 -#define WI_RID_MICROWAVE_OVEN 0xFC25 -#define WI_RID_P2_CRYPT_KEY2 0xFC26 -#define WI_RID_P2_CRYPT_KEY3 0xFC27 -#define WI_RID_P2_ENCRYPTION 0xFC28 -#define PRIVACY_INVOKED 0x01 -#define EXCLUDE_UNENCRYPTED 0x02 -#define HOST_ENCRYPT 0x10 -#define IV_EVERY_FRAME 0x00 /* IV = Initialization Vector */ -#define IV_EVERY10_FRAME 0x20 /* every 10 frame IV reuse */ -#define IV_EVERY50_FRAME 0x40 /* every 50 frame IV reuse */ -#define IV_EVERY100_FRAME 0x60 /* every 100 frame IV reuse */ -#define HOST_DECRYPT 0x80 -#define WI_RID_WEP_MAPTABLE 0xFC29 -#define WI_RID_CNFAUTHMODE 0xFC2A -#define WI_RID_ROAMING_MODE 0xFC2D -#define WI_RID_OWN_BEACON_INT 0xFC33 /* beacon xmit time for BSS creation */ -#define WI_RID_CNF_DBM_ADJUST 0xFC46 -#define WI_RID_DBM_ADJUST 0xFC46 /* RSSI - WI_RID_DBM_ADJUST ~ dBm */ -#define WI_RID_BASIC_RATE 0xFCB3 -#define WI_RID_SUPPORT_RATE 0xFCB4 - -/* - * Network parameters, dynamic configuration entities - */ -#define WI_RID_MCAST_LIST 0xFC80 /* list of multicast addrs */ -#define WI_RID_CREATE_IBSS 0xFC81 /* create IBSS */ -#define WI_RID_FRAG_THRESH 0xFC82 /* frag len, unicast msg xmit */ -#define WI_RID_RTS_THRESH 0xFC83 /* frame len for RTS/CTS handshake */ -#define WI_RID_TX_RATE 0xFC84 /* data rate for message xmit - * 0 == Fixed 1mbps - * 1 == Fixed 2mbps - * 2 == auto fallback - */ -#define WI_RID_PROMISC 0xFC85 /* enable promisc mode */ -#define WI_RID_FRAG_THRESH0 0xFC90 -#define WI_RID_FRAG_THRESH1 0xFC91 -#define WI_RID_FRAG_THRESH2 0xFC92 -#define WI_RID_FRAG_THRESH3 0xFC93 -#define WI_RID_FRAG_THRESH4 0xFC94 -#define WI_RID_FRAG_THRESH5 0xFC95 -#define WI_RID_FRAG_THRESH6 0xFC96 -#define WI_RID_RTS_THRESH0 0xFC97 -#define WI_RID_RTS_THRESH1 0xFC98 -#define WI_RID_RTS_THRESH2 0xFC99 -#define WI_RID_RTS_THRESH3 0xFC9A -#define WI_RID_RTS_THRESH4 0xFC9B -#define WI_RID_RTS_THRESH5 0xFC9C -#define WI_RID_RTS_THRESH6 0xFC9D -#define WI_RID_TX_RATE0 0xFC9E -#define WI_RID_TX_RATE1 0xFC9F -#define WI_RID_TX_RATE2 0xFCA0 -#define WI_RID_TX_RATE3 0xFCA1 -#define WI_RID_TX_RATE4 0xFCA2 -#define WI_RID_TX_RATE5 0xFCA3 -#define WI_RID_TX_RATE6 0xFCA4 -#define WI_RID_DEFLT_CRYPT_KEYS 0xFCB0 -#define WI_RID_TX_CRYPT_KEY 0xFCB1 -#define WI_RID_TICK_TIME 0xFCE0 - -struct wi_key { - uint16_t wi_keylen; - uint8_t wi_keydat[14]; -}; - -#define WI_NLTV_KEYS 4 -struct wi_ltv_keys { - uint16_t wi_len; - uint16_t wi_type; - struct wi_key wi_keys[WI_NLTV_KEYS]; -}; - -/* - * NIC information - */ -#define WI_RID_DNLD_BUF 0xFD01 -#define WI_RID_MEMSZ 0xFD02 /* memory size info (XXX Lucent) */ - /* Looks like on lucnet pri firm too */ -#define WI_RID_PRI_IDENTITY 0xFD02 /* primary funcs firmware ident (PRISM2) */ -#define WI_RID_PRI_SUP_RANGE 0xFD03 /* primary supplier compatibility */ -#define WI_RID_CIF_ACT_RANGE 0xFD04 /* controller sup. compatibility */ -#define WI_RID_SERIALNO 0xFD0A /* card serial number */ -#define WI_RID_CARD_ID 0xFD0B /* card identification */ -#define WI_RID_MFI_SUP_RANGE 0xFD0C /* modem supplier compatibility */ -#define WI_RID_CFI_SUP_RANGE 0xFD0D /* controller sup. compatibility */ -#define WI_RID_CHANNEL_LIST 0xFD10 /* allowd comm. frequencies. */ -#define WI_RID_REG_DOMAINS 0xFD11 /* list of intendted regulatory doms */ -#define WI_RID_TEMP_TYPE 0xFD12 /* hw temp range code */ -#define WI_RID_CIS 0xFD13 /* PC card info struct */ -#define WI_RID_STA_IDENTITY 0xFD20 /* station funcs firmware ident */ -#define WI_RID_STA_SUP_RANGE 0xFD21 /* station supplier compat */ -#define WI_RID_MFI_ACT_RANGE 0xFD22 -#define WI_RID_SYMBOL_IDENTITY 0xFD24 -#define WI_RID_CFI_ACT_RANGE 0xFD33 -#define WI_RID_COMMQUAL 0xFD43 -#define WI_RID_SCALETHRESH 0xFD46 -#define WI_RID_PCF 0xFD87 - -/* - * MAC information - */ -#define WI_RID_PORT_STAT 0xFD40 /* actual MAC port con control stat */ -#define WI_RID_CURRENT_SSID 0xFD41 /* ID of actually connected SS */ -#define WI_RID_CURRENT_BSSID 0xFD42 /* ID of actually connected BSS */ -#define WI_RID_COMMS_QUALITY 0xFD43 /* quality of BSS connection */ -#define WI_RID_CUR_TX_RATE 0xFD44 /* current TX rate */ -#define WI_RID_CUR_BEACON_INT 0xFD45 /* current beacon interval */ -#define WI_RID_CUR_SCALE_THRESH 0xFD46 /* actual system scane thresh setting */ -#define WI_RID_PROT_RESP_TIME 0xFD47 /* time to wait for resp to req msg */ -#define WI_RID_SHORT_RTR_LIM 0xFD48 /* max tx attempts for short frames */ -#define WI_RID_LONG_RTS_LIM 0xFD49 /* max tx attempts for long frames */ -#define WI_RID_MAX_TX_LIFE 0xFD4A /* max tx frame handling duration */ -#define WI_RID_MAX_RX_LIFE 0xFD4B /* max rx frame handling duration */ -#define WI_RID_CF_POLL 0xFD4C /* contention free pollable ind */ -#define WI_RID_AUTH_ALGS 0xFD4D /* auth algorithms available */ -#define WI_RID_AUTH_TYPE 0xFD4E /* availanle auth types */ -#define WI_RID_WEP_AVAIL 0xFD4F /* WEP privacy option available */ -#define WI_RID_DBM_COMMS_QUAL 0xFD51 /* CommQuality normalized to dBm */ -#define WI_RID_CUR_TX_RATE1 0xFD80 -#define WI_RID_CUR_TX_RATE2 0xFD81 -#define WI_RID_CUR_TX_RATE3 0xFD82 -#define WI_RID_CUR_TX_RATE4 0xFD83 -#define WI_RID_CUR_TX_RATE5 0xFD84 -#define WI_RID_CUR_TX_RATE6 0xFD85 -#define WI_RID_OWN_MAC 0xFD86 /* unique local MAC addr */ -#define WI_RID_PCI_INFO 0xFD87 /* point coordination func cap */ - -/* - * Scan Information - */ -#define WI_RID_BCAST_SCAN_REQ 0xFCAB /* Broadcast Scan request (Symbol) */ -#define BSCAN_5SEC 0x01 -#define BSCAN_ONETIME 0x02 -#define BSCAN_PASSIVE 0x40 -#define BSCAN_BCAST 0x80 -#define WI_RID_SCAN_REQ 0xFCE1 /* Scan request (STA only) */ -#define WI_RID_JOIN_REQ 0xFCE2 /* Join request (STA only) */ -#define WI_RID_AUTH_STATION 0xFCE3 /* Authenticates Station (AP) */ -#define WI_RID_CHANNEL_REQ 0xFCE4 /* Channel Information Request (AP) */ -#define WI_RID_SCAN_RESULTS 0xFD88 /* Scan Results Table */ - -struct wi_apinfo { - int scanreason; /* ScanReason */ - char bssid[6]; /* BSSID (mac address) */ - int channel; /* Channel */ - int signal; /* Signal level */ - int noise; /* Average Noise Level*/ - int quality; /* Quality */ - int namelen; /* Length of SSID string */ - char name[32]; /* SSID string */ - int capinfo; /* Capability info. */ - int interval; /* BSS Beacon Interval */ - int rate; /* Data Rate */ -}; - -/* - * Modem information - */ -#define WI_RID_PHY_TYPE 0xFDC0 /* phys layer type indication */ -#define WI_RID_CURRENT_CHAN 0xFDC1 /* current frequency */ -#define WI_RID_PWR_STATE 0xFDC2 /* pwr consumption status */ -#define WI_RID_CCA_MODE 0xFDC3 /* clear chan assess mode indication */ -#define WI_RID_CCA_TIME 0xFDC4 /* clear chan assess time */ -#define WI_RID_MAC_PROC_DELAY 0xFDC5 /* MAC processing delay time */ -#define WI_RID_DATA_RATES 0xFDC6 /* supported data rates */ - -/* - * bsd-airtools v0.2 - source-mods v0.2 [common.h] - * by h1kari - (c) Dachb0den Labs 2001 - */ - -/* - * Copyright (c) 2001 Dachb0den Labs. - * David Hulton . All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by David Hulton. - * 4. Neither the name of the author nor the names of any co-contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY David Hulton AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL David Hulton OR THE VOICES IN HIS HEAD - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * standard hermes recieve frame used by wavelan/prism2 cards - */ -struct wi_rx_frame { - /* - * hermes prefix header. supplies information on the current status of - * the network and various other statistics gathered from the - * management/control frames as used internally. - */ - uint16_t wi_status; - uint16_t wi_ts0; - uint16_t wi_ts1; - uint8_t wi_silence; - uint8_t wi_signal; - uint8_t wi_rate; - uint8_t wi_rx_flow; - uint16_t wi_rsvd0; - uint16_t wi_rsvd1; - /* - * standard 80211 frame header. all packets have to use this header as - * per the AN9900 from intersil, even management/control. for - * management packets, they just threw the header into the data field, - * but for control packets the headers are lost in translation and - * therefore not all control packet info can be displayed. - */ - uint16_t wi_frame_ctl; - uint16_t wi_id; - uint8_t wi_addr1[6]; - uint8_t wi_addr2[6]; - uint8_t wi_addr3[6]; - uint16_t wi_seq_ctl; - uint8_t wi_addr4[6]; - uint16_t wi_dat_len; - /* - * another wierdity with the drivers. they append a 802.3 header which - * is somewhat redundant, since all the same data is provided in the - * 802.11 header. - */ - uint8_t wi_dst_addr[6]; - uint8_t wi_src_addr[6]; - uint16_t wi_len; -}; -#define WI_DATA_HDRLEN 0x44 -#define WI_MGMT_HDRLEN 0x3C -#define WI_CTL_HDRLEN 0x3C - - -/* - * all data packets have a snap (sub-network access protocol) header that - * isn't entirely definied, but added for ethernet compatibility. - */ -struct wi_snap_frame { - uint16_t wi_dat[3]; - uint16_t wi_type; -}; - - -/* - * management frame headers - * note: all management frames consist of a static header and variable length - * fields. - */ - -/* - * variable length field structure - */ -struct wi_mgmt_var_hdr { - uint8_t wi_code; - uint8_t wi_len; - uint8_t wi_data[256]; -}; - -/* - * management beacon frame prefix - */ -struct wi_mgmt_beacon_hdr { - uint32_t wi_ts0; - uint32_t wi_ts1; - uint16_t wi_interval; - uint16_t wi_capinfo; -}; - -/* - * ibss announcement traffic indication message (atim) frame - * note: no parameters - */ - -/* - * management disassociation frame - */ -struct wi_mgmt_disas_hdr { - uint16_t wi_reason; -}; - -/* - * management association request frame prefix - */ -struct wi_mgmt_asreq_hdr { - uint16_t wi_capinfo; - uint16_t wi_interval; -}; - -/* - * management association response frame prefix - */ -struct wi_mgmt_asresp_hdr { - uint16_t wi_capinfo; - uint16_t wi_status; - uint16_t wi_aid; -}; - -/* - * management reassociation request frame prefix - */ -struct wi_mgmt_reasreq_hdr { - uint16_t wi_capinfo; - uint16_t wi_interval; - uint8_t wi_currap[6]; -}; - -/* - * management reassociation response frame prefix - */ -struct wi_mgmt_reasresp_hdr { - uint16_t wi_capinfo; - uint16_t wi_status; - uint16_t wi_aid; -}; - -/* - * management probe request frame prefix - * note: no static parameters, only variable length - */ - -/* - * management probe response frame prefix - */ -struct wi_mgmt_proberesp_hdr { - uint32_t wi_ts0; - uint32_t wi_ts1; - uint16_t wi_interval; - uint16_t wi_capinfo; -}; - -/* - * management authentication frame prefix - */ -struct wi_mgmt_auth_hdr { - uint16_t wi_algo; - uint16_t wi_seq; - uint16_t wi_status; -}; - -/* - * management deauthentication frame - */ -struct wi_mgmt_deauth_hdr { - uint16_t wi_reason; -}; - - -/* - * rid configuration register definitions - */ -#define WI_RID_SCAN_REQ 0xFCE1 /* scan request information */ -#define WI_RID_SCAN_RES 0xFD88 /* scan result information */ - -#define WI_RID_PROCFRAME 0x3137 /* Return full frame information */ -#define WI_RID_PRISM2 0x3138 /* tell if we're a prism2 card or not */ - - -/* - * 802.11 definitions - */ -#define WI_STAT_BADCRC 0x0001 -#define WI_STAT_UNDECRYPTABLE 0x0002 -#define WI_STAT_ERRSTAT 0x0003 -#define WI_STAT_MAC_PORT 0x0700 -#define WI_STAT_1042 0x2000 -#define WI_STAT_TUNNEL 0x4000 -#define WI_STAT_WMP_MSG 0x6000 -#define WI_RXSTAT_MSG_TYPE 0xE000 - -#define WI_FCTL_OPT_MASK 0xFF00 -#define WI_AID_SET 0xC000 -#define WI_AID_MASK 0x3FFF -#define WI_SCTL_FRAGNUM_MASK 0x000F -#define WI_SCTL_SEQNUM_MASK 0xFFF0 - -#define WI_STAT_UNSPEC_FAIL 1 -#define WI_STAT_CAPINFO_FAIL 10 -#define WI_STAT_REAS_DENY 11 -#define WI_STAT_ASSOC_DENY 12 -#define WI_STAT_ALGO_FAIL 13 -#define WI_STAT_SEQ_FAIL 14 -#define WI_STAT_CHAL_FAIL 15 -#define WI_STAT_TOUT_FAIL 16 -#define WI_STAT_OVERL_DENY 17 -#define WI_STAT_RATE_DENY 18 - -#define WI_FTYPE_MGMT 0x0000 -#define WI_FTYPE_CTL 0x0004 -#define WI_FTYPE_DATA 0x0008 - -#define WI_FCTL_VERS 0x0002 -#define WI_FCTL_FTYPE 0x000C -#define WI_FCTL_STYPE 0x00F0 -#define WI_FCTL_TODS 0x0100 -#define WI_FCTL_FROMDS 0x0200 -#define WI_FCTL_MOREFRAGS 0x0400 -#define WI_FCTL_RETRY 0x0800 -#define WI_FCTL_PM 0x1000 -#define WI_FCTL_MOREDATA 0x2000 -#define WI_FCTL_WEP 0x4000 -#define WI_FCTL_ORDER 0x8000 - -#define WI_FCS_LEN 0x4 /* checksum length */ - - -/* - * management definitions - */ -#define WI_STYPE_MGMT_ASREQ 0x0000 -#define WI_STYPE_MGMT_ASRESP 0x0010 -#define WI_STYPE_MGMT_REASREQ 0x0020 -#define WI_STYPE_MGMT_REASRESP 0x0030 -#define WI_STYPE_MGMT_PROBEREQ 0x0040 -#define WI_STYPE_MGMT_PROBERESP 0x0050 -#define WI_STYPE_MGMT_BEACON 0x0080 -#define WI_STYPE_MGMT_ATIM 0x0090 -#define WI_STYPE_MGMT_DISAS 0x00A0 -#define WI_STYPE_MGMT_AUTH 0x00B0 -#define WI_STYPE_MGMT_DEAUTH 0x00C0 - -#define WI_CAPINFO_ESS 0x01 -#define WI_CAPINFO_IBSS 0x02 -#define WI_CAPINFO_CFPOLL 0x04 -#define WI_CAPINFO_CFPOLLREQ 0x08 -#define WI_CAPINFO_PRIV 0x10 - -#define WI_REASON_UNSPEC 1 -#define WI_REASON_AUTH_INVALID 2 -#define WI_REASON_DEAUTH_LEAVE 3 -#define WI_REASON_DISAS_INACT 4 -#define WI_REASON_DISAS_OVERL 5 -#define WI_REASON_CLASS2 6 -#define WI_REASON_CLASS3 7 -#define WI_REASON_DISAS_LEAVE 8 -#define WI_REASON_NOAUTH 9 - -#define WI_VAR_SSID 0 -#define WI_VAR_SRATES 1 -#define WI_VAR_FH 2 -#define WI_VAR_DS 3 -#define WI_VAR_CF 4 -#define WI_VAR_TIM 5 -#define WI_VAR_IBSS 6 -#define WI_VAR_CHAL 16 - -#define WI_VAR_SRATES_MASK 0x7F - - -/* - * control definitions - */ -#define WI_STYPE_CTL_PSPOLL 0x00A0 -#define WI_STYPE_CTL_RTS 0x00B0 -#define WI_STYPE_CTL_CTS 0x00C0 -#define WI_STYPE_CTL_ACK 0x00D0 -#define WI_STYPE_CTL_CFEND 0x00E0 -#define WI_STYPE_CTL_CFENDCFACK 0x00F0 - - -/* - * ap scanning structures - */ -struct wi_scan_res { - uint16_t wi_chan; - uint16_t wi_noise; - uint16_t wi_signal; - uint8_t wi_bssid[6]; - uint16_t wi_interval; - uint16_t wi_capinfo; - uint16_t wi_ssid_len; - uint8_t wi_ssid[32]; - uint8_t wi_srates[10]; - uint8_t wi_rate; - uint8_t wi_rsvd; -}; -#define WI_WAVELAN_RES_SIZE 50 - -struct wi_scan_p2_hdr { - uint16_t wi_rsvd; - uint16_t wi_reason; -}; -#define WI_PRISM2_RES_SIZE 62 - - -/* - * prism2 debug mode definitions - */ -#define SIOCSPRISM2DEBUG _IOW('i', 137, struct ifreq) -#define SIOCGPRISM2DEBUG _IOWR('i', 138, struct ifreq) - -#define WI_DEBUG_RESET 0x00 -#define WI_DEBUG_INIT 0x01 -#define WI_DEBUG_SLEEP 0x02 -#define WI_DEBUG_WAKE 0x03 -#define WI_DEBUG_CHAN 0x08 -#define WI_DEBUG_DELAYSUPP 0x09 -#define WI_DEBUG_TXSUPP 0x0A -#define WI_DEBUG_MONITOR 0x0B -#define WI_DEBUG_LEDTEST 0x0C -#define WI_DEBUG_CONTTX 0x0E -#define WI_DEBUG_STOPTEST 0x0F -#define WI_DEBUG_CONTRX 0x10 -#define WI_DEBUG_SIGSTATE 0x11 -#define WI_DEBUG_CALENABLE 0x13 -#define WI_DEBUG_CONFBITS 0x15 - -#endif /* _NETPROTO_802_11_IF_WAVELAN_IEEE_H */