7 #include <minix/sysutil.h>
9 /*===========================================================================*
11 *===========================================================================*/
12 PUBLIC
char *pci_dev_name(vid
, did
)
16 static char name
[PCIINFO_ENTRY_SIZE
]; /* 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("syslib/" __FILE__
, "pci_dev_name: can't talk to PCI", r
);
42 if (m
.m_type
== ENOENT
)
45 printf("pci_dev_name: got no name\n");
47 return NULL
; /* No name for this device */
50 panic("syslib/" __FILE__
, "pci_dev_name: got bad reply from PCI", m
.m_type
);
52 name
[sizeof(name
)-1]= '\0'; /* Make sure that the string is NUL
57 printf("pci_dev_name: got name %s\n", name
);