7 #include <minix/sysutil.h>
9 /*===========================================================================*
11 *===========================================================================*/
12 PUBLIC
char *pci_dev_name(vid
, did
)
16 static char name
[80]; /* We need a better interface for this */
22 gid
= cpf_grant_direct(pci_procnr
, (vir_bytes
)name
, sizeof(name
),
26 printf("pci_dev_name: cpf_grant_direct failed: %d\n",
31 m
.m_type
= BUSC_PCI_DEV_NAME_S
;
34 m
.m7_i3
= sizeof(name
);
37 r
= sendrec(pci_procnr
, &m
);
40 panic("pci", "pci_dev_name: can't talk to PCI", r
);
42 if (m
.m_type
== ENOENT
)
44 printf("pci_dev_name: got no name\n");
45 return NULL
; /* No name for this device */
48 panic("pci", "pci_dev_name: got bad reply from PCI", m
.m_type
);
50 name
[sizeof(name
)-1]= '\0'; /* Make sure that the string is NUL
55 printf("pci_dev_name: got name %s\n", name
);