source: trunk/minix/lib/syslib/pci_next_dev.c@ 10

Last change on this file since 10 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 822 bytes
RevLine 
[9]1/*
2pci_next_dev.c
3*/
4
5#include "pci.h"
6#include "syslib.h"
7#include <minix/sysutil.h>
8
9/*===========================================================================*
10 * pci_next_dev *
11 *===========================================================================*/
12PUBLIC int pci_next_dev(devindp, vidp, didp)
13int *devindp;
14u16_t *vidp;
15u16_t *didp;
16{
17 int r;
18 message m;
19
20 m.m_type= BUSC_PCI_NEXT_DEV;
21 m.m1_i1= *devindp;
22
23 r= sendrec(pci_procnr, &m);
24 if (r != 0)
25 panic("pci", "pci_next_dev: can't talk to PCI", r);
26
27 if (m.m_type == 1)
28 {
29 *devindp= m.m1_i1;
30 *vidp= m.m1_i2;
31 *didp= m.m1_i3;
32#if 0
33 printf("pci_next_dev: got device %d, %04x/%04x\n",
34 *devindp, *vidp, *didp);
35#endif
36 return 1;
37 }
38 if (m.m_type != 0)
39 panic("pci", "pci_next_dev: got bad reply from PCI", m.m_type);
40
41 return 0;
42}
43
Note: See TracBrowser for help on using the repository browser.