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