Pre-trip, making sure everything is in

origin
mark 1999-10-13 14:23:15 +00:00
parent 58fcde77b3
commit 1ef6c5abe4
19 changed files with 6850 additions and 5789 deletions

13
README
View File

@ -0,0 +1,13 @@
Top level directory for linux-wlan-ng.
./doc - source distribution documentation
./man - man pages
./scripts - scripts used at run-time
./src - source code for various components
Note:
Some of the subdirectories have empty README files. This means we haven't
gotten to the contents of these directories. The empty README is just a trick
to prevent CVS from pruning the directory.

View File

@ -0,0 +1,11 @@
linux-wlan source distribution documentation
Files:
format.hfile - format of a header file
format.srcfile.c - template C file
format.srcfile.html - C file code standard document
TODO:
Create format.hfile.html and format.hfile.h using new style

View File

@ -1 +1,15 @@
This is the root directory for the linux-wlan-ng project.
./src - root for linux-wlan-ng source code directories
src/am930 - source for the AMD MAC specific driver
src/include - header files shared by various components. Header files
that are only used by one component are in that component's
source directory
src/p80211 - source for 802.11 services
src/prism2 - source for the Intersil PRISM2 MAC specific driver
src/shared - source files (.c) that are shared among two or more
components
src/wlanctl - source for the wlanctl user-mode utility
src/wland - source for the wland user-mode utility
src/wlandump - source for the wlandump utility

View File

@ -1,59 +1,72 @@
/* p80211hdr.h: Macros, types, and functions for handling 802.11 MAC headers
* --------------------------------------------------------------------
* Linux WLAN
* --------------------------------------------------------------------
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
* Linux WLAN
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
* The contents of this file are subject to the Mozilla Public
* License Version 1.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* The initial developer of the original code is Mark S. Mathews
* <mark@absoval.com>. Portions created by Mark S. Mathews
* are Copyright (C) 1998 AbsoluteValue Software, Inc. All Rights Reserved.
*
* Description:
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* This file declares the constants and types used in the interface
* between a wlan driver and the user mode utilities.
* The initial developer of the original code is Mark S. Mathews
* <mark@absoval.com>. Portions created by Mark S. Mathews
* are Copyright (C) 1998 AbsoluteValue Software, Inc. All Rights Reserved.
*
* --------------------------------------------------------------------
*
* Note: Constant values are always in HOST byte order. To assign
* values to multi-byte fields they _must_ be converted to
* ieee byte order. To retrieve multi-byte values from incoming
* frames, they must be converted to host order.
* The initial author may be reached as mark@absoval.com, or
* C/O AbsoluteValue Software Inc., P.O. Box 941149,
* Maitland, FL, 32794-1149
*
* All functions declared here are implemented in p80211.c
* --------------------------------------------------------------------
* --------------------------------------------------------------------
*
* This file declares the constants and types used in the interface
* between a wlan driver and the user mode utilities.
*
* Note:
* - Constant values are always in HOST byte order. To assign
* values to multi-byte fields they _must_ be converted to
* ieee byte order. To retrieve multi-byte values from incoming
* frames, they must be converted to host order.
*
* All functions declared here are implemented in p80211.c
* --------------------------------------------------------------------
*/
#ifndef _P80211HDR_H
#define _P80211HDR_H
/*================================================================*/
/* System Includes */
/*================================================================*/
/* Project Includes */
#ifndef _WLAN_COMPAT_H
#include <wlan/wlan_compat.h>
#endif
/*=============================================================*/
/*--- Constants -----------------------------------------------*/
/*=============================================================*/
/*================================================================*/
/* Constants */
/*--- Sizes -----------------------------------------------*/
#define WLAN_ADDR_LEN 6
#define WLAN_CRC_LEN 4
#define WLAN_BSSID_LEN 6
#define WLAN_BSS_TS_LEN 8
#define WLAN_HDR_A3_LEN 24
#define WLAN_HDR_A4_LEN 30
#define WLAN_SSID_MAXLEN 32
#define WLAN_DATA_MAXLEN 2312
#define WLAN_A3FR_MAXLEN (WLAN_HDR_A3_LEN + WLAN_DATA_MAXLEN + WLAN_CRC_LEN)
#define WLAN_ADDR_LEN 6
#define WLAN_CRC_LEN 4
#define WLAN_BSSID_LEN 6
#define WLAN_BSS_TS_LEN 8
#define WLAN_HDR_A3_LEN 24
#define WLAN_HDR_A4_LEN 30
#define WLAN_SSID_MAXLEN 32
#define WLAN_DATA_MAXLEN 2312
#define WLAN_A3FR_MAXLEN (WLAN_HDR_A3_LEN + WLAN_DATA_MAXLEN + WLAN_CRC_LEN)
#define WLAN_BEACON_FR_MAXLEN (WLAN_HDR_A3_LEN + 334)
#define WLAN_ATIM_FR_MAXLEN (WLAN_HDR_A3_LEN + 0)
#define WLAN_ATIM_FR_MAXLEN (WLAN_HDR_A3_LEN + 0)
#define WLAN_DISASSOC_FR_MAXLEN (WLAN_HDR_A3_LEN + 2)
#define WLAN_ASSOCREQ_FR_MAXLEN (WLAN_HDR_A3_LEN + 48)
#define WLAN_ASSOCRESP_FR_MAXLEN (WLAN_HDR_A3_LEN + 16)
@ -63,18 +76,18 @@
#define WLAN_PROBERESP_FR_MAXLEN (WLAN_HDR_A3_LEN + 78)
#define WLAN_AUTHEN_FR_MAXLEN (WLAN_HDR_A3_LEN + 261)
#define WLAN_DEATHEN_FR_MAXLEN (WLAN_HDR_A3_LEN + 2)
#define WLAN_WEP_NKEYS 4
#define WLAN_WEP_KEYLEN 5
#define WLAN_WEP_NKEYS 4
#define WLAN_WEP_KEYLEN 5
#define WLAN_CHALLENGE_IE_LEN 130
#define WLAN_CHALLENGE_LEN 128
#define WLAN_WEP_IV_LEN 4
#define WLAN_WEP_ICV_LEN 4
#define WLAN_CHALLENGE_LEN 128
#define WLAN_WEP_IV_LEN 4
#define WLAN_WEP_ICV_LEN 4
/*--- Frame Control Field -------------------------------------*/
/* Frame Types */
#define WLAN_FTYPE_MGMT 0x00
#define WLAN_FTYPE_CTL 0x01
#define WLAN_FTYPE_DATA 0x02
#define WLAN_FTYPE_MGMT 0x00
#define WLAN_FTYPE_CTL 0x01
#define WLAN_FTYPE_DATA 0x02
/* Frame subtypes */
/* Management */
@ -84,18 +97,18 @@
#define WLAN_FSTYPE_REASSOCRESP 0x03
#define WLAN_FSTYPE_PROBEREQ 0x04
#define WLAN_FSTYPE_PROBERESP 0x05
#define WLAN_FSTYPE_BEACON 0x08
#define WLAN_FSTYPE_ATIM 0x09
#define WLAN_FSTYPE_BEACON 0x08
#define WLAN_FSTYPE_ATIM 0x09
#define WLAN_FSTYPE_DISASSOC 0x0a
#define WLAN_FSTYPE_AUTHEN 0x0b
#define WLAN_FSTYPE_AUTHEN 0x0b
#define WLAN_FSTYPE_DEAUTHEN 0x0c
/* Control */
#define WLAN_FSTYPE_PSPOLL 0x0a
#define WLAN_FSTYPE_RTS 0x0b
#define WLAN_FSTYPE_CTS 0x0c
#define WLAN_FSTYPE_ACK 0x0d
#define WLAN_FSTYPE_CFEND 0x0e
#define WLAN_FSTYPE_PSPOLL 0x0a
#define WLAN_FSTYPE_RTS 0x0b
#define WLAN_FSTYPE_CTS 0x0c
#define WLAN_FSTYPE_ACK 0x0d
#define WLAN_FSTYPE_CFEND 0x0e
#define WLAN_FSTYPE_CFENDCFACK 0x0f
/* Data */
@ -103,11 +116,15 @@
#define WLAN_FSTYPE_DATA_CFACK 0x01
#define WLAN_FSTYPE_DATA_CFPOLL 0x02
#define WLAN_FSTYPE_DATA_CFACK_CFPOLL 0x03
#define WLAN_FSTYPE_NULL 0x04
#define WLAN_FSTYPE_CFACK 0x05
#define WLAN_FSTYPE_CFPOLL 0x06
#define WLAN_FSTYPE_NULL 0x04
#define WLAN_FSTYPE_CFACK 0x05
#define WLAN_FSTYPE_CFPOLL 0x06
#define WLAN_FSTYPE_CFACK_CFPOLL 0x07
/*================================================================*/
/* Macros */
/*--- FC Macros ----------------------------------------------*/
/* Macros to get/set the bitfields of the Frame Control Field */
/* GET_FC_??? - takes the host byte-order value of an FC */
@ -127,7 +144,7 @@
/* SET_FC_FSTYPE(WLAN_FSTYPE_RTS) ); */
/*------------------------------------------------------------*/
#define WLAN_GET_FC_PVER(n) (((UINT16)(n)) & (BIT0 | BIT1))
#define WLAN_GET_FC_PVER(n) (((UINT16)(n)) & (BIT0 | BIT1))
#define WLAN_GET_FC_FTYPE(n) ((((UINT16)(n)) & (BIT2 | BIT3)) >> 2)
#define WLAN_GET_FC_FSTYPE(n) ((((UINT16)(n)) & (BIT4|BIT5|BIT6|BIT7)) >> 4)
#define WLAN_GET_FC_TODS(n) ((((UINT16)(n)) & (BIT8)) >> 8)
@ -139,7 +156,7 @@
#define WLAN_GET_FC_ISWEP(n) ((((UINT16)(n)) & (BIT14)) >> 14)
#define WLAN_GET_FC_ORDER(n) ((((UINT16)(n)) & (BIT15)) >> 15)
#define WLAN_SET_FC_PVER(n) ((UINT16)(n))
#define WLAN_SET_FC_PVER(n) ((UINT16)(n))
#define WLAN_SET_FC_FTYPE(n) (((UINT16)(n)) << 2)
#define WLAN_SET_FC_FSTYPE(n) (((UINT16)(n)) << 4)
#define WLAN_SET_FC_TODS(n) (((UINT16)(n)) << 8)
@ -172,9 +189,8 @@
#define WLAN_HDR_A3_DATAP(p) (((UINT8*)(p)) + WLAN_HDR_A3_LEN)
#define WLAN_HDR_A4_DATAP(p) (((UINT8*)(p)) + WLAN_HDR_A4_LEN)
/*=============================================================*/
/*--- Types and Structures ------------------------------------*/
/*=============================================================*/
/*================================================================*/
/* Types */
/* BSS Timestamp */
typedef UINT8 wlan_bss_ts_t[WLAN_BSS_TS_LEN];
@ -183,24 +199,24 @@ typedef UINT8 wlan_bss_ts_t[WLAN_BSS_TS_LEN];
__WLAN_PRAGMA_PACK1__
typedef struct p80211_hdr_a3
{
UINT16 fc __WLAN_ATTRIB_PACK__;
UINT16 dur __WLAN_ATTRIB_PACK__;
UINT16 fc __WLAN_ATTRIB_PACK__;
UINT16 dur __WLAN_ATTRIB_PACK__;
UINT8 a1[WLAN_ADDR_LEN] __WLAN_ATTRIB_PACK__;
UINT8 a2[WLAN_ADDR_LEN] __WLAN_ATTRIB_PACK__;
UINT8 a3[WLAN_ADDR_LEN] __WLAN_ATTRIB_PACK__;
UINT16 seq __WLAN_ATTRIB_PACK__;
UINT16 seq __WLAN_ATTRIB_PACK__;
} p80211_hdr_a3_t;
__WLAN_PRAGMA_PACKDFLT__
__WLAN_PRAGMA_PACK1__
typedef struct p80211_hdr_a4
{
UINT16 fc __WLAN_ATTRIB_PACK__;
UINT16 dur __WLAN_ATTRIB_PACK__;
UINT16 fc __WLAN_ATTRIB_PACK__;
UINT16 dur __WLAN_ATTRIB_PACK__;
UINT8 a1[WLAN_ADDR_LEN] __WLAN_ATTRIB_PACK__;
UINT8 a2[WLAN_ADDR_LEN] __WLAN_ATTRIB_PACK__;
UINT8 a3[WLAN_ADDR_LEN] __WLAN_ATTRIB_PACK__;
UINT16 seq __WLAN_ATTRIB_PACK__;
UINT16 seq __WLAN_ATTRIB_PACK__;
UINT8 a4[WLAN_ADDR_LEN] __WLAN_ATTRIB_PACK__;
} p80211_hdr_a4_t;
__WLAN_PRAGMA_PACKDFLT__
@ -211,9 +227,13 @@ typedef union p80211_hdr
p80211_hdr_a4_t a4;
} p80211_hdr_t;
/*=============================================================*/
/*--- Functions -----------------------------------------------*/
/*=============================================================*/
/*================================================================*/
/* Extern Declarations */
/*================================================================*/
/* Function Declarations */
void p802addr_to_str( char *buf, UINT8 *addr);

View File

@ -1,61 +1,80 @@
/* p80211ioctl.h: Declares constants and types for the p80211 ioctls
* --------------------------------------------------------------------
* Linux WLAN
* --------------------------------------------------------------------
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
* Linux WLAN
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
* The contents of this file are subject to the Mozilla Public
* License Version 1.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* The initial developer of the original code is Mark S. Mathews
* <mark@absoval.com>. Portions created by Mark S. Mathews
* are Copyright (C) 1998 AbsoluteValue Software, Inc. All Rights Reserved.
*
* Description:
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* --------------------------------------------------------------------
* The initial developer of the original code is Mark S. Mathews
* <mark@absoval.com>. Portions created by Mark S. Mathews
* are Copyright (C) 1998 AbsoluteValue Software, Inc. All Rights Reserved.
*
* --------------------------------------------------------------------
*
* The initial author may be reached as mark@absoval.com, or
* C/O AbsoluteValue Software Inc., P.O. Box 941149,
* Maitland, FL, 32794-1149
*
* --------------------------------------------------------------------
*
* --------------------------------------------------------------------
*/
#ifndef _P80211IOCTL_H
#define _P80211IOCTL_H
/*====================================================================*/
/*----- Constants ----------------------------------------------------*/
/*================================================================*/
/* System Includes */
/*================================================================*/
/* Project Includes */
/*================================================================*/
/* Constants */
/*----------------------------------------------------------------*/
/* p80211 ioctl "request" codes. See argument 2 of ioctl(2). */
/*--------------------------------------------------------------------*/
/* p80211 ioctl "request" codes. See argument 2 of ioctl(2). */
/*--------------------------------------------------------------------*/
#define P80211_IFTEST (SIOCDEVPRIVATE + 0)
#define P80211_IFREQ (SIOCDEVPRIVATE + 1)
/*====================================================================*/
/*----- Macros -------------------------------------------------------*/
/*====================================================================*/
/*----- Types --------------------------------------------------------*/
/*================================================================*/
/* Macros */
/*================================================================*/
/* Types */
/*----------------------------------------------------------------*/
/* A ptr to the following structure type is passed as the third */
/* argument to the ioctl system call when issuing a request to */
/* the p80211 module. */
/*--------------------------------------------------------------------*/
/* A ptr to the following structure type is passed as the third */
/* argument to the ioctl system call when issuing a request to the */
/* p80211 module. */
/*--------------------------------------------------------------------*/
typedef struct p80211ioctl_req
{
char name[16] __WLAN_ATTRIB_PACK__;
void *data __WLAN_ATTRIB_PACK__;
UINT16 result __WLAN_ATTRIB_PACK__;
UINT16 len __WLAN_ATTRIB_PACK__;
UINT16 len __WLAN_ATTRIB_PACK__;
} p80211ioctl_req_t;
/*====================================================================*/
/*----- External Declarations ----------------------------------------*/
/*====================================================================*/
/*----- Function Prototypes ------------------------------------------*/
/*================================================================*/
/* Extern Declarations */
/*================================================================*/
/* Function Declarations */
#endif /* _P80211IOCTL_H */

View File

@ -1,78 +1,92 @@
/* p80211mgmt.h: Macros, types, and functions to handle 802.11 mgmt frames
* --------------------------------------------------------------------
* Linux WLAN
* --------------------------------------------------------------------
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
* Linux WLAN
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
* The contents of this file are subject to the Mozilla Public
* License Version 1.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* The initial developer of the original code is Mark S. Mathews
* <mark@absoval.com>. Portions created by Mark S. Mathews
* are Copyright (C) 1998 AbsoluteValue Software, Inc. All Rights Reserved.
*
* Description:
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* This file declares the constants and types used in the interface
* between a wlan driver and the user mode utilities.
* The initial developer of the original code is Mark S. Mathews
* <mark@absoval.com>. Portions created by Mark S. Mathews
* are Copyright (C) 1998 AbsoluteValue Software, Inc. All Rights Reserved.
*
* --------------------------------------------------------------------
*
* Note: Constant values are always in HOST byte order. To assign
* values to multi-byte fields they _must_ be converted to
* ieee byte order. To retrieve multi-byte values from incoming
* frames, they must be converted to host order.
* The initial author may be reached as mark@absoval.com, or
* C/O AbsoluteValue Software Inc., P.O. Box 941149,
* Maitland, FL, 32794-1149
*
* Note: The len member of the frame structure does NOT!!! include
* the MAC CRC. Therefore, the len field on rx'd frames should
* have 4 subtracted from it.
* --------------------------------------------------------------------
*
* All functions declared here are implemented in p80211.c
* This file declares the constants and types used in the interface
* between a wlan driver and the user mode utilities.
*
* The types, macros, and functions defined here are primarily
* used for encoding and decoding management frames. They are
* designed to follow these patterns of use:
* Notes:
* - Constant values are always in HOST byte order. To assign
* values to multi-byte fields they _must_ be converted to
* ieee byte order. To retrieve multi-byte values from incoming
* frames, they must be converted to host order.
*
* DECODE:
* 1) a frame of length len is received into buffer b
* 2) using the hdr structure and macros, we determine the type
* 3) an appropriate mgmt frame structure, mf, is allocated and zeroed
* 4) mf.hdr = b
* mf.buf = b
* mf.len = len
* 5) call mgmt_decode( mf )
* 6) the frame field pointers in mf are now set. Note that any
* multi-byte frame field values accessed using the frame field
* pointers are in ieee byte order and will have to be converted
* to host order.
* - The len member of the frame structure does NOT!!! include
* the MAC CRC. Therefore, the len field on rx'd frames should
* have 4 subtracted from it.
*
* ENCODE:
* 1) Library client allocates buffer space for maximum length
* frame of the desired type
* 2) Library client allocates a mgmt frame structure, called mf,
* of the desired type
* 3) Set the following:
* mf.type = <desired type>
* mf.buf = <allocated buffer address>
* 4) call mgmt_encode( mf )
* 5) all of the fixed field pointers and fixed length information element
* pointers in mf are now set to their respective locations in the
* allocated space (fortunately, all variable length information elements
* fall at the end of their respective frames).
* 5a) The length field is set to include the last of the fixed and fixed
* length fields. It may have to be updated for optional or variable
* length information elements.
* 6) Optional and variable length information elements are special cases
* and must be handled individually by the client code.
* --------------------------------------------------------------------
* All functions declared here are implemented in p80211.c
*
* The types, macros, and functions defined here are primarily
* used for encoding and decoding management frames. They are
* designed to follow these patterns of use:
*
* DECODE:
* 1) a frame of length len is received into buffer b
* 2) using the hdr structure and macros, we determine the type
* 3) an appropriate mgmt frame structure, mf, is allocated and zeroed
* 4) mf.hdr = b
* mf.buf = b
* mf.len = len
* 5) call mgmt_decode( mf )
* 6) the frame field pointers in mf are now set. Note that any
* multi-byte frame field values accessed using the frame field
* pointers are in ieee byte order and will have to be converted
* to host order.
*
* ENCODE:
* 1) Library client allocates buffer space for maximum length
* frame of the desired type
* 2) Library client allocates a mgmt frame structure, called mf,
* of the desired type
* 3) Set the following:
* mf.type = <desired type>
* mf.buf = <allocated buffer address>
* 4) call mgmt_encode( mf )
* 5) all of the fixed field pointers and fixed length information element
* pointers in mf are now set to their respective locations in the
* allocated space (fortunately, all variable length information elements
* fall at the end of their respective frames).
* 5a) The length field is set to include the last of the fixed and fixed
* length fields. It may have to be updated for optional or variable
* length information elements.
* 6) Optional and variable length information elements are special cases
* and must be handled individually by the client code.
* --------------------------------------------------------------------
*/
#ifndef _P80211MGMT_H
#define _P80211MGMT_H
/*================================================================*/
/* System Includes */
/*================================================================*/
/* Project Includes */
#ifndef _WLAN_COMPAT_H
#include <wlan_compat.h>
#endif
@ -82,121 +96,125 @@
#endif
/*=============================================================*/
/*--- Constants & Macros --------------------------------------*/
/*=============================================================*/
/*================================================================*/
/* Constants */
/*== Information Element IDs ====================*/
#define WLAN_EID_SSID 0
#define WLAN_EID_SUPP_RATES 1
#define WLAN_EID_FH_PARMS 2
#define WLAN_EID_DS_PARMS 3
#define WLAN_EID_CF_PARMS 4
#define WLAN_EID_TIM 5
#define WLAN_EID_IBSS_PARMS 6
/*-- Information Element IDs --------------------*/
#define WLAN_EID_SSID 0
#define WLAN_EID_SUPP_RATES 1
#define WLAN_EID_FH_PARMS 2
#define WLAN_EID_DS_PARMS 3
#define WLAN_EID_CF_PARMS 4
#define WLAN_EID_TIM 5
#define WLAN_EID_IBSS_PARMS 6
/*-- values 7-15 reserved --*/
#define WLAN_EID_CHALLENGE 16
#define WLAN_EID_CHALLENGE 16
/*-- values 17-31 reserved for challenge text extension --*/
/*-- values 32-255 reserved --*/
/*== Reason Codes ===============================*/
#define WLAN_MGMT_REASON_RSVD 0
#define WLAN_MGMT_REASON_UNSPEC 1
#define WLAN_MGMT_REASON_PRIOR_AUTH_INVALID 2
#define WLAN_MGMT_REASON_DEAUTH_LEAVING 3
#define WLAN_MGMT_REASON_DISASSOC_INACTIVE 4
#define WLAN_MGMT_REASON_DISASSOC_AP_BUSY 5
#define WLAN_MGMT_REASON_CLASS2_NONAUTH 6
#define WLAN_MGMT_REASON_CLASS3_NONASSOC 7
/*-- Reason Codes -------------------------------*/
#define WLAN_MGMT_REASON_RSVD 0
#define WLAN_MGMT_REASON_UNSPEC 1
#define WLAN_MGMT_REASON_PRIOR_AUTH_INVALID 2
#define WLAN_MGMT_REASON_DEAUTH_LEAVING 3
#define WLAN_MGMT_REASON_DISASSOC_INACTIVE 4
#define WLAN_MGMT_REASON_DISASSOC_AP_BUSY 5
#define WLAN_MGMT_REASON_CLASS2_NONAUTH 6
#define WLAN_MGMT_REASON_CLASS3_NONASSOC 7
#define WLAN_MGMT_REASON_DISASSOC_STA_HASLEFT 8
#define WLAN_MGMT_REASON_CANT_ASSOC_NONAUTH 9
#define WLAN_MGMT_REASON_CANT_ASSOC_NONAUTH 9
/*== Status Codes ===============================*/
#define WLAN_MGMT_STATUS_SUCCESS 0
#define WLAN_MGMT_STATUS_UNSPEC_FAILURE 1
#define WLAN_MGMT_STATUS_CAPS_UNSUPPORTED 10
#define WLAN_MGMT_STATUS_REASSOC_NO_ASSOC 11
/*-- Status Codes -------------------------------*/
#define WLAN_MGMT_STATUS_SUCCESS 0
#define WLAN_MGMT_STATUS_UNSPEC_FAILURE 1
#define WLAN_MGMT_STATUS_CAPS_UNSUPPORTED 10
#define WLAN_MGMT_STATUS_REASSOC_NO_ASSOC 11
#define WLAN_MGMT_STATUS_ASSOC_DENIED_UNSPEC 12
#define WLAN_MGMT_STATUS_UNSUPPORTED_AUTHALG 13
#define WLAN_MGMT_STATUS_RX_AUTH_NOSEQ 14
#define WLAN_MGMT_STATUS_CHALLENGE_FAIL 15
#define WLAN_MGMT_STATUS_AUTH_TIMEOUT 16
#define WLAN_MGMT_STATUS_ASSOC_DENIED_BUSY 17
#define WLAN_MGMT_STATUS_ASSOC_DENIED_RATES 18
#define WLAN_MGMT_STATUS_RX_AUTH_NOSEQ 14
#define WLAN_MGMT_STATUS_CHALLENGE_FAIL 15
#define WLAN_MGMT_STATUS_AUTH_TIMEOUT 16
#define WLAN_MGMT_STATUS_ASSOC_DENIED_BUSY 17
#define WLAN_MGMT_STATUS_ASSOC_DENIED_RATES 18
/*== Capability Field ===========================*/
#define WLAN_GET_MGMT_CAP_INFO_ESS(n) ((n) & BIT0)
#define WLAN_GET_MGMT_CAP_INFO_IBSS(n) (((n) & BIT1) >> 1)
#define WLAN_GET_MGMT_CAP_INFO_CFPOLLABLE(n) (((n) & BIT2) >> 2)
#define WLAN_GET_MGMT_CAP_INFO_CFPOLLREQ(n) (((n) & BIT3) >> 3)
#define WLAN_GET_MGMT_CAP_INFO_PRIVACY(n) (((n) & BIT4) >> 4)
#define WLAN_SET_MGMT_CAP_INFO_ESS(n) (n)
#define WLAN_SET_MGMT_CAP_INFO_IBSS(n) ((n) << 1)
#define WLAN_SET_MGMT_CAP_INFO_CFPOLLABLE(n) ((n) << 2)
#define WLAN_SET_MGMT_CAP_INFO_CFPOLLREQ(n) ((n) << 3)
#define WLAN_SET_MGMT_CAP_INFO_PRIVACY(n) ((n) << 4)
/*-- Auth Algorithm Field ---------------------------*/
#define WLAN_AUTH_ALG_OPENSYSTEM 0
#define WLAN_AUTH_ALG_SHAREDKEY 1
/*== Auth Algorithm Field ===========================*/
#define WLAN_AUTH_ALG_OPENSYSTEM 0
#define WLAN_AUTH_ALG_SHAREDKEY 1
/*== Management Frame Field Offsets =============*/
/*-- Management Frame Field Offsets -------------*/
/* Note: Not all fields are listed because of variable lengths, */
/* see the code in p80211.c to see how we search for fields */
/* Note: These offsets are from the start of the frame data */
#define WLAN_BEACON_OFF_TS 0
#define WLAN_BEACON_OFF_BCN_INT 8
#define WLAN_BEACON_OFF_CAPINFO 10
#define WLAN_BEACON_OFF_SSID 12
#define WLAN_BEACON_OFF_TS 0
#define WLAN_BEACON_OFF_BCN_INT 8
#define WLAN_BEACON_OFF_CAPINFO 10
#define WLAN_BEACON_OFF_SSID 12
#define WLAN_DISASSOC_OFF_REASON 0
#define WLAN_DISASSOC_OFF_REASON 0
#define WLAN_ASSOCREQ_OFF_CAP_INFO 0
#define WLAN_ASSOCREQ_OFF_CAP_INFO 0
#define WLAN_ASSOCREQ_OFF_LISTEN_INT 2
#define WLAN_ASSOCREQ_OFF_SSID 4
#define WLAN_ASSOCREQ_OFF_SSID 4
#define WLAN_ASSOCRESP_OFF_CAP_INFO 0
#define WLAN_ASSOCRESP_OFF_STATUS 2
#define WLAN_ASSOCRESP_OFF_AID 4
#define WLAN_ASSOCRESP_OFF_CAP_INFO 0
#define WLAN_ASSOCRESP_OFF_STATUS 2
#define WLAN_ASSOCRESP_OFF_AID 4
#define WLAN_ASSOCRESP_OFF_SUPP_RATES 6
#define WLAN_REASSOCREQ_OFF_CAP_INFO 0
#define WLAN_REASSOCREQ_OFF_LISTEN_INT 2
#define WLAN_REASSOCREQ_OFF_CURR_AP 4
#define WLAN_REASSOCREQ_OFF_SSID 10
#define WLAN_REASSOCREQ_OFF_CURR_AP 4
#define WLAN_REASSOCREQ_OFF_SSID 10
#define WLAN_REASSOCRESP_OFF_CAP_INFO 0
#define WLAN_REASSOCRESP_OFF_STATUS 2
#define WLAN_REASSOCRESP_OFF_AID 4
#define WLAN_REASSOCRESP_OFF_STATUS 2
#define WLAN_REASSOCRESP_OFF_AID 4
#define WLAN_REASSOCRESP_OFF_SUPP_RATES 6
#define WLAN_PROBEREQ_OFF_SSID 0
#define WLAN_PROBEREQ_OFF_SSID 0
#define WLAN_PROBERESP_OFF_TS 0
#define WLAN_PROBERESP_OFF_BCN_INT 8
#define WLAN_PROBERESP_OFF_CAP_INFO 10
#define WLAN_PROBERESP_OFF_SSID 12
#define WLAN_PROBERESP_OFF_TS 0
#define WLAN_PROBERESP_OFF_BCN_INT 8
#define WLAN_PROBERESP_OFF_CAP_INFO 10
#define WLAN_PROBERESP_OFF_SSID 12
#define WLAN_AUTHEN_OFF_AUTH_ALG 0
#define WLAN_AUTHEN_OFF_AUTH_SEQ 2
#define WLAN_AUTHEN_OFF_STATUS 4
#define WLAN_AUTHEN_OFF_CHALLENGE 6
#define WLAN_AUTHEN_OFF_AUTH_ALG 0
#define WLAN_AUTHEN_OFF_AUTH_SEQ 2
#define WLAN_AUTHEN_OFF_STATUS 4
#define WLAN_AUTHEN_OFF_CHALLENGE 6
#define WLAN_DEAUTHEN_OFF_REASON 0
#define WLAN_DEAUTHEN_OFF_REASON 0
/*=============================================================*/
/*--- Types and Structures ------------------------------------*/
/*=============================================================*/
/*== Information Element Types ====================*/
/*================================================================*/
/* Macros */
/*-- Capability Field ---------------------------*/
#define WLAN_GET_MGMT_CAP_INFO_ESS(n) ((n) & BIT0)
#define WLAN_GET_MGMT_CAP_INFO_IBSS(n) (((n) & BIT1) >> 1)
#define WLAN_GET_MGMT_CAP_INFO_CFPOLLABLE(n) (((n) & BIT2) >> 2)
#define WLAN_GET_MGMT_CAP_INFO_CFPOLLREQ(n) (((n) & BIT3) >> 3)
#define WLAN_GET_MGMT_CAP_INFO_PRIVACY(n) (((n) & BIT4) >> 4)
#define WLAN_SET_MGMT_CAP_INFO_ESS(n) (n)
#define WLAN_SET_MGMT_CAP_INFO_IBSS(n) ((n) << 1)
#define WLAN_SET_MGMT_CAP_INFO_CFPOLLABLE(n) ((n) << 2)
#define WLAN_SET_MGMT_CAP_INFO_CFPOLLREQ(n) ((n) << 3)
#define WLAN_SET_MGMT_CAP_INFO_PRIVACY(n) ((n) << 4)
/*================================================================*/
/* Types */
/*-- Information Element Types --------------------*/
/* prototype structure, all IEs start with these members */
__WLAN_PRAGMA_PACK1__
typedef struct wlan_ie
{
UINT8 eid __WLAN_ATTRIB_PACK__;
UINT8 len __WLAN_ATTRIB_PACK__;
UINT8 eid __WLAN_ATTRIB_PACK__;
UINT8 len __WLAN_ATTRIB_PACK__;
} wlan_ie_t;
__WLAN_PRAGMA_PACKDFLT__
@ -204,8 +222,8 @@ __WLAN_PRAGMA_PACKDFLT__
__WLAN_PRAGMA_PACK1__
typedef struct wlan_ie_ssid
{
UINT8 eid __WLAN_ATTRIB_PACK__;
UINT8 len __WLAN_ATTRIB_PACK__;
UINT8 eid __WLAN_ATTRIB_PACK__;
UINT8 len __WLAN_ATTRIB_PACK__;
UINT8 ssid[1] __WLAN_ATTRIB_PACK__; /* may be zero, ptrs may overlap */
} wlan_ie_ssid_t;
__WLAN_PRAGMA_PACKDFLT__
@ -214,8 +232,8 @@ __WLAN_PRAGMA_PACKDFLT__
__WLAN_PRAGMA_PACK1__
typedef struct wlan_ie_supp_rates
{
UINT8 eid __WLAN_ATTRIB_PACK__;
UINT8 len __WLAN_ATTRIB_PACK__;
UINT8 eid __WLAN_ATTRIB_PACK__;
UINT8 len __WLAN_ATTRIB_PACK__;
UINT8 rates[1] __WLAN_ATTRIB_PACK__; /* had better be at LEAST one! */
} wlan_ie_supp_rates_t;
__WLAN_PRAGMA_PACKDFLT__
@ -224,8 +242,8 @@ __WLAN_PRAGMA_PACKDFLT__
__WLAN_PRAGMA_PACK1__
typedef struct wlan_ie_fh_parms
{
UINT8 eid __WLAN_ATTRIB_PACK__;
UINT8 len __WLAN_ATTRIB_PACK__;
UINT8 eid __WLAN_ATTRIB_PACK__;
UINT8 len __WLAN_ATTRIB_PACK__;
UINT16 dwell __WLAN_ATTRIB_PACK__;
UINT8 hopset __WLAN_ATTRIB_PACK__;
UINT8 hoppattern __WLAN_ATTRIB_PACK__;
@ -237,8 +255,8 @@ __WLAN_PRAGMA_PACKDFLT__
__WLAN_PRAGMA_PACK1__
typedef struct wlan_ie_ds_parms
{
UINT8 eid __WLAN_ATTRIB_PACK__;
UINT8 len __WLAN_ATTRIB_PACK__;
UINT8 eid __WLAN_ATTRIB_PACK__;
UINT8 len __WLAN_ATTRIB_PACK__;
UINT8 curr_ch __WLAN_ATTRIB_PACK__;
} wlan_ie_ds_parms_t;
__WLAN_PRAGMA_PACKDFLT__
@ -247,8 +265,8 @@ __WLAN_PRAGMA_PACKDFLT__
__WLAN_PRAGMA_PACK1__
typedef struct wlan_ie_cf_parms
{
UINT8 eid __WLAN_ATTRIB_PACK__;
UINT8 len __WLAN_ATTRIB_PACK__;
UINT8 eid __WLAN_ATTRIB_PACK__;
UINT8 len __WLAN_ATTRIB_PACK__;
UINT8 cfp_cnt __WLAN_ATTRIB_PACK__;
UINT8 cfp_period __WLAN_ATTRIB_PACK__;
UINT16 cfp_maxdur __WLAN_ATTRIB_PACK__;
@ -260,8 +278,8 @@ __WLAN_PRAGMA_PACKDFLT__
__WLAN_PRAGMA_PACK1__
typedef struct wlan_ie_tim
{
UINT8 eid __WLAN_ATTRIB_PACK__;
UINT8 len __WLAN_ATTRIB_PACK__;
UINT8 eid __WLAN_ATTRIB_PACK__;
UINT8 len __WLAN_ATTRIB_PACK__;
UINT8 dtim_cnt __WLAN_ATTRIB_PACK__;
UINT8 dtim_period __WLAN_ATTRIB_PACK__;
UINT8 bitmap_ctl __WLAN_ATTRIB_PACK__;
@ -273,8 +291,8 @@ __WLAN_PRAGMA_PACKDFLT__
__WLAN_PRAGMA_PACK1__
typedef struct wlan_ie_ibss_parms
{
UINT8 eid __WLAN_ATTRIB_PACK__;
UINT8 len __WLAN_ATTRIB_PACK__;
UINT8 eid __WLAN_ATTRIB_PACK__;
UINT8 len __WLAN_ATTRIB_PACK__;
UINT16 atim_win __WLAN_ATTRIB_PACK__;
} wlan_ie_ibss_parms_t;
__WLAN_PRAGMA_PACKDFLT__
@ -283,23 +301,25 @@ __WLAN_PRAGMA_PACKDFLT__
__WLAN_PRAGMA_PACK1__
typedef struct wlan_ie_challenge
{
UINT8 eid __WLAN_ATTRIB_PACK__;
UINT8 len __WLAN_ATTRIB_PACK__;
UINT8 eid __WLAN_ATTRIB_PACK__;
UINT8 len __WLAN_ATTRIB_PACK__;
UINT8 challenge[1] __WLAN_ATTRIB_PACK__;
} wlan_ie_challenge_t;
__WLAN_PRAGMA_PACKDFLT__
/*=================================================*/
/*== Frame Types ==================================*/
/*-------------------------------------------------*/
/* Frame Types */
/* prototype structure, all mgmt frame types will start with these members */
typedef struct wlan_fr_mgmt
{
UINT16 type;
UINT16 len; /* DOES NOT include CRC !!!!*/
UINT8 *buf;
p80211_hdr_t *hdr;
void *priv; /* used for target specific data, skb in Linux */
UINT16 type;
UINT16 len; /* DOES NOT include CRC !!!!*/
UINT8 *buf;
p80211_hdr_t *hdr;
/* used for target specific data, skb in Linux */
void *priv;
/*-- fixed fields -----------*/
/*-- info elements ----------*/
} wlan_fr_mgmt_t;
@ -307,23 +327,24 @@ typedef struct wlan_fr_mgmt
/*-- Beacon ---------------------------------------*/
typedef struct wlan_fr_beacon
{
UINT16 type;
UINT16 len;
UINT8 *buf;
p80211_hdr_t *hdr;
void *priv; /* used for target specific data, skb in Linux */
UINT16 type;
UINT16 len;
UINT8 *buf;
p80211_hdr_t *hdr;
/* used for target specific data, skb in Linux */
void *priv;
/*-- fixed fields -----------*/
UINT64 *ts;
UINT16 *bcn_int;
UINT16 *cap_info;
UINT64 *ts;
UINT16 *bcn_int;
UINT16 *cap_info;
/*-- info elements ----------*/
wlan_ie_ssid_t *ssid;
wlan_ie_ssid_t *ssid;
wlan_ie_supp_rates_t *supp_rates;
wlan_ie_fh_parms_t *fh_parms;
wlan_ie_ds_parms_t *ds_parms;
wlan_ie_cf_parms_t *cf_parms;
wlan_ie_fh_parms_t *fh_parms;
wlan_ie_ds_parms_t *ds_parms;
wlan_ie_cf_parms_t *cf_parms;
wlan_ie_ibss_parms_t *ibss_parms;
wlan_ie_tim_t *tim;
wlan_ie_tim_t *tim;
} wlan_fr_beacon_t;
@ -331,11 +352,12 @@ typedef struct wlan_fr_beacon
/*-- IBSS ATIM ------------------------------------*/
typedef struct wlan_fr_ibssatim
{
UINT16 type;
UINT16 len;
UINT8* buf;
p80211_hdr_t *hdr;
void *priv; /* used for target specific data, skb in Linux */
UINT16 type;
UINT16 len;
UINT8* buf;
p80211_hdr_t *hdr;
/* used for target specific data, skb in Linux */
void *priv;
/*-- fixed fields -----------*/
/*-- info elements ----------*/
@ -347,13 +369,14 @@ typedef struct wlan_fr_ibssatim
/*-- Disassociation -------------------------------*/
typedef struct wlan_fr_disassoc
{
UINT16 type;
UINT16 len;
UINT8 *buf;
p80211_hdr_t *hdr;
void *priv; /* used for target specific data, skb in Linux */
UINT16 type;
UINT16 len;
UINT8 *buf;
p80211_hdr_t *hdr;
/* used for target specific data, skb in Linux */
void *priv;
/*-- fixed fields -----------*/
UINT16 *reason;
UINT16 *reason;
/*-- info elements ----------*/
@ -362,16 +385,17 @@ typedef struct wlan_fr_disassoc
/*-- Association Request --------------------------*/
typedef struct wlan_fr_assocreq
{
UINT16 type;
UINT16 len;
UINT8* buf;
p80211_hdr_t *hdr;
void *priv; /* used for target specific data, skb in Linux */
UINT16 type;
UINT16 len;
UINT8* buf;
p80211_hdr_t *hdr;
/* used for target specific data, skb in Linux */
void *priv;
/*-- fixed fields -----------*/
UINT16 *cap_info;
UINT16 *listen_int;
UINT16 *cap_info;
UINT16 *listen_int;
/*-- info elements ----------*/
wlan_ie_ssid_t *ssid;
wlan_ie_ssid_t *ssid;
wlan_ie_supp_rates_t *supp_rates;
} wlan_fr_assocreq_t;
@ -379,15 +403,16 @@ typedef struct wlan_fr_assocreq
/*-- Association Response -------------------------*/
typedef struct wlan_fr_assocresp
{
UINT16 type;
UINT16 len;
UINT8 *buf;
p80211_hdr_t *hdr;
void *priv; /* used for target specific data, skb in Linux */
UINT16 type;
UINT16 len;
UINT8 *buf;
p80211_hdr_t *hdr;
/* used for target specific data, skb in Linux */
void *priv;
/*-- fixed fields -----------*/
UINT16 *cap_info;
UINT16 *status;
UINT16 *aid;
UINT16 *cap_info;
UINT16 *status;
UINT16 *aid;
/*-- info elements ----------*/
wlan_ie_supp_rates_t *supp_rates;
@ -396,17 +421,18 @@ typedef struct wlan_fr_assocresp
/*-- Reassociation Request ------------------------*/
typedef struct wlan_fr_reassocreq
{
UINT16 type;
UINT16 len;
UINT8 *buf;
p80211_hdr_t *hdr;
void *priv; /* used for target specific data, skb in Linux */
UINT16 type;
UINT16 len;
UINT8 *buf;
p80211_hdr_t *hdr;
/* used for target specific data, skb in Linux */
void *priv;
/*-- fixed fields -----------*/
UINT16 *cap_info;
UINT16 *listen_int;
UINT8 *curr_ap;
UINT16 *cap_info;
UINT16 *listen_int;
UINT8 *curr_ap;
/*-- info elements ----------*/
wlan_ie_ssid_t *ssid;
wlan_ie_ssid_t *ssid;
wlan_ie_supp_rates_t *supp_rates;
} wlan_fr_reassocreq_t;
@ -414,15 +440,16 @@ typedef struct wlan_fr_reassocreq
/*-- Reassociation Response -----------------------*/
typedef struct wlan_fr_reassocresp
{
UINT16 type;
UINT16 len;
UINT8 *buf;
p80211_hdr_t *hdr;
void *priv; /* used for target specific data, skb in Linux */
UINT16 type;
UINT16 len;
UINT8 *buf;
p80211_hdr_t *hdr;
/* used for target specific data, skb in Linux */
void *priv;
/*-- fixed fields -----------*/
UINT16 *cap_info;
UINT16 *status;
UINT16 *aid;
UINT16 *cap_info;
UINT16 *status;
UINT16 *aid;
/*-- info elements ----------*/
wlan_ie_supp_rates_t *supp_rates;
@ -431,14 +458,15 @@ typedef struct wlan_fr_reassocresp
/*-- Probe Request --------------------------------*/
typedef struct wlan_fr_probereq
{
UINT16 type;
UINT16 len;
UINT8 *buf;
p80211_hdr_t *hdr;
void *priv; /* used for target specific data, skb in Linux */
UINT16 type;
UINT16 len;
UINT8 *buf;
p80211_hdr_t *hdr;
/* used for target specific data, skb in Linux */
void *priv;
/*-- fixed fields -----------*/
/*-- info elements ----------*/
wlan_ie_ssid_t *ssid;
wlan_ie_ssid_t *ssid;
wlan_ie_supp_rates_t *supp_rates;
} wlan_fr_probereq_t;
@ -446,57 +474,67 @@ typedef struct wlan_fr_probereq
/*-- Probe Response -------------------------------*/
typedef struct wlan_fr_proberesp
{
UINT16 type;
UINT16 len;
UINT8 *buf;
p80211_hdr_t *hdr;
void *priv; /* used for target specific data, skb in Linux */
UINT16 type;
UINT16 len;
UINT8 *buf;
p80211_hdr_t *hdr;
/* used for target specific data, skb in Linux */
void *priv;
/*-- fixed fields -----------*/
UINT64 *ts;
UINT16 *bcn_int;
UINT16 *cap_info;
UINT64 *ts;
UINT16 *bcn_int;
UINT16 *cap_info;
/*-- info elements ----------*/
wlan_ie_ssid_t *ssid;
wlan_ie_ssid_t *ssid;
wlan_ie_supp_rates_t *supp_rates;
wlan_ie_fh_parms_t *fh_parms;
wlan_ie_ds_parms_t *ds_parms;
wlan_ie_cf_parms_t *cf_parms;
wlan_ie_fh_parms_t *fh_parms;
wlan_ie_ds_parms_t *ds_parms;
wlan_ie_cf_parms_t *cf_parms;
wlan_ie_ibss_parms_t *ibss_parms;
} wlan_fr_proberesp_t;
/*-- Authentication -------------------------------*/
typedef struct wlan_fr_authen
{
UINT16 type;
UINT16 len;
UINT8 *buf;
p80211_hdr_t *hdr;
void *priv; /* used for target specific data, skb in Linux */
UINT16 type;
UINT16 len;
UINT8 *buf;
p80211_hdr_t *hdr;
/* used for target specific data, skb in Linux */
void *priv;
/*-- fixed fields -----------*/
UINT16 *auth_alg;
UINT16 *auth_seq;
UINT16 *status;
UINT16 *auth_alg;
UINT16 *auth_seq;
UINT16 *status;
/*-- info elements ----------*/
wlan_ie_challenge_t *challenge;
wlan_ie_challenge_t *challenge;
} wlan_fr_authen_t;
/*-- Deauthenication -----------------------------*/
typedef struct wlan_fr_deauthen
{
UINT16 type;
UINT16 len;
UINT8 *buf;
p80211_hdr_t *hdr;
void *priv; /* used for target specific data, skb in Linux */
UINT16 type;
UINT16 len;
UINT8 *buf;
p80211_hdr_t *hdr;
/* used for target specific data, skb in Linux */
void *priv;
/*-- fixed fields -----------*/
UINT16 *reason;
UINT16 *reason;
/*-- info elements ----------*/
} wlan_fr_deauthen_t;
/*================================================================*/
/* Extern Declarations */
/*================================================================*/
/* Function Declarations */
void wlan_mgmt_encode_beacon( wlan_fr_beacon_t *f );
void wlan_mgmt_decode_beacon( wlan_fr_beacon_t *f );
void wlan_mgmt_encode_disassoc( wlan_fr_disassoc_t *f );

View File

@ -1,37 +1,95 @@
/* p80211msg.h: Macros, constants, types, and funcs for req and ind messages
* --------------------------------------------------------------------
* Linux WLAN
* --------------------------------------------------------------------
* Linux WLAN
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
* The contents of this file are subject to the Mozilla Public
* License Version 1.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The initial developer of the original code is Mark S. Mathews
* <mark@absoval.com>. Portions created by Mark S. Mathews
* are Copyright (C) 1998 AbsoluteValue Software, Inc. All Rights Reserved.
*
* Description:
* The initial developers of the original code are Jo-Ellen F. Mathews
* <joellen@absoval.com> and Mark S. Mathews <mark@absoval.com>.
* Portions created by Jo-Ellen F. and Mark S. Mathews
* are Copyright (C) 1998 AbsoluteValue Software, Inc. All Rights Reserved.
*
* --------------------------------------------------------------------
*
* Note: Constant values are always in HOST byte order.
* The initial authors may be reached at info@absoval.com, or
* C/O AbsoluteValue Software Inc., P.O. Box 941149,
* Maitland, FL, 32794-1149
*
* All functions and statics declared here are implemented in p80211msg.c
* --------------------------------------------------------------------
* --------------------------------------------------------------------
*
* --------------------------------------------------------------------
*/
#ifndef _P80211MSG_H
#define _P80211MSG_H
/*================================================================*/
/* System Includes */
/*================================================================*/
/* Project Includes */
#ifndef _WLAN_COMPAT_H
#include <wlan/wlan_compat.h>
#endif
/*====================================================================*/
/*----- Macros -------------------------------------------------------*/
/*================================================================*/
/* Constants */
#define MAX_BSSDESC 10
/*--------------------------------------------------------------------*/
/* Request messages */
#define P80211MSG_REQ_MIB_GET 1 /* 802.11 */
#define P80211MSG_REQ_MIB_SET 2 /* 802.11 */
#define P80211MSG_REQ_POWERMGMT 3 /* 802.11 */
#define P80211MSG_REQ_SCAN 4 /* 802.11 */
#define P80211MSG_REQ_JOIN 5 /* 802.11 */
#define P80211MSG_REQ_AUTHENTICATE 6 /* 802.11 */
#define P80211MSG_REQ_DEAUTHENTICATE 7 /* 802.11 */
#define P80211MSG_REQ_ASSOCIATE 8 /* 802.11 */
#define P80211MSG_REQ_REASSOCIATE 9 /* 802.11 */
#define P80211MSG_REQ_DISASSOCIATE 10 /* 802.11 */
#define P80211MSG_REQ_RESET 11 /* 802.11 */
#define P80211MSG_REQ_START 12 /* 802.11 */
/* 13-20 reserved */
/*--------------------------------------------------------------------*/
/* Indication messages */
#define P80211MSG_IND_AUTHENTICATE 21 /* 802.11 */
#define P80211MSG_IND_DEAUTHENTICATE 22 /* 802.11 */
#define P80211MSG_IND_ASSOCIATE 23 /* 802.11 */
#define P80211MSG_IND_REASSOCIATE 24 /* 802.11 */
#define P80211MSG_IND_DISASSOCIATE 25 /* 802.11 */
/* 26-40 reserved */
/*--------------------------------------------------------------------*/
/* Confirm messages */
/* For now, these are embedded in the REQ messages. Just in case, */
/* 41-60 reserved */
/*--------------------------------------------------------------------*/
/* Metadata flags */
#define ISREQUIRED (0x80000000UL)
#define ISREQUEST (0x40000000UL)
#define ISCONFIRM (0x20000000UL)
/*================================================================*/
/* Macros */
/*--------------------------------------------------------------------*/
/* The following macros are used to manipulate the 'flags' field in */
@ -41,64 +99,22 @@
/* command or both. */
/*--------------------------------------------------------------------*/
#define ISREQUIRED (0x80000000UL)
#define ISREQUEST (0x40000000UL)
#define ISCONFIRM (0x20000000UL)
#define P80211ITEM_SETFLAGS(q, r, c) ( q | r | c )
#define P80211ITEM_ISREQUIRED(flags) (((UINT32)(flags & ISREQUIRED)) \
>> 31 )
#define P80211ITEM_ISREQUEST(flags) (((UINT32)(flags & ISREQUEST)) \
>> 30 )
#define P80211ITEM_ISCONFIRM(flags) (((UINT32)(flags & ISCONFIRM)) \
>> 29 )
#define P80211ITEM_ISREQUIRED(flags) (((UINT32)(flags & ISREQUIRED)) >> 31 )
#define P80211ITEM_ISREQUEST(flags) (((UINT32)(flags & ISREQUEST)) >> 30 )
#define P80211ITEM_ISCONFIRM(flags) (((UINT32)(flags & ISCONFIRM)) >> 29 )
/*====================================================================*/
/*----- Constants ----------------------------------------------------*/
/*================================================================*/
/* Types */
/*--------------------------------------------------------------------*/
/* Request messages */
/*--------------------------------------------------------------------*/
#define P80211MSG_REQ_MIB_GET 1 /* 802.11 */
#define P80211MSG_REQ_MIB_SET 2 /* 802.11 */
#define P80211MSG_REQ_POWERMGMT 3 /* 802.11 */
#define P80211MSG_REQ_SCAN 4 /* 802.11 */
#define P80211MSG_REQ_JOIN 5 /* 802.11 */
#define P80211MSG_REQ_AUTHENTICATE 6 /* 802.11 */
#define P80211MSG_REQ_DEAUTHENTICATE 7 /* 802.11 */
#define P80211MSG_REQ_ASSOCIATE 8 /* 802.11 */
#define P80211MSG_REQ_REASSOCIATE 9 /* 802.11 */
#define P80211MSG_REQ_DISASSOCIATE 10 /* 802.11 */
#define P80211MSG_REQ_RESET 11 /* 802.11 */
#define P80211MSG_REQ_START 12 /* 802.11 */
/* 13-20 reserved */
/*--------------------------------------------------------------------*/
/* Indication messages */
/*--------------------------------------------------------------------*/
#define P80211MSG_IND_AUTHENTICATE 21 /* 802.11 */
#define P80211MSG_IND_DEAUTHENTICATE 22 /* 802.11 */
#define P80211MSG_IND_ASSOCIATE 23 /* 802.11 */
#define P80211MSG_IND_REASSOCIATE 24 /* 802.11 */
#define P80211MSG_IND_DISASSOCIATE 25 /* 802.11 */
/* 26-40 reserved */
/*--------------------------------------------------------------------*/
/* Confirm messages */
/*--------------------------------------------------------------------*/
/* For now, these are embedded in the REQ messages. Just in case, 41-60 reserved */
/*====================================================================*/
/*----- Types --------------------------------------------------------*/
/*====================================================================*/
/*----- Message Structure Types --------------------------------------*/
/*--------------------------------------------------------------------*/
/* Prototype msg type
/*--------------------------------------------------------------------*/
/* Prototype msg type */
__WLAN_PRAGMA_PACK1__
typedef struct p80211msg
{
@ -121,12 +137,12 @@ __WLAN_PRAGMA_PACKDFLT__
__WLAN_PRAGMA_PACK1__
typedef struct p80211msg_req_mib_get
{
UINT32 msgcode __WLAN_ATTRIB_PACK__;
p80211item_uint32_t mibid __WLAN_ATTRIB_PACK__;
p80211item_uint32_t resultcode __WLAN_ATTRIB_PACK__;
p80211item_coll_t mibvalue __WLAN_ATTRIB_PACK__;
p80211item_uint32_t uint32val __WLAN_ATTRIB_PACK__;
p80211item_pstr255_t pstrval __WLAN_ATTRIB_PACK__;
UINT32 msgcode __WLAN_ATTRIB_PACK__;
p80211item_uint32_t mibid __WLAN_ATTRIB_PACK__;
p80211item_uint32_t resultcode __WLAN_ATTRIB_PACK__;
p80211item_coll_t mibvalue __WLAN_ATTRIB_PACK__;
p80211item_uint32_t uint32val __WLAN_ATTRIB_PACK__;
p80211item_pstr255_t pstrval __WLAN_ATTRIB_PACK__;
} p80211msg_req_mib_get_t;
__WLAN_PRAGMA_PACKDFLT__
@ -134,12 +150,12 @@ __WLAN_PRAGMA_PACKDFLT__
__WLAN_PRAGMA_PACK1__
typedef struct p80211msg_req_mib_set
{
UINT32 msgcode __WLAN_ATTRIB_PACK__;
p80211item_uint32_t mibid __WLAN_ATTRIB_PACK__;
p80211item_uint32_t resultcode __WLAN_ATTRIB_PACK__;
p80211item_coll_t mibvalue __WLAN_ATTRIB_PACK__;
p80211item_uint32_t uint32val __WLAN_ATTRIB_PACK__;
p80211item_pstr255_t pstrval __WLAN_ATTRIB_PACK__;
UINT32 msgcode __WLAN_ATTRIB_PACK__;
p80211item_uint32_t mibid __WLAN_ATTRIB_PACK__;
p80211item_uint32_t resultcode __WLAN_ATTRIB_PACK__;
p80211item_coll_t mibvalue __WLAN_ATTRIB_PACK__;
p80211item_uint32_t uint32val __WLAN_ATTRIB_PACK__;
p80211item_pstr255_t pstrval __WLAN_ATTRIB_PACK__;
} p80211msg_req_mib_set_t;
__WLAN_PRAGMA_PACKDFLT__
@ -147,29 +163,27 @@ __WLAN_PRAGMA_PACKDFLT__
__WLAN_PRAGMA_PACK1__
typedef struct p80211msg_req_powermgmt
{
UINT32 msgcode __WLAN_ATTRIB_PACK__;
p80211item_uint32_t mode __WLAN_ATTRIB_PACK__;
p80211item_uint32_t wakeup __WLAN_ATTRIB_PACK__;
p80211item_uint32_t rxdtims __WLAN_ATTRIB_PACK__;
p80211item_uint32_t resultcode __WLAN_ATTRIB_PACK__;
UINT32 msgcode __WLAN_ATTRIB_PACK__;
p80211item_uint32_t mode __WLAN_ATTRIB_PACK__;
p80211item_uint32_t wakeup __WLAN_ATTRIB_PACK__;
p80211item_uint32_t rxdtims __WLAN_ATTRIB_PACK__;
p80211item_uint32_t resultcode __WLAN_ATTRIB_PACK__;
} p80211msg_req_powermgmt_t;
__WLAN_PRAGMA_PACKDFLT__
#define MAX_BSSDESC 10
__WLAN_PRAGMA_PACK1__
typedef struct p80211msg_req_scan
{
UINT32 msgcode __WLAN_ATTRIB_PACK__;
p80211item_uint32_t bsstype __WLAN_ATTRIB_PACK__;
p80211item_pstr6_t bssid __WLAN_ATTRIB_PACK__;
p80211item_pstr32_t ssid __WLAN_ATTRIB_PACK__;
p80211item_uint32_t scantype __WLAN_ATTRIB_PACK__;
p80211item_uint32_t probedelay __WLAN_ATTRIB_PACK__;
p80211item_pstr14_t channellist __WLAN_ATTRIB_PACK__;
p80211item_uint32_t minchanneltime __WLAN_ATTRIB_PACK__;
p80211item_uint32_t maxchanneltime __WLAN_ATTRIB_PACK__;
p80211item_uint32_t resultcode __WLAN_ATTRIB_PACK__;
UINT32 msgcode __WLAN_ATTRIB_PACK__;
p80211item_uint32_t bsstype __WLAN_ATTRIB_PACK__;
p80211item_pstr6_t bssid __WLAN_ATTRIB_PACK__;
p80211item_pstr32_t ssid __WLAN_ATTRIB_PACK__;
p80211item_uint32_t scantype __WLAN_ATTRIB_PACK__;
p80211item_uint32_t probedelay __WLAN_ATTRIB_PACK__;
p80211item_pstr14_t channellist __WLAN_ATTRIB_PACK__;
p80211item_uint32_t minchanneltime __WLAN_ATTRIB_PACK__;
p80211item_uint32_t maxchanneltime __WLAN_ATTRIB_PACK__;
p80211item_uint32_t resultcode __WLAN_ATTRIB_PACK__;
p80211item_bssdesc_t bssdesc[MAX_BSSDESC] __WLAN_ATTRIB_PACK__;
} p80211msg_req_scan_t;