Pre-trip, making sure everything is in

This commit is contained in:
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;
__WLAN_PRAGMA_PACKDFLT__
@ -177,133 +191,133 @@ __WLAN_PRAGMA_PACKDFLT__
__WLAN_PRAGMA_PACK1__
typedef struct p80211msg_req_join
{
UINT32 msgcode __WLAN_ATTRIB_PACK__;
p80211item_pstr6_t bssid __WLAN_ATTRIB_PACK__;
p80211item_uint32_t joinfailtimeout __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate1 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate2 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate3 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate4 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate5 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate6 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate7 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate8 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t operationalrate1 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t operationalrate2 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t operationalrate3 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t operationalrate4 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t operationalrate5 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t operationalrate6 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t operationalrate7 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t operationalrate8 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t resultcode __WLAN_ATTRIB_PACK__;
UINT32 msgcode __WLAN_ATTRIB_PACK__;
p80211item_pstr6_t bssid __WLAN_ATTRIB_PACK__;
p80211item_uint32_t joinfailtimeout __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate1 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate2 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate3 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate4 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate5 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate6 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate7 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate8 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t operationalrate1 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t operationalrate2 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t operationalrate3 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t operationalrate4 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t operationalrate5 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t operationalrate6 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t operationalrate7 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t operationalrate8 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t resultcode __WLAN_ATTRIB_PACK__;
} p80211msg_req_join_t;
__WLAN_PRAGMA_PACKDFLT__
__WLAN_PRAGMA_PACK1__
typedef struct p80211msg_req_authenticate
{
UINT32 msgcode __WLAN_ATTRIB_PACK__;
p80211item_pstr6_t peerstaaddr __WLAN_ATTRIB_PACK__;
p80211item_uint32_t authtype __WLAN_ATTRIB_PACK__;
p80211item_uint32_t authfailtimeout __WLAN_ATTRIB_PACK__;
p80211item_uint32_t resultcode __WLAN_ATTRIB_PACK__;
UINT32 msgcode __WLAN_ATTRIB_PACK__;
p80211item_pstr6_t peerstaaddr __WLAN_ATTRIB_PACK__;
p80211item_uint32_t authtype __WLAN_ATTRIB_PACK__;
p80211item_uint32_t authfailtimeout __WLAN_ATTRIB_PACK__;
p80211item_uint32_t resultcode __WLAN_ATTRIB_PACK__;
} p80211msg_req_authenticate_t;
__WLAN_PRAGMA_PACKDFLT__
__WLAN_PRAGMA_PACK1__
typedef struct p80211msg_req_deauthenticate
{
UINT32 msgcode __WLAN_ATTRIB_PACK__;
p80211item_pstr6_t peerstaaddr __WLAN_ATTRIB_PACK__;
p80211item_uint32_t reasoncode __WLAN_ATTRIB_PACK__;
p80211item_uint32_t resultcode __WLAN_ATTRIB_PACK__;
UINT32 msgcode __WLAN_ATTRIB_PACK__;
p80211item_pstr6_t peerstaaddr __WLAN_ATTRIB_PACK__;
p80211item_uint32_t reasoncode __WLAN_ATTRIB_PACK__;
p80211item_uint32_t resultcode __WLAN_ATTRIB_PACK__;
} p80211msg_req_deauthenticate_t;
__WLAN_PRAGMA_PACKDFLT__
__WLAN_PRAGMA_PACK1__
typedef struct p80211msg_req_associate
{
UINT32 msgcode __WLAN_ATTRIB_PACK__;
p80211item_pstr6_t peerstaaddr __WLAN_ATTRIB_PACK__;
p80211item_uint32_t assocfailtimeout __WLAN_ATTRIB_PACK__;
p80211item_uint32_t cfpollable __WLAN_ATTRIB_PACK__;
p80211item_uint32_t cfpollreq __WLAN_ATTRIB_PACK__;
p80211item_uint32_t privacy __WLAN_ATTRIB_PACK__;
p80211item_uint32_t listeninterval __WLAN_ATTRIB_PACK__;
p80211item_uint32_t resultcode __WLAN_ATTRIB_PACK__;
UINT32 msgcode __WLAN_ATTRIB_PACK__;
p80211item_pstr6_t peerstaaddr __WLAN_ATTRIB_PACK__;
p80211item_uint32_t assocfailtimeout __WLAN_ATTRIB_PACK__;
p80211item_uint32_t cfpollable __WLAN_ATTRIB_PACK__;
p80211item_uint32_t cfpollreq __WLAN_ATTRIB_PACK__;
p80211item_uint32_t privacy __WLAN_ATTRIB_PACK__;
p80211item_uint32_t listeninterval __WLAN_ATTRIB_PACK__;
p80211item_uint32_t resultcode __WLAN_ATTRIB_PACK__;
} p80211msg_req_associate_t;
__WLAN_PRAGMA_PACKDFLT__
__WLAN_PRAGMA_PACK1__
typedef struct p80211msg_req_reassociate
{
UINT32 msgcode __WLAN_ATTRIB_PACK__;
p80211item_pstr6_t newapaddr __WLAN_ATTRIB_PACK__;
p80211item_uint32_t reassocfailtimeout __WLAN_ATTRIB_PACK__;
p80211item_uint32_t cfpollable __WLAN_ATTRIB_PACK__;
p80211item_uint32_t cfpollreq __WLAN_ATTRIB_PACK__;
p80211item_uint32_t privacy __WLAN_ATTRIB_PACK__;
p80211item_uint32_t listeninterval __WLAN_ATTRIB_PACK__;
p80211item_uint32_t resultcode __WLAN_ATTRIB_PACK__;
UINT32 msgcode __WLAN_ATTRIB_PACK__;
p80211item_pstr6_t newapaddr __WLAN_ATTRIB_PACK__;
p80211item_uint32_t reassocfailtimeout __WLAN_ATTRIB_PACK__;
p80211item_uint32_t cfpollable __WLAN_ATTRIB_PACK__;
p80211item_uint32_t cfpollreq __WLAN_ATTRIB_PACK__;
p80211item_uint32_t privacy __WLAN_ATTRIB_PACK__;
p80211item_uint32_t listeninterval __WLAN_ATTRIB_PACK__;
p80211item_uint32_t resultcode __WLAN_ATTRIB_PACK__;
} p80211msg_req_reassociate_t;
__WLAN_PRAGMA_PACKDFLT__
__WLAN_PRAGMA_PACK1__
typedef struct p80211msg_req_disassociate
{
UINT32 msgcode __WLAN_ATTRIB_PACK__;
p80211item_pstr6_t peerstaaddr __WLAN_ATTRIB_PACK__;
p80211item_uint32_t reasoncode __WLAN_ATTRIB_PACK__;
p80211item_uint32_t resultcode __WLAN_ATTRIB_PACK__;
UINT32 msgcode __WLAN_ATTRIB_PACK__;
p80211item_pstr6_t peerstaaddr __WLAN_ATTRIB_PACK__;
p80211item_uint32_t reasoncode __WLAN_ATTRIB_PACK__;
p80211item_uint32_t resultcode __WLAN_ATTRIB_PACK__;
} p80211msg_req_disassociate_t;
__WLAN_PRAGMA_PACKDFLT__
__WLAN_PRAGMA_PACK1__
typedef struct p80211msg_req_reset
{
UINT32 msgcode __WLAN_ATTRIB_PACK__;
p80211item_pstr6_t peerstaaddr __WLAN_ATTRIB_PACK__;
p80211item_uint32_t setdefaultmib __WLAN_ATTRIB_PACK__;
p80211item_uint32_t resultcode __WLAN_ATTRIB_PACK__;
UINT32 msgcode __WLAN_ATTRIB_PACK__;
p80211item_pstr6_t peerstaaddr __WLAN_ATTRIB_PACK__;
p80211item_uint32_t setdefaultmib __WLAN_ATTRIB_PACK__;
p80211item_uint32_t resultcode __WLAN_ATTRIB_PACK__;
} p80211msg_req_reset_t;
__WLAN_PRAGMA_PACKDFLT__
__WLAN_PRAGMA_PACK1__
typedef struct p80211msg_req_start
{
UINT32 msgcode __WLAN_ATTRIB_PACK__;
p80211item_pstr32_t ssid __WLAN_ATTRIB_PACK__;
p80211item_uint32_t bsstype __WLAN_ATTRIB_PACK__;
p80211item_uint32_t beaconperiod __WLAN_ATTRIB_PACK__;
p80211item_uint32_t dtimperiod __WLAN_ATTRIB_PACK__;
p80211item_uint32_t cfpperiod __WLAN_ATTRIB_PACK__;
p80211item_uint32_t cfpmaxdur __WLAN_ATTRIB_PACK__;
p80211item_uint32_t fhdwelltime __WLAN_ATTRIB_PACK__;
p80211item_uint32_t fhhopset __WLAN_ATTRIB_PACK__;
p80211item_uint32_t fhhoppattern __WLAN_ATTRIB_PACK__;
p80211item_uint32_t dschannel __WLAN_ATTRIB_PACK__;
p80211item_uint32_t ibssatimwin __WLAN_ATTRIB_PACK__;
p80211item_uint32_t probedelay __WLAN_ATTRIB_PACK__;
p80211item_uint32_t cfpollable __WLAN_ATTRIB_PACK__;
p80211item_uint32_t cfpollreq __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate1 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate2 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate3 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate4 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate5 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate6 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate7 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate8 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t operationalrate1 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t operationalrate2 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t operationalrate3 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t operationalrate4 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t operationalrate5 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t operationalrate6 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t operationalrate7 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t operationalrate8 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t resultcode __WLAN_ATTRIB_PACK__;
UINT32 msgcode __WLAN_ATTRIB_PACK__;
p80211item_pstr32_t ssid __WLAN_ATTRIB_PACK__;
p80211item_uint32_t bsstype __WLAN_ATTRIB_PACK__;
p80211item_uint32_t beaconperiod __WLAN_ATTRIB_PACK__;
p80211item_uint32_t dtimperiod __WLAN_ATTRIB_PACK__;
p80211item_uint32_t cfpperiod __WLAN_ATTRIB_PACK__;
p80211item_uint32_t cfpmaxdur __WLAN_ATTRIB_PACK__;
p80211item_uint32_t fhdwelltime __WLAN_ATTRIB_PACK__;
p80211item_uint32_t fhhopset __WLAN_ATTRIB_PACK__;
p80211item_uint32_t fhhoppattern __WLAN_ATTRIB_PACK__;
p80211item_uint32_t dschannel __WLAN_ATTRIB_PACK__;
p80211item_uint32_t ibssatimwin __WLAN_ATTRIB_PACK__;
p80211item_uint32_t probedelay __WLAN_ATTRIB_PACK__;
p80211item_uint32_t cfpollable __WLAN_ATTRIB_PACK__;
p80211item_uint32_t cfpollreq __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate1 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate2 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate3 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate4 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate5 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate6 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate7 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate8 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t operationalrate1 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t operationalrate2 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t operationalrate3 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t operationalrate4 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t operationalrate5 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t operationalrate6 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t operationalrate7 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t operationalrate8 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t resultcode __WLAN_ATTRIB_PACK__;
} p80211msg_req_start_t;
__WLAN_PRAGMA_PACKDFLT__
@ -314,52 +328,53 @@ __WLAN_PRAGMA_PACKDFLT__
__WLAN_PRAGMA_PACK1__
typedef struct p80211msg_ind_authenticate
{
UINT32 msgcode __WLAN_ATTRIB_PACK__;
p80211item_pstr6_t peerstaaddr __WLAN_ATTRIB_PACK__;
p80211item_uint32_t authtype __WLAN_ATTRIB_PACK__;
UINT32 msgcode __WLAN_ATTRIB_PACK__;
p80211item_pstr6_t peerstaaddr __WLAN_ATTRIB_PACK__;
p80211item_uint32_t authtype __WLAN_ATTRIB_PACK__;
} p80211msg_ind_authenticate_t;
__WLAN_PRAGMA_PACKDFLT__
__WLAN_PRAGMA_PACK1__
typedef struct p80211msg_ind_deauthenticate
{
UINT32 msgcode __WLAN_ATTRIB_PACK__;
p80211item_pstr6_t peerstaaddr __WLAN_ATTRIB_PACK__;
p80211item_uint32_t reasoncode __WLAN_ATTRIB_PACK__;
UINT32 msgcode __WLAN_ATTRIB_PACK__;
p80211item_pstr6_t peerstaaddr __WLAN_ATTRIB_PACK__;
p80211item_uint32_t reasoncode __WLAN_ATTRIB_PACK__;
} p80211msg_ind_deauthenticate_t;
__WLAN_PRAGMA_PACKDFLT__
__WLAN_PRAGMA_PACK1__
typedef struct p80211msg_ind_associate
{
UINT32 msgcode __WLAN_ATTRIB_PACK__;
p80211item_pstr6_t peerstaaddr __WLAN_ATTRIB_PACK__;
UINT32 msgcode __WLAN_ATTRIB_PACK__;
p80211item_pstr6_t peerstaaddr __WLAN_ATTRIB_PACK__;
} p80211msg_ind_associate_t;
__WLAN_PRAGMA_PACKDFLT__
__WLAN_PRAGMA_PACK1__
typedef struct p80211msg_ind_reassociate
{
UINT32 msgcode __WLAN_ATTRIB_PACK__;
p80211item_pstr6_t peerstaaddr __WLAN_ATTRIB_PACK__;
UINT32 msgcode __WLAN_ATTRIB_PACK__;
p80211item_pstr6_t peerstaaddr __WLAN_ATTRIB_PACK__;
} p80211msg_ind_reassociate_t;
__WLAN_PRAGMA_PACKDFLT__
__WLAN_PRAGMA_PACK1__
typedef struct p80211msg_ind_disassociate
{
UINT32 msgcode __WLAN_ATTRIB_PACK__;
p80211item_pstr6_t peerstaaddr __WLAN_ATTRIB_PACK__;
p80211item_uint32_t reasoncode __WLAN_ATTRIB_PACK__;
UINT32 msgcode __WLAN_ATTRIB_PACK__;
p80211item_pstr6_t peerstaaddr __WLAN_ATTRIB_PACK__;
p80211item_uint32_t reasoncode __WLAN_ATTRIB_PACK__;
} p80211msg_ind_disassociate_t;
__WLAN_PRAGMA_PACKDFLT__
/*====================================================================*/
/*----- External Declarations ----------------------------------------*/
/*================================================================*/
/* Extern Declarations */
/*====================================================================*/
/*----- Function Prototypes ------------------------------------------*/
/*================================================================*/
/* Function Declarations */
UINT32 p80211item_getoffset( UINT32 did );

View File

@ -1,137 +1,149 @@
/* p80211types.h: Macros, constants, types, and funcs for p80211 data types
* --------------------------------------------------------------------
* 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 some of the constants and types used in various
* parts of the linux-wlan system.
* 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.
* 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 and statics declared here are implemented in p80211types.c
* --------------------------------------------------------------------
*
* This file declares some of the constants and types used in various
* parts of the linux-wlan system.
*
* Notes:
* - Constant values are always in HOST byte order.
*
* All functions and statics declared here are implemented in p80211types.c
* --------------------------------------------------------------------
*/
#ifndef _P80211TYPES_H
#define _P80211TYPES_H
/*================================================================*/
/* System Includes */
/*================================================================*/
/* Project Includes */
#ifndef _WLAN_COMPAT_H
#include <wlan/wlan_compat.h>
#endif
/*====================================================================*/
/*----- Constants ----------------------------------------------------*/
/*================================================================*/
/* Constants */
/*--------------------------------------------------------------------*/
/* p80211 data type codes, used for MIB items and message arguments. */
/* the various metadata structures provide additional information */
/* about these types. */
/*--------------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* p80211 data type codes, used for MIB items and message */
/* arguments. The various metadata structures provide */
/* additional information about these types. */
#define P80211_TYPE_OCTETSTR 1 /* pascal array of bytes */
#define P80211_TYPE_DISPLAYSTR 2 /* pascal array of bytes containing ascii */
#define P80211_TYPE_BOUNDEDINT 3 /* UINT32 w/ min and max values */
#define P80211_TYPE_INT 4 /* UINT32 min and max limited by 32 bits */
#define P80211_TYPE_ENUMINT 5 /* UINT32 holding a numeric code that can be mapped to a textual name */
#define P80211_TYPE_INT 4 /* UINT32 min and max limited by 32 bits */
#define P80211_TYPE_ENUMINT 5 /* UINT32 holding a numeric code that can be mapped to a textual name */
#define P80211_TYPE_COLLECTION 6 /* Data item containing other data items */
#define P80211_TYPE_MIBITEM 7 /* Data item containing a MIB value, requires the MIB DID for conversion and validation */
#define P80211_TYPE_MIBITEM 7 /* Data item containing a MIB value, requires the MIB DID for conversion and validation */
/*--------------------------------------------------------------------*/
/* The following constants are indexes into the SECTION list. */
/*--------------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* The following constants are indexes into the SECTION list. */
#define P80211SEC_DOT11SMT 1
#define P80211SEC_DOT11MAC 2
#define P80211SEC_DOT11PHY 3
#define P80211SEC_MSG 4
#define P80211SEC_DOT11SMT 1
#define P80211SEC_DOT11MAC 2
#define P80211SEC_DOT11PHY 3
#define P80211SEC_MSG 4
/*--------------------------------------------------------------------*/
/* The following constants are indexes into the SECTION list. */
/*--------------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* The following constants are indexes into the SECTION list. */
#define P80211GRP_REQ_MIBGET 1
#define P80211GRP_REQ_MIBSET 2
#define P80211GRP_REQ_POWERMGMT 3
#define P80211GRP_REQ_SCAN 4
#define P80211GRP_REQ_JOIN 5
#define P80211GRP_REQ_SCAN 4
#define P80211GRP_REQ_JOIN 5
#define P80211GRP_REQ_AUTHENTICATE 6
#define P80211GRP_REQ_DEAUTHENTICATE 7
#define P80211GRP_REQ_DEAUTHENTICATE 7
#define P80211GRP_REQ_ASSOCIATE 8
#define P80211GRP_REQ_REASSOCIATE 9
#define P80211GRP_REQ_DISASSOCIATE 10
#define P80211GRP_REQ_START 12
#define P80211GRP_REQ_START 12
/*--------------------------------------------------------------------*/
/* The following constants are indexes into the SECTION list. */
/*--------------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* The following constants are indexes into the SECTION list. */
#define P80211GRP_IND_AUTHENTICATE 21
#define P80211GRP_IND_DEAUTHENTICATE 22
#define P80211GRP_IND_DEAUTHENTICATE 22
#define P80211GRP_IND_ASSOCIATE 23
#define P80211GRP_IND_REASSOCIATE 24
#define P80211GRP_IND_DISASSOCIATE 25
/*--------------------------------------------------------------------*/
/* p80211 DID field codes that represent access type and is_table */
/* status. */
/*--------------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* p80211 DID field codes that represent access type and */
/* is_table status. */
#define P80211DID_ACCESS_READONLY 0
#define P80211DID_ACCESS_READWRITE 1
#define P80211DID_ISTABLE_FALSE 0
#define P80211DID_ISTABLE_TRUE 1
/*--------------------------------------------------------------------*/
/* p80211 enumeration constants. The value to text mappings for */
/* these is in p80211types.c. These defines were generated from the */
/* mappings. */
/*--------------------------------------------------------------------*/
#define P80211ENUM_BAD 0xffffffffUL /* error code for lookups */
#define P80211ENUM_BADSTR "\"P80211ENUM_BAD\""
#define P80211ENUM_truth_false 0
#define P80211ENUM_truth_true 1
#define P80211ENUM_powermgmt_active 1
/*----------------------------------------------------------------*/
/* p80211 enumeration constants. The value to text mappings for */
/* these is in p80211types.c. These defines were generated */
/* from the mappings. */
/* error codes for lookups */
#define P80211ENUM_BAD 0xffffffffUL
#define P80211ENUM_BADSTR "\"P80211ENUM_BAD\""
#define P80211ENUM_truth_false 0
#define P80211ENUM_truth_true 1
#define P80211ENUM_powermgmt_active 1
#define P80211ENUM_powermgmt_powersave 2
#define P80211ENUM_bsstype_infrastructure 1
#define P80211ENUM_bsstype_independent 2
#define P80211ENUM_bsstype_any 3
#define P80211ENUM_bsstype_any 3
#define P80211ENUM_authalg_opensystem 1
#define P80211ENUM_authalg_sharedkey 2
#define P80211ENUM_phytype_fhss 1
#define P80211ENUM_phytype_dsss 2
#define P80211ENUM_phytype_fhss 1
#define P80211ENUM_phytype_dsss 2
#define P80211ENUM_phytype_irbaseband 3
#define P80211ENUM_temptype_commercial 1
#define P80211ENUM_temptype_industrial 2
#define P80211ENUM_regdomain_fcc 16
#define P80211ENUM_regdomain_doc 32
#define P80211ENUM_regdomain_etsi 48
#define P80211ENUM_regdomain_spain 49
#define P80211ENUM_regdomain_france 50
#define P80211ENUM_regdomain_mkk 64
#define P80211ENUM_ccamode_edonly 1
#define P80211ENUM_ccamode_csonly 2
#define P80211ENUM_ccamode_edandcs 4
#define P80211ENUM_regdomain_fcc 16
#define P80211ENUM_regdomain_doc 32
#define P80211ENUM_regdomain_etsi 48
#define P80211ENUM_regdomain_spain 49
#define P80211ENUM_regdomain_france 50
#define P80211ENUM_regdomain_mkk 64
#define P80211ENUM_ccamode_edonly 1
#define P80211ENUM_ccamode_csonly 2
#define P80211ENUM_ccamode_edandcs 4
#define P80211ENUM_diversity_fixedlist 1
#define P80211ENUM_diversity_notsupported 2
#define P80211ENUM_diversity_dynamic 3
#define P80211ENUM_scantype_active 1
#define P80211ENUM_scantype_passive 2
#define P80211ENUM_scantype_active 1
#define P80211ENUM_scantype_passive 2
#define P80211ENUM_resultcode_success 1
#define P80211ENUM_resultcode_invalid_parameters 2
#define P80211ENUM_resultcode_invalid_parameters 2
#define P80211ENUM_resultcode_not_supported 3
#define P80211ENUM_resultcode_timeout 4
#define P80211ENUM_resultcode_too_many_req 5
@ -149,39 +161,37 @@
#define P80211ENUM_reason_asoc_not_auth 9
#define P80211ENUM_status_successful 0
#define P80211ENUM_status_unspec_failure 1
#define P80211ENUM_status_unsup_cap 10
#define P80211ENUM_status_unsup_cap 10
#define P80211ENUM_status_reasoc_no_asoc 11
#define P80211ENUM_status_fail_other 12
#define P80211ENUM_status_unspt_alg 13
#define P80211ENUM_status_unspt_alg 13
#define P80211ENUM_status_auth_seq_fail 14
#define P80211ENUM_status_chlng_fail 15
#define P80211ENUM_status_auth_timeout 16
#define P80211ENUM_status_ap_full 17
#define P80211ENUM_status_ap_full 17
#define P80211ENUM_status_unsup_rate 18
/*--------------------------------------------------------------------*/
/* p80211 maximum length constants for the different pascal strings. */
/*--------------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* p80211 max length constants for the different pascal strings. */
#define MAXLEN_PSTR6 (6) /* pascal array of 6 bytes */
#define MAXLEN_PSTR6 (6) /* pascal array of 6 bytes */
#define MAXLEN_PSTR14 (14) /* pascal array of 14 bytes */
#define MAXLEN_PSTR32 (32) /* pascal array of 32 bytes */
#define MAXLEN_PSTR255 (255) /* pascal array of 255 bytes */
/*--------------------------------------------------------------------*/
/* string constants */
/*--------------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* string constants */
#define NOT_SET "\"NOT_SET\""
#define NOT_SET "\"NOT_SET\""
#define NOT_SUPPORTED "\"NOT_SUPPORTED\""
/*====================================================================*/
/*----- Macros -------------------------------------------------------*/
/*--------------------------------------------------------------------*/
/* The following macros are used to ensure consistent naming */
/* conventions for all the different metadata lists. */
/*--------------------------------------------------------------------*/
/*================================================================*/
/* Macros */
/*----------------------------------------------------------------*/
/* The following macros are used to ensure consistent naming */
/* conventions for all the different metadata lists. */
#define MKREQMETANAME(name) p80211meta_ ## req ## _ ## name
#define MKCOLLMETANAME(name) p80211meta_ ## coll ## _ ## name
@ -197,11 +207,10 @@
#define GETMETASIZE(aptr) (**((UINT32**)(aptr)))
/*--------------------------------------------------------------------*/
/* The following ifdef depends on the following defines */
/* P80211_NOINCLUDESTRINGS - ifdef, all metadata name fields */
/* are empty strings */
/*--------------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* The following ifdef depends on the following defines: */
/* P80211_NOINCLUDESTRINGS - if defined, all metadata name fields */
/* are empty strings */
#ifdef P80211_NOINCLUDESTRINGS
#define MKITEMNAME(s) ("")
@ -209,128 +218,126 @@
#define MKITEMNAME(s) (s)
#endif
/*--------------------------------------------------------------------*/
/* The following macro creates a name for an enum */
/*--------------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* The following macro creates a name for an enum */
#define MKENUMNAME(name) p80211enum_ ## name
/*--------------------------------------------------------------------*/
/* The following constants and macros are used to construct and */
/* deconstruct the Data ID codes. */
/*--------------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* The following constants and macros are used to construct and */
/* deconstruct the Data ID codes. */
#define P80211DID_LSB_SECTION (0)
#define P80211DID_LSB_SECTION (0)
#define P80211DID_LSB_GROUP (6)
#define P80211DID_LSB_ITEM (12)
#define P80211DID_LSB_INDEX (18)
#define P80211DID_LSB_ISTABLE (26)
#define P80211DID_LSB_ACCESS (27)
#define P80211DID_LSB_ISTABLE (26)
#define P80211DID_LSB_ACCESS (27)
#define P80211DID_LSB_TYPE (28)
#define P80211DID_MASK_SECTION (0x0000003fUL)
#define P80211DID_MASK_GROUP (0x0000003fUL)
#define P80211DID_MASK_SECTION (0x0000003fUL)
#define P80211DID_MASK_GROUP (0x0000003fUL)
#define P80211DID_MASK_ITEM (0x0000003fUL)
#define P80211DID_MASK_INDEX (0x000000ffUL)
#define P80211DID_MASK_ISTABLE (0x00000001UL)
#define P80211DID_MASK_ACCESS (0x00000001UL)
#define P80211DID_MASK_INDEX (0x000000ffUL)
#define P80211DID_MASK_ISTABLE (0x00000001UL)
#define P80211DID_MASK_ACCESS (0x00000001UL)
#define P80211DID_MASK_TYPE (0x00000007UL)
#define P80211DID_MK(a,m,l) ((((UINT32)(a)) & (m)) << (l))
#define P80211DID_MK(a,m,l) ((((UINT32)(a)) & (m)) << (l))
#define P80211DID_MKSECTION(a) P80211DID_MK(a, \
P80211DID_MASK_SECTION, \
P80211DID_LSB_SECTION )
P80211DID_MASK_SECTION, \
P80211DID_LSB_SECTION )
#define P80211DID_MKGROUP(a) P80211DID_MK(a, \
P80211DID_MASK_GROUP, \
P80211DID_LSB_GROUP )
#define P80211DID_MKITEM(a) P80211DID_MK(a, \
P80211DID_MASK_ITEM, \
P80211DID_LSB_ITEM )
P80211DID_MASK_GROUP, \
P80211DID_LSB_GROUP )
#define P80211DID_MKITEM(a) P80211DID_MK(a, \
P80211DID_MASK_ITEM, \
P80211DID_LSB_ITEM )
#define P80211DID_MKINDEX(a) P80211DID_MK(a, \
P80211DID_MASK_INDEX, \
P80211DID_LSB_INDEX )
P80211DID_MASK_INDEX, \
P80211DID_LSB_INDEX )
#define P80211DID_MKISTABLE(a) P80211DID_MK(a, \
P80211DID_MASK_ISTABLE, \
P80211DID_LSB_ISTABLE )
P80211DID_MASK_ISTABLE, \
P80211DID_LSB_ISTABLE )
#define P80211DID_MKACCESS(a) P80211DID_MK(a, \
P80211DID_MASK_ACCESS, \
P80211DID_LSB_ACCESS )
#define P80211DID_MKTYPE(a) P80211DID_MK(a, \
P80211DID_MASK_TYPE, \
P80211DID_LSB_TYPE )
P80211DID_MASK_ACCESS, \
P80211DID_LSB_ACCESS )
#define P80211DID_MKTYPE(a) P80211DID_MK(a, \
P80211DID_MASK_TYPE, \
P80211DID_LSB_TYPE )
#define P80211DID_MKID(s,g,i,n,t,a,d) (P80211DID_MKSECTION(s) | \
P80211DID_MKGROUP(g) | \
P80211DID_MKITEM(i) | \
P80211DID_MKINDEX(n) | \
P80211DID_MKISTABLE(t) | \
P80211DID_MKACCESS(a) | \
P80211DID_MKTYPE(d) )
P80211DID_MKGROUP(g) | \
P80211DID_MKITEM(i) | \
P80211DID_MKINDEX(n) | \
P80211DID_MKISTABLE(t) | \
P80211DID_MKACCESS(a) | \
P80211DID_MKTYPE(d) )
#define P80211DID_GET(a,m,l) ((((UINT32)(a)) >> (l)) & (m))
#define P80211DID_SECTION(a) P80211DID_GET(a, \
P80211DID_MASK_SECTION, \
P80211DID_LSB_SECTION)
#define P80211DID_GROUP(a) P80211DID_GET(a, \
P80211DID_MASK_GROUP, \
P80211DID_LSB_GROUP)
#define P80211DID_ITEM(a) P80211DID_GET(a, \
P80211DID_MASK_ITEM, \
P80211DID_LSB_ITEM)
#define P80211DID_INDEX(a) P80211DID_GET(a, \
P80211DID_MASK_INDEX, \
P80211DID_LSB_INDEX)
P80211DID_MASK_SECTION, \
P80211DID_LSB_SECTION)
#define P80211DID_GROUP(a) P80211DID_GET(a, \
P80211DID_MASK_GROUP, \
P80211DID_LSB_GROUP)
#define P80211DID_ITEM(a) P80211DID_GET(a, \
P80211DID_MASK_ITEM, \
P80211DID_LSB_ITEM)
#define P80211DID_INDEX(a) P80211DID_GET(a, \
P80211DID_MASK_INDEX, \
P80211DID_LSB_INDEX)
#define P80211DID_ISTABLE(a) P80211DID_GET(a, \
P80211DID_MASK_ISTABLE, \
P80211DID_LSB_ISTABLE)
#define P80211DID_ACCESS(a) P80211DID_GET(a, \
P80211DID_MASK_ACCESS, \
P80211DID_LSB_ACCESS)
#define P80211DID_TYPE(a) P80211DID_GET(a, \
P80211DID_MASK_TYPE, \
P80211DID_LSB_TYPE)
P80211DID_MASK_ISTABLE, \
P80211DID_LSB_ISTABLE)
#define P80211DID_ACCESS(a) P80211DID_GET(a, \
P80211DID_MASK_ACCESS, \
P80211DID_LSB_ACCESS)
#define P80211DID_TYPE(a) P80211DID_GET(a, \
P80211DID_MASK_TYPE, \
P80211DID_LSB_TYPE)
/*====================================================================*/
/*----- Types --------------------------------------------------------*/
/*================================================================*/
/* Types */
/*----------------------------------------------------------------*/
/* The following structure types are used for the represenation */
/* of ENUMINT type metadata. */
/*--------------------------------------------------------------------*/
/* The following structure types are used for the represenation of */
/* ENUMINT type metadata. */
/*--------------------------------------------------------------------*/
typedef struct p80211enumpair
{
UINT32 val;
char *name;
UINT32 val;
char *name;
} p80211enumpair_t;
typedef struct p80211enum
{
INT nitems;
INT nitems;
p80211enumpair_t *list;
} p80211enum_t;
/*--------------------------------------------------------------------*/
/* The following structure types are used to store data items in */
/* messages. */
/*--------------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* The following structure types are used to store data items in */
/* messages. */
/* Template pascal string */
__WLAN_PRAGMA_PACK1__
typedef struct p80211pstr
{
UINT8 len __WLAN_ATTRIB_PACK__;
UINT8 len __WLAN_ATTRIB_PACK__;
} p80211pstr_t;
__WLAN_PRAGMA_PACKDFLT__
__WLAN_PRAGMA_PACK1__
typedef struct p80211pstrd
{
UINT8 len __WLAN_ATTRIB_PACK__;
UINT8 data[0] __WLAN_ATTRIB_PACK__;
UINT8 len __WLAN_ATTRIB_PACK__;
UINT8 data[0] __WLAN_ATTRIB_PACK__;
} p80211pstrd_t;
__WLAN_PRAGMA_PACKDFLT__
@ -338,8 +345,8 @@ __WLAN_PRAGMA_PACKDFLT__
__WLAN_PRAGMA_PACK1__
typedef struct p80211pstr255
{
UINT8 len __WLAN_ATTRIB_PACK__;
UINT8 data[MAXLEN_PSTR255+1] __WLAN_ATTRIB_PACK__;
UINT8 len __WLAN_ATTRIB_PACK__;
UINT8 data[MAXLEN_PSTR255+1] __WLAN_ATTRIB_PACK__;
} p80211pstr255_t;
__WLAN_PRAGMA_PACKDFLT__
@ -347,8 +354,8 @@ __WLAN_PRAGMA_PACKDFLT__
__WLAN_PRAGMA_PACK1__
typedef struct p80211pstr6
{
UINT8 len __WLAN_ATTRIB_PACK__;
UINT8 data[MAXLEN_PSTR6+1] __WLAN_ATTRIB_PACK__;
UINT8 len __WLAN_ATTRIB_PACK__;
UINT8 data[MAXLEN_PSTR6+1] __WLAN_ATTRIB_PACK__;
} p80211pstr6_t;
__WLAN_PRAGMA_PACKDFLT__
@ -356,8 +363,8 @@ __WLAN_PRAGMA_PACKDFLT__
__WLAN_PRAGMA_PACK1__
typedef struct p80211pstr14
{
UINT8 len __WLAN_ATTRIB_PACK__;
UINT8 data[MAXLEN_PSTR14+1] __WLAN_ATTRIB_PACK__;
UINT8 len __WLAN_ATTRIB_PACK__;
UINT8 data[MAXLEN_PSTR14+1] __WLAN_ATTRIB_PACK__;
} p80211pstr14_t;
__WLAN_PRAGMA_PACKDFLT__
@ -365,8 +372,8 @@ __WLAN_PRAGMA_PACKDFLT__
__WLAN_PRAGMA_PACK1__
typedef struct p80211pstr32
{
UINT8 len __WLAN_ATTRIB_PACK__;
UINT8 data[MAXLEN_PSTR32+1] __WLAN_ATTRIB_PACK__;
UINT8 len __WLAN_ATTRIB_PACK__;
UINT8 data[MAXLEN_PSTR32+1] __WLAN_ATTRIB_PACK__;
} p80211pstr32_t;
__WLAN_PRAGMA_PACKDFLT__
@ -374,8 +381,8 @@ __WLAN_PRAGMA_PACKDFLT__
__WLAN_PRAGMA_PACK1__
typedef struct p80211item
{
UINT32 did __WLAN_ATTRIB_PACK__;
UINT32 len __WLAN_ATTRIB_PACK__;
UINT32 did __WLAN_ATTRIB_PACK__;
UINT32 len __WLAN_ATTRIB_PACK__;
} p80211item_t;
__WLAN_PRAGMA_PACKDFLT__
@ -383,9 +390,9 @@ __WLAN_PRAGMA_PACKDFLT__
__WLAN_PRAGMA_PACK1__
typedef struct p80211itemd
{
UINT32 did __WLAN_ATTRIB_PACK__;
UINT32 len __WLAN_ATTRIB_PACK__;
UINT8 data[0] __WLAN_ATTRIB_PACK__;
UINT32 did __WLAN_ATTRIB_PACK__;
UINT32 len __WLAN_ATTRIB_PACK__;
UINT8 data[0] __WLAN_ATTRIB_PACK__;
} p80211itemd_t;
__WLAN_PRAGMA_PACKDFLT__
@ -393,8 +400,8 @@ __WLAN_PRAGMA_PACKDFLT__
__WLAN_PRAGMA_PACK1__
typedef struct p80211item_coll
{
UINT32 did __WLAN_ATTRIB_PACK__;
UINT32 len __WLAN_ATTRIB_PACK__;
UINT32 did __WLAN_ATTRIB_PACK__;
UINT32 len __WLAN_ATTRIB_PACK__;
} p80211item_coll_t;
__WLAN_PRAGMA_PACKDFLT__
@ -402,9 +409,9 @@ __WLAN_PRAGMA_PACKDFLT__
__WLAN_PRAGMA_PACK1__
typedef struct p80211item_uint32
{
UINT32 did __WLAN_ATTRIB_PACK__;
UINT32 len __WLAN_ATTRIB_PACK__;
UINT32 data __WLAN_ATTRIB_PACK__;
UINT32 did __WLAN_ATTRIB_PACK__;
UINT32 len __WLAN_ATTRIB_PACK__;
UINT32 data __WLAN_ATTRIB_PACK__;
} p80211item_uint32_t;
__WLAN_PRAGMA_PACKDFLT__
@ -412,9 +419,9 @@ __WLAN_PRAGMA_PACKDFLT__
__WLAN_PRAGMA_PACK1__
typedef struct p80211item_pstr6
{
UINT32 did __WLAN_ATTRIB_PACK__;
UINT32 len __WLAN_ATTRIB_PACK__;
p80211pstr6_t data __WLAN_ATTRIB_PACK__;
UINT32 did __WLAN_ATTRIB_PACK__;
UINT32 len __WLAN_ATTRIB_PACK__;
p80211pstr6_t data __WLAN_ATTRIB_PACK__;
}p80211item_pstr6_t;
__WLAN_PRAGMA_PACKDFLT__
@ -422,9 +429,9 @@ __WLAN_PRAGMA_PACKDFLT__
__WLAN_PRAGMA_PACK1__
typedef struct p80211item_pstr14
{
UINT32 did __WLAN_ATTRIB_PACK__;
UINT32 len __WLAN_ATTRIB_PACK__;
p80211pstr14_t data __WLAN_ATTRIB_PACK__;
UINT32 did __WLAN_ATTRIB_PACK__;
UINT32 len __WLAN_ATTRIB_PACK__;
p80211pstr14_t data __WLAN_ATTRIB_PACK__;
}p80211item_pstr14_t;
__WLAN_PRAGMA_PACKDFLT__
@ -432,9 +439,9 @@ __WLAN_PRAGMA_PACKDFLT__
__WLAN_PRAGMA_PACK1__
typedef struct p80211item_pstr32
{
UINT32 did __WLAN_ATTRIB_PACK__;
UINT32 len __WLAN_ATTRIB_PACK__;
p80211pstr32_t data __WLAN_ATTRIB_PACK__;
UINT32 did __WLAN_ATTRIB_PACK__;
UINT32 len __WLAN_ATTRIB_PACK__;
p80211pstr32_t data __WLAN_ATTRIB_PACK__;
}p80211item_pstr32_t;
__WLAN_PRAGMA_PACKDFLT__
@ -442,9 +449,9 @@ __WLAN_PRAGMA_PACKDFLT__
__WLAN_PRAGMA_PACK1__
typedef struct p80211item_pstr255
{
UINT32 did __WLAN_ATTRIB_PACK__;
UINT32 len __WLAN_ATTRIB_PACK__;
p80211pstr255_t data __WLAN_ATTRIB_PACK__;
UINT32 did __WLAN_ATTRIB_PACK__;
UINT32 len __WLAN_ATTRIB_PACK__;
p80211pstr255_t data __WLAN_ATTRIB_PACK__;
}p80211item_pstr255_t;
__WLAN_PRAGMA_PACKDFLT__
@ -454,34 +461,34 @@ __WLAN_PRAGMA_PACKDFLT__
__WLAN_PRAGMA_PACK1__
typedef struct p80211item_coll_bssdesc
{
p80211item_pstr6_t bssid __WLAN_ATTRIB_PACK__;
p80211item_pstr32_t ssid __WLAN_ATTRIB_PACK__;
p80211item_uint32_t bsstype __WLAN_ATTRIB_PACK__;
p80211item_uint32_t beaconperiod __WLAN_ATTRIB_PACK__;
p80211item_uint32_t dtimperiod __WLAN_ATTRIB_PACK__;
p80211item_uint32_t timestamp __WLAN_ATTRIB_PACK__;
p80211item_uint32_t localtime __WLAN_ATTRIB_PACK__;
p80211item_uint32_t fhdwelltime __WLAN_ATTRIB_PACK__;
p80211item_uint32_t fhhopset __WLAN_ATTRIB_PACK__;
p80211item_uint32_t fhhoppattern __WLAN_ATTRIB_PACK__;
p80211item_uint32_t fhhopindex __WLAN_ATTRIB_PACK__;
p80211item_uint32_t dschannel __WLAN_ATTRIB_PACK__;
p80211item_uint32_t cfpcount __WLAN_ATTRIB_PACK__;
p80211item_uint32_t cfpperiod __WLAN_ATTRIB_PACK__;
p80211item_uint32_t cfpmaxdur __WLAN_ATTRIB_PACK__;
p80211item_uint32_t cfpdurremain __WLAN_ATTRIB_PACK__;
p80211item_uint32_t ibssatimwin __WLAN_ATTRIB_PACK__;
p80211item_uint32_t cfpollable __WLAN_ATTRIB_PACK__;
p80211item_uint32_t cfpollreq __WLAN_ATTRIB_PACK__;
p80211item_uint32_t privacy __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate1 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate2 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate3 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate4 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate5 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate6 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate7 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate8 __WLAN_ATTRIB_PACK__;
p80211item_pstr6_t bssid __WLAN_ATTRIB_PACK__;
p80211item_pstr32_t ssid __WLAN_ATTRIB_PACK__;
p80211item_uint32_t bsstype __WLAN_ATTRIB_PACK__;
p80211item_uint32_t beaconperiod __WLAN_ATTRIB_PACK__;
p80211item_uint32_t dtimperiod __WLAN_ATTRIB_PACK__;
p80211item_uint32_t timestamp __WLAN_ATTRIB_PACK__;
p80211item_uint32_t localtime __WLAN_ATTRIB_PACK__;
p80211item_uint32_t fhdwelltime __WLAN_ATTRIB_PACK__;
p80211item_uint32_t fhhopset __WLAN_ATTRIB_PACK__;
p80211item_uint32_t fhhoppattern __WLAN_ATTRIB_PACK__;
p80211item_uint32_t fhhopindex __WLAN_ATTRIB_PACK__;
p80211item_uint32_t dschannel __WLAN_ATTRIB_PACK__;
p80211item_uint32_t cfpcount __WLAN_ATTRIB_PACK__;
p80211item_uint32_t cfpperiod __WLAN_ATTRIB_PACK__;
p80211item_uint32_t cfpmaxdur __WLAN_ATTRIB_PACK__;
p80211item_uint32_t cfpdurremain __WLAN_ATTRIB_PACK__;
p80211item_uint32_t ibssatimwin __WLAN_ATTRIB_PACK__;
p80211item_uint32_t cfpollable __WLAN_ATTRIB_PACK__;
p80211item_uint32_t cfpollreq __WLAN_ATTRIB_PACK__;
p80211item_uint32_t privacy __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate1 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate2 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate3 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate4 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate5 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate6 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate7 __WLAN_ATTRIB_PACK__;
p80211item_uint32_t basicrate8 __WLAN_ATTRIB_PACK__;
}p80211item_coll_bssdesc_t;
__WLAN_PRAGMA_PACKDFLT__
@ -490,17 +497,16 @@ __WLAN_PRAGMA_PACKDFLT__
__WLAN_PRAGMA_PACK1__
typedef struct p80211item_bssdesc
{
UINT32 did __WLAN_ATTRIB_PACK__;
UINT32 len __WLAN_ATTRIB_PACK__;
p80211item_coll_bssdesc_t data __WLAN_ATTRIB_PACK__;
UINT32 did __WLAN_ATTRIB_PACK__;
UINT32 len __WLAN_ATTRIB_PACK__;
p80211item_coll_bssdesc_t data __WLAN_ATTRIB_PACK__;
} p80211item_bssdesc_t;
__WLAN_PRAGMA_PACKDFLT__
/*--------------------------------------------------------------------*/
/* The following structure type is used to represent all of the */
/* metadata items. Some components may choose to use more, less or */
/* different metadata items. */
/*--------------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* The following structure type is used to represent all of the */
/* metadata items. Some components may choose to use more, */
/* less or different metadata items. */
typedef void (*p80211_totext_t)(UINT32 did, UINT8* itembuf, char *textbuf);
typedef void (*p80211_fromtext_t)(UINT32 did, UINT8* itembuf, char *textbuf);
@ -508,28 +514,28 @@ typedef UINT32 (*p80211_valid_t)(UINT32 did, UINT8* itembuf);
typedef struct p80211meta
{
char *name; /* data item name */
UINT32 did; /* partial did */
UINT32 flags; /* set of various flag bits */
UINT32 min; /* min value of a BOUNDEDINT */
UINT32 max; /* max value of a BOUNDEDINT */
UINT32 maxlen; /* maxlen of a OCTETSTR or DISPLAYSTR */
p80211enum_t *enumptr; /* ptr to the enum type for ENUMINT */
struct p80211meta *collptr; /* ptr to array of COLLECTION subitems */
p80211_totext_t totextptr; /* ptr to totext conversion function */
char *name; /* data item name */
UINT32 did; /* partial did */
UINT32 flags; /* set of various flag bits */
UINT32 min; /* min value of a BOUNDEDINT */
UINT32 max; /* max value of a BOUNDEDINT */
UINT32 maxlen; /* maxlen of a OCTETSTR or DISPLAYSTR */
p80211enum_t *enumptr; /* ptr to the enum type for ENUMINT */
struct p80211meta *collptr; /* ptr to array of COLLECTION subitems */
p80211_totext_t totextptr; /* ptr to totext conversion function */
p80211_fromtext_t fromtextptr; /* ptr to totext conversion function */
p80211_valid_t validfunptr; /* ptr to totext conversion function */
} p80211meta_t;
/*====================================================================*/
/*----- External Declarations ----------------------------------------*/
/*================================================================*/
/* Extern Declarations */
/*--------------------------------------------------------------------*/
/* Enumeration Lists */
/* The following are the external declarations for all enumerations */
/*--------------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Enumeration Lists */
/* The following are the external declarations */
/* for all enumerations */
extern p80211enum_t MKENUMNAME(truth);
extern p80211enum_t MKENUMNAME(powermgmt);
@ -546,33 +552,44 @@ extern p80211enum_t MKENUMNAME(reason);
extern p80211enum_t MKENUMNAME(status);
extern p80211enum_t MKENUMNAME(msgcode);
/*--------------------------------------------------------------------*/
/* Metadata Lists */
/* The following are the external declarations for all the metadata */
/* lists. */
/*--------------------------------------------------------------------*/
/*------------- Extern for the collection metadata lists -------------*/
/*------------- defined in p80211metamib.c ----------------------------*/
/*----------------------------------------------------------------*/
/* Metadata Lists */
/* The following are the external declarations */
/* for all the metadata lists. */
/*----------------------------------------------------------------*/
/* Extern for the collection metadata lists */
/* defined in p80211metamib.c */
extern p80211meta_t **p80211meta_slist[];
/*------------- Extern(s) for the mib metadata group(s) --------------*/
/*------------- defined in p80211metamib.c ----------------------------*/
/*----------------------------------------------------------------*/
/* Externs for the mib metadata groups */
/* defined in p80211metamib.c */
extern p80211meta_t *MKGRPMETANAME(dot11smt)[];
extern p80211meta_t *MKGRPMETANAME(dot11mac)[];
extern p80211meta_t *MKGRPMETANAME(dot11phy)[];
/*------------- Extern(s) for the msg metadata group(s) --------------*/
/*------------- defined in p80211msg.c --------------------------------*/
/*----------------------------------------------------------------*/
/* Extern for the msg metadata group */
/* defined in p80211msg.c */
extern p80211meta_t *MKGRPMETANAME(msg)[];
/*------------- Externs for the msg collection metadata lists --------*/
/*------------- defined in p80211msg.c --------------------------------*/
/*----------------------------------------------------------------*/
/* Externs for the msg collection metadata lists */
/* defined in p80211msg.c */
extern p80211meta_t MKCOLLMETANAME(bssdesc)[];
extern UINT32 MKCOLLMETASIZE(bssdesc);
/*------------- Externs for the command metadata lists ---------------*/
/*------------- defined in p80211msg.c --------------------------------*/
/*----------------------------------------------------------------*/
/* Externs for the command metadata lists */
/* defined in p80211msg.c */
extern p80211meta_t MKREQMETANAME(mib_get)[];
extern UINT32 MKREQMETASIZE(mib_get);
extern p80211meta_t MKREQMETANAME(mib_set)[];
@ -598,8 +615,9 @@ extern UINT32 MKREQMETASIZE(reset);
extern p80211meta_t MKREQMETANAME(start)[];
extern UINT32 MKREQMETASIZE(start);
/*------------- Externs for the indication metadata lists ------------*/
/*------------- defined in p80211msg.c --------------------------------*/
/*----------------------------------------------------------------*/
/* Externs for the indication metadata lists */
/* defined in p80211msg.c */
extern p80211meta_t MKINDMETANAME(authenticate)[];
extern UINT32 MKINDMETASIZE(authenticate);
extern p80211meta_t MKINDMETANAME(deauthenticate)[];
@ -612,29 +630,28 @@ extern p80211meta_t MKINDMETANAME(disassociate)[];
extern UINT32 MKINDMETASIZE(disassociate);
/*====================================================================*/
/*----- Function Prototypes ------------------------------------------*/
/*================================================================*/
/* Function Declarations */
/*--------------------------------------------------------------------*/
/* The following declare some utility functions for use with the */
/* p80211enum_t type. */
/*--------------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* The following declare some utility functions for use with the */
/* p80211enum_t type. */
UINT32 p80211enum_text2int(p80211enum_t *ep, char *text);
UINT32 p80211enum_int2text(p80211enum_t *ep, UINT32 val, char *text);
/*--------------------------------------------------------------------*/
/* The following declare some utility functions for use with the */
/* p80211item_t and p80211meta_t types. */
/*--------------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* The following declare some utility functions for use with the */
/* p80211item_t and p80211meta_t types. */
UINT32 p80211item_maxdatalen( UINT32 did );
UINT32 p80211_metaname2did(char *name);
/*--------------------------------------------------------------------*/
/* The following declare functions that perform validation and text */
/* to binary conversions based on the metadata for interface and */
/* MIB data items. */
/*--------------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* The following declare functions that perform validation and */
/* text to binary conversions based on the metadata for interface */
/* and MIB data items. */
/*----------------------------------------------------------------*/
/*-- DISPLAYSTR ------------------------------------------------------*/
/* pstr ==> cstr */

View File

@ -1,24 +1,35 @@
/* wlan_compat.h: Types and macros to aid in portability
* --------------------------------------------------------------------
* 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
*
* --------------------------------------------------------------------
*
* Notes:
* - Because of the conditionals and the logical grouping of items in
* this file, we decided to not split the constants and macros into
* separate sections.
* --------------------------------------------------------------------
*/
#ifndef _WLAN_COMPAT_H
@ -29,36 +40,36 @@
/*=============================================================*/
/* Key macros: */
/* WLAN_CPU_FAMILY */
#define WLAN_Ix86 1
#define WLAN_PPC 2
#define WLAN_Ix96 3
#define WLAN_Ix86 1
#define WLAN_PPC 2
#define WLAN_Ix96 3
/* WLAN_CPU_CORE */
#define WLAN_I386CORE 1
#define WLAN_PPCCORE 2
#define WLAN_I296 3
#define WLAN_I296 3
/* WLAN_CPU_PART */
#define WLAN_I386PART 1
#define WLAN_MPC860 2
#define WLAN_MPC850 3
#define WLAN_I296SA 4
#define WLAN_MPC860 2
#define WLAN_MPC850 3
#define WLAN_I296SA 4
#define WLAN_PPCPART 5
/* WLAN_SYSARCH */
#define WLAN_PCAT 1
#define WLAN_MBX 2
#define WLAN_RPX 3
#define WLAN_LWARCH 4
#define WLAN_PMAC 5
#define WLAN_PCAT 1
#define WLAN_MBX 2
#define WLAN_RPX 3
#define WLAN_LWARCH 4
#define WLAN_PMAC 5
/* WLAN_OS */
#define WLAN_LINUX_KERNEL 1
#define WLAN_LINUX_USER 2
#define WLAN_LWOS 3
#define WLAN_QNX4 4
#define WLAN_LWOS 3
#define WLAN_QNX4 4
/* WLAN_COMPILER */
#define WLAN_GNUC 1
#define WLAN_DIAB 2
#define WLAN_GNUC 1
#define WLAN_DIAB 2
#if defined(__LINUX_WLAN__) && defined(__KERNEL__)
#define WLAN_OS WLAN_LINUX_KERNEL
#define WLAN_OS WLAN_LINUX_KERNEL
#define WLAN_COMPILER WLAN_GNUC
#if defined(__i386__) || defined(__i486__) || defined(__i586__) || defined(__i686__)
#define WLAN_CPU_FAMILY WLAN_Ix86
@ -80,7 +91,7 @@
#endif
#endif
#elif defined(__LINUX_WLAN__) && !defined(__KERNEL__)
#define WLAN_OS WLAN_LINUX_USER
#define WLAN_OS WLAN_LINUX_USER
#define WLAN_COMPILER WLAN_GNUC
#if defined(__I386__)
#define WLAN_CPU_FAMILY WLAN_Ix86
@ -100,16 +111,18 @@
#define WLAN_CPU_PART WLAN_PPCPART
#define WLAN_SYSARCH WLAN_PMAC
#endif
#else
#error "No CPU identified!"
#endif
#elif defined(LW) || defined(LW_HDW_ISDN) || defined(LW_HDW_SERIAL)
#define WLAN_OS WLAN_LWOS
#define WLAN_OS WLAN_LWOS
#define WLAN_COMPILER WLAN_DIAB
#define WLAN_CPU_FAMILY WLAN_PPC
#define WLAN_CPU_CORE WLAN_PPCCORE
#define WLAN_CPU_PART WLAN_MPC860
#define WLAN_SYSARCH WLAN_LWARCH
#elif defined(MBX)
#define WLAN_OS WLAN_LWOS
#define WLAN_OS WLAN_LWOS
#define WLAN_COMPILER WLAN_DIAB
#define WLAN_CPU_FAMILY WLAN_PPC
#define WLAN_CPU_CORE WLAN_PPCCORE
@ -202,7 +215,7 @@ typedef signed int INT;
typedef unsigned long long UINT64;
typedef signed long long INT64;
#else
typedef UINT8 UINT64[8];
typedef UINT8 UINT64[8];
#endif
#define UINT8_MAX (0xffUL)
@ -220,12 +233,12 @@ typedef signed int INT;
#define __WLAN_ATTRIB_PACK__ __attribute__ ((packed))
#define __WLAN_PRAGMA_PACK1__
#define __WLAN_PRAGMA_PACKDFLT__
#define __WLAN_INLINE__ inline
#define __WLAN_INLINE__ inline
#elif (WLAN_COMPILER == WLAN_DIAB)
#define __WLAN_ATTRIB_PACK__
#define __WLAN_ATTRIB_PACK__
#define __WLAN_PRAGMA_PACK1__ #pragma pack
#define __WLAN_PRAGMA_PACKDFLT__ #pragma pack()
#define __WLAN_INLINE__ inline
#define __WLAN_INLINE__ inline
#else
#error "Unknown compiler"
#endif
@ -256,9 +269,11 @@ typedef signed int INT;
#if defined(WLAN_INCLUDE_DEBUG)
#define WLAN_ASSERT(c) if ((!(c)) && wlan_debug >= 1) { \
WLAN_LOG_DEBUG0(1, "Assertion failure!\n"); }
#define WLAN_HEX_DUMP( l, s, p, n) if( wlan_debug >= (l) ){ int i; \
#define WLAN_HEX_DUMP( l, s, p, n) if( wlan_debug >= (l) ){ \
int __i__; \
printk(KERN_DEBUG s ":"); \
for( i=0; i < (n); i++) printk( " %02x", ((UINT8*)(p))[i]); \
for( __i__=0; __i__ < (n); __i__++) \
printk( " %02x", ((UINT8*)(p))[__i__]); \
printk("\n"); }
#define DBFENTER { if ( wlan_debug >= 4 ){ WLAN_LOG_DEBUG0(3,"Enter\n"); } }
@ -275,6 +290,7 @@ typedef signed int INT;
#define WLAN_LOG_DEBUG2(l, s,n1,n2) if ( wlan_debug >= (l)) printk(KERN_DEBUG __FUNCTION__": " s, (n1), (n2));
#define WLAN_LOG_DEBUG3(l, s,n1,n2,n3) if ( wlan_debug >= (l)) printk(KERN_DEBUG __FUNCTION__": " s, (n1), (n2), (n3));
#define WLAN_LOG_DEBUG4(l, s,n1,n2,n3,n4) if ( wlan_debug >= (l)) printk(KERN_DEBUG __FUNCTION__": " s, (n1), (n2), (n3), (n4));
#define WLAN_LOG_DEBUG5(l, s,n1,n2,n3,n4,n5) if ( wlan_debug >= (l)) printk(KERN_DEBUG __FUNCTION__": " s, (n1), (n2), (n3), (n4), (n5));
#else
#define WLAN_ASSERT(c)
#define WLAN_HEX_DUMP( l, s, p, n)
@ -293,6 +309,7 @@ typedef signed int INT;
#define WLAN_LOG_DEBUG2(l, s,n1,n2)
#define WLAN_LOG_DEBUG3(l, s,n1,n2,n3)
#define WLAN_LOG_DEBUG4(l, s,n1,n2,n3,n4)
#define WLAN_LOG_DEBUG5(l, s,n1,n2,n3,n4,n5)
#endif
#elif (WLAN_OS == WLAN_LWOS)
#define KERN_ERR
@ -323,9 +340,11 @@ typedef signed int INT;
#if defined(WLAN_INCLUDE_DEBUG)
#define WLAN_ASSERT(c) if ((!(c)) && wlan_debug >= 1) \
{WLAN_LOG_DEBUG0(1, "Assertion failure!\n");}
#define WLAN_HEX_DUMP( l, s, p, n) if( wlan_debug >= (l) ){ int i; \
#define WLAN_HEX_DUMP( l, s, p, n) if( wlan_debug >= (l) ){ \
int __i__; \
kprintf(KERN_DEBUG s ":"); \
for( i=0; i < (n); i++) kprintf( " %02x", ((UINT8*)(p))[i]); \
for( __i__=0; __i__ < (n); __i__++) \
kprintf( " %02x", ((UINT8*)(p))[__i__]); \
kprintf("\n"); }
#define DBFENTER { if ( wlan_debug >= 4 ){ WLAN_LOG_DEBUG0(3,"Enter\n"); } }
@ -342,6 +361,7 @@ typedef signed int INT;
#define WLAN_LOG_DEBUG2(l, s,n1,n2) if ( wlan_debug >= (l)) kprintf(KERN_DEBUG __FUNCTION__": " s, (n1), (n2));
#define WLAN_LOG_DEBUG3(l, s,n1,n2,n3) if ( wlan_debug >= (l)) kprintf(KERN_DEBUG __FUNCTION__": " s, (n1), (n2), (n3));
#define WLAN_LOG_DEBUG4(l, s,n1,n2,n3,n4) if ( wlan_debug >= (l)) kprintf(KERN_DEBUG __FUNCTION__": " s, (n1), (n2), (n3), (n4));
#define WLAN_LOG_DEBUG5(l, s,n1,n2,n3,n4,n5) if ( wlan_debug >= (l)) kprintf(KERN_DEBUG __FUNCTION__": " s, (n1), (n2), (n3), (n4), (n5));
#else
#define WLAN_ASSERT(c)
#define WLAN_HEX_DUMP( l, s, p, n)
@ -360,6 +380,7 @@ typedef signed int INT;
#define WLAN_LOG_DEBUG2(l, s,n1,n2)
#define WLAN_LOG_DEBUG3(l, s,n1,n2,n3)
#define WLAN_LOG_DEBUG4(l, s,n1,n2,n3,n4)
#define WLAN_LOG_DEBUG5(l, s,n1,n2,n3,n4,n5)
#endif
#else
#define WLAN_LOG_ERROR0(s)
@ -397,28 +418,38 @@ typedef signed int INT;
#define WLAN_LOG_DEBUG2(l, s,n1,n2)
#define WLAN_LOG_DEBUG3(l, s,n1,n2,n3)
#define WLAN_LOG_DEBUG4(l, s,n1,n2,n3,n4)
#define WLAN_LOG_DEBUG5(l, s,n1,n2,n3,n4,n5)
#endif
#if (WLAN_OS == WLAN_LINUX_KERNEL)
#define wlan_ticks_per_sec HZ
#define wlan_ms_per_tick (1000UL / (wlan_ticks_per_sec))
#define wlan_ms_to_ticks(n) ( (n) / (wlan_ms_per_tick))
#define wlan_tu2ticks(n) ( (n) / (wlan_ms_per_tick))
#define WLAN_INT_DISABLE(n) { save_flags((n)); cli(); }
#define WLAN_INT_ENABLE(n) { sti(); restore_flags((n)); }
#define am930shim_pballoc_p80211( pb, len) am930llc_pballoc_p80211((pb),(len))
#define am930shim_pballoc am930llc_pballoc
#define am930shim_pbfree am930llc_pbfree
#define am930shim_malloc(l,d) kmalloc((l), (d))
#define am930shim_free(p,l) kfree_s((p), (l))
#define am930shim_rxframe(o,p) am930llc_rxframe((o), (p))
#define am930shim_ontxcomplete(o,r) am930llc_ontxcomplete((o), (r))
#elif (WLAN_OS == WLAN_LWOS)
#define atomic_t UINT32
#define jiffies (sNumTicks)
#define atomic_t UINT32
#define jiffies (sNumTicks)
#define wlan_ticks_per_sec ((kTicksPerTenth) * 10UL)
#define HZ (wlan_ticks_per_sec)
#define HZ (wlan_ticks_per_sec)
#define wlan_ms_per_tick (1000UL / (wlan_ticks_per_sec))
#define wlan_ms_to_ticks(n) ( (n) / (wlan_ms_per_tick))
#define udelay(n) { int i, j=0; for( i = (n)*10; i > 0; i--) j++; }
#define wlan_tu2ticks(n) ( (n) / (wlan_ms_per_tick))
#define udelay(n) { int i, j=0; for( i = (n)*10; i > 0; i--) j++; }
#define outb_p(v, a) (*((UINT8*)(a))) = (v);
#define outb(v, a) (*((UINT8*)(a))) = (v);
#define inb_p(a) (*((UINT8*)(a)))
#define inb(a) (*((UINT8*)(a)))
#define readb(a) (*((UINT8*)(a)))
#define outb(v, a) (*((UINT8*)(a))) = (v);
#define inb_p(a) (*((UINT8*)(a)))
#define inb(a) (*((UINT8*)(a)))
#define readb(a) (*((UINT8*)(a)))
#define writeb(byte, dest) ((*((UINT8*)(dest))) = ((UINT8)(byte)))
#define test_and_set_bit(b, p) \
(((*(UINT32*)(p)) & ((BIT0) << (b))) ? \
@ -427,12 +458,30 @@ typedef signed int INT;
#define kmalloc(l,d) malloc((l))
#define kfree_s(p,l) free((p))
#define GFP_KERNEL 0
#define GFP_ATOMIC 0
#define GFP_KERNEL 0
#define GFP_ATOMIC 0
#define WLAN_INT_DISABLE(n) { IntDisable(&(n)); }
#define WLAN_INT_ENABLE(n) { IntRestore(&(n)); }
#define spin_lock_irqsave(a,b) WLAN_INT_DISABLE((b));
#define spin_unlock_irqrestore(a,b) WLAN_INT_ENABLE((b));
#define am930shim_pballoc_p80211( pb, len) am930lw_pballoc_p80211((pb),(len))
#define am930shim_pballoc am930lw_pballoc
#define am930shim_pbfree am930lw_pbfree
#define am930shim_malloc(l,d) am930lw_bufalloc((l))
#define am930shim_free(p,l) am930lw_buffree((p), (l))
#define am930shim_rxframe(o,p) am930lw_rxframe((o), (p))
#define am930shim_ontxcomplete(o,r) am930lw_ontxcomplete((o), (r))
#define SPIN_LOCK_UNLOCKED 0
typedef UINT32 spinlock_t;
#define time_after(a,b) ((UINT32)(b) - (UINT32)(a) < 0)
#define time_before(a,b) time_after(b,a)
#define time_after_eq(a,b) ((UINT32)(a) - (UINT32)(b) >= 0)
#define time_before_eq(a,b) time_after_eq(b,a)
#endif
#define wlan_minutes2ticks(a) ((a)*(wlan_ticks_per_sec * 60))
#define wlan_seconds2ticks(a) ((a)*(wlan_ticks_per_sec))
/*=============================================================*/
/*------ Hardware Portability Macros --------------------------*/
/*=============================================================*/
@ -461,8 +510,13 @@ typedef signed int INT;
((((UINT32)(n)) & ((UINT32)0x00ff0000UL)) >> 8 ) | \
((((UINT32)(n)) & ((UINT32)0xff000000UL)) >> 24 ) ))
#define htons(n) (n)
#define ntohs(n) (n)
#ifndef htons
#define htons(n) (n)
#endif
#ifndef ntohs
#define ntohs(n) (n)
#endif
#endif
/*=============================================================*/
@ -472,16 +526,17 @@ typedef signed int INT;
#define wlan_max(a, b) (((a) > (b)) ? (a) : (b))
#define wlan_min(a, b) (((a) < (b)) ? (a) : (b))
/*=============================================================*/
/*--- Variables -----------------------------------------------*/
/*=============================================================*/
/*================================================================*/
/* Extern Declarations */
extern int wlan_debug;
extern int wlan_ethconv; /* What's the default ethconv? */
/*=============================================================*/
/*--- Functions -----------------------------------------------*/
/*=============================================================*/
/*================================================================*/
/* Function Declarations */
#endif /* _WLAN_COMPAT_H */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,12 +1,18 @@
all : wlanctl
all : tstmeta tstmsg
SRCS= ../shared/p80211types.c \
../shared/p80211metamsg.c \
../shared/p80211metamib.c \
wlanctl.c
SHSRCS= ../shared/p80211types.c \
../shared/p80211metamsg.c \
../shared/p80211metamib.c
wlanctl : ../include/wlan/p80211types.h \
../include/wlan/p80211msg.h \
$(SRCS)
cc -I ../include -D__LINUX_WLAN__ -o wlanctl $(SRCS)
tstmeta : ../include/wlan/p80211types.h \
../include/wlan/p80211msg.h \
$(SHSRCS) \
tstmeta.c
cc -I ../include -D__I386__ -D__LINUX_WLAN__ -o tstmeta $(SHSRCS) tstmeta.c
tstmsg : ../include/wlan/p80211types.h \
../include/wlan/p80211msg.h \
$(SHSRCS) \
tstmsg.c
cc -I ../include -D__I386__ -D__LINUX_WLAN__ -o tstmsg $(SHSRCS) tstmsg.c

View File

@ -0,0 +1,2 @@
Programs to test the metadata data structures.

View File

@ -9,116 +9,100 @@
int main(int argc, char **argv)
{
int s, g, i, n, k;
UINT32 flags;
UINT32 nenumargs;
UINT32 ncollargs;
int s, g, i, n, k;
UINT32 flags;
UINT32 nenumargs;
UINT32 ncollargs;
if ( argc > 1 )
k = atoi(argv[1]);
else
k = 1;
if ( argc > 1 )
k = atoi(argv[1]);
else
k = 1;
for ( s=k; s < GETMETASIZE(p80211meta_slist); s++)
{
if ( p80211meta_slist[s] != NULL )
{
for ( g=1; g < GETMETASIZE(p80211meta_slist[s]); g++)
{
if ( p80211meta_slist[s][g] != NULL )
{
for ( i=1; i < GETMETASIZE(p80211meta_slist[s][g]); i++)
{
flags = p80211meta_slist[s][g][i].flags;
printf(" name=%s\n", p80211meta_slist[s][g][i].name);
printf(" did=0x%x\n", p80211meta_slist[s][g][i].did);
printf(" flags value=0x%x\n", flags );
printf(" is required?=0x%x\n", P80211ITEM_ISREQUIRED(flags));
printf(" is request?=0x%x\n", P80211ITEM_ISREQUEST(flags));
printf(" is confirm?=0x%x\n", P80211ITEM_ISCONFIRM(flags));
printf(" min=%lu\n", p80211meta_slist[s][g][i].min);
printf(" max=%lu\n", p80211meta_slist[s][g][i].max);
printf(" maxlen=%lu\n", p80211meta_slist[s][g][i].maxlen);
/******* IF there's an ENUM LIST, print it *********/
if ( P80211DID_TYPE(p80211meta_slist[s][g][i].did) == P80211_TYPE_ENUMINT )
{
printf(" enum list:\n");
nenumargs= p80211meta_slist[s][g][i].enumptr->nitems;
printf(" nenumargs=%lu\n", nenumargs);
for ( n = 0; n < nenumargs; n++)
{
printf(" enum value: %lu\n", p80211meta_slist[s][g][i].enumptr->list[n].val);
printf(" enum name: %s\n", p80211meta_slist[s][g][i].enumptr->list[n].name);
}
}
else
{
if ( p80211meta_slist[s][g][i].enumptr == NULL )
printf(" enum list = NULL\n");
else
printf(" ERROR: type is not ENUMINT, yet enumptr not NULL\n");
}
/******* IF there's a COLLECTION SUB-ITEM LIST, print it *********/
if ( P80211DID_TYPE(p80211meta_slist[s][g][i].did)==P80211_TYPE_COLLECTION)
{
printf(" collection list:\n");
ncollargs = GETMETASIZE(p80211meta_slist[s][g][i].collptr);
printf(" ncollargs=%lu\n", ncollargs);
for ( n = 1; n < ncollargs; n++)
{
flags = p80211meta_slist[s][g][i].collptr[n].flags;
printf(" name: %s\n", p80211meta_slist[s][g][i].collptr[n].name);
printf(" did: 0x%x\n", p80211meta_slist[s][g][i].collptr[n].did);
printf(" flags value=0x%x\n", flags );
printf(" is required?=0x%x\n", P80211ITEM_ISREQUIRED(flags));
printf(" is request?=0x%x\n", P80211ITEM_ISREQUEST(flags));
printf(" is confirm?=0x%x\n", P80211ITEM_ISCONFIRM(flags));
printf(" min=%lu\n", p80211meta_slist[s][g][i].collptr[n].min);
printf(" max=%lu\n", p80211meta_slist[s][g][i].collptr[n].max);
printf(" maxlen=%lu\n", p80211meta_slist[s][g][i].collptr[n].maxlen);
/******* item in COLLECTION SUB-ITEM LIST is an ENUMINT type *********/
if ( P80211DID_TYPE(p80211meta_slist[s][g][i].collptr[n].did) == P80211_TYPE_ENUMINT )
{
printf(" enum list:\n");
nenumargs= p80211meta_slist[s][g][i].collptr[n].enumptr->nitems;
printf(" nenumargs=%lu\n", nenumargs);
for ( k = 0; k < nenumargs; k++)
{
printf(" enum value: %lu\n", p80211meta_slist[s][g][i].collptr[n].enumptr->list[k].val);
printf(" enum name: %s\n", p80211meta_slist[s][g][i].collptr[n].enumptr->list[k].name);
}
}
else
{
if ( p80211meta_slist[s][g][i].collptr[n].enumptr == NULL )
printf(" enum list = NULL\n");
else
printf(" ERROR: type is not ENUMINT, yet enumptr not NULL\n");
}
if ( p80211meta_slist[s][g][i].collptr[n].collptr != NULL )
{
printf(" ERROR: it looks as though you have an embedded\n");
printf(" collection; not expected\n");
}
}
}
}
}
}
}
}
return 0;
for ( s=k; s < GETMETASIZE(p80211meta_slist); s++) {
if ( p80211meta_slist[s] != NULL ) {
for ( g=1; g < GETMETASIZE(p80211meta_slist[s]); g++) {
if ( p80211meta_slist[s][g] != NULL ) {
for ( i=1; i < GETMETASIZE(p80211meta_slist[s][g]); i++) {
flags = p80211meta_slist[s][g][i].flags;
printf(" name=%s\n", p80211meta_slist[s][g][i].name);
printf(" did=0x%x\n", p80211meta_slist[s][g][i].did);
printf(" flags value=0x%x\n", flags );
printf(" is required?=0x%x\n", P80211ITEM_ISREQUIRED(flags));
printf(" is request?=0x%x\n", P80211ITEM_ISREQUEST(flags));
printf(" is confirm?=0x%x\n", P80211ITEM_ISCONFIRM(flags));
printf(" min=%lu\n", p80211meta_slist[s][g][i].min);
printf(" max=%lu\n", p80211meta_slist[s][g][i].max);
printf(" maxlen=%lu\n", p80211meta_slist[s][g][i].maxlen);
/******* IF there's an ENUM LIST, print it *********/
if ( P80211DID_TYPE(p80211meta_slist[s][g][i].did) == P80211_TYPE_ENUMINT ) {
printf(" enum list:\n");
nenumargs= p80211meta_slist[s][g][i].enumptr->nitems;
printf(" nenumargs=%lu\n", nenumargs);
for ( n = 0; n < nenumargs; n++) {
printf(" enum value: %lu\n", p80211meta_slist[s][g][i].enumptr->list[n].val);
printf(" enum name: %s\n", p80211meta_slist[s][g][i].enumptr->list[n].name);
}
} else {
if ( p80211meta_slist[s][g][i].enumptr == NULL )
printf(" enum list = NULL\n");
else
printf(" ERROR: type is not ENUMINT, yet enumptr not NULL\n");
}
/******* IF there's a COLLECTION SUB-ITEM LIST, print it *********/
if ( P80211DID_TYPE(p80211meta_slist[s][g][i].did)==P80211_TYPE_COLLECTION) {
printf(" collection list:\n");
ncollargs = GETMETASIZE(p80211meta_slist[s][g][i].collptr);
printf(" ncollargs=%lu\n", ncollargs);
for ( n = 1; n < ncollargs; n++) {
flags = p80211meta_slist[s][g][i].collptr[n].flags;
printf(" name: %s\n", p80211meta_slist[s][g][i].collptr[n].name);
printf(" did: 0x%x\n", p80211meta_slist[s][g][i].collptr[n].did);
printf(" flags value=0x%x\n", flags );
printf(" is required?=0x%x\n", P80211ITEM_ISREQUIRED(flags));
printf(" is request?=0x%x\n", P80211ITEM_ISREQUEST(flags));
printf(" is confirm?=0x%x\n", P80211ITEM_ISCONFIRM(flags));
printf(" min=%lu\n", p80211meta_slist[s][g][i].collptr[n].min);
printf(" max=%lu\n", p80211meta_slist[s][g][i].collptr[n].max);
printf(" maxlen=%lu\n", p80211meta_slist[s][g][i].collptr[n].maxlen);
/******* item in COLLECTION SUB-ITEM LIST is an ENUMINT type *********/
if ( P80211DID_TYPE(p80211meta_slist[s][g][i].collptr[n].did) == P80211_TYPE_ENUMINT ) {
printf(" enum list:\n");
nenumargs= p80211meta_slist[s][g][i].collptr[n].enumptr->nitems;
printf(" nenumargs=%lu\n", nenumargs);
for ( k = 0; k < nenumargs; k++) {
printf(" enum value: %lu\n", p80211meta_slist[s][g][i].collptr[n].enumptr->list[k].val);
printf(" enum name: %s\n", p80211meta_slist[s][g][i].collptr[n].enumptr->list[k].name);
}
} else {
if ( p80211meta_slist[s][g][i].collptr[n].enumptr == NULL )
printf(" enum list = NULL\n");
else
printf(" ERROR: type is not ENUMINT, yet enumptr not NULL\n");
}
if ( p80211meta_slist[s][g][i].collptr[n].collptr != NULL ) {
printf(" ERROR: it looks as though you have an embedded\n");
printf(" collection; not expected\n");
}
}
}
}
}
}
}
}
return 0;
}

View File

@ -7,125 +7,107 @@
#include <wlan/p80211types.h>
#include <wlan/p80211msg.h>
void usage()
{
}
int main(int argc, char **argv)
{
int s, g, i, n, k;
UINT32 offset;
UINT32 nenumargs;
UINT32 ncollargs;
int s, g, i, n, k;
UINT32 nenumargs;
UINT32 ncollargs;
if ( argc > 3 )
{
k = argc;
}
else
{
usgae();
return 0;
}
if ( argc > 3 ) {
k = argc;
} else {
usage();
return 0;
}
for ( s=2; s < k; s++)
{
if ( p80211meta_slist[s] != NULL )
{
for ( g=1; g < GETMETASIZE(p80211meta_slist[s]); g++)
{
if ( p80211meta_slist[s][g] != NULL )
{
for ( i=1; i < GETMETASIZE(p80211meta_slist[s][g]); i++)
{
offset = p80211meta_slist[s][g][i].msgoffset;
printf(" name=%s\n", p80211meta_slist[s][g][i].name);
printf(" did=0x%x\n", p80211meta_slist[s][g][i].did);
printf(" msgoffset value=0x%x\n", offset );
printf(" is required?=0x%x\n", P80211ITEM_ISREQUIRED(offset));
printf(" is request?=0x%x\n", P80211ITEM_ISREQUEST(offset));
printf(" is confirm?=0x%x\n", P80211ITEM_ISCONFIRM(offset));
printf(" actual offset=%lu\n", P80211ITEM_GET_OFFSET(offset));
printf(" min=%lu\n", p80211meta_slist[s][g][i].min);
printf(" max=%lu\n", p80211meta_slist[s][g][i].max);
printf(" maxlen=%lu\n", p80211meta_slist[s][g][i].maxlen);
/******* IF there's an ENUM LIST, print it *********/
if ( P80211DID_TYPE(p80211meta_slist[s][g][i].did) == P80211_TYPE_ENUMINT )
{
printf(" enum list:\n");
nenumargs= p80211meta_slist[s][g][i].enumptr->nitems;
printf(" nenumargs=%lu\n", nenumargs);
for ( n = 0; n < nenumargs; n++)
{
printf(" enum value: %lu\n", p80211meta_slist[s][g][i].enumptr->list[n].val);
printf(" enum name: %s\n", p80211meta_slist[s][g][i].enumptr->list[n].name);
}
}
else
{
if ( p80211meta_slist[s][g][i].enumptr == NULL )
printf(" enum list = NULL\n");
else
printf(" ERROR: type is not ENUMINT, yet enumptr not NULL\n");
}
/******* IF there's a COLLECTION SUB-ITEM LIST, print it *********/
if ( P80211DID_TYPE(p80211meta_slist[s][g][i].did)==P80211_TYPE_COLLECTION)
{
printf(" collection list:\n");
ncollargs = GETMETASIZE(p80211meta_slist[s][g][i].collptr);
printf(" ncollargs=%lu\n", ncollargs);
for ( n = 1; n < ncollargs; n++)
{
offset = p80211meta_slist[s][g][i].collptr[n].msgoffset;
printf(" name: %s\n", p80211meta_slist[s][g][i].collptr[n].name);
printf(" did: 0x%x\n", p80211meta_slist[s][g][i].collptr[n].did);
printf(" msgoffset value=0x%x\n", offset );
printf(" is required?=0x%x\n", P80211ITEM_ISREQUIRED(offset));
printf(" is request?=0x%x\n", P80211ITEM_ISREQUEST(offset));
printf(" is confirm?=0x%x\n", P80211ITEM_ISCONFIRM(offset));
printf(" actual offset=%lu\n", P80211ITEM_GET_OFFSET(offset));
printf(" min=%lu\n", p80211meta_slist[s][g][i].collptr[n].min);
printf(" max=%lu\n", p80211meta_slist[s][g][i].collptr[n].max);
printf(" maxlen=%lu\n", p80211meta_slist[s][g][i].collptr[n].maxlen);
/******* item in COLLECTION SUB-ITEM LIST is an ENUMINT type *********/
if ( P80211DID_TYPE(p80211meta_slist[s][g][i].collptr[n].did) == P80211_TYPE_ENUMINT )
{
printf(" enum list:\n");
nenumargs= p80211meta_slist[s][g][i].collptr[n].enumptr->nitems;
printf(" nenumargs=%lu\n", nenumargs);
for ( k = 0; k < nenumargs; k++)
{
printf(" enum value: %lu\n", p80211meta_slist[s][g][i].collptr[n].enumptr->list[k].val);
printf(" enum name: %s\n", p80211meta_slist[s][g][i].collptr[n].enumptr->list[k].name);
}
}
else
{
if ( p80211meta_slist[s][g][i].collptr[n].enumptr == NULL )
printf(" enum list = NULL\n");
else
printf(" ERROR: type is not ENUMINT, yet enumptr not NULL\n");
}
if ( p80211meta_slist[s][g][i].collptr[n].collptr != NULL )
{
printf(" ERROR: it looks as though you have an embedded\n");
printf(" collection; not expected\n");
}
}
}
}
}
}
}
}
return 0;
for ( s=2; s < k; s++) {
if ( p80211meta_slist[s] != NULL ) {
for ( g=1; g < GETMETASIZE(p80211meta_slist[s]); g++) {
if ( p80211meta_slist[s][g] != NULL ) {
for ( i=1; i < GETMETASIZE(p80211meta_slist[s][g]); i++) {
printf(" name=%s\n", p80211meta_slist[s][g][i].name);
printf(" did=0x%x\n", p80211meta_slist[s][g][i].did);
/* printf(" is required?=0x%x\n", P80211ITEM_ISREQUIRED(offset));
printf(" is request?=0x%x\n", P80211ITEM_ISREQUEST(offset));
printf(" is confirm?=0x%x\n", P80211ITEM_ISCONFIRM(offset));
printf(" actual offset=%lu\n", P80211ITEM_GET_OFFSET(offset)); */
printf(" min=%lu\n", p80211meta_slist[s][g][i].min);
printf(" max=%lu\n", p80211meta_slist[s][g][i].max);
printf(" maxlen=%lu\n", p80211meta_slist[s][g][i].maxlen);
/******* IF there's an ENUM LIST, print it *********/
if ( P80211DID_TYPE(p80211meta_slist[s][g][i].did) == P80211_TYPE_ENUMINT ) {
printf(" enum list:\n");
nenumargs= p80211meta_slist[s][g][i].enumptr->nitems;
printf(" nenumargs=%lu\n", nenumargs);
for ( n = 0; n < nenumargs; n++) {
printf(" enum value: %lu\n", p80211meta_slist[s][g][i].enumptr->list[n].val);
printf(" enum name: %s\n", p80211meta_slist[s][g][i].enumptr->list[n].name);
}
} else {
if ( p80211meta_slist[s][g][i].enumptr == NULL )
printf(" enum list = NULL\n");
else
printf(" ERROR: type is not ENUMINT, yet enumptr not NULL\n");
}
/******* IF there's a COLLECTION SUB-ITEM LIST, print it *********/
if ( P80211DID_TYPE(p80211meta_slist[s][g][i].did)==P80211_TYPE_COLLECTION) {
printf(" collection list:\n");
ncollargs = GETMETASIZE(p80211meta_slist[s][g][i].collptr);
printf(" ncollargs=%lu\n", ncollargs);
for ( n = 1; n < ncollargs; n++) {
/* offset = p80211meta_slist[s][g][i].collptr[n].msgoffset; */
printf(" name: %s\n", p80211meta_slist[s][g][i].collptr[n].name);
printf(" did: 0x%x\n", p80211meta_slist[s][g][i].collptr[n].did);
/* printf(" msgoffset value=0x%x\n", offset ); */
/* printf(" is required?=0x%x\n", P80211ITEM_ISREQUIRED(offset)); */
/* printf(" is request?=0x%x\n", P80211ITEM_ISREQUEST(offset)); */
/* printf(" is confirm?=0x%x\n", P80211ITEM_ISCONFIRM(offset)); */
/* printf(" actual offset=%lu\n", P80211ITEM_GET_OFFSET(offset)); */
printf(" min=%lu\n", p80211meta_slist[s][g][i].collptr[n].min);
printf(" max=%lu\n", p80211meta_slist[s][g][i].collptr[n].max);
printf(" maxlen=%lu\n", p80211meta_slist[s][g][i].collptr[n].maxlen);
/******* item in COLLECTION SUB-ITEM LIST is an ENUMINT type *********/
if ( P80211DID_TYPE(p80211meta_slist[s][g][i].collptr[n].did) == P80211_TYPE_ENUMINT ) {
printf(" enum list:\n");
nenumargs= p80211meta_slist[s][g][i].collptr[n].enumptr->nitems;
printf(" nenumargs=%lu\n", nenumargs);
for ( k = 0; k < nenumargs; k++) {
printf(" enum value: %lu\n", p80211meta_slist[s][g][i].collptr[n].enumptr->list[k].val);
printf(" enum name: %s\n", p80211meta_slist[s][g][i].collptr[n].enumptr->list[k].name);
}
} else {
if ( p80211meta_slist[s][g][i].collptr[n].enumptr == NULL )
printf(" enum list = NULL\n");
else
printf(" ERROR: type is not ENUMINT, yet enumptr not NULL\n");
}
if ( p80211meta_slist[s][g][i].collptr[n].collptr != NULL ) {
printf(" ERROR: it looks as though you have an embedded\n");
printf(" collection; not expected\n");
}
}
}
}
}
}
}
}
return 0;
}

View File

@ -1,19 +1,58 @@
# makefile for the PRISM/AMD79C930 configuration utility
# Makefile: build script for wlanctl
# --------------------------------------------------------------------
#
# 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/
#
# 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
#
# --------------------------------------------------------------------
#
# --------------------------------------------------------------------
#
include ../../config.mk
ifndef CFLAGS
CFLAGS = -O2 -Wall -Wstrict-prototypes -Winline -pipe -D__LINUX_WLAN__
CFLAGS = -g -O2 -Wall -Wstrict-prototypes -Winline -pipe \
-D__LINUX_WLAN__ -D__I386__
endif
CPPFLAGS = -I../include -I$(LINUX)/include
SRCS = main.c prmib.c
SRCS = wlanctl.c \
help.c \
../shared/p80211types.c \
../shared/p80211metamsg.c \
../shared/p80211metamib.c
OBJS = wlanctl.o \
help.o \
../shared/p80211types.o \
../shared/p80211metamsg.o \
../shared/p80211metamib.o
wlanctl: main.o prmib.o
cc -o wlanctl main.o prmib.o
wlanctl: $(OBJS)
cc -o wlanctl $(OBJS)
install:
cp -p wlanctl $(INST_EXEDIR)

View File

@ -43,6 +43,7 @@
#include <wlan/version.h>
#include <wlan/p80211types.h>
#include <wlan/p80211msg.h>
#include "wlanctl.h"
/*================================================================*/
/* Local Constants */
@ -66,7 +67,6 @@
INT cmdline2requestmsg( UINT8 *msg, UINT32 cmdcode, int argc, char **argv );
void printmsg( UINT8 *msg, UINT32 cmdcode );
void sim_ioctl( UINT8 *msg, UINT32 cmdcode );
void usage(void);
/*================================================================*/
/* Function Definitions */
@ -89,13 +89,13 @@ int main ( int argc, char **argv )
{
UINT8 message[4000];
UINT32 cmdcode;
INT result;
INT result = 0;
if ( argc < 4 && argc > 2 && strcmp( argv[1], "version") == 0) {
if ( argc < 4 && argc >= 2 && strcmp( argv[1], "version") == 0) {
printf("wlanctl: %s\n", WLAN_RELEASE);
}
if ( argc < 4 && argc > 2 && strcmp( argv[1], "commands") == 0) {
print_allcommands();
else if ( argc < 4 && argc >= 2 && strcmp( argv[1], "commands") == 0) {
print_allrequests();
}
else if ( argc < 4 ) {
usage();
@ -105,9 +105,10 @@ int main ( int argc, char **argv )
if (cmdcode != P80211ENUM_BAD) { /* cmdcode valid */
result = cmdline2requestmsg( message, cmdcode, argc, argv );
if ( result == 0 ) {
printmsg( message, cmdcode );
sim_ioctl( message, cmdcode );
sim_ioctl( message, cmdcode );
printmsg( message, cmdcode );
} else {
printf("Message was unable to be created\n");
@ -123,12 +124,16 @@ int main ( int argc, char **argv )
/*----------------------------------------------------------------
* buildmsg
* cmdline2requestmsg
*
* TODO: describe
* Default command line to request message converter. Takes the
* command (request) code and the cmdline arguments, compares them
* to the metadata for the request arguments for the given request
* and if all required arguments are present and valid, builds a
* message structure. This function handles the general case.
*
* Arguments:
* msg buffer to build msg in
* msg buffer to build msg in (assumed to be at least 4000 bytes)
* cmdcode integer identifying the command msg we're building
* argc number of command line arguments
* argv array of argument strings
@ -151,6 +156,7 @@ INT cmdline2requestmsg( UINT8 *msg, UINT32 cmdcode, int argc, char **argv )
UINT32 tmpdid;
size_t itemlen;
size_t offset;
UINT32 mibitemdid = 0;
/* Create an array of bytes where each byte represents a flag for
each command line argument. For each argument on the command line
@ -209,23 +215,39 @@ INT cmdline2requestmsg( UINT8 *msg, UINT32 cmdcode, int argc, char **argv )
if ( strncmp(alist[i].name,argv[j],
strlen(alist[i].name)) == 0 ) {
found = 1;
cmdlinelist[j] = (UINT8)1;
if ( P80211ITEM_ISREQUEST(alist[i].flags) ) {
found = 1;
cmdlinelist[j] = (UINT8)1;
(*(alist[i].fromtextptr))
(tmpdid, tmpitem, argv[j]);
/* trick to help fromtext_mibcollection, */
/* it's a nop for others */
*((UINT32*)tmpitem) = mibitemdid;
if ( !(*(alist[i].validfunptr))(tmpdid, tmpitem) ) {
printf("invalid value entered for %s\n",
alist[i].name);
(*(alist[i].fromtextptr))
(tmpdid, tmpitem, argv[j]);
if ( !(*(alist[i].validfunptr))(tmpdid, tmpitem) ) {
printf("invalid value entered for %s\n",
alist[i].name);
free( cmdlinelist );
return 1;
}
if ( strncmp(argv[j],"mibattribute", strlen("mibattribute")) == 0 ) {
mibitemdid =
((p80211item_uint32_t*)tmpitem)->data;
}
itemlen = sizeof(p80211item_t) +
p80211item_maxdatalen(tmpdid);
memcpy(msgptr, tmpitem, itemlen);
} else {
printf("non-request argument found on cmdline.\n");
free( cmdlinelist );
return 1;
}
itemlen = sizeof(p80211item_t) +
p80211item_maxdatalen(tmpdid);
memcpy(msgptr, tmpitem, itemlen);
} /* if cmdline match */
} /* for each cmdline arg */
@ -251,7 +273,7 @@ INT cmdline2requestmsg( UINT8 *msg, UINT32 cmdcode, int argc, char **argv )
for ( j = 3; j < argc; j++) {
if ( !(cmdlinelist[j]) ) {
printf("\'%s\' entered on the command line "
"was either an invalid\n",
"was either an invalid\n"
"argument to the cmd \'%s\' or an extra "
"occurence of a valid argument.\n",
argv[j], argv[2]);
@ -268,7 +290,7 @@ INT cmdline2requestmsg( UINT8 *msg, UINT32 cmdcode, int argc, char **argv )
/*----------------------------------------------------------------
* printmsg
*
* TODO: describe
* Traverse the message items printing each.
*
* Arguments:
* msg buffer containing a complete msg
@ -284,9 +306,7 @@ void printmsg( UINT8 *msg, UINT32 cmdcode )
UINT8 *msgptr;
UINT8 *start;
INT i;
INT j;
UINT32 narg;
UINT32 nsub;
UINT32 offset;
UINT32 tmpdid;
p80211meta_t *alist;
@ -313,8 +333,8 @@ void printmsg( UINT8 *msg, UINT32 cmdcode )
offset =p80211item_getoffset(tmpdid);
msgptr = start + offset;
/* pass tmpdid since the 'totext' functions expect a non-zero
/* did */
/* pass tmpdid since the 'totext' functions */
/* expect a non-zero did */
(*(alist[i].totextptr))( tmpdid, msgptr, tmpitem);
printf("\t%s\n", tmpitem);
@ -397,6 +417,7 @@ void sim_ioctl( UINT8 *msg, UINT32 cmdcode )
*((UINT32 *)(((p80211itemd_t *)msgptr)->data)) = 2UL;
break;
case P80211_TYPE_COLLECTION:
#ifdef bob
/* acquire the collection sub-item argument metadata list */
clist = alist[i].collptr;
nsub = GETMETASIZE(clist);
@ -446,6 +467,7 @@ void sim_ioctl( UINT8 *msg, UINT32 cmdcode )
}
}
}
#endif
break;
case P80211_TYPE_MIBITEM:
break;
@ -457,27 +479,3 @@ void sim_ioctl( UINT8 *msg, UINT32 cmdcode )
return;
}
/*----------------------------------------------------------------
* usage
*
* Print a short usage message
*
* Arguments:
* none
*
* Returns:
* nothing
----------------------------------------------------------------*/
void usage(void)
{
printf("wlanctl: - control utility for 802.11 devices\n");
printf(" usage: wlanctl interface|version|commands cmd cmdarg [cmdarg...]\n\n");
printf(" where \"interface\" is the name of a wireless\n");
printf(" network interface. Running \'ifconfig\' will list\n");
printf(" all network interfaces.\n\n");
printf(" Refer to the wlanctl man page or run \n");
printf(" \'wlanctl commands\' for more details\n\n");
}

64
src/wlanctl/wlanctl.h Normal file
View File

@ -0,0 +1,64 @@
/* wlanctl.h: Shared declarations for the wlanctl utility
* --------------------------------------------------------------------
*
* 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/
*
* 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 _WLANCTL_H
#define _WLANCTL_H
/*================================================================*/
/* System Includes */
/*================================================================*/
/* Project Includes */
/*================================================================*/
/* Constants */
/*================================================================*/
/* Macros */
/*================================================================*/
/* Types */
/*================================================================*/
/* Extern Declarations */
/*================================================================*/
/* Function Declarations */
void usage(void); /* help.c */
void print_allrequests(void); /* help.c */
#endif /* _WLANCTL_H */