Lines Matching refs:hpdev

538 	struct hv_pci_dev *hpdev;  member
592 completion->hpdev->probed_bar[i] = in q_resource_requirements()
613 hv_int_desc_free(struct hv_pci_dev *hpdev, struct hv_irq_desc *hid) in hv_int_desc_free() argument
624 int_pkt->wslot.val = hpdev->desc.wslot.val; in hv_int_desc_free()
627 vmbus_chan_send(hpdev->hbus->sc->chan, VMBUS_CHANPKT_TYPE_INBAND, 0, in hv_int_desc_free()
634 hv_pci_delete_device(struct hv_pci_dev *hpdev) in hv_pci_delete_device() argument
636 struct hv_pcibus *hbus = hpdev->hbus; in hv_pci_delete_device()
641 devfn = wslot_to_devfn(hpdev->desc.wslot.val); in hv_pci_delete_device()
653 TAILQ_REMOVE(&hbus->children, hpdev, link); in hv_pci_delete_device()
656 TAILQ_FOREACH_SAFE(hid, &hpdev->irq_desc_list, link, tmp_hid) in hv_pci_delete_device()
657 hv_int_desc_free(hpdev, hid); in hv_pci_delete_device()
659 free(hpdev, M_DEVBUF); in hv_pci_delete_device()
665 struct hv_pci_dev *hpdev; in new_pcichild_device() local
674 hpdev = malloc(sizeof(*hpdev), M_DEVBUF, M_WAITOK | M_ZERO); in new_pcichild_device()
675 hpdev->hbus = hbus; in new_pcichild_device()
677 TAILQ_INIT(&hpdev->irq_desc_list); in new_pcichild_device()
680 comp_pkt.hpdev = hpdev; in new_pcichild_device()
700 hpdev->desc = *desc; in new_pcichild_device()
705 TAILQ_INSERT_TAIL(&hbus->children, hpdev, link); in new_pcichild_device()
707 return (hpdev); in new_pcichild_device()
710 free(hpdev, M_DEVBUF); in new_pcichild_device()
729 struct hv_pci_dev *hpdev, *tmp_hpdev; in pci_devices_present_work() local
755 TAILQ_FOREACH(hpdev, &hbus->children, link) in pci_devices_present_work()
756 hpdev->reported_missing = true; in pci_devices_present_work()
765 TAILQ_FOREACH(hpdev, &hbus->children, link) { in pci_devices_present_work()
766 if ((hpdev->desc.wslot.val == in pci_devices_present_work()
768 (hpdev->desc.v_id == new_desc->v_id) && in pci_devices_present_work()
769 (hpdev->desc.d_id == new_desc->d_id) && in pci_devices_present_work()
770 (hpdev->desc.ser == new_desc->ser)) { in pci_devices_present_work()
771 hpdev->reported_missing = false; in pci_devices_present_work()
782 hpdev = new_pcichild_device(hbus, new_desc); in pci_devices_present_work()
783 if (!hpdev) in pci_devices_present_work()
789 TAILQ_FOREACH_SAFE(hpdev, &hbus->children, link, tmp_hpdev) { in pci_devices_present_work()
790 if (hpdev->reported_missing) in pci_devices_present_work()
791 hv_pci_delete_device(hpdev); in pci_devices_present_work()
811 struct hv_pci_dev *hpdev, *ret = NULL; in get_pcichild_wslot() local
814 TAILQ_FOREACH(hpdev, &hbus->children, link) { in get_pcichild_wslot()
815 if (hpdev->desc.wslot.val == wslot) { in get_pcichild_wslot()
816 ret = hpdev; in get_pcichild_wslot()
888 struct hv_pci_dev *hpdev = arg; in hv_eject_device_work() local
889 union win_slot_encoding wslot = hpdev->desc.wslot; in hv_eject_device_work()
890 struct hv_pcibus *hbus = hpdev->hbus; in hv_eject_device_work()
897 hv_pci_delete_device(hpdev); in hv_eject_device_work()
908 hv_pci_eject_device(struct hv_pci_dev *hpdev) in hv_pci_eject_device() argument
910 struct hv_pcibus *hbus = hpdev->hbus; in hv_pci_eject_device()
921 TASK_INIT(&hpdev->eject_task, 0, hv_eject_device_work, hpdev); in hv_pci_eject_device()
923 taskqueue_enqueue(taskq, &hpdev->eject_task); in hv_pci_eject_device()
943 struct hv_pci_dev *hpdev; in vmbus_pcib_on_channel_callback() local
1020 hpdev = get_pcichild_wslot(hbus, in vmbus_pcib_on_channel_callback()
1023 if (hpdev) in vmbus_pcib_on_channel_callback()
1024 hv_pci_eject_device(hpdev); in vmbus_pcib_on_channel_callback()
1178 struct hv_pci_dev *hpdev; in hv_send_resources_allocated() local
1190 hpdev = get_pcichild_wslot(hbus, wslot); in hv_send_resources_allocated()
1191 if (!hpdev) in hv_send_resources_allocated()
1205 res_assigned->wslot.val = hpdev->desc.wslot.val; in hv_send_resources_allocated()
1211 res_assigned2->wslot.val = hpdev->desc.wslot.val; in hv_send_resources_allocated()
1242 struct hv_pci_dev *hpdev; in hv_send_resources_released() local
1247 hpdev = get_pcichild_wslot(hbus, wslot); in hv_send_resources_released()
1248 if (!hpdev) in hv_send_resources_released()
1252 pkt.wslot.val = hpdev->desc.wslot.val; in hv_send_resources_released()
1286 _hv_pcifront_read_config(struct hv_pci_dev *hpdev, int where, int size, in _hv_pcifront_read_config() argument
1289 struct hv_pcibus *hbus = hpdev->hbus; in _hv_pcifront_read_config()
1296 memcpy(val, ((uint8_t *)&hpdev->desc.v_id) + where, size); in _hv_pcifront_read_config()
1299 memcpy(val, ((uint8_t *)&hpdev->desc.rev) + where - in _hv_pcifront_read_config()
1303 memcpy(val, (uint8_t *)&hpdev->desc.subsystem_id + where - in _hv_pcifront_read_config()
1321 hv_cfg_write_4(hbus, 0, hpdev->desc.wslot.val); in _hv_pcifront_read_config()
1352 _hv_pcifront_write_config(struct hv_pci_dev *hpdev, int where, int size, in _hv_pcifront_write_config() argument
1355 struct hv_pcibus *hbus = hpdev->hbus; in _hv_pcifront_write_config()
1366 hv_cfg_write_4(hbus, 0, hpdev->desc.wslot.val); in _hv_pcifront_write_config()
1410 struct hv_pci_dev *hpdev; in vmbus_pcib_prepopulate_bars() local
1414 TAILQ_FOREACH(hpdev, &hbus->children, link) { in vmbus_pcib_prepopulate_bars()
1417 if (hpdev->probed_bar[i] == 0) in vmbus_pcib_prepopulate_bars()
1422 _hv_pcifront_read_config(hpdev, PCIR_BAR(i), in vmbus_pcib_prepopulate_bars()
1425 if (hpdev->probed_bar[i] != bar_val) { in vmbus_pcib_prepopulate_bars()
1430 _hv_pcifront_write_config(hpdev, PCIR_BAR(i), in vmbus_pcib_prepopulate_bars()
1434 _hv_pcifront_write_config(hpdev, PCIR_BAR(i), in vmbus_pcib_prepopulate_bars()
1671 struct hv_pci_dev *hpdev; in vmbus_pcib_alloc_resource() local
1687 hpdev = get_pcichild_wslot(sc->hbus, devfn_to_wslot(devfn)); in vmbus_pcib_alloc_resource()
1688 if (!hpdev) in vmbus_pcib_alloc_resource()
1696 if (!(hpdev->probed_bar[bar_no] & PCIM_BAR_MEM_64)) in vmbus_pcib_alloc_resource()
1743 struct hv_pci_dev *hpdev; in vmbus_pcib_read_config() local
1749 hpdev = get_pcichild_wslot(sc->hbus, devfn_to_wslot(devfn)); in vmbus_pcib_read_config()
1750 if (!hpdev) in vmbus_pcib_read_config()
1753 _hv_pcifront_read_config(hpdev, reg, bytes, &data); in vmbus_pcib_read_config()
1763 struct hv_pci_dev *hpdev; in vmbus_pcib_write_config() local
1768 hpdev = get_pcichild_wslot(sc->hbus, devfn_to_wslot(devfn)); in vmbus_pcib_write_config()
1769 if (!hpdev) in vmbus_pcib_write_config()
1772 _hv_pcifront_write_config(hpdev, reg, bytes, data); in vmbus_pcib_write_config()
1848 struct hv_pci_dev *hpdev; in vmbus_pcib_map_msi() local
1869 hpdev = get_pcichild_wslot(sc->hbus, devfn_to_wslot(devfn)); in vmbus_pcib_map_msi()
1870 if (!hpdev) in vmbus_pcib_map_msi()
1882 TAILQ_FOREACH_SAFE(hid, &hpdev->irq_desc_list, link, tmp_hid) { in vmbus_pcib_map_msi()
1884 TAILQ_REMOVE(&hpdev->irq_desc_list, hid, link); in vmbus_pcib_map_msi()
1885 hv_int_desc_free(hpdev, hid); in vmbus_pcib_map_msi()
1900 if (hpdev->hbus->protocol_version < PCI_PROTOCOL_VERSION_1_4 && in vmbus_pcib_map_msi()
1906 vcpu_id, hpdev->hbus->protocol_version); in vmbus_pcib_map_msi()
1915 switch (hpdev->hbus->protocol_version) { in vmbus_pcib_map_msi()
1919 ctxt.int_pkts.v1.wslot.val = hpdev->desc.wslot.val; in vmbus_pcib_map_msi()
1931 ctxt.int_pkts.v3.wslot.val = hpdev->desc.wslot.val; in vmbus_pcib_map_msi()
1966 TAILQ_INSERT_TAIL(&hpdev->irq_desc_list, hid, link); in vmbus_pcib_map_msi()