19 #include <linux/errno.h>
21 #include <linux/module.h>
30 #define link link_shadow
39 snprintf(file,
sizeof(file),
"mpipe/%d/iorpc", mpipe_index);
64 for (i = 0; i < 8; i++)
87 static int16_t gxio_mpipe_buffer_sizes[8] =
88 { 128, 256, 512, 1024, 1664, 4096, 10368, 16384 };
94 for (i = 0; i < 7; i++)
95 if (size <= gxio_mpipe_buffer_sizes[i])
105 if (buffer_size_enum > 7)
106 buffer_size_enum = 7;
108 return gxio_mpipe_buffer_sizes[buffer_size_enum];
115 const int BUFFERS_PER_LINE = 12;
118 unsigned long lines =
119 (buffers + BUFFERS_PER_LINE - 1) / BUFFERS_PER_LINE;
131 unsigned int mem_flags)
154 unsigned int mem_flags)
165 unsigned int num_rings,
167 unsigned int num_buckets,
181 for (i = 0; i < num_rings; i++)
182 gxio_mpipe_notif_group_add_ring(&bits, ring + i);
188 for (i = 0; i < num_buckets; i++) {
189 bucket_info.
notifring = ring + (i % num_rings);
205 unsigned int mem_flags)
225 unsigned int bucket,
unsigned int num_buckets,
243 unsigned int pad = 0;
251 if (head + pad +
sizeof(*rule) >=
sizeof(list->
rules))
255 if (__builtin_popcount(num_buckets) != 1)
275 for (i = 8 - 1; i >= 0; i--) {
288 for (i = 8 - 1; i > 0; i--) {
297 rule->
size =
sizeof(*rule);
359 void *
mem,
size_t mem_size,
unsigned int mem_flags)
371 #ifdef __BIG_ENDIAN__
386 unsigned int edma_ring_id,
389 unsigned int mem_flags)
398 mem, mem_size, mem_flags);
402 memset(equeue, 0,
sizeof(*equeue));
408 offset.
ring = edma_ring_id;
445 ts->
tv_nsec -= (cycles_now - cycles_prev) * 1000000000
LL / clock_rate;
465 static int tried_open = 0;
478 for (i = 0; i < 4; i++) {
481 snprintf(file,
sizeof(file),
"mpipe/%d/iorpc_info", i);
533 link->
mac = rv & 0xFF;