7 #include <minix/sysutil.h>
9 /*===========================================================================*
11 *===========================================================================*/
12 char *pci_dev_name(u16_t vid
, u16_t did
)
14 static char name
[80]; /* We need a better interface for this */
20 gid
= cpf_grant_direct(pci_procnr
, (vir_bytes
)name
, sizeof(name
),
24 printf("pci_dev_name: cpf_grant_direct failed: %d\n",
29 m
.m_type
= BUSC_PCI_DEV_NAME_S
;
32 m
.m7_i3
= sizeof(name
);
35 r
= ipc_sendrec(pci_procnr
, &m
);
38 panic("pci_dev_name: can't talk to PCI: %d", r
);
40 if (m
.m_type
== ENOENT
)
43 printf("pci_dev_name: got no name\n");
45 return NULL
; /* No name for this device */
48 panic("pci_dev_name: got bad reply from PCI: %d", 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
);