USB gadget驱动上层驱动如何加载?

发布于 2025-01-11 13:27:41 字数 297 浏览 6 评论 0原文

我的嵌入式 Linux 板具有 USB-Net 小工具功能。我可以从我的主机通过 USB 连接建立以太网。我试图了解 USB 小工具子系统层的不同层如何协同工作。

在设备树中,我可以看到平台特定的 udc 驱动程序,在内核配置中,我可以看到内核驱动程序中启用了 USB Gadget 和以太网 Gadget 支持。据我了解,g_ether 驱动程序是内核的内置部分。

什么配置创建 USB 小工具接口和端点并将其链接到上层驱动程序 (g_ether) 并创建 usb-net 小工具以太网接口? 在哪里定义小工具的usb类函数并加载不同的上层驱动程序?

My embedded linux board has usb-net gadget functionality. From my host computer I am able to establish ethernet over usb connectivity. I am trying to understand how the different layers of the usb gadget subsystem layers work together.

In the device tree, I can see the platform specific udc driver and in the kernel configuration I can see the USB Gadget and Ethernet Gadget support being enabled in the kernel drivers. So as I understand the g_ether driver gets built-in part of the kernel.

What configuration creates the usb gadget interface and endpoint and links it to the upper layer driver (g_ether) and creates the usb-net gadget ethernet interface ?
Where to define the usb class function of the gadget and load a different upper layer driver ?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

咽泪装欢 2025-01-18 13:27:41

我的系统上运行的是 5.10.36 版本的内核。经过一番研究和学习,这是我目前所知道的。
因此,在 Linux 内核构建过程中,我在 menuconfig 中设置了以下选项。

Symbol: USB_ETH [=m]
Prompt: Ethernet Gadget (with CDC Ethernet support)
 Defined at drivers/usb/gadget/Kconfig:628
 Depends on: <choice> && NET
 Location:
   -> Kernel configuration
     -> Device Drivers
       -> USB support (USB_SUPPORT [=y])
         -> USB Gadget Support (USB_GADGET [=y])
           -> USB Gadget Drivers (<choice> [=y])

此配置提供了预定义的 USB 网络设备接口,具有 CDC 以太网支持和所需的端点配置。这个驱动程序是g_ether。
端点配置在文件

drivers->usb->gadget->function->f_ecm.c 

configFS 中预定义,可用于从用户空间级别配置自定义 USB 小工具接口。

I am running version 5.10.36 kernel on my system. After some research and study, this is what I know so far.
So during linux kernel build, I have following option setup in menuconfig.

Symbol: USB_ETH [=m]
Prompt: Ethernet Gadget (with CDC Ethernet support)
 Defined at drivers/usb/gadget/Kconfig:628
 Depends on: <choice> && NET
 Location:
   -> Kernel configuration
     -> Device Drivers
       -> USB support (USB_SUPPORT [=y])
         -> USB Gadget Support (USB_GADGET [=y])
           -> USB Gadget Drivers (<choice> [=y])

This configuration gives a predefined USB net gadget interface with CDC ethernet support and required end-point configuration. This driver is g_ether.
The end point configuration is predefined in the file

drivers->usb->gadget->function->f_ecm.c 

configFS can be used to configure a custom usb gadget interface from the user-space level.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文