Lines Matching refs:pipe

59 	struct ipc_pipe *pipe = args->pipe_open.pipe;  in ipc_protocol_msg_prepipe_open()  local
72 skbr = kcalloc(pipe->nr_of_entries, sizeof(*skbr), GFP_ATOMIC); in ipc_protocol_msg_prepipe_open()
78 pipe->nr_of_entries * sizeof(*tdr), in ipc_protocol_msg_prepipe_open()
79 &pipe->phy_tdr_start, GFP_ATOMIC); in ipc_protocol_msg_prepipe_open()
86 pipe->max_nr_of_queued_entries = pipe->nr_of_entries - 1; in ipc_protocol_msg_prepipe_open()
87 pipe->nr_of_queued_entries = 0; in ipc_protocol_msg_prepipe_open()
88 pipe->tdr_start = tdr; in ipc_protocol_msg_prepipe_open()
89 pipe->skbr_start = skbr; in ipc_protocol_msg_prepipe_open()
90 pipe->old_tail = 0; in ipc_protocol_msg_prepipe_open()
92 ipc_protocol->p_ap_shm->head_array[pipe->pipe_nr] = 0; in ipc_protocol_msg_prepipe_open()
95 msg->open_pipe.pipe_nr = pipe->pipe_nr; in ipc_protocol_msg_prepipe_open()
96 msg->open_pipe.tdr_addr = cpu_to_le64(pipe->phy_tdr_start); in ipc_protocol_msg_prepipe_open()
97 msg->open_pipe.tdr_entries = cpu_to_le16(pipe->nr_of_entries); in ipc_protocol_msg_prepipe_open()
99 cpu_to_le32(pipe->accumulation_backoff); in ipc_protocol_msg_prepipe_open()
100 msg->open_pipe.irq_vector = cpu_to_le32(pipe->irq); in ipc_protocol_msg_prepipe_open()
111 struct ipc_pipe *pipe = args->pipe_close.pipe; in ipc_protocol_msg_prepipe_close() local
117 msg->close_pipe.pipe_nr = pipe->pipe_nr; in ipc_protocol_msg_prepipe_close()
219 struct ipc_pipe *pipe, in ipc_protocol_ul_td_send() argument
237 head = le32_to_cpu(ipc_protocol->p_ap_shm->head_array[pipe->pipe_nr]); in ipc_protocol_ul_td_send()
238 tail = pipe->old_tail; in ipc_protocol_ul_td_send()
245 pipe->nr_of_entries - head + ((s32)tail - 1); in ipc_protocol_ul_td_send()
250 pipe->pipe_nr); in ipc_protocol_ul_td_send()
255 td = &pipe->tdr_start[head]; in ipc_protocol_ul_td_send()
265 pipe->skbr_start[head] = skb; in ipc_protocol_ul_td_send()
271 pipe->nr_of_queued_entries++; in ipc_protocol_ul_td_send()
275 if (head >= pipe->nr_of_entries) in ipc_protocol_ul_td_send()
278 ipc_protocol->p_ap_shm->head_array[pipe->pipe_nr] = in ipc_protocol_ul_td_send()
282 if (pipe->old_head != head) { in ipc_protocol_ul_td_send()
283 dev_dbg(ipc_protocol->dev, "New UL TDs Pipe:%d", pipe->pipe_nr); in ipc_protocol_ul_td_send()
285 pipe->old_head = head; in ipc_protocol_ul_td_send()
295 struct ipc_pipe *pipe) in ipc_protocol_ul_td_process() argument
297 struct ipc_protocol_td *p_td = &pipe->tdr_start[pipe->old_tail]; in ipc_protocol_ul_td_process()
298 struct sk_buff *skb = pipe->skbr_start[pipe->old_tail]; in ipc_protocol_ul_td_process()
300 pipe->nr_of_queued_entries--; in ipc_protocol_ul_td_process()
301 pipe->old_tail++; in ipc_protocol_ul_td_process()
302 if (pipe->old_tail >= pipe->nr_of_entries) in ipc_protocol_ul_td_process()
303 pipe->old_tail = 0; in ipc_protocol_ul_td_process()
313 pipe->pipe_nr); in ipc_protocol_ul_td_process()
324 struct ipc_pipe *pipe) in ipc_protocol_dl_td_prepare() argument
335 head = le32_to_cpu(ipc_protocol->p_ap_shm->head_array[pipe->pipe_nr]); in ipc_protocol_dl_td_prepare()
336 tail = le32_to_cpu(ipc_protocol->p_ap_shm->tail_array[pipe->pipe_nr]); in ipc_protocol_dl_td_prepare()
339 if (new_head >= pipe->nr_of_entries) in ipc_protocol_dl_td_prepare()
346 td = &pipe->tdr_start[head]; in ipc_protocol_dl_td_prepare()
349 skb = ipc_pcie_alloc_skb(ipc_protocol->pcie, pipe->buf_size, GFP_ATOMIC, in ipc_protocol_dl_td_prepare()
356 td->scs = cpu_to_le32(pipe->buf_size) & cpu_to_le32(SIZE_MASK); in ipc_protocol_dl_td_prepare()
360 ipc_protocol->p_ap_shm->head_array[pipe->pipe_nr] = in ipc_protocol_dl_td_prepare()
364 pipe->skbr_start[head] = skb; in ipc_protocol_dl_td_prepare()
366 pipe->nr_of_queued_entries++; in ipc_protocol_dl_td_prepare()
373 struct ipc_pipe *pipe) in ipc_protocol_dl_td_process() argument
376 le32_to_cpu(ipc_protocol->p_ap_shm->tail_array[pipe->pipe_nr]); in ipc_protocol_dl_td_process()
380 if (!pipe->tdr_start) in ipc_protocol_dl_td_process()
384 p_td = &pipe->tdr_start[pipe->old_tail]; in ipc_protocol_dl_td_process()
385 skb = pipe->skbr_start[pipe->old_tail]; in ipc_protocol_dl_td_process()
388 pipe->skbr_start[pipe->old_tail] = NULL; in ipc_protocol_dl_td_process()
390 pipe->nr_of_queued_entries--; in ipc_protocol_dl_td_process()
392 pipe->old_tail++; in ipc_protocol_dl_td_process()
393 if (pipe->old_tail >= pipe->nr_of_entries) in ipc_protocol_dl_td_process()
394 pipe->old_tail = 0; in ipc_protocol_dl_td_process()
408 pipe->pipe_nr, tail); in ipc_protocol_dl_td_process()
420 } else if ((le32_to_cpu(p_td->scs) & SIZE_MASK) > pipe->buf_size) { in ipc_protocol_dl_td_process()
423 pipe->buf_size); in ipc_protocol_dl_td_process()
444 struct ipc_pipe *pipe, u32 *head, in ipc_protocol_get_head_tail_index() argument
450 *head = le32_to_cpu(ipc_ap_shm->head_array[pipe->pipe_nr]); in ipc_protocol_get_head_tail_index()
453 *tail = le32_to_cpu(ipc_ap_shm->tail_array[pipe->pipe_nr]); in ipc_protocol_get_head_tail_index()
458 struct ipc_pipe *pipe) in ipc_protocol_pipe_cleanup() argument
465 head = le32_to_cpu(ipc_protocol->p_ap_shm->head_array[pipe->pipe_nr]); in ipc_protocol_pipe_cleanup()
466 tail = pipe->old_tail; in ipc_protocol_pipe_cleanup()
469 ipc_protocol->p_ap_shm->tail_array[pipe->pipe_nr] = 0; in ipc_protocol_pipe_cleanup()
470 ipc_protocol->p_ap_shm->head_array[pipe->pipe_nr] = 0; in ipc_protocol_pipe_cleanup()
473 if (pipe->skbr_start) { in ipc_protocol_pipe_cleanup()
478 skb = pipe->skbr_start[tail]; in ipc_protocol_pipe_cleanup()
483 if (tail >= pipe->nr_of_entries) in ipc_protocol_pipe_cleanup()
487 kfree(pipe->skbr_start); in ipc_protocol_pipe_cleanup()
488 pipe->skbr_start = NULL; in ipc_protocol_pipe_cleanup()
491 pipe->old_tail = 0; in ipc_protocol_pipe_cleanup()
494 if (pipe->tdr_start) { in ipc_protocol_pipe_cleanup()
496 sizeof(*pipe->tdr_start) * pipe->nr_of_entries, in ipc_protocol_pipe_cleanup()
497 pipe->tdr_start, pipe->phy_tdr_start); in ipc_protocol_pipe_cleanup()
499 pipe->tdr_start = NULL; in ipc_protocol_pipe_cleanup()