mbgtools-lx  4.2.8
pci_lx.h
Go to the documentation of this file.
1 
2 /**************************************************************************
3  *
4  * $Id: pci_lx.h 1.3 2017/12/12 08:23:46 martin REL_M $
5  *
6  * Copyright (c) Meinberg Funkuhren, Bad Pyrmont, Germany
7  *
8  * Description:
9  * Definitions to enable usage of Meinberg PCI function calls
10  * with Linux.
11  *
12  * -----------------------------------------------------------------------
13  * $Log: pci_lx.h $
14  * Revision 1.3 2017/12/12 08:23:46 martin
15  * Fixed a typo in a comment.
16  * Revision 1.2 2006/07/07 12:12:57 martin
17  * Account for _mbg_pci_..() symbols used in the updated library.
18  * Revision 1.1 2001/02/05 15:30:35 MARTIN
19  * Initial revision
20  *
21  **************************************************************************/
22 
23 #ifndef _PCI_LX_H
24 #define _PCI_LX_H
25 
26 
27 /* Other headers to be included */
28 
29 #include <pcidefs.h>
30 
31 #include <mbg_lx.h>
32 #include <linux/pci.h>
33 
34 
35 #ifdef _PCI_LX
36  #define _ext
37 #else
38  #define _ext extern
39 #endif
40 
41 
42 /* Start of header body */
43 
44 // The pcibios_..() calls use below are not supported by
45 // recent 2.6.x kernels. However, those kernels should use
46 // the PNP PCI interface anyway, whereas the functions below
47 // are only used by non-PNP environments.
48 
49 #define _mbg_pci_find_bios( _p1, _p2, _p3 ) \
50  ( pcibios_present() ? PCI_SUCCESS : PCI_NO_SUCCESS )
51 
52 #define _mbg_pci_find_device( _did, _vid, _ix, _pbn, _pdfn ) \
53  pcibios_find_device( (_vid), (_did), (_ix), (_pbn), (_pdfn) )
54 
55 #define _mbg_pci_read_cfg_byte pcibios_read_config_byte
56 #define _mbg_pci_read_cfg_word pcibios_read_config_word
57 #define _mbg_pci_read_cfg_dword pcibios_read_config_dword
58 
59 #define _mbg_pci_write_cfg_byte pcibios_write_config_byte
60 #define _mbg_pci_write_cfg_word pcibios_write_config_word
61 #define _mbg_pci_write_cfg_dword pcibios_write_config_dword
62 
63 /* End of header body */
64 
65 #undef _ext
66 
67 #endif /* _PCI_LX_H */