Subversion Repositories shark

Rev

Rev 636 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
636 giacomo 1
/*
2
 * Project: S.Ha.R.K.
3
 *
4
 * Coordinators:
5
 *   Giorgio Buttazzo    <giorgio@sssup.it>
6
 *   Paolo Gai           <pj@gandalf.sssup.it>
7
 *
8
 * Authors     :
9
 *   Paolo Gai           <pj@gandalf.sssup.it>
10
 *   Massimiliano Giorgi <massy@gandalf.sssup.it>
11
 *   Luca Abeni          <luca@gandalf.sssup.it>
12
 *   (see the web pages for full authors list)
13
 *
14
 * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
15
 *
16
 * http://www.sssup.it
17
 * http://retis.sssup.it
18
 * http://shark.sssup.it
19
 */
629 giacomo 20
 
636 giacomo 21
/**
22
 ------------
23
 CVS :        $Id: pci.h,v 1.2 2004-05-11 16:03:40 giacomo Exp $
629 giacomo 24
 
636 giacomo 25
 File:        $File$
26
 Revision:    $Revision: 1.2 $
27
 Last update: $Date: 2004-05-11 16:03:40 $
28
 ------------
629 giacomo 29
 
636 giacomo 30
**/
629 giacomo 31
 
636 giacomo 32
/*
33
 * Copyright (C) 2000 Luca Abeni
34
 *
35
 * This program is free software; you can redistribute it and/or modify
36
 * it under the terms of the GNU General Public License as published by
37
 * the Free Software Foundation; either version 2 of the License, or
38
 * (at your option) any later version.
39
 *
40
 * This program is distributed in the hope that it will be useful,
41
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
42
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
43
 * GNU General Public License for more details.
44
 *
45
 * You should have received a copy of the GNU General Public License
46
 * along with this program; if not, write to the Free Software
47
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
48
 *
49
 */
629 giacomo 50
 
636 giacomo 51
/* Project:     HARTIK 3.0 Network Library                      */
52
/* Description: Hard Real TIme Kernel for 8086 compatible       */
53
/* Author:      Luca Abeni                                      */
54
/* Date:        14/4/1997                                       */
55
 
56
/* File:        PCI.H                                           */
57
/* Revision:    1.02                                            */
629 giacomo 58
 
636 giacomo 59
#ifndef __PCI_H__
60
#define __PCI_H__
61
 
62
#include <linux/llpci.h>
63
#include <linux/linuxpci.h>
64
 
65
#ifdef __cplusplus
66
extern "C" {
629 giacomo 67
#endif
68
 
636 giacomo 69
#define N_MAX_DEVS 10
629 giacomo 70
 
636 giacomo 71
typedef struct pci_regs {
72
        WORD VendorId;
73
        WORD DeviceId;
74
        WORD PciCommand;
75
        WORD PciStatus;
76
        BYTE reserved1;
77
        BYTE dummy;
78
        WORD ClassCode;
79
        BYTE reserved2;
80
        BYTE LatencyTimer;
81
        BYTE HeaderType;
82
        BYTE reserved3;
83
        DWORD IoBaseAddress;
84
        DWORD reserved4;
85
        DWORD reserved5;
86
        DWORD reserved6;
87
        DWORD reserved7;
88
        DWORD reserved8;
89
        DWORD reserved9;
90
        DWORD reserved10;
91
        DWORD BiosRomControl;
92
        DWORD reserved11;
93
        DWORD reserver12;
94
        BYTE InterruptLine;
95
        BYTE InterruptPin;
96
        BYTE MinGnt;
97
        BYTE MaxLat;
98
        DWORD InternalConfig;
99
} PCI_REGS;
100
 
101
typedef struct pci_des {
102
                BYTE bus;
103
                BYTE dev;
104
                BYTE mem[256];
105
} PCI_DES;
106
 
107
/*
108
 * Error values that may be returned by the PCI bios.  Use
109
 * pcibios_strerror() to convert to a printable string.
110
 */
111
#define PCIBIOS_SUCCESSFUL              0x00
112
#define PCIBIOS_FUNC_NOT_SUPPORTED      0x81
113
#define PCIBIOS_BAD_VENDOR_ID           0x83
114
#define PCIBIOS_DEVICE_NOT_FOUND        0x86
115
#define PCIBIOS_BAD_REGISTER_NUMBER     0x87
116
#define PCIBIOS_SET_FAILED              0x88
117
#define PCIBIOS_BUFFER_TOO_SMALL        0x89
118
 
119
 
120
/*int pci_detect(struct pci_des *p_des);
121
void pci_show(struct pci_des *PCIdes, int n);*/
122
int pci_init(void);
123
void pci_show(void);
124
int scan_bus(struct pci_des *p_des);
125
struct pci_regs *pci_class(DWORD class_code, WORD index, BYTE *bus, BYTE *dev);
126
struct pci_regs *pci_device(WORD vendor, WORD device, WORD index, BYTE *bus, BYTE *dev);
127
 
128
#ifdef __cplusplus
129
};
130
#endif
131
 
132
#endif
133