xref: /netbsd-src/usr.sbin/btattach/firmload.h (revision 8622efc43caf032d20406ccc2638ec1e072a86fe)
1*8622efc4Sjmcneill /* $NetBSD: firmload.h,v 1.1 2017/08/10 20:43:12 jmcneill Exp $ */
2*8622efc4Sjmcneill 
3*8622efc4Sjmcneill /*-
4*8622efc4Sjmcneill  * Copyright (c) 2017 Jared McNeill <jmcneill@invisible.ca>
5*8622efc4Sjmcneill  * All rights reserved.
6*8622efc4Sjmcneill  *
7*8622efc4Sjmcneill  * Redistribution and use in source and binary forms, with or without
8*8622efc4Sjmcneill  * modification, are permitted provided that the following conditions
9*8622efc4Sjmcneill  * are met:
10*8622efc4Sjmcneill  * 1. Redistributions of source code must retain the above copyright
11*8622efc4Sjmcneill  *    notice, this list of conditions and the following disclaimer.
12*8622efc4Sjmcneill  * 2. Redistributions in binary form must reproduce the above copyright
13*8622efc4Sjmcneill  *    notice, this list of conditions and the following disclaimer in the
14*8622efc4Sjmcneill  *    documentation and/or other materials provided with the distribution.
15*8622efc4Sjmcneill  *
16*8622efc4Sjmcneill  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
17*8622efc4Sjmcneill  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18*8622efc4Sjmcneill  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19*8622efc4Sjmcneill  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
20*8622efc4Sjmcneill  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21*8622efc4Sjmcneill  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22*8622efc4Sjmcneill  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23*8622efc4Sjmcneill  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24*8622efc4Sjmcneill  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25*8622efc4Sjmcneill  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26*8622efc4Sjmcneill  * SUCH DAMAGE.
27*8622efc4Sjmcneill  */
28*8622efc4Sjmcneill 
29*8622efc4Sjmcneill #ifndef _HAVE_FIRMLOAD_H
30*8622efc4Sjmcneill #define _HAVE_FIRMLOAD_H
31*8622efc4Sjmcneill 
32*8622efc4Sjmcneill /*
33*8622efc4Sjmcneill  * firmware_open(drvname, imgname)
34*8622efc4Sjmcneill  *
35*8622efc4Sjmcneill  *   Open the firmware image specified by the second parameter for the driver
36*8622efc4Sjmcneill  *   specified by the first parameter. The path to the firmware file is created
37*8622efc4Sjmcneill  *   by appending the string "/drvname/imgname" each path in the sysctl node
38*8622efc4Sjmcneill  *   hw.firmware.path until opening the firmware image succeeds.
39*8622efc4Sjmcneill  *
40*8622efc4Sjmcneill  *   Returns a file descriptor on success, and -1 on failure.
41*8622efc4Sjmcneill  */
42*8622efc4Sjmcneill int	firmware_open(const char *, const char *);
43*8622efc4Sjmcneill 
44*8622efc4Sjmcneill #endif /* !_HAVE_FIRMLOAD_H */
45