MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ppt_find

Function ppt_find

freebsd/amd64/vmm/io/ppt.c:202–224  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

200DRIVER_MODULE(ppt, pci, ppt_driver, ppt_devclass, NULL, NULL);
201
202static int
203ppt_find(struct vm *vm, int bus, int slot, int func, struct pptdev **pptp)
204{
205 device_t dev;
206 struct pptdev *ppt;
207 int b, s, f;
208
209 TAILQ_FOREACH(ppt, &pptdev_list, next) {
210 dev = ppt->dev;
211 b = pci_get_bus(dev);
212 s = pci_get_slot(dev);
213 f = pci_get_function(dev);
214 if (bus == b && slot == s && func == f)
215 break;
216 }
217
218 if (ppt == NULL)
219 return (ENOENT);
220 if (ppt->vm != vm) /* Make sure we own this device */
221 return (EBUSY);
222 *pptp = ppt;
223 return (0);
224}
225
226static void
227ppt_unmap_mmio(struct vm *vm, struct pptdev *ppt)

Callers 6

ppt_assign_deviceFunction · 0.85
ppt_unassign_deviceFunction · 0.85
ppt_map_mmioFunction · 0.85
ppt_setup_msiFunction · 0.85
ppt_setup_msixFunction · 0.85
ppt_disable_msixFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected