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);
101 vmbus_connection.msg_conn_id = VMBUS_MESSAGE_CONNECTION_ID_4; in vmbus_negotiate_version()
103 msg->interrupt_page = virt_to_phys(vmbus_connection.int_page); in vmbus_negotiate_version()
104 vmbus_connection.msg_conn_id = VMBUS_MESSAGE_CONNECTION_ID; in vmbus_negotiate_version()
107 msg->monitor_page1 = vmbus_connection.monitor_pages_pa[0]; in vmbus_negotiate_version()
108 msg->monitor_page2 = vmbus_connection.monitor_pages_pa[1]; in vmbus_negotiate_version()
116 spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags); in vmbus_negotiate_version()
118 &vmbus_connection.chn_msg_list); in vmbus_negotiate_version()
120 spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags); in vmbus_negotiate_version()
129 spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags); in vmbus_negotiate_version()
131 spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, in vmbus_negotiate_version()
139 spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags); in vmbus_negotiate_version()
141 spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock, flags); in vmbus_negotiate_version()
145 vmbus_connection.conn_state = CONNECTED; in vmbus_negotiate_version()
148 vmbus_connection.msg_conn_id = in vmbus_negotiate_version()
167 vmbus_connection.conn_state = CONNECTING; in vmbus_connect()
168 vmbus_connection.work_queue = create_workqueue("hv_vmbus_con"); in vmbus_connect()
169 if (!vmbus_connection.work_queue) { in vmbus_connect()
174 vmbus_connection.handle_primary_chan_wq = in vmbus_connect()
176 if (!vmbus_connection.handle_primary_chan_wq) { in vmbus_connect()
181 vmbus_connection.handle_sub_chan_wq = in vmbus_connect()
183 if (!vmbus_connection.handle_sub_chan_wq) { in vmbus_connect()
188 INIT_LIST_HEAD(&vmbus_connection.chn_msg_list); in vmbus_connect()
189 spin_lock_init(&vmbus_connection.channelmsg_lock); in vmbus_connect()
191 INIT_LIST_HEAD(&vmbus_connection.chn_list); in vmbus_connect()
192 mutex_init(&vmbus_connection.channel_mutex); in vmbus_connect()
198 vmbus_connection.int_page = in vmbus_connect()
200 if (vmbus_connection.int_page == NULL) { in vmbus_connect()
205 vmbus_connection.recv_int_page = vmbus_connection.int_page; in vmbus_connect()
206 vmbus_connection.send_int_page = in vmbus_connect()
207 (void *)((unsigned long)vmbus_connection.int_page + in vmbus_connect()
214 vmbus_connection.monitor_pages[0] = (void *)hv_alloc_hyperv_zeroed_page(); in vmbus_connect()
215 vmbus_connection.monitor_pages[1] = (void *)hv_alloc_hyperv_zeroed_page(); in vmbus_connect()
216 if ((vmbus_connection.monitor_pages[0] == NULL) || in vmbus_connect()
217 (vmbus_connection.monitor_pages[1] == NULL)) { in vmbus_connect()
222 vmbus_connection.monitor_pages_original[0] in vmbus_connect()
223 = vmbus_connection.monitor_pages[0]; in vmbus_connect()
224 vmbus_connection.monitor_pages_original[1] in vmbus_connect()
225 = vmbus_connection.monitor_pages[1]; in vmbus_connect()
226 vmbus_connection.monitor_pages_pa[0] in vmbus_connect()
227 = virt_to_phys(vmbus_connection.monitor_pages[0]); in vmbus_connect()
228 vmbus_connection.monitor_pages_pa[1] in vmbus_connect()
229 = virt_to_phys(vmbus_connection.monitor_pages[1]); in vmbus_connect()
233 vmbus_connection.monitor_pages[0], in vmbus_connect()
236 vmbus_connection.monitor_pages[1], in vmbus_connect()
246 vmbus_connection.monitor_pages_pa[0] += in vmbus_connect()
248 vmbus_connection.monitor_pages_pa[1] += in vmbus_connect()
251 vmbus_connection.monitor_pages[0] in vmbus_connect()
252 = memremap(vmbus_connection.monitor_pages_pa[0], in vmbus_connect()
255 if (!vmbus_connection.monitor_pages[0]) { in vmbus_connect()
260 vmbus_connection.monitor_pages[1] in vmbus_connect()
261 = memremap(vmbus_connection.monitor_pages_pa[1], in vmbus_connect()
264 if (!vmbus_connection.monitor_pages[1]) { in vmbus_connect()
274 memset(vmbus_connection.monitor_pages[0], 0x00, in vmbus_connect()
276 memset(vmbus_connection.monitor_pages[1], 0x00, in vmbus_connect()
310 if (vmbus_connection.conn_state == CONNECTED) in vmbus_connect()
325 vmbus_connection.channels = kcalloc(MAX_CHANNEL_RELIDS, in vmbus_connect()
328 if (vmbus_connection.channels == NULL) { in vmbus_connect()
339 vmbus_connection.conn_state = DISCONNECTED; in vmbus_connect()
354 if (vmbus_connection.handle_sub_chan_wq) in vmbus_disconnect()
355 destroy_workqueue(vmbus_connection.handle_sub_chan_wq); in vmbus_disconnect()
357 if (vmbus_connection.handle_primary_chan_wq) in vmbus_disconnect()
358 destroy_workqueue(vmbus_connection.handle_primary_chan_wq); in vmbus_disconnect()
360 if (vmbus_connection.work_queue) in vmbus_disconnect()
361 destroy_workqueue(vmbus_connection.work_queue); in vmbus_disconnect()
363 if (vmbus_connection.int_page) { in vmbus_disconnect()
364 hv_free_hyperv_page((unsigned long)vmbus_connection.int_page); in vmbus_disconnect()
365 vmbus_connection.int_page = NULL; in vmbus_disconnect()
374 memunmap(vmbus_connection.monitor_pages[0]); in vmbus_disconnect()
375 memunmap(vmbus_connection.monitor_pages[1]); in vmbus_disconnect()
378 vmbus_connection.monitor_pages_original[0], in vmbus_disconnect()
381 vmbus_connection.monitor_pages_original[1], in vmbus_disconnect()
386 vmbus_connection.monitor_pages_original[0]); in vmbus_disconnect()
388 vmbus_connection.monitor_pages_original[1]); in vmbus_disconnect()
389 vmbus_connection.monitor_pages_original[0] = in vmbus_disconnect()
390 vmbus_connection.monitor_pages[0] = NULL; in vmbus_disconnect()
391 vmbus_connection.monitor_pages_original[1] = in vmbus_disconnect()
392 vmbus_connection.monitor_pages[1] = NULL; in vmbus_disconnect()
403 return READ_ONCE(vmbus_connection.channels[relid]); in relid2channel()
466 conn_id.u.id = vmbus_connection.msg_conn_id; in vmbus_post_msg()