Lines Matching full:pipe

51  * updates the pipe structure referenced in the preparation arguments.
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()
76 /* Allocate the transfer descriptors for the pipe. */ 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()
215 /* Sends data from UL list to CP for the provided pipe by updating the Head
216 * pointer of given pipe.
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()
249 "no free td elements for UL pipe %d", 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()
312 "pipe %d: invalid buf_addr or skb_data", in ipc_protocol_ul_td_process()
313 pipe->pipe_nr); in ipc_protocol_ul_td_process()
321 * of the given Pipe#.
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
378 if (!pipe->tdr_start) in ipc_protocol_dl_td_process()
382 p_td = &pipe->tdr_start[pipe->old_tail]; in ipc_protocol_dl_td_process()
383 skb = pipe->skbr_start[pipe->old_tail]; in ipc_protocol_dl_td_process()
386 pipe->skbr_start[pipe->old_tail] = NULL; in ipc_protocol_dl_td_process()
388 pipe->nr_of_queued_entries--; in ipc_protocol_dl_td_process()
390 pipe->old_tail++; in ipc_protocol_dl_td_process()
391 if (pipe->old_tail >= pipe->nr_of_entries) in ipc_protocol_dl_td_process()
392 pipe->old_tail = 0; in ipc_protocol_dl_td_process()
410 } else if ((le32_to_cpu(p_td->scs) & SIZE_MASK) > pipe->buf_size) { in ipc_protocol_dl_td_process()
413 pipe->buf_size); in ipc_protocol_dl_td_process()
434 struct ipc_pipe *pipe, u32 *head, in ipc_protocol_get_head_tail_index() argument
440 *head = le32_to_cpu(ipc_ap_shm->head_array[pipe->pipe_nr]); in ipc_protocol_get_head_tail_index()
443 *tail = le32_to_cpu(ipc_ap_shm->tail_array[pipe->pipe_nr]); in ipc_protocol_get_head_tail_index()
448 struct ipc_pipe *pipe) in ipc_protocol_pipe_cleanup() argument
455 head = le32_to_cpu(ipc_protocol->p_ap_shm->head_array[pipe->pipe_nr]); in ipc_protocol_pipe_cleanup()
456 tail = pipe->old_tail; in ipc_protocol_pipe_cleanup()
459 ipc_protocol->p_ap_shm->tail_array[pipe->pipe_nr] = 0; in ipc_protocol_pipe_cleanup()
460 ipc_protocol->p_ap_shm->head_array[pipe->pipe_nr] = 0; in ipc_protocol_pipe_cleanup()
463 if (pipe->skbr_start) { in ipc_protocol_pipe_cleanup()
468 skb = pipe->skbr_start[tail]; in ipc_protocol_pipe_cleanup()
473 if (tail >= pipe->nr_of_entries) in ipc_protocol_pipe_cleanup()
477 kfree(pipe->skbr_start); in ipc_protocol_pipe_cleanup()
478 pipe->skbr_start = NULL; in ipc_protocol_pipe_cleanup()
481 pipe->old_tail = 0; in ipc_protocol_pipe_cleanup()
484 if (pipe->tdr_start) { in ipc_protocol_pipe_cleanup()
486 sizeof(*pipe->tdr_start) * pipe->nr_of_entries, in ipc_protocol_pipe_cleanup()
487 pipe->tdr_start, pipe->phy_tdr_start); in ipc_protocol_pipe_cleanup()
489 pipe->tdr_start = NULL; in ipc_protocol_pipe_cleanup()