From owner-svn-src-all@FreeBSD.ORG Sun Apr 5 18:20:13 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A76C710658E6; Sun, 5 Apr 2009 18:20:13 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 908598FC22; Sun, 5 Apr 2009 18:20:13 +0000 (UTC) (envelope-from thompsa@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n35IKD5g027822; Sun, 5 Apr 2009 18:20:13 GMT (envelope-from thompsa@svn.freebsd.org) Received: (from thompsa@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n35IKDDL027820; Sun, 5 Apr 2009 18:20:13 GMT (envelope-from thompsa@svn.freebsd.org) Message-Id: <200904051820.n35IKDDL027820@svn.freebsd.org> From: Andrew Thompson Date: Sun, 5 Apr 2009 18:20:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190732 - head/sys/dev/usb X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Apr 2009 18:20:19 -0000 Author: thompsa Date: Sun Apr 5 18:20:13 2009 New Revision: 190732 URL: http://svn.freebsd.org/changeset/base/190732 Log: MFp4 //depot/projects/usb@159897 Add new endpoint direction values for use with usb2_config Submitted by: Hans Petter Selasky Modified: head/sys/dev/usb/usb.h head/sys/dev/usb/usb_device.c Modified: head/sys/dev/usb/usb.h ============================================================================== --- head/sys/dev/usb/usb.h Sun Apr 5 18:20:03 2009 (r190731) +++ head/sys/dev/usb/usb.h Sun Apr 5 18:20:13 2009 (r190732) @@ -461,8 +461,10 @@ struct usb2_endpoint_descriptor { uByte bEndpointAddress; #define UE_GET_DIR(a) ((a) & 0x80) #define UE_SET_DIR(a,d) ((a) | (((d)&1) << 7)) -#define UE_DIR_IN 0x80 -#define UE_DIR_OUT 0x00 +#define UE_DIR_IN 0x80 /* IN-token endpoint, fixed */ +#define UE_DIR_OUT 0x00 /* OUT-token endpoint, fixed */ +#define UE_DIR_RX 0xfd /* for internal use only! */ +#define UE_DIR_TX 0xfe /* for internal use only! */ #define UE_DIR_ANY 0xff /* for internal use only! */ #define UE_ADDR 0x0f #define UE_ADDR_ANY 0xff /* for internal use only! */ Modified: head/sys/dev/usb/usb_device.c ============================================================================== --- head/sys/dev/usb/usb_device.c Sun Apr 5 18:20:03 2009 (r190731) +++ head/sys/dev/usb/usb_device.c Sun Apr 5 18:20:13 2009 (r190732) @@ -174,7 +174,15 @@ usb2_get_pipe(struct usb2_device *udev, /* setup expected endpoint direction mask and value */ - if (setup->direction == UE_DIR_ANY) { + if (setup->direction == UE_DIR_RX) { + ea_mask = (UE_DIR_IN | UE_DIR_OUT); + ea_val = (udev->flags.usb2_mode == USB_MODE_DEVICE) ? + UE_DIR_OUT : UE_DIR_IN; + } else if (setup->direction == UE_DIR_TX) { + ea_mask = (UE_DIR_IN | UE_DIR_OUT); + ea_val = (udev->flags.usb2_mode == USB_MODE_DEVICE) ? + UE_DIR_IN : UE_DIR_OUT; + } else if (setup->direction == UE_DIR_ANY) { /* match any endpoint direction */ ea_mask = 0; ea_val = 0;