summaryrefslogtreecommitdiffstats
path: root/rtemsbsd/include/rtems/bsd/local/pci_if.h
blob: d4152556347046f5f06370a44e9d2dc1c0cdc16b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
/*
 * This file is produced automatically.
 * Do not modify anything in here by hand.
 *
 * Created from source file
 *   freebsd-org/sys/dev/pci/pci_if.m
 * with
 *   makeobjops.awk
 *
 * See the source file for legal information
 */


#ifndef _pci_if_h_
#define _pci_if_h_

/** @brief Unique descriptor for the PCI_READ_CONFIG() method */
extern struct kobjop_desc pci_read_config_desc;
/** @brief A function implementing the PCI_READ_CONFIG() method */
typedef u_int32_t pci_read_config_t(device_t dev, device_t child, int reg,
                                    int width);

static __inline u_int32_t PCI_READ_CONFIG(device_t dev, device_t child, int reg,
                                          int width)
{
	kobjop_t _m;
	KOBJOPLOOKUP(((kobj_t)dev)->ops,pci_read_config);
	return ((pci_read_config_t *) _m)(dev, child, reg, width);
}

/** @brief Unique descriptor for the PCI_WRITE_CONFIG() method */
extern struct kobjop_desc pci_write_config_desc;
/** @brief A function implementing the PCI_WRITE_CONFIG() method */
typedef void pci_write_config_t(device_t dev, device_t child, int reg,
                                u_int32_t val, int width);

static __inline void PCI_WRITE_CONFIG(device_t dev, device_t child, int reg,
                                      u_int32_t val, int width)
{
	kobjop_t _m;
	KOBJOPLOOKUP(((kobj_t)dev)->ops,pci_write_config);
	((pci_write_config_t *) _m)(dev, child, reg, val, width);
}

/** @brief Unique descriptor for the PCI_GET_POWERSTATE() method */
extern struct kobjop_desc pci_get_powerstate_desc;
/** @brief A function implementing the PCI_GET_POWERSTATE() method */
typedef int pci_get_powerstate_t(device_t dev, device_t child);

static __inline int PCI_GET_POWERSTATE(device_t dev, device_t child)
{
	kobjop_t _m;
	KOBJOPLOOKUP(((kobj_t)dev)->ops,pci_get_powerstate);
	return ((pci_get_powerstate_t *) _m)(dev, child);
}

/** @brief Unique descriptor for the PCI_SET_POWERSTATE() method */
extern struct kobjop_desc pci_set_powerstate_desc;
/** @brief A function implementing the PCI_SET_POWERSTATE() method */
typedef int pci_set_powerstate_t(device_t dev, device_t child, int state);

static __inline int PCI_SET_POWERSTATE(device_t dev, device_t child, int state)
{
	kobjop_t _m;
	KOBJOPLOOKUP(((kobj_t)dev)->ops,pci_set_powerstate);
	return ((pci_set_powerstate_t *) _m)(dev, child, state);
}

/** @brief Unique descriptor for the PCI_GET_VPD_IDENT() method */
extern struct kobjop_desc pci_get_vpd_ident_desc;
/** @brief A function implementing the PCI_GET_VPD_IDENT() method */
typedef int pci_get_vpd_ident_t(device_t dev, device_t child,
                                const char **identptr);

static __inline int PCI_GET_VPD_IDENT(device_t dev, device_t child,
                                      const char **identptr)
{
	kobjop_t _m;
	KOBJOPLOOKUP(((kobj_t)dev)->ops,pci_get_vpd_ident);
	return ((pci_get_vpd_ident_t *) _m)(dev, child, identptr);
}

/** @brief Unique descriptor for the PCI_GET_VPD_READONLY() method */
extern struct kobjop_desc pci_get_vpd_readonly_desc;
/** @brief A function implementing the PCI_GET_VPD_READONLY() method */
typedef int pci_get_vpd_readonly_t(device_t dev, device_t child, const char *kw,
                                   const char **vptr);

static __inline int PCI_GET_VPD_READONLY(device_t dev, device_t child,
                                         const char *kw, const char **vptr)
{
	kobjop_t _m;
	KOBJOPLOOKUP(((kobj_t)dev)->ops,pci_get_vpd_readonly);
	return ((pci_get_vpd_readonly_t *) _m)(dev, child, kw, vptr);
}

/** @brief Unique descriptor for the PCI_ENABLE_BUSMASTER() method */
extern struct kobjop_desc pci_enable_busmaster_desc;
/** @brief A function implementing the PCI_ENABLE_BUSMASTER() method */
typedef int pci_enable_busmaster_t(device_t dev, device_t child);

static __inline int PCI_ENABLE_BUSMASTER(device_t dev, device_t child)
{
	kobjop_t _m;
	KOBJOPLOOKUP(((kobj_t)dev)->ops,pci_enable_busmaster);
	return ((pci_enable_busmaster_t *) _m)(dev, child);
}

/** @brief Unique descriptor for the PCI_DISABLE_BUSMASTER() method */
extern struct kobjop_desc pci_disable_busmaster_desc;
/** @brief A function implementing the PCI_DISABLE_BUSMASTER() method */
typedef int pci_disable_busmaster_t(device_t dev, device_t child);

static __inline int PCI_DISABLE_BUSMASTER(device_t dev, device_t child)
{
	kobjop_t _m;
	KOBJOPLOOKUP(((kobj_t)dev)->ops,pci_disable_busmaster);
	return ((pci_disable_busmaster_t *) _m)(dev, child);
}

/** @brief Unique descriptor for the PCI_ENABLE_IO() method */
extern struct kobjop_desc pci_enable_io_desc;
/** @brief A function implementing the PCI_ENABLE_IO() method */
typedef int pci_enable_io_t(device_t dev, device_t child, int space);

static __inline int PCI_ENABLE_IO(device_t dev, device_t child, int space)
{
	kobjop_t _m;
	KOBJOPLOOKUP(((kobj_t)dev)->ops,pci_enable_io);
	return ((pci_enable_io_t *) _m)(dev, child, space);
}

/** @brief Unique descriptor for the PCI_DISABLE_IO() method */
extern struct kobjop_desc pci_disable_io_desc;
/** @brief A function implementing the PCI_DISABLE_IO() method */
typedef int pci_disable_io_t(device_t dev, device_t child, int space);

static __inline int PCI_DISABLE_IO(device_t dev, device_t child, int space)
{
	kobjop_t _m;
	KOBJOPLOOKUP(((kobj_t)dev)->ops,pci_disable_io);
	return ((pci_disable_io_t *) _m)(dev, child, space);
}

/** @brief Unique descriptor for the PCI_ASSIGN_INTERRUPT() method */
extern struct kobjop_desc pci_assign_interrupt_desc;
/** @brief A function implementing the PCI_ASSIGN_INTERRUPT() method */
typedef int pci_assign_interrupt_t(device_t dev, device_t child);

static __inline int PCI_ASSIGN_INTERRUPT(device_t dev, device_t child)
{
	kobjop_t _m;
	KOBJOPLOOKUP(((kobj_t)dev)->ops,pci_assign_interrupt);
	return ((pci_assign_interrupt_t *) _m)(dev, child);
}

/** @brief Unique descriptor for the PCI_FIND_EXTCAP() method */
extern struct kobjop_desc pci_find_extcap_desc;
/** @brief A function implementing the PCI_FIND_EXTCAP() method */
typedef int pci_find_extcap_t(device_t dev, device_t child, int capability,
                              int *capreg);

static __inline int PCI_FIND_EXTCAP(device_t dev, device_t child,
                                    int capability, int *capreg)
{
	kobjop_t _m;
	KOBJOPLOOKUP(((kobj_t)dev)->ops,pci_find_extcap);
	return ((pci_find_extcap_t *) _m)(dev, child, capability, capreg);
}

/** @brief Unique descriptor for the PCI_ALLOC_MSI() method */
extern struct kobjop_desc pci_alloc_msi_desc;
/** @brief A function implementing the PCI_ALLOC_MSI() method */
typedef int pci_alloc_msi_t(device_t dev, device_t child, int *count);

static __inline int PCI_ALLOC_MSI(device_t dev, device_t child, int *count)
{
	kobjop_t _m;
	KOBJOPLOOKUP(((kobj_t)dev)->ops,pci_alloc_msi);
	return ((pci_alloc_msi_t *) _m)(dev, child, count);
}

/** @brief Unique descriptor for the PCI_ALLOC_MSIX() method */
extern struct kobjop_desc pci_alloc_msix_desc;
/** @brief A function implementing the PCI_ALLOC_MSIX() method */
typedef int pci_alloc_msix_t(device_t dev, device_t child, int *count);

static __inline int PCI_ALLOC_MSIX(device_t dev, device_t child, int *count)
{
	kobjop_t _m;
	KOBJOPLOOKUP(((kobj_t)dev)->ops,pci_alloc_msix);
	return ((pci_alloc_msix_t *) _m)(dev, child, count);
}

/** @brief Unique descriptor for the PCI_REMAP_MSIX() method */
extern struct kobjop_desc pci_remap_msix_desc;
/** @brief A function implementing the PCI_REMAP_MSIX() method */
typedef int pci_remap_msix_t(device_t dev, device_t child, int count,
                             const u_int *vectors);

static __inline int PCI_REMAP_MSIX(device_t dev, device_t child, int count,
                                   const u_int *vectors)
{
	kobjop_t _m;
	KOBJOPLOOKUP(((kobj_t)dev)->ops,pci_remap_msix);
	return ((pci_remap_msix_t *) _m)(dev, child, count, vectors);
}

/** @brief Unique descriptor for the PCI_RELEASE_MSI() method */
extern struct kobjop_desc pci_release_msi_desc;
/** @brief A function implementing the PCI_RELEASE_MSI() method */
typedef int pci_release_msi_t(device_t dev, device_t child);

static __inline int PCI_RELEASE_MSI(device_t dev, device_t child)
{
	kobjop_t _m;
	KOBJOPLOOKUP(((kobj_t)dev)->ops,pci_release_msi);
	return ((pci_release_msi_t *) _m)(dev, child);
}

/** @brief Unique descriptor for the PCI_MSI_COUNT() method */
extern struct kobjop_desc pci_msi_count_desc;
/** @brief A function implementing the PCI_MSI_COUNT() method */
typedef int pci_msi_count_t(device_t dev, device_t child);

static __inline int PCI_MSI_COUNT(device_t dev, device_t child)
{
	kobjop_t _m;
	KOBJOPLOOKUP(((kobj_t)dev)->ops,pci_msi_count);
	return ((pci_msi_count_t *) _m)(dev, child);
}

/** @brief Unique descriptor for the PCI_MSIX_COUNT() method */
extern struct kobjop_desc pci_msix_count_desc;
/** @brief A function implementing the PCI_MSIX_COUNT() method */
typedef int pci_msix_count_t(device_t dev, device_t child);

static __inline int PCI_MSIX_COUNT(device_t dev, device_t child)
{
	kobjop_t _m;
	KOBJOPLOOKUP(((kobj_t)dev)->ops,pci_msix_count);
	return ((pci_msix_count_t *) _m)(dev, child);
}

#endif /* _pci_if_h_ */