Lines Matching defs:hdev
456 struct hv_device *hdev;
594 static int wait_for_response(struct hv_device *hdev,
598 if (hdev->channel->rescind) {
599 dev_warn_once(&hdev->device, "The device is gone.\n");
716 dev_err(&hpdev->hbus->hdev->device,
787 dev_err(&hpdev->hbus->hdev->device,
962 ret = vmbus_sendpacket(hbus->hdev->channel, read_blk,
969 ret = wait_for_response(hbus->hdev, &comp_pkt.comp_pkt.host_event);
975 dev_err(&hbus->hdev->device,
1052 ret = vmbus_sendpacket(hbus->hdev->channel, write_blk, pkt_size,
1058 ret = wait_for_response(hbus->hdev, &comp_pkt.host_event);
1063 dev_err(&hbus->hdev->device,
1122 vmbus_sendpacket(hpdev->hbus->hdev->channel, int_pkt, sizeof(*int_pkt),
1232 dev_warn(&hbus->hdev->device, "%s() can not unmask irq %u\n",
1245 params->device_id = (hbus->hdev->dev_instance.b[5] << 24) |
1246 (hbus->hdev->dev_instance.b[4] << 16) |
1247 (hbus->hdev->dev_instance.b[7] << 8) |
1248 (hbus->hdev->dev_instance.b[6] & 0xf8) |
1320 dev_err(&hbus->hdev->device,
1434 channel = hbus->hdev->channel;
1501 dev_err(&hbus->hdev->device,
1506 ret = vmbus_sendpacket(hpdev->hbus->hdev->channel, &ctxt.int_pkts,
1511 dev_err(&hbus->hdev->device,
1532 dev_err_once(&hbus->hdev->device,
1558 dev_err(&hbus->hdev->device,
1634 dev_err(&hbus->hdev->device,
1696 dev_err(&hbus->hdev->device,
1924 hbus->pci_bus = pci_create_root_bus(&hbus->hdev->device,
1933 hbus->pci_bus->msi->dev = &hbus->hdev->device;
1969 dev_err(&completion->hpdev->hbus->hdev->device,
2021 ret = vmbus_sendpacket(hbus->hdev->channel, res_req,
2029 if (wait_for_response(hbus->hdev, &comp_pkt.host_event))
2166 dev_err(&hbus->hdev->device,
2239 dev_info(&hbus->hdev->device,
2397 vmbus_sendpacket(hbus->hdev->channel, ejct_pkt,
2422 struct hv_device *hdev = hbus->hdev;
2425 dev_info(&hdev->device, "PCI VMBus EJECT: ignored\n");
2466 ret = vmbus_recvpacket_raw(hbus->hdev->channel, buffer,
2515 dev_err(&hbus->hdev->device,
2529 dev_err(&hbus->hdev->device,
2564 dev_warn(&hbus->hdev->device,
2572 dev_err(&hbus->hdev->device,
2584 * @hdev: VMBus's tracking struct for this root PCI bus.
2601 static int hv_pci_protocol_negotiation(struct hv_device *hdev,
2605 struct hv_pcibus_device *hbus = hv_get_drvdata(hdev);
2630 ret = vmbus_sendpacket(hdev->channel, version_req,
2635 ret = wait_for_response(hdev, &comp_pkt.host_event);
2638 dev_err(&hdev->device,
2646 dev_info(&hdev->device,
2653 dev_err(&hdev->device,
2663 dev_err(&hdev->device,
2729 ret = vmbus_allocate_mmio(&hbus->low_mmio_res, hbus->hdev, 0,
2734 dev_err(&hbus->hdev->device,
2749 ret = vmbus_allocate_mmio(&hbus->high_mmio_res, hbus->hdev,
2754 dev_err(&hbus->hdev->device,
2795 ret = vmbus_allocate_mmio(&hbus->mem_config, hbus->hdev, 0, -1,
2818 static int hv_pci_bus_exit(struct hv_device *hdev, bool keep_devs);
2822 * @hdev: VMBus's tracking struct for this root PCI bus
2826 static int hv_pci_enter_d0(struct hv_device *hdev)
2828 struct hv_pcibus_device *hbus = hv_get_drvdata(hdev);
2853 ret = vmbus_sendpacket(hdev->channel, d0_entry, sizeof(*d0_entry),
2857 ret = wait_for_response(hdev, &comp_pkt.host_event);
2872 dev_err(&hdev->device, "Retrying D0 Entry\n");
2884 ret = hv_pci_bus_exit(hdev, true);
2890 dev_err(&hdev->device,
2895 dev_err(&hdev->device,
2912 * @hdev: VMBus's tracking struct for this root PCI bus
2916 static int hv_pci_query_relations(struct hv_device *hdev)
2918 struct hv_pcibus_device *hbus = hv_get_drvdata(hdev);
2931 ret = vmbus_sendpacket(hdev->channel, &message, sizeof(message),
2934 ret = wait_for_response(hdev, &comp);
2959 * @hdev: VMBus's tracking struct for this root PCI bus
2974 static int hv_send_resources_allocated(struct hv_device *hdev)
2976 struct hv_pcibus_device *hbus = hv_get_drvdata(hdev);
3020 ret = vmbus_sendpacket(hdev->channel, &pkt->message,
3025 ret = wait_for_response(hdev, &comp_pkt.host_event);
3031 dev_err(&hdev->device,
3047 * @hdev: VMBus's tracking struct for this root PCI bus
3051 static int hv_send_resources_released(struct hv_device *hdev)
3053 struct hv_pcibus_device *hbus = hv_get_drvdata(hdev);
3070 ret = vmbus_sendpacket(hdev->channel, &pkt, sizeof(pkt), 0,
3138 * @hdev: VMBus's tracking struct for this root PCI bus
3143 static int hv_pci_probe(struct hv_device *hdev,
3194 dom_req = hdev->dev_instance.b[5] << 8 | hdev->dev_instance.b[4];
3198 dev_err(&hdev->device,
3205 dev_info(&hdev->device,
3211 hbus->hdev = hdev;
3227 ret = vmbus_open(hdev->channel, pci_ring_size, pci_ring_size, NULL, 0,
3232 hv_set_drvdata(hdev, hbus);
3234 ret = hv_pci_protocol_negotiation(hdev, pci_protocol_versions,
3246 dev_err(&hdev->device,
3252 name = kasprintf(GFP_KERNEL, "%pUL", &hdev->dev_instance);
3269 ret = hv_pci_query_relations(hdev);
3273 ret = hv_pci_enter_d0(hdev);
3281 ret = hv_send_resources_allocated(hdev);
3298 (void) hv_pci_bus_exit(hdev, true);
3308 vmbus_close(hdev->channel);
3318 static int hv_pci_bus_exit(struct hv_device *hdev, bool keep_devs)
3320 struct hv_pcibus_device *hbus = hv_get_drvdata(hdev);
3334 if (hdev->channel->rescind)
3358 ret = hv_send_resources_released(hdev);
3360 dev_err(&hdev->device,
3371 ret = vmbus_sendpacket(hdev->channel, &pkt.teardown_packet.message,
3387 * @hdev: VMBus's tracking struct for this root PCI bus
3391 static int hv_pci_remove(struct hv_device *hdev)
3396 hbus = hv_get_drvdata(hdev);
3398 tasklet_disable(&hdev->channel->callback_event);
3400 tasklet_enable(&hdev->channel->callback_event);
3417 ret = hv_pci_bus_exit(hdev, false);
3419 vmbus_close(hdev->channel);
3436 static int hv_pci_suspend(struct hv_device *hdev)
3438 struct hv_pcibus_device *hbus = hv_get_drvdata(hdev);
3460 tasklet_disable(&hdev->channel->callback_event);
3467 tasklet_enable(&hdev->channel->callback_event);
3474 ret = hv_pci_bus_exit(hdev, true);
3478 vmbus_close(hdev->channel);
3511 static int hv_pci_resume(struct hv_device *hdev)
3513 struct hv_pcibus_device *hbus = hv_get_drvdata(hdev);
3519 ret = vmbus_open(hdev->channel, pci_ring_size, pci_ring_size, NULL, 0,
3526 ret = hv_pci_protocol_negotiation(hdev, version, 1);
3530 ret = hv_pci_query_relations(hdev);
3534 ret = hv_pci_enter_d0(hdev);
3538 ret = hv_send_resources_allocated(hdev);
3549 vmbus_close(hdev->channel);