linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Sweet <msweet@msweet.org>
To: Ajay Garg <ajaygargnsit@gmail.com>
Cc: linux-usb@vger.kernel.org
Subject: Re: How to register a new "function" in configfs?
Date: Sat, 11 Sep 2021 10:31:29 -0400	[thread overview]
Message-ID: <CE84D77A-93F8-43B2-A952-896D6BED2E6D@msweet.org> (raw)
In-Reply-To: <CAHP4M8Vc+0eChmJDnLLa3ibuzGLOnc5hJ1Nk09794RHEJ7tEPw@mail.gmail.com>

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 <ajaygargnsit@gmail.com> wrote:
> 
> Hi All.
> 
> 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.
> 
> 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.
> 
> 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.
> 
> Kindly let know what I am missing.
> Will be grateful for pointers.
> 
> 
> Thanks and Regards,
> Ajay
> 

________________________
Michael Sweet




  reply	other threads:[~2021-09-11 14:40 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-11  5:43 How to register a new "function" in configfs? Ajay Garg
2021-09-11 14:31 ` Michael Sweet [this message]
2021-09-11 14:58   ` Ajay Garg
2021-09-15 14:54     ` Ajay Garg
     [not found]     ` <CAHP4M8W-z_L3r0kDbW943A6hm9y3gXzYJd=ZOpi+w9okS1zaaQ@mail.gmail.com>
2021-09-17 14:17       ` Michael Sweet
2021-09-17 15:25         ` Ajay Garg
2021-09-18  7:30           ` Ajay Garg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CE84D77A-93F8-43B2-A952-896D6BED2E6D@msweet.org \
    --to=msweet@msweet.org \
    --cc=ajaygargnsit@gmail.com \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).