Lines Matching refs:hpdev
458 struct hv_pci_dev *hpdev; member
512 completion->hpdev->probed_bar[i] = in q_resource_requirements()
533 hv_int_desc_free(struct hv_pci_dev *hpdev, struct hv_irq_desc *hid) in hv_int_desc_free() argument
544 int_pkt->wslot.val = hpdev->desc.wslot.val; in hv_int_desc_free()
547 vmbus_chan_send(hpdev->hbus->sc->chan, VMBUS_CHANPKT_TYPE_INBAND, 0, in hv_int_desc_free()
554 hv_pci_delete_device(struct hv_pci_dev *hpdev) in hv_pci_delete_device() argument
556 struct hv_pcibus *hbus = hpdev->hbus; in hv_pci_delete_device()
561 devfn = wslot_to_devfn(hpdev->desc.wslot.val); in hv_pci_delete_device()
573 TAILQ_REMOVE(&hbus->children, hpdev, link); in hv_pci_delete_device()
576 TAILQ_FOREACH_SAFE(hid, &hpdev->irq_desc_list, link, tmp_hid) in hv_pci_delete_device()
577 hv_int_desc_free(hpdev, hid); in hv_pci_delete_device()
579 free(hpdev, M_DEVBUF); in hv_pci_delete_device()
585 struct hv_pci_dev *hpdev; in new_pcichild_device() local
594 hpdev = malloc(sizeof(*hpdev), M_DEVBUF, M_WAITOK | M_ZERO); in new_pcichild_device()
595 hpdev->hbus = hbus; in new_pcichild_device()
597 TAILQ_INIT(&hpdev->irq_desc_list); in new_pcichild_device()
600 comp_pkt.hpdev = hpdev; in new_pcichild_device()
620 hpdev->desc = *desc; in new_pcichild_device()
625 TAILQ_INSERT_TAIL(&hbus->children, hpdev, link); in new_pcichild_device()
627 return (hpdev); in new_pcichild_device()
630 free(hpdev, M_DEVBUF); in new_pcichild_device()
768 struct hv_pci_dev *hpdev, *tmp_hpdev; in pci_devices_present_work() local
794 TAILQ_FOREACH(hpdev, &hbus->children, link) in pci_devices_present_work()
795 hpdev->reported_missing = true; in pci_devices_present_work()
804 TAILQ_FOREACH(hpdev, &hbus->children, link) { in pci_devices_present_work()
805 if ((hpdev->desc.wslot.val == in pci_devices_present_work()
807 (hpdev->desc.v_id == new_desc->v_id) && in pci_devices_present_work()
808 (hpdev->desc.d_id == new_desc->d_id) && in pci_devices_present_work()
809 (hpdev->desc.ser == new_desc->ser)) { in pci_devices_present_work()
810 hpdev->reported_missing = false; in pci_devices_present_work()
821 hpdev = new_pcichild_device(hbus, new_desc); in pci_devices_present_work()
822 if (!hpdev) in pci_devices_present_work()
828 TAILQ_FOREACH_SAFE(hpdev, &hbus->children, link, tmp_hpdev) { in pci_devices_present_work()
829 if (hpdev->reported_missing) in pci_devices_present_work()
830 hv_pci_delete_device(hpdev); in pci_devices_present_work()
850 struct hv_pci_dev *hpdev, *ret = NULL; in get_pcichild_wslot() local
853 TAILQ_FOREACH(hpdev, &hbus->children, link) { in get_pcichild_wslot()
854 if (hpdev->desc.wslot.val == wslot) { in get_pcichild_wslot()
855 ret = hpdev; in get_pcichild_wslot()
897 struct hv_pci_dev *hpdev = arg; in hv_eject_device_work() local
898 union win_slot_encoding wslot = hpdev->desc.wslot; in hv_eject_device_work()
899 struct hv_pcibus *hbus = hpdev->hbus; in hv_eject_device_work()
906 hv_pci_delete_device(hpdev); in hv_eject_device_work()
917 hv_pci_eject_device(struct hv_pci_dev *hpdev) in hv_pci_eject_device() argument
919 struct hv_pcibus *hbus = hpdev->hbus; in hv_pci_eject_device()
930 TASK_INIT(&hpdev->eject_task, 0, hv_eject_device_work, hpdev); in hv_pci_eject_device()
932 taskqueue_enqueue(taskq, &hpdev->eject_task); in hv_pci_eject_device()
951 struct hv_pci_dev *hpdev; in vmbus_pcib_on_channel_callback() local
1013 hpdev = get_pcichild_wslot(hbus, in vmbus_pcib_on_channel_callback()
1016 if (hpdev) in vmbus_pcib_on_channel_callback()
1017 hv_pci_eject_device(hpdev); in vmbus_pcib_on_channel_callback()
1153 struct hv_pci_dev *hpdev; in hv_send_resources_allocated() local
1162 hpdev = get_pcichild_wslot(hbus, wslot); in hv_send_resources_allocated()
1163 if (!hpdev) in hv_send_resources_allocated()
1174 res_assigned->wslot.val = hpdev->desc.wslot.val; in hv_send_resources_allocated()
1204 struct hv_pci_dev *hpdev; in hv_send_resources_released() local
1209 hpdev = get_pcichild_wslot(hbus, wslot); in hv_send_resources_released()
1210 if (!hpdev) in hv_send_resources_released()
1214 pkt.wslot.val = hpdev->desc.wslot.val; in hv_send_resources_released()
1248 _hv_pcifront_read_config(struct hv_pci_dev *hpdev, int where, int size, in _hv_pcifront_read_config() argument
1251 struct hv_pcibus *hbus = hpdev->hbus; in _hv_pcifront_read_config()
1258 memcpy(val, ((uint8_t *)&hpdev->desc.v_id) + where, size); in _hv_pcifront_read_config()
1261 memcpy(val, ((uint8_t *)&hpdev->desc.rev) + where - in _hv_pcifront_read_config()
1265 memcpy(val, (uint8_t *)&hpdev->desc.subsystem_id + where - in _hv_pcifront_read_config()
1283 hv_cfg_write_4(hbus, 0, hpdev->desc.wslot.val); in _hv_pcifront_read_config()
1314 _hv_pcifront_write_config(struct hv_pci_dev *hpdev, int where, int size, in _hv_pcifront_write_config() argument
1317 struct hv_pcibus *hbus = hpdev->hbus; in _hv_pcifront_write_config()
1328 hv_cfg_write_4(hbus, 0, hpdev->desc.wslot.val); in _hv_pcifront_write_config()
1372 struct hv_pci_dev *hpdev; in vmbus_pcib_prepopulate_bars() local
1376 TAILQ_FOREACH(hpdev, &hbus->children, link) { in vmbus_pcib_prepopulate_bars()
1379 if (hpdev->probed_bar[i] == 0) in vmbus_pcib_prepopulate_bars()
1384 _hv_pcifront_read_config(hpdev, PCIR_BAR(i), in vmbus_pcib_prepopulate_bars()
1387 if (hpdev->probed_bar[i] != bar_val) { in vmbus_pcib_prepopulate_bars()
1392 _hv_pcifront_write_config(hpdev, PCIR_BAR(i), in vmbus_pcib_prepopulate_bars()
1628 struct hv_pci_dev *hpdev; in vmbus_pcib_alloc_resource() local
1644 hpdev = get_pcichild_wslot(sc->hbus, devfn_to_wslot(devfn)); in vmbus_pcib_alloc_resource()
1645 if (!hpdev) in vmbus_pcib_alloc_resource()
1653 if (!(hpdev->probed_bar[bar_no] & PCIM_BAR_MEM_64)) in vmbus_pcib_alloc_resource()
1699 struct hv_pci_dev *hpdev; in vmbus_pcib_read_config() local
1705 hpdev = get_pcichild_wslot(sc->hbus, devfn_to_wslot(devfn)); in vmbus_pcib_read_config()
1706 if (!hpdev) in vmbus_pcib_read_config()
1709 _hv_pcifront_read_config(hpdev, reg, bytes, &data); in vmbus_pcib_read_config()
1719 struct hv_pci_dev *hpdev; in vmbus_pcib_write_config() local
1724 hpdev = get_pcichild_wslot(sc->hbus, devfn_to_wslot(devfn)); in vmbus_pcib_write_config()
1725 if (!hpdev) in vmbus_pcib_write_config()
1728 _hv_pcifront_write_config(hpdev, reg, bytes, data); in vmbus_pcib_write_config()
1773 struct hv_pci_dev *hpdev; in vmbus_pcib_map_msi() local
1792 hpdev = get_pcichild_wslot(sc->hbus, devfn_to_wslot(devfn)); in vmbus_pcib_map_msi()
1793 if (!hpdev) in vmbus_pcib_map_msi()
1801 TAILQ_FOREACH_SAFE(hid, &hpdev->irq_desc_list, link, tmp_hid) { in vmbus_pcib_map_msi()
1803 TAILQ_REMOVE(&hpdev->irq_desc_list, hid, link); in vmbus_pcib_map_msi()
1804 hv_int_desc_free(hpdev, hid); in vmbus_pcib_map_msi()
1821 int_pkt->wslot.val = hpdev->desc.wslot.val; in vmbus_pcib_map_msi()
1847 TAILQ_INSERT_TAIL(&hpdev->irq_desc_list, hid, link); in vmbus_pcib_map_msi()