xref: /freebsd/sbin/camcontrol/camcontrol.h (revision 5672fac93554beae34d48b6538a191bae2119310)
1525689f1SJustin T. Gibbs /*
2525689f1SJustin T. Gibbs  * Copyright (c) 1998 Kenneth D. Merry.
3525689f1SJustin T. Gibbs  * All rights reserved.
4525689f1SJustin T. Gibbs  *
5525689f1SJustin T. Gibbs  * Redistribution and use in source and binary forms, with or without
6525689f1SJustin T. Gibbs  * modification, are permitted provided that the following conditions
7525689f1SJustin T. Gibbs  * are met:
8525689f1SJustin T. Gibbs  * 1. Redistributions of source code must retain the above copyright
9525689f1SJustin T. Gibbs  *    notice, this list of conditions and the following disclaimer.
10525689f1SJustin T. Gibbs  * 2. Redistributions in binary form must reproduce the above copyright
11525689f1SJustin T. Gibbs  *    notice, this list of conditions and the following disclaimer in the
12525689f1SJustin T. Gibbs  *    documentation and/or other materials provided with the distribution.
13525689f1SJustin T. Gibbs  * 3. The name of the author may not be used to endorse or promote products
14525689f1SJustin T. Gibbs  *    derived from this software without specific prior written permission.
15525689f1SJustin T. Gibbs  *
16525689f1SJustin T. Gibbs  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17525689f1SJustin T. Gibbs  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18525689f1SJustin T. Gibbs  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19525689f1SJustin T. Gibbs  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20525689f1SJustin T. Gibbs  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21525689f1SJustin T. Gibbs  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22525689f1SJustin T. Gibbs  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23525689f1SJustin T. Gibbs  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24525689f1SJustin T. Gibbs  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25525689f1SJustin T. Gibbs  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26525689f1SJustin T. Gibbs  * SUCH DAMAGE.
27525689f1SJustin T. Gibbs  *
287f3dea24SPeter Wemm  * $FreeBSD$
29525689f1SJustin T. Gibbs  */
30525689f1SJustin T. Gibbs 
31525689f1SJustin T. Gibbs #ifndef _CAMCONTROL_H
32525689f1SJustin T. Gibbs #define _CAMCONTROL_H
3308df2e3eSKenneth D. Merry 
3408df2e3eSKenneth D. Merry typedef enum {
3508df2e3eSKenneth D. Merry 	CC_OR_NOT_FOUND,
3608df2e3eSKenneth D. Merry 	CC_OR_AMBIGUOUS,
3708df2e3eSKenneth D. Merry 	CC_OR_FOUND
3808df2e3eSKenneth D. Merry } camcontrol_optret;
3908df2e3eSKenneth D. Merry 
40525689f1SJustin T. Gibbs /*
41525689f1SJustin T. Gibbs  * get_hook: Structure for evaluating args in a callback.
42525689f1SJustin T. Gibbs  */
43525689f1SJustin T. Gibbs struct get_hook
44525689f1SJustin T. Gibbs {
45525689f1SJustin T. Gibbs 	int argc;
46525689f1SJustin T. Gibbs 	char **argv;
47525689f1SJustin T. Gibbs 	int got;
48525689f1SJustin T. Gibbs };
49525689f1SJustin T. Gibbs 
50bf70beceSEd Schouten extern int verbose;
51bf70beceSEd Schouten 
521f4782a4SEd Maste int fwdownload(struct cam_device *device, int argc, char **argv,
53bf70beceSEd Schouten 	       char *combinedopt, int printerrors, int retry_count, int timeout,
543ff78f82SScott Long 	       const char */*type*/);
55525689f1SJustin T. Gibbs void mode_sense(struct cam_device *device, int mode_page, int page_control,
56525689f1SJustin T. Gibbs 		int dbd, int retry_count, int timeout, u_int8_t *data,
57525689f1SJustin T. Gibbs 		int datalen);
58525689f1SJustin T. Gibbs void mode_select(struct cam_device *device, int save_pages, int retry_count,
59525689f1SJustin T. Gibbs 		 int timeout, u_int8_t *data, int datalen);
60525689f1SJustin T. Gibbs void mode_edit(struct cam_device *device, int page, int page_control, int dbd,
617e32b20dSKelly Yancey 	       int edit, int binary, int retry_count, int timeout);
627e32b20dSKelly Yancey void mode_list(struct cam_device *device, int page_control, int dbd,
637e32b20dSKelly Yancey 	       int retry_count, int timeout);
641f4782a4SEd Maste int scsidoinquiry(struct cam_device *device, int argc, char **argv,
651f4782a4SEd Maste 		  char *combinedopt, int retry_count, int timeout);
6608df2e3eSKenneth D. Merry int scsipersist(struct cam_device *device, int argc, char **argv,
6708df2e3eSKenneth D. Merry 		char *combinedopt, int retry_count, int timeout, int verbose,
6808df2e3eSKenneth D. Merry 		int err_recover);
69*5672fac9SKenneth D. Merry int scsiattrib(struct cam_device *device, int argc, char **argv,
70*5672fac9SKenneth D. Merry 	       char *combinedopt, int retry_count, int timeout, int verbose,
71*5672fac9SKenneth D. Merry 	       int err_recover);
72525689f1SJustin T. Gibbs char *cget(void *hook, char *name);
73525689f1SJustin T. Gibbs int iget(void *hook, char *name);
74525689f1SJustin T. Gibbs void arg_put(void *hook, int letter, void *arg, int count, char *name);
751f4782a4SEd Maste int get_confirmation(void);
76bf70beceSEd Schouten void usage(int printlong);
77525689f1SJustin T. Gibbs #endif /* _CAMCONTROL_H */
78