Lines Matching refs:newchannel
165 int vmbus_alloc_ring(struct vmbus_channel *newchannel, in vmbus_alloc_ring() argument
176 page = alloc_pages_node(cpu_to_node(newchannel->target_cpu), in vmbus_alloc_ring()
185 newchannel->ringbuffer_page = page; in vmbus_alloc_ring()
186 newchannel->ringbuffer_pagecount = (send_size + recv_size) >> PAGE_SHIFT; in vmbus_alloc_ring()
187 newchannel->ringbuffer_send_offset = send_size >> PAGE_SHIFT; in vmbus_alloc_ring()
653 static int __vmbus_open(struct vmbus_channel *newchannel, in __vmbus_open() argument
659 struct page *page = newchannel->ringbuffer_page; in __vmbus_open()
667 send_pages = newchannel->ringbuffer_send_offset; in __vmbus_open()
668 recv_pages = newchannel->ringbuffer_pagecount - send_pages; in __vmbus_open()
670 if (newchannel->state != CHANNEL_OPEN_STATE) in __vmbus_open()
674 if (newchannel->rqstor_size) { in __vmbus_open()
675 if (vmbus_alloc_requestor(&newchannel->requestor, newchannel->rqstor_size)) in __vmbus_open()
679 newchannel->state = CHANNEL_OPENING_STATE; in __vmbus_open()
680 newchannel->onchannel_callback = onchannelcallback; in __vmbus_open()
681 newchannel->channel_callback_context = context; in __vmbus_open()
683 if (!newchannel->max_pkt_size) in __vmbus_open()
684 newchannel->max_pkt_size = VMBUS_DEFAULT_MAX_PKT_SIZE; in __vmbus_open()
687 newchannel->ringbuffer_gpadlhandle.gpadl_handle = 0; in __vmbus_open()
689 err = __vmbus_establish_gpadl(newchannel, HV_GPADL_RING, in __vmbus_open()
690 page_address(newchannel->ringbuffer_page), in __vmbus_open()
692 newchannel->ringbuffer_send_offset << PAGE_SHIFT, in __vmbus_open()
693 &newchannel->ringbuffer_gpadlhandle); in __vmbus_open()
697 err = hv_ringbuffer_init(&newchannel->outbound, in __vmbus_open()
702 err = hv_ringbuffer_init(&newchannel->inbound, &page[send_pages], in __vmbus_open()
703 recv_pages, newchannel->max_pkt_size); in __vmbus_open()
717 open_info->waiting_channel = newchannel; in __vmbus_open()
721 open_msg->openid = newchannel->offermsg.child_relid; in __vmbus_open()
722 open_msg->child_relid = newchannel->offermsg.child_relid; in __vmbus_open()
724 = newchannel->ringbuffer_gpadlhandle.gpadl_handle; in __vmbus_open()
732 open_msg->target_vp = hv_cpu_number_to_vp_number(newchannel->target_cpu); in __vmbus_open()
742 if (newchannel->rescind) { in __vmbus_open()
761 if (newchannel->rescind) { in __vmbus_open()
771 newchannel->state = CHANNEL_OPENED_STATE; in __vmbus_open()
782 vmbus_teardown_gpadl(newchannel, &newchannel->ringbuffer_gpadlhandle); in __vmbus_open()
784 hv_ringbuffer_cleanup(&newchannel->outbound); in __vmbus_open()
785 hv_ringbuffer_cleanup(&newchannel->inbound); in __vmbus_open()
786 vmbus_free_requestor(&newchannel->requestor); in __vmbus_open()
787 newchannel->state = CHANNEL_OPEN_STATE; in __vmbus_open()
794 int vmbus_connect_ring(struct vmbus_channel *newchannel, in vmbus_connect_ring() argument
797 return __vmbus_open(newchannel, NULL, 0, onchannelcallback, context); in vmbus_connect_ring()
804 int vmbus_open(struct vmbus_channel *newchannel, in vmbus_open() argument
811 err = vmbus_alloc_ring(newchannel, send_ringbuffer_size, in vmbus_open()
816 err = __vmbus_open(newchannel, userdata, userdatalen, in vmbus_open()
819 vmbus_free_ring(newchannel); in vmbus_open()