#if !defined(PCI_H) && defined(CONFIG_PCI)
#define PCI_H
/*
** Support for NE2000 PCI clones added David Monro June 1997
** Generalised for other PCI NICs by Ken Yap July 1997
**
** Most of this is taken from:
**
*/
/*
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2, or (at
* your option) any later version.
*/
#include "pci_ids.h"
#define PCI_HEADER_TYPE_NORMAL 0
/* Header type 0 (normal devices) */
#ifndef PCI_BASE_ADDRESS_IO_MASK
#endif
#ifndef PCI_BASE_ADDRESS_MEM_MASK
#endif
bits 31..11 are address,
10..2 are reserved */
/* Header type 1 (PCI-to-PCI bridges) */
/* 0x34 same as for htype 0 */
/* 0x35-0x3b is reserved */
/* 0x3c-0x3d are same as for htype 0 */
/* Capability lists */
/* Power Management Registers */
/* AGP registers */
/* Slot Identification */
/* Message Signalled Interrupts registers */
/* PCI signature: "PCI " */
/* PCI service signature: "$PCI" */
union bios32 {
struct {
} fields;
};
struct pci_device;
struct dev;
struct pci_device {
const char *name;
/* membase and ioaddr are silly and depricated */
unsigned int membase;
unsigned int ioaddr;
unsigned int romaddr;
unsigned char irq;
unsigned char devfn;
unsigned char bus;
unsigned char use_specified;
};
extern int pcibios_read_config_byte(unsigned int bus, unsigned int device_fn, unsigned int where, uint8_t *value);
extern int pcibios_write_config_byte (unsigned int bus, unsigned int device_fn, unsigned int where, uint8_t value);
extern int pcibios_read_config_word(unsigned int bus, unsigned int device_fn, unsigned int where, uint16_t *value);
extern int pcibios_write_config_word (unsigned int bus, unsigned int device_fn, unsigned int where, uint16_t value);
extern int pcibios_read_config_dword(unsigned int bus, unsigned int device_fn, unsigned int where, uint32_t *value);
extern int pcibios_write_config_dword(unsigned int bus, unsigned int device_fn, unsigned int where, uint32_t value);
extern unsigned long pcibios_bus_base(unsigned int bus);
extern void adjust_pci_device(struct pci_device *p);
static inline int
{
}
static inline int
{
}
static inline int
{
}
static inline int
{
}
static inline int
{
}
static inline int
{
}
/* Helper functions to find the size of a pci bar */
/* Helper function to find pci capabilities */
struct pci_id {
const char *name;
};
struct dev;
/* Most pci drivers will use this */
struct pci_driver {
int type;
const char *name;
int id_count;
/* On a few occasions the hardware is standardized enough that
* we only need to know the class of the device and not the exact
* type to drive the device correctly. If this is the case
* set a class value other than 0.
*/
unsigned short class;
};
#endif /* PCI_H */