139214Sgibbs/*
239214Sgibbs * Copyright (c) 1998 Kenneth D. Merry.
339214Sgibbs * All rights reserved.
439214Sgibbs *
539214Sgibbs * Redistribution and use in source and binary forms, with or without
639214Sgibbs * modification, are permitted provided that the following conditions
739214Sgibbs * are met:
839214Sgibbs * 1. Redistributions of source code must retain the above copyright
939214Sgibbs *    notice, this list of conditions and the following disclaimer.
1039214Sgibbs * 2. Redistributions in binary form must reproduce the above copyright
1139214Sgibbs *    notice, this list of conditions and the following disclaimer in the
1239214Sgibbs *    documentation and/or other materials provided with the distribution.
1339214Sgibbs * 3. The name of the author may not be used to endorse or promote products
1439214Sgibbs *    derived from this software without specific prior written permission.
1539214Sgibbs *
1639214Sgibbs * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1739214Sgibbs * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1839214Sgibbs * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1939214Sgibbs * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
2039214Sgibbs * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2139214Sgibbs * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2239214Sgibbs * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2339214Sgibbs * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2439214Sgibbs * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2539214Sgibbs * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2639214Sgibbs * SUCH DAMAGE.
2739214Sgibbs *
2850476Speter * $FreeBSD$
2939214Sgibbs */
3039214Sgibbs
3139214Sgibbs#ifndef _CAMCONTROL_H
3239214Sgibbs#define _CAMCONTROL_H
33268700Smav
34268700Smavtypedef enum {
35268700Smav	CC_OR_NOT_FOUND,
36268700Smav	CC_OR_AMBIGUOUS,
37268700Smav	CC_OR_FOUND
38268700Smav} camcontrol_optret;
39268700Smav
4039214Sgibbs/*
4139214Sgibbs * get_hook: Structure for evaluating args in a callback.
4239214Sgibbs */
4339214Sgibbsstruct get_hook
4439214Sgibbs{
4539214Sgibbs	int argc;
4639214Sgibbs	char **argv;
4739214Sgibbs	int got;
4839214Sgibbs};
4939214Sgibbs
50241737Sedextern int verbose;
51241737Sed
52227961Semasteint fwdownload(struct cam_device *device, int argc, char **argv,
53241737Sed	       char *combinedopt, int printerrors, int retry_count, int timeout,
54237281Sscottl	       const char */*type*/);
5539214Sgibbsvoid mode_sense(struct cam_device *device, int mode_page, int page_control,
5639214Sgibbs		int dbd, int retry_count, int timeout, u_int8_t *data,
5739214Sgibbs		int datalen);
5839214Sgibbsvoid mode_select(struct cam_device *device, int save_pages, int retry_count,
5939214Sgibbs		 int timeout, u_int8_t *data, int datalen);
6039214Sgibbsvoid mode_edit(struct cam_device *device, int page, int page_control, int dbd,
6164382Skbyanc	       int edit, int binary, int retry_count, int timeout);
6264382Skbyancvoid mode_list(struct cam_device *device, int page_control, int dbd,
6364382Skbyanc	       int retry_count, int timeout);
64227961Semasteint scsidoinquiry(struct cam_device *device, int argc, char **argv,
65227961Semaste		  char *combinedopt, int retry_count, int timeout);
66268700Smavint scsipersist(struct cam_device *device, int argc, char **argv,
67268700Smav		char *combinedopt, int retry_count, int timeout, int verbose,
68268700Smav		int err_recover);
6939214Sgibbschar *cget(void *hook, char *name);
7039214Sgibbsint iget(void *hook, char *name);
7139214Sgibbsvoid arg_put(void *hook, int letter, void *arg, int count, char *name);
72227961Semasteint get_confirmation(void);
73241737Sedvoid usage(int printlong);
7439214Sgibbs#endif /* _CAMCONTROL_H */
75