Home | History | Annotate | Line # | Download | only in ppbus
ppbus_io.h revision 1.1.1.1
      1 /*-
      2  * Copyright (c) 1999 Nicolas Souchu
      3  * 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  *
     14  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
     15  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     16  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     17  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
     18  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     19  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     20  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     21  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     22  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     23  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     24  * SUCH DAMAGE.
     25  *
     26  * $FreeBSD: src/sys/dev/ppbus/ppbio.h,v 1.1 2000/01/14 00:17:57 nsouch Exp $
     27  *
     28  */
     29 
     30 #ifndef __PPBUS_IO_H
     31 #define __PPBUS_IO_H
     32 
     33 /* Parallel port bus I/O opcodes */
     34 #define PPBUS_OUTSB_EPP 1
     35 #define PPBUS_OUTSW_EPP 2
     36 #define PPBUS_OUTSL_EPP 3
     37 #define PPBUS_INSB_EPP  4
     38 #define PPBUS_INSW_EPP  5
     39 #define PPBUS_INSL_EPP  6
     40 #define PPBUS_RDTR      7
     41 #define PPBUS_RSTR      8
     42 #define PPBUS_RCTR      9
     43 #define PPBUS_REPP_A    10
     44 #define PPBUS_REPP_D    11
     45 #define PPBUS_RECR      12
     46 #define PPBUS_RFIFO     13
     47 #define PPBUS_WDTR      14
     48 #define PPBUS_WSTR      15
     49 #define PPBUS_WCTR      16
     50 #define PPBUS_WEPP_A    17
     51 #define PPBUS_WEPP_D    18
     52 #define PPBUS_WECR      19
     53 #define PPBUS_WFIFO     20
     54 
     55 
     56 #ifdef _KERNEL
     57 
     58 /*
     59  * Set of ppbus i/o routines callable from ppbus device drivers
     60  */
     61 
     62 #define ppbus_outsb_epp(dev,buf,cnt) \
     63 		ppbus_io((dev), PPBUS_OUTSB_EPP, (buf), (cnt), 0)
     64 
     65 #define ppbus_outsw_epp(dev,buf,cnt) \
     66 		ppbus_io((dev), PPBUS_OUTSW_EPP, (buf), (cnt), 0)
     67 
     68 #define ppbus_outsl_epp(dev,buf,cnt) \
     69 		ppbus_io((dev), PPBUS_OUTSL_EPP, (buf), (cnt), 0)
     70 
     71 #define ppbus_insb_epp(dev,buf,cnt) \
     72 		ppbus_io((dev), PPBUS_INSB_EPP, (buf), (cnt), 0)
     73 
     74 #define ppbus_insw_epp(dev,buf,cnt) \
     75 		ppbus_io(( dev), PPBUS_INSW_EPP, (buf), (cnt), 0)
     76 
     77 #define ppbus_insl_epp(dev,buf,cnt) \
     78 		ppbus_io((dev), PPBUS_INSL_EPP, (buf), (cnt), 0))
     79 
     80 #define ppbus_repp_A(dev) \
     81 		ppbus_io((dev), PPBUS_REPP_A, NULL, 0, 0)
     82 
     83 #define ppbus_repp_D(dev) \
     84 		ppbus_io((dev), PPBUS_REPP_D, NULL, 0, 0)
     85 
     86 #define ppbus_recr(dev)	\
     87 		ppbus_io((dev), PPBUS_RECR, NULL, 0, 0)
     88 
     89 #define ppbus_rfifo(dev) \
     90 		ppbus_io((dev), PPBUS_RFIFO, NULL, 0, 0)
     91 
     92 #define ppbus_wepp_A(dev,byte) \
     93 		ppbus_io((dev), PPBUS_WEPP_A, NULL, 0, (byte))
     94 
     95 #define ppbus_wepp_D(dev,byte) \
     96 		ppbus_io((dev), PPBUS_WEPP_D, NULL, 0, (byte))
     97 
     98 #define ppbus_wecr(dev,byte) \
     99 		ppbus_io((dev), PPBUS_WECR, NULL, 0, (byte))
    100 
    101 #define ppbus_wfifo(dev,byte) \
    102 		ppbus_io((dev), PPBUS_WFIFO, NULL, 0, (byte))
    103 
    104 #define ppbus_rdtr(dev) \
    105 		ppbus_io((dev), PPBUS_RDTR, NULL, 0, 0)
    106 
    107 #define ppbus_rstr(dev) \
    108 		ppbus_io((dev), PPBUS_RSTR, NULL, 0, 0)
    109 
    110 #define ppbus_rctr(dev) \
    111 		ppbus_io((dev), PPBUS_RCTR, NULL, 0, 0)
    112 
    113 #define ppbus_wdtr(dev,byte) \
    114 		ppbus_io((dev), PPBUS_WDTR, NULL, 0, (byte))
    115 
    116 #define ppbus_wstr(dev,byte) \
    117 		ppbus_io((dev), PPBUS_WSTR, NULL, 0, (byte))
    118 
    119 #define ppbus_wctr(dev,byte) \
    120 		ppbus_io((dev), PPBUS_WCTR, NULL, 0, (byte))
    121 
    122 #endif /* _KERNEL */
    123 
    124 #endif /* __PPBUS_IO_H */
    125