]> pilppa.org Git - linux-2.6-omap-h63xx.git/blob - drivers/staging/wlan-ng/p80211meta.h
Staging: wlan-ng: Remove stray comments in header files
[linux-2.6-omap-h63xx.git] / drivers / staging / wlan-ng / p80211meta.h
1 /* p80211meta.h
2 *
3 * Macros, constants, types, and funcs for p80211 metadata
4 *
5 * Copyright (C) 1999 AbsoluteValue Systems, Inc.  All Rights Reserved.
6 * --------------------------------------------------------------------
7 *
8 * linux-wlan
9 *
10 *   The contents of this file are subject to the Mozilla Public
11 *   License Version 1.1 (the "License"); you may not use this file
12 *   except in compliance with the License. You may obtain a copy of
13 *   the License at http://www.mozilla.org/MPL/
14 *
15 *   Software distributed under the License is distributed on an "AS
16 *   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
17 *   implied. See the License for the specific language governing
18 *   rights and limitations under the License.
19 *
20 *   Alternatively, the contents of this file may be used under the
21 *   terms of the GNU Public License version 2 (the "GPL"), in which
22 *   case the provisions of the GPL are applicable instead of the
23 *   above.  If you wish to allow the use of your version of this file
24 *   only under the terms of the GPL and not to allow others to use
25 *   your version of this file under the MPL, indicate your decision
26 *   by deleting the provisions above and replace them with the notice
27 *   and other provisions required by the GPL.  If you do not delete
28 *   the provisions above, a recipient may use your version of this
29 *   file under either the MPL or the GPL.
30 *
31 * --------------------------------------------------------------------
32 *
33 * Inquiries regarding the linux-wlan Open Source project can be
34 * made directly to:
35 *
36 * AbsoluteValue Systems Inc.
37 * info@linux-wlan.com
38 * http://www.linux-wlan.com
39 *
40 * --------------------------------------------------------------------
41 *
42 * Portions of the development of this software were funded by
43 * Intersil Corporation as part of PRISM(R) chipset product development.
44 *
45 * --------------------------------------------------------------------
46 *
47 * This file declares some of the constants and types used in various
48 * parts of the linux-wlan system.
49 *
50 * Notes:
51 *   - Constant values are always in HOST byte order.
52 *
53 * All functions and statics declared here are implemented in p80211types.c
54 *   --------------------------------------------------------------------
55 */
56
57 #ifndef _P80211META_H
58 #define _P80211META_H
59
60 /*================================================================*/
61 /* Project Includes */
62
63 #ifndef _WLAN_COMPAT_H
64 #include "wlan_compat.h"
65 #endif
66
67 /*================================================================*/
68 /* Macros */
69
70 /*----------------------------------------------------------------*/
71 /* The following macros are used to ensure consistent naming */
72 /*  conventions for all the different metadata lists. */
73
74 #define MKREQMETANAME(name)             p80211meta_ ## req ## _ ## name
75 #define MKINDMETANAME(name)             p80211meta_ ## ind ## _ ## name
76 #define MKMIBMETANAME(name)             p80211meta_ ## mib ## _ ## name
77 #define MKGRPMETANAME(name)             p80211meta_ ## grp ## _ ## name
78
79 #define MKREQMETASIZE(name)             p80211meta_ ## req ## _ ## name ## _ ## size
80 #define MKINDMETASIZE(name)             p80211meta_ ## ind ## _ ## name ## _ ## size
81 #define MKMIBMETASIZE(name)             p80211meta_ ## mib ## _ ## name ## _ ## size
82 #define MKGRPMETASIZE(name)             p80211meta_ ## grp ## _ ## name ## _ ## size
83
84 #define GETMETASIZE(aptr)               (**((u32**)(aptr)))
85
86 /*----------------------------------------------------------------*/
87 /* The following ifdef depends on the following defines: */
88 /*  P80211_NOINCLUDESTRINGS - if defined, all metadata name fields */
89 /*                               are empty strings */
90
91 #ifdef P80211_NOINCLUDESTRINGS
92         #define MKITEMNAME(s)   ("")
93 #else
94         #define MKITEMNAME(s)   (s)
95 #endif
96
97 /*================================================================*/
98 /* Types */
99
100 /*----------------------------------------------------------------*/
101 /* The following structure types are used for the metadata */
102 /* representation of category list metadata, group list metadata, */
103 /* and data item metadata for both Mib and Messages. */
104
105 typedef struct p80211meta
106 {
107         char                    *name;          /* data item name */
108         u32                     did;            /* partial did */
109         u32                     flags;          /* set of various flag bits */
110         u32                     min;            /* min value of a BOUNDEDint */
111         u32                     max;            /* max value of a BOUNDEDint */
112
113         u32                     maxlen;         /* maxlen of a OCTETSTR or DISPLAYSTR */
114         u32                     minlen;         /* minlen of a OCTETSTR or DISPLAYSTR */
115         p80211enum_t            *enumptr;       /* ptr to the enum type for ENUMint */
116         p80211_totext_t         totextptr;      /* ptr to totext conversion function */
117         p80211_fromtext_t       fromtextptr;    /* ptr to totext conversion function */
118         p80211_valid_t          validfunptr;    /* ptr to totext conversion function */
119 } p80211meta_t;
120
121 typedef struct grplistitem
122 {
123         char            *name;
124         p80211meta_t    *itemlist;
125 } grplistitem_t;
126
127 typedef struct catlistitem
128 {
129         char            *name;
130         grplistitem_t   *grplist;
131 } catlistitem_t;
132
133 /*================================================================*/
134 /* Function Declarations */
135
136 /*----------------------------------------------------------------*/
137 /* */
138 u32 p80211_text2did(catlistitem_t *catlist, char *catname, char *grpname, char *itemname);
139 u32 p80211_text2catdid(catlistitem_t *list, char *name );
140 u32 p80211_text2grpdid(grplistitem_t *list, char *name );
141 u32 p80211_text2itemdid(p80211meta_t *list, char *name );
142 u32 p80211_isvalid_did( catlistitem_t *catlist, u32 did );
143 u32 p80211_isvalid_catdid( catlistitem_t *catlist, u32 did );
144 u32 p80211_isvalid_grpdid( catlistitem_t *catlist, u32 did );
145 u32 p80211_isvalid_itemdid( catlistitem_t *catlist, u32 did );
146 catlistitem_t *p80211_did2cat( catlistitem_t *catlist, u32 did );
147 grplistitem_t *p80211_did2grp( catlistitem_t *catlist, u32 did );
148 p80211meta_t *p80211_did2item( catlistitem_t *catlist, u32 did );
149 u32 p80211item_maxdatalen( struct catlistitem *metalist, u32 did );
150 u32 p80211_metaname2did(struct catlistitem *metalist, char *itemname);
151 u32 p80211item_getoffset( struct catlistitem *metalist, u32 did );
152 int p80211item_gettype(p80211meta_t *meta);
153
154 #endif /* _P80211META_H */