xref: /freebsd/usr.sbin/pciconf/pciconf.h (revision b3e7694832e81d7a904a10f525f8797b753bf0d3)
18866f04eSJohn Baldwin /*-
28a16b7a1SPedro F. Giffuni  * SPDX-License-Identifier: BSD-3-Clause
38a16b7a1SPedro F. Giffuni  *
4cbf96402SJohn Baldwin  * Copyright (c) 2007 Yahoo!, Inc.
58866f04eSJohn Baldwin  * All rights reserved.
6cbf96402SJohn Baldwin  * Written by: John Baldwin <jhb@FreeBSD.org>
78866f04eSJohn Baldwin  *
88866f04eSJohn Baldwin  * Redistribution and use in source and binary forms, with or without
98866f04eSJohn Baldwin  * modification, are permitted provided that the following conditions
108866f04eSJohn Baldwin  * are met:
118866f04eSJohn Baldwin  * 1. Redistributions of source code must retain the above copyright
128866f04eSJohn Baldwin  *    notice, this list of conditions and the following disclaimer.
138866f04eSJohn Baldwin  * 2. Redistributions in binary form must reproduce the above copyright
148866f04eSJohn Baldwin  *    notice, this list of conditions and the following disclaimer in the
158866f04eSJohn Baldwin  *    documentation and/or other materials provided with the distribution.
168866f04eSJohn Baldwin  * 3. Neither the name of the author nor the names of any co-contributors
178866f04eSJohn Baldwin  *    may be used to endorse or promote products derived from this software
188866f04eSJohn Baldwin  *    without specific prior written permission.
198866f04eSJohn Baldwin  *
208866f04eSJohn Baldwin  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
218866f04eSJohn Baldwin  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
228866f04eSJohn Baldwin  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
238866f04eSJohn Baldwin  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
248866f04eSJohn Baldwin  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
258866f04eSJohn Baldwin  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
268866f04eSJohn Baldwin  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
278866f04eSJohn Baldwin  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
288866f04eSJohn Baldwin  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
298866f04eSJohn Baldwin  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
308866f04eSJohn Baldwin  * SUCH DAMAGE.
318866f04eSJohn Baldwin  */
328866f04eSJohn Baldwin 
338866f04eSJohn Baldwin #ifndef __PCICONF_H__
348866f04eSJohn Baldwin #define	__PCICONF_H__
358866f04eSJohn Baldwin 
36*97faa4c4SScott Long void	list_caps(int fd, struct pci_conf *p, int level);
37b6de0055SJohn Baldwin void	list_errors(int fd, struct pci_conf *p);
38b6de0055SJohn Baldwin uint8_t	pci_find_cap(int fd, struct pci_conf *p, uint8_t id);
39b6de0055SJohn Baldwin uint16_t pcie_find_cap(int fd, struct pci_conf *p, uint16_t id);
407fdbba5eSRyan Stone void	print_bar(int fd, struct pci_conf *p, const char *label,  uint16_t bar);
418866f04eSJohn Baldwin uint32_t read_config(int fd, struct pcisel *sel, long reg, int width);
428866f04eSJohn Baldwin 
438866f04eSJohn Baldwin #endif
44