Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2686364pxb; Tue, 19 Jan 2021 03:41:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJy9mKKJMQynP2tTDrL0lQgh9iW52G+jdPafAbsBf4q9os6vhFZAfHR32I72W7g/1ag7M1SB X-Received: by 2002:aa7:db4e:: with SMTP id n14mr3018962edt.101.1611056492159; Tue, 19 Jan 2021 03:41:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611056492; cv=none; d=google.com; s=arc-20160816; b=McZ8hMe7JAt6UOgdI0kN8MbbK6Frf6oqoD7pW6s9fugw+L+hAMAHV3wTLnMtNT5K4J hunZzwdB3ll7hzqtE1IuBLpyXdvUGv1IjnU1jj8UdJKCVBv19bNRwrw2sfv0A6XdiEmL 4Ro0BULiAfooxIhI3lbc3vh5DIJnW/0FtyBY2A6AgzutJ068tmEGFPU3tUHUBJD0al40 N0Md5EKzmRAg+C06CBQHNAM8MDWC6UxePSCq45Xx/LLYFKwVEzocR0bRnp30sM8/fdEq xlSAHGpJoGtb4JtJInL+yVczyh4ffYmI3TWUKdGI1ABiYWjgMcheefqld6u49xabFJQq kMDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:sender:dkim-signature; bh=BcPoYEbdIYyM8L8hAhQ7ZZD170CnJQ01Heu1vKTFsss=; b=o9e4oDKdXiAQzXCMFpJWQ9lUBnpbN0VVthKnIWdrqoU/+XGI1c2hpmQce4I2Rs8oDK pq5+dXl8g3z13VdFCF4RmbksPryLwyyHQbqrErdyNm+dASJ/6cn14cCVXHRWPxDqh0Ci USwFWU6sWg0E2S4YVpO9jdJTSUvOt3UIMgC64E3UpjhmzmUXi7WCT5dAPvHWJsXgIWwd YsV1uXki7rVBqKA7/jKz2aqRccm2Yxgdf0llkI3z6b8fFuaEcfCNYQMAmGh5Y7Akdo7w 5yBqw4mgOkUZ8qqON3mMUBPJi8JehwLs2gQjB7HD/XHWxgAHLgg73LGIAsnqzEmnBlFE skWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=D9fyG4LJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p31si5354943edd.505.2021.01.19.03.39.59; Tue, 19 Jan 2021 03:41:32 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=D9fyG4LJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404200AbhASKeU (ORCPT + 99 others); Tue, 19 Jan 2021 05:34:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389149AbhASKNF (ORCPT ); Tue, 19 Jan 2021 05:13:05 -0500 Received: from mail-qk1-x749.google.com (mail-qk1-x749.google.com [IPv6:2607:f8b0:4864:20::749]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 812DAC061575 for ; Tue, 19 Jan 2021 02:12:24 -0800 (PST) Received: by mail-qk1-x749.google.com with SMTP id l138so19688459qke.4 for ; Tue, 19 Jan 2021 02:12:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=BcPoYEbdIYyM8L8hAhQ7ZZD170CnJQ01Heu1vKTFsss=; b=D9fyG4LJqOzR0b1Nb7kKUNMQjqR37zsPPSq6cWgywvRFNX+bsd5Hw9DpESDF1e6QZy copoF54mllDVMx7zq7x8SSCSRrDticTfSiZUazhWQUUpn8+cCCGefIH4jz/ZCwuAwe4x RCtuo/yVBqwnFBojFsNIC8cCoNLq7Vs34nfiNUpaBaaHKZGkpkG1HdirEla6Glgox1OW gVZk+rxOA/ibk/V8aS1JEsfXjhupQhS8pjk0kxw2E3nJppUmXmleexR19+cM1LU/RzlC nHx+842pBCrGXanuDNznserDO6Vq4sDDorTu6ccLwVa9zERO3AADhtU7MPVMSYbZLJkB Upyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=BcPoYEbdIYyM8L8hAhQ7ZZD170CnJQ01Heu1vKTFsss=; b=VXFicbb8H9caAVytcaIkpqm9IBf3UXxr1pBCkj1lhlqrxYwKp9oXkhoy5liQTz7fJ7 rTCgKefow/SuvRsxlcFJDVAIezUVst2cuQd80T5O//AI52GViIMmjZU2gtlf/6/ZxxLh YXTJCZeLO3YB+XNp+YEkCBF2kcXSuuBjsHIlq4f5kcZleg3WB1svGyevx1rEXw/SMas7 Z2qq+E1/Rqjy/PDiqB7kt2EJRUo1MhzdpACShoNQjRQv6w5Wqo0byZGAqsMD/HnHtM0p HI12rutNPD+LtZOCo1+0A+448fR9rSx0pHiHZAXqqbP0dHjuLguA60MYYjCcmM0Bbv2w ldgQ== X-Gm-Message-State: AOAM531fYAay82FaOPnIRYhpJvH2rgRAZ1CkikslJOnaVZi2mDNiMxp9 Q0lIMHOG0gewG/Dwb8gzaLTnEB8RxehfYH4= Sender: "howardyen via sendgmr" X-Received: from howardyen.ntc.corp.google.com ([2401:fa00:fc:202:5d06:ba6f:6a89:a201]) (user=howardyen job=sendgmr) by 2002:a0c:d403:: with SMTP id t3mr3780313qvh.4.1611051143686; Tue, 19 Jan 2021 02:12:23 -0800 (PST) Date: Tue, 19 Jan 2021 18:10:42 +0800 In-Reply-To: <20210119101044.1637023-1-howardyen@google.com> Message-Id: <20210119101044.1637023-3-howardyen@google.com> Mime-Version: 1.0 References: <20210119101044.1637023-1-howardyen@google.com> X-Mailer: git-send-email 2.30.0.284.gd98b1dd5eaa7-goog Subject: [PATCH 2/4] usb: host: export symbols for xhci hooks usage From: Howard Yen To: gregkh@linuxfoundation.org, robh+dt@kernel.org, mathias.nyman@intel.com Cc: linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Howard Yen Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Export symbols for xhci hooks usage: xhci_ring_free - Allow xhci hook to free xhci_ring. xhci_get_slot_ctx - Allow xhci hook to get slot_ctx from the xhci_container_ctx for getting the slot_ctx information to know which slot is offloading and compare the context in remote subsystem memory if needed. xhci_get_ep_ctx - Allow xhci hook to get ep_ctx from the xhci_container_ctx for getting the ep_ctx information to know which ep is offloading and comparing the context in remote subsystem memory if needed. xhci_handle_event - Allow xhci hook to handle the xhci events from the USB controller. xhci_update_erst_dequeue - If xhci events was handle by xhci hook, it needs to update the erst dequeue pointer to let the USB controller know the events was handled. Signed-off-by: Howard Yen --- drivers/usb/host/xhci-mem.c | 3 +++ drivers/usb/host/xhci-ring.c | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index f3dbc5956290..69f19774b914 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c @@ -289,6 +289,7 @@ void xhci_ring_free(struct xhci_hcd *xhci, struct xhci_ring *ring) kfree(ring); } +EXPORT_SYMBOL_GPL(xhci_ring_free); static void xhci_initialize_ring_info(struct xhci_ring *ring, unsigned int cycle_state) @@ -545,6 +546,7 @@ struct xhci_slot_ctx *xhci_get_slot_ctx(struct xhci_hcd *xhci, return (struct xhci_slot_ctx *) (ctx->bytes + CTX_SIZE(xhci->hcc_params)); } +EXPORT_SYMBOL_GPL(xhci_get_slot_ctx); struct xhci_ep_ctx *xhci_get_ep_ctx(struct xhci_hcd *xhci, struct xhci_container_ctx *ctx, @@ -558,6 +560,7 @@ struct xhci_ep_ctx *xhci_get_ep_ctx(struct xhci_hcd *xhci, return (struct xhci_ep_ctx *) (ctx->bytes + (ep_index * CTX_SIZE(xhci->hcc_params))); } +EXPORT_SYMBOL_GPL(xhci_get_ep_ctx); /***************** Streams structures manipulation *************************/ diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index bfd653a1e5f6..f3b387e2fcb3 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -2717,7 +2717,7 @@ static int handle_tx_event(struct xhci_hcd *xhci, * Returns >0 for "possibly more events to process" (caller should call again), * otherwise 0 if done. In future, <0 returns should indicate error code. */ -static int xhci_handle_event(struct xhci_hcd *xhci) +int xhci_handle_event(struct xhci_hcd *xhci) { union xhci_trb *event; int update_ptrs = 1; @@ -2786,13 +2786,14 @@ static int xhci_handle_event(struct xhci_hcd *xhci) */ return 1; } +EXPORT_SYMBOL_GPL(xhci_handle_event); /* * Update Event Ring Dequeue Pointer: * - When all events have finished * - To avoid "Event Ring Full Error" condition */ -static void xhci_update_erst_dequeue(struct xhci_hcd *xhci, +void xhci_update_erst_dequeue(struct xhci_hcd *xhci, union xhci_trb *event_ring_deq) { u64 temp_64; @@ -2822,6 +2823,7 @@ static void xhci_update_erst_dequeue(struct xhci_hcd *xhci, temp_64 |= ERST_EHB; xhci_write_64(xhci, temp_64, &xhci->ir_set->erst_dequeue); } +EXPORT_SYMBOL_GPL(xhci_update_erst_dequeue); static irqreturn_t xhci_vendor_queue_irq_work(struct xhci_hcd *xhci) { -- 2.30.0.284.gd98b1dd5eaa7-goog