Lines Matching refs:ioc

144 	struct proto_ioc_busdma ioc;  in bd_tag_new()  local
151 memset(&ioc, 0, sizeof(ioc)); in bd_tag_new()
152 ioc.request = (ptag != NULL) ? PROTO_IOC_BUSDMA_TAG_DERIVE : in bd_tag_new()
154 ioc.key = (ptag != NULL) ? ptag->key : 0; in bd_tag_new()
155 ioc.u.tag.align = align; in bd_tag_new()
156 ioc.u.tag.bndry = bndry; in bd_tag_new()
157 ioc.u.tag.maxaddr = maxaddr; in bd_tag_new()
158 ioc.u.tag.maxsz = maxsz; in bd_tag_new()
159 ioc.u.tag.nsegs = nsegs; in bd_tag_new()
160 ioc.u.tag.maxsegsz = maxsegsz; in bd_tag_new()
161 ioc.u.tag.datarate = datarate; in bd_tag_new()
162 ioc.u.tag.flags = flags; in bd_tag_new()
163 if (ioctl(fd, PROTO_IOC_BUSDMA, &ioc) == -1) { in bd_tag_new()
170 tag->key = ioc.result; in bd_tag_new()
171 tag->u.tag.align = ioc.u.tag.align; in bd_tag_new()
172 tag->u.tag.bndry = ioc.u.tag.bndry; in bd_tag_new()
173 tag->u.tag.maxaddr = ioc.u.tag.maxaddr; in bd_tag_new()
174 tag->u.tag.maxsz = ioc.u.tag.maxsz; in bd_tag_new()
175 tag->u.tag.maxsegsz = ioc.u.tag.maxsegsz; in bd_tag_new()
176 tag->u.tag.nsegs = ioc.u.tag.nsegs; in bd_tag_new()
177 tag->u.tag.datarate = ioc.u.tag.datarate; in bd_tag_new()
228 struct proto_ioc_busdma ioc; in bd_tag_destroy() local
237 memset(&ioc, 0, sizeof(ioc)); in bd_tag_destroy()
238 ioc.request = PROTO_IOC_BUSDMA_TAG_DESTROY; in bd_tag_destroy()
239 ioc.key = tag->key; in bd_tag_destroy()
240 if (ioctl(tag->fd, PROTO_IOC_BUSDMA, &ioc) == -1) in bd_tag_destroy()
286 struct proto_ioc_busdma ioc; in bd_md_create() local
297 memset(&ioc, 0, sizeof(ioc)); in bd_md_create()
298 ioc.request = PROTO_IOC_BUSDMA_MD_CREATE; in bd_md_create()
299 ioc.u.md.tag = tag->key; in bd_md_create()
300 ioc.u.md.flags = flags; in bd_md_create()
301 if (ioctl(tag->fd, PROTO_IOC_BUSDMA, &ioc) == -1) { in bd_md_create()
310 md->key = ioc.result; in bd_md_create()
317 struct proto_ioc_busdma ioc; in bd_md_destroy() local
324 memset(&ioc, 0, sizeof(ioc)); in bd_md_destroy()
325 ioc.request = PROTO_IOC_BUSDMA_MD_DESTROY; in bd_md_destroy()
326 ioc.key = md->key; in bd_md_destroy()
327 if (ioctl(md->fd, PROTO_IOC_BUSDMA, &ioc) == -1) in bd_md_destroy()
338 struct proto_ioc_busdma ioc; in bd_md_load() local
346 memset(&ioc, 0, sizeof(ioc)); in bd_md_load()
347 ioc.request = PROTO_IOC_BUSDMA_MD_LOAD; in bd_md_load()
348 ioc.key = md->key; in bd_md_load()
349 ioc.u.md.flags = flags; in bd_md_load()
350 ioc.u.md.virt_addr = (uintptr_t)buf; in bd_md_load()
351 ioc.u.md.virt_size = len; in bd_md_load()
352 if (ioctl(md->fd, PROTO_IOC_BUSDMA, &ioc) == -1) in bd_md_load()
355 error = bd_md_add_seg(md, BUSDMA_MD_VIRT, ioc.u.md.virt_addr, len); in bd_md_load()
356 error = bd_md_add_seg(md, BUSDMA_MD_PHYS, ioc.u.md.phys_addr, len); in bd_md_load()
357 error = bd_md_add_seg(md, BUSDMA_MD_BUS, ioc.u.md.bus_addr, len); in bd_md_load()
364 struct proto_ioc_busdma ioc; in bd_md_unload() local
372 memset(&ioc, 0, sizeof(ioc)); in bd_md_unload()
373 ioc.request = PROTO_IOC_BUSDMA_MD_UNLOAD; in bd_md_unload()
374 ioc.key = md->key; in bd_md_unload()
375 if (ioctl(md->fd, PROTO_IOC_BUSDMA, &ioc) == -1) in bd_md_unload()
387 struct proto_ioc_busdma ioc; in bd_mem_alloc() local
400 memset(&ioc, 0, sizeof(ioc)); in bd_mem_alloc()
401 ioc.request = PROTO_IOC_BUSDMA_MEM_ALLOC; in bd_mem_alloc()
402 ioc.u.md.tag = tag->key; in bd_mem_alloc()
403 ioc.u.md.flags = flags; in bd_mem_alloc()
404 if (ioctl(tag->fd, PROTO_IOC_BUSDMA, &ioc) == -1) { in bd_mem_alloc()
413 md->key = ioc.result; in bd_mem_alloc()
416 assert(ioc.u.md.phys_nsegs == 1); in bd_mem_alloc()
417 assert(ioc.u.md.bus_nsegs == 1); in bd_mem_alloc()
418 error = bd_md_add_seg(md, BUSDMA_MD_PHYS, ioc.u.md.phys_addr, in bd_mem_alloc()
420 error = bd_md_add_seg(md, BUSDMA_MD_BUS, ioc.u.md.bus_addr, in bd_mem_alloc()
424 MAP_NOCORE | MAP_SHARED, md->fd, ioc.u.md.phys_addr); in bd_mem_alloc()
432 memset(&ioc, 0, sizeof(ioc)); in bd_mem_alloc()
433 ioc.request = PROTO_IOC_BUSDMA_MEM_FREE; in bd_mem_alloc()
434 ioc.key = md->key; in bd_mem_alloc()
435 ioctl(md->fd, PROTO_IOC_BUSDMA, &ioc); in bd_mem_alloc()
444 struct proto_ioc_busdma ioc; in bd_mem_free() local
451 memset(&ioc, 0, sizeof(ioc)); in bd_mem_free()
452 ioc.request = PROTO_IOC_BUSDMA_MEM_FREE; in bd_mem_free()
453 ioc.key = md->key; in bd_mem_free()
454 if (ioctl(md->fd, PROTO_IOC_BUSDMA, &ioc) == -1) in bd_mem_free()
539 struct proto_ioc_busdma ioc; in bd_sync() local
546 memset(&ioc, 0, sizeof(ioc)); in bd_sync()
547 ioc.request = PROTO_IOC_BUSDMA_SYNC; in bd_sync()
548 ioc.key = md->key; in bd_sync()
549 ioc.u.sync.op = op; in bd_sync()
550 ioc.u.sync.base = ofs; in bd_sync()
551 ioc.u.sync.size = len; in bd_sync()
552 if (ioctl(md->fd, PROTO_IOC_BUSDMA, &ioc) == -1) in bd_sync()