Lines Matching refs:hpdev
433 struct hv_pci_dev *hpdev; member
468 completion->hpdev->probed_bar[i] = in q_resource_requirements()
489 hv_int_desc_free(struct hv_pci_dev *hpdev, struct hv_irq_desc *hid) in hv_int_desc_free() argument
500 int_pkt->wslot.val = hpdev->desc.wslot.val; in hv_int_desc_free()
503 vmbus_chan_send(hpdev->hbus->sc->chan, VMBUS_CHANPKT_TYPE_INBAND, 0, in hv_int_desc_free()
510 hv_pci_delete_device(struct hv_pci_dev *hpdev) in hv_pci_delete_device() argument
512 struct hv_pcibus *hbus = hpdev->hbus; in hv_pci_delete_device()
517 devfn = wslot_to_devfn(hpdev->desc.wslot.val); in hv_pci_delete_device()
529 TAILQ_REMOVE(&hbus->children, hpdev, link); in hv_pci_delete_device()
532 TAILQ_FOREACH_SAFE(hid, &hpdev->irq_desc_list, link, tmp_hid) in hv_pci_delete_device()
533 hv_int_desc_free(hpdev, hid); in hv_pci_delete_device()
535 free(hpdev, M_DEVBUF); in hv_pci_delete_device()
541 struct hv_pci_dev *hpdev; in new_pcichild_device() local
550 hpdev = malloc(sizeof(*hpdev), M_DEVBUF, M_WAITOK | M_ZERO); in new_pcichild_device()
551 hpdev->hbus = hbus; in new_pcichild_device()
553 TAILQ_INIT(&hpdev->irq_desc_list); in new_pcichild_device()
556 comp_pkt.hpdev = hpdev; in new_pcichild_device()
574 hpdev->desc = *desc; in new_pcichild_device()
579 TAILQ_INSERT_TAIL(&hbus->children, hpdev, link); in new_pcichild_device()
581 return (hpdev); in new_pcichild_device()
584 free(hpdev, M_DEVBUF); in new_pcichild_device()
722 struct hv_pci_dev *hpdev, *tmp_hpdev; in pci_devices_present_work() local
748 TAILQ_FOREACH(hpdev, &hbus->children, link) in pci_devices_present_work()
749 hpdev->reported_missing = true; in pci_devices_present_work()
758 TAILQ_FOREACH(hpdev, &hbus->children, link) { in pci_devices_present_work()
759 if ((hpdev->desc.wslot.val == in pci_devices_present_work()
761 (hpdev->desc.v_id == new_desc->v_id) && in pci_devices_present_work()
762 (hpdev->desc.d_id == new_desc->d_id) && in pci_devices_present_work()
763 (hpdev->desc.ser == new_desc->ser)) { in pci_devices_present_work()
764 hpdev->reported_missing = false; in pci_devices_present_work()
775 hpdev = new_pcichild_device(hbus, new_desc); in pci_devices_present_work()
776 if (!hpdev) in pci_devices_present_work()
782 TAILQ_FOREACH_SAFE(hpdev, &hbus->children, link, tmp_hpdev) { in pci_devices_present_work()
783 if (hpdev->reported_missing) in pci_devices_present_work()
784 hv_pci_delete_device(hpdev); in pci_devices_present_work()
804 struct hv_pci_dev *hpdev, *ret = NULL; in get_pcichild_wslot() local
807 TAILQ_FOREACH(hpdev, &hbus->children, link) { in get_pcichild_wslot()
808 if (hpdev->desc.wslot.val == wslot) { in get_pcichild_wslot()
809 ret = hpdev; in get_pcichild_wslot()
851 struct hv_pci_dev *hpdev = arg; in hv_eject_device_work() local
852 union win_slot_encoding wslot = hpdev->desc.wslot; in hv_eject_device_work()
853 struct hv_pcibus *hbus = hpdev->hbus; in hv_eject_device_work()
860 hv_pci_delete_device(hpdev); in hv_eject_device_work()
871 hv_pci_eject_device(struct hv_pci_dev *hpdev) in hv_pci_eject_device() argument
873 struct hv_pcibus *hbus = hpdev->hbus; in hv_pci_eject_device()
884 TASK_INIT(&hpdev->eject_task, 0, hv_eject_device_work, hpdev); in hv_pci_eject_device()
886 taskqueue_enqueue(taskq, &hpdev->eject_task); in hv_pci_eject_device()
905 struct hv_pci_dev *hpdev; in vmbus_pcib_on_channel_callback() local
967 hpdev = get_pcichild_wslot(hbus, in vmbus_pcib_on_channel_callback()
970 if (hpdev) in vmbus_pcib_on_channel_callback()
971 hv_pci_eject_device(hpdev); in vmbus_pcib_on_channel_callback()
1101 struct hv_pci_dev *hpdev; in hv_send_resources_allocated() local
1110 hpdev = get_pcichild_wslot(hbus, wslot); in hv_send_resources_allocated()
1111 if (!hpdev) in hv_send_resources_allocated()
1122 res_assigned->wslot.val = hpdev->desc.wslot.val; in hv_send_resources_allocated()
1152 struct hv_pci_dev *hpdev; in hv_send_resources_released() local
1157 hpdev = get_pcichild_wslot(hbus, wslot); in hv_send_resources_released()
1158 if (!hpdev) in hv_send_resources_released()
1162 pkt.wslot.val = hpdev->desc.wslot.val; in hv_send_resources_released()
1196 _hv_pcifront_read_config(struct hv_pci_dev *hpdev, int where, int size, in _hv_pcifront_read_config() argument
1199 struct hv_pcibus *hbus = hpdev->hbus; in _hv_pcifront_read_config()
1206 memcpy(val, ((uint8_t *)&hpdev->desc.v_id) + where, size); in _hv_pcifront_read_config()
1209 memcpy(val, ((uint8_t *)&hpdev->desc.rev) + where - in _hv_pcifront_read_config()
1213 memcpy(val, (uint8_t *)&hpdev->desc.subsystem_id + where - in _hv_pcifront_read_config()
1231 hv_cfg_write_4(hbus, 0, hpdev->desc.wslot.val); in _hv_pcifront_read_config()
1262 _hv_pcifront_write_config(struct hv_pci_dev *hpdev, int where, int size, in _hv_pcifront_write_config() argument
1265 struct hv_pcibus *hbus = hpdev->hbus; in _hv_pcifront_write_config()
1276 hv_cfg_write_4(hbus, 0, hpdev->desc.wslot.val); in _hv_pcifront_write_config()
1531 struct hv_pci_dev *hpdev; in vmbus_pcib_alloc_resource() local
1547 hpdev = get_pcichild_wslot(sc->hbus, devfn_to_wslot(devfn)); in vmbus_pcib_alloc_resource()
1548 if (!hpdev) in vmbus_pcib_alloc_resource()
1556 if (!(hpdev->probed_bar[bar_no] & PCIM_BAR_MEM_64)) in vmbus_pcib_alloc_resource()
1602 struct hv_pci_dev *hpdev; in vmbus_pcib_read_config() local
1608 hpdev = get_pcichild_wslot(sc->hbus, devfn_to_wslot(devfn)); in vmbus_pcib_read_config()
1609 if (!hpdev) in vmbus_pcib_read_config()
1612 _hv_pcifront_read_config(hpdev, reg, bytes, &data); in vmbus_pcib_read_config()
1622 struct hv_pci_dev *hpdev; in vmbus_pcib_write_config() local
1627 hpdev = get_pcichild_wslot(sc->hbus, devfn_to_wslot(devfn)); in vmbus_pcib_write_config()
1628 if (!hpdev) in vmbus_pcib_write_config()
1631 _hv_pcifront_write_config(hpdev, reg, bytes, data); in vmbus_pcib_write_config()
1676 struct hv_pci_dev *hpdev; in vmbus_pcib_map_msi() local
1695 hpdev = get_pcichild_wslot(sc->hbus, devfn_to_wslot(devfn)); in vmbus_pcib_map_msi()
1696 if (!hpdev) in vmbus_pcib_map_msi()
1704 TAILQ_FOREACH_SAFE(hid, &hpdev->irq_desc_list, link, tmp_hid) { in vmbus_pcib_map_msi()
1706 TAILQ_REMOVE(&hpdev->irq_desc_list, hid, link); in vmbus_pcib_map_msi()
1707 hv_int_desc_free(hpdev, hid); in vmbus_pcib_map_msi()
1724 int_pkt->wslot.val = hpdev->desc.wslot.val; in vmbus_pcib_map_msi()
1750 TAILQ_INSERT_TAIL(&hpdev->irq_desc_list, hid, link); in vmbus_pcib_map_msi()