mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
hyperv/vmbus: Add type/instance guid fields into hv_vmbus_channel
This prepares to remove the unnecessary offer message embedding in hv_vmbus_channel. MFC after: 1 week Sponsored by: Microsoft OSTC Differential Revision: https://reviews.freebsd.org/D7020
This commit is contained in:
parent
d74e22ed4a
commit
5c604feb67
4 changed files with 12 additions and 14 deletions
|
|
@ -632,6 +632,9 @@ typedef struct hv_vmbus_channel {
|
|||
TAILQ_ENTRY(hv_vmbus_channel) ch_link;
|
||||
uint32_t ch_subidx; /* subchan index */
|
||||
|
||||
struct hv_guid ch_guid_type;
|
||||
struct hv_guid ch_guid_inst;
|
||||
|
||||
struct sysctl_ctx_list ch_sysctl_ctx;
|
||||
} hv_vmbus_channel;
|
||||
|
||||
|
|
|
|||
|
|
@ -127,11 +127,9 @@ vmbus_channel_process_offer(hv_vmbus_channel *new_channel)
|
|||
}
|
||||
|
||||
TAILQ_FOREACH(channel, &sc->vmbus_chlist, ch_link) {
|
||||
if (memcmp(&channel->offer_msg.offer.interface_type,
|
||||
&new_channel->offer_msg.offer.interface_type,
|
||||
if (memcmp(&channel->ch_guid_type, &new_channel->ch_guid_type,
|
||||
sizeof(hv_guid)) == 0 &&
|
||||
memcmp(&channel->offer_msg.offer.interface_instance,
|
||||
&new_channel->offer_msg.offer.interface_instance,
|
||||
memcmp(&channel->ch_guid_inst, &new_channel->ch_guid_inst,
|
||||
sizeof(hv_guid)) == 0)
|
||||
break;
|
||||
}
|
||||
|
|
@ -212,9 +210,7 @@ vmbus_channel_process_offer(hv_vmbus_channel *new_channel)
|
|||
* (We need to set the device field before calling
|
||||
* hv_vmbus_child_device_add())
|
||||
*/
|
||||
new_channel->device = hv_vmbus_child_device_create(
|
||||
new_channel->offer_msg.offer.interface_type,
|
||||
new_channel->offer_msg.offer.interface_instance, new_channel);
|
||||
new_channel->device = hv_vmbus_child_device_create(new_channel);
|
||||
|
||||
/*
|
||||
* Add the new device to the bus. This will kick off device-driver
|
||||
|
|
@ -296,6 +292,8 @@ vmbus_channel_on_offer_internal(struct vmbus_softc *sc,
|
|||
new_channel->ch_subidx = offer->offer.sub_channel_index;
|
||||
if (offer->monitor_allocated)
|
||||
new_channel->ch_flags |= VMBUS_CHAN_FLAG_HASMNF;
|
||||
new_channel->ch_guid_type = offer->offer.interface_type;
|
||||
new_channel->ch_guid_inst = offer->offer.interface_instance;
|
||||
|
||||
/*
|
||||
* By default we setup state to enable batched
|
||||
|
|
|
|||
|
|
@ -213,9 +213,7 @@ void hv_vmbus_release_unattached_channels(
|
|||
struct vmbus_softc *);
|
||||
|
||||
struct hv_device* hv_vmbus_child_device_create(
|
||||
hv_guid device_type,
|
||||
hv_guid device_instance,
|
||||
hv_vmbus_channel *channel);
|
||||
struct hv_vmbus_channel *channel);
|
||||
|
||||
void hv_vmbus_child_device_register(struct vmbus_softc *,
|
||||
struct hv_device *child_dev);
|
||||
|
|
|
|||
|
|
@ -1017,8 +1017,7 @@ vmbus_child_pnpinfo_str(device_t dev, device_t child, char *buf, size_t buflen)
|
|||
}
|
||||
|
||||
struct hv_device *
|
||||
hv_vmbus_child_device_create(hv_guid type, hv_guid instance,
|
||||
hv_vmbus_channel *channel)
|
||||
hv_vmbus_child_device_create(struct hv_vmbus_channel *channel)
|
||||
{
|
||||
hv_device *child_dev;
|
||||
|
||||
|
|
@ -1028,8 +1027,8 @@ hv_vmbus_child_device_create(hv_guid type, hv_guid instance,
|
|||
child_dev = malloc(sizeof(hv_device), M_DEVBUF, M_WAITOK | M_ZERO);
|
||||
|
||||
child_dev->channel = channel;
|
||||
memcpy(&child_dev->class_id, &type, sizeof(hv_guid));
|
||||
memcpy(&child_dev->device_id, &instance, sizeof(hv_guid));
|
||||
child_dev->class_id = channel->ch_guid_type;
|
||||
child_dev->device_id = channel->ch_guid_inst;
|
||||
|
||||
return (child_dev);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue