Lines Matching refs:channel

137 	struct vmbus_channel *channel;  in alloc_channel()  local
139 channel = kzalloc(sizeof(*channel), GFP_ATOMIC); in alloc_channel()
140 if (!channel) in alloc_channel()
143 channel->id = atomic_inc_return(&chan_num); in alloc_channel()
144 spin_lock_init(&channel->inbound_lock); in alloc_channel()
145 spin_lock_init(&channel->lock); in alloc_channel()
147 INIT_LIST_HEAD(&channel->sc_list); in alloc_channel()
148 INIT_LIST_HEAD(&channel->percpu_list); in alloc_channel()
150 return channel; in alloc_channel()
156 static void free_channel(struct vmbus_channel *channel) in free_channel() argument
158 kfree(channel); in free_channel()
163 struct vmbus_channel *channel = arg; in percpu_channel_enq() local
166 list_add_tail(&channel->percpu_list, &hv_context.percpu_list[cpu]); in percpu_channel_enq()
171 struct vmbus_channel *channel = arg; in percpu_channel_deq() local
173 list_del(&channel->percpu_list); in percpu_channel_deq()
177 void hv_process_channel_removal(struct vmbus_channel *channel, u32 relid) in hv_process_channel_removal() argument
188 if (channel == NULL) in hv_process_channel_removal()
191 if (channel->target_cpu != get_cpu()) { in hv_process_channel_removal()
193 smp_call_function_single(channel->target_cpu, in hv_process_channel_removal()
194 percpu_channel_deq, channel, true); in hv_process_channel_removal()
196 percpu_channel_deq(channel); in hv_process_channel_removal()
200 if (channel->primary_channel == NULL) { in hv_process_channel_removal()
202 list_del(&channel->listentry); in hv_process_channel_removal()
205 primary_channel = channel->primary_channel; in hv_process_channel_removal()
207 list_del(&channel->sc_list); in hv_process_channel_removal()
210 free_channel(channel); in hv_process_channel_removal()
215 struct vmbus_channel *channel; in vmbus_free_channels() local
217 list_for_each_entry(channel, &vmbus_connection.chn_list, listentry) { in vmbus_free_channels()
218 vmbus_device_unregister(channel->device_obj); in vmbus_free_channels()
219 free_channel(channel); in vmbus_free_channels()
229 struct vmbus_channel *channel; in vmbus_process_offer() local
237 list_for_each_entry(channel, &vmbus_connection.chn_list, listentry) { in vmbus_process_offer()
238 if (!uuid_le_cmp(channel->offermsg.offer.if_type, in vmbus_process_offer()
240 !uuid_le_cmp(channel->offermsg.offer.if_instance, in vmbus_process_offer()
274 newchannel->primary_channel = channel; in vmbus_process_offer()
275 spin_lock_irqsave(&channel->lock, flags); in vmbus_process_offer()
276 list_add_tail(&newchannel->sc_list, &channel->sc_list); in vmbus_process_offer()
277 spin_unlock_irqrestore(&channel->lock, flags); in vmbus_process_offer()
290 channel->num_sc++; in vmbus_process_offer()
291 if (channel->sc_creation_callback != NULL) in vmbus_process_offer()
292 channel->sc_creation_callback(newchannel); in vmbus_process_offer()
388 static void init_vp_index(struct vmbus_channel *channel, const uuid_le *type_guid) in init_vp_index() argument
410 channel->target_cpu = 0; in init_vp_index()
411 channel->target_vp = 0; in init_vp_index()
415 channel->target_cpu = cur_cpu; in init_vp_index()
416 channel->target_vp = hv_context.vp_index[cur_cpu]; in init_vp_index()
482 struct vmbus_channel *channel; in vmbus_onoffer_rescind() local
487 channel = relid2channel(rescind->child_relid); in vmbus_onoffer_rescind()
489 if (channel == NULL) { in vmbus_onoffer_rescind()
494 spin_lock_irqsave(&channel->lock, flags); in vmbus_onoffer_rescind()
495 channel->rescind = true; in vmbus_onoffer_rescind()
496 spin_unlock_irqrestore(&channel->lock, flags); in vmbus_onoffer_rescind()
498 if (channel->device_obj) { in vmbus_onoffer_rescind()
503 dev = get_device(&channel->device_obj->device); in vmbus_onoffer_rescind()
505 vmbus_device_unregister(channel->device_obj); in vmbus_onoffer_rescind()
509 hv_process_channel_removal(channel, in vmbus_onoffer_rescind()
510 channel->offermsg.child_relid); in vmbus_onoffer_rescind()