pciconf.h revision 285830
1204076Spjd/*-
2204076Spjd * Copyright (c) 2007 Yahoo!, Inc.
3204076Spjd * All rights reserved.
4204076Spjd * Written by: John Baldwin <jhb@FreeBSD.org>
5204076Spjd *
6204076Spjd * Redistribution and use in source and binary forms, with or without
7204076Spjd * modification, are permitted provided that the following conditions
8204076Spjd * are met:
9204076Spjd * 1. Redistributions of source code must retain the above copyright
10204076Spjd *    notice, this list of conditions and the following disclaimer.
11204076Spjd * 2. Redistributions in binary form must reproduce the above copyright
12204076Spjd *    notice, this list of conditions and the following disclaimer in the
13204076Spjd *    documentation and/or other materials provided with the distribution.
14204076Spjd * 3. Neither the name of the author nor the names of any co-contributors
15204076Spjd *    may be used to endorse or promote products derived from this software
16204076Spjd *    without specific prior written permission.
17204076Spjd *
18204076Spjd * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19204076Spjd * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20204076Spjd * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21204076Spjd * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22204076Spjd * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23204076Spjd * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24204076Spjd * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25204076Spjd * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26204076Spjd * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27204076Spjd * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28204076Spjd * SUCH DAMAGE.
29204076Spjd *
30204076Spjd * $FreeBSD: releng/10.2/usr.sbin/pciconf/pciconf.h 236415 2012-06-01 18:33:40Z jhb $
31204076Spjd */
32204076Spjd
33204076Spjd#ifndef __PCICONF_H__
34204076Spjd#define	__PCICONF_H__
35204076Spjd
36204076Spjdvoid	list_caps(int fd, struct pci_conf *p);
37void	list_errors(int fd, struct pci_conf *p);
38uint8_t	pci_find_cap(int fd, struct pci_conf *p, uint8_t id);
39uint16_t pcie_find_cap(int fd, struct pci_conf *p, uint16_t id);
40uint32_t read_config(int fd, struct pcisel *sel, long reg, int width);
41
42#endif
43