2004-06-07 03:52:08 +04:00
|
|
|
/*
|
2008-05-26 20:52:27 +04:00
|
|
|
* Copyright 2008, Haiku Inc. All rights reserved.
|
2005-05-12 07:27:44 +04:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2004-06-07 03:52:08 +04:00
|
|
|
#ifndef _PCI2_H
|
|
|
|
#define _PCI2_H
|
|
|
|
|
2008-05-26 20:52:27 +04:00
|
|
|
|
2004-06-07 03:52:08 +04:00
|
|
|
#include <device_manager.h>
|
|
|
|
#include <PCI.h>
|
|
|
|
|
|
|
|
|
2008-05-26 20:52:27 +04:00
|
|
|
typedef struct pci_device pci_device;
|
2004-06-07 03:52:08 +04:00
|
|
|
|
|
|
|
typedef struct pci_device_module_info {
|
2005-01-12 02:19:41 +03:00
|
|
|
driver_module_info info;
|
2004-06-07 03:52:08 +04:00
|
|
|
|
2008-05-26 20:52:27 +04:00
|
|
|
uint8 (*read_io_8)(pci_device *device, addr_t mappedIOAddress);
|
|
|
|
void (*write_io_8)(pci_device *device, addr_t mappedIOAddress,
|
|
|
|
uint8 value);
|
|
|
|
uint16 (*read_io_16)(pci_device *device, addr_t mappedIOAddress);
|
|
|
|
void (*write_io_16)(pci_device *device, addr_t mappedIOAddress,
|
|
|
|
uint16 value);
|
|
|
|
uint32 (*read_io_32)(pci_device *device, addr_t mappedIOAddress);
|
|
|
|
void (*write_io_32)(pci_device *device, addr_t mappedIOAddress,
|
|
|
|
uint32 value);
|
|
|
|
|
2017-11-21 23:28:49 +03:00
|
|
|
phys_addr_t (*ram_address)(pci_device *device, phys_addr_t physicalAddress);
|
2008-05-26 20:52:27 +04:00
|
|
|
|
2013-06-24 21:12:41 +04:00
|
|
|
uint32 (*read_pci_config)(pci_device *device, uint16 offset,
|
2008-05-26 20:52:27 +04:00
|
|
|
uint8 size);
|
2013-06-24 21:12:41 +04:00
|
|
|
void (*write_pci_config)(pci_device *device, uint16 offset,
|
2008-05-26 20:52:27 +04:00
|
|
|
uint8 size, uint32 value);
|
|
|
|
status_t (*find_pci_capability)(pci_device *device, uint8 capID,
|
|
|
|
uint8 *offset);
|
|
|
|
void (*get_pci_info)(pci_device *device, struct pci_info *info);
|
2013-06-24 21:12:41 +04:00
|
|
|
status_t (*find_pci_extended_capability)(pci_device *device, uint16 capID,
|
|
|
|
uint16 *offset);
|
2004-06-07 03:52:08 +04:00
|
|
|
} pci_device_module_info;
|
|
|
|
|
|
|
|
|
2008-05-26 20:52:27 +04:00
|
|
|
/* Attributes of PCI device nodes */
|
|
|
|
#define B_PCI_DEVICE_DOMAIN "pci/domain" /* uint32 */
|
|
|
|
#define B_PCI_DEVICE_BUS "pci/bus" /* uint8 */
|
|
|
|
#define B_PCI_DEVICE_DEVICE "pci/device" /* uint8 */
|
|
|
|
#define B_PCI_DEVICE_FUNCTION "pci/function" /* uint8 */
|
2004-06-07 03:52:08 +04:00
|
|
|
|
2008-05-26 20:52:27 +04:00
|
|
|
#endif /* _PCI2_H */
|