From patchwork Wed Jul 19 13:51:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bin Meng X-Patchwork-Id: 791050 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="nE0qo78c"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3xCJkg2j9fz9sDB for ; Thu, 20 Jul 2017 00:07:23 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 23CB0C21E78; Wed, 19 Jul 2017 14:00:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id EE778C21E54; Wed, 19 Jul 2017 13:55:12 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 7E6DAC21E40; Wed, 19 Jul 2017 13:51:54 +0000 (UTC) Received: from mail-pf0-f195.google.com (mail-pf0-f195.google.com [209.85.192.195]) by lists.denx.de (Postfix) with ESMTPS id 9D982C21E4D for ; Wed, 19 Jul 2017 13:51:50 +0000 (UTC) Received: by mail-pf0-f195.google.com with SMTP id e199so105551pfh.0 for ; Wed, 19 Jul 2017 06:51:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=TFsK+Y4QdnTB+ZkToMHfI4fqPYpHXJCnONFokRFKKLE=; b=nE0qo78ccF0u6IGSlCfpL7jGoXGMXf/O8Eu2kUtEWyqVsBAba5NsftLpawT1sr2cNd OJIUwc13tmL2ZwmxCqG5PwbCJrY4olCYNrlH+P4bwx6vjMUa+pxY4iyY4n6GaLGMV9Z8 Xd3fgObkYKpufea8id6nuzWQfGmB3ehcQ1T3OkQyhWp/EPioMefelf3hq6AZUWse8YP4 0tRIV8Ura/f0qevsgUdLscl2+ErHXT6gm9m6gZbMIxU2096o/ic9e9B4V7gSVZgwOvko AXH5quXEpNYlKUygWDw3qW11Pts8GJWJrKDo+XtZztUb47HQexK3fgz6fBqxz+j6gO9d 4rKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=TFsK+Y4QdnTB+ZkToMHfI4fqPYpHXJCnONFokRFKKLE=; b=OYlB8vRqtPG7Cnrqg0DgMP9ma+QMovMcfWm51ZOo37RF99VJRlDbxLJgnyDRsAvdYf 81jY1UG2BtFnQWA2bAOeOtfxmBNx3wSbl/mKU7mTIuZ61HIhhdQh3x+mIgvXUgj7BSzt OIbSaL9kjPJB/NJk1/rzyWCfaoyqDCreCMlw0szRBUWb6NwIJ6dd9O3WPGltmstbE+RT Ls8nR52otW+ck4mvR9iLb39ulHX7kBWmfskAy+N4LRJtsJTc6mr9ANhrHLC2/ITdi8CN Gyev7LmdLL4027N4c/5RCxK8gXowEwDC4ySNmBiTrmgilQdOsLBwYN3yFlr33inJIGA9 Q6uw== X-Gm-Message-State: AIVw111PgmMx+WpzjmHXnU5rZZlAbRFzEFWRyAWf3hOh4hNCQDZWqAjx Oz7NAz724ZM0BQ== X-Received: by 10.99.44.68 with SMTP id s65mr137762pgs.101.1500472309340; Wed, 19 Jul 2017 06:51:49 -0700 (PDT) Received: from pek-cc-pb03l.wrs.com ([106.120.101.38]) by smtp.gmail.com with ESMTPSA id r64sm189971pfj.62.2017.07.19.06.51.47 (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 19 Jul 2017 06:51:48 -0700 (PDT) From: Bin Meng To: Marek Vasut , U-Boot Mailing List Date: Wed, 19 Jul 2017 21:51:14 +0800 Message-Id: <1500472281-15554-9-git-send-email-bmeng.cn@gmail.com> X-Mailer: git-send-email 1.8.2.1 In-Reply-To: <1500472281-15554-1-git-send-email-bmeng.cn@gmail.com> References: <1500472281-15554-1-git-send-email-bmeng.cn@gmail.com> Cc: Stefan Roese Subject: [U-Boot] [PATCH v3 08/15] usb: xhci: Change xhci_setup_addressable_virt_dev() signature X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" For future extension, change xhci_setup_addressable_virt_dev() signature to accept a pointer to 'struct usb_device', instead of its members slot_id & speed, as the struct already contains these two plus some other useful information of the device. Signed-off-by: Bin Meng Reviewed-by: Simon Glass --- Changes in v3: None Changes in v2: None drivers/usb/host/xhci-mem.c | 6 ++++-- drivers/usb/host/xhci.c | 3 +-- drivers/usb/host/xhci.h | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index 12e277a..9aa3092 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c @@ -713,14 +713,16 @@ void xhci_slot_copy(struct xhci_ctrl *ctrl, struct xhci_container_ctx *in_ctx, * @param udev pointer to the Device Data Structure * @return returns negative value on failure else 0 on success */ -void xhci_setup_addressable_virt_dev(struct xhci_ctrl *ctrl, int slot_id, - int speed, int hop_portnr) +void xhci_setup_addressable_virt_dev(struct xhci_ctrl *ctrl, + struct usb_device *udev, int hop_portnr) { struct xhci_virt_device *virt_dev; struct xhci_ep_ctx *ep0_ctx; struct xhci_slot_ctx *slot_ctx; u32 port_num = 0; u64 trb_64 = 0; + int slot_id = udev->slot_id; + int speed = udev->speed; virt_dev = ctrl->devs[slot_id]; diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 0c88980..336613f 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -415,8 +415,7 @@ static int xhci_address_device(struct usb_device *udev, int root_portnr) * so setting up the slot context. */ debug("Setting up addressable devices %p\n", ctrl->dcbaa); - xhci_setup_addressable_virt_dev(ctrl, udev->slot_id, udev->speed, - root_portnr); + xhci_setup_addressable_virt_dev(ctrl, udev, root_portnr); ctrl_ctx = xhci_get_input_control_ctx(virt_dev->in_ctx); ctrl_ctx->add_flags = cpu_to_le32(SLOT_FLAG | EP0_FLAG); diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index b9602ba..cdce67c 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -1247,8 +1247,8 @@ void xhci_endpoint_copy(struct xhci_ctrl *ctrl, void xhci_slot_copy(struct xhci_ctrl *ctrl, struct xhci_container_ctx *in_ctx, struct xhci_container_ctx *out_ctx); -void xhci_setup_addressable_virt_dev(struct xhci_ctrl *ctrl, int slot_id, - int speed, int hop_portnr); +void xhci_setup_addressable_virt_dev(struct xhci_ctrl *ctrl, + struct usb_device *udev, int hop_portnr); void xhci_queue_command(struct xhci_ctrl *ctrl, u8 *ptr, u32 slot_id, u32 ep_index, trb_type cmd); void xhci_acknowledge_event(struct xhci_ctrl *ctrl);