Kconfig 和 menuconfig界面的对应关系:
U-Boot 2019.10 Configuration
Device Drivers --->
[*] USB support --->
*** USB peripherals ***
[*] USB Gadget Support --->
[*] USB Ethernet Gadget
USB Ethernet Gadget Model (RNDIS Protocol) --->
(X) RNDIS Protocol
上面没进入一级菜单项,就对应的读取一个新的Kconfig文件。
对应的Kconfig文件类容:
drivers/Kconfig :
menu "Device Drivers"
source "drivers/usb/Kconfig"
drivers/usb/Kconfig:
bool "USB support"
comment "USB peripherals" #注释行
... ...
source "drivers/usb/gadget/Kconfig"
drivers/usb/gadget/Kconfig类容:
menuconfig USB_GADGET
bool "USB Gadget Support" #选择项
help
USB is a master ...
if USB_GADGET
config USB_ETHER
bool "USB Ethernet Gadget"
depends on NET
default y if ARCH_SUNXI && USB_MUSB_GADGET
help
Creates an Ethernet network device through a USB peripheral ...
if USB_ETHER
choice
prompt "USB Ethernet Gadget Model" #二选一,USB_ETH_CDC/USB_ETH_RNDIS
default USB_ETH_RNDIS
help
There is several models (protocols) to implement Ethernet over USB
devices. The main ones are Microsoft's RNDIS and USB's CDC-Ethernet
(also called CDC-ECM). RNDIS is obviously compatible with Windows,
while CDC-ECM is not. Most other operating systems support both, so
if inter-operability is a concern, RNDIS is to be preferred.
# choice 下的config选项是可供choice选择的
config USB_ETH_CDC
bool "CDC-ECM Protocol"
help
CDC (Communications Device Class) is the standard for Ethernet over
USB devices. While there's several alternatives, the most widely used
protocol is ECM (Ethernet Control Model). However, compatibility with
Windows is not that great.
config USB_ETH_RNDIS
bool "RNDIS Protocol"
help
The RNDIS (Remote Network Driver Interface Specification) is a
Microsoft proprietary protocol to create an Ethernet device over USB.
Windows obviously supports it, as well as all the major operating
systems, so it's the best option for compatibility.
endchoice
endif # USB_ETHER
endif # USB_GADGET
参考:深入理解 Linux 配置/构建系统是如何工作的https://linux.cn/article-11227-1.html