From owner-p4-projects@FreeBSD.ORG Sun Jul 6 07:46:45 2008 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id E9E0B1065686; Sun, 6 Jul 2008 07:46:44 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AE34D106567D for ; Sun, 6 Jul 2008 07:46:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 973488FC19 for ; Sun, 6 Jul 2008 07:46:44 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m667kixF072683 for ; Sun, 6 Jul 2008 07:46:44 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.2/8.14.1/Submit) id m667kivJ072681 for perforce@freebsd.org; Sun, 6 Jul 2008 07:46:44 GMT (envelope-from hselasky@FreeBSD.org) Date: Sun, 6 Jul 2008 07:46:44 GMT Message-Id: <200807060746.m667kivJ072681@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 144761 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Jul 2008 07:46:45 -0000 http://perforce.freebsd.org/chv.cgi?CH=144761 Change 144761 by hselasky@hselasky_laptop001 on 2008/07/06 07:45:48 The beginning of a new generic USB file system interface, to better support the upcoming LibUSB 1.0. Affected files ... .. //depot/projects/usb/src/sys/dev/usb2/include/usb2_ioctl.h#5 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb2/include/usb2_ioctl.h#5 (text+ko) ==== @@ -102,6 +102,68 @@ uint8_t ude_addr; /* not used */ }; +struct usb2_fs_start { + uint8_t ep_index; +}; + +struct usb2_fs_stop { + uint8_t ep_index; +}; + +/* This structure is used for all endpoint types */ +struct usb2_fs_endpoint { + void *priv_sc0; /* private client data */ + void *priv_sc1; /* private client data */ + /* + * NOTE: isochronous USB transfer only use one buffer, but can have + * multiple frame lengths ! + */ + void **ppBuffer; /* pointer to userland buffers */ + uint32_t *pLength; /* pointer to frame lengths, updated + * to actual length */ + uint32_t nFrames; /* number of frames, updated to actual + * frames */ + uint16_t flags; + /* a single short frame will terminate */ +#define USB2_FS_FLAG_SINGLE_SHORT_OK 0x0001 + /* multiple short frames are allowed */ +#define USB2_FS_FLAG_MULTI_SHORT_OK 0x0002 + /* all frame(s) transmitted are short terminated */ +#define USB2_FS_FLAG_FORCE_SHORT 0x0004 + /* will do a clear-stall before xfer */ +#define USB2_FS_FLAG_CLEAR_STALL 0x0008 + uint16_t timeout; /* in milliseconds */ + /* timeout value for no timeout */ +#define USB2_FS_TIMEOUT_NONE 0 +}; + +struct usb2_fs_init { + /* userland pointer to endpoints structure */ + struct usb2_fs_endpoint *pEndpoints; + /* maximum number of endpoints */ + uint8_t ep_index_max; +}; + +struct usb2_fs_uninit { + uint8_t dummy; +}; + +struct usb2_fs_open { + uint32_t max_bufsize; + uint32_t max_frames; + uint8_t dev_index; /* currently unused */ + uint8_t ep_index; + uint8_t ep_no; /* bEndpointNumber */ +}; + +struct usb2_fs_close { + uint8_t ep_index; +}; + +struct usb2_fs_clear_stall_sync { + unit8_t ep_index; +}; + /* USB controller */ #define USB_REQUEST _IOWR('U', 1, struct usb2_ctl_request) #define USB_SETDEBUG _IOW ('U', 2, int) @@ -140,4 +202,13 @@ #define USB_GET_CM_OVER_DATA _IOR ('U', 130, int) #define USB_SET_CM_OVER_DATA _IOW ('U', 131, int) +/* USB file system interface */ +#define USB_FS_START _IOW ('U', 192, struct usb2_fs_start) +#define USB_FS_STOP _IOW ('U', 193, struct usb2_fs_stop) +#define USB_FS_INIT _IOW ('U', 194, struct usb2_fs_init) +#define USB_FS_UNINIT _IOW ('U', 195, struct usb2_fs_uninit) +#define USB_FS_OPEN _IOW ('U', 196, struct usb2_fs_open) +#define USB_FS_CLOSE _IOW ('U', 197, struct usb2_fs_close) +#define USB_FS_CLEAR_STALL_SYNC _IOW ('U', 198, struct usb2_fs_clear_stall_sync) + #endif /* _USB2_IOCTL_H_ */