NetBSD/sys/dev/usb/utoppy.h
scw 34b4a96dbb Add a kernel driver and userland program for the Topfield TF5000PVR range
of digital video recorders popular in Europe and Australia.

These devices have a USB client port which can be used to upload and
download recordings (and other files, such as MIPS binaries for execution
on the DVR's CPU) to/from their internal hard disk, in addition to some
other operations on files and directories.
2006-04-03 08:15:48 +00:00

107 lines
3.5 KiB
C

/* $NetBSD: utoppy.h,v 1.1 2006/04/03 08:15:48 scw Exp $ */
/*-
* Copyright (c) 2006 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Steve C. Woodford.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the NetBSD
* Foundation, Inc. and its contributors.
* 4. Neither the name of The NetBSD Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _DEV_USB_UTOPPY_H_
#define _DEV_USB_UTOPPY_H_
#include <sys/ioccom.h>
#define UTOPPY_MAX_FILENAME_LEN 95
#define UTOPPY_MAX_PATHNAME_LEN ((UTOPPY_MAX_FILENAME_LEN + 1) * 6)
/* Set/clear turbo mode */
#define UTOPPYIOTURBO _IOW('t', 1, int)
/* Cancel previous op */
#define UTOPPYIOCANCEL _IO('t', 2)
/* Reboot the toppy */
#define UTOPPYIOREBOOT _IO('t', 3)
/* Get status of Toppy's hard disk drive */
#define UTOPPYIOSTATS _IOR('t', 4, struct utoppy_stats)
struct utoppy_stats {
uint64_t us_hdd_size;
uint64_t us_hdd_free;
};
/* Rename a file/directory */
#define UTOPPYIORENAME _IOW('t', 5, struct utoppy_rename)
struct utoppy_rename {
char *ur_old_path;
char *ur_new_path;
};
/* Create a directory */
#define UTOPPYIOMKDIR _IOW('t', 6, char *)
/* Delete a file/directory */
#define UTOPPYIODELETE _IOW('t', 7, char *)
/* Initiate reading of the contents of a directory */
#define UTOPPYIOREADDIR _IOW('t', 8, char *)
struct utoppy_dirent {
char ud_path[UTOPPY_MAX_FILENAME_LEN + 1];
enum {
UTOPPY_DIRENT_UNKNOWN,
UTOPPY_DIRENT_DIRECTORY,
UTOPPY_DIRENT_FILE
} ud_type;
off_t ud_size;
time_t ud_mtime;
uint32_t ud_attributes;
};
/* Initiate reading from a specific file */
#define UTOPPYIOREADFILE _IOW('t', 9, struct utoppy_readfile)
struct utoppy_readfile {
char *ur_path;
off_t ur_offset;
};
/* Initiate writing to a new file */
#define UTOPPYIOWRITEFILE _IOW('t', 10, struct utoppy_writefile)
struct utoppy_writefile {
char *uw_path;
off_t uw_offset;
off_t uw_size;
time_t uw_mtime;
};
#endif /* _DEV_USB_UTOPPY_H_ */