The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/dev/wi/if_wavelan_ieee.h

Version: -  FREEBSD  -  FREEBSD-13-STABLE  -  FREEBSD-13-0  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  l41  -  OPENBSD  -  linux-2.6  -  MK84  -  PLAN9  -  xnu-8792 
SearchContext: -  none  -  3  -  10 

    1 /*
    2  * Copyright (c) 1997, 1998, 1999
    3  *      Bill Paul <wpaul@ctr.columbia.edu>.  All rights reserved.
    4  *
    5  * Redistribution and use in source and binary forms, with or without
    6  * modification, are permitted provided that the following conditions
    7  * are met:
    8  * 1. Redistributions of source code must retain the above copyright
    9  *    notice, this list of conditions and the following disclaimer.
   10  * 2. Redistributions in binary form must reproduce the above copyright
   11  *    notice, this list of conditions and the following disclaimer in the
   12  *    documentation and/or other materials provided with the distribution.
   13  * 3. All advertising materials mentioning features or use of this software
   14  *    must display the following acknowledgement:
   15  *      This product includes software developed by Bill Paul.
   16  * 4. Neither the name of the author nor the names of any co-contributors
   17  *    may be used to endorse or promote products derived from this software
   18  *    without specific prior written permission.
   19  *
   20  * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
   21  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   22  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
   23  * ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD
   24  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   25  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   26  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
   27  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
   28  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
   29  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
   30  * THE POSSIBILITY OF SUCH DAMAGE.
   31  *
   32  * $FreeBSD: releng/5.0/sys/dev/wi/if_wavelan_ieee.h 105076 2002-10-14 01:59:57Z imp $
   33  */
   34 
   35 #ifndef _IF_WAVELAN_IEEE_H
   36 #define _IF_WAVELAN_IEEE_H
   37 
   38 /*
   39  * This header defines a simple command interface to the FreeBSD
   40  * WaveLAN/IEEE driver (wi) driver, which is used to set certain
   41  * device-specific parameters which can't be easily managed through
   42  * ifconfig(8). No, sysctl(2) is not the answer. I said a _simple_
   43  * interface, didn't I.
   44  */
   45 
   46 #ifndef SIOCSWAVELAN
   47 #define SIOCSWAVELAN    SIOCSIFGENERIC
   48 #endif
   49 
   50 #ifndef SIOCGWAVELAN
   51 #define SIOCGWAVELAN    SIOCGIFGENERIC
   52 #endif
   53 
   54 /*
   55  * Technically I don't think there's a limit to a record
   56  * length. The largest record is the one that contains the CIS
   57  * data, which is 240 words long, so 256 should be a safe
   58  * value.
   59  */
   60 #define WI_MAX_DATALEN  512
   61 
   62 struct wi_req {
   63         u_int16_t       wi_len;
   64         u_int16_t       wi_type;
   65         u_int16_t       wi_val[WI_MAX_DATALEN];
   66 };
   67 
   68 /*
   69  * Private LTV records (interpreted only by the driver). This is
   70  * a minor kludge to allow reading the interface statistics from
   71  * the driver.
   72  */
   73 #define WI_RID_IFACE_STATS      0x0100
   74 #define WI_RID_MGMT_XMIT        0x0200
   75 #define WI_RID_ZERO_CACHE       0x0300
   76 #define WI_RID_READ_CACHE       0x0400
   77 #define WI_RID_FWDOWNLOAD       0x0500
   78 #define WI_RID_MONITOR_MODE     0x0600
   79 #define WI_RID_MIF              0x0700
   80 
   81 
   82 struct wi_80211_hdr {
   83         u_int16_t               frame_ctl;
   84         u_int16_t               dur_id;
   85         u_int8_t                addr1[6];
   86         u_int8_t                addr2[6];
   87         u_int8_t                addr3[6];
   88         u_int16_t               seq_ctl;
   89         u_int8_t                addr4[6];
   90 };
   91 
   92 #define WI_FCTL_VERS            0x0002
   93 #define WI_FCTL_FTYPE           0x000C
   94 #define WI_FCTL_STYPE           0x00F0
   95 #define WI_FCTL_TODS            0x0100
   96 #define WI_FCTL_FROMDS          0x0200
   97 #define WI_FCTL_MOREFRAGS       0x0400
   98 #define WI_FCTL_RETRY           0x0800
   99 #define WI_FCTL_PM              0x1000
  100 #define WI_FCTL_MOREDATA        0x2000
  101 #define WI_FCTL_WEP             0x4000
  102 #define WI_FCTL_ORDER           0x8000
  103 
  104 #define WI_FTYPE_MGMT           0x0000
  105 #define WI_FTYPE_CTL            0x0004
  106 #define WI_FTYPE_DATA           0x0008
  107 
  108 #define WI_STYPE_MGMT_ASREQ     0x0000  /* association request */
  109 #define WI_STYPE_MGMT_ASRESP    0x0010  /* association response */
  110 #define WI_STYPE_MGMT_REASREQ   0x0020  /* reassociation request */
  111 #define WI_STYPE_MGMT_REASRESP  0x0030  /* reassociation response */
  112 #define WI_STYPE_MGMT_PROBEREQ  0x0040  /* probe request */
  113 #define WI_STYPE_MGMT_PROBERESP 0x0050  /* probe response */
  114 #define WI_STYPE_MGMT_BEACON    0x0080  /* beacon */
  115 #define WI_STYPE_MGMT_ATIM      0x0090  /* announcement traffic ind msg */
  116 #define WI_STYPE_MGMT_DISAS     0x00A0  /* disassociation */
  117 #define WI_STYPE_MGMT_AUTH      0x00B0  /* authentication */
  118 #define WI_STYPE_MGMT_DEAUTH    0x00C0  /* deauthentication */
  119 
  120 #define WI_STYPE_CTL_PSPOLL     0x00A0
  121 #define WI_STYPE_CTL_RTS        0x00B0
  122 #define WI_STYPE_CTL_CTS        0x00C0
  123 #define WI_STYPE_CTL_ACK        0x00D0
  124 #define WI_STYPE_CTL_CFEND      0x00E0
  125 #define WI_STYPE_CTL_CFENDACK   0x00F0
  126 
  127 struct wi_mgmt_hdr {
  128         u_int16_t               frame_ctl;
  129         u_int16_t               duration;
  130         u_int8_t                dst_addr[6];
  131         u_int8_t                src_addr[6];
  132         u_int8_t                bssid[6];
  133         u_int16_t               seq_ctl;
  134 };
  135 
  136 /* 
  137  * Lucent/wavelan IEEE signal strength cache
  138  *
  139  * driver keeps cache of last
  140  * MAXWICACHE packets to arrive including signal strength info.
  141  * daemons may read this via ioctl
  142  *
  143  * Each entry in the wi_sigcache has a unique macsrc.
  144  */
  145 struct wi_sigcache {
  146         char    macsrc[6];      /* unique MAC address for entry */
  147         int     ipsrc;          /* ip address associated with packet */
  148         int     signal;         /* signal strength of the packet */
  149         int     noise;          /* noise value */
  150         int     quality;        /* quality of the packet */
  151 };
  152 
  153 /*
  154  * Firmware downloading API.  We support downloading into RAM and into
  155  * flash.  We copy the entire .hex file for both the primary and secondary
  156  * firmware into the kernel, which is minorly gross, but matches the
  157  * format of the compiled in firmware.
  158  */
  159 struct wi_fwdownload {
  160         int     type;           /* What type of download. */
  161 #define WI_FW_RAM       1
  162 #define WI_FW_FLASH     2
  163         size_t  pri_len;        /* Primary firmware length */
  164         size_t  sec_len;        /* Secondary firmware length */
  165         caddr_t pri_data;       /* Pointer (user) to primary data */
  166         caddr_t sec_data;       /* Pointer (user) to secondary data */
  167 };
  168 
  169 #ifndef _KERNEL
  170 struct wi_counters {
  171         u_int32_t               wi_tx_unicast_frames;
  172         u_int32_t               wi_tx_multicast_frames;
  173         u_int32_t               wi_tx_fragments;
  174         u_int32_t               wi_tx_unicast_octets;
  175         u_int32_t               wi_tx_multicast_octets;
  176         u_int32_t               wi_tx_deferred_xmits;
  177         u_int32_t               wi_tx_single_retries;
  178         u_int32_t               wi_tx_multi_retries;
  179         u_int32_t               wi_tx_retry_limit;
  180         u_int32_t               wi_tx_discards;
  181         u_int32_t               wi_rx_unicast_frames;
  182         u_int32_t               wi_rx_multicast_frames;
  183         u_int32_t               wi_rx_fragments;
  184         u_int32_t               wi_rx_unicast_octets;
  185         u_int32_t               wi_rx_multicast_octets;
  186         u_int32_t               wi_rx_fcs_errors;
  187         u_int32_t               wi_rx_discards_nobuf;
  188         u_int32_t               wi_tx_discards_wrong_sa;
  189         u_int32_t               wi_rx_WEP_cant_decrypt;
  190         u_int32_t               wi_rx_msg_in_msg_frags;
  191         u_int32_t               wi_rx_msg_in_bad_msg_frags;
  192 };
  193 #endif
  194 
  195 /*
  196  * Network parameters, static configuration entities.
  197  */
  198 #define WI_RID_PORTTYPE         0xFC00 /* Connection control characteristics */
  199 #define WI_RID_MAC_NODE         0xFC01 /* MAC address of this station */
  200 #define WI_RID_DESIRED_SSID     0xFC02 /* Service Set ID for connection */
  201 #define WI_RID_OWN_CHNL         0xFC03 /* Comm channel for BSS creation */
  202 #define WI_RID_OWN_SSID         0xFC04 /* IBSS creation ID */
  203 #define WI_RID_OWN_ATIM_WIN     0xFC05 /* ATIM window time for IBSS creation */
  204 #define WI_RID_SYSTEM_SCALE     0xFC06 /* scale that specifies AP density */
  205 #define WI_RID_MAX_DATALEN      0xFC07 /* Max len of MAC frame body data */
  206 #define WI_RID_MAC_WDS          0xFC08 /* MAC addr of corresponding WDS node */
  207 #define WI_RID_PM_ENABLED       0xFC09 /* ESS power management enable */
  208 #define WI_RID_PM_EPS           0xFC0A /* PM EPS/PS mode */
  209 #define WI_RID_MCAST_RX         0xFC0B /* ESS PM mcast reception */
  210 #define WI_RID_MAX_SLEEP        0xFC0C /* max sleep time for ESS PM */
  211 #define WI_RID_HOLDOVER         0xFC0D /* holdover time for ESS PM */
  212 #define WI_RID_NODENAME         0xFC0E /* ID name of this node for diag */
  213 #define WI_RID_DTIM_PERIOD      0xFC10 /* beacon interval between DTIMs */
  214 #define WI_RID_WDS_ADDR1        0xFC11 /* port 1 MAC of WDS link node */
  215 #define WI_RID_WDS_ADDR2        0xFC12 /* port 1 MAC of WDS link node */
  216 #define WI_RID_WDS_ADDR3        0xFC13 /* port 1 MAC of WDS link node */
  217 #define WI_RID_WDS_ADDR4        0xFC14 /* port 1 MAC of WDS link node */
  218 #define WI_RID_WDS_ADDR5        0xFC15 /* port 1 MAC of WDS link node */
  219 #define WI_RID_WDS_ADDR6        0xFC16 /* port 1 MAC of WDS link node */
  220 #define WI_RID_MCAST_PM_BUF     0xFC17 /* PM buffering of mcast */
  221 #define WI_RID_ENCRYPTION       0xFC20 /* enable/disable WEP */
  222 #define WI_RID_AUTHTYPE         0xFC21 /* specify authentication type */
  223 #define WI_RID_P2_TX_CRYPT_KEY  0xFC23
  224 #define WI_RID_P2_CRYPT_KEY0    0xFC24
  225 #define WI_RID_P2_CRYPT_KEY1    0xFC25
  226 #define WI_RID_MICROWAVE_OVEN   0xFC25
  227 #define WI_RID_P2_CRYPT_KEY2    0xFC26
  228 #define WI_RID_P2_CRYPT_KEY3    0xFC27
  229 #define WI_RID_P2_ENCRYPTION    0xFC28
  230 #define  PRIVACY_INVOKED        0x01
  231 #define  EXCLUDE_UNENCRYPTED    0x02
  232 #define  HOST_ENCRYPT           0x10
  233 #define  IV_EVERY_FRAME         0x00    /* IV = Initialization Vector */
  234 #define  IV_EVERY10_FRAME       0x20    /* every 10 frame IV reuse */
  235 #define  IV_EVERY50_FRAME       0x40    /* every 50 frame IV reuse */
  236 #define  IV_EVERY100_FRAME      0x60    /* every 100 frame IV reuse */
  237 #define  HOST_DECRYPT           0x80
  238 #define WI_RID_WEP_MAPTABLE     0xFC29
  239 #define WI_RID_CNFAUTHMODE      0xFC2A
  240 #define WI_RID_ROAMING_MODE     0xFC2D
  241 #define WI_RID_CNF_DBM_ADJUST   0xFC46
  242 #define WI_RID_BASIC_RATE       0xFCB3
  243 #define WI_RID_SUPPORT_RATE     0xFCB4
  244 
  245 /*
  246  * Network parameters, dynamic configuration entities
  247  */
  248 #define WI_RID_MCAST_LIST       0xFC80 /* list of multicast addrs */
  249 #define WI_RID_CREATE_IBSS      0xFC81 /* create IBSS */
  250 #define WI_RID_FRAG_THRESH      0xFC82 /* frag len, unicast msg xmit */
  251 #define WI_RID_RTS_THRESH       0xFC83 /* frame len for RTS/CTS handshake */
  252 #define WI_RID_TX_RATE          0xFC84 /* data rate for message xmit
  253                                         * 0 == Fixed 1mbps
  254                                         * 1 == Fixed 2mbps
  255                                         * 2 == auto fallback
  256                                         */
  257 #define WI_RID_PROMISC          0xFC85 /* enable promisc mode */
  258 #define WI_RID_FRAG_THRESH0     0xFC90
  259 #define WI_RID_FRAG_THRESH1     0xFC91
  260 #define WI_RID_FRAG_THRESH2     0xFC92
  261 #define WI_RID_FRAG_THRESH3     0xFC93
  262 #define WI_RID_FRAG_THRESH4     0xFC94
  263 #define WI_RID_FRAG_THRESH5     0xFC95
  264 #define WI_RID_FRAG_THRESH6     0xFC96
  265 #define WI_RID_RTS_THRESH0      0xFC97
  266 #define WI_RID_RTS_THRESH1      0xFC98
  267 #define WI_RID_RTS_THRESH2      0xFC99
  268 #define WI_RID_RTS_THRESH3      0xFC9A
  269 #define WI_RID_RTS_THRESH4      0xFC9B
  270 #define WI_RID_RTS_THRESH5      0xFC9C
  271 #define WI_RID_RTS_THRESH6      0xFC9D
  272 #define WI_RID_TX_RATE0         0xFC9E
  273 #define WI_RID_TX_RATE1         0xFC9F
  274 #define WI_RID_TX_RATE2         0xFCA0
  275 #define WI_RID_TX_RATE3         0xFCA1
  276 #define WI_RID_TX_RATE4         0xFCA2
  277 #define WI_RID_TX_RATE5         0xFCA3
  278 #define WI_RID_TX_RATE6         0xFCA4
  279 #define WI_RID_DEFLT_CRYPT_KEYS 0xFCB0
  280 #define WI_RID_TX_CRYPT_KEY     0xFCB1
  281 #define WI_RID_TICK_TIME        0xFCE0
  282 
  283 #ifndef _KERNEL
  284 struct wi_key {
  285         u_int16_t               wi_keylen;
  286         u_int8_t                wi_keydat[14];
  287 };
  288 
  289 struct wi_ltv_keys {
  290         u_int16_t               wi_len;
  291         u_int16_t               wi_type;
  292         struct wi_key           wi_keys[4];
  293 };
  294 #endif
  295 
  296 /*
  297  * NIC information
  298  */
  299 #define WI_RID_DNLD_BUF         0xFD01
  300 #define WI_RID_MEMSZ            0xFD02 /* memory size info (XXX Lucent) */
  301                                         /* Looks like on lucnet pri firm too */
  302 #define WI_RID_PRI_IDENTITY     0xFD02 /* primary funcs firmware ident (PRISM2) */
  303 #define WI_RID_PRI_SUP_RANGE    0xFD03 /* primary supplier compatibility */
  304 #define WI_RID_CIF_ACT_RANGE    0xFD04 /* controller sup. compatibility */
  305 #define WI_RID_SERIALNO         0xFD0A /* card serial number */
  306 #define WI_RID_CARD_ID          0xFD0B /* card identification */
  307 #define WI_RID_MFI_SUP_RANGE    0xFD0C /* modem supplier compatibility */
  308 #define WI_RID_CFI_SUP_RANGE    0xFD0D /* controller sup. compatibility */
  309 #define WI_RID_CHANNEL_LIST     0xFD10 /* allowd comm. frequencies. */
  310 #define WI_RID_REG_DOMAINS      0xFD11 /* list of intendted regulatory doms */
  311 #define WI_RID_TEMP_TYPE        0xFD12 /* hw temp range code */
  312 #define WI_RID_CIS              0xFD13 /* PC card info struct */
  313 #define WI_RID_STA_IDENTITY     0xFD20 /* station funcs firmware ident */
  314 #define WI_RID_STA_SUP_RANGE    0xFD21 /* station supplier compat */
  315 #define WI_RID_MFI_ACT_RANGE    0xFD22
  316 #define WI_RID_SYMBOL_IDENTITY  0xFD24
  317 #define WI_RID_CFI_ACT_RANGE    0xFD33
  318 #define WI_RID_COMMQUAL         0xFD43
  319 #define WI_RID_SCALETHRESH      0xFD46
  320 #define WI_RID_PCF              0xFD87
  321 
  322 /*
  323  * MAC information
  324  */
  325 #define WI_RID_PORT_STAT        0xFD40 /* actual MAC port con control stat */
  326 #define WI_RID_CURRENT_SSID     0xFD41 /* ID of actually connected SS */
  327 #define WI_RID_CURRENT_BSSID    0xFD42 /* ID of actually connected BSS */
  328 #define WI_RID_COMMS_QUALITY    0xFD43 /* quality of BSS connection */
  329 #define WI_RID_CUR_TX_RATE      0xFD44 /* current TX rate */
  330 #define WI_RID_OWN_BEACON_INT   0xFD45 /* beacon xmit time for BSS creation */
  331 #define WI_RID_CUR_SCALE_THRESH 0xFD46 /* actual system scane thresh setting */
  332 #define WI_RID_PROT_RESP_TIME   0xFD47 /* time to wait for resp to req msg */
  333 #define WI_RID_SHORT_RTR_LIM    0xFD48 /* max tx attempts for short frames */
  334 #define WI_RID_LONG_RTS_LIM     0xFD49 /* max tx attempts for long frames */
  335 #define WI_RID_MAX_TX_LIFE      0xFD4A /* max tx frame handling duration */
  336 #define WI_RID_MAX_RX_LIFE      0xFD4B /* max rx frame handling duration */
  337 #define WI_RID_CF_POLL          0xFD4C /* contention free pollable ind */
  338 #define WI_RID_AUTH_ALGS        0xFD4D /* auth algorithms available */
  339 #define WI_RID_AUTH_TYPE        0xFD4E /* availanle auth types */
  340 #define WI_RID_WEP_AVAIL        0xFD4F /* WEP privacy option available */
  341 #define WI_RID_DBM_COMMS_QUAL   0xFD51 /* CommQuality normalized to dBm */
  342 #define WI_RID_CUR_TX_RATE1     0xFD80
  343 #define WI_RID_CUR_TX_RATE2     0xFD81
  344 #define WI_RID_CUR_TX_RATE3     0xFD82
  345 #define WI_RID_CUR_TX_RATE4     0xFD83
  346 #define WI_RID_CUR_TX_RATE5     0xFD84
  347 #define WI_RID_CUR_TX_RATE6     0xFD85
  348 #define WI_RID_OWN_MAC          0xFD86 /* unique local MAC addr */
  349 #define WI_RID_PCI_INFO         0xFD87 /* point coordination func cap */
  350 
  351 /*
  352  * Modem information
  353  */
  354 #define WI_RID_PHY_TYPE         0xFDC0 /* phys layer type indication */
  355 #define WI_RID_CURRENT_CHAN     0xFDC1 /* current frequency */
  356 #define WI_RID_PWR_STATE        0xFDC2 /* pwr consumption status */
  357 #define WI_RID_CCA_MODE         0xFDC3 /* clear chan assess mode indication */
  358 #define WI_RID_CCA_TIME         0xFDC4 /* clear chan assess time */
  359 #define WI_RID_MAC_PROC_DELAY   0xFDC5 /* MAC processing delay time */
  360 #define WI_RID_DATA_RATES       0xFDC6 /* supported data rates */
  361 
  362 /*
  363  * bsd-airtools v0.2 - source-mods v0.2 [common.h]
  364  * by h1kari - (c) Dachb0den Labs 2001
  365  */
  366 
  367 /*
  368  * Copyright (c) 2001 Dachb0den Labs.
  369  *      David Hulton <h1kari@dachb0den.com>.  All rights reserved.
  370  *
  371  * Redistribution and use in source and binary forms, with or without
  372  * modification, are permitted provided that the following conditions
  373  * are met:
  374  * 1. Redistributions of source code must retain the above copyright
  375  *    notice, this list of conditions and the following disclaimer.
  376  * 2. Redistributions in binary form must reproduce the above copyright
  377  *    notice, this list of conditions and the following disclaimer in the
  378  *    documentation and/or other materials provided with the distribution.
  379  * 3. All advertising materials mentioning features or use of this software
  380  *    must display the following acknowledgement:
  381  *      This product includes software developed by David Hulton.
  382  * 4. Neither the name of the author nor the names of any co-contributors
  383  *    may be used to endorse or promote products derived from this software
  384  *    without specific prior written permission.
  385  *
  386  * THIS SOFTWARE IS PROVIDED BY David Hulton AND CONTRIBUTORS ``AS IS'' AND
  387  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  388  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  389  * ARE DISCLAIMED.  IN NO EVENT SHALL David Hulton OR THE VOICES IN HIS HEAD
  390  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  391  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  392  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  393  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  394  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  395  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
  396  * THE POSSIBILITY OF SUCH DAMAGE.
  397  */
  398 
  399 /*
  400  * standard hermes recieve frame used by wavelan/prism2 cards
  401  */
  402 struct wi_rx_frame {
  403         /*
  404          * hermes prefix header. supplies information on the current status of
  405          * the network and various other statistics gathered from the
  406          * management/control frames as used internally.
  407          */
  408         u_int16_t       wi_status;
  409         u_int16_t       wi_ts0;
  410         u_int16_t       wi_ts1;
  411         u_int8_t        wi_silence;
  412         u_int8_t        wi_signal;
  413         u_int8_t        wi_rate;
  414         u_int8_t        wi_rx_flow;
  415         u_int16_t       wi_rsvd0;
  416         u_int16_t       wi_rsvd1;
  417         /*
  418          * standard 80211 frame header. all packets have to use this header as
  419          * per the AN9900 from intersil, even management/control. for
  420          * management packets, they just threw the header into the data field,
  421          * but for control packets the headers are lost in translation and
  422          * therefore not all control packet info can be displayed.
  423          */
  424         u_int16_t       wi_frame_ctl;
  425         u_int16_t       wi_id;
  426         u_int8_t        wi_addr1[6];
  427         u_int8_t        wi_addr2[6];
  428         u_int8_t        wi_addr3[6];
  429         u_int16_t       wi_seq_ctl;
  430         u_int8_t        wi_addr4[6];
  431         u_int16_t       wi_dat_len;
  432         /*
  433          * another wierdity with the drivers. they append a 802.3 header which
  434          * is somewhat redundant, since all the same data is provided in the
  435          * 802.11 header.
  436          */
  437         u_int8_t        wi_dst_addr[6];
  438         u_int8_t        wi_src_addr[6];
  439         u_int16_t       wi_len;
  440 };
  441 #define WI_DATA_HDRLEN          WI_802_11_OFFSET
  442 #define WI_MGMT_HDRLEN          WI_802_11_OFFSET_RAW
  443 #define WI_CTL_HDRLEN           WI_802_11_OFFSET_RAW
  444 
  445 
  446 /*
  447  * all data packets have a snap (sub-network access protocol) header that
  448  * isn't entirely definied, but added for ethernet compatibility.
  449  */
  450 struct wi_snap_frame {
  451         u_int16_t       wi_dat[3];
  452         u_int16_t       wi_type;
  453 };
  454 
  455 
  456 /*
  457  * management frame headers
  458  * note: all management frames consist of a static header and variable length
  459  * fields.
  460  */
  461 
  462 /*
  463  * variable length field structure
  464  */
  465 struct wi_mgmt_var_hdr {
  466         u_int8_t        wi_code;
  467         u_int8_t        wi_len;
  468         u_int8_t        wi_data[256];
  469 };
  470 
  471 /*
  472  * management beacon frame prefix
  473  */
  474 struct wi_mgmt_beacon_hdr {
  475         u_int32_t       wi_ts0;
  476         u_int32_t       wi_ts1;
  477         u_int16_t       wi_interval;
  478         u_int16_t       wi_capinfo;
  479 };
  480 
  481 /*
  482  * ibss announcement traffic indication message (atim) frame
  483  * note: no parameters
  484  */
  485 
  486 /*
  487  * management disassociation frame
  488  */
  489 struct wi_mgmt_disas_hdr {
  490         u_int16_t       wi_reason;
  491 };
  492 
  493 /*
  494  * management association request frame prefix
  495  */
  496 struct wi_mgmt_asreq_hdr {
  497         u_int16_t       wi_capinfo;
  498         u_int16_t       wi_interval;
  499 };
  500 
  501 /*
  502  * management association response frame prefix
  503  */
  504 struct wi_mgmt_asresp_hdr {
  505         u_int16_t       wi_capinfo;
  506         u_int16_t       wi_status;
  507         u_int16_t       wi_aid;
  508 };
  509 
  510 /*
  511  * management reassociation request frame prefix
  512  */
  513 struct wi_mgmt_reasreq_hdr {
  514         u_int16_t       wi_capinfo;
  515         u_int16_t       wi_interval;
  516         u_int8_t        wi_currap[6];
  517 };
  518 
  519 /*
  520  * management reassociation response frame prefix
  521  */
  522 struct wi_mgmt_reasresp_hdr {
  523         u_int16_t       wi_capinfo;
  524         u_int16_t       wi_status;
  525         u_int16_t       wi_aid;
  526 };
  527 
  528 /*
  529  * management probe request frame prefix
  530  * note: no static parameters, only variable length
  531  */
  532 
  533 /*
  534  * management probe response frame prefix
  535  */
  536 struct wi_mgmt_proberesp_hdr {
  537         u_int32_t       wi_ts0;
  538         u_int32_t       wi_ts1;
  539         u_int16_t       wi_interval;
  540         u_int16_t       wi_capinfo;
  541 };
  542 
  543 /*
  544  * management authentication frame prefix
  545  */
  546 struct wi_mgmt_auth_hdr {
  547         u_int16_t       wi_algo;
  548         u_int16_t       wi_seq;
  549         u_int16_t       wi_status;
  550 };
  551 
  552 /*
  553  * management deauthentication frame
  554  */
  555 struct wi_mgmt_deauth_hdr {
  556         u_int16_t       wi_reason;
  557 };
  558 
  559 
  560 /*
  561  * rid configuration register definitions
  562  */
  563 #define WI_RID_SCAN_REQ         0xFCE1 /* scan request information */
  564 #define WI_RID_SCAN_RES         0xFD88 /* scan result information */
  565 
  566 #define WI_RID_PROCFRAME        0x3137 /* Return full frame information */
  567 #define WI_RID_PRISM2           0x3138 /* tell if we're a prism2 card or not */
  568 
  569 
  570 /*
  571  * 802.11 definitions
  572  */
  573 #define WI_STAT_BADCRC          0x0001
  574 #define WI_STAT_UNDECRYPTABLE   0x0002
  575 #define WI_STAT_ERRSTAT         0x0003
  576 #define WI_STAT_MAC_PORT        0x0700
  577 #define WI_STAT_1042            0x2000
  578 #define WI_STAT_TUNNEL          0x4000
  579 #define WI_STAT_WMP_MSG         0x6000
  580 #define WI_RXSTAT_MSG_TYPE      0xE000
  581 
  582 #define WI_FCTL_OPT_MASK        0xFF00
  583 #define WI_AID_SET              0xC000
  584 #define WI_AID_MASK             0x3FFF
  585 #define WI_SCTL_FRAGNUM_MASK    0x000F
  586 #define WI_SCTL_SEQNUM_MASK     0xFFF0
  587 
  588 #define WI_STAT_UNSPEC_FAIL     1
  589 #define WI_STAT_CAPINFO_FAIL    10
  590 #define WI_STAT_REAS_DENY       11
  591 #define WI_STAT_ASSOC_DENY      12
  592 #define WI_STAT_ALGO_FAIL       13
  593 #define WI_STAT_SEQ_FAIL        14
  594 #define WI_STAT_CHAL_FAIL       15
  595 #define WI_STAT_TOUT_FAIL       16
  596 #define WI_STAT_OVERL_DENY      17
  597 #define WI_STAT_RATE_DENY       18
  598 
  599 #define WI_FTYPE_MGMT           0x0000
  600 #define WI_FTYPE_CTL            0x0004
  601 #define WI_FTYPE_DATA           0x0008
  602 
  603 #define WI_FCTL_VERS            0x0002
  604 #define WI_FCTL_FTYPE           0x000C
  605 #define WI_FCTL_STYPE           0x00F0
  606 #define WI_FCTL_TODS            0x0100
  607 #define WI_FCTL_FROMDS          0x0200
  608 #define WI_FCTL_MOREFRAGS       0x0400
  609 #define WI_FCTL_RETRY           0x0800
  610 #define WI_FCTL_PM              0x1000
  611 #define WI_FCTL_MOREDATA        0x2000
  612 #define WI_FCTL_WEP             0x4000
  613 #define WI_FCTL_ORDER           0x8000
  614 
  615 #define WI_FCS_LEN              0x4 /* checksum length */
  616 
  617 
  618 /*
  619  * management definitions
  620  */
  621 #define WI_STYPE_MGMT_ASREQ     0x0000
  622 #define WI_STYPE_MGMT_ASRESP    0x0010
  623 #define WI_STYPE_MGMT_REASREQ   0x0020
  624 #define WI_STYPE_MGMT_REASRESP  0x0030
  625 #define WI_STYPE_MGMT_PROBEREQ  0x0040
  626 #define WI_STYPE_MGMT_PROBERESP 0x0050
  627 #define WI_STYPE_MGMT_BEACON    0x0080
  628 #define WI_STYPE_MGMT_ATIM      0x0090
  629 #define WI_STYPE_MGMT_DISAS     0x00A0
  630 #define WI_STYPE_MGMT_AUTH      0x00B0
  631 #define WI_STYPE_MGMT_DEAUTH    0x00C0
  632 
  633 #define WI_CAPINFO_ESS          0x01
  634 #define WI_CAPINFO_IBSS         0x02
  635 #define WI_CAPINFO_CFPOLL       0x04
  636 #define WI_CAPINFO_CFPOLLREQ    0x08
  637 #define WI_CAPINFO_PRIV         0x10
  638 
  639 #define WI_REASON_UNSPEC        1
  640 #define WI_REASON_AUTH_INVALID  2
  641 #define WI_REASON_DEAUTH_LEAVE  3
  642 #define WI_REASON_DISAS_INACT   4
  643 #define WI_REASON_DISAS_OVERL   5
  644 #define WI_REASON_CLASS2        6
  645 #define WI_REASON_CLASS3        7
  646 #define WI_REASON_DISAS_LEAVE   8
  647 #define WI_REASON_NOAUTH        9
  648 
  649 #define WI_VAR_SSID             0
  650 #define WI_VAR_SRATES           1
  651 #define WI_VAR_FH               2
  652 #define WI_VAR_DS               3
  653 #define WI_VAR_CF               4
  654 #define WI_VAR_TIM              5
  655 #define WI_VAR_IBSS             6
  656 #define WI_VAR_CHAL             16
  657 
  658 #define WI_VAR_SRATES_MASK      0x7F
  659 
  660 
  661 /*
  662  * control definitions
  663  */
  664 #define WI_STYPE_CTL_PSPOLL     0x00A0
  665 #define WI_STYPE_CTL_RTS        0x00B0
  666 #define WI_STYPE_CTL_CTS        0x00C0
  667 #define WI_STYPE_CTL_ACK        0x00D0
  668 #define WI_STYPE_CTL_CFEND      0x00E0
  669 #define WI_STYPE_CTL_CFENDCFACK 0x00F0
  670 
  671 
  672 /*
  673  * ap scanning structures
  674  */
  675 struct wi_scan_res {
  676         u_int16_t       wi_chan;
  677         u_int16_t       wi_noise;
  678         u_int16_t       wi_signal;
  679         u_int8_t        wi_bssid[6];
  680         u_int16_t       wi_interval;
  681         u_int16_t       wi_capinfo;
  682         u_int16_t       wi_ssid_len;
  683         u_int8_t        wi_ssid[32];
  684         u_int8_t        wi_srates[10];
  685         u_int8_t        wi_rate;
  686         u_int8_t        wi_rsvd;
  687 };
  688 #define WI_WAVELAN_RES_SIZE     50
  689 
  690 struct wi_scan_p2_hdr {
  691         u_int16_t       wi_rsvd;
  692         u_int16_t       wi_reason;
  693 };
  694 #define WI_PRISM2_RES_SIZE      62
  695 
  696 
  697 /*
  698  * prism2 debug mode definitions
  699  */
  700 #define SIOCSPRISM2DEBUG        _IOW('i', 137, struct ifreq)
  701 #define SIOCGPRISM2DEBUG        _IOWR('i', 138, struct ifreq)
  702 
  703 #define WI_DEBUG_RESET          0x00
  704 #define WI_DEBUG_INIT           0x01
  705 #define WI_DEBUG_SLEEP          0x02
  706 #define WI_DEBUG_WAKE           0x03
  707 #define WI_DEBUG_CHAN           0x08
  708 #define WI_DEBUG_DELAYSUPP      0x09
  709 #define WI_DEBUG_TXSUPP         0x0A
  710 #define WI_DEBUG_MONITOR        0x0B
  711 #define WI_DEBUG_LEDTEST        0x0C
  712 #define WI_DEBUG_CONTTX         0x0E
  713 #define WI_DEBUG_STOPTEST       0x0F
  714 #define WI_DEBUG_CONTRX         0x10
  715 #define WI_DEBUG_SIGSTATE       0x11
  716 #define WI_DEBUG_CALENABLE      0x13
  717 #define WI_DEBUG_CONFBITS       0x15
  718 
  719 #endif

Cache object: 8792635de3ebfbf26d7abc07510bdd16


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.