Nut/OS  4.10.3
API Reference
lan91.h
Go to the documentation of this file.
00001 #ifndef _DEV_LAN91_H_
00002 #define _DEV_LAN91_H_
00003 
00004 /*
00005  * Copyright (C) 2003 by egnite Software GmbH.
00006  * Copyright (C) 2008 by egnite GmbH.
00007  *
00008  * All rights reserved.
00009  *
00010  * Redistribution and use in source and binary forms, with or without
00011  * modification, are permitted provided that the following conditions
00012  * are met:
00013  *
00014  * 1. Redistributions of source code must retain the above copyright
00015  *    notice, this list of conditions and the following disclaimer.
00016  * 2. Redistributions in binary form must reproduce the above copyright
00017  *    notice, this list of conditions and the following disclaimer in the
00018  *    documentation and/or other materials provided with the distribution.
00019  * 3. Neither the name of the copyright holders nor the names of
00020  *    contributors may be used to endorse or promote products derived
00021  *    from this software without specific prior written permission.
00022  *
00023  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
00024  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
00025  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
00026  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
00027  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
00028  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
00029  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
00030  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
00031  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00032  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
00033  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
00034  * SUCH DAMAGE.
00035  *
00036  * For additional information see http://www.ethernut.de/
00037  */
00038 
00039 /*
00040  * $Id: lan91.h 2282 2008-08-28 11:07:10Z haraldkipp $
00041  */
00042 
00043 #include <dev/netbuf.h>
00044 #include <net/if_var.h>
00045 
00055 
00056 #ifndef LAN91_BASE_ADDR
00057 #define LAN91_BASE_ADDR 0xC000
00058 #endif
00059 
00063 #define LAN91_BSR         (LAN91_BASE_ADDR + 0x0E)
00064 
00068 #define LAN91_TCR         (LAN91_BASE_ADDR + 0x00)
00069 
00070 #define LAN91_TCR_SWFDUP      0x8000  
00071 #define LAN91_TCR_EPH_LOOP    0x2000  
00072 #define LAN91_TCR_STP_SQET    0x1000  
00073 #define LAN91_TCR_FDUPLX      0x0800  
00074 #define LAN91_TCR_MON_CSN     0x0400  
00075 #define LAN91_TCR_NOCRC       0x0100  
00076 #define LAN91_TCR_PAD_EN      0x0080  
00077 #define LAN91_TCR_FORCOL      0x0004  
00078 #define LAN91_TCR_LOOP        0x0002  
00079 #define LAN91_TCR_TXENA       0x0001  
00085 #define LAN91_EPHSR       (LAN91_BASE_ADDR + 0x02)
00086 
00090 #define LAN91_RCR         (LAN91_BASE_ADDR + 0x04)
00091 
00092 #define LAN91_RCR_SOFT_RST    0x8000  
00093 #define LAN91_RCR_FILT_CAR    0x4000  
00094 #define LAN91_RCR_ABORT_ENB   0x2000  
00095 #define LAN91_RCR_STRIP_CRC   0x0200  
00096 #define LAN91_RCR_RXEN        0x0100  
00097 #define LAN91_RCR_ALMUL       0x0004  
00098 #define LAN91_RCR_PRMS        0x0002  
00099 #define LAN91_RCR_RX_ABORT    0x0001  
00104 #define LAN91_ECR         (LAN91_BASE_ADDR + 0x06)
00105 
00109 #define LAN91_MIR         (LAN91_BASE_ADDR + 0x08)
00110 
00114 #define LAN91_RPCR        (LAN91_BASE_ADDR + 0x0A)
00115 
00116 #define LAN91_RPCR_SPEED      0x2000  
00117 #define LAN91_RPCR_DPLX       0x1000  
00118 #define LAN91_RPCR_ANEG       0x0800  
00119 #define LAN91_RPCR_LEDA_PAT   0x0000  
00120 #define LAN91_RPCR_LEDB_PAT   0x0010  
00125 #define LAN91_CR          (LAN91_BASE_ADDR + 0x00)
00126 
00127 #define LAN91_CR_EPH_EN       0x8000  
00132 #define LAN91_BAR         (LAN91_BASE_ADDR + 0x02)
00133 
00137 #define LAN91_IAR         (LAN91_BASE_ADDR + 0x04)
00138 
00142 #define LAN91_GPR         (LAN91_BASE_ADDR + 0x0A)
00143 
00147 #define LAN91_CTR         (LAN91_BASE_ADDR + 0x0C)
00148 
00149 #define LAN91_CTR_RCV_BAD     0x4000  
00150 #define LAN91_CTR_AUTO_RELEASE 0x0800 
00155 #define LAN91_MMUCR       (LAN91_BASE_ADDR + 0x00)
00156 
00157 #define LAN91_MMUCR_BUSY      0x0001
00158 
00159 #define LAN91_MMU_NOP         0
00160 #define LAN91_MMU_ALO         (1<<5)
00161 #define LAN91_MMU_RST         (2<<5)
00162 #define LAN91_MMU_REM         (3<<5)
00163 #define LAN91_MMU_TOP         (4<<5)
00164 #define LAN91_MMU_PKT         (5<<5)
00165 #define LAN91_MMU_ENQ         (6<<5)
00166 #define LAN91_MMU_RTX         (7<<5)
00167 
00173 #define LAN91_PNR         (LAN91_BASE_ADDR + 0x02)
00174 
00180 #define LAN91_ARR         (LAN91_BASE_ADDR + 0x03)
00181 
00182 #define LAN91_ARR_FAILED      0x80
00183 
00187 #define LAN91_FIFO        (LAN91_BASE_ADDR + 0x04)
00188 
00192 #define LAN91_PTR         (LAN91_BASE_ADDR + 0x06)
00193 
00194 #define LAN91_PTR_RCV         0x8000  
00195 #define LAN91_PTR_AUTO_INCR   0x4000  
00196 #define LAN91_PTR_READ        0x2000  
00197 #define LAN91_PTR_ETEN        0x1000  
00198 #define LAN91_PTR_NOT_EMPTY   0x0800  
00203 #define LAN91_DATA        (LAN91_BASE_ADDR + 0x08)
00204 
00208 #define LAN91_IST         (LAN91_BASE_ADDR + 0x0C)
00209 
00213 #define LAN91_ACK         (LAN91_BASE_ADDR + 0x0C)
00214 
00218 #define LAN91_MSK         (LAN91_BASE_ADDR + 0x0D)
00219 
00220 #define LAN91_INT_MD          0x80    
00221 #define LAN91_INT_ERCV        0x40    
00222 #define LAN91_INT_EPH         0x20    
00223 #define LAN91_INT_RX_OVRN     0x10    
00224 #define LAN91_INT_ALLOC       0x08    
00225 #define LAN91_INT_TX_EMPTY    0x04    
00226 #define LAN91_INT_TX          0x02    
00227 #define LAN91_INT_RCV         0x01    
00232 #define LAN91_MT          (LAN91_BASE_ADDR + 0x00)
00233 
00237 #define LAN91_MGMT        (LAN91_BASE_ADDR + 0x08)
00238 
00239 #define LAN91_MGMT_MDOE       0x08    
00240 #define LAN91_MGMT_MCLK       0x04    
00241 #define LAN91_MGMT_MDI        0x02    
00242 #define LAN91_MGMT_MDO        0x01    
00247 #define LAN91_REV         (LAN91_BASE_ADDR + 0x0A)
00248 
00252 #define LAN91_ERCV        (LAN91_BASE_ADDR + 0x0C)
00253 
00257 #define LAN91_PHYCR       0
00258 
00259 #define LAN91_PHYCR_RST       0x8000  
00260 #define LAN91_PHYCR_LPBK      0x4000  
00261 #define LAN91_PHYCR_SPEED     0x2000  
00262 #define LAN91_PHYCR_ANEG_EN   0x1000  
00263 #define LAN91_PHYCR_PDN       0x0800  
00264 #define LAN91_PHYCR_MII_DIS   0x0400  
00265 #define LAN91_PHYCR_ANEG_RST  0x0200  
00266 #define LAN91_PHYCR_DPLX      0x0100  
00267 #define LAN91_PHYCR_COLST     0x0080  
00273 #define LAN91_PHYSR       1
00274 
00275 #define LAN91_PHYSR_CAP_T4    0x8000  
00276 #define LAN91_PHYSR_CAP_TXF   0x4000  
00277 #define LAN91_PHYSR_CAP_TXH   0x2000  
00278 #define LAN91_PHYSR_CAP_TF    0x1000  
00279 #define LAN91_PHYSR_CAP_TH    0x0800  
00280 #define LAN91_PHYSR_CAP_SUPR  0x0040  
00281 #define LAN91_PHYSR_ANEG_ACK  0x0020  
00282 #define LAN91_PHYSR_REM_FLT   0x0010  
00283 #define LAN91_PHYSR_CAP_ANEG  0x0008  
00284 #define LAN91_PHYSR_LINK      0x0004  
00285 #define LAN91_PHYSR_JAB       0x0002  
00286 #define LAN91_PHYSR_EXREG     0x0001  
00292 #define LAN91_PHYID1      2
00293 
00297 #define LAN91_PHYID2      3
00298 
00302 #define LAN91_PHYANAD     4
00303 
00304 #define LAN91_PHYANAD_NP      0x8000  
00305 #define LAN91_PHYANAD_ACK     0x4000  
00306 #define LAN91_PHYANAD_RF      0x2000  
00307 #define LAN91_PHYANAD_T4      0x0200  
00308 #define LAN91_PHYANAD_TX_FDX  0x0100  
00309 #define LAN91_PHYANAD_TX_HDX  0x0080  
00310 #define LAN91_PHYANAD_10FDX   0x0040  
00311 #define LAN91_PHYANAD_10_HDX  0x0020  
00312 #define LAN91_PHYANAD_CSMA    0x0001  
00317 #define LAN91_PHYANRC     5
00318 
00322 #define LAN91_PHYCFR1     16
00323 
00327 #define LAN91_PHYCFR2     17
00328 
00332 #define LAN91_PHYSOR      18
00333 
00334 #define LAN91_PHYSOR_INT      0x8000  
00335 #define LAN91_PHYSOR_LNKFAIL  0x4000  
00336 #define LAN91_PHYSOR_LOSSSYNC 0x2000  
00337 #define LAN91_PHYSOR_CWRD     0x1000  
00338 #define LAN91_PHYSOR_SSD      0x0800  
00339 #define LAN91_PHYSOR_ESD      0x0400  
00340 #define LAN91_PHYSOR_RPOL     0x0200  
00341 #define LAN91_PHYSOR_JAB      0x0100  
00342 #define LAN91_PHYSOR_SPDDET   0x0080  
00343 #define LAN91_PHYSOR_DPLXDET  0x0040  
00348 #define LAN91_PHYMSK      19
00349 
00350 #define LAN91_PHYMSK_MINT     0x8000  
00351 #define LAN91_PHYMSK_MLNKFAIL 0x4000  
00352 #define LAN91_PHYMSK_MLOSSSYN 0x2000  
00353 #define LAN91_PHYMSK_MCWRD    0x1000  
00354 #define LAN91_PHYMSK_MSSD     0x0800  
00355 #define LAN91_PHYMSK_MESD     0x0400  
00356 #define LAN91_PHYMSK_MRPOL    0x0200  
00357 #define LAN91_PHYMSK_MJAB     0x0100  
00358 #define LAN91_PHYMSK_MSPDDT   0x0080  
00359 #define LAN91_PHYMSK_MDPLDT   0x0040  
00362 
00363 
00364 __BEGIN_DECLS
00365 
00366 /*
00367  * Available drivers.
00368  */
00369 extern NUTDEVICE devLan91;
00370 
00371 #ifndef DEV_ETHER
00372 #define DEV_ETHER   devLan91
00373 #endif
00374 
00375 
00376 __END_DECLS
00377 
00378 #endif