xref: /minix3/minix/lib/libddekit/src/pci.c (revision 433d6423c39e34ec4b79c950597bb2d236f886be)
1*433d6423SLionel Sambuc /**
2*433d6423SLionel Sambuc  * pci.c
3*433d6423SLionel Sambuc  * @author: Dirk Vogt
4*433d6423SLionel Sambuc  * @date: 2010-02-18
5*433d6423SLionel Sambuc  */
6*433d6423SLionel Sambuc 
7*433d6423SLionel Sambuc #include "common.h"
8*433d6423SLionel Sambuc 
9*433d6423SLionel Sambuc #include <ddekit/pci.h>
10*433d6423SLionel Sambuc #include <ddekit/panic.h>
11*433d6423SLionel Sambuc #include <minix/syslib.h>
12*433d6423SLionel Sambuc 
13*433d6423SLionel Sambuc #ifdef DDEBUG_LEVEL_PCI
14*433d6423SLionel Sambuc #undef DDEBUG
15*433d6423SLionel Sambuc #define DDEBUG DDEBUG_LEVEL_PCI
16*433d6423SLionel Sambuc #endif
17*433d6423SLionel Sambuc 
18*433d6423SLionel Sambuc #include "util.h"
19*433d6423SLionel Sambuc #include "debug.h"
20*433d6423SLionel Sambuc 
21*433d6423SLionel Sambuc #define PCI_MAX_DEVS 32
22*433d6423SLionel Sambuc 
23*433d6423SLionel Sambuc #define PCI_TAKE_ALL (-1)
24*433d6423SLionel Sambuc 
25*433d6423SLionel Sambuc struct ddekit_pci_dev {
26*433d6423SLionel Sambuc 	int devind; /* thats how we identify the defice at the pci server */
27*433d6423SLionel Sambuc 	ddekit_uint16_t vid; /* as we get them for                 */
28*433d6423SLionel Sambuc 	                     /*   free during iteration store them */
29*433d6423SLionel Sambuc 	ddekit_uint16_t did;
30*433d6423SLionel Sambuc 	int bus;
31*433d6423SLionel Sambuc 	int slot; /* slot should equal index in dev array */
32*433d6423SLionel Sambuc 	int func; /* don't support multiple functionalities yet -> 0 */
33*433d6423SLionel Sambuc };
34*433d6423SLionel Sambuc 
35*433d6423SLionel Sambuc struct ddekit_pci_dev pci_devs[PCI_MAX_DEVS];
36*433d6423SLionel Sambuc 
37*433d6423SLionel Sambuc static struct ddekit_pci_dev * ddekit_get_dev_helper(int bus, int slot,
38*433d6423SLionel Sambuc 	int func);
39*433d6423SLionel Sambuc 
40*433d6423SLionel Sambuc /****************************************************************************/
41*433d6423SLionel Sambuc /*      ddekit_pci_init_only_one                                            */
42*433d6423SLionel Sambuc /****************************************************************************/
ddekit_pci_init_only_one(int skip)43*433d6423SLionel Sambuc void ddekit_pci_init_only_one(int skip)
44*433d6423SLionel Sambuc {
45*433d6423SLionel Sambuc 	/*
46*433d6423SLionel Sambuc 	 * If skip is not PCI_TAKE_ALL this function will skip skip PCI DEVICES
47*433d6423SLionel Sambuc 	 * and than only take on PCI device.
48*433d6423SLionel Sambuc 	 */
49*433d6423SLionel Sambuc 
50*433d6423SLionel Sambuc 	int res, count, more, take_all = 0;
51*433d6423SLionel Sambuc 
52*433d6423SLionel Sambuc 	if (skip == -1) {
53*433d6423SLionel Sambuc 		take_all = 1;
54*433d6423SLionel Sambuc 	}
55*433d6423SLionel Sambuc 
56*433d6423SLionel Sambuc 	DDEBUG_MSG_INFO("Initializing PCI subsystem...");
57*433d6423SLionel Sambuc 
58*433d6423SLionel Sambuc 	pci_init();
59*433d6423SLionel Sambuc 
60*433d6423SLionel Sambuc 	/*
61*433d6423SLionel Sambuc 	 * Iterate the PCI-bus
62*433d6423SLionel Sambuc 	 */
63*433d6423SLionel Sambuc 
64*433d6423SLionel Sambuc 	more = 1;
65*433d6423SLionel Sambuc 
66*433d6423SLionel Sambuc 	for (count = 0 ; count < PCI_MAX_DEVS ; count++) {
67*433d6423SLionel Sambuc 
68*433d6423SLionel Sambuc 		struct ddekit_pci_dev *d = &pci_devs[count];
69*433d6423SLionel Sambuc 
70*433d6423SLionel Sambuc 		if (more) {
71*433d6423SLionel Sambuc 			if ( count==0 ) {
72*433d6423SLionel Sambuc 				res = pci_first_dev(&d->devind, &d->vid, &d->did);
73*433d6423SLionel Sambuc 			} else {
74*433d6423SLionel Sambuc 				d->devind = pci_devs[count-1].devind;
75*433d6423SLionel Sambuc 				res = pci_next_dev(&d->devind, &d->vid, &d->did);
76*433d6423SLionel Sambuc 			}
77*433d6423SLionel Sambuc 
78*433d6423SLionel Sambuc 			if (res && d->devind!=0 && (take_all || skip == 0)) {
79*433d6423SLionel Sambuc 
80*433d6423SLionel Sambuc 				DDEBUG_MSG_VERBOSE("Found pci device: "
81*433d6423SLionel Sambuc 				                   "(ind: %x, vid: %x, did: %x) "
82*433d6423SLionel Sambuc 							 	   "mapped to slot %x",
83*433d6423SLionel Sambuc 								   d->devind, d->vid, d->did, count);
84*433d6423SLionel Sambuc 				d->slot = count;
85*433d6423SLionel Sambuc 				d->bus  = 0;
86*433d6423SLionel Sambuc 				d->func = 0;
87*433d6423SLionel Sambuc 				res = pci_reserve_ok(d->devind);
88*433d6423SLionel Sambuc 				if (res != 0) {
89*433d6423SLionel Sambuc 					ddekit_panic("ddekit_pci_init_only_one: "
90*433d6423SLionel Sambuc 					             "pci_reserve_ok failed (%d)\n",res);
91*433d6423SLionel Sambuc 				}
92*433d6423SLionel Sambuc 
93*433d6423SLionel Sambuc 			} else {
94*433d6423SLionel Sambuc 				/* no more PCI devices */
95*433d6423SLionel Sambuc 				DDEBUG_MSG_VERBOSE("Found %d PCI devices.", count);
96*433d6423SLionel Sambuc 				d->devind = -1;
97*433d6423SLionel Sambuc 				more = 0;
98*433d6423SLionel Sambuc 			} /*if (res) */
99*433d6423SLionel Sambuc 		} else {
100*433d6423SLionel Sambuc 			d->devind = -1;
101*433d6423SLionel Sambuc 		}
102*433d6423SLionel Sambuc 		if (!take_all) {
103*433d6423SLionel Sambuc 			skip--;
104*433d6423SLionel Sambuc 		}
105*433d6423SLionel Sambuc 	}
106*433d6423SLionel Sambuc }
107*433d6423SLionel Sambuc 
108*433d6423SLionel Sambuc /****************************************************************************/
109*433d6423SLionel Sambuc /*      ddekit_pci_get_device_id                                            */
110*433d6423SLionel Sambuc /****************************************************************************/
ddekit_pci_init(void)111*433d6423SLionel Sambuc void ddekit_pci_init(void)
112*433d6423SLionel Sambuc {
113*433d6423SLionel Sambuc 	ddekit_pci_init_only_one(DDEKIT_PCI_ANY_ID);
114*433d6423SLionel Sambuc }
115*433d6423SLionel Sambuc 
116*433d6423SLionel Sambuc /****************************************************************************/
117*433d6423SLionel Sambuc /*      ddekit_pci_get_device_id                                            */
118*433d6423SLionel Sambuc /****************************************************************************/
ddekit_pci_get_device(int nr,int * bus,int * slot,int * func)119*433d6423SLionel Sambuc int ddekit_pci_get_device(int nr, int *bus, int *slot, int *func)
120*433d6423SLionel Sambuc {
121*433d6423SLionel Sambuc 	if(nr >= 0  && nr < PCI_MAX_DEVS) {
122*433d6423SLionel Sambuc 
123*433d6423SLionel Sambuc 		*bus = 0;
124*433d6423SLionel Sambuc 		*slot = nr;
125*433d6423SLionel Sambuc 		*func =0;
126*433d6423SLionel Sambuc 
127*433d6423SLionel Sambuc 		return 0;
128*433d6423SLionel Sambuc 	}
129*433d6423SLionel Sambuc 
130*433d6423SLionel Sambuc 	return -1;
131*433d6423SLionel Sambuc }
132*433d6423SLionel Sambuc 
133*433d6423SLionel Sambuc /****************************************************************************/
134*433d6423SLionel Sambuc /*      ddekit_pci_get_device_id                                            */
135*433d6423SLionel Sambuc /****************************************************************************/
136*433d6423SLionel Sambuc static struct ddekit_pci_dev *
ddekit_get_dev_helper(int bus,int slot,int func)137*433d6423SLionel Sambuc ddekit_get_dev_helper(int bus, int slot, int func)
138*433d6423SLionel Sambuc {
139*433d6423SLionel Sambuc 	/*
140*433d6423SLionel Sambuc 	 * Used internally to look up devices.
141*433d6423SLionel Sambuc 	 * Should make it easier to support multiple buses somewhen
142*433d6423SLionel Sambuc 	 */
143*433d6423SLionel Sambuc 	struct ddekit_pci_dev * ret = 0;
144*433d6423SLionel Sambuc 	if (slot >= 0  && slot < PCI_MAX_DEVS) {
145*433d6423SLionel Sambuc 		ret = &pci_devs[slot];
146*433d6423SLionel Sambuc 	}
147*433d6423SLionel Sambuc 	if (ret->devind == -1) {
148*433d6423SLionel Sambuc 		ret = 0;
149*433d6423SLionel Sambuc 	}
150*433d6423SLionel Sambuc 	return ret;
151*433d6423SLionel Sambuc }
152*433d6423SLionel Sambuc 
153*433d6423SLionel Sambuc /****************************************************************************/
154*433d6423SLionel Sambuc /*      ddekit_pci_read                                                     */
155*433d6423SLionel Sambuc /****************************************************************************/
ddekit_pci_read(int bus,int slot,int func,int pos,int len,ddekit_uint32_t * val)156*433d6423SLionel Sambuc int ddekit_pci_read
157*433d6423SLionel Sambuc (int bus, int slot, int func, int pos, int len, ddekit_uint32_t *val)
158*433d6423SLionel Sambuc {
159*433d6423SLionel Sambuc 	switch(len) {
160*433d6423SLionel Sambuc 		case 1:
161*433d6423SLionel Sambuc 			return ddekit_pci_readb(bus, slot, func, pos,
162*433d6423SLionel Sambuc 			    (ddekit_uint8_t*)  val);
163*433d6423SLionel Sambuc 		case 2:
164*433d6423SLionel Sambuc 			return ddekit_pci_readw(bus, slot, func, pos,
165*433d6423SLionel Sambuc 			    (ddekit_uint16_t*) val);
166*433d6423SLionel Sambuc 		case 4:
167*433d6423SLionel Sambuc 			return ddekit_pci_readl(bus, slot, func, pos, val);
168*433d6423SLionel Sambuc 		default: return -1;
169*433d6423SLionel Sambuc 	}
170*433d6423SLionel Sambuc }
171*433d6423SLionel Sambuc 
172*433d6423SLionel Sambuc /****************************************************************************/
173*433d6423SLionel Sambuc /*      ddekit_pci_write                                                    */
174*433d6423SLionel Sambuc /****************************************************************************/
ddekit_pci_write(int bus,int slot,int func,int pos,int len,ddekit_uint32_t val)175*433d6423SLionel Sambuc int ddekit_pci_write
176*433d6423SLionel Sambuc (int bus, int slot, int func, int pos, int len, ddekit_uint32_t val)
177*433d6423SLionel Sambuc {
178*433d6423SLionel Sambuc 	switch(len) {
179*433d6423SLionel Sambuc 		case 1:
180*433d6423SLionel Sambuc 			return ddekit_pci_writeb(bus, slot, func, pos,
181*433d6423SLionel Sambuc 			    (ddekit_uint8_t)  val);
182*433d6423SLionel Sambuc 		case 2:
183*433d6423SLionel Sambuc 			return ddekit_pci_writew(bus, slot, func, pos,
184*433d6423SLionel Sambuc 			    (ddekit_uint16_t) val);
185*433d6423SLionel Sambuc 		case 4:
186*433d6423SLionel Sambuc 			return ddekit_pci_writel(bus, slot, func, pos, val);
187*433d6423SLionel Sambuc 		default: return -1;
188*433d6423SLionel Sambuc 	}
189*433d6423SLionel Sambuc }
190*433d6423SLionel Sambuc 
191*433d6423SLionel Sambuc /****************************************************************************/
192*433d6423SLionel Sambuc /*      ddekit_pci_readb                                                    */
193*433d6423SLionel Sambuc /****************************************************************************/
ddekit_pci_readb(int bus,int slot,int func,int pos,ddekit_uint8_t * val)194*433d6423SLionel Sambuc int ddekit_pci_readb (int bus, int slot, int func, int pos, ddekit_uint8_t  *val) {
195*433d6423SLionel Sambuc 	struct ddekit_pci_dev * dev = ddekit_get_dev_helper(bus, slot, func);
196*433d6423SLionel Sambuc 	if (func!=0) {
197*433d6423SLionel Sambuc 		*val=0;
198*433d6423SLionel Sambuc 		return 0;
199*433d6423SLionel Sambuc 	}
200*433d6423SLionel Sambuc 	if (dev) {
201*433d6423SLionel Sambuc 		*val = pci_attr_r8 (dev->devind, pos);
202*433d6423SLionel Sambuc 		DDEBUG_MSG_VERBOSE("bus: %d, slot: %d, func: %d, pos: %x %x",
203*433d6423SLionel Sambuc 		    bus, slot, func, pos, *val);
204*433d6423SLionel Sambuc 		return 0;
205*433d6423SLionel Sambuc 	}
206*433d6423SLionel Sambuc 	return -1;
207*433d6423SLionel Sambuc }
208*433d6423SLionel Sambuc 
209*433d6423SLionel Sambuc /****************************************************************************/
210*433d6423SLionel Sambuc /*      ddekit_pci_readw                                                    */
211*433d6423SLionel Sambuc /****************************************************************************/
ddekit_pci_readw(int bus,int slot,int func,int pos,ddekit_uint16_t * val)212*433d6423SLionel Sambuc int ddekit_pci_readw
213*433d6423SLionel Sambuc (int bus, int slot, int func, int pos, ddekit_uint16_t *val) {
214*433d6423SLionel Sambuc 	struct ddekit_pci_dev * dev = ddekit_get_dev_helper(bus, slot, func);
215*433d6423SLionel Sambuc 	if (func!=0) {
216*433d6423SLionel Sambuc 		*val=0;
217*433d6423SLionel Sambuc 		return 0;
218*433d6423SLionel Sambuc 	}
219*433d6423SLionel Sambuc 	if (dev) {
220*433d6423SLionel Sambuc 		*val = pci_attr_r16 (dev->devind, pos);
221*433d6423SLionel Sambuc 		DDEBUG_MSG_VERBOSE("bus: %d, slot: %d, func: %d, pos: %x %x",
222*433d6423SLionel Sambuc 		    bus, slot, func, pos, *val);
223*433d6423SLionel Sambuc 		return 0;
224*433d6423SLionel Sambuc 	}
225*433d6423SLionel Sambuc 	return -1;
226*433d6423SLionel Sambuc }
227*433d6423SLionel Sambuc 
228*433d6423SLionel Sambuc /****************************************************************************/
229*433d6423SLionel Sambuc /*      ddekit_pci_readl                                                    */
230*433d6423SLionel Sambuc /****************************************************************************/
ddekit_pci_readl(int bus,int slot,int func,int pos,ddekit_uint32_t * val)231*433d6423SLionel Sambuc int ddekit_pci_readl
232*433d6423SLionel Sambuc (int bus, int slot, int func, int pos, ddekit_uint32_t *val)  {
233*433d6423SLionel Sambuc 	struct ddekit_pci_dev * dev = ddekit_get_dev_helper(bus, slot, func);
234*433d6423SLionel Sambuc 	if (func!=0) {
235*433d6423SLionel Sambuc 		*val=0;
236*433d6423SLionel Sambuc 		return 0;
237*433d6423SLionel Sambuc 	}
238*433d6423SLionel Sambuc 	if (dev) {
239*433d6423SLionel Sambuc 		*val = pci_attr_r32 (dev->devind, pos);
240*433d6423SLionel Sambuc 		DDEBUG_MSG_VERBOSE("bus: %d, slot: %d, func: %d, pos: %x %x",
241*433d6423SLionel Sambuc 		    bus, slot, func, pos, *val);
242*433d6423SLionel Sambuc 		return 0;
243*433d6423SLionel Sambuc 	}
244*433d6423SLionel Sambuc 	return -1;
245*433d6423SLionel Sambuc }
246*433d6423SLionel Sambuc 
247*433d6423SLionel Sambuc /****************************************************************************/
248*433d6423SLionel Sambuc /*      ddekit_pci_writeb                                                   */
249*433d6423SLionel Sambuc /****************************************************************************/
ddekit_pci_writeb(int bus,int slot,int func,int pos,ddekit_uint8_t val)250*433d6423SLionel Sambuc int ddekit_pci_writeb
251*433d6423SLionel Sambuc (int bus, int slot, int func, int pos, ddekit_uint8_t val) {
252*433d6423SLionel Sambuc 	struct ddekit_pci_dev * dev = ddekit_get_dev_helper(bus, slot, func);
253*433d6423SLionel Sambuc 	if (dev) {
254*433d6423SLionel Sambuc 		pci_attr_w8 (dev->devind, pos, val);
255*433d6423SLionel Sambuc 		DDEBUG_MSG_VERBOSE("bus: %d, slot: %d, func: %d, pos: %x %x",
256*433d6423SLionel Sambuc 		    bus, slot, func, pos, val);
257*433d6423SLionel Sambuc 		return 0;
258*433d6423SLionel Sambuc 	}
259*433d6423SLionel Sambuc 	return -1;
260*433d6423SLionel Sambuc }
261*433d6423SLionel Sambuc 
262*433d6423SLionel Sambuc /****************************************************************************/
263*433d6423SLionel Sambuc /*      ddekit_pci_writel                                                   */
264*433d6423SLionel Sambuc /****************************************************************************/
ddekit_pci_writew(int bus,int slot,int func,int pos,ddekit_uint16_t val)265*433d6423SLionel Sambuc int ddekit_pci_writew
266*433d6423SLionel Sambuc (int bus, int slot, int func, int pos, ddekit_uint16_t val) {
267*433d6423SLionel Sambuc 	struct ddekit_pci_dev * dev = ddekit_get_dev_helper(bus, slot, func);
268*433d6423SLionel Sambuc 	if (dev) {
269*433d6423SLionel Sambuc 		pci_attr_w16 (dev->devind, pos, val);
270*433d6423SLionel Sambuc 		DDEBUG_MSG_VERBOSE("bus: %d, slot: %d, func: %d, pos: %x %x",
271*433d6423SLionel Sambuc 		    bus,slot,func,pos, val);
272*433d6423SLionel Sambuc 		return 0;
273*433d6423SLionel Sambuc 	}
274*433d6423SLionel Sambuc 	return -1;
275*433d6423SLionel Sambuc }
276*433d6423SLionel Sambuc 
277*433d6423SLionel Sambuc /****************************************************************************/
278*433d6423SLionel Sambuc /*      ddekit_pci_writel                                                   */
279*433d6423SLionel Sambuc /****************************************************************************/
ddekit_pci_writel(int bus,int slot,int func,int pos,ddekit_uint32_t val)280*433d6423SLionel Sambuc int ddekit_pci_writel
281*433d6423SLionel Sambuc (int bus, int slot, int func, int pos, ddekit_uint32_t val) {
282*433d6423SLionel Sambuc 	struct ddekit_pci_dev * dev = ddekit_get_dev_helper(bus, slot, func);
283*433d6423SLionel Sambuc 	if (dev) {
284*433d6423SLionel Sambuc 		pci_attr_w32 (dev->devind, pos, val);
285*433d6423SLionel Sambuc 		DDEBUG_MSG_VERBOSE("bus: %d, slot: %d, func: %d, pos: %x %x",bus,slot,func,pos, val);
286*433d6423SLionel Sambuc 		return 0;
287*433d6423SLionel Sambuc 	}
288*433d6423SLionel Sambuc 	return -1;
289*433d6423SLionel Sambuc }
290*433d6423SLionel Sambuc 
291*433d6423SLionel Sambuc /****************************************************************************/
292*433d6423SLionel Sambuc /*      ddekit_pci_find_device                                              */
293*433d6423SLionel Sambuc /****************************************************************************/
ddekit_pci_find_device(int * bus,int * slot,int * func,struct ddekit_pci_dev * start)294*433d6423SLionel Sambuc struct ddekit_pci_dev *ddekit_pci_find_device
295*433d6423SLionel Sambuc (int *bus, int *slot, int *func, struct ddekit_pci_dev *start)
296*433d6423SLionel Sambuc {
297*433d6423SLionel Sambuc 	int i,search=0;
298*433d6423SLionel Sambuc 
299*433d6423SLionel Sambuc 	if(start)
300*433d6423SLionel Sambuc 		search = 1;
301*433d6423SLionel Sambuc 
302*433d6423SLionel Sambuc 	for(i=0; i < PCI_MAX_DEVS ; i++)
303*433d6423SLionel Sambuc 	{
304*433d6423SLionel Sambuc 		/* start searching? */
305*433d6423SLionel Sambuc 		if (search)
306*433d6423SLionel Sambuc 			search = (&pci_devs[i]==start);
307*433d6423SLionel Sambuc 		else
308*433d6423SLionel Sambuc 		{
309*433d6423SLionel Sambuc 			struct ddekit_pci_dev * dev = &pci_devs[i];
310*433d6423SLionel Sambuc 			if ((*slot==dev->slot || *slot == DDEKIT_PCI_ANY_ID)
311*433d6423SLionel Sambuc 				&& (*func==dev->func || *func == DDEKIT_PCI_ANY_ID))
312*433d6423SLionel Sambuc 			{
313*433d6423SLionel Sambuc 				*bus  = 0;
314*433d6423SLionel Sambuc 				*slot = dev->slot;
315*433d6423SLionel Sambuc 				*func = dev->func;
316*433d6423SLionel Sambuc 				return dev;
317*433d6423SLionel Sambuc 			}
318*433d6423SLionel Sambuc 		}
319*433d6423SLionel Sambuc 	}
320*433d6423SLionel Sambuc 	return 0;
321*433d6423SLionel Sambuc }
322*433d6423SLionel Sambuc 
323*433d6423SLionel Sambuc /****************************************************************************/
324*433d6423SLionel Sambuc /*      ddekit_pci_get_vendor                                               */
325*433d6423SLionel Sambuc /****************************************************************************/
ddekit_pci_get_vendor(struct ddekit_pci_dev * dev)326*433d6423SLionel Sambuc unsigned short ddekit_pci_get_vendor(struct ddekit_pci_dev *dev)
327*433d6423SLionel Sambuc {
328*433d6423SLionel Sambuc 	return dev->vid;
329*433d6423SLionel Sambuc }
330*433d6423SLionel Sambuc 
331*433d6423SLionel Sambuc /****************************************************************************/
332*433d6423SLionel Sambuc /*      ddekit_pci_get_device_id                                            */
333*433d6423SLionel Sambuc /****************************************************************************/
ddekit_pci_get_device_id(struct ddekit_pci_dev * dev)334*433d6423SLionel Sambuc unsigned short ddekit_pci_get_device_id(struct ddekit_pci_dev *dev)
335*433d6423SLionel Sambuc {
336*433d6423SLionel Sambuc 	return dev->did;
337*433d6423SLionel Sambuc }
338*433d6423SLionel Sambuc 
339*433d6423SLionel Sambuc /*
340*433d6423SLionel Sambuc  * XXX: Those are neither used be DDEFBSD or DDELinux implement them
341*433d6423SLionel Sambuc  *      when you need them
342*433d6423SLionel Sambuc  */
343*433d6423SLionel Sambuc 
344*433d6423SLionel Sambuc /****************************************************************************/
345*433d6423SLionel Sambuc /*      ddekit_pci_enable_device                                            */
346*433d6423SLionel Sambuc /****************************************************************************/
ddekit_pci_enable_device(struct ddekit_pci_dev * dev)347*433d6423SLionel Sambuc int ddekit_pci_enable_device(struct ddekit_pci_dev *dev)
348*433d6423SLionel Sambuc {
349*433d6423SLionel Sambuc 	WARN_UNIMPL;
350*433d6423SLionel Sambuc 	return 0;
351*433d6423SLionel Sambuc }
352*433d6423SLionel Sambuc 
353*433d6423SLionel Sambuc /****************************************************************************/
354*433d6423SLionel Sambuc /*      ddekit_pci_disable_device                                           */
355*433d6423SLionel Sambuc /****************************************************************************/
ddekit_pci_disable_device(struct ddekit_pci_dev * dev)356*433d6423SLionel Sambuc int ddekit_pci_disable_device(struct ddekit_pci_dev *dev)
357*433d6423SLionel Sambuc {
358*433d6423SLionel Sambuc 	WARN_UNIMPL;
359*433d6423SLionel Sambuc 	return 0;
360*433d6423SLionel Sambuc }
361*433d6423SLionel Sambuc 
362*433d6423SLionel Sambuc /****************************************************************************/
363*433d6423SLionel Sambuc /*      ddekit_pci_set_master                                               */
364*433d6423SLionel Sambuc /****************************************************************************/
ddekit_pci_set_master(struct ddekit_pci_dev * dev)365*433d6423SLionel Sambuc void ddekit_pci_set_master(struct ddekit_pci_dev *dev)
366*433d6423SLionel Sambuc {
367*433d6423SLionel Sambuc 	WARN_UNIMPL;
368*433d6423SLionel Sambuc }
369*433d6423SLionel Sambuc 
370*433d6423SLionel Sambuc 
371*433d6423SLionel Sambuc /****************************************************************************/
372*433d6423SLionel Sambuc /*      ddekit_pci_get_sub_vendor                                           */
373*433d6423SLionel Sambuc /****************************************************************************/
ddekit_pci_get_sub_vendor(struct ddekit_pci_dev * dev)374*433d6423SLionel Sambuc unsigned short ddekit_pci_get_sub_vendor(struct ddekit_pci_dev *dev)
375*433d6423SLionel Sambuc {
376*433d6423SLionel Sambuc 	WARN_UNIMPL;
377*433d6423SLionel Sambuc 	return 0;
378*433d6423SLionel Sambuc }
379*433d6423SLionel Sambuc 
380*433d6423SLionel Sambuc /****************************************************************************/
381*433d6423SLionel Sambuc /*      ddekit_pci_get_sub_device                                           */
382*433d6423SLionel Sambuc /****************************************************************************/
ddekit_pci_get_sub_device(struct ddekit_pci_dev * dev)383*433d6423SLionel Sambuc unsigned short ddekit_pci_get_sub_device(struct ddekit_pci_dev *dev)
384*433d6423SLionel Sambuc {
385*433d6423SLionel Sambuc 	WARN_UNIMPL;
386*433d6423SLionel Sambuc 	return 0;
387*433d6423SLionel Sambuc }
388*433d6423SLionel Sambuc 
389*433d6423SLionel Sambuc /****************************************************************************/
390*433d6423SLionel Sambuc /*      ddekit_pci_get_dev_class                                            */
391*433d6423SLionel Sambuc /****************************************************************************/
ddekit_pci_get_dev_class(struct ddekit_pci_dev * dev)392*433d6423SLionel Sambuc unsigned ddekit_pci_get_dev_class(struct ddekit_pci_dev *dev)
393*433d6423SLionel Sambuc {
394*433d6423SLionel Sambuc 	WARN_UNIMPL;
395*433d6423SLionel Sambuc 	return 0;
396*433d6423SLionel Sambuc }
397*433d6423SLionel Sambuc 
398*433d6423SLionel Sambuc /****************************************************************************/
399*433d6423SLionel Sambuc /*      ddekit_pci_get_irq                                                  */
400*433d6423SLionel Sambuc /****************************************************************************/
401*433d6423SLionel Sambuc unsigned long
ddekit_pci_get_irq(struct ddekit_pci_dev * dev)402*433d6423SLionel Sambuc ddekit_pci_get_irq(struct ddekit_pci_dev *dev)
403*433d6423SLionel Sambuc {
404*433d6423SLionel Sambuc 	WARN_UNIMPL;
405*433d6423SLionel Sambuc 	return 0;
406*433d6423SLionel Sambuc }
407*433d6423SLionel Sambuc 
408*433d6423SLionel Sambuc /****************************************************************************/
409*433d6423SLionel Sambuc /*      ddekit_pci_get_name                                                 */
410*433d6423SLionel Sambuc /****************************************************************************/
ddekit_pci_get_name(struct ddekit_pci_dev * dev)411*433d6423SLionel Sambuc char *ddekit_pci_get_name(struct ddekit_pci_dev *dev)
412*433d6423SLionel Sambuc {
413*433d6423SLionel Sambuc 	WARN_UNIMPL;
414*433d6423SLionel Sambuc 	return 0;
415*433d6423SLionel Sambuc }
416*433d6423SLionel Sambuc 
417*433d6423SLionel Sambuc /****************************************************************************/
418*433d6423SLionel Sambuc /*      ddekit_pci_get_slot_name                                            */
419*433d6423SLionel Sambuc /****************************************************************************/
ddekit_pci_get_slot_name(struct ddekit_pci_dev * dev)420*433d6423SLionel Sambuc char *ddekit_pci_get_slot_name(struct ddekit_pci_dev *dev)
421*433d6423SLionel Sambuc {
422*433d6423SLionel Sambuc 	WARN_UNIMPL;
423*433d6423SLionel Sambuc 	return 0;
424*433d6423SLionel Sambuc }
425*433d6423SLionel Sambuc 
426*433d6423SLionel Sambuc /****************************************************************************/
427*433d6423SLionel Sambuc /*      ddekit_pci_get_resource                                             */
428*433d6423SLionel Sambuc /****************************************************************************/
429*433d6423SLionel Sambuc ddekit_pci_res_t *
ddekit_pci_get_resource(struct ddekit_pci_dev * dev,unsigned int idx)430*433d6423SLionel Sambuc ddekit_pci_get_resource(struct ddekit_pci_dev *dev, unsigned int idx)
431*433d6423SLionel Sambuc {
432*433d6423SLionel Sambuc 	WARN_UNIMPL;
433*433d6423SLionel Sambuc 	return 0;
434*433d6423SLionel Sambuc }
435*433d6423SLionel Sambuc 
436*433d6423SLionel Sambuc /****************************************************************************/
437*433d6423SLionel Sambuc /*      ddekit_pci_irq_enable                                               */
438*433d6423SLionel Sambuc /****************************************************************************/
ddekit_pci_irq_enable(int bus,int slot,int func,int pin,int * irq)439*433d6423SLionel Sambuc int ddekit_pci_irq_enable
440*433d6423SLionel Sambuc (int bus, int slot, int func, int pin, int *irq)
441*433d6423SLionel Sambuc {
442*433d6423SLionel Sambuc 	/* call not needed */
443*433d6423SLionel Sambuc #if 0
444*433d6423SLionel Sambuc 	WARN_UNIMPL;
445*433d6423SLionel Sambuc #endif
446*433d6423SLionel Sambuc 	return 0;
447*433d6423SLionel Sambuc }
448*433d6423SLionel Sambuc 
449