Home | History | Annotate | Line # | Download | only in isa
      1  1.5  christos /*	$NetBSD: if_egreg.h,v 1.5 2005/12/11 12:22:02 christos Exp $	*/
      2  1.2       cgd 
      3  1.1   deraadt /*
      4  1.1   deraadt  * Copyright (c) 1993 Dean Huxley (dean (at) fsa.ca)
      5  1.1   deraadt  * All rights reserved.
      6  1.1   deraadt  *
      7  1.1   deraadt  * Redistribution and use in source and binary forms, with or without
      8  1.1   deraadt  * modification, are permitted provided that the following conditions
      9  1.1   deraadt  * are met:
     10  1.1   deraadt  * 1. Redistributions of source code must retain the above copyright
     11  1.1   deraadt  *    notice, this list of conditions and the following disclaimer.
     12  1.1   deraadt  * 2. Redistributions in binary form must reproduce the above copyright
     13  1.1   deraadt  *    notice, this list of conditions and the following disclaimer in the
     14  1.1   deraadt  *    documentation and/or other materials provided with the distribution.
     15  1.1   deraadt  * 3. All advertising materials mentioning features or use of this software
     16  1.1   deraadt  *    must display the following acknowledgement:
     17  1.1   deraadt  *      This product includes software developed by Dean Huxley.
     18  1.1   deraadt  * 4. The name of Dean Huxley may not be used to endorse or promote products
     19  1.1   deraadt  *    derived from this software without specific prior written permission.
     20  1.1   deraadt  *
     21  1.1   deraadt  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     22  1.1   deraadt  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     23  1.1   deraadt  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     24  1.1   deraadt  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     25  1.1   deraadt  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     26  1.1   deraadt  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     27  1.1   deraadt  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     28  1.1   deraadt  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     29  1.1   deraadt  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     30  1.1   deraadt  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     31  1.1   deraadt  */
     32  1.1   deraadt 
     33  1.1   deraadt /*
     34  1.1   deraadt  * Register offsets from base.
     35  1.1   deraadt  */
     36  1.1   deraadt #define EG_COMMAND	0x00
     37  1.1   deraadt #define EG_STATUS	0x02
     38  1.1   deraadt #define EG_DATA		0x04
     39  1.1   deraadt #define EG_CONTROL	0x06
     40  1.1   deraadt 
     41  1.1   deraadt /*
     42  1.1   deraadt  * Host Control Register bits
     43  1.1   deraadt  * EG_CTL_ATTN - does a soft reset
     44  1.1   deraadt  * EG_CTL_FLSH - flushes the data register
     45  1.1   deraadt  * EG_CTL_RESET - does a hard reset
     46  1.1   deraadt  * EG_CTL_DMAE - Used with DIR bit, enables DMA transfers to/from data reg.
     47  1.1   deraadt  * EG_CTL_DIR  - if clear then host -> adapter, if set then adapter -> host
     48  1.1   deraadt  * EG_CTL_TCEN - terminal count enable. enables host interrupt after DMA.
     49  1.1   deraadt  * EG_CTL_CMDE - command reg interrupt enable. (when it is written)
     50  1.1   deraadt  * EG_CTL_HSF1 - Host status flag 1
     51  1.1   deraadt  * EG_CTL_HSF2 - Host status flag 2
     52  1.1   deraadt  */
     53  1.1   deraadt 
     54  1.1   deraadt #define EG_CTL_ATTN 0x80
     55  1.1   deraadt #define EG_CTL_FLSH 0x40
     56  1.1   deraadt #define EG_CTL_RESET (EG_CTL_ATTN|EG_CTL_FLSH)
     57  1.1   deraadt #define EG_CTL_DMAE 0x20
     58  1.1   deraadt #define EG_CTL_DIR  0x10
     59  1.1   deraadt #define EG_CTL_TCEN 0x08
     60  1.1   deraadt #define EG_CTL_CMDE 0x04
     61  1.1   deraadt #define EG_CTL_HSF2 0x02
     62  1.1   deraadt #define EG_CTL_HSF1 0x01
     63  1.1   deraadt 
     64  1.1   deraadt /*
     65  1.1   deraadt  * Host Status Register bits
     66  1.4     perry  * EG_STAT_HRDY - Data Register ready
     67  1.1   deraadt  * EG_STAT_HCRE - Host Command Register empty
     68  1.1   deraadt  * EG_STAT_ACRF - Adapter Command register full
     69  1.1   deraadt  * EG_STAT_DIR  - Direction flag, 0 = host -> adapter, 1 = adapter -> host
     70  1.1   deraadt  * EG_STAT_DONE - DMA done
     71  1.1   deraadt  * EG_STAT_ASF1 - Adapter status flag 1
     72  1.1   deraadt  * EG_STAT_ASF2 - Adapter status flag 2
     73  1.1   deraadt  * EG_STAT_ASF3 - Adapter status flag 3
     74  1.1   deraadt  */
     75  1.1   deraadt 
     76  1.1   deraadt #define EG_STAT_HRDY 0x80
     77  1.1   deraadt #define EG_STAT_HCRE 0x40
     78  1.1   deraadt #define EG_STAT_ACRF 0x20
     79  1.1   deraadt #define EG_STAT_DIR  0x10
     80  1.1   deraadt #define EG_STAT_DONE 0x08
     81  1.1   deraadt #define EG_STAT_ASF3 0x04
     82  1.1   deraadt #define EG_STAT_ASF2 0x02
     83  1.1   deraadt #define EG_STAT_ASF1 0x01
     84  1.1   deraadt 
     85  1.3   mycroft #define	EG_PCB_NULL	0x00
     86  1.4     perry #define EG_PCB_ACCEPT	0x01
     87  1.3   mycroft #define EG_PCB_REJECT	0x02
     88  1.3   mycroft #define EG_PCB_DONE	0x03
     89  1.3   mycroft #define EG_PCB_STAT	0x03
     90  1.1   deraadt 
     91  1.1   deraadt #define EG_CMD_CONFIG82586	0x02
     92  1.1   deraadt #define EG_CMD_GETEADDR		0x03
     93  1.1   deraadt #define EG_CMD_RECVPACKET	0x08
     94  1.1   deraadt #define EG_CMD_SENDPACKET	0x09
     95  1.1   deraadt #define EG_CMD_GETSTATS		0x0a
     96  1.1   deraadt #define EG_CMD_SETEADDR		0x10
     97  1.1   deraadt #define EG_CMD_GETINFO		0x11
     98  1.1   deraadt 
     99  1.1   deraadt #define EG_RSP_CONFIG82586	0x32
    100  1.1   deraadt #define EG_RSP_GETEADDR		0x33
    101  1.1   deraadt #define EG_RSP_RECVPACKET	0x38
    102  1.1   deraadt #define EG_RSP_SENDPACKET	0x39
    103  1.1   deraadt #define EG_RSP_GETSTATS		0x3a
    104  1.1   deraadt #define EG_RSP_SETEADDR		0x40
    105  1.1   deraadt #define EG_RSP_GETINFO		0x41
    106