usb_freebsd.h revision 214221
123599Smarkm/* $FreeBSD: head/sys/dev/usb/usb_freebsd.h 214221 2010-10-22 20:13:45Z hselasky $ */
251694Sroger/*-
351694Sroger * Copyright (c) 2008 Hans Petter Selasky. All rights reserved.
448781Sroger *
548781Sroger * Redistribution and use in source and binary forms, with or without
623599Smarkm * modification, are permitted provided that the following conditions
723599Smarkm * are met:
823599Smarkm * 1. Redistributions of source code must retain the above copyright
923599Smarkm *    notice, this list of conditions and the following disclaimer.
1023599Smarkm * 2. Redistributions in binary form must reproduce the above copyright
1123599Smarkm *    notice, this list of conditions and the following disclaimer in the
1223599Smarkm *    documentation and/or other materials provided with the distribution.
1323599Smarkm *
1423599Smarkm * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1523599Smarkm * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1623599Smarkm * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1723599Smarkm * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1823599Smarkm * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1923599Smarkm * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2023599Smarkm * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2123599Smarkm * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2223599Smarkm * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2323599Smarkm * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2423599Smarkm * SUCH DAMAGE.
2523599Smarkm */
2623599Smarkm
2723599Smarkm/*
2823599Smarkm * Including this file is mandatory for all USB related c-files in the kernel.
2923599Smarkm */
3023599Smarkm
3123599Smarkm#ifndef _USB_FREEBSD_H_
3223599Smarkm#define	_USB_FREEBSD_H_
3323599Smarkm
3439838Ssos/* Default USB configuration */
3523599Smarkm#define	USB_HAVE_UGEN 1
3651694Sroger#define	USB_HAVE_DEVCTL 1
3751694Sroger#define	USB_HAVE_BUSDMA 1
3859014Sroger#define	USB_HAVE_COMPAT_LINUX 1
3959014Sroger#define	USB_HAVE_USER_IO 1
4059014Sroger#define	USB_HAVE_MBUF 1
4159014Sroger#define	USB_HAVE_TT_SUPPORT 1
4259014Sroger#define	USB_HAVE_POWERD 1
4359014Sroger#define	USB_HAVE_MSCTEST 1
4451694Sroger
4559014Sroger#define	USB_TD_GET_PROC(td) (td)->td_proc
4651694Sroger#define	USB_PROC_GET_GID(td) (td)->p_pgid
4759014Sroger
4859014Sroger#define	USB_HOST_ALIGN    8		/* bytes, must be power of two */
4959014Sroger#define	USB_FS_ISOC_UFRAME_MAX 4	/* exclusive unit */
5059014Sroger#define	USB_BUS_MAX 256			/* units */
5159014Sroger#define	USB_MAX_DEVICES 128		/* units */
5251694Sroger#define	USB_IFACE_MAX 32		/* units */
5351694Sroger#define	USB_FIFO_MAX 128		/* units */
5423599Smarkm
5523599Smarkm#define	USB_MAX_FS_ISOC_FRAMES_PER_XFER (120)	/* units */
5623599Smarkm#define	USB_MAX_HS_ISOC_FRAMES_PER_XFER (8*120)	/* units */
5723599Smarkm
5823599Smarkm#define	USB_HUB_MAX_DEPTH	5
5947884Sroger#define	USB_EP0_BUFSIZE		1024	/* bytes */
6023599Smarkm
6143771Srogertypedef uint32_t usb_timeout_t;		/* milliseconds */
6243771Srogertypedef uint32_t usb_frlength_t;	/* bytes */
6343771Srogertypedef uint32_t usb_frcount_t;		/* units */
6443771Srogertypedef uint32_t usb_size_t;		/* bytes */
6523599Smarkmtypedef uint32_t usb_ticks_t;		/* system defined */
6643771Srogertypedef uint16_t usb_power_mask_t;	/* see "USB_HW_POWER_XXX" */
6743771Sroger
6847492Sroger#endif	/* _USB_FREEBSD_H_ */
6943771Sroger