Lines Matching refs:vmbus_connection
29 struct vmbus_connection vmbus_connection = { variable
32 vmbus_connection.unload_event),
36 vmbus_connection.ready_for_suspend_event),
38 vmbus_connection.ready_for_resume_event),
40 EXPORT_SYMBOL_GPL(vmbus_connection);
102 vmbus_connection.msg_conn_id = VMBUS_MESSAGE_CONNECTION_ID_4; in vmbus_negotiate_version()
104 msg->interrupt_page = virt_to_phys(vmbus_connection.int_page); in vmbus_negotiate_version()
105 vmbus_connection.msg_conn_id = VMBUS_MESSAGE_CONNECTION_ID; in vmbus_negotiate_version()
112 msg->monitor_page1 = virt_to_phys(vmbus_connection.monitor_pages[0]) | in vmbus_negotiate_version()
114 msg->monitor_page2 = virt_to_phys(vmbus_connection.monitor_pages[1]) | in vmbus_negotiate_version()
123 spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags); in vmbus_negotiate_version()
125 &vmbus_connection.chn_msg_list); in vmbus_negotiate_version()
127 spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags); in vmbus_negotiate_version()
136 spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags); in vmbus_negotiate_version()
138 spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, in vmbus_negotiate_version()
146 spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags); in vmbus_negotiate_version()
148 spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags); in vmbus_negotiate_version()
152 vmbus_connection.conn_state = CONNECTED; in vmbus_negotiate_version()
155 vmbus_connection.msg_conn_id = in vmbus_negotiate_version()
174 vmbus_connection.conn_state = CONNECTING; in vmbus_connect()
175 vmbus_connection.work_queue = create_workqueue("hv_vmbus_con"); in vmbus_connect()
176 if (!vmbus_connection.work_queue) { in vmbus_connect()
181 vmbus_connection.rescind_work_queue = in vmbus_connect()
183 if (!vmbus_connection.rescind_work_queue) { in vmbus_connect()
187 vmbus_connection.ignore_any_offer_msg = false; in vmbus_connect()
189 vmbus_connection.handle_primary_chan_wq = in vmbus_connect()
191 if (!vmbus_connection.handle_primary_chan_wq) { in vmbus_connect()
196 vmbus_connection.handle_sub_chan_wq = in vmbus_connect()
198 if (!vmbus_connection.handle_sub_chan_wq) { in vmbus_connect()
203 INIT_LIST_HEAD(&vmbus_connection.chn_msg_list); in vmbus_connect()
204 spin_lock_init(&vmbus_connection.channelmsg_lock); in vmbus_connect()
206 INIT_LIST_HEAD(&vmbus_connection.chn_list); in vmbus_connect()
207 mutex_init(&vmbus_connection.channel_mutex); in vmbus_connect()
213 vmbus_connection.int_page = hv_alloc_hyperv_zeroed_page(); in vmbus_connect()
214 if (vmbus_connection.int_page == NULL) { in vmbus_connect()
219 vmbus_connection.recv_int_page = vmbus_connection.int_page; in vmbus_connect()
220 vmbus_connection.send_int_page = in vmbus_connect()
221 (void *)((unsigned long)vmbus_connection.int_page + in vmbus_connect()
228 vmbus_connection.monitor_pages[0] = hv_alloc_hyperv_page(); in vmbus_connect()
229 vmbus_connection.monitor_pages[1] = hv_alloc_hyperv_page(); in vmbus_connect()
230 if ((vmbus_connection.monitor_pages[0] == NULL) || in vmbus_connect()
231 (vmbus_connection.monitor_pages[1] == NULL)) { in vmbus_connect()
237 vmbus_connection.monitor_pages[0], 1); in vmbus_connect()
239 vmbus_connection.monitor_pages[1], 1); in vmbus_connect()
247 memset(vmbus_connection.monitor_pages[0], 0x00, HV_HYP_PAGE_SIZE); in vmbus_connect()
248 memset(vmbus_connection.monitor_pages[1], 0x00, HV_HYP_PAGE_SIZE); in vmbus_connect()
279 if (vmbus_connection.conn_state == CONNECTED) in vmbus_connect()
294 vmbus_connection.channels = kcalloc(MAX_CHANNEL_RELIDS, in vmbus_connect()
297 if (vmbus_connection.channels == NULL) { in vmbus_connect()
308 vmbus_connection.conn_state = DISCONNECTED; in vmbus_connect()
323 if (vmbus_connection.handle_sub_chan_wq) in vmbus_disconnect()
324 destroy_workqueue(vmbus_connection.handle_sub_chan_wq); in vmbus_disconnect()
326 if (vmbus_connection.handle_primary_chan_wq) in vmbus_disconnect()
327 destroy_workqueue(vmbus_connection.handle_primary_chan_wq); in vmbus_disconnect()
329 if (vmbus_connection.rescind_work_queue) in vmbus_disconnect()
330 destroy_workqueue(vmbus_connection.rescind_work_queue); in vmbus_disconnect()
332 if (vmbus_connection.work_queue) in vmbus_disconnect()
333 destroy_workqueue(vmbus_connection.work_queue); in vmbus_disconnect()
335 if (vmbus_connection.int_page) { in vmbus_disconnect()
336 hv_free_hyperv_page(vmbus_connection.int_page); in vmbus_disconnect()
337 vmbus_connection.int_page = NULL; in vmbus_disconnect()
340 set_memory_encrypted((unsigned long)vmbus_connection.monitor_pages[0], 1); in vmbus_disconnect()
341 set_memory_encrypted((unsigned long)vmbus_connection.monitor_pages[1], 1); in vmbus_disconnect()
343 hv_free_hyperv_page(vmbus_connection.monitor_pages[0]); in vmbus_disconnect()
344 hv_free_hyperv_page(vmbus_connection.monitor_pages[1]); in vmbus_disconnect()
345 vmbus_connection.monitor_pages[0] = NULL; in vmbus_disconnect()
346 vmbus_connection.monitor_pages[1] = NULL; in vmbus_disconnect()
355 if (vmbus_connection.channels == NULL) { in relid2channel()
361 return READ_ONCE(vmbus_connection.channels[relid]); in relid2channel()
419 conn_id.u.id = vmbus_connection.msg_conn_id; in vmbus_post_msg()