cardbusreg.h revision 1.2.24.1       1  1.2.24.1  yamt /*	$NetBSD: cardbusreg.h,v 1.2.24.1 2010/03/11 15:03:25 yamt Exp $ */
      2       1.1  haya 
      3       1.1  haya /*
      4       1.1  haya  * Copyright (c) 2001
      5       1.1  haya  *       HAYAKAWA Koichi.  All rights reserved.
      6       1.1  haya  *
      7       1.1  haya  * Redistribution and use in source and binary forms, with or without
      8       1.1  haya  * modification, are permitted provided that the following conditions
      9       1.1  haya  * are met:
     10       1.1  haya  * 1. Redistributions of source code must retain the above copyright
     11       1.1  haya  *    notice, this list of conditions and the following disclaimer.
     12       1.1  haya  * 2. Redistributions in binary form must reproduce the above copyright
     13       1.1  haya  *    notice, this list of conditions and the following disclaimer in the
     14       1.1  haya  *    documentation and/or other materials provided with the distribution.
     15       1.1  haya  *
     16       1.1  haya  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     17       1.1  haya  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     18       1.1  haya  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
     19       1.1  haya  * DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
     20       1.1  haya  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
     21       1.1  haya  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
     22       1.1  haya  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     23       1.1  haya  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     24       1.1  haya  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
     25       1.1  haya  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     26       1.1  haya  * POSSIBILITY OF SUCH DAMAGE.
     27       1.1  haya  */
     28       1.1  haya 
     29       1.1  haya #ifndef _DEV_CARDBUS_CARDBUSREG_H_
     30       1.1  haya #define _DEV_CARDBUS_CARDBUSREG_H_
     31       1.1  haya 
     32       1.1  haya #include <dev/pci/pcivar.h>	/* for pcitag_t */
     33       1.1  haya 
     34       1.1  haya typedef int cardbus_intr_line_t;
     35       1.1  haya 
     36       1.1  haya /* Base Resisters */
     37       1.1  haya #define CARDBUS_CIS_REG    0x28
     38       1.1  haya #define CARDBUS_ROM_REG	   0x30
     39       1.1  haya #  define CARDBUS_CIS_ASIMASK 0x07
     40       1.1  haya #    define CARDBUS_CIS_ASI(x) (CARDBUS_CIS_ASIMASK & (x))
     41       1.1  haya #  define CARDBUS_CIS_ASI_TUPLE 0x00
     42       1.1  haya #  define CARDBUS_CIS_ASI_BAR0  0x01
     43       1.1  haya #  define CARDBUS_CIS_ASI_BAR1  0x02
     44       1.1  haya #  define CARDBUS_CIS_ASI_BAR2  0x03
     45       1.1  haya #  define CARDBUS_CIS_ASI_BAR3  0x04
     46       1.1  haya #  define CARDBUS_CIS_ASI_BAR4  0x05
     47       1.1  haya #  define CARDBUS_CIS_ASI_BAR5  0x06
     48       1.1  haya #  define CARDBUS_CIS_ASI_ROM   0x07
     49       1.1  haya #  define CARDBUS_CIS_ADDRMASK 0x0ffffff8
     50       1.1  haya #    define CARDBUS_CIS_ADDR(x) (CARDBUS_CIS_ADDRMASK & (x))
     51  1.2.24.1  yamt #    define CARDBUS_CIS_ASI_BAR(x) (((CARDBUS_CIS_ASIMASK & (x))-1)*4+PCI_BAR0)
     52       1.1  haya #    define CARDBUS_CIS_ASI_ROM_IMAGE(x) (((x) >> 28) & 0xf)
     53       1.1  haya 
     54       1.1  haya #endif /* !_DEV_CARDBUS_CARDBUSREG_H_ */
     55