17 #include <linux/device.h>
27 xpc_process_connect(
struct xpc_channel *ch,
unsigned long *irq_flags)
41 spin_unlock_irqrestore(&ch->
lock, *irq_flags);
80 xpc_process_disconnect(
struct xpc_channel *ch,
unsigned long *irq_flags)
131 spin_unlock_irqrestore(&ch->
lock, *irq_flags);
159 if (channel_was_connected) {
183 xpc_process_openclose_chctl_flags(
struct xpc_partition *part,
int ch_number,
186 unsigned long irq_flags;
192 int create_kthread = 0;
211 "from partid=%d, channel=%d\n", args->
reason,
231 xpc_process_disconnect(ch, &irq_flags);
239 XPC_CHCTL_OPENREQUEST) {
280 xpc_process_disconnect(ch, &irq_flags);
297 XPC_CHCTL_CLOSEREQUEST) {
312 xpc_process_disconnect(ch, &irq_flags);
316 if (chctl_flags & XPC_CHCTL_OPENREQUEST) {
319 "local_nentries=%d) received from partid=%d, "
365 xpc_process_connect(ch, &irq_flags);
371 "0x%lx, local_nentries=%d, remote_nentries=%d) "
372 "received from partid=%d, channel=%d\n",
409 "remote_nentries=%d, old remote_nentries=%d, "
410 "partid=%d, channel=%d\n",
418 "local_nentries=%d, old local_nentries=%d, "
419 "partid=%d, channel=%d\n",
426 xpc_process_connect(ch, &irq_flags);
450 xpc_process_connect(ch, &irq_flags);
455 spin_unlock_irqrestore(&ch->
lock, irq_flags);
467 unsigned long irq_flags;
484 spin_unlock_irqrestore(&ch->
lock, irq_flags);
499 ch->
key = registration->
key;
519 spin_unlock_irqrestore(&ch->
lock, irq_flags);
538 xpc_process_connect(ch, &irq_flags);
540 spin_unlock_irqrestore(&ch->
lock, irq_flags);
548 unsigned long irq_flags;
563 for (ch_number = 0; ch_number < part->
nchannels; ch_number++) {
572 xpc_process_openclose_chctl_flags(part, ch_number,
573 chctl.
flags[ch_number]);
576 ch_flags = ch->
flags;
580 xpc_process_disconnect(ch, &irq_flags);
581 spin_unlock_irqrestore(&ch->
lock, irq_flags);
591 (
void)xpc_connect_channel(ch);
619 unsigned long irq_flags;
626 if (!xpc_part_ref(part)) {
633 for (ch_number = 0; ch_number < part->
nchannels; ch_number++) {
636 xpc_msgqueue_ref(ch);
641 spin_unlock_irqrestore(&ch->
lock, irq_flags);
642 xpc_msgqueue_deref(ch);
645 xpc_wakeup_channel_mgr(part);
647 xpc_part_deref(part);
666 if (xpc_part_ref(part)) {
673 xpc_wakeup_channel_mgr(part);
674 xpc_part_deref(part);
712 unsigned long irq_flags;
723 if (xpc_part_ref(part)) {
725 xpc_msgqueue_ref(ch);
736 spin_unlock_irqrestore(&ch->
lock, irq_flags);
738 xpc_msgqueue_deref(ch);
739 xpc_part_deref(part);
757 enum xp_retval reason,
unsigned long *irq_flags)
781 if (channel_was_connected)
784 spin_unlock_irqrestore(&ch->
lock, *irq_flags);
844 }
else if (ret == 0) {
885 if (xpc_part_ref(part)) {
887 flags, payload, payload_size, 0,
NULL,
NULL);
888 xpc_part_deref(part);
937 if (xpc_part_ref(part)) {
939 flags, payload, payload_size,
XPC_N_CALL, func, key);
940 xpc_part_deref(part);
954 if (payload !=
NULL) {
961 xpc_msgqueue_ref(ch);
967 "partid=%d channel=%d\n", payload, ch->
partid,
975 "partid=%d channel=%d\n", payload, ch->
partid,
1010 xpc_msgqueue_deref(ch);