Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

# prism2.h

Go to the documentation of this file.

    00001 /*! \file prism2.h \brief Prism2 802.11b Wireless-LAN Interface Driver. */
    00002 //*****************************************************************************
    00003 //
    00004 // File Name    : 'prism2.h'
    00005 // Title        : Prism2 802.11b Wireless-LAN Interface Driver
    00006 // Author       : Pascal Stang
    00007 // Created      : 12/27/2004
    00008 // Revised      : 1/7/2005
    00009 // Version      : 0.1
    00010 // Target MCU   : Atmel AVR series
    00011 // Editor Tabs  : 4
    00012 //
    00013 /// \ingroup network
    00014 /// \defgroup prism2 PrismII 802.11b WLAN Interface Driver (prism2.c)
    00015 /// \code #include "net/prism2.h" \endcode
    00016 /// \par Overview
    00017 ///     This driver provides initialization and transmit/receive
    00018 /// functions for the Prism2 802.11b Wireless-LAN Controller.
    00019 ///
    00020 /// \note This driver works but is still in development.
    00021 //
    00022 //*****************************************************************************
    00023 //@{
    00024
    00025 #ifndef PRISM2_H
    00026 #define PRISM2_H
    00027
    00028 #include "global.h"
    00029
    00030 #define nop()   asm volatile ("nop")
    00031
    00032 // PRISM2 I/O register defines
    00033 #define PRISM2_REG_CMD          0x00
    00034 #define PRISM2_REG_PARAM0       0x02
    00035 #define PRISM2_REG_PARAM1       0x04
    00036 #define PRISM2_REG_PARAM2       0x06
    00037 #define PRISM2_REG_STATUS       0x08
    00038 #define PRISM2_REG_RESP0        0x0A
    00039 #define PRISM2_REG_RESP1        0x0C
    00040 #define PRISM2_REG_RESP2        0x0E
    00041
    00042 #define PRISM2_REG_INFOFID      0x10
    00043 #define PRISM2_REG_RXFID        0x20
    00044 #define PRISM2_REG_ALLOCFID     0x22
    00045 #define PRISM2_REG_TXFID        0x24
    00046
    00047 #define PRISM2_REG_BAP0SEL      0x18
    00048 #define PRISM2_REG_BAP0OFFSET   0x1C
    00049 #define PRISM2_REG_BAP0DATA     0x36
    00050
    00051 #define PRISM2_REG_BAP1SEL      0x1A
    00052 #define PRISM2_REG_BAP1OFFSET   0x1E
    00053 #define PRISM2_REG_BAP1DATA     0x38
    00054
    00055 #define PRISM2_REG_EVSTAT       0x30
    00056 #define PRISM2_REG_INTEN        0x32
    00057 #define PRISM2_REG_EVACK        0x34
    00058
    00059 #define PRISM2_REG_SWSUP0       0x28
    00060 #define PRISM2_REG_SWSUP1       0x2A
    00061 #define PRISM2_REG_SWSUP2       0x2C
    00062
    00063 #define PRISM2_REG_AUXPAGE      0x3A
    00064 #define PRISM2_REG_AUXOFFSET    0x3C
    00065 #define PRISM2_REG_AUXDATA      0x3E
    00066
    00067
    00068 // PRISM2 commands defines
    00069 #define PRISM2_CMD_INIT         0x0000
    00070 #define PRISM2_CMD_ENABLE_MAC0  0x0001
    00071 #define PRISM2_CMD_DISABLE_MAC0 0x0002
    00072 #define PRISM2_CMD_DIAG         0x0003
    00073 #define PRISM2_CMD_ALLOC        0x000A
    00074 #define PRISM2_CMD_TX           0x000B
    00075 #define PRISM2_CMD_TX_RECL      0x010B
    00076 #define PRISM2_CMD_NOTIFY       0x0010
    00077 #define PRISM2_CMD_INQUIRE      0x0011
    00078 #define PRISM2_CMD_ACCESS_RD    0x0021
    00079 #define PRISM2_CMD_ACCESS_WR    0x0121
    00080 #define PRISM2_CMD_BUSY         0x8000
    00081 #define PRISM2_CMD_NORESP       0xFFFF
    00082
    00083 // PRISM2 command result codes
    00084 #define PRISM2_RESULT_SUCCESS   0x00
    00085 #define PRISM2_RESULT_CARDFAIL  0x01
    00086 #define PRISM2_RESULT_NOBUFFER  0x05
    00087 #define PRISM2_RESULT_CMDERROR  0x7F
    00088
    00089 // PRISM2 BAP Offset defines
    00090 #define PRISM2_BAPOFFSET_ERROR  0x4000
    00091 #define PRISM2_BAPOFFSET_BUSY   0x8000
    00092
    00093 // PRISM2 event bit defines
    00094 #define PRISM2_EVENT_RX         0x0001
    00095 #define PRISM2_EVENT_TX         0x0002
    00096 #define PRISM2_EVENT_TXEXEC     0x0004
    00097 #define PRISM2_EVENT_ALLOC      0x0008
    00098 #define PRISM2_EVENT_CMD        0x0010
    00099 #define PRISM2_EVENT_DTIM       0x0020
    00100 #define PRISM2_EVENT_INFO       0x0080
    00101 #define PRISM2_EVENT_INFDROP    0x2000
    00102 #define PRISM2_EVENT_WTERR      0x4000
    00103 #define PRISM2_EVENT_TICK       0x8000
    00104 #define PRISM2_EVENT_ALL        0xFFFF
    00105
    00106 // PRISM2 Record ID defines (RIDs)
    00107 #define PRISM2_RID_CNFPORTTYPE              0xFC00
    00108 #define PRISM2_RID_CNFOWNMACADDR            0xFC01
    00109 #define PRISM2_RID_CNFDESIREDSSID           0xFC02
    00110 #define PRISM2_RID_CNFOWNCHANNEL            0xFC03
    00111 #define PRISM2_RID_CNFOWNSSID               0xFC04
    00112 #define PRISM2_RID_CNFOWNATIMWIN            0xFC05
    00113 #define PRISM2_RID_CNFSYSSCALE              0xFC06
    00114 #define PRISM2_RID_CNFMAXDATALEN            0xFC07
    00115 #define PRISM2_RID_CNFWDSADDR               0xFC08
    00116 #define PRISM2_RID_CNFPMENABLED             0xFC09
    00117 #define PRISM2_RID_CNFPMEPS                 0xFC0A
    00118 #define PRISM2_RID_CNFMULTICASTRX           0xFC0B
    00119 #define PRISM2_RID_CNFMAXSLEEPDUR           0xFC0C
    00120 #define PRISM2_RID_CNFPMHOLDDUR             0xFC0D
    00121 #define PRISM2_RID_CNFOWNNAME               0xFC0E
    00122 #define PRISM2_RID_CNFOWNDTIMPER            0xFC10
    00123 #define PRISM2_RID_CNFWDSADDR1              0xFC11
    00124 #define PRISM2_RID_CNFWDSADDR2              0xFC12
    00125 #define PRISM2_RID_CNFWDSADDR3              0xFC13
    00126 #define PRISM2_RID_CNFWDSADDR4              0xFC14
    00127 #define PRISM2_RID_CNFWDSADDR5              0xFC15
    00128 #define PRISM2_RID_CNFWDSADDR6              0xFC16
    00129 #define PRISM2_RID_CNFMCASTPMBUFF           0xFC17
    00130 #define PRISM2_RID_CNFWEPDEFAULTKEYID       0xFC23
    00131 #define PRISM2_RID_CNFWEPDEFAULTKEY0        0xFC24
    00132 #define PRISM2_RID_CNFWEPDEFAULTKEY1        0xFC25
    00133 #define PRISM2_RID_CNFWEPDEFAULTKEY2        0xFC26
    00134 #define PRISM2_RID_CNFWEPDEFAULTKEY3        0xFC27
    00135 #define PRISM2_RID_CNFWEPFLAGS              0xFC28
    00136 #define PRISM2_RID_CNFWEPKEYMAPTABLE        0xFC29
    00137 #define PRISM2_RID_CNFAUTHENTICATION        0xFC2A
    00138 #define PRISM2_RID_CNFMAXASSOCSTATIONS      0xFC2B
    00139 #define PRISM2_RID_CNFTXCONTROL             0xFC2C
    00140 #define PRISM2_RID_CNFROAMINGMODE           0xFC2D
    00141 #define PRISM2_RID_CNFHOSTAUTH              0xFC2E
    00142 #define PRISM2_RID_CNFRCVCRCERROR           0xFC30
    00143 #define PRISM2_RID_CNFALTRETRYCNT           0xFC32
    00144 #define PRISM2_RID_CNFAPBCNINT              0xFC33
    00145 #define PRISM2_RID_CNFAPPCFINFO             0xFC34
    00146 #define PRISM2_RID_CNFSTAPCFINFO            0xFC35
    00147 #define PRISM2_RID_CNFPRIORITYQUSAGE        0xFC37
    00148 #define PRISM2_RID_CNFTIMCTRL               0xFC40
    00149 #define PRISM2_RID_CNFTHIRTY2TALLY          0xFC42
    00150 #define PRISM2_RID_CNFENHSECURITY           0xFC43
    00151 #define PRISM2_RID_CNFDBMADJUST             0xFC46
    00152 #define PRISM2_RID_SSNGENERICELEMENT        0xFC48
    00153 #define PRISM2_RID_CNFSHORTPREAMBLE         0xFCB0
    00154 #define PRISM2_RID_CNFEXCLONGPREAMBLE       0xFCB1
    00155 #define PRISM2_RID_CNFAUTHRSPTIMEOUT        0xFCB2
    00156 #define PRISM2_RID_CNFBASICRATES            0xFCB3
    00157 #define PRISM2_RID_CNFSUPPRATES             0xFCB4
    00158 #define PRISM2_RID_CNFFALLBACKCTRL          0xFCB5
    00159 #define PRISM2_RID_WEPKEYDISABLE            0xFCB6
    00160 #define PRISM2_RID_WEPKEYMAPINDEX           0xFCB7
    00161 #define PRISM2_RID_BROADCASTKEYID           0xFCB8
    00162 #define PRISM2_RID_ENTSECFLAGEYID           0xFCB9
    00163 #define PRISM2_RID_CNFPASSIVESCANCTRL       0xFCBA
    00164 #define PRISM2_RID_SSNHANDLINGMODE          0xFCBB
    00165 #define PRISM2_RID_MDCCONTROL               0xFCBC
    00166 #define PRISM2_RID_MDCCOUNTRY               0xFCBD
    00167 #define PRISM2_RID_TXPOWERMAX               0xFCBE
    00168 #define PRISM2_RID_CNFLFOENBLED             0xFCBF
    00169 #define PRISM2_RID_CAPINFO                  0xFCC0
    00170 #define PRISM2_RID_LISTENINTERVAL           0xFCC1
    00171 #define PRISM2_RID_SCANREQUEST              0xFCE1
    00172 #define PRISM2_RID_JOINREQUEST              0xFCE2
    00173 #define PRISM2_RID_AUTHENTICATESTA          0xFCE3
    00174 #define PRISM2_RID_CHANNELINFOREQUEST       0xFCE4
    00175 #define PRISM2_RID_HOSTSCAN                 0xFCE5
    00176
    00177 #define PCMCIA_ATTR_COR                     0x0000
    00178 #define PCMCIA_ATTR_CSR                     0x0002
    00179 #define PCMCIA_ATTR_PRR                     0x0004
    00180 #define PCMCIA_ATTR_SCR                     0x0006
    00181 #define PCMCIA_ATTR_IOBASE0                 0x0010
    00182 #define PCMCIA_ATTR_IOBASE1                 0x0012
    00183 #define PCMCIA_ATTR_IOLIMIT                 0x0018
    00184
    00185 // typedefs
    00186
    00187 // constants
    00188
    00189 // prototypes
    00190 #include "nic.h"
    00191
    00192
    00193 unsigned int prism2BeginPacketRetreive(void);
    00194 void prism2RetreivePacketData(u08* packet, unsigned int packetLength);
    00195 void prism2EndPacketRetreive(void);
    00196
    00197 void prism2SetupTxHeader(u16* header);
    00198 void prism2EventCheck(void);
    00199
    00200 // initialize the network interface for transmit/receive
    00201 void prism2Init(void);
    00202
    00203 void prism2GetMacAddress(u08* macaddr);
    00204 void prism2SetSSID(u08* ssid);
    00205 void prism2SetWEPKey(u08* wepkey);
    00206
    00207 u08 prism2Command(u16 cmd, u16 param0);
    00208 u08 prism2WriteBAP0(u16 id, u16 offset, u16* data, u16 len);
    00209 u08 prism2ReadBAP0(u16 id, u16 offset, u16* data, u16 len);
    00210
    00211 u08 prism2ReadRID(u16 id, u16 offset, u16* data, u16 len);
    00212 u08 prism2WriteRID(u16 id, u16 offset, u16* data, u16 len);
    00213
    00214
    00215 // hardware access commands
    00216 void prism2Write(unsigned short address, unsigned char data);
    00217 unsigned char prism2Read(unsigned short address);
    00218 void prism2Write16(unsigned short address, unsigned short data);
    00219 unsigned short prism2Read16(unsigned short address);
    00220 void prism2WriteMem(unsigned short address, unsigned short data);
    00221 unsigned short prism2ReadMem(unsigned short address);
    00222
    00223 // debugging commands
    00224 void prism2CardRegDump(void);
    00225 void prism2RegDump(void);
    00226
    00227 #endif
    00228 //@}
    00229