From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0A98EC433F5 for ; Sat, 11 Sep 2021 14:40:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D654B611CC for ; Sat, 11 Sep 2021 14:40:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229901AbhIKOlk (ORCPT ); Sat, 11 Sep 2021 10:41:40 -0400 Received: from mail.msweet.org ([173.255.209.91]:49606 "EHLO mail.msweet.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229643AbhIKOlk (ORCPT ); Sat, 11 Sep 2021 10:41:40 -0400 X-Greylist: delayed 534 seconds by postgrey-1.27 at vger.kernel.org; Sat, 11 Sep 2021 10:41:40 EDT Received: from smtpclient.apple (unknown [135.129.115.168]) by mail.msweet.org (Postfix) with ESMTPSA id 07EF2803B1; Sat, 11 Sep 2021 14:31:31 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 mail.msweet.org 07EF2803B1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=msweet.org; s=default; t=1631370692; bh=Nk4yW8o7fGfCyZZFbozVwzOS92fZC4GClCHPKEX2E34=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=mhf4SO7OwcrE5pv/RU1dBxzhbHxJCA7grGerRfuvF+XCAmb3MwDBi//ivvqaiYvqA ZGFqZoDEH5k2nCZfPI9bQJSZnv+GUXmYIVZS/ruZ5bMNyf71BYfKLL5oKZatmlIbhO nEf9XRuV6ccpE79gyepwXvJSTcIS8btkCZzTYjuE= Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 15.0 \(3693.0.1.1.10\)) Subject: Re: How to register a new "function" in configfs? From: Michael Sweet In-Reply-To: Date: Sat, 11 Sep 2021 10:31:29 -0400 Cc: linux-usb@vger.kernel.org Content-Transfer-Encoding: quoted-printable Message-Id: References: To: Ajay Garg X-Mailer: Apple Mail (2.3693.0.1.1.10) Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Ajay, Quick question (as someone who has been down this road), do you need to = do a kernel driver or could you just use the functionfs support to = implement everything in userspace? I found that path to be much easier = and less error-prone (and one of these days I'm going to be contributing = some documentation changes to make some things clearer...) and I was = able to get my IPP-USB implementation up and running very quickly. > On Sep 11, 2021, at 1:43 AM, Ajay Garg wrote: >=20 > Hi All. >=20 > As a first step, I have been able to load a gadget on configfs, which > binds to the function "gser" (thus loading up the usb_f_serial module > when the gadget mounts). Things work well till here. >=20 > Now, I have written a brand-new gadget-side device-driver, trying to > create a new function "gusb", via DECLARE_USB_FUNCTION_INIT. > However, now when I try to load the gadget for binding to "gusb", I > get the error that the function cannot be found. >=20 > Seems that firing up a new gadget-side driver, that registers a new > function via DECLARE_USB_FUNCTION_INIT, is not enough to make the new > function visible across the kernel. >=20 > Kindly let know what I am missing. > Will be grateful for pointers. >=20 >=20 > Thanks and Regards, > Ajay >=20 ________________________ Michael Sweet