Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/hyperv/vmbus/hv_channel.c
Show First 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | |||||
/** | /** | ||||
* @brief Trigger an event notification on the specified channel | * @brief Trigger an event notification on the specified channel | ||||
*/ | */ | ||||
static void | static void | ||||
vmbus_channel_set_event(hv_vmbus_channel *channel) | vmbus_channel_set_event(hv_vmbus_channel *channel) | ||||
{ | { | ||||
if (channel->offer_msg.monitor_allocated) { | if (channel->offer_msg.monitor_allocated) { | ||||
struct vmbus_softc *sc = vmbus_get_softc(); | struct vmbus_softc *sc = channel->vmbus_sc; | ||||
hv_vmbus_monitor_page *monitor_page; | hv_vmbus_monitor_page *monitor_page; | ||||
uint32_t chanid = channel->offer_msg.child_rel_id; | uint32_t chanid = channel->offer_msg.child_rel_id; | ||||
atomic_set_long( | atomic_set_long( | ||||
&sc->vmbus_tx_evtflags[chanid >> VMBUS_EVTFLAG_SHIFT], | &sc->vmbus_tx_evtflags[chanid >> VMBUS_EVTFLAG_SHIFT], | ||||
1UL << (chanid & VMBUS_EVTFLAG_MASK)); | 1UL << (chanid & VMBUS_EVTFLAG_MASK)); | ||||
monitor_page = sc->vmbus_mnf2; | monitor_page = sc->vmbus_mnf2; | ||||
▲ Show 20 Lines • Show All 121 Lines • ▼ Show 20 Lines | hv_vmbus_channel_open( | ||||
} | } | ||||
mtx_unlock(&new_channel->sc_lock); | mtx_unlock(&new_channel->sc_lock); | ||||
new_channel->on_channel_callback = pfn_on_channel_callback; | new_channel->on_channel_callback = pfn_on_channel_callback; | ||||
new_channel->channel_callback_context = context; | new_channel->channel_callback_context = context; | ||||
vmbus_on_channel_open(new_channel); | vmbus_on_channel_open(new_channel); | ||||
new_channel->rxq = VMBUS_PCPU_GET(vmbus_get_softc(), event_tq, | new_channel->rxq = VMBUS_PCPU_GET(new_channel->vmbus_sc, event_tq, | ||||
new_channel->target_cpu); | new_channel->target_cpu); | ||||
TASK_INIT(&new_channel->channel_task, 0, VmbusProcessChannelEvent, new_channel); | TASK_INIT(&new_channel->channel_task, 0, VmbusProcessChannelEvent, new_channel); | ||||
/* Allocate the ring buffer */ | /* Allocate the ring buffer */ | ||||
out = contigmalloc((send_ring_buffer_size + recv_ring_buffer_size), | out = contigmalloc((send_ring_buffer_size + recv_ring_buffer_size), | ||||
M_DEVBUF, M_ZERO, 0UL, BUS_SPACE_MAXADDR, PAGE_SIZE, 0); | M_DEVBUF, M_ZERO, 0UL, BUS_SPACE_MAXADDR, PAGE_SIZE, 0); | ||||
KASSERT(out != NULL, | KASSERT(out != NULL, | ||||
("Error VMBUS: contigmalloc failed to allocate Ring Buffer!")); | ("Error VMBUS: contigmalloc failed to allocate Ring Buffer!")); | ||||
▲ Show 20 Lines • Show All 818 Lines • Show Last 20 Lines |