深入理解 Linux 配置/构建系统

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值