Lines Matching refs:hpdev
537 struct hv_pci_dev *hpdev; member
591 completion->hpdev->probed_bar[i] = in q_resource_requirements()
612 hv_int_desc_free(struct hv_pci_dev *hpdev, struct hv_irq_desc *hid) in hv_int_desc_free() argument
623 int_pkt->wslot.val = hpdev->desc.wslot.val; in hv_int_desc_free()
626 vmbus_chan_send(hpdev->hbus->sc->chan, VMBUS_CHANPKT_TYPE_INBAND, 0, in hv_int_desc_free()
633 hv_pci_delete_device(struct hv_pci_dev *hpdev) in hv_pci_delete_device() argument
635 struct hv_pcibus *hbus = hpdev->hbus; in hv_pci_delete_device()
640 devfn = wslot_to_devfn(hpdev->desc.wslot.val); in hv_pci_delete_device()
652 TAILQ_REMOVE(&hbus->children, hpdev, link); in hv_pci_delete_device()
655 TAILQ_FOREACH_SAFE(hid, &hpdev->irq_desc_list, link, tmp_hid) in hv_pci_delete_device()
656 hv_int_desc_free(hpdev, hid); in hv_pci_delete_device()
658 free(hpdev, M_DEVBUF); in hv_pci_delete_device()
664 struct hv_pci_dev *hpdev; in new_pcichild_device() local
673 hpdev = malloc(sizeof(*hpdev), M_DEVBUF, M_WAITOK | M_ZERO); in new_pcichild_device()
674 hpdev->hbus = hbus; in new_pcichild_device()
676 TAILQ_INIT(&hpdev->irq_desc_list); in new_pcichild_device()
679 comp_pkt.hpdev = hpdev; in new_pcichild_device()
699 hpdev->desc = *desc; in new_pcichild_device()
704 TAILQ_INSERT_TAIL(&hbus->children, hpdev, link); in new_pcichild_device()
706 return (hpdev); in new_pcichild_device()
709 free(hpdev, M_DEVBUF); in new_pcichild_device()
728 struct hv_pci_dev *hpdev, *tmp_hpdev; in pci_devices_present_work() local
754 TAILQ_FOREACH(hpdev, &hbus->children, link) in pci_devices_present_work()
755 hpdev->reported_missing = true; in pci_devices_present_work()
764 TAILQ_FOREACH(hpdev, &hbus->children, link) { in pci_devices_present_work()
765 if ((hpdev->desc.wslot.val == in pci_devices_present_work()
767 (hpdev->desc.v_id == new_desc->v_id) && in pci_devices_present_work()
768 (hpdev->desc.d_id == new_desc->d_id) && in pci_devices_present_work()
769 (hpdev->desc.ser == new_desc->ser)) { in pci_devices_present_work()
770 hpdev->reported_missing = false; in pci_devices_present_work()
781 hpdev = new_pcichild_device(hbus, new_desc); in pci_devices_present_work()
782 if (!hpdev) in pci_devices_present_work()
788 TAILQ_FOREACH_SAFE(hpdev, &hbus->children, link, tmp_hpdev) { in pci_devices_present_work()
789 if (hpdev->reported_missing) in pci_devices_present_work()
790 hv_pci_delete_device(hpdev); in pci_devices_present_work()
810 struct hv_pci_dev *hpdev, *ret = NULL; in get_pcichild_wslot() local
813 TAILQ_FOREACH(hpdev, &hbus->children, link) { in get_pcichild_wslot()
814 if (hpdev->desc.wslot.val == wslot) { in get_pcichild_wslot()
815 ret = hpdev; in get_pcichild_wslot()
887 struct hv_pci_dev *hpdev = arg; in hv_eject_device_work() local
888 union win_slot_encoding wslot = hpdev->desc.wslot; in hv_eject_device_work()
889 struct hv_pcibus *hbus = hpdev->hbus; in hv_eject_device_work()
896 hv_pci_delete_device(hpdev); in hv_eject_device_work()
907 hv_pci_eject_device(struct hv_pci_dev *hpdev) in hv_pci_eject_device() argument
909 struct hv_pcibus *hbus = hpdev->hbus; in hv_pci_eject_device()
920 TASK_INIT(&hpdev->eject_task, 0, hv_eject_device_work, hpdev); in hv_pci_eject_device()
922 taskqueue_enqueue(taskq, &hpdev->eject_task); in hv_pci_eject_device()
942 struct hv_pci_dev *hpdev; in vmbus_pcib_on_channel_callback() local
1019 hpdev = get_pcichild_wslot(hbus, in vmbus_pcib_on_channel_callback()
1022 if (hpdev) in vmbus_pcib_on_channel_callback()
1023 hv_pci_eject_device(hpdev); in vmbus_pcib_on_channel_callback()
1177 struct hv_pci_dev *hpdev; in hv_send_resources_allocated() local
1189 hpdev = get_pcichild_wslot(hbus, wslot); in hv_send_resources_allocated()
1190 if (!hpdev) in hv_send_resources_allocated()
1204 res_assigned->wslot.val = hpdev->desc.wslot.val; in hv_send_resources_allocated()
1210 res_assigned2->wslot.val = hpdev->desc.wslot.val; in hv_send_resources_allocated()
1241 struct hv_pci_dev *hpdev; in hv_send_resources_released() local
1246 hpdev = get_pcichild_wslot(hbus, wslot); in hv_send_resources_released()
1247 if (!hpdev) in hv_send_resources_released()
1251 pkt.wslot.val = hpdev->desc.wslot.val; in hv_send_resources_released()
1285 _hv_pcifront_read_config(struct hv_pci_dev *hpdev, int where, int size, in _hv_pcifront_read_config() argument
1288 struct hv_pcibus *hbus = hpdev->hbus; in _hv_pcifront_read_config()
1295 memcpy(val, ((uint8_t *)&hpdev->desc.v_id) + where, size); in _hv_pcifront_read_config()
1298 memcpy(val, ((uint8_t *)&hpdev->desc.rev) + where - in _hv_pcifront_read_config()
1302 memcpy(val, (uint8_t *)&hpdev->desc.subsystem_id + where - in _hv_pcifront_read_config()
1320 hv_cfg_write_4(hbus, 0, hpdev->desc.wslot.val); in _hv_pcifront_read_config()
1351 _hv_pcifront_write_config(struct hv_pci_dev *hpdev, int where, int size, in _hv_pcifront_write_config() argument
1354 struct hv_pcibus *hbus = hpdev->hbus; in _hv_pcifront_write_config()
1365 hv_cfg_write_4(hbus, 0, hpdev->desc.wslot.val); in _hv_pcifront_write_config()
1409 struct hv_pci_dev *hpdev; in vmbus_pcib_prepopulate_bars() local
1413 TAILQ_FOREACH(hpdev, &hbus->children, link) { in vmbus_pcib_prepopulate_bars()
1416 if (hpdev->probed_bar[i] == 0) in vmbus_pcib_prepopulate_bars()
1421 _hv_pcifront_read_config(hpdev, PCIR_BAR(i), in vmbus_pcib_prepopulate_bars()
1424 if (hpdev->probed_bar[i] != bar_val) { in vmbus_pcib_prepopulate_bars()
1429 _hv_pcifront_write_config(hpdev, PCIR_BAR(i), in vmbus_pcib_prepopulate_bars()
1433 _hv_pcifront_write_config(hpdev, PCIR_BAR(i), in vmbus_pcib_prepopulate_bars()
1670 struct hv_pci_dev *hpdev; in vmbus_pcib_alloc_resource() local
1686 hpdev = get_pcichild_wslot(sc->hbus, devfn_to_wslot(devfn)); in vmbus_pcib_alloc_resource()
1687 if (!hpdev) in vmbus_pcib_alloc_resource()
1695 if (!(hpdev->probed_bar[bar_no] & PCIM_BAR_MEM_64)) in vmbus_pcib_alloc_resource()
1775 struct hv_pci_dev *hpdev; in vmbus_pcib_read_config() local
1781 hpdev = get_pcichild_wslot(sc->hbus, devfn_to_wslot(devfn)); in vmbus_pcib_read_config()
1782 if (!hpdev) in vmbus_pcib_read_config()
1785 _hv_pcifront_read_config(hpdev, reg, bytes, &data); in vmbus_pcib_read_config()
1795 struct hv_pci_dev *hpdev; in vmbus_pcib_write_config() local
1800 hpdev = get_pcichild_wslot(sc->hbus, devfn_to_wslot(devfn)); in vmbus_pcib_write_config()
1801 if (!hpdev) in vmbus_pcib_write_config()
1804 _hv_pcifront_write_config(hpdev, reg, bytes, data); in vmbus_pcib_write_config()
1880 struct hv_pci_dev *hpdev; in vmbus_pcib_map_msi() local
1901 hpdev = get_pcichild_wslot(sc->hbus, devfn_to_wslot(devfn)); in vmbus_pcib_map_msi()
1902 if (!hpdev) in vmbus_pcib_map_msi()
1914 TAILQ_FOREACH_SAFE(hid, &hpdev->irq_desc_list, link, tmp_hid) { in vmbus_pcib_map_msi()
1916 TAILQ_REMOVE(&hpdev->irq_desc_list, hid, link); in vmbus_pcib_map_msi()
1917 hv_int_desc_free(hpdev, hid); in vmbus_pcib_map_msi()
1932 if (hpdev->hbus->protocol_version < PCI_PROTOCOL_VERSION_1_4 && in vmbus_pcib_map_msi()
1938 vcpu_id, hpdev->hbus->protocol_version); in vmbus_pcib_map_msi()
1947 switch (hpdev->hbus->protocol_version) { in vmbus_pcib_map_msi()
1951 ctxt.int_pkts.v1.wslot.val = hpdev->desc.wslot.val; in vmbus_pcib_map_msi()
1963 ctxt.int_pkts.v3.wslot.val = hpdev->desc.wslot.val; in vmbus_pcib_map_msi()
1998 TAILQ_INSERT_TAIL(&hpdev->irq_desc_list, hid, link); in vmbus_pcib_map_msi()