Home | History | Annotate | Line # | Download | only in usb
      1  1.2  martin /*	$NetBSD: utoppy.h,v 1.2 2008/04/28 20:24:01 martin Exp $	*/
      2  1.1     scw 
      3  1.1     scw /*-
      4  1.1     scw  * Copyright (c) 2006 The NetBSD Foundation, Inc.
      5  1.1     scw  * All rights reserved.
      6  1.1     scw  *
      7  1.1     scw  * This code is derived from software contributed to The NetBSD Foundation
      8  1.1     scw  * by Steve C. Woodford.
      9  1.1     scw  *
     10  1.1     scw  * Redistribution and use in source and binary forms, with or without
     11  1.1     scw  * modification, are permitted provided that the following conditions
     12  1.1     scw  * are met:
     13  1.1     scw  * 1. Redistributions of source code must retain the above copyright
     14  1.1     scw  *    notice, this list of conditions and the following disclaimer.
     15  1.1     scw  * 2. Redistributions in binary form must reproduce the above copyright
     16  1.1     scw  *    notice, this list of conditions and the following disclaimer in the
     17  1.1     scw  *    documentation and/or other materials provided with the distribution.
     18  1.1     scw  *
     19  1.1     scw  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     20  1.1     scw  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     21  1.1     scw  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     22  1.1     scw  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     23  1.1     scw  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     24  1.1     scw  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     25  1.1     scw  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     26  1.1     scw  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     27  1.1     scw  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     28  1.1     scw  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     29  1.1     scw  * POSSIBILITY OF SUCH DAMAGE.
     30  1.1     scw  */
     31  1.1     scw 
     32  1.1     scw #ifndef _DEV_USB_UTOPPY_H_
     33  1.1     scw #define _DEV_USB_UTOPPY_H_
     34  1.1     scw 
     35  1.1     scw #include <sys/ioccom.h>
     36  1.1     scw 
     37  1.1     scw #define	UTOPPY_MAX_FILENAME_LEN	95
     38  1.1     scw #define	UTOPPY_MAX_PATHNAME_LEN	((UTOPPY_MAX_FILENAME_LEN + 1) * 6)
     39  1.1     scw 
     40  1.1     scw /* Set/clear turbo mode */
     41  1.1     scw #define	UTOPPYIOTURBO		_IOW('t', 1, int)
     42  1.1     scw 
     43  1.1     scw /* Cancel previous op */
     44  1.1     scw #define	UTOPPYIOCANCEL		_IO('t', 2)
     45  1.1     scw 
     46  1.1     scw /* Reboot the toppy */
     47  1.1     scw #define	UTOPPYIOREBOOT		_IO('t', 3)
     48  1.1     scw 
     49  1.1     scw /* Get status of Toppy's hard disk drive */
     50  1.1     scw #define	UTOPPYIOSTATS		_IOR('t', 4, struct utoppy_stats)
     51  1.1     scw struct utoppy_stats {
     52  1.1     scw 	uint64_t us_hdd_size;
     53  1.1     scw 	uint64_t us_hdd_free;
     54  1.1     scw };
     55  1.1     scw 
     56  1.1     scw /* Rename a file/directory */
     57  1.1     scw #define	UTOPPYIORENAME		_IOW('t', 5, struct utoppy_rename)
     58  1.1     scw struct utoppy_rename {
     59  1.1     scw 	char *ur_old_path;
     60  1.1     scw 	char *ur_new_path;
     61  1.1     scw };
     62  1.1     scw 
     63  1.1     scw /* Create a directory */
     64  1.1     scw #define	UTOPPYIOMKDIR		_IOW('t', 6, char *)
     65  1.1     scw 
     66  1.1     scw /* Delete a file/directory */
     67  1.1     scw #define	UTOPPYIODELETE		_IOW('t', 7, char *)
     68  1.1     scw 
     69  1.1     scw /* Initiate reading of the contents of a directory */
     70  1.1     scw #define	UTOPPYIOREADDIR		_IOW('t', 8, char *)
     71  1.1     scw struct utoppy_dirent {
     72  1.1     scw 	char ud_path[UTOPPY_MAX_FILENAME_LEN + 1];
     73  1.1     scw 	enum {
     74  1.1     scw 		UTOPPY_DIRENT_UNKNOWN,
     75  1.1     scw 		UTOPPY_DIRENT_DIRECTORY,
     76  1.1     scw 		UTOPPY_DIRENT_FILE
     77  1.1     scw 	} ud_type;
     78  1.1     scw 	off_t ud_size;
     79  1.1     scw 	time_t ud_mtime;
     80  1.1     scw 	uint32_t ud_attributes;
     81  1.1     scw };
     82  1.1     scw 
     83  1.1     scw /* Initiate reading from a specific file */
     84  1.1     scw #define	UTOPPYIOREADFILE	_IOW('t', 9, struct utoppy_readfile)
     85  1.1     scw struct utoppy_readfile {
     86  1.1     scw 	char *ur_path;
     87  1.1     scw 	off_t ur_offset;
     88  1.1     scw };
     89  1.1     scw 
     90  1.1     scw /* Initiate writing to a new file */
     91  1.1     scw #define	UTOPPYIOWRITEFILE	_IOW('t', 10, struct utoppy_writefile)
     92  1.1     scw struct utoppy_writefile {
     93  1.1     scw 	char *uw_path;
     94  1.1     scw 	off_t uw_offset;
     95  1.1     scw 	off_t uw_size;
     96  1.1     scw 	time_t uw_mtime;
     97  1.1     scw };
     98  1.1     scw 
     99  1.1     scw #endif /* _DEV_USB_UTOPPY_H_ */
    100