From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:46508) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RvotE-00061s-BR for qemu-devel@nongnu.org; Fri, 10 Feb 2012 06:43:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rvot8-0000Im-76 for qemu-devel@nongnu.org; Fri, 10 Feb 2012 06:43:44 -0500 Received: from mx1.redhat.com ([209.132.183.28]:40118) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rvot7-0000IJ-Sw for qemu-devel@nongnu.org; Fri, 10 Feb 2012 06:43:38 -0500 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q1ABhbEe012947 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 10 Feb 2012 06:43:37 -0500 From: Gerd Hoffmann Date: Fri, 10 Feb 2012 12:43:14 +0100 Message-Id: <1328874204-20920-19-git-send-email-kraxel@redhat.com> In-Reply-To: <1328874204-20920-1-git-send-email-kraxel@redhat.com> References: <1328874204-20920-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH 18/28] usb: add USBEndpoint->{nr,pid} List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann Add a "nr" and "pid" fields to USBEndpoint so you can easily figure the endpoint number and direction of any given endpoint. Signed-off-by: Gerd Hoffmann --- hw/usb.c | 5 +++++ hw/usb.h | 2 ++ 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/hw/usb.c b/hw/usb.c index 8584db0..8bd1222 100644 --- a/hw/usb.c +++ b/hw/usb.c @@ -402,10 +402,15 @@ void usb_ep_init(USBDevice *dev) { int ep; + dev->ep_ctl.nr = 0; dev->ep_ctl.type = USB_ENDPOINT_XFER_CONTROL; dev->ep_ctl.ifnum = 0; dev->ep_ctl.dev = dev; for (ep = 0; ep < USB_MAX_ENDPOINTS; ep++) { + dev->ep_in[ep].nr = ep + 1; + dev->ep_out[ep].nr = ep + 1; + dev->ep_in[ep].pid = USB_TOKEN_IN; + dev->ep_out[ep].pid = USB_TOKEN_OUT; dev->ep_in[ep].type = USB_ENDPOINT_XFER_INVALID; dev->ep_out[ep].type = USB_ENDPOINT_XFER_INVALID; dev->ep_in[ep].ifnum = 0; diff --git a/hw/usb.h b/hw/usb.h index 4e878d3..1e629af 100644 --- a/hw/usb.h +++ b/hw/usb.h @@ -171,6 +171,8 @@ struct USBDescString { #define USB_MAX_INTERFACES 16 struct USBEndpoint { + uint8_t nr; + uint8_t pid; uint8_t type; uint8_t ifnum; int max_packet_size; -- 1.7.1