PERFORCE change 119988 for review

Hans Petter Selasky hselasky at FreeBSD.org
Fri May 18 10:45:55 UTC 2007


http://perforce.freebsd.org/chv.cgi?CH=119988

Change 119988 by hselasky at hselasky_mini_itx on 2007/05/18 10:45:10

	Submit the Linux USB compatibility layer for our new USB stack.
	Remove unused USBD_CUSTOM_CLEARSTALL flag.
	Fix a comment.

Affected files ...

.. //depot/projects/usb/src/sys/conf/files#16 edit
.. //depot/projects/usb/src/sys/dev/usb/README#13 edit
.. //depot/projects/usb/src/sys/dev/usb/usb.h#9 edit
.. //depot/projects/usb/src/sys/dev/usb/usb_compat_linux.c#1 add
.. //depot/projects/usb/src/sys/dev/usb/usb_compat_linux.h#1 add
.. //depot/projects/usb/src/sys/dev/usb/usb_subr.c#35 edit
.. //depot/projects/usb/src/sys/dev/usb/usb_subr.h#38 edit
.. //depot/projects/usb/src/sys/dev/usb/usb_transfer.c#24 edit
.. //depot/projects/usb/src/sys/modules/usb/Makefile#3 edit

Differences ...

==== //depot/projects/usb/src/sys/conf/files#16 (text+ko) ====

@@ -1084,6 +1084,7 @@
 dev/usb/usb_requests.c		optional usb
 dev/usb/usb_subr.c		optional usb
 dev/usb/usb_transfer.c		optional usb
+dev/usb/usb_compat_linux.c	optional usb
 dev/usb/uscanner.c		optional uscanner
 dev/usb/uvisor.c		optional uvisor
 dev/usb/uvscom.c		optional uvscom

==== //depot/projects/usb/src/sys/dev/usb/README#13 (text+ko) ====

@@ -223,8 +223,6 @@
 	This flag allows the transfer length, "xfer->actlen" to be
 	less than "xfer->length", upon completion of a transfer.
 
-  USBD_CUSTOM_CLEARSTALL
-
   USBD_USE_POLLING
 	This flag can be used with any callback and will cause the
 	"usbd_transfer_start()" function to wait, using "DELAY()",

==== //depot/projects/usb/src/sys/dev/usb/usb.h#9 (text+ko) ====

@@ -72,7 +72,7 @@
 #define USB_START_ADDR 0
 
 #define USB_CONTROL_ENDPOINT 0
-#define USB_MAX_ENDPOINTS 16
+#define USB_MAX_ENDPOINTS (2*16)
 
 #define USB_FRAMES_PER_SECOND 1000
 
@@ -662,6 +662,7 @@
 #define USB_SPEED_LOW  1
 #define USB_SPEED_FULL 2
 #define USB_SPEED_HIGH 3
+#define USB_SPEED_VARIABLE 4
 	int		udi_power;	/* power consumption in mA, 0 if selfpowered */
 	int		udi_nports;
 	char		udi_devnames[USB_MAX_DEVNAMES][USB_MAX_DEVNAMELEN];

==== //depot/projects/usb/src/sys/dev/usb/usb_subr.c#35 (text+ko) ====

@@ -1495,6 +1495,12 @@
 			__FUNCTION__);
 	}
 
+	/* free Linux compat device if any */
+	if (udev->linux_dev) {
+	    usb_linux_free_usb_device(udev->linux_dev);
+	    udev->linux_dev = NULL;
+	}
+
 	/* free device */
 	free(udev, M_USB);
 	up->device = 0;

==== //depot/projects/usb/src/sys/dev/usb/usb_subr.h#38 (text+ko) ====

@@ -83,6 +83,7 @@
 struct malloc_type;
 struct proc;
 struct usb_hid_descriptor;
+struct usb_device; /* Linux compat */
 
 typedef uint8_t usbd_status;
 
@@ -232,6 +233,7 @@
 	struct usbd_hub		*hub; /* only if this is a hub */
 	device_t                subdevs[USB_MAX_ENDPOINTS]; /* array of all sub-devices */
 	device_t                subdevs_end[0];
+	struct usb_device 	*linux_dev;
 
 	usb_event_cookie_t	cookie;	       /* unique connection id */
 
@@ -279,10 +281,7 @@
 					 * flag is also exported by usb.h
 					 */
 #endif
-#define	USBD_CUSTOM_CLEARSTALL   0x0008 /* used to disable automatic clear-stall
-					 * when a device reset request is needed
-					 * in addition to the clear stall request
-					 */
+#define	USBD_UNUSED_3            0x0008
 #define	USBD_DEV_OPEN            0x0010
 #define	USBD_DEV_RECURSED_1      0x0020
 #define	USBD_DEV_RECURSED_2      0x0040
@@ -333,7 +332,7 @@
 
 	struct usbd_pipe 	*pipe;
 	struct usbd_device 	*udev;
-	struct usbd_xfer 	*clearstall_xfer;
+	struct usbd_xfer	*clearstall_xfer;
 	struct mtx 		*priv_mtx;
 	struct mtx 		*usb_mtx; /* used by HC driver */
 	struct usbd_memory_info	*usb_root; /* used by HC driver */
@@ -806,4 +805,7 @@
 	uint8_t			sc_first_open; /* set when first device is being opened */
 };
 
+/* prototypes from "usb_compat_linux.c" */
+void	usb_linux_free_usb_device(struct usb_device *dev);
+
 #endif /* _USB_SUBR_H_ */

==== //depot/projects/usb/src/sys/dev/usb/usb_transfer.c#24 (text+ko) ====

@@ -165,7 +165,7 @@
 		    udev, iface_index, setup->endpoint,
 		    setup->type, setup->direction, setup->index));
 
-	/* NOTE: pipes should be searched from the beginning */
+	/* NOTE: pipes are searched from the beginning */
 
 	for (pipe = udev->pipes;
 	     ((pipe >= udev->pipes) && 
@@ -284,7 +284,6 @@
 		   (~(USBD_SYNCHRONOUS|
 		      USBD_FORCE_SHORT_XFER|
 		      USBD_SHORT_XFER_OK|
-		      USBD_CUSTOM_CLEARSTALL|
 		      USBD_USE_POLLING|
 		      USBD_USE_DMA)))
 		{

==== //depot/projects/usb/src/sys/modules/usb/Makefile#3 (text+ko) ====

@@ -16,6 +16,7 @@
 	usb_requests.c \
 	usb_subr.c usb_subr.h \
 	usb_transfer.c \
+	usb_compat_linux.c \
 
 SRCS+=	uhci_pci.c uhci.c uhci.h 
 SRCS+=	ohci_pci.c ohci.c ohci.h 


More information about the p4-projects mailing list