ieee80211.h
Go to the documentation of this file.
00001 /*------------------------------------------------------------------------------
00002  *-------------------------        ATH5K Driver          -----------------------
00003  *------------------------------------------------------------------------------
00004  *                                                           V1.0  08/02/2010
00005  *
00006  *
00007  *  Feb 2010 - Samuel Cabrero <samuelcabrero@gmail.com>
00008  *              Initial release
00009  *
00010  *  ----------------------------------------------------------------------------
00011  *  Copyright (C) 2000-2010, Universidad de Zaragoza, SPAIN
00012  *
00013  *  Autors:
00014  *              Samuel Cabrero        <samuelcabrero@gmail.com>
00015  *              Danilo Tardioli       <dantard@unizar.es>
00016  *              Jose Luis Villarroel  <jlvilla@unizar.es>
00017  *
00018  *  This is a simplified version of the original ath5k driver. It should work 
00019  *  with all Atheros 5xxx WLAN cards. The 802.11 layer have been removed so it
00020  *  just send and receive frames over the air, as if it were an Ethernet bus
00021  *  interface.
00022  *
00023  *  Please read ath5k_interface.h for instructions.
00024  *
00025  *  This program is distributed under the terms of GPL version 2 and in the 
00026  *  hope that it will be useful, but WITHOUT ANY WARRANTY; without even the 
00027  *  implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
00028  *  See the GNU General Public License for more details.
00029  *
00030  *----------------------------------------------------------------------------*/
00031 
00032 /*
00033  * IEEE 802.11 defines
00034  *
00035  * Copyright (c) 2001-2002, SSH Communications Security Corp and Jouni Malinen
00036  * <jkmaline@cc.hut.fi>
00037  * Copyright (c) 2002-2003, Jouni Malinen <jkmaline@cc.hut.fi>
00038  * Copyright (c) 2005, Devicescape Software, Inc.
00039  * Copyright (c) 2006, Michael Wu <flamingice@sourmilk.net>
00040  *
00041  * This program is free software; you can redistribute it and/or modify
00042  * it under the terms of the GNU General Public License version 2 as
00043  * published by the Free Software Foundation.
00044  */
00045 
00046 #ifndef IEEE80211_H
00047 #define IEEE80211_H
00048 
00049 #define FCS_LEN 4
00050 
00051 #define IEEE80211_FCTL_VERS             0x0003
00052 #define IEEE80211_FCTL_FTYPE            0x000c
00053 #define IEEE80211_FCTL_STYPE            0x00f0
00054 #define IEEE80211_FCTL_TODS             0x0100
00055 #define IEEE80211_FCTL_FROMDS           0x0200
00056 #define IEEE80211_FCTL_MOREFRAGS        0x0400
00057 #define IEEE80211_FCTL_RETRY            0x0800
00058 #define IEEE80211_FCTL_PM               0x1000
00059 #define IEEE80211_FCTL_MOREDATA         0x2000
00060 #define IEEE80211_FCTL_PROTECTED        0x4000
00061 #define IEEE80211_FCTL_ORDER            0x8000
00062 
00063 #define IEEE80211_SCTL_FRAG             0x000F
00064 #define IEEE80211_SCTL_SEQ              0xFFF0
00065 
00066 #define IEEE80211_FTYPE_MGMT            0x0000
00067 #define IEEE80211_FTYPE_CTL             0x0004
00068 #define IEEE80211_FTYPE_DATA            0x0008
00069 
00070 /* management */
00071 #define IEEE80211_STYPE_ASSOC_REQ       0x0000
00072 #define IEEE80211_STYPE_ASSOC_RESP      0x0010
00073 #define IEEE80211_STYPE_REASSOC_REQ     0x0020
00074 #define IEEE80211_STYPE_REASSOC_RESP    0x0030
00075 #define IEEE80211_STYPE_PROBE_REQ       0x0040
00076 #define IEEE80211_STYPE_PROBE_RESP      0x0050
00077 #define IEEE80211_STYPE_BEACON          0x0080
00078 #define IEEE80211_STYPE_ATIM            0x0090
00079 #define IEEE80211_STYPE_DISASSOC        0x00A0
00080 #define IEEE80211_STYPE_AUTH            0x00B0
00081 #define IEEE80211_STYPE_DEAUTH          0x00C0
00082 #define IEEE80211_STYPE_ACTION          0x00D0
00083 
00084 /* control */
00085 #define IEEE80211_STYPE_BACK_REQ        0x0080
00086 #define IEEE80211_STYPE_BACK            0x0090
00087 #define IEEE80211_STYPE_PSPOLL          0x00A0
00088 #define IEEE80211_STYPE_RTS             0x00B0
00089 #define IEEE80211_STYPE_CTS             0x00C0
00090 #define IEEE80211_STYPE_ACK             0x00D0
00091 #define IEEE80211_STYPE_CFEND           0x00E0
00092 #define IEEE80211_STYPE_CFENDACK        0x00F0
00093 
00094 /* data */
00095 #define IEEE80211_STYPE_DATA                    0x0000
00096 #define IEEE80211_STYPE_DATA_CFACK              0x0010
00097 #define IEEE80211_STYPE_DATA_CFPOLL             0x0020
00098 #define IEEE80211_STYPE_DATA_CFACKPOLL          0x0030
00099 #define IEEE80211_STYPE_NULLFUNC                0x0040
00100 #define IEEE80211_STYPE_CFACK                   0x0050
00101 #define IEEE80211_STYPE_CFPOLL                  0x0060
00102 #define IEEE80211_STYPE_CFACKPOLL               0x0070
00103 #define IEEE80211_STYPE_QOS_DATA                0x0080
00104 #define IEEE80211_STYPE_QOS_DATA_CFACK          0x0090
00105 #define IEEE80211_STYPE_QOS_DATA_CFPOLL         0x00A0
00106 #define IEEE80211_STYPE_QOS_DATA_CFACKPOLL      0x00B0
00107 #define IEEE80211_STYPE_QOS_NULLFUNC            0x00C0
00108 #define IEEE80211_STYPE_QOS_CFACK               0x00D0
00109 #define IEEE80211_STYPE_QOS_CFPOLL              0x00E0
00110 #define IEEE80211_STYPE_QOS_CFACKPOLL           0x00F0
00111 
00112 
00113 /* miscellaneous IEEE 802.11 constants */
00114 #define IEEE80211_MAX_FRAG_THRESHOLD    2352
00115 #define IEEE80211_MAX_RTS_THRESHOLD     2353
00116 #define IEEE80211_MAX_AID               2007
00117 #define IEEE80211_MAX_TIM_LEN           251
00118 /* Maximum size for the MA-UNITDATA primitive, 802.11 standard section
00119    6.2.1.1.2.
00120 
00121    802.11e clarifies the figure in section 7.1.2. The frame body is
00122    up to 2304 octets long (maximum MSDU size) plus any crypt overhead. */
00123 #define IEEE80211_MAX_DATA_LEN          2304
00124 /* 30 byte 4 addr hdr, 2 byte QoS, 2304 byte MSDU, 12 byte crypt, 4 byte FCS */
00125 #define IEEE80211_MAX_FRAME_LEN         2352
00126 
00127 #define IEEE80211_MAX_SSID_LEN          32
00128 
00129 #define IEEE80211_4ADDR_LEN 30
00130 #define IEEE80211_3ADDR_LEN 24
00131 
00132 struct ieee80211_hdr {
00133         __le16 frame_control;
00134         __le16 duration_id;
00135         u8 addr1[6];
00136         u8 addr2[6];
00137         u8 addr3[6];
00138         __le16 seq_ctrl;
00139         u8 addr4[6];
00140 } __attribute__ ((packed));
00141 
00142 
00143 #define P80211_OUI_LEN 3
00144 
00145 struct ieee80211_snap_hdr {
00146 
00147         u8 dsap;                /* always 0xAA */
00148         u8 ssap;                /* always 0xAA */
00149         u8 ctrl;                /* always 0x03 */
00150         u8 oui[P80211_OUI_LEN]; /* organizational universal id */
00151 
00152 } __attribute__ ((packed));
00153 
00154 #define SNAP_SIZE sizeof(struct ieee80211_snap_hdr)
00155 
00156 
00157 #endif /* IEEE80211_H */
00158 


ros_rt_wmp
Author(s): Danilo Tardioli, dantard@unizar.es
autogenerated on Fri Jan 3 2014 12:07:54