svn commit: r190731 - head/sys/dev/usb

Andrew Thompson thompsa at FreeBSD.org
Sun Apr 5 11:20:11 PDT 2009


Author: thompsa
Date: Sun Apr  5 18:20:03 2009
New Revision: 190731
URL: http://svn.freebsd.org/changeset/base/190731

Log:
  MFp4 //depot/projects/usb at 159871
  
  - bugfixes after the memory usage reduction patch
  - Use "udev->pipes_max" instead of USB_EP_MAX
  - Use correct "bmRequestType" for getting the config descriptor.
  
  Submitted by:	Hans Petter Selasky

Modified:
  head/sys/dev/usb/usb_device.c
  head/sys/dev/usb/usb_request.c

Modified: head/sys/dev/usb/usb_device.c
==============================================================================
--- head/sys/dev/usb/usb_device.c	Sun Apr  5 18:19:52 2009	(r190730)
+++ head/sys/dev/usb/usb_device.c	Sun Apr  5 18:20:03 2009	(r190731)
@@ -105,7 +105,7 @@ struct usb2_pipe *
 usb2_get_pipe_by_addr(struct usb2_device *udev, uint8_t ea_val)
 {
 	struct usb2_pipe *pipe = udev->pipes;
-	struct usb2_pipe *pipe_end = udev->pipes + USB_EP_MAX;
+	struct usb2_pipe *pipe_end = udev->pipes + udev->pipes_max;
 	enum {
 		EA_MASK = (UE_DIR_IN | UE_DIR_OUT | UE_ADDR),
 	};
@@ -160,7 +160,7 @@ usb2_get_pipe(struct usb2_device *udev, 
     const struct usb2_config *setup)
 {
 	struct usb2_pipe *pipe = udev->pipes;
-	struct usb2_pipe *pipe_end = udev->pipes + USB_EP_MAX;
+	struct usb2_pipe *pipe_end = udev->pipes + udev->pipes_max;
 	uint8_t index = setup->ep_index;
 	uint8_t ea_mask;
 	uint8_t ea_val;
@@ -320,7 +320,7 @@ usb2_init_pipe(struct usb2_device *udev,
 struct usb2_pipe *
 usb2_pipe_foreach(struct usb2_device *udev, struct usb2_pipe *pipe)
 {
-	struct usb2_pipe *pipe_end = udev->pipes + USB_EP_MAX;
+	struct usb2_pipe *pipe_end = udev->pipes + udev->pipes_max;
 
 	/* be NULL safe */
 	if (udev == NULL)
@@ -924,7 +924,7 @@ usb2_reset_iface_endpoints(struct usb2_d
 	usb2_error_t err;
 
 	pipe = udev->pipes;
-	pipe_end = udev->pipes + USB_EP_MAX;
+	pipe_end = udev->pipes + udev->pipes_max;
 
 	for (; pipe != pipe_end; pipe++) {
 

Modified: head/sys/dev/usb/usb_request.c
==============================================================================
--- head/sys/dev/usb/usb_request.c	Sun Apr  5 18:19:52 2009	(r190730)
+++ head/sys/dev/usb/usb_request.c	Sun Apr  5 18:20:03 2009	(r190731)
@@ -97,7 +97,7 @@ usb2_do_clear_stall_callback(struct usb2
 	struct usb2_pipe *pipe;
 	struct usb2_pipe *pipe_end;
 	struct usb2_pipe *pipe_first;
-	uint8_t to = USB_EP_MAX;
+	uint8_t to;
 
 	udev = xfer->xroot->udev;
 
@@ -106,8 +106,9 @@ usb2_do_clear_stall_callback(struct usb2
 	/* round robin pipe clear stall */
 
 	pipe = udev->pipe_curr;
-	pipe_end = udev->pipes + USB_EP_MAX;
+	pipe_end = udev->pipes + udev->pipes_max;
 	pipe_first = udev->pipes;
+	to = udev->pipes_max;
 	if (pipe == NULL) {
 		pipe = pipe_first;
 	}
@@ -854,7 +855,7 @@ usb2_req_get_config_desc_ptr(struct usb2
 	if (udev->flags.usb2_mode != USB_MODE_DEVICE)
 		return (USB_ERR_INVAL);
 
-	req.bmRequestType = UT_READ_CLASS_DEVICE;
+	req.bmRequestType = UT_READ_DEVICE;
 	req.bRequest = UR_GET_DESCRIPTOR;
 	USETW2(req.wValue, UDESC_CONFIG, config_index);
 	USETW(req.wIndex, 0);


More information about the svn-src-head mailing list