Index: head/sys/dev/hyperv/include/hyperv.h =================================================================== --- head/sys/dev/hyperv/include/hyperv.h +++ head/sys/dev/hyperv/include/hyperv.h @@ -336,7 +336,7 @@ struct sysctl_ctx_list ch_sysctl_ctx; } hv_vmbus_channel; -#define HV_VMBUS_CHAN_ISPRIMARY(chan) ((chan)->primary_channel == NULL) +#define VMBUS_CHAN_ISPRIMARY(chan) ((chan)->ch_subidx == 0) #define VMBUS_CHAN_FLAG_HASMNF 0x0001 /* Index: head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c =================================================================== --- head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c +++ head/sys/dev/hyperv/netvsc/hv_netvsc_drv_freebsd.c @@ -2957,7 +2957,7 @@ hn_subchan_attach(struct hn_softc *sc, struct hv_vmbus_channel *chan) { - KASSERT(!HV_VMBUS_CHAN_ISPRIMARY(chan), + KASSERT(!VMBUS_CHAN_ISPRIMARY(chan), ("subchannel callback on primary channel")); KASSERT(chan->ch_subidx > 0, ("invalid channel subidx %u", Index: head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c =================================================================== --- head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c +++ head/sys/dev/hyperv/vmbus/hv_channel_mgmt.c @@ -285,7 +285,7 @@ return; } - if (HV_VMBUS_CHAN_ISPRIMARY(chan)) { + if (VMBUS_CHAN_ISPRIMARY(chan)) { /* * Add device for this primary channel. * @@ -332,7 +332,7 @@ { struct hv_vmbus_channel *chan = xchan; - if (HV_VMBUS_CHAN_ISPRIMARY(chan)) { + if (VMBUS_CHAN_ISPRIMARY(chan)) { /* Only primary channel owns the device */ hv_vmbus_child_device_unregister(chan); /* NOTE: DO NOT free primary channel for now */ @@ -413,7 +413,7 @@ channel = TAILQ_FIRST(&sc->vmbus_chlist); TAILQ_REMOVE(&sc->vmbus_chlist, channel, ch_link); - if (HV_VMBUS_CHAN_ISPRIMARY(channel)) { + if (VMBUS_CHAN_ISPRIMARY(channel)) { /* Only primary channel owns the device */ hv_vmbus_child_device_unregister(channel); }