Date: Fri, 27 Mar 2009 07:56:24 GMT From: Hans Petter Selasky <hselasky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 159897 for review Message-ID: <200903270756.n2R7uO6n028443@repoman.freebsd.org>
index | next in thread | raw e-mail
http://perforce.freebsd.org/chv.cgi?CH=159897 Change 159897 by hselasky@hselasky_laptop001 on 2009/03/27 07:56:16 USB core: - add new endpoint direction values for use with usb2_config Affected files ... .. //depot/projects/usb/src/sys/dev/usb/usb.h#38 edit .. //depot/projects/usb/src/sys/dev/usb/usb_device.c#18 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/usb.h#38 (text+ko) ==== @@ -461,8 +461,10 @@ 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! */ ==== //depot/projects/usb/src/sys/dev/usb/usb_device.c#18 (text+ko) ==== @@ -174,7 +174,15 @@ /* 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;help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903270756.n2R7uO6n028443>
