From patchwork Mon Jun 3 19:21:27 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Warren X-Patchwork-Id: 248394 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 358122C00AA for ; Tue, 4 Jun 2013 05:21:57 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757592Ab3FCTVp (ORCPT ); Mon, 3 Jun 2013 15:21:45 -0400 Received: from avon.wwwdotorg.org ([70.85.31.133]:48901 "EHLO avon.wwwdotorg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756049Ab3FCTVn (ORCPT ); Mon, 3 Jun 2013 15:21:43 -0400 Received: from severn.wwwdotorg.org (unknown [192.168.65.5]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by avon.wwwdotorg.org (Postfix) with ESMTPS id 49A3E635A; Mon, 3 Jun 2013 13:29:11 -0600 (MDT) Received: from swarren-lx1.nvidia.com (localhost [127.0.0.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by severn.wwwdotorg.org (Postfix) with ESMTPSA id C6112E4634; Mon, 3 Jun 2013 13:21:41 -0600 (MDT) From: Stephen Warren To: Felipe Balbi Cc: Greg Kroah-Hartman , Alan Stern , Manjunath Goudar , Arnd Bergmann , Venu Byravarasu , linux-usb@vger.kernel.org, linux-tegra@vger.kernel.org, Stephen Warren Subject: [PATCH 3/6] USB: EHCI: expand struct ehci_driver_overrides Date: Mon, 3 Jun 2013 13:21:27 -0600 Message-Id: <1370287290-21579-4-git-send-email-swarren@wwwdotorg.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1370287290-21579-1-git-send-email-swarren@wwwdotorg.org> References: <1370287290-21579-1-git-send-email-swarren@wwwdotorg.org> X-NVConfidentiality: public X-Virus-Scanned: clamav-milter 0.97.7 at avon.wwwdotorg.org X-Virus-Status: Clean Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org From: Manjunath Goudar Some EHCI HCD drivers may need to override additional fields in struct hc_driver, such as map_urb_for_dma, unmap_urb_for_dma, hub_control. Add fields to struct ehci_driver_overrides to allow them to do so. These new overrides will be used at least by the Tegra EHCI driver. Signed-off-by: Manjunath Goudar [swarren, reworked Manjunath's patches to split them more logically] Signed-off-by: Stephen Warren --- drivers/usb/host/ehci-hcd.c | 6 ++++++ drivers/usb/host/ehci.h | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index 246e124..da1c224 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c @@ -1211,6 +1211,12 @@ void ehci_init_driver(struct hc_driver *drv, drv->hcd_priv_size += over->extra_priv_size; if (over->reset) drv->reset = over->reset; + if (over->map_urb_for_dma) + drv->map_urb_for_dma = over->map_urb_for_dma; + if (over->unmap_urb_for_dma) + drv->unmap_urb_for_dma = over->unmap_urb_for_dma; + if (over->hub_control) + drv->hub_control = over->hub_control; } } EXPORT_SYMBOL_GPL(ehci_init_driver); diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h index 7c978b2..918008a 100644 --- a/drivers/usb/host/ehci.h +++ b/drivers/usb/host/ehci.h @@ -795,6 +795,12 @@ static inline u32 hc32_to_cpup (const struct ehci_hcd *ehci, const __hc32 *x) struct ehci_driver_overrides { size_t extra_priv_size; int (*reset)(struct usb_hcd *hcd); + int (*map_urb_for_dma)(struct usb_hcd *hcd, struct urb *urb, + gfp_t mem_flags); + void (*unmap_urb_for_dma)(struct usb_hcd *hcd, struct urb *urb); + int (*hub_control)(struct usb_hcd *hcd, + u16 typeReq, u16 wValue, u16 wIndex, + char *buf, u16 wLength); }; extern void ehci_init_driver(struct hc_driver *drv,