Home | History | Annotate | Line # | Download | only in usb
utoppy.h revision 1.1
      1  1.1  scw /*	$NetBSD: utoppy.h,v 1.1 2006/04/03 08:15:48 scw 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  * 3. All advertising materials mentioning features or use of this software
     19  1.1  scw  *    must display the following acknowledgement:
     20  1.1  scw  *        This product includes software developed by the NetBSD
     21  1.1  scw  *        Foundation, Inc. and its contributors.
     22  1.1  scw  * 4. Neither the name of The NetBSD Foundation nor the names of its
     23  1.1  scw  *    contributors may be used to endorse or promote products derived
     24  1.1  scw  *    from this software without specific prior written permission.
     25  1.1  scw  *
     26  1.1  scw  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27  1.1  scw  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28  1.1  scw  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29  1.1  scw  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30  1.1  scw  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31  1.1  scw  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32  1.1  scw  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33  1.1  scw  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34  1.1  scw  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35  1.1  scw  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36  1.1  scw  * POSSIBILITY OF SUCH DAMAGE.
     37  1.1  scw  */
     38  1.1  scw 
     39  1.1  scw #ifndef _DEV_USB_UTOPPY_H_
     40  1.1  scw #define _DEV_USB_UTOPPY_H_
     41  1.1  scw 
     42  1.1  scw #include <sys/ioccom.h>
     43  1.1  scw 
     44  1.1  scw #define	UTOPPY_MAX_FILENAME_LEN	95
     45  1.1  scw #define	UTOPPY_MAX_PATHNAME_LEN	((UTOPPY_MAX_FILENAME_LEN + 1) * 6)
     46  1.1  scw 
     47  1.1  scw /* Set/clear turbo mode */
     48  1.1  scw #define	UTOPPYIOTURBO		_IOW('t', 1, int)
     49  1.1  scw 
     50  1.1  scw /* Cancel previous op */
     51  1.1  scw #define	UTOPPYIOCANCEL		_IO('t', 2)
     52  1.1  scw 
     53  1.1  scw /* Reboot the toppy */
     54  1.1  scw #define	UTOPPYIOREBOOT		_IO('t', 3)
     55  1.1  scw 
     56  1.1  scw /* Get status of Toppy's hard disk drive */
     57  1.1  scw #define	UTOPPYIOSTATS		_IOR('t', 4, struct utoppy_stats)
     58  1.1  scw struct utoppy_stats {
     59  1.1  scw 	uint64_t us_hdd_size;
     60  1.1  scw 	uint64_t us_hdd_free;
     61  1.1  scw };
     62  1.1  scw 
     63  1.1  scw /* Rename a file/directory */
     64  1.1  scw #define	UTOPPYIORENAME		_IOW('t', 5, struct utoppy_rename)
     65  1.1  scw struct utoppy_rename {
     66  1.1  scw 	char *ur_old_path;
     67  1.1  scw 	char *ur_new_path;
     68  1.1  scw };
     69  1.1  scw 
     70  1.1  scw /* Create a directory */
     71  1.1  scw #define	UTOPPYIOMKDIR		_IOW('t', 6, char *)
     72  1.1  scw 
     73  1.1  scw /* Delete a file/directory */
     74  1.1  scw #define	UTOPPYIODELETE		_IOW('t', 7, char *)
     75  1.1  scw 
     76  1.1  scw /* Initiate reading of the contents of a directory */
     77  1.1  scw #define	UTOPPYIOREADDIR		_IOW('t', 8, char *)
     78  1.1  scw struct utoppy_dirent {
     79  1.1  scw 	char ud_path[UTOPPY_MAX_FILENAME_LEN + 1];
     80  1.1  scw 	enum {
     81  1.1  scw 		UTOPPY_DIRENT_UNKNOWN,
     82  1.1  scw 		UTOPPY_DIRENT_DIRECTORY,
     83  1.1  scw 		UTOPPY_DIRENT_FILE
     84  1.1  scw 	} ud_type;
     85  1.1  scw 	off_t ud_size;
     86  1.1  scw 	time_t ud_mtime;
     87  1.1  scw 	uint32_t ud_attributes;
     88  1.1  scw };
     89  1.1  scw 
     90  1.1  scw /* Initiate reading from a specific file */
     91  1.1  scw #define	UTOPPYIOREADFILE	_IOW('t', 9, struct utoppy_readfile)
     92  1.1  scw struct utoppy_readfile {
     93  1.1  scw 	char *ur_path;
     94  1.1  scw 	off_t ur_offset;
     95  1.1  scw };
     96  1.1  scw 
     97  1.1  scw /* Initiate writing to a new file */
     98  1.1  scw #define	UTOPPYIOWRITEFILE	_IOW('t', 10, struct utoppy_writefile)
     99  1.1  scw struct utoppy_writefile {
    100  1.1  scw 	char *uw_path;
    101  1.1  scw 	off_t uw_offset;
    102  1.1  scw 	off_t uw_size;
    103  1.1  scw 	time_t uw_mtime;
    104  1.1  scw };
    105  1.1  scw 
    106  1.1  scw #endif /* _DEV_USB_UTOPPY_H_ */
    107