Lines Matching refs:ch_sn2

1171 	struct xpc_channel_sn2 *ch_sn2;  in xpc_setup_ch_structures_sn2()  local
1240 ch_sn2 = &part->channels[ch_number].sn.sn2; in xpc_setup_ch_structures_sn2()
1242 ch_sn2->local_GP = &part_sn2->local_GPs[ch_number]; in xpc_setup_ch_structures_sn2()
1243 ch_sn2->local_openclose_args = in xpc_setup_ch_structures_sn2()
1246 mutex_init(&ch_sn2->msg_to_pull_mutex); in xpc_setup_ch_structures_sn2()
1560 struct xpc_channel_sn2 *ch_sn2 = &ch->sn.sn2; in xpc_allocate_local_msgqueue_sn2() local
1568 ch_sn2->local_msgqueue = in xpc_allocate_local_msgqueue_sn2()
1570 &ch_sn2->local_msgqueue_base); in xpc_allocate_local_msgqueue_sn2()
1571 if (ch_sn2->local_msgqueue == NULL) in xpc_allocate_local_msgqueue_sn2()
1575 ch_sn2->notify_queue = kzalloc(nbytes, GFP_KERNEL); in xpc_allocate_local_msgqueue_sn2()
1576 if (ch_sn2->notify_queue == NULL) { in xpc_allocate_local_msgqueue_sn2()
1577 kfree(ch_sn2->local_msgqueue_base); in xpc_allocate_local_msgqueue_sn2()
1578 ch_sn2->local_msgqueue = NULL; in xpc_allocate_local_msgqueue_sn2()
1605 struct xpc_channel_sn2 *ch_sn2 = &ch->sn.sn2; in xpc_allocate_remote_msgqueue_sn2() local
1615 ch_sn2->remote_msgqueue = in xpc_allocate_remote_msgqueue_sn2()
1616 xpc_kzalloc_cacheline_aligned(nbytes, GFP_KERNEL, &ch_sn2-> in xpc_allocate_remote_msgqueue_sn2()
1618 if (ch_sn2->remote_msgqueue == NULL) in xpc_allocate_remote_msgqueue_sn2()
1646 struct xpc_channel_sn2 *ch_sn2 = &ch->sn.sn2; in xpc_setup_msg_structures_sn2() local
1656 kfree(ch_sn2->local_msgqueue_base); in xpc_setup_msg_structures_sn2()
1657 ch_sn2->local_msgqueue = NULL; in xpc_setup_msg_structures_sn2()
1658 kfree(ch_sn2->notify_queue); in xpc_setup_msg_structures_sn2()
1659 ch_sn2->notify_queue = NULL; in xpc_setup_msg_structures_sn2()
1672 struct xpc_channel_sn2 *ch_sn2 = &ch->sn.sn2; in xpc_teardown_msg_structures_sn2() local
1676 ch_sn2->remote_msgqueue_pa = 0; in xpc_teardown_msg_structures_sn2()
1678 ch_sn2->local_GP->get = 0; in xpc_teardown_msg_structures_sn2()
1679 ch_sn2->local_GP->put = 0; in xpc_teardown_msg_structures_sn2()
1680 ch_sn2->remote_GP.get = 0; in xpc_teardown_msg_structures_sn2()
1681 ch_sn2->remote_GP.put = 0; in xpc_teardown_msg_structures_sn2()
1682 ch_sn2->w_local_GP.get = 0; in xpc_teardown_msg_structures_sn2()
1683 ch_sn2->w_local_GP.put = 0; in xpc_teardown_msg_structures_sn2()
1684 ch_sn2->w_remote_GP.get = 0; in xpc_teardown_msg_structures_sn2()
1685 ch_sn2->w_remote_GP.put = 0; in xpc_teardown_msg_structures_sn2()
1686 ch_sn2->next_msg_to_pull = 0; in xpc_teardown_msg_structures_sn2()
1692 kfree(ch_sn2->local_msgqueue_base); in xpc_teardown_msg_structures_sn2()
1693 ch_sn2->local_msgqueue = NULL; in xpc_teardown_msg_structures_sn2()
1694 kfree(ch_sn2->remote_msgqueue_base); in xpc_teardown_msg_structures_sn2()
1695 ch_sn2->remote_msgqueue = NULL; in xpc_teardown_msg_structures_sn2()
1696 kfree(ch_sn2->notify_queue); in xpc_teardown_msg_structures_sn2()
1697 ch_sn2->notify_queue = NULL; in xpc_teardown_msg_structures_sn2()
1758 struct xpc_channel_sn2 *ch_sn2 = &ch->sn.sn2; in xpc_clear_local_msgqueue_flags_sn2() local
1762 get = ch_sn2->w_remote_GP.get; in xpc_clear_local_msgqueue_flags_sn2()
1764 msg = (struct xpc_msg_sn2 *)((u64)ch_sn2->local_msgqueue + in xpc_clear_local_msgqueue_flags_sn2()
1769 } while (++get < ch_sn2->remote_GP.get); in xpc_clear_local_msgqueue_flags_sn2()
1778 struct xpc_channel_sn2 *ch_sn2 = &ch->sn.sn2; in xpc_clear_remote_msgqueue_flags_sn2() local
1783 if (ch_sn2->remote_GP.put < remote_nentries) in xpc_clear_remote_msgqueue_flags_sn2()
1786 put = max(ch_sn2->w_remote_GP.put, remote_nentries); in xpc_clear_remote_msgqueue_flags_sn2()
1788 msg = (struct xpc_msg_sn2 *)((u64)ch_sn2->remote_msgqueue + in xpc_clear_remote_msgqueue_flags_sn2()
1795 } while (++put < ch_sn2->remote_GP.put); in xpc_clear_remote_msgqueue_flags_sn2()
1808 struct xpc_channel_sn2 *ch_sn2 = &ch->sn.sn2; in xpc_process_msg_chctl_flags_sn2() local
1811 ch_sn2->remote_GP = part->sn.sn2.remote_GPs[ch_number]; in xpc_process_msg_chctl_flags_sn2()
1817 if (ch_sn2->w_remote_GP.get == ch_sn2->remote_GP.get && in xpc_process_msg_chctl_flags_sn2()
1818 ch_sn2->w_remote_GP.put == ch_sn2->remote_GP.put) { in xpc_process_msg_chctl_flags_sn2()
1835 if (ch_sn2->w_remote_GP.get != ch_sn2->remote_GP.get) { in xpc_process_msg_chctl_flags_sn2()
1850 ch_sn2->remote_GP.get); in xpc_process_msg_chctl_flags_sn2()
1859 ch_sn2->w_remote_GP.get = ch_sn2->remote_GP.get; in xpc_process_msg_chctl_flags_sn2()
1862 "channel=%d\n", ch_sn2->w_remote_GP.get, ch->partid, in xpc_process_msg_chctl_flags_sn2()
1878 if (ch_sn2->w_remote_GP.put != ch_sn2->remote_GP.put) { in xpc_process_msg_chctl_flags_sn2()
1886 ch_sn2->w_remote_GP.put = ch_sn2->remote_GP.put; in xpc_process_msg_chctl_flags_sn2()
1889 "channel=%d\n", ch_sn2->w_remote_GP.put, ch->partid, in xpc_process_msg_chctl_flags_sn2()
1910 struct xpc_channel_sn2 *ch_sn2 = &ch->sn.sn2; in xpc_pull_remote_msg_sn2() local
1918 if (mutex_lock_interruptible(&ch_sn2->msg_to_pull_mutex) != 0) { in xpc_pull_remote_msg_sn2()
1923 while (get >= ch_sn2->next_msg_to_pull) { in xpc_pull_remote_msg_sn2()
1927 msg_index = ch_sn2->next_msg_to_pull % ch->remote_nentries; in xpc_pull_remote_msg_sn2()
1929 DBUG_ON(ch_sn2->next_msg_to_pull >= ch_sn2->w_remote_GP.put); in xpc_pull_remote_msg_sn2()
1930 nmsgs = ch_sn2->w_remote_GP.put - ch_sn2->next_msg_to_pull; in xpc_pull_remote_msg_sn2()
1937 msg = (struct xpc_msg_sn2 *)((u64)ch_sn2->remote_msgqueue + in xpc_pull_remote_msg_sn2()
1939 remote_msg_pa = ch_sn2->remote_msgqueue_pa + msg_offset; in xpc_pull_remote_msg_sn2()
1947 "ret=%d\n", nmsgs, ch_sn2->next_msg_to_pull, in xpc_pull_remote_msg_sn2()
1952 mutex_unlock(&ch_sn2->msg_to_pull_mutex); in xpc_pull_remote_msg_sn2()
1956 ch_sn2->next_msg_to_pull += nmsgs; in xpc_pull_remote_msg_sn2()
1959 mutex_unlock(&ch_sn2->msg_to_pull_mutex); in xpc_pull_remote_msg_sn2()
1963 msg = (struct xpc_msg_sn2 *)((u64)ch_sn2->remote_msgqueue + msg_offset); in xpc_pull_remote_msg_sn2()
1974 struct xpc_channel_sn2 *ch_sn2 = &ch->sn.sn2; in xpc_get_deliverable_payload_sn2() local
1983 get = ch_sn2->w_local_GP.get; in xpc_get_deliverable_payload_sn2()
1985 if (get == ch_sn2->w_remote_GP.put) in xpc_get_deliverable_payload_sn2()
1995 if (cmpxchg(&ch_sn2->w_local_GP.get, get, get + 1) == get) { in xpc_get_deliverable_payload_sn2()
2029 struct xpc_channel_sn2 *ch_sn2 = &ch->sn.sn2; in xpc_send_msgs_sn2() local
2037 if (put == ch_sn2->w_local_GP.put) in xpc_send_msgs_sn2()
2040 msg = (struct xpc_msg_sn2 *)((u64)ch_sn2-> in xpc_send_msgs_sn2()
2056 if (cmpxchg_rel(&ch_sn2->local_GP->put, initial_put, put) != in xpc_send_msgs_sn2()
2059 DBUG_ON(ch_sn2->local_GP->put < initial_put); in xpc_send_msgs_sn2()
2090 struct xpc_channel_sn2 *ch_sn2 = &ch->sn.sn2; in xpc_allocate_msg_sn2() local
2104 put = ch_sn2->w_local_GP.put; in xpc_allocate_msg_sn2()
2106 if (put - ch_sn2->w_remote_GP.get < ch->local_nentries) { in xpc_allocate_msg_sn2()
2114 if (cmpxchg(&ch_sn2->w_local_GP.put, put, put + 1) == in xpc_allocate_msg_sn2()
2143 msg = (struct xpc_msg_sn2 *)((u64)ch_sn2->local_msgqueue + in xpc_allocate_msg_sn2()
2169 struct xpc_channel_sn2 *ch_sn2 = &ch->sn.sn2; in xpc_send_payload_sn2() local
2206 notify = &ch_sn2->notify_queue[msg_number % ch->local_nentries]; in xpc_send_payload_sn2()
2242 put = ch_sn2->local_GP->put; in xpc_send_payload_sn2()
2262 struct xpc_channel_sn2 *ch_sn2 = &ch->sn.sn2; in xpc_acknowledge_msgs_sn2() local
2270 if (get == ch_sn2->w_local_GP.get) in xpc_acknowledge_msgs_sn2()
2273 msg = (struct xpc_msg_sn2 *)((u64)ch_sn2-> in xpc_acknowledge_msgs_sn2()
2290 if (cmpxchg_rel(&ch_sn2->local_GP->get, initial_get, get) != in xpc_acknowledge_msgs_sn2()
2293 DBUG_ON(ch_sn2->local_GP->get <= initial_get); in xpc_acknowledge_msgs_sn2()