Lines Matching defs:pipe
65 struct glink_smem_pipe *pipe = to_smem_pipe(np);
66 struct qcom_glink_smem *smem = pipe->smem;
72 if (!pipe->fifo) {
81 pipe->fifo = fifo;
82 pipe->native.length = len;
85 head = le32_to_cpu(*pipe->head);
86 tail = le32_to_cpu(*pipe->tail);
89 return pipe->native.length - tail + head;
97 struct glink_smem_pipe *pipe = to_smem_pipe(np);
101 tail = le32_to_cpu(*pipe->tail);
103 if (tail >= pipe->native.length)
104 tail -= pipe->native.length;
106 len = min_t(size_t, count, pipe->native.length - tail);
108 memcpy_fromio(data, pipe->fifo + tail, len);
111 memcpy_fromio(data + len, pipe->fifo, (count - len));
117 struct glink_smem_pipe *pipe = to_smem_pipe(np);
120 tail = le32_to_cpu(*pipe->tail);
123 if (tail >= pipe->native.length)
124 tail -= pipe->native.length;
126 *pipe->tail = cpu_to_le32(tail);
131 struct glink_smem_pipe *pipe = to_smem_pipe(np);
136 head = le32_to_cpu(*pipe->head);
137 tail = le32_to_cpu(*pipe->tail);
140 avail = pipe->native.length - head + tail;
152 static unsigned int glink_smem_tx_write_one(struct glink_smem_pipe *pipe,
158 len = min_t(size_t, count, pipe->native.length - head);
160 memcpy(pipe->fifo + head, data, len);
163 memcpy(pipe->fifo, data + len, count - len);
166 if (head >= pipe->native.length)
167 head -= pipe->native.length;
176 struct glink_smem_pipe *pipe = to_smem_pipe(glink_pipe);
179 head = le32_to_cpu(*pipe->head);
181 head = glink_smem_tx_write_one(pipe, head, hdr, hlen);
182 head = glink_smem_tx_write_one(pipe, head, data, dlen);
186 if (head >= pipe->native.length)
187 head -= pipe->native.length;
192 *pipe->head = cpu_to_le32(head);
197 struct glink_smem_pipe *pipe = to_smem_pipe(glink_pipe);
198 struct qcom_glink_smem *smem = pipe->smem;