pciaccess.h revision 4f5e7dd7
14f5e7dd7Smrg/*
24f5e7dd7Smrg * (C) Copyright IBM Corporation 2006
34f5e7dd7Smrg * All Rights Reserved.
44f5e7dd7Smrg *
54f5e7dd7Smrg * Permission is hereby granted, free of charge, to any person obtaining a
64f5e7dd7Smrg * copy of this software and associated documentation files (the "Software"),
74f5e7dd7Smrg * to deal in the Software without restriction, including without limitation
84f5e7dd7Smrg * on the rights to use, copy, modify, merge, publish, distribute, sub
94f5e7dd7Smrg * license, and/or sell copies of the Software, and to permit persons to whom
104f5e7dd7Smrg * the Software is furnished to do so, subject to the following conditions:
114f5e7dd7Smrg *
124f5e7dd7Smrg * The above copyright notice and this permission notice (including the next
134f5e7dd7Smrg * paragraph) shall be included in all copies or substantial portions of the
144f5e7dd7Smrg * Software.
154f5e7dd7Smrg *
164f5e7dd7Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
174f5e7dd7Smrg * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
184f5e7dd7Smrg * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.  IN NO EVENT SHALL
194f5e7dd7Smrg * IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
204f5e7dd7Smrg * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
214f5e7dd7Smrg * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
224f5e7dd7Smrg * DEALINGS IN THE SOFTWARE.
234f5e7dd7Smrg */
244f5e7dd7Smrg
254f5e7dd7Smrg/**
264f5e7dd7Smrg * \file pciaccess.h
274f5e7dd7Smrg *
284f5e7dd7Smrg * \author Ian Romanick <idr@us.ibm.com>
294f5e7dd7Smrg */
304f5e7dd7Smrg
314f5e7dd7Smrg#ifndef PCIACCESS_H
324f5e7dd7Smrg#define PCIACCESS_H
334f5e7dd7Smrg
344f5e7dd7Smrg#include <inttypes.h>
354f5e7dd7Smrg
364f5e7dd7Smrg#if __GNUC__ >= 3
374f5e7dd7Smrg#define __deprecated __attribute__((deprecated))
384f5e7dd7Smrg#else
394f5e7dd7Smrg#define __deprecated
404f5e7dd7Smrg#endif
414f5e7dd7Smrg
424f5e7dd7Smrgtypedef uint64_t pciaddr_t;
434f5e7dd7Smrg
444f5e7dd7Smrgstruct pci_device;
454f5e7dd7Smrgstruct pci_device_iterator;
464f5e7dd7Smrgstruct pci_id_match;
474f5e7dd7Smrgstruct pci_slot_match;
484f5e7dd7Smrg
494f5e7dd7Smrg#ifdef __cplusplus
504f5e7dd7Smrgextern "C" {
514f5e7dd7Smrg#endif
524f5e7dd7Smrg
534f5e7dd7Smrgint pci_device_read_rom(struct pci_device *dev, void *buffer);
544f5e7dd7Smrg
554f5e7dd7Smrgint  __deprecated pci_device_map_region(struct pci_device *dev,
564f5e7dd7Smrg    unsigned region, int write_enable);
574f5e7dd7Smrg
584f5e7dd7Smrgint __deprecated pci_device_unmap_region(struct pci_device *dev,
594f5e7dd7Smrg    unsigned region);
604f5e7dd7Smrg
614f5e7dd7Smrgint pci_device_map_range(struct pci_device *dev, pciaddr_t base,
624f5e7dd7Smrg    pciaddr_t size, unsigned map_flags, void **addr);
634f5e7dd7Smrg
644f5e7dd7Smrgint pci_device_unmap_range(struct pci_device *dev, void *memory,
654f5e7dd7Smrg    pciaddr_t size);
664f5e7dd7Smrg
674f5e7dd7Smrgint __deprecated pci_device_map_memory_range(struct pci_device *dev,
684f5e7dd7Smrg    pciaddr_t base, pciaddr_t size, int write_enable, void **addr);
694f5e7dd7Smrg
704f5e7dd7Smrgint __deprecated pci_device_unmap_memory_range(struct pci_device *dev,
714f5e7dd7Smrg    void *memory, pciaddr_t size);
724f5e7dd7Smrg
734f5e7dd7Smrgint pci_device_probe(struct pci_device *dev);
744f5e7dd7Smrg
754f5e7dd7Smrgconst struct pci_agp_info *pci_device_get_agp_info(struct pci_device *dev);
764f5e7dd7Smrg
774f5e7dd7Smrgconst struct pci_bridge_info *pci_device_get_bridge_info(
784f5e7dd7Smrg    struct pci_device *dev);
794f5e7dd7Smrg
804f5e7dd7Smrgconst struct pci_pcmcia_bridge_info *pci_device_get_pcmcia_bridge_info(
814f5e7dd7Smrg    struct pci_device *dev);
824f5e7dd7Smrg
834f5e7dd7Smrgint pci_device_get_bridge_buses(struct pci_device *dev, int *primary_bus,
844f5e7dd7Smrg    int *secondary_bus, int *subordinate_bus);
854f5e7dd7Smrg
864f5e7dd7Smrgint pci_system_init(void);
874f5e7dd7Smrg
884f5e7dd7Smrgvoid pci_system_init_dev_mem(int fd);
894f5e7dd7Smrg
904f5e7dd7Smrgvoid pci_system_cleanup(void);
914f5e7dd7Smrg
924f5e7dd7Smrgstruct pci_device_iterator *pci_slot_match_iterator_create(
934f5e7dd7Smrg    const struct pci_slot_match *match);
944f5e7dd7Smrg
954f5e7dd7Smrgstruct pci_device_iterator *pci_id_match_iterator_create(
964f5e7dd7Smrg    const struct pci_id_match *match);
974f5e7dd7Smrg
984f5e7dd7Smrgvoid pci_iterator_destroy(struct pci_device_iterator *iter);
994f5e7dd7Smrg
1004f5e7dd7Smrgstruct pci_device *pci_device_next(struct pci_device_iterator *iter);
1014f5e7dd7Smrg
1024f5e7dd7Smrgstruct pci_device *pci_device_find_by_slot(uint32_t domain, uint32_t bus,
1034f5e7dd7Smrg    uint32_t dev, uint32_t func);
1044f5e7dd7Smrg
1054f5e7dd7Smrgvoid pci_get_strings(const struct pci_id_match *m,
1064f5e7dd7Smrg    const char **device_name, const char **vendor_name,
1074f5e7dd7Smrg    const char **subdevice_name, const char **subvendor_name);
1084f5e7dd7Smrgconst char *pci_device_get_device_name(const struct pci_device *dev);
1094f5e7dd7Smrgconst char *pci_device_get_subdevice_name(const struct pci_device *dev);
1104f5e7dd7Smrgconst char *pci_device_get_vendor_name(const struct pci_device *dev);
1114f5e7dd7Smrgconst char *pci_device_get_subvendor_name(const struct pci_device *dev);
1124f5e7dd7Smrg
1134f5e7dd7Smrgvoid pci_device_enable(struct pci_device *dev);
1144f5e7dd7Smrg
1154f5e7dd7Smrgint pci_device_cfg_read    (struct pci_device *dev, void *data,
1164f5e7dd7Smrg    pciaddr_t offset, pciaddr_t size, pciaddr_t *bytes_read);
1174f5e7dd7Smrgint pci_device_cfg_read_u8 (struct pci_device *dev, uint8_t  *data,
1184f5e7dd7Smrg    pciaddr_t offset);
1194f5e7dd7Smrgint pci_device_cfg_read_u16(struct pci_device *dev, uint16_t *data,
1204f5e7dd7Smrg    pciaddr_t offset);
1214f5e7dd7Smrgint pci_device_cfg_read_u32(struct pci_device *dev, uint32_t *data,
1224f5e7dd7Smrg    pciaddr_t offset);
1234f5e7dd7Smrg
1244f5e7dd7Smrgint pci_device_cfg_write    (struct pci_device *dev, const void *data,
1254f5e7dd7Smrg    pciaddr_t offset, pciaddr_t size, pciaddr_t *bytes_written);
1264f5e7dd7Smrgint pci_device_cfg_write_u8 (struct pci_device *dev, uint8_t  data,
1274f5e7dd7Smrg    pciaddr_t offset);
1284f5e7dd7Smrgint pci_device_cfg_write_u16(struct pci_device *dev, uint16_t data,
1294f5e7dd7Smrg    pciaddr_t offset);
1304f5e7dd7Smrgint pci_device_cfg_write_u32(struct pci_device *dev, uint32_t data,
1314f5e7dd7Smrg    pciaddr_t offset);
1324f5e7dd7Smrgint pci_device_cfg_write_bits(struct pci_device *dev, uint32_t mask,
1334f5e7dd7Smrg    uint32_t data, pciaddr_t offset);
1344f5e7dd7Smrg
1354f5e7dd7Smrg#ifdef __cplusplus
1364f5e7dd7Smrg}
1374f5e7dd7Smrg#endif
1384f5e7dd7Smrg
1394f5e7dd7Smrg/**
1404f5e7dd7Smrg * \name Mapping flags passed to \c pci_device_map_range
1414f5e7dd7Smrg */
1424f5e7dd7Smrg/*@{*/
1434f5e7dd7Smrg#define PCI_DEV_MAP_FLAG_WRITABLE       (1U<<0)
1444f5e7dd7Smrg#define PCI_DEV_MAP_FLAG_WRITE_COMBINE  (1U<<1)
1454f5e7dd7Smrg#define PCI_DEV_MAP_FLAG_CACHABLE       (1U<<2)
1464f5e7dd7Smrg/*@}*/
1474f5e7dd7Smrg
1484f5e7dd7Smrg
1494f5e7dd7Smrg#define PCI_MATCH_ANY  (~0)
1504f5e7dd7Smrg
1514f5e7dd7Smrg/**
1524f5e7dd7Smrg * Compare two PCI ID values (either vendor or device).  This is used
1534f5e7dd7Smrg * internally to compare the fields of \c pci_id_match to the fields of
1544f5e7dd7Smrg * \c pci_device.
1554f5e7dd7Smrg */
1564f5e7dd7Smrg#define PCI_ID_COMPARE(a, b) \
1574f5e7dd7Smrg    (((a) == PCI_MATCH_ANY) || ((a) == (b)))
1584f5e7dd7Smrg
1594f5e7dd7Smrg/**
1604f5e7dd7Smrg */
1614f5e7dd7Smrgstruct pci_id_match {
1624f5e7dd7Smrg    /**
1634f5e7dd7Smrg     * \name Device / vendor matching controls
1644f5e7dd7Smrg     *
1654f5e7dd7Smrg     * Control the search based on the device, vendor, subdevice, or subvendor
1664f5e7dd7Smrg     * IDs.  Setting any of these fields to \c PCI_MATCH_ANY will cause the
1674f5e7dd7Smrg     * field to not be used in the comparison.
1684f5e7dd7Smrg     */
1694f5e7dd7Smrg    /*@{*/
1704f5e7dd7Smrg    uint32_t    vendor_id;
1714f5e7dd7Smrg    uint32_t    device_id;
1724f5e7dd7Smrg    uint32_t    subvendor_id;
1734f5e7dd7Smrg    uint32_t    subdevice_id;
1744f5e7dd7Smrg    /*@}*/
1754f5e7dd7Smrg
1764f5e7dd7Smrg
1774f5e7dd7Smrg    /**
1784f5e7dd7Smrg     * \name Device class matching controls
1794f5e7dd7Smrg     *
1804f5e7dd7Smrg     */
1814f5e7dd7Smrg    /*@{*/
1824f5e7dd7Smrg    uint32_t    device_class;
1834f5e7dd7Smrg    uint32_t    device_class_mask;
1844f5e7dd7Smrg    /*@}*/
1854f5e7dd7Smrg
1864f5e7dd7Smrg    intptr_t    match_data;
1874f5e7dd7Smrg};
1884f5e7dd7Smrg
1894f5e7dd7Smrg
1904f5e7dd7Smrg/**
1914f5e7dd7Smrg */
1924f5e7dd7Smrgstruct pci_slot_match {
1934f5e7dd7Smrg    /**
1944f5e7dd7Smrg     * \name Device slot matching controls
1954f5e7dd7Smrg     *
1964f5e7dd7Smrg     * Control the search based on the domain, bus, slot, and function of
1974f5e7dd7Smrg     * the device.  Setting any of these fields to \c PCI_MATCH_ANY will cause
1984f5e7dd7Smrg     * the field to not be used in the comparison.
1994f5e7dd7Smrg     */
2004f5e7dd7Smrg    /*@{*/
2014f5e7dd7Smrg    uint32_t    domain;
2024f5e7dd7Smrg    uint32_t    bus;
2034f5e7dd7Smrg    uint32_t    dev;
2044f5e7dd7Smrg    uint32_t    func;
2054f5e7dd7Smrg    /*@}*/
2064f5e7dd7Smrg
2074f5e7dd7Smrg    intptr_t    match_data;
2084f5e7dd7Smrg};
2094f5e7dd7Smrg
2104f5e7dd7Smrg/**
2114f5e7dd7Smrg * BAR descriptor for a PCI device.
2124f5e7dd7Smrg */
2134f5e7dd7Smrgstruct pci_mem_region {
2144f5e7dd7Smrg    /**
2154f5e7dd7Smrg     * When the region is mapped, this is the pointer to the memory.
2164f5e7dd7Smrg     *
2174f5e7dd7Smrg     * This field is \b only set when the deprecated \c pci_device_map_region
2184f5e7dd7Smrg     * interface is used.  Use \c pci_device_map_range instead.
2194f5e7dd7Smrg     *
2204f5e7dd7Smrg     * \deprecated
2214f5e7dd7Smrg     */
2224f5e7dd7Smrg    void *memory;
2234f5e7dd7Smrg
2244f5e7dd7Smrg
2254f5e7dd7Smrg    /**
2264f5e7dd7Smrg     * Base physical address of the region within its bus / domain.
2274f5e7dd7Smrg     *
2284f5e7dd7Smrg     * \warning
2294f5e7dd7Smrg     * This address is really only useful to other devices in the same
2304f5e7dd7Smrg     * domain.  It's probably \b not the address applications will ever
2314f5e7dd7Smrg     * use.
2324f5e7dd7Smrg     *
2334f5e7dd7Smrg     * \warning
2344f5e7dd7Smrg     * Most (all?) platform back-ends leave this field unset.
2354f5e7dd7Smrg     */
2364f5e7dd7Smrg    pciaddr_t bus_addr;
2374f5e7dd7Smrg
2384f5e7dd7Smrg
2394f5e7dd7Smrg    /**
2404f5e7dd7Smrg     * Base physical address of the region from the CPU's point of view.
2414f5e7dd7Smrg     *
2424f5e7dd7Smrg     * This address is typically passed to \c pci_device_map_range to create
2434f5e7dd7Smrg     * a mapping of the region to the CPU's virtual address space.
2444f5e7dd7Smrg     */
2454f5e7dd7Smrg    pciaddr_t base_addr;
2464f5e7dd7Smrg
2474f5e7dd7Smrg
2484f5e7dd7Smrg    /**
2494f5e7dd7Smrg     * Size, in bytes, of the region.
2504f5e7dd7Smrg     */
2514f5e7dd7Smrg    pciaddr_t size;
2524f5e7dd7Smrg
2534f5e7dd7Smrg
2544f5e7dd7Smrg    /**
2554f5e7dd7Smrg     * Is the region I/O ports or memory?
2564f5e7dd7Smrg     */
2574f5e7dd7Smrg    unsigned is_IO:1;
2584f5e7dd7Smrg
2594f5e7dd7Smrg    /**
2604f5e7dd7Smrg     * Is the memory region prefetchable?
2614f5e7dd7Smrg     *
2624f5e7dd7Smrg     * \note
2634f5e7dd7Smrg     * This can only be set if \c is_IO is not set.
2644f5e7dd7Smrg     */
2654f5e7dd7Smrg    unsigned is_prefetchable:1;
2664f5e7dd7Smrg
2674f5e7dd7Smrg
2684f5e7dd7Smrg    /**
2694f5e7dd7Smrg     * Is the memory at a 64-bit address?
2704f5e7dd7Smrg     *
2714f5e7dd7Smrg     * \note
2724f5e7dd7Smrg     * This can only be set if \c is_IO is not set.
2734f5e7dd7Smrg     */
2744f5e7dd7Smrg    unsigned is_64:1;
2754f5e7dd7Smrg};
2764f5e7dd7Smrg
2774f5e7dd7Smrg
2784f5e7dd7Smrg/**
2794f5e7dd7Smrg * PCI device.
2804f5e7dd7Smrg *
2814f5e7dd7Smrg * Contains all of the information about a particular PCI device.
2824f5e7dd7Smrg */
2834f5e7dd7Smrgstruct pci_device {
2844f5e7dd7Smrg    /**
2854f5e7dd7Smrg     * \name Device bus identification.
2864f5e7dd7Smrg     *
2874f5e7dd7Smrg     * Complete bus identification, including domain, of the device.  On
2884f5e7dd7Smrg     * platforms that do not support PCI domains (e.g., 32-bit x86 hardware),
2894f5e7dd7Smrg     * the domain will always be zero.
2904f5e7dd7Smrg     */
2914f5e7dd7Smrg    /*@{*/
2924f5e7dd7Smrg    uint16_t    domain;
2934f5e7dd7Smrg    uint8_t     bus;
2944f5e7dd7Smrg    uint8_t     dev;
2954f5e7dd7Smrg    uint8_t     func;
2964f5e7dd7Smrg    /*@}*/
2974f5e7dd7Smrg
2984f5e7dd7Smrg
2994f5e7dd7Smrg    /**
3004f5e7dd7Smrg     * \name Vendor / device ID
3014f5e7dd7Smrg     *
3024f5e7dd7Smrg     * The vendor ID, device ID, and sub-IDs for the device.
3034f5e7dd7Smrg     */
3044f5e7dd7Smrg    /*@{*/
3054f5e7dd7Smrg    uint16_t    vendor_id;
3064f5e7dd7Smrg    uint16_t    device_id;
3074f5e7dd7Smrg    uint16_t    subvendor_id;
3084f5e7dd7Smrg    uint16_t    subdevice_id;
3094f5e7dd7Smrg    /*@}*/
3104f5e7dd7Smrg
3114f5e7dd7Smrg    /**
3124f5e7dd7Smrg     * Device's class, subclass, and programming interface packed into a
3134f5e7dd7Smrg     * single 32-bit value.  The class is at bits [23:16], subclass is at
3144f5e7dd7Smrg     * bits [15:8], and programming interface is at [7:0].
3154f5e7dd7Smrg     */
3164f5e7dd7Smrg    uint32_t    device_class;
3174f5e7dd7Smrg
3184f5e7dd7Smrg
3194f5e7dd7Smrg    /**
3204f5e7dd7Smrg     * Device revision number, as read from the configuration header.
3214f5e7dd7Smrg     */
3224f5e7dd7Smrg    uint8_t     revision;
3234f5e7dd7Smrg
3244f5e7dd7Smrg
3254f5e7dd7Smrg    /**
3264f5e7dd7Smrg     * BAR descriptors for the device.
3274f5e7dd7Smrg     */
3284f5e7dd7Smrg    struct pci_mem_region regions[6];
3294f5e7dd7Smrg
3304f5e7dd7Smrg
3314f5e7dd7Smrg    /**
3324f5e7dd7Smrg     * Size, in bytes, of the device's expansion ROM.
3334f5e7dd7Smrg     */
3344f5e7dd7Smrg    pciaddr_t   rom_size;
3354f5e7dd7Smrg
3364f5e7dd7Smrg
3374f5e7dd7Smrg    /**
3384f5e7dd7Smrg     * IRQ associated with the device.  If there is no IRQ, this value will
3394f5e7dd7Smrg     * be -1.
3404f5e7dd7Smrg     */
3414f5e7dd7Smrg    int irq;
3424f5e7dd7Smrg
3434f5e7dd7Smrg
3444f5e7dd7Smrg    /**
3454f5e7dd7Smrg     * Storage for user data.  Users of the library can store arbitrary
3464f5e7dd7Smrg     * data in this pointer.  The library will not use it for any purpose.
3474f5e7dd7Smrg     * It is the user's responsability to free this memory before destroying
3484f5e7dd7Smrg     * the \c pci_device structure.
3494f5e7dd7Smrg     */
3504f5e7dd7Smrg    intptr_t user_data;
3514f5e7dd7Smrg};
3524f5e7dd7Smrg
3534f5e7dd7Smrg
3544f5e7dd7Smrg/**
3554f5e7dd7Smrg * Description of the AGP capability of the device.
3564f5e7dd7Smrg *
3574f5e7dd7Smrg * \sa pci_device_get_agp_info
3584f5e7dd7Smrg */
3594f5e7dd7Smrgstruct pci_agp_info {
3604f5e7dd7Smrg    /**
3614f5e7dd7Smrg     * Offset of the AGP registers in the devices configuration register
3624f5e7dd7Smrg     * space.  This is generally used so that the offset of the AGP command
3634f5e7dd7Smrg     * register can be determined.
3644f5e7dd7Smrg     */
3654f5e7dd7Smrg    unsigned    config_offset;
3664f5e7dd7Smrg
3674f5e7dd7Smrg
3684f5e7dd7Smrg    /**
3694f5e7dd7Smrg     * \name AGP major / minor version.
3704f5e7dd7Smrg     */
3714f5e7dd7Smrg    /*@{*/
3724f5e7dd7Smrg    uint8_t	major_version;
3734f5e7dd7Smrg    uint8_t     minor_version;
3744f5e7dd7Smrg    /*@}*/
3754f5e7dd7Smrg
3764f5e7dd7Smrg    /**
3774f5e7dd7Smrg     * Logical OR of the supported AGP rates.  For example, a value of 0x07
3784f5e7dd7Smrg     * means that the device can support 1x, 2x, and 4x.  A value of 0x0c
3794f5e7dd7Smrg     * means that the device can support 8x and 4x.
3804f5e7dd7Smrg     */
3814f5e7dd7Smrg    uint8_t    rates;
3824f5e7dd7Smrg
3834f5e7dd7Smrg    unsigned int    fast_writes:1;  /**< Are fast-writes supported? */
3844f5e7dd7Smrg    unsigned int    addr64:1;
3854f5e7dd7Smrg    unsigned int    htrans:1;
3864f5e7dd7Smrg    unsigned int    gart64:1;
3874f5e7dd7Smrg    unsigned int    coherent:1;
3884f5e7dd7Smrg    unsigned int    sideband:1;     /**< Is side-band addressing supported? */
3894f5e7dd7Smrg    unsigned int    isochronus:1;
3904f5e7dd7Smrg
3914f5e7dd7Smrg    uint8_t    async_req_size;
3924f5e7dd7Smrg    uint8_t    calibration_cycle_timing;
3934f5e7dd7Smrg    uint8_t    max_requests;
3944f5e7dd7Smrg};
3954f5e7dd7Smrg
3964f5e7dd7Smrg/**
3974f5e7dd7Smrg * Description of a PCI-to-PCI bridge device.
3984f5e7dd7Smrg *
3994f5e7dd7Smrg * \sa pci_device_get_bridge_info
4004f5e7dd7Smrg */
4014f5e7dd7Smrgstruct pci_bridge_info {
4024f5e7dd7Smrg    uint8_t    primary_bus;
4034f5e7dd7Smrg    uint8_t    secondary_bus;
4044f5e7dd7Smrg    uint8_t    subordinate_bus;
4054f5e7dd7Smrg    uint8_t    secondary_latency_timer;
4064f5e7dd7Smrg
4074f5e7dd7Smrg    uint8_t     io_type;
4084f5e7dd7Smrg    uint8_t     mem_type;
4094f5e7dd7Smrg    uint8_t     prefetch_mem_type;
4104f5e7dd7Smrg
4114f5e7dd7Smrg    uint16_t    secondary_status;
4124f5e7dd7Smrg    uint16_t    bridge_control;
4134f5e7dd7Smrg
4144f5e7dd7Smrg    uint32_t    io_base;
4154f5e7dd7Smrg    uint32_t    io_limit;
4164f5e7dd7Smrg
4174f5e7dd7Smrg    uint32_t    mem_base;
4184f5e7dd7Smrg    uint32_t    mem_limit;
4194f5e7dd7Smrg
4204f5e7dd7Smrg    uint64_t    prefetch_mem_base;
4214f5e7dd7Smrg    uint64_t    prefetch_mem_limit;
4224f5e7dd7Smrg};
4234f5e7dd7Smrg
4244f5e7dd7Smrg/**
4254f5e7dd7Smrg * Description of a PCI-to-PCMCIA bridge device.
4264f5e7dd7Smrg *
4274f5e7dd7Smrg * \sa pci_device_get_pcmcia_bridge_info
4284f5e7dd7Smrg */
4294f5e7dd7Smrgstruct pci_pcmcia_bridge_info {
4304f5e7dd7Smrg    uint8_t    primary_bus;
4314f5e7dd7Smrg    uint8_t    card_bus;
4324f5e7dd7Smrg    uint8_t    subordinate_bus;
4334f5e7dd7Smrg    uint8_t    cardbus_latency_timer;
4344f5e7dd7Smrg
4354f5e7dd7Smrg    uint16_t    secondary_status;
4364f5e7dd7Smrg    uint16_t    bridge_control;
4374f5e7dd7Smrg
4384f5e7dd7Smrg    struct {
4394f5e7dd7Smrg	uint32_t    base;
4404f5e7dd7Smrg	uint32_t    limit;
4414f5e7dd7Smrg    } io[2];
4424f5e7dd7Smrg
4434f5e7dd7Smrg    struct {
4444f5e7dd7Smrg	uint32_t    base;
4454f5e7dd7Smrg	uint32_t    limit;
4464f5e7dd7Smrg    } mem[2];
4474f5e7dd7Smrg
4484f5e7dd7Smrg};
4494f5e7dd7Smrg
4504f5e7dd7Smrg#endif /* PCIACCESS_H */
451