source: trunk/minix/lib/syslib/pci_slot_name.c@ 20

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

Minix 3.1.2a

File size: 848 bytes
RevLine 
[9]1/*
2pci_slot_name.c
3*/
4
5#include "pci.h"
6#include "syslib.h"
7#include <minix/sysutil.h>
8
9/*===========================================================================*
10 * pci_slot_name *
11 *===========================================================================*/
12PUBLIC char *pci_slot_name(devind)
13int devind;
14{
15 static char name[80]; /* We need a better interface for this */
16
17 int r;
18 message m;
19
20 m.m_type= BUSC_PCI_SLOT_NAME;
21 m.m1_i1= devind;
22 m.m1_i2= sizeof(name);
23 m.m1_p1= name;
24
25 r= sendrec(pci_procnr, &m);
26 if (r != 0)
27 panic("pci", "pci_slot_name: can't talk to PCI", r);
28
29 if (m.m_type != 0)
30 panic("pci", "pci_slot_name: got bad reply from PCI", m.m_type);
31
32 name[sizeof(name)-1]= '\0'; /* Make sure that the string is NUL
33 * terminated.
34 */
35
36 printf("pci_slot_name: got name %s\n", name);
37 return name;
38}
39
Note: See TracBrowser for help on using the repository browser.