From: "Sid Spry" <sid@aeam.us>
To: "Peter Chen" <peter.chen@nxp.com>, "Felipe Balbi" <balbi@kernel.org>
Cc: "linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: Re: Documentation for Raw USB ConfigFS
Date: Thu, 14 May 2020 11:32:35 -0500 [thread overview]
Message-ID: <6cab4113-b4ad-43d9-85fc-f68682cf0259@www.fastmail.com> (raw)
In-Reply-To: <20200513100614.GA3698@b29397-desktop>
On Wed, May 13, 2020, at 5:05 AM, Peter Chen wrote:
> On 20-05-13 10:36:05, Felipe Balbi wrote:
> >
> > Hi,
> >
> > "Sid Spry" <sid@aeam.us> writes:
> >
> > > Hi Peter, thanks for pointing me towards the ffs-test. Unfortunately after
> > > some exploration in that area I still don't see how I would add a preexisting
> > > function to the configuration to be handled by the kernel.
> > >
> > > I do see something in an AIO test in the host code where libusb is used to
> > > bind a kernel driver to an endpoint. Is that something that will be necessary?
> > > Device side, I'm still unsure how I tell the function to handle ECM/ethernet
> > > on a collection of endpoints.
> > >
> > > I understand how USB works fairly well, especially on microcontrollers, but am
> > > a little lost still in understanding the Linux machinery for USB.
> >
>
> Would you please let ECM gadget work first at your board, then let f_fs work
> using test application (you need to compile both host and device
> application for it). After that, you may have more precise concept for
> Linux USB gadget framework.
>
I don't see anything that harmonizes preexsting function usage with specifying custom endpoints.
I've gotten the ECM gadget, and then the ECM gadget via ffs working. I've read through the ffs test but I don't see any way to assign functionality to the endpoints. The example seems to transport raw data via a bulk endpoint. I know enough to instead assign an isochronous endpoint to the UDC and transfer via that, but I don't want it to be the *only* functionality the device offers.
Are you saying I can assign the ECM gadget via ffs and then add another driver after the fact? This isn't really spelled out in the documentation (from what I can see). I was operating under the assumption that assigning the UDC claims it and it's not a shared resource. I've already run into issues where certain configurations use up the available endpoints or cause other issues.
For reference here is what I am currently doing:
---
modprobe g_ffs
cd /sys/kernel/config/usb_gadget
if [[ -d "g1" ]]; then
echo "" > UAC
rm -rf g1;
fi
mkdir g1
cd g1
echo "0x1d6b" > idVendor
echo "0x0104" > idProduct
mkdir strings/0x409
echo "0000000000" > strings/0x409/serialnumber
echo "Foo Bar Inc." > strings/0x409/manufacturer
echo "Trololololo" > strings/0x409/product
mkdir functions/ecm.usb0
mkdir functions/uac2.dev0
mkdir functions/midi.dev0
mkdir configs/c.1
ln -s functions/ecm.usb0 configs/c.1
ln -s functions/uac2.dev0 configs/c.1
ln -s functions/midi.dev0 configs/c.1
echo "musb-hdrc.2.auto" > UDC
next prev parent reply other threads:[~2020-05-14 16:33 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-30 17:08 Documentation for Raw USB ConfigFS Sid Spry
2020-05-06 9:17 ` Peter Chen
2020-05-12 15:14 ` Sid Spry
2020-05-13 7:36 ` Felipe Balbi
2020-05-13 10:05 ` Peter Chen
2020-05-14 16:32 ` Sid Spry [this message]
2020-05-15 1:05 ` Peter Chen
2020-05-16 5:57 ` Sid Spry
2020-05-18 5:48 ` Peter Chen
2020-05-18 22:14 ` Sid Spry
2020-05-18 23:58 ` Peter Chen
2020-05-19 19:12 ` Sid Spry
2020-05-19 19:40 ` Sid Spry
2020-05-19 19:51 ` Krzysztof Opasiak
2020-05-20 5:27 ` Sid Spry
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=6cab4113-b4ad-43d9-85fc-f68682cf0259@www.fastmail.com \
--to=sid@aeam.us \
--cc=balbi@kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=peter.chen@nxp.com \
/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).