Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Jul 2008 07:46:44 GMT
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 144761 for review
Message-ID:  <200807060746.m667kivJ072681@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
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_ */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200807060746.m667kivJ072681>