Lines Matching refs:pipe
51 struct glink_smem_pipe *pipe = to_smem_pipe(np);
57 if (!pipe->fifo) {
58 fifo = qcom_smem_get(pipe->remote_pid,
66 pipe->fifo = fifo;
67 pipe->native.length = len;
70 head = le32_to_cpu(*pipe->head);
71 tail = le32_to_cpu(*pipe->tail);
74 return pipe->native.length - tail + head;
82 struct glink_smem_pipe *pipe = to_smem_pipe(np);
86 tail = le32_to_cpu(*pipe->tail);
88 if (tail >= pipe->native.length)
89 tail -= pipe->native.length;
91 len = min_t(size_t, count, pipe->native.length - tail);
93 memcpy_fromio(data, pipe->fifo + tail, len);
96 memcpy_fromio(data + len, pipe->fifo, (count - len));
102 struct glink_smem_pipe *pipe = to_smem_pipe(np);
105 tail = le32_to_cpu(*pipe->tail);
108 if (tail >= pipe->native.length)
109 tail -= pipe->native.length;
111 *pipe->tail = cpu_to_le32(tail);
116 struct glink_smem_pipe *pipe = to_smem_pipe(np);
121 head = le32_to_cpu(*pipe->head);
122 tail = le32_to_cpu(*pipe->tail);
125 avail = pipe->native.length - head + tail;
137 static unsigned int glink_smem_tx_write_one(struct glink_smem_pipe *pipe,
143 len = min_t(size_t, count, pipe->native.length - head);
145 memcpy(pipe->fifo + head, data, len);
148 memcpy(pipe->fifo, data + len, count - len);
151 if (head >= pipe->native.length)
152 head -= pipe->native.length;
161 struct glink_smem_pipe *pipe = to_smem_pipe(glink_pipe);
164 head = le32_to_cpu(*pipe->head);
166 head = glink_smem_tx_write_one(pipe, head, hdr, hlen);
167 head = glink_smem_tx_write_one(pipe, head, data, dlen);
171 if (head >= pipe->native.length)
172 head -= pipe->native.length;
177 *pipe->head = cpu_to_le32(head);