- pci_conf_hdr_t config_hdr;
- boolean_t multi_function_device;
- int8_t func;
- int8_t first_func = 0;
- int8_t last_func = PCI_REG_FUNC_M >> PCI_REG_FUNC_SHIFT;
- int rval = 0;
- struct pci_device * pci_base;
-
- /*
- * Loop through at least func=first_func. Continue looping through
- * functions if there are no errors and the device is a multi-function
- * device.
- *
- * (Note, if first_func == 0, header will show whether multifunction
- * device and set multi_function_device. If first_func != 0, then we
- * will force the loop as the user wants a specific function to be
- * checked.
- */
- for (func = first_func, multi_function_device = B_FALSE;
- ((func <= last_func) &&
- ((func == first_func) || (multi_function_device)));
- func++) {
- prg_p->func_no = func;
-
- /*
- * Four things can happen here:
- *
- * 1) ioctl comes back as EFAULT and prg_p->status is
- * PCITOOL_INVALID_ADDRESS. There is no device at this location.
- *
- * 2) ioctl comes back successful and the data comes back as
- * zero. Config space is mapped but no device responded.
- *
- * 3) ioctl comes back successful and the data comes back as
- * non-zero. We've found a device.
- *
- * 4) Some other error occurs in an ioctl.
- */
-
- prg_p->status = PCITOOL_SUCCESS;
- prg_p->offset = 0;
- prg_p->data = 0;
- prg_p->user_version = PCITOOL_USER_VERSION;
-
- errno = 0;
- if (((rval = ioctl(nexus->fd, PCITOOL_DEVICE_GET_REG, prg_p)) != 0) ||
- (prg_p->data == 0xffffffff)) {
+ int *retbuf = NULL;
+ int len = 0, i;
+ struct pci_device *pci_base;
+ probe_info_t *pinfo = ((probe_args_t *)arg)->pinfo;
+ nexus_t *nexus = ((probe_args_t *)arg)->nexus;
+ property_info_t property_list[] = {
+ { "class-code", 0 },
+ { "device-id", 0 },
+ { "vendor-id", 0 },
+ { "revision-id", 0},
+ { "subsystem-vendor-id", 0},
+ { "subsystem-id", 0},
+ };
+#define NUM_PROPERTIES sizeof(property_list)/sizeof(property_info_t)