xref: /dflybsd-src/sys/dev/drm/include/uapi/linux/pci.h (revision 1cefe05a9d7d319e466c0d8ba788849b2a8eb417)
1*1cefe05aSFrançois Tigeot /*
2*1cefe05aSFrançois Tigeot  * Copyright (c) 2018 François Tigeot
3*1cefe05aSFrançois Tigeot  * All rights reserved.
4*1cefe05aSFrançois Tigeot  *
5*1cefe05aSFrançois Tigeot  * Redistribution and use in source and binary forms, with or without
6*1cefe05aSFrançois Tigeot  * modification, are permitted provided that the following conditions
7*1cefe05aSFrançois Tigeot  * are met:
8*1cefe05aSFrançois Tigeot  * 1. Redistributions of source code must retain the above copyright
9*1cefe05aSFrançois Tigeot  *    notice unmodified, this list of conditions, and the following
10*1cefe05aSFrançois Tigeot  *    disclaimer.
11*1cefe05aSFrançois Tigeot  * 2. Redistributions in binary form must reproduce the above copyright
12*1cefe05aSFrançois Tigeot  *    notice, this list of conditions and the following disclaimer in the
13*1cefe05aSFrançois Tigeot  *    documentation and/or other materials provided with the distribution.
14*1cefe05aSFrançois Tigeot  *
15*1cefe05aSFrançois Tigeot  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16*1cefe05aSFrançois Tigeot  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17*1cefe05aSFrançois Tigeot  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18*1cefe05aSFrançois Tigeot  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19*1cefe05aSFrançois Tigeot  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20*1cefe05aSFrançois Tigeot  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21*1cefe05aSFrançois Tigeot  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22*1cefe05aSFrançois Tigeot  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23*1cefe05aSFrançois Tigeot  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24*1cefe05aSFrançois Tigeot  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*1cefe05aSFrançois Tigeot  */
26*1cefe05aSFrançois Tigeot 
27*1cefe05aSFrançois Tigeot #ifndef _UAPI_LINUX_PCI_H_
28*1cefe05aSFrançois Tigeot #define _UAPI_LINUX_PCI_H_
29*1cefe05aSFrançois Tigeot 
30*1cefe05aSFrançois Tigeot #define PCI_DEVFN(slot, func)	((((slot) & 0x1f) << 3) | ((func) & 0x07))
31*1cefe05aSFrançois Tigeot #define PCI_SLOT(devfn)		(((devfn) >> 3) & 0x1f)
32*1cefe05aSFrançois Tigeot #define PCI_FUNC(devfn)		((devfn) & 0x07)
33*1cefe05aSFrançois Tigeot 
34*1cefe05aSFrançois Tigeot #endif /* _UAPI_LINUX_PCI_H_ */
35