| 122 | static TAILQ_HEAD(, pptdev) pptdev_list = TAILQ_HEAD_INITIALIZER(pptdev_list); |
| 123 | |
| 124 | static int |
| 125 | ppt_probe(device_t dev) |
| 126 | { |
| 127 | int bus, slot, func; |
| 128 | struct pci_devinfo *dinfo; |
| 129 | |
| 130 | dinfo = (struct pci_devinfo *)device_get_ivars(dev); |
| 131 | |
| 132 | bus = pci_get_bus(dev); |
| 133 | slot = pci_get_slot(dev); |
| 134 | func = pci_get_function(dev); |
| 135 | |
| 136 | /* |
| 137 | * To qualify as a pci passthrough device a device must: |
| 138 | * - be allowed by administrator to be used in this role |
| 139 | * - be an endpoint device |
| 140 | */ |
| 141 | if ((dinfo->cfg.hdrtype & PCIM_HDRTYPE) != PCIM_HDRTYPE_NORMAL) |
| 142 | return (ENXIO); |
| 143 | else if (vmm_is_pptdev(bus, slot, func)) |
| 144 | return (0); |
| 145 | else |
| 146 | /* |
| 147 | * Returning BUS_PROBE_NOWILDCARD here matches devices that the |
| 148 | * SR-IOV infrastructure specified as "ppt" passthrough devices. |
| 149 | * All normal devices that did not have "ppt" specified as their |
| 150 | * driver will not be matched by this. |
| 151 | */ |
| 152 | return (BUS_PROBE_NOWILDCARD); |
| 153 | } |
| 154 | |
| 155 | static int |
| 156 | ppt_attach(device_t dev) |
nothing calls this directly
no test coverage detected