167fb10f3SMarcel Moolenaar /*- 24f027abdSMarcel Moolenaar * Copyright (c) 2014, 2015 Marcel Moolenaar 367fb10f3SMarcel Moolenaar * All rights reserved. 467fb10f3SMarcel Moolenaar * 567fb10f3SMarcel Moolenaar * Redistribution and use in source and binary forms, with or without 667fb10f3SMarcel Moolenaar * modification, are permitted provided that the following conditions 767fb10f3SMarcel Moolenaar * are met: 867fb10f3SMarcel Moolenaar * 967fb10f3SMarcel Moolenaar * 1. Redistributions of source code must retain the above copyright 1067fb10f3SMarcel Moolenaar * notice, this list of conditions and the following disclaimer. 1167fb10f3SMarcel Moolenaar * 2. Redistributions in binary form must reproduce the above copyright 1267fb10f3SMarcel Moolenaar * notice, this list of conditions and the following disclaimer in the 1367fb10f3SMarcel Moolenaar * documentation and/or other materials provided with the distribution. 1467fb10f3SMarcel Moolenaar * 1567fb10f3SMarcel Moolenaar * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 1667fb10f3SMarcel Moolenaar * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 1767fb10f3SMarcel Moolenaar * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 1867fb10f3SMarcel Moolenaar * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 1967fb10f3SMarcel Moolenaar * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 2067fb10f3SMarcel Moolenaar * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2167fb10f3SMarcel Moolenaar * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2267fb10f3SMarcel Moolenaar * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2367fb10f3SMarcel Moolenaar * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 2467fb10f3SMarcel Moolenaar * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2567fb10f3SMarcel Moolenaar * 2667fb10f3SMarcel Moolenaar * $FreeBSD$ 2767fb10f3SMarcel Moolenaar */ 2867fb10f3SMarcel Moolenaar 2967fb10f3SMarcel Moolenaar #ifndef _DEV_PROTO_DEV_H_ 3067fb10f3SMarcel Moolenaar #define _DEV_PROTO_DEV_H_ 3167fb10f3SMarcel Moolenaar 3267fb10f3SMarcel Moolenaar #include <sys/ioccom.h> 3367fb10f3SMarcel Moolenaar 3467fb10f3SMarcel Moolenaar #define PROTO_IOC_CLASS 'h' 3567fb10f3SMarcel Moolenaar 3667fb10f3SMarcel Moolenaar struct proto_ioc_region { 3767fb10f3SMarcel Moolenaar unsigned long address; 3867fb10f3SMarcel Moolenaar unsigned long size; 3967fb10f3SMarcel Moolenaar }; 4067fb10f3SMarcel Moolenaar 4167fb10f3SMarcel Moolenaar #define PROTO_IOC_REGION _IOWR(PROTO_IOC_CLASS, 1, struct proto_ioc_region) 4267fb10f3SMarcel Moolenaar 434f027abdSMarcel Moolenaar struct proto_ioc_busdma { 444f027abdSMarcel Moolenaar unsigned int request; 454f027abdSMarcel Moolenaar #define PROTO_IOC_BUSDMA_TAG_CREATE 1 464f027abdSMarcel Moolenaar #define PROTO_IOC_BUSDMA_TAG_DERIVE 2 474f027abdSMarcel Moolenaar #define PROTO_IOC_BUSDMA_TAG_DESTROY 3 485dcca8e8SMarcel Moolenaar #define PROTO_IOC_BUSDMA_MEM_ALLOC 10 495dcca8e8SMarcel Moolenaar #define PROTO_IOC_BUSDMA_MEM_FREE 11 504f027abdSMarcel Moolenaar unsigned long key; 514f027abdSMarcel Moolenaar union { 524f027abdSMarcel Moolenaar struct { 534f027abdSMarcel Moolenaar unsigned long align; 544f027abdSMarcel Moolenaar unsigned long bndry; 554f027abdSMarcel Moolenaar unsigned long maxaddr; 564f027abdSMarcel Moolenaar unsigned long maxsz; 574f027abdSMarcel Moolenaar unsigned long maxsegsz; 584f027abdSMarcel Moolenaar unsigned int nsegs; 594f027abdSMarcel Moolenaar unsigned int datarate; 604f027abdSMarcel Moolenaar unsigned int flags; 614f027abdSMarcel Moolenaar } tag; 625dcca8e8SMarcel Moolenaar struct { 635dcca8e8SMarcel Moolenaar unsigned long tag; 645dcca8e8SMarcel Moolenaar unsigned int flags; 65*90a1793cSMarcel Moolenaar unsigned int phys_nsegs; 66*90a1793cSMarcel Moolenaar unsigned long phys_addr; 67*90a1793cSMarcel Moolenaar unsigned long bus_addr; 68*90a1793cSMarcel Moolenaar unsigned int bus_nsegs; 695dcca8e8SMarcel Moolenaar } mem; 704f027abdSMarcel Moolenaar } u; 714f027abdSMarcel Moolenaar unsigned long result; 724f027abdSMarcel Moolenaar }; 734f027abdSMarcel Moolenaar 744f027abdSMarcel Moolenaar #define PROTO_IOC_BUSDMA _IOWR(PROTO_IOC_CLASS, 2, struct proto_ioc_busdma) 754f027abdSMarcel Moolenaar 7667fb10f3SMarcel Moolenaar #endif /* _DEV_PROTO_H_ */ 77