Staging: Add pristine upstream vt6656 driver sources to drivers/staging/vt6656.
[firewire-audio.git] / drivers / staging / vt6656 / tpci.h
blob3a04845cbb51bcb343eeb4fb3a9f33f39d92a4ed
1 /*
2 * Copyright (c) 1996, 2003 VIA Networking Technologies, Inc.
3 * All rights reserved.
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License along
17 * with this program; if not, write to the Free Software Foundation, Inc.,
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 * File: tpci.h
24 * Purpose: PCI routines
26 * Author: Tevin Chen
28 * Date: May 21, 1996
33 #ifndef __TPCI_H__
34 #define __TPCI_H__
36 #if !defined(__TTYPE_H__)
37 #include "ttype.h"
38 #endif
43 /*--------------------- Export Definitions -------------------------*/
44 #define MAX_PCI_BUS 4 // max. # of PCI bus that we support
45 #define MAX_PCI_DEVICE 32 // max. # of PCI devices
49 // Registers in the PCI configuration space
51 #define PCI_REG_VENDOR_ID 0x00 //
52 #define PCI_REG_DEVICE_ID 0x02 //
53 #define PCI_REG_COMMAND 0x04 //
54 #define PCI_REG_STATUS 0x06 //
55 #define PCI_REG_REV_ID 0x08 //
56 #define PCI_REG_CLASS_CODE 0x09 //
57 #define PCI_REG_CACHELINE_SIZE 0x0C //
58 #define PCI_REG_LAT_TIMER 0x0D //
59 #define PCI_REG_HDR_TYPE 0x0E //
60 #define PCI_REG_BIST 0x0F //
62 #define PCI_REG_BAR0 0x10 //
63 #define PCI_REG_BAR1 0x14 //
64 #define PCI_REG_BAR2 0x18 //
65 #define PCI_REG_CARDBUS_CIS_PTR 0x28 //
67 #define PCI_REG_SUB_VEN_ID 0x2C //
68 #define PCI_REG_SUB_SYS_ID 0x2E //
69 #define PCI_REG_EXP_ROM_BAR 0x30 //
70 #define PCI_REG_CAP 0x34 //
72 #define PCI_REG_INT_LINE 0x3C //
73 #define PCI_REG_INT_PIN 0x3D //
74 #define PCI_REG_MIN_GNT 0x3E //
75 #define PCI_REG_MAX_LAT 0x3F //
77 #define PCI_REG_MAX_SIZE 0x100 // maximun total PCI registers
81 // Bits in the COMMAND register
83 #define COMMAND_BUSM 0x04 //
84 #define COMMAND_WAIT 0x80 //
86 /*--------------------- Export Types ------------------------------*/
88 /*--------------------- Export Macros ------------------------------*/
90 // macro MAKE Bus Dev Fun ID into WORD
91 #define MAKE_BDF_TO_WORD(byBusId, byDevId, byFunId) \
92 MAKEWORD( \
93 ((((BYTE)(byDevId)) & 0x1F) << 3) + \
94 (((BYTE)(byFunId)) & 0x07), \
95 (byBusId) \
98 #define GET_BUSID(wBusDevFunId) \
99 HIBYTE(wBusDevFunId)
101 #define GET_DEVID(wBusDevFunId) \
102 (LOBYTE(wBusDevFunId) >> 3)
104 #define GET_FUNID(wBusDevFunId) \
105 (LOBYTE(wBusDevFunId) & 0x07)
108 /*--------------------- Export Classes ----------------------------*/
110 /*--------------------- Export Variables --------------------------*/
112 /*--------------------- Export Functions --------------------------*/
117 #endif // __TPCI_H__