pcie_impl.h revision 0c5eba8c5970fdedca3397ca86830ae5db5d98eb
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _SYS_PCIE_IMPL_H
#define _SYS_PCIE_IMPL_H
#pragma ident "%Z%%M% %I% %E% SMI"
#ifdef __cplusplus
extern "C" {
#endif
/* PCI-E config space data for error handling and ereport */
typedef struct pf_data {
int parent_index;
int send_erpt;
/* 0-3Fh. PCI */
/* 40h-FFh. PCI-X Capability */
/* 40h-FFh. PCI-E Capability */
/* 100h-FFFh. Extended PCI-E */
} pf_data_t;
/* Information used while handling errors in the fabric. */
typedef struct pf_impl {
int *pf_dq_tail_p; /* last valid index of fault data q */
} pf_impl_t;
typedef struct pcie_ppd {
int ppd_addr_entries; /* number of range prop */
int ppd_assigned_entries; /* number of prop entries */
} pcie_ppd_t;
#define PCI_GET_BDF(dip) \
#define PCI_GET_SEC_BUS(dip) \
#define PCI_GET_PHFUN(dip) \
/*
* The following flag is used for Broadcom 5714/5715 bridge prefetch issue.
* This flag will be used both by px and px_pci nexus drivers.
*/
#define PX_DMAI_FLAGS_MAP_BUFZONE 0x40000
/* ppd_fm_flags field */
/* PCIe fabric error handling return codes */
/* PCIe fabric handle lookup return codes */
#define PF_HDL_FOUND 0
#define PF_HDL_NOTFOUND 1
/* PCIe fabric handle lookup address flags */
#define PF_DMA_ADDR (1 << 0)
#define PF_SEND_ERPT_YES 1
#define PF_SEND_ERPT_UNKNOWN 0
#define PF_SEND_ERPT_NO -1
#define PF_SUCCESS (1 << 0)
/* PCIe helper functions */
/* PCIe Friendly Functions */
/* PCIe error handling functions */
extern int pf_get_dq_size(void);
#ifdef __cplusplus
}
#endif
#endif /* _SYS_PCIE_IMPL_H */