From owner-svn-soc-all@FreeBSD.ORG Sun Jul 28 17:24:24 2013 Return-Path: Delivered-To: svn-soc-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id A5E59F4B for ; Sun, 28 Jul 2013 17:24:24 +0000 (UTC) (envelope-from bguan@FreeBSD.org) Received: from socsvn.freebsd.org (socsvn.freebsd.org [IPv6:2001:1900:2254:206a::50:2]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 78D9F22A4 for ; Sun, 28 Jul 2013 17:24:24 +0000 (UTC) Received: from socsvn.freebsd.org ([127.0.1.124]) by socsvn.freebsd.org (8.14.7/8.14.7) with ESMTP id r6SHOO85090788 for ; Sun, 28 Jul 2013 17:24:24 GMT (envelope-from bguan@FreeBSD.org) Received: (from www@localhost) by socsvn.freebsd.org (8.14.7/8.14.6/Submit) id r6SHOOPk090782 for svn-soc-all@FreeBSD.org; Sun, 28 Jul 2013 17:24:24 GMT (envelope-from bguan@FreeBSD.org) Date: Sun, 28 Jul 2013 17:24:24 GMT Message-Id: <201307281724.r6SHOOPk090782@socsvn.freebsd.org> X-Authentication-Warning: socsvn.freebsd.org: www set sender to bguan@FreeBSD.org using -f From: bguan@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r255270 - soc2013/bguan/head/sys/dev/xen/usbfront MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-soc-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the entire Summer of Code repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 28 Jul 2013 17:24:24 -0000 Author: bguan Date: Sun Jul 28 17:24:24 2013 New Revision: 255270 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=255270 Log: add struct mtx for usbfront Modified: soc2013/bguan/head/sys/dev/xen/usbfront/xenhci.h Modified: soc2013/bguan/head/sys/dev/xen/usbfront/xenhci.h ============================================================================== --- soc2013/bguan/head/sys/dev/xen/usbfront/xenhci.h Sun Jul 28 17:24:11 2013 (r255269) +++ soc2013/bguan/head/sys/dev/xen/usbfront/xenhci.h Sun Jul 28 17:24:24 2013 (r255270) @@ -35,6 +35,13 @@ #define XENHCI_MAX_DEVICES MIN(USB_MAX_DEVICES, 128) +#define XENHCI_PAGE_SIZE 4096 /* bytes */ + +//#define TASK_COMM_LEN 16 /* Task command name length */ + +#define GRANT_INVALID_REF 0 + + /* USB ports. This is arbitrary. * From USB 2.0 spec Table 11-13, offset 7, a hub can * have up to 255 ports. The most yet reported is 10. @@ -50,6 +57,7 @@ #endif #define USB_URB_RING_SIZE __RING_SIZE((usbif_urb_sring_t *)0, PAGE_SIZE) +#define USB_CONN_RING_SIZE __RING_SIZE((usbif_conn_sring_t *)0, PAGE_SIZE) LIST_HEAD(list_head, list_head); @@ -74,7 +82,24 @@ enum usb_dev_speed speed; }; +/* + The "hardware" in Xen host controller is the shared ring to + the backend driver and the data you can send and receive across it +*/ +//struct xenhci_hw_softc { + //struct usb_page_cache root_pc; + //struct usb_page_cache ctx_pc; + //struct usb_page_cache scratch_pc[XHCI_MAX_SCRATCHPADS]; + + //struct usb_page root_pg; + //struct usb_page ctx_pg; + //struct usb_page scratch_pg[XHCI_MAX_SCRATCHPADS]; + + //struct xhci_hw_dev devs[XHCI_MAX_DEVICES + 1]; +//}; + struct xenhci_softc { + //struct xenhci_hw_softc sc_hw; /* base device */ struct usb_bus sc_bus; /* configure message */ @@ -90,7 +115,7 @@ LIST_ENTRY(list_head) in_progress_list; //?? LIST_ENTRY(list_head) giveback_waiting_list; //?? - //spinlock_t lock; + struct mtx lock; //spinlock_t lock; /* timer that kick pending and giveback waiting urbs */ //struct timer_list watchdog;//?? @@ -115,8 +140,9 @@ unsigned long shadow_free; /* ring response thread */ - struct task *ringthread;//struct task_struct *kthread; - LIST_ENTRY(list_head) *wait_list; //wait_queue_head_t wq;?? + struct task *kthread;//struct task_struct *kthread; + //LIST_ENTRY(list_head) *wait_list; //wait_queue_head_t wq;?? + struct taskqueue *wait_taskqueue; unsigned int waiting_resp;// };