/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* to whom the Software is furnished to do so, provided that the above
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
* OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
* INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Except as contained in this notice, the name of a copyright holder
* shall not be used in advertising or otherwise to promote the sale, use
* or other dealings in this Software without prior written authorization
* of the copyright holder.
*/
#ifndef _SYS_PCI_TOOLS_H
#define _SYS_PCI_TOOLS_H
#pragma ident "@(#)pci_tools.h 1.4 05/09/28 SMI"
#ifdef __cplusplus
extern "C" {
#endif
/*
* Versioning. Have different versions for userland program and drivers, so
* they can all stay in sync with each other.
*/
/* File suffixes for nexus pcitool nodes. */
/*
* Ioctls for PCI tools.
*/
/* Return the number of supported interrupts on a PCI bus. */
/*
* This file contains data structures for the pci tool.
*/
#define PCITOOL_CONFIG 0
/*
* Pass this through barnum to signal to use a base addr instead.
* This is for platforms which do not have a way to automatically map
* a selected bank to a base addr.
*/
/*
* BAR corresponding to space desired.
*/
typedef enum {
/*
* PCITOOL error numbers.
*/
typedef enum {
/*
* PCITOOL_DEVICE_SET_INTR ioctl data structure to re-assign the interrupts.
*/
typedef struct pcitool_intr_set {
/*
* PCITOOL_DEVICE_GET_INTR ioctl data structure to dump out the
* ino mapping information.
*/
typedef struct pcitool_intr_dev {
typedef struct pcitool_intr_get {
/* returned - to kernel */
/* # devs returned - from kernel */
/* intrs enabled for devs if > 0 */
/* from kernel */
/*
* Get the size needed to return the number of devices wanted.
* Can't say num_devs - 1 as num_devs may be unsigned.
*/
(sizeof (pcitool_intr_get_t) - \
sizeof (pcitool_intr_dev_t) + \
(num_devs * sizeof (pcitool_intr_dev_t)))
/*
* Size and endian fields for acc_attr bitmask.
*/
/*
* Data structure to read and write to pci device registers.
* This is the argument to the following ioctls:
*/
typedef struct pcitool_reg {
/* BAR from pcitools_bar_t */
/* (DEVCTL_DEVICE_SET/GET_REG) */
/* to kernel */
#ifdef __cplusplus
}
#endif
#endif /* _SYS_PCI_TOOLS_H */