iPXE
|
Hyper-V virtual machine bus. More...
#include <stdint.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <assert.h>
#include <byteswap.h>
#include <ipxe/nap.h>
#include <ipxe/malloc.h>
#include <ipxe/iobuf.h>
#include <ipxe/bitops.h>
#include <ipxe/hyperv.h>
#include <ipxe/vmbus.h>
Go to the source code of this file.
Macros | |
#define | VMBUS_GPADL_MAGIC 0x18ae0000 |
VMBus initial GPADL ID. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
static int | vmbus_post_message (struct hv_hypervisor *hv, const struct vmbus_message_header *header, size_t len) |
Post message. More... | |
static int | vmbus_post_empty_message (struct hv_hypervisor *hv, unsigned int type) |
Post empty message. More... | |
static int | vmbus_wait_for_any_message (struct hv_hypervisor *hv) |
Wait for received message of any type. More... | |
static int | vmbus_wait_for_message (struct hv_hypervisor *hv, unsigned int type) |
Wait for received message of a specified type, ignoring any others. More... | |
static int | vmbus_initiate_contact (struct hv_hypervisor *hv, unsigned int raw) |
Initiate contact. More... | |
static int | vmbus_unload (struct hv_hypervisor *hv) |
Terminate contact. More... | |
static int | vmbus_negotiate_version (struct hv_hypervisor *hv) |
Negotiate protocol version. More... | |
int | vmbus_establish_gpadl (struct vmbus_device *vmdev, userptr_t data, size_t len) |
Establish GPA descriptor list. More... | |
int | vmbus_gpadl_teardown (struct vmbus_device *vmdev, unsigned int gpadl) |
Tear down GPA descriptor list. More... | |
int | vmbus_open (struct vmbus_device *vmdev, struct vmbus_channel_operations *op, size_t out_len, size_t in_len, size_t mtu) |
Open VMBus channel. More... | |
void | vmbus_close (struct vmbus_device *vmdev) |
Close VMBus channel. More... | |
static void | vmbus_signal_monitor (struct vmbus_device *vmdev) |
Signal channel via monitor page. More... | |
static void | vmbus_signal_event (struct vmbus_device *vmdev) |
Signal channel via hypervisor event. More... | |
static size_t | vmbus_produce (struct vmbus_device *vmdev, size_t prod, const void *data, size_t len) |
Fill outbound ring buffer. More... | |
static size_t | vmbus_consume (struct vmbus_device *vmdev, size_t cons, void *data, size_t len) |
Consume inbound ring buffer. More... | |
static int | vmbus_send (struct vmbus_device *vmdev, struct vmbus_packet_header *header, const void *data, size_t len) |
Send packet via ring buffer. More... | |
int | vmbus_send_control (struct vmbus_device *vmdev, uint64_t xid, const void *data, size_t len) |
Send control packet via ring buffer. More... | |
int | vmbus_send_data (struct vmbus_device *vmdev, uint64_t xid, const void *data, size_t len, struct io_buffer *iobuf) |
Send data packet via ring buffer. More... | |
int | vmbus_send_completion (struct vmbus_device *vmdev, uint64_t xid, const void *data, size_t len) |
Send completion packet via ring buffer. More... | |
int | vmbus_send_cancellation (struct vmbus_device *vmdev, uint64_t xid) |
Send cancellation packet via ring buffer. More... | |
static struct vmbus_xfer_pages * | vmbus_xfer_pages (struct vmbus_device *vmdev, uint16_t pageset) |
Get transfer page set from pageset ID. More... | |
static int | vmbus_xfer_page_iobufs (struct vmbus_device *vmdev, struct vmbus_packet_header *header, struct list_head *list) |
Construct I/O buffer list from transfer pages. More... | |
int | vmbus_poll (struct vmbus_device *vmdev) |
Poll ring buffer. More... | |
void | vmbus_dump_channel (struct vmbus_device *vmdev) |
Dump channel status (for debugging) More... | |
static struct vmbus_driver * | vmbus_find_driver (const union uuid *type) |
Find driver for VMBus device. More... | |
static int | vmbus_probe_channels (struct hv_hypervisor *hv, struct device *parent) |
Probe channels. More... | |
static int | vmbus_reset_channels (struct hv_hypervisor *hv, struct device *parent) |
Reset channels. More... | |
static void | vmbus_remove_channels (struct hv_hypervisor *hv __unused, struct device *parent) |
Remove channels. More... | |
int | vmbus_probe (struct hv_hypervisor *hv, struct device *parent) |
Probe Hyper-V virtual machine bus. More... | |
int | vmbus_reset (struct hv_hypervisor *hv, struct device *parent) |
Reset Hyper-V virtual machine bus. More... | |
void | vmbus_remove (struct hv_hypervisor *hv, struct device *parent) |
Remove Hyper-V virtual machine bus. More... | |
Variables | |
static unsigned int | vmbus_gpadl = VMBUS_GPADL_MAGIC |
Current (i.e. More... | |
unsigned int | vmbus_obsolete_gpadl |
Obsolete GPADL ID threshold. More... | |
Hyper-V virtual machine bus.
Definition in file vmbus.c.
#define VMBUS_GPADL_MAGIC 0x18ae0000 |
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
static |
Post message.
hv | Hyper-V hypervisor |
header | Message header |
len | Length of message (including header) |
rc | Return status code |
Definition at line 71 of file vmbus.c.
References DBGC, header, len, rc, strerror(), hv_hypervisor::vmbus, VMBUS_MESSAGE_ID, and VMBUS_MESSAGE_TYPE.
Referenced by vmbus_close(), vmbus_establish_gpadl(), vmbus_gpadl_teardown(), vmbus_initiate_contact(), vmbus_open(), and vmbus_post_empty_message().
|
static |
Post empty message.
hv | Hyper-V hypervisor |
type | Message type |
rc | Return status code |
Definition at line 95 of file vmbus.c.
References cpu_to_le32, header, type, and vmbus_post_message().
Referenced by vmbus_probe_channels(), vmbus_reset_channels(), and vmbus_unload().
|
static |
Wait for received message of any type.
hv | Hyper-V hypervisor |
rc | Return status code |
Definition at line 108 of file vmbus.c.
References cpu_to_le32, DBGC, EINVAL, hv_wait_for_message(), le32_to_cpu, hv_hypervisor::message, rc, hv_message_buffer::received, strerror(), hv_message::type, hv_hypervisor::vmbus, VMBUS_MESSAGE_SINT, and VMBUS_MESSAGE_TYPE.
Referenced by vmbus_probe_channels(), vmbus_reset_channels(), and vmbus_wait_for_message().
|
static |
Wait for received message of a specified type, ignoring any others.
hv | Hyper-V hypervisor |
type | Message type |
rc | Return status code |
Definition at line 136 of file vmbus.c.
References cpu_to_le32, DBGC, vmbus_message::header, header, le32_to_cpu, vmbus::message, rc, type, hv_hypervisor::vmbus, and vmbus_wait_for_any_message().
Referenced by vmbus_establish_gpadl(), vmbus_gpadl_teardown(), vmbus_initiate_contact(), vmbus_open(), and vmbus_unload().
|
static |
Initiate contact.
hv | Hyper-V hypervisor |
raw | VMBus protocol (raw) version |
rc | Return status code |
Definition at line 168 of file vmbus.c.
References cpu_to_le32, DBGC, ENOTSUP, vmbus_initiate_contact::header, vmbus_initiate_contact::intr, vmbus::intr, le16_to_cpu, vmbus_version::major, memset(), vmbus::message, vmbus_version::minor, vmbus_initiate_contact::monitor_in, vmbus::monitor_in, vmbus_initiate_contact::monitor_out, vmbus::monitor_out, raw, vmbus_version::raw, rc, vmbus_message_header::type, vmbus_initiate_contact::version, vmbus_message::version, version, virt_to_phys(), hv_hypervisor::vmbus, VMBUS_INITIATE_CONTACT, vmbus_post_message(), VMBUS_VERSION_RESPONSE, and vmbus_wait_for_message().
|
static |
Terminate contact.
hv | Hyper-V hypervisor |
rc | Return status code |
Definition at line 211 of file vmbus.c.
References rc, vmbus_post_empty_message(), VMBUS_UNLOAD, VMBUS_UNLOAD_RESPONSE, and vmbus_wait_for_message().
Referenced by vmbus_negotiate_version(), vmbus_probe(), and vmbus_remove().
|
static |
Negotiate protocol version.
hv | Hyper-V hypervisor |
rc | Return status code |
Definition at line 231 of file vmbus.c.
References rc, vmbus_unload(), VMBUS_VERSION_WIN8_1, and VMBUS_VERSION_WS2008.
Referenced by vmbus_probe(), and vmbus_reset().
int vmbus_establish_gpadl | ( | struct vmbus_device * | vmdev, |
userptr_t | data, | ||
size_t | len | ||
) |
Establish GPA descriptor list.
vmdev | VMBus device |
data | Data buffer |
len | Length of data buffer |
gpadl | GPADL ID, or negative error |
Definition at line 276 of file vmbus.c.
References __attribute__, addr, vmbus_gpadl_created::channel, vmbus_device::channel, cpu_to_le16, cpu_to_le32, vmbus_message::created, data, DBGC, vmbus_device::dev, EPROTO, gpadl, vmbus_gpadl_created::gpadl, vmbus_device::hv, hv_pfn_count(), le32_to_cpu, len, memset(), vmbus::message, device::name, PAGE_SIZE, vmbus_gpa_range::pfn, range, rc, vmbus_gpadl_created::status, user_to_phys(), hv_hypervisor::vmbus, vmbus_gpadl, VMBUS_GPADL_CREATED, VMBUS_GPADL_HEADER, vmbus_post_message(), and vmbus_wait_for_message().
Referenced by netvsc_create_buffer(), and vmbus_open().
int vmbus_gpadl_teardown | ( | struct vmbus_device * | vmdev, |
unsigned int | gpadl | ||
) |
Tear down GPA descriptor list.
vmdev | VMBus device |
gpadl | GPADL ID |
rc | Return status code |
Definition at line 347 of file vmbus.c.
References vmbus_gpadl_teardown::channel, vmbus_device::channel, cpu_to_le32, DBGC, vmbus_device::dev, EPROTO, gpadl, vmbus_gpadl_teardown::gpadl, vmbus_gpadl_torndown::gpadl, vmbus_gpadl_teardown::header, vmbus_device::hv, le32_to_cpu, memset(), vmbus::message, device::name, rc, vmbus_message::torndown, vmbus_message_header::type, hv_hypervisor::vmbus, vmbus_gpadl_is_obsolete(), VMBUS_GPADL_TEARDOWN, VMBUS_GPADL_TORNDOWN, vmbus_post_message(), and vmbus_wait_for_message().
Referenced by netvsc_create_buffer(), and vmbus_open().
int vmbus_open | ( | struct vmbus_device * | vmdev, |
struct vmbus_channel_operations * | op, | ||
size_t | out_len, | ||
size_t | in_len, | ||
size_t | mtu | ||
) |
Open VMBus channel.
vmdev | VMBus device |
op | Channel operations |
out_len | Outbound ring buffer length |
in_len | Inbound ring buffer length |
mtu | Maximum expected data packet length (including headers) |
rc | Return status code |
Both outbound and inbound ring buffer lengths must be a power of two and a multiple of PAGE_SIZE. The requirement to be a power of two is a policy decision taken to simplify the ring buffer indexing logic.
Definition at line 403 of file vmbus.c.
References assert(), vmbus_open_channel_result::channel, vmbus_device::channel, cpu_to_le32, DBGC, vmbus_device::dev, ENOMEM, EPROTO, free, free_phys(), gpadl, vmbus_device::gpadl, vmbus_device::hv, vmbus_open_channel_result::id, vmbus_device::in, vmbus_device::in_len, le32_to_cpu, len, malloc(), malloc_phys(), memset(), vmbus::message, mtu, vmbus_device::mtu, device::name, op, vmbus_device::op, open(), vmbus_message::opened, vmbus_device::out, vmbus_device::out_len, vmbus_device::packet, PAGE_SIZE, random(), rc, vmbus_open_channel_result::status, virt_to_phys(), virt_to_user(), hv_hypervisor::vmbus, vmbus_establish_gpadl(), vmbus_gpadl_teardown(), VMBUS_OPEN_CHANNEL, VMBUS_OPEN_CHANNEL_RESULT, vmbus_post_message(), and vmbus_wait_for_message().
Referenced by netvsc_open().
void vmbus_close | ( | struct vmbus_device * | vmdev | ) |
Close VMBus channel.
vmdev | VMBus device |
Definition at line 524 of file vmbus.c.
References vmbus_device::channel, close, cpu_to_le32, DBGC, vmbus_device::dev, free, free_phys(), vmbus_device::gpadl, vmbus_device::hv, vmbus_device::in, vmbus_device::in_len, len, memset(), device::name, NULL, vmbus_device::out, vmbus_device::out_len, vmbus_device::packet, rc, strerror(), VMBUS_CLOSE_CHANNEL, and vmbus_post_message().
Referenced by netvsc_close(), and netvsc_open().
|
static |
Signal channel via monitor page.
vmdev | VMBus device |
Definition at line 574 of file vmbus.c.
References bit, group, vmbus_device::hv, vmbus_device::monitor, vmbus::monitor_out, hv_monitor_trigger::pending, set_bit(), trigger, hv_monitor::trigger, and hv_hypervisor::vmbus.
Referenced by vmbus_probe_channels().
|
static |
Signal channel via hypervisor event.
vmdev | VMBus device |
Definition at line 593 of file vmbus.c.
References DBGC, vmbus_device::dev, vmbus_device::hv, device::name, rc, strerror(), and VMBUS_EVENT_ID.
Referenced by vmbus_probe_channels().
|
static |
Fill outbound ring buffer.
vmdev | VMBus device |
prod | Producer index |
data | Data |
len | Length |
prod | New producer index |
The caller must ensure that there is sufficient space in the ring buffer.
Definition at line 617 of file vmbus.c.
References data, vmbus_ring::data, first, len, memcpy(), vmbus_device::out, vmbus_device::out_len, and second.
Referenced by vmbus_send().
|
static |
Consume inbound ring buffer.
vmdev | VMBus device |
cons | Consumer index |
data | Data buffer, or NULL |
len | Length to consume |
cons | New consumer index |
Definition at line 645 of file vmbus.c.
References cons, data, vmbus_ring::data, first, vmbus_device::in, vmbus_device::in_len, len, memcpy(), and second.
Referenced by vmbus_poll().
|
static |
Send packet via ring buffer.
vmdev | VMBus device |
header | Packet header |
data | Data |
len | Length of data |
rc | Return status code |
Send a packet via the outbound ring buffer. All fields in the packet header must be filled in, with the exception of the total packet length.
Definition at line 677 of file vmbus.c.
References assert(), vmbus_device::channel, cons, vmbus_ring::cons, cpu_to_le16, cpu_to_le32, data, DBGC, DBGC2, DBGC2_HDA, vmbus_device::dev, ENOBUFS, fill, header, vmbus_device::hv, vmbus::intr, vmbus_ring::intr_mask, le16_to_cpu, le32_to_cpu, len, mb(), device::name, NULL, vmbus_interrupt::out, vmbus_device::out, vmbus_device::out_len, pad_len, vmbus_packet_footer::prod, vmbus_ring::prod, vmbus_packet_footer::reserved, rmb, set_bit(), vmbus_device::signal, hv_hypervisor::vmbus, vmbus_produce(), and wmb().
Referenced by vmbus_send_cancellation(), vmbus_send_completion(), vmbus_send_control(), and vmbus_send_data().
int vmbus_send_control | ( | struct vmbus_device * | vmdev, |
uint64_t | xid, | ||
const void * | data, | ||
size_t | len | ||
) |
Send control packet via ring buffer.
vmdev | VMBus device |
xid | Transaction ID (or zero to not request completion) |
data | Data |
len | Length of data |
rc | Return status code |
Send data using a VMBUS_DATA_INBAND packet.
Definition at line 765 of file vmbus.c.
References assert(), cpu_to_le16, data, ena_aq_header::flags, header, len, NULL, vmbus_device::packet, VMBUS_COMPLETION_REQUESTED, VMBUS_DATA_INBAND, vmbus_send(), and vmbus_packet_header::xid.
Referenced by netvsc_control().
int vmbus_send_data | ( | struct vmbus_device * | vmdev, |
uint64_t | xid, | ||
const void * | data, | ||
size_t | len, | ||
struct io_buffer * | iobuf | ||
) |
Send data packet via ring buffer.
vmdev | VMBus device |
xid | Transaction ID |
data | Data |
len | Length of data |
iobuf | I/O buffer |
rc | Return status code |
Send data using a VMBUS_DATA_GPA_DIRECT packet. The caller is responsible for ensuring that the I/O buffer remains untouched until the corresponding completion has been received.
Definition at line 794 of file vmbus.c.
References __attribute__, addr, assert(), cpu_to_le16, cpu_to_le32, data, io_buffer::data, ena_aq_header::flags, header, hv_pfn_count(), iob_len(), len, vmbus_device::mtu, NULL, vmbus_device::packet, PAGE_SIZE, vmbus_gpa_range::pfn, range, virt_to_phys(), VMBUS_COMPLETION_REQUESTED, VMBUS_DATA_GPA_DIRECT, and vmbus_send().
Referenced by netvsc_transmit().
int vmbus_send_completion | ( | struct vmbus_device * | vmdev, |
uint64_t | xid, | ||
const void * | data, | ||
size_t | len | ||
) |
Send completion packet via ring buffer.
vmdev | VMBus device |
xid | Transaction ID |
data | Data |
len | Length of data |
rc | Return status code |
Send data using a VMBUS_COMPLETION packet.
Definition at line 834 of file vmbus.c.
References assert(), cpu_to_le16, data, ena_aq_header::flags, header, len, NULL, vmbus_device::packet, VMBUS_COMPLETION, vmbus_send(), and vmbus_packet_header::xid.
Referenced by netvsc_recv_data().
int vmbus_send_cancellation | ( | struct vmbus_device * | vmdev, |
uint64_t | xid | ||
) |
Send cancellation packet via ring buffer.
vmdev | VMBus device |
xid | Transaction ID |
rc | Return status code |
Send data using a VMBUS_CANCELLATION packet.
Definition at line 857 of file vmbus.c.
References assert(), cpu_to_le16, ena_aq_header::flags, header, NULL, vmbus_device::packet, VMBUS_CANCELLATION, vmbus_send(), and vmbus_packet_header::xid.
Referenced by netvsc_cancel_transmit().
|
static |
Get transfer page set from pageset ID.
vmdev | VMBus device |
pageset | Page set ID (in protocol byte order) |
pages | Page set, or NULL if not found |
Definition at line 877 of file vmbus.c.
References DBGC, vmbus_device::dev, le16_to_cpu, vmbus_xfer_pages::list, list_for_each_entry, device::name, NULL, vmbus_device::pages, pageset, and vmbus_xfer_pages::pageset.
Referenced by vmbus_xfer_page_iobufs().
|
static |
Construct I/O buffer list from transfer pages.
vmdev | VMBus device |
header | Transfer page header |
list | I/O buffer list to populate |
rc | Return status code |
Definition at line 900 of file vmbus.c.
References alloc_iob(), assert(), container_of, vmbus_xfer_pages_operations::copy, cpu_to_le16, DBGC, vmbus_device::dev, ENOENT, ENOMEM, free_iob(), header, iob_put, le32_to_cpu, len, vmbus_xfer_page_range::len, io_buffer::list, list_add, list_del, list_for_each_entry_safe, device::name, offset, vmbus_xfer_page_range::offset, vmbus_xfer_pages::op, vmbus_xfer_page_header::pageset, vmbus_xfer_page_header::range, vmbus_xfer_page_header::range_count, rc, strerror(), tmp, VMBUS_DATA_XFER_PAGES, and vmbus_xfer_pages().
Referenced by vmbus_poll().
int vmbus_poll | ( | struct vmbus_device * | vmdev | ) |
Poll ring buffer.
vmdev | VMBus device |
rc | Return status code |
Definition at line 972 of file vmbus.c.
References assert(), cons, vmbus_ring::cons, cpu_to_le16, cpu_to_le32, data, DBGC, DBGC2, DBGC2_HDA, vmbus_device::dev, EINVAL, ENOTSUP, ERANGE, header, vmbus_device::in, vmbus_device::in_len, INIT_LIST_HEAD, le16_to_cpu, le32_to_cpu, le64_to_cpu, len, vmbus_device::mtu, device::name, NULL, vmbus_device::op, vmbus_device::packet, rc, vmbus_channel_operations::recv_cancellation, vmbus_channel_operations::recv_completion, vmbus_channel_operations::recv_control, vmbus_channel_operations::recv_data, rmb, strerror(), VMBUS_CANCELLATION, VMBUS_COMPLETION, vmbus_consume(), VMBUS_DATA_INBAND, VMBUS_DATA_XFER_PAGES, vmbus_has_data(), and vmbus_xfer_page_iobufs().
Referenced by netvsc_control(), and netvsc_poll().
void vmbus_dump_channel | ( | struct vmbus_device * | vmdev | ) |
Dump channel status (for debugging)
vmdev | VMBus device |
Definition at line 1089 of file vmbus.c.
References vmbus_ring::cons, vmbus_ring::data, DBGC, DBGC_HDA, vmbus_device::dev, first, vmbus_device::in, vmbus_device::in_len, vmbus_ring::intr_mask, le32_to_cpu, device::name, vmbus_device::out, vmbus_ring::prod, and second.
Referenced by netvsc_control().
|
static |
Find driver for VMBus device.
vmdev | VMBus device |
driver | Driver, or NULL |
Definition at line 1123 of file vmbus.c.
References for_each_table_entry, memcmp(), NULL, type, vmbus_driver::type, and VMBUS_DRIVERS.
Referenced by vmbus_probe_channels().
|
static |
Probe channels.
hv | Hyper-V hypervisor |
parent | Parent device |
rc | Return status code |
Definition at line 1140 of file vmbus.c.
References device_description::bus_type, BUS_TYPE_HV, channel, vmbus_offer_channel::channel, vmbus_device::channel, device::children, cpu_to_le32, DBGC, DBGC2, device::desc, vmbus_device::dev, vmbus_device::driver, device::driver_name, ENOMEM, EPROTO, free, vmbus_message::header, header, vmbus_device::hv, INIT_LIST_HEAD, vmbus_offer_channel::instance, vmbus_device::instance, le32_to_cpu, list_add_tail, list_del, list_for_each_entry, list_for_each_entry_continue_reverse, list_for_each_entry_safe, memcpy(), vmbus::message, vmbus_offer_channel::monitor, vmbus_device::monitor, vmbus_offer_channel::monitored, device::name, vmbus_driver::name, vmbus_message::offer, vmbus_device::pages, device::parent, vmbus_driver::probe, rc, vmbus_driver::remove, device::siblings, vmbus_device::signal, snprintf(), strerror(), tmp, type, vmbus_offer_channel::type, uuid_mangle(), uuid_ntoa(), hv_hypervisor::vmbus, VMBUS_ALL_OFFERS_DELIVERED, vmbus_find_driver(), VMBUS_OFFER_CHANNEL, vmbus_post_empty_message(), VMBUS_REQUEST_OFFERS, vmbus_signal_event(), vmbus_signal_monitor(), vmbus_wait_for_any_message(), and zalloc().
Referenced by vmbus_probe().
|
static |
Reset channels.
hv | Hyper-V hypervisor |
parent | Parent device |
rc | Return status code |
Definition at line 1270 of file vmbus.c.
References channel, vmbus_offer_channel::channel, device::children, cpu_to_le32, DBGC, DBGC2, vmbus_device::dev, vmbus_device::driver, EPROTO, vmbus_message::header, header, vmbus_device::hv, le32_to_cpu, list_for_each_entry, vmbus::message, vmbus_offer_channel::monitor, vmbus_offer_channel::monitored, device::name, vmbus_message::offer, rc, vmbus_driver::reset, device::siblings, strerror(), type, vmbus_offer_channel::type, uuid_ntoa(), hv_hypervisor::vmbus, VMBUS_ALL_OFFERS_DELIVERED, VMBUS_OFFER_CHANNEL, vmbus_post_empty_message(), VMBUS_REQUEST_OFFERS, and vmbus_wait_for_any_message().
Referenced by vmbus_reset().
|
static |
Remove channels.
hv | Hyper-V hypervisor |
parent | Parent device |
Definition at line 1339 of file vmbus.c.
References assert(), device::children, vmbus_device::dev, vmbus_device::driver, free, vmbus_device::in, list_del, list_empty, list_for_each_entry_safe, NULL, vmbus_device::out, vmbus_device::packet, vmbus_device::pages, vmbus_driver::remove, device::siblings, and tmp.
Referenced by vmbus_probe(), and vmbus_remove().
int vmbus_probe | ( | struct hv_hypervisor * | hv, |
struct device * | parent | ||
) |
Probe Hyper-V virtual machine bus.
hv | Hyper-V hypervisor |
parent | Parent device |
rc | Return status code |
Definition at line 1365 of file vmbus.c.
References assert(), hv_message::data, ENOMEM, free, hv_alloc_pages(), hv_disable_sint(), hv_enable_sint(), hv_free_pages(), vmbus::intr, hv_hypervisor::message, vmbus::message, vmbus::monitor_in, vmbus::monitor_out, NULL, rc, hv_message_buffer::received, hv_hypervisor::vmbus, VMBUS_MESSAGE_SINT, vmbus_negotiate_version(), vmbus_probe_channels(), vmbus_remove_channels(), vmbus_unload(), and zalloc().
Referenced by hv_probe().
int vmbus_reset | ( | struct hv_hypervisor * | hv, |
struct device * | parent | ||
) |
Reset Hyper-V virtual machine bus.
hv | Hyper-V hypervisor |
parent | Parent device |
rc | Return status code |
Definition at line 1426 of file vmbus.c.
References hv_enable_sint(), vmbus::intr, memset(), vmbus::monitor_in, vmbus::monitor_out, PAGE_SIZE, rc, hv_hypervisor::vmbus, vmbus_gpadl, VMBUS_MESSAGE_SINT, vmbus_negotiate_version(), vmbus_obsolete_gpadl, and vmbus_reset_channels().
Referenced by hv_unquiesce().
void vmbus_remove | ( | struct hv_hypervisor * | hv, |
struct device * | parent | ||
) |
Remove Hyper-V virtual machine bus.
hv | Hyper-V hypervisor |
parent | Parent device |
Definition at line 1458 of file vmbus.c.
References free, hv_disable_sint(), hv_free_pages(), vmbus::intr, vmbus::monitor_in, vmbus::monitor_out, NULL, hv_hypervisor::vmbus, VMBUS_MESSAGE_SINT, vmbus_remove_channels(), and vmbus_unload().
Referenced by hv_probe(), and hv_remove().
|
static |
Current (i.e.
most recently issued) GPADL ID
Definition at line 54 of file vmbus.c.
Referenced by vmbus_establish_gpadl(), and vmbus_reset().
unsigned int vmbus_obsolete_gpadl |
Obsolete GPADL ID threshold.
When the Hyper-V connection is reset, any previous GPADLs are automatically rendered obsolete.
Definition at line 61 of file vmbus.c.
Referenced by vmbus_gpadl_is_obsolete(), and vmbus_reset().