Skip to contentSkip to conversation

reorganize USB submenu's

PATCH In review Stephen Hemminger 4 participants 10 messages Jul 31, 2003 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 reorganize USB submenu's

The USB configuration menu's in 2.6 are a mismash of sub-menu's and comments. This patch tries to rationalize it so it comes out looking more like the current filesystems menus.

I think it is easier to navigate, there should be no functional change from this. Though some elements may appear/disappear differently based on earlier choices.

drivers/usb/Kconfig +2 -5
diff -Nru a/drivers/usb/Kconfig b/drivers/usb/Kconfig
@@ -44,18 +44,15 @@
 
 source "drivers/usb/class/Kconfig"
 
-source "drivers/usb/storage/Kconfig"
-
 source "drivers/usb/input/Kconfig"
 
+source "drivers/usb/storage/Kconfig"
+
 source "drivers/usb/image/Kconfig"
 
 source "drivers/usb/media/Kconfig"
 
 source "drivers/usb/net/Kconfig"
-
-comment "USB port drivers"
-	depends on USB
 
 config USB_USS720
 	tristate "USS720 parport driver"
drivers/usb/class/Kconfig +0 -3
diff -Nru a/drivers/usb/class/Kconfig b/drivers/usb/class/Kconfig
@@ -1,9 +1,6 @@
 #
 # USB Class driver configuration
 #
-comment "USB Device Class drivers"
-	depends on USB
-
 config USB_AUDIO
 	tristate "USB Audio support"
 	depends on USB && SOUND
drivers/usb/core/Kconfig +0 -3
diff -Nru a/drivers/usb/core/Kconfig b/drivers/usb/core/Kconfig
@@ -9,9 +9,6 @@
 	  of debug messages to the system log. Select this if you are having a
 	  problem with USB support and want to see more of what is going on.
 
-comment "Miscellaneous USB options"
-	depends on USB
-
 config USB_DEVICEFS
 	bool "USB device filesystem"
 	depends on USB
drivers/usb/gadget/Kconfig +6 -3
diff -Nru a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
@@ -6,9 +6,12 @@
 # for 2.5 kbuild, drivers/usb/gadget/Kconfig
 # source this at the end of drivers/usb/Kconfig
 #
-menuconfig USB_GADGET
+menu "USB Gadgets"
+	depends on USB!=n
+
+config USB_GADGET
 	tristate "Support for USB Gadgets"
-	depends on EXPERIMENTAL
+	depends on USB && EXPERIMENTAL
 	help
 	   USB is a master/slave protocol, organized with one master
 	   host (such as a PC) controlling up to 127 peripheral devices.
@@ -149,4 +152,4 @@
 
 endchoice
 
-# endmenuconfig
+endmenu
drivers/usb/host/Kconfig +0 -2
diff -Nru a/drivers/usb/host/Kconfig b/drivers/usb/host/Kconfig
@@ -1,8 +1,6 @@
 #
 # USB Host Controller Drivers
 #
-comment "USB Host Controller Drivers"
-	depends on USB
 
 config USB_EHCI_HCD
 	tristate "EHCI HCD (USB 2.0) support"
drivers/usb/image/Kconfig +2 -1
diff -Nru a/drivers/usb/image/Kconfig b/drivers/usb/image/Kconfig
@@ -1,7 +1,7 @@
 #
 # USB Imageing devices configuration
 #
-comment "USB Imaging devices"
+menu "USB Imaging devices"
 	depends on USB
 
 config USB_MDC800
@@ -53,3 +53,4 @@
 	  The scanner will be accessible as a SCSI device.
 	  This can be compiled as a module, called hpusbscsi.
 
+endmenu
drivers/usb/input/Kconfig +7 -8
diff -Nru a/drivers/usb/input/Kconfig b/drivers/usb/input/Kconfig
@@ -1,8 +1,10 @@
 #
 # USB Input driver configuration
 #
-comment "USB Human Interface Devices (HID)"
-	depends on USB
+menu "USB Input devices"
+
+comment "Input core support is needed for USB HID input layer or HIDBP support"
+	depends on USB && INPUT=n
 
 config USB_HID
 	tristate "USB Human Interface Device (full HID) support"
@@ -90,12 +92,10 @@
 
 	  If unsure, say Y.
 
-menu "USB HID Boot Protocol drivers"
-	depends on USB!=n && USB_HID!=y
 
 config USB_KBD
 	tristate "USB HIDBP Keyboard (simple Boot) support"
-	depends on USB && INPUT
+	depends on USB && INPUT && USB_HIDINPUT=n
 	---help---
 	  Say Y here only if you are absolutely sure that you don't want
 	  to use the generic HID driver for your USB keyboard and prefer
@@ -113,7 +113,7 @@
 
 config USB_MOUSE
 	tristate "USB HIDBP Mouse (simple Boot) support"
-	depends on USB && INPUT
+	depends on USB && INPUT && USB_HIDINPUT=n
 	---help---
 	  Say Y here only if you are absolutely sure that you don't want
 	  to use the generic HID driver for your USB keyboard and prefer
@@ -129,8 +129,6 @@
 
 	  If even remotely unsure, say N.
 
-endmenu
-
 config USB_AIPTEK
 	tristate "Aiptek 6000U/8000U tablet support"
 	depends on USB && INPUT
@@ -205,3 +203,4 @@
 	  The module will be called xpad.  If you want to compile it as a
 	  module, say M here and read <file:Documentation/modules.txt>.
 
+endmenu
drivers/usb/media/Kconfig +2 -2
diff -Nru a/drivers/usb/media/Kconfig b/drivers/usb/media/Kconfig
@@ -1,8 +1,7 @@
 #
 # USB Multimedia device configuration
 #
-comment "USB Multimedia devices"
-	depends on USB
+menu "USB Multimedia devices"
 
 config USB_DABUSB
 	tristate "DABUSB driver"
@@ -194,3 +193,4 @@
 	  The module will be called stv680. If you want to compile it as a
 	  module, say M here and read <file:Documentation/modules.txt>.
 
+endmenu
drivers/usb/misc/Kconfig +3 -3
diff -Nru a/drivers/usb/misc/Kconfig b/drivers/usb/misc/Kconfig
@@ -1,8 +1,8 @@
 #
 # USB Miscellaneous driver configuration
 #
-comment "USB Miscellaneous drivers"
-	depends on USB
+menu "USB Miscellaneous drivers"
+	depends on USB!=n
 
 config USB_EMI26
 	tristate "EMI 2|6 USB Audio interface support"
@@ -117,4 +117,4 @@
 
 	  See <http://www.linux-usb.org/usbtest> for more information,
 	  including sample test device firmware and "how to use it".
-
+endmenu
drivers/usb/net/Kconfig +2 -2
diff -Nru a/drivers/usb/net/Kconfig b/drivers/usb/net/Kconfig
@@ -1,8 +1,7 @@
 #
 # USB Network devices configuration
 #
-comment "USB Network adaptors"
-	depends on USB
+menu "USB Network devices"
 
 comment "Networking support is needed for USB Networking device support"
 	depends on USB && !NET
@@ -266,3 +265,4 @@
 	  IEEE 802 "local assignment" bit is set in the address, a "usbX"
 	  name is used instead.
 
+endmenu
drivers/usb/serial/Kconfig +1 -1
diff -Nru a/drivers/usb/serial/Kconfig b/drivers/usb/serial/Kconfig
@@ -2,7 +2,7 @@
 # USB Serial device configuration
 #
 
-menu "USB Serial Converter support"
+menu "USB Serial drivers"
 	depends on USB!=n
 
 config USB_SERIAL
drivers/usb/storage/Kconfig +3 -1
diff -Nru a/drivers/usb/storage/Kconfig b/drivers/usb/storage/Kconfig
@@ -1,6 +1,8 @@
 #
 # USB Storage driver configuration
 #
+menu "USB Mass Storage"
+
 comment "SCSI support is needed for USB Storage"
 	depends on USB && SCSI=n
 
@@ -91,4 +93,4 @@
 	help
 	  Say Y here to include additional code to support the Lexar Jumpshot
 	  USB CompactFlash reader.
-
+endmenu
#1 lore raw
Quoted 8 lines · Stephen Hemminger

diff -Nru a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig

drivers/usb/gadget/Kconfig +0 -1
@@ -6,9 +6,12 @@
 # for 2.5 kbuild, drivers/usb/gadget/Kconfig
 # source this at the end of drivers/usb/Kconfig
 #
-menuconfig USB_GADGET

drivers/usb/gadget/Kconfig line 17

Quoted 10 lines
drivers/usb/gadget/Kconfig +5 -1
+menu "USB Gadgets"
+	depends on USB!=n
+
+config USB_GADGET
 	tristate "Support for USB Gadgets"
-	depends on EXPERIMENTAL
+	depends on USB && EXPERIMENTAL
 	help
 	   USB is a master/slave protocol, organized with one master
 	   host (such as a PC) controlling up to 127 peripheral devices.

Why do you remove the menuconfig?
USB_GADGET is independent of USB.

Quoted 6 lines

diff -Nru a/drivers/usb/input/Kconfig b/drivers/usb/input/Kconfig

drivers/usb/input/Kconfig +0 -0
@@ -1,8 +1,10 @@
 #
 # USB Input driver configuration

drivers/usb/input/Kconfig line 10

Quoted 10 lines
drivers/usb/input/Kconfig +4 -2
 #
-comment "USB Human Interface Devices (HID)"
-	depends on USB
+menu "USB Input devices"
+
+comment "Input core support is needed for USB HID input layer or HIDBP support"
+	depends on USB && INPUT=n
 
 config USB_HID
 	tristate "USB Human Interface Device (full HID) support"

The menu needs to depend on USB otherwise you'll have empty menus if USB is disabled (the same is true for storage/media/net).

bye, Roman

#2 lore raw
In reply to Stephen Hemminger
Quoted 35 lines · Stephen Hemminger

The USB configuration menu's in 2.6 are a mismash of sub-menu's and comments. This patch tries to rationalize it so it comes out looking more like the current filesystems menus.

I think it is easier to navigate, there should be no functional change from this. Though some elements may appear/disappear differently based on earlier choices.

diff -Nru a/drivers/usb/Kconfig b/drivers/usb/Kconfig

drivers/usb/Kconfig +2 -5
@@ -44,18 +44,15 @@
 
 source "drivers/usb/class/Kconfig"
 
-source "drivers/usb/storage/Kconfig"
-
 source "drivers/usb/input/Kconfig"
 
+source "drivers/usb/storage/Kconfig"
+
 source "drivers/usb/image/Kconfig"
 
 source "drivers/usb/media/Kconfig"
 
 source "drivers/usb/net/Kconfig"
-
-comment "USB port drivers"
-	depends on USB
 
 config USB_USS720
 	tristate "USS720 parport driver"

diff -Nru a/drivers/usb/class/Kconfig b/drivers/usb/class/Kconfig

drivers/usb/class/Kconfig line 6

Quoted 6 lines
drivers/usb/class/Kconfig +0 -3
@@ -1,9 +1,6 @@
 #
 # USB Class driver configuration
 #
-comment "USB Device Class drivers"
-	depends on USB
-

Why remove these seperators? They seem to be useful, as they were added to help remove the clutter we have.

drivers/usb/class/Kconfig

Quoted 8 lines
drivers/usb/class/Kconfig +5 -2
-menuconfig USB_GADGET
+menu "USB Gadgets"
+	depends on USB!=n
+
+config USB_GADGET
 	tristate "Support for USB Gadgets"
-	depends on EXPERIMENTAL
+	depends on USB && EXPERIMENTAL

Nope, USB_GADGET does not depend on USB at all.

drivers/usb/class/Kconfig

Quoted 7 lines
drivers/usb/class/Kconfig +1 -3
-menu "USB HID Boot Protocol drivers"
-	depends on USB!=n && USB_HID!=y
 
 config USB_KBD
 	tristate "USB HIDBP Keyboard (simple Boot) support"
-	depends on USB && INPUT
+	depends on USB && INPUT && USB_HIDINPUT=n

Nope, I can build USB_KBD and USB_HIDINPUT as modules at the same time. This breaks that ability.

drivers/usb/class/Kconfig

Quoted 4 lines

config USB_MOUSE

drivers/usb/class/Kconfig +1 -1
 	tristate "USB HIDBP Mouse (simple Boot) support"
-	depends on USB && INPUT
+	depends on USB && INPUT && USB_HIDINPUT=n

Same thing here.

drivers/usb/class/Kconfig

Quoted 3 lines
drivers/usb/class/Kconfig +1 -2
-comment "USB Multimedia devices"
-	depends on USB
+menu "USB Multimedia devices"

I don't really see a nest of menu options as a better option from the separators we have today. But that's just my opinion :)

drivers/usb/class/Kconfig

Quoted 4 lines
drivers/usb/class/Kconfig +2 -2
-comment "USB Miscellaneous drivers"
-	depends on USB
+menu "USB Miscellaneous drivers"
+	depends on USB!=n

Why "USB!=n" What's wrong with just "depends on USB"?

thanks,

greg k-h

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw

Okay, here is a second try.
- Devices in submenus
- Gadget sub-menu fixed now independent of USB
and has correct exposing.
- Gadget was using choice incorrectly, there were cases were if gadget was not a module it would only let you choose one menu item.
- USB serial debugging can be enabled if module

This is against 2.6.0-test2

drivers/usb/gadget/Kconfig +10 -11
diff -urN -X dontdiff linux-2.5/drivers/usb/gadget/Kconfig usb/drivers/usb/gadget/Kconfig
@@ -35,9 +35,6 @@
 #
 # USB Peripheral Controller Support
 #
-choice
-	prompt "USB Peripheral Controller Support"
-	depends on USB_GADGET
 
 config USB_NET2280
 	tristate "NetChip 2280 USB Peripheral Controller"
@@ -54,21 +51,23 @@
 	   dynamically linked module called "net2280" and force all
 	   gadget drivers to also be dynamically linked.
 
-endchoice
 
 #
 # USB Gadget Drivers
 #
-choice
-	prompt "USB Gadget Drivers"
+menu "USB Gadget Drivers"
 	depends on USB_GADGET
-	default USB_ETH
 
-# FIXME want a cleaner dependency/config approach for drivers.
+config USB_GADGET_CONTROL
+	bool
+	default y if USB_GADGET && (USB_DUMMY_HCD || USB_NET2280 || USB_PXA250 || USB_SA1100)
+
+comment "USB Gadgets need peripheral controller"
+	depends on !USB_GADGET_CONTROL
 
 config USB_ZERO
 	tristate "Gadget Zero (DEVELOPMENT)"
-	depends on USB_GADGET && (USB_DUMMY_HCD || USB_NET2280 || USB_PXA250 || USB_SA1100)
+	depends on USB_GADGET_CONTROL
 	help
 	  Gadget Zero is a two-configuration device.  It either sinks and
 	  sources bulk data; or it loops back a configurable number of
@@ -110,7 +109,7 @@
 
 config USB_ETH
 	tristate "Ethernet Gadget"
-	depends on USB_GADGET && (USB_DUMMY_HCD || USB_NET2280 || USB_PXA250 || USB_SA1100)
+	depends on USB_GADGET_CONTROL
 	help
 	  This driver implements the "Communication Device Class" (CDC)
 	  Ethernet Control Model.  That protocol is often avoided with pure
@@ -147,6 +146,6 @@
 	depends on USB_ETH && USB_SA1100
 	default y
 
-endchoice
+endmenu
 
 # endmenuconfig
drivers/usb/image/Kconfig +2 -1
diff -urN -X dontdiff linux-2.5/drivers/usb/image/Kconfig usb/drivers/usb/image/Kconfig
@@ -1,7 +1,7 @@
 #
 # USB Imageing devices configuration
 #
-comment "USB Imaging devices"
+menu "USB Imaging devices"
 	depends on USB
 
 config USB_MDC800
@@ -53,3 +53,4 @@
 	  The scanner will be accessible as a SCSI device.
 	  This can be compiled as a module, called hpusbscsi.
 
+endmenu
drivers/usb/input/Kconfig +5 -8
diff -urN -X dontdiff linux-2.5/drivers/usb/input/Kconfig usb/drivers/usb/input/Kconfig
@@ -1,7 +1,8 @@
 #
 # USB Input driver configuration
 #
-comment "USB Human Interface Devices (HID)"
+
+menu "USB Input devices"
 	depends on USB
 
 config USB_HID
@@ -90,12 +91,9 @@
 
 	  If unsure, say Y.
 
-menu "USB HID Boot Protocol drivers"
-	depends on USB!=n && USB_HID!=y
-
 config USB_KBD
 	tristate "USB HIDBP Keyboard (simple Boot) support"
-	depends on USB && INPUT
+	depends on USB && INPUT && USB_HID!=y
 	---help---
 	  Say Y here only if you are absolutely sure that you don't want
 	  to use the generic HID driver for your USB keyboard and prefer
@@ -113,7 +111,7 @@
 
 config USB_MOUSE
 	tristate "USB HIDBP Mouse (simple Boot) support"
-	depends on USB && INPUT
+	depends on USB && INPUT && USB_HID!=y
 	---help---
 	  Say Y here only if you are absolutely sure that you don't want
 	  to use the generic HID driver for your USB keyboard and prefer
@@ -129,8 +127,6 @@
 
 	  If even remotely unsure, say N.
 
-endmenu
-
 config USB_AIPTEK
 	tristate "Aiptek 6000U/8000U tablet support"
 	depends on USB && INPUT
@@ -205,3 +201,4 @@
 	  The module will be called xpad.  If you want to compile it as a
 	  module, say M here and read <file:Documentation/modules.txt>.
 
+endmenu
drivers/usb/media/Kconfig +2 -1
diff -urN -X dontdiff linux-2.5/drivers/usb/media/Kconfig usb/drivers/usb/media/Kconfig
@@ -1,7 +1,7 @@
 #
 # USB Multimedia device configuration
 #
-comment "USB Multimedia devices"
+menu "USB Multimedia devices"
 	depends on USB
 
 config USB_DABUSB
@@ -194,3 +194,4 @@
 	  The module will be called stv680. If you want to compile it as a
 	  module, say M here and read <file:Documentation/modules.txt>.
 
+endmenu
drivers/usb/misc/Kconfig +2 -2
diff -urN -X dontdiff linux-2.5/drivers/usb/misc/Kconfig usb/drivers/usb/misc/Kconfig
@@ -1,7 +1,7 @@
 #
 # USB Miscellaneous driver configuration
 #
-comment "USB Miscellaneous drivers"
+menu "USB Miscellaneous drivers"
 	depends on USB
 
 config USB_EMI26
@@ -117,4 +117,4 @@
 
 	  See <http://www.linux-usb.org/usbtest> for more information,
 	  including sample test device firmware and "how to use it".
-
+endmenu
drivers/usb/net/Kconfig +2 -1
diff -urN -X dontdiff linux-2.5/drivers/usb/net/Kconfig usb/drivers/usb/net/Kconfig
@@ -1,7 +1,7 @@
 #
 # USB Network devices configuration
 #
-comment "USB Network adaptors"
+menu "USB Network adaptors"
 	depends on USB
 
 comment "Networking support is needed for USB Networking device support"
@@ -266,3 +266,4 @@
 	  IEEE 802 "local assignment" bit is set in the address, a "usbX"
 	  name is used instead.
 
+endmenu
drivers/usb/serial/Kconfig +4 -8
diff -urN -X dontdiff linux-2.5/drivers/usb/serial/Kconfig usb/drivers/usb/serial/Kconfig
@@ -2,10 +2,7 @@
 # USB Serial device configuration
 #
 
-menu "USB Serial Converter support"
-	depends on USB!=n
-
-config USB_SERIAL
+menuconfig  USB_SERIAL
 	tristate "USB Serial Converter support"
 	depends on USB
 	---help---
@@ -24,7 +21,7 @@
 
 config USB_SERIAL_DEBUG
 	bool "USB Serial Converter verbose debug"
-	depends on USB_SERIAL=y
+	depends on USB_SERIAL
 	help
 	  Say Y here if you want verbose debug messages from the USB Serial
 	  Drivers sent to the kernel debug log.
@@ -438,8 +435,7 @@
 
 config USB_EZUSB
 	bool
-	depends on USB_SERIAL_KEYSPAN_PDA || USB_SERIAL_XIRCOM || USB_SERIAL_KEYSPAN || USB_SERIAL_WHITEHEAT
+	depends on USB_SERIAL && (USB_SERIAL_KEYSPAN_PDA || USB_SERIAL_XIRCOM || USB_SERIAL_KEYSPAN || USB_SERIAL_WHITEHEAT)
 	default y
 
-endmenu
-
+# endmenuconfig
drivers/usb/storage/Kconfig +3 -1
diff -urN -X dontdiff linux-2.5/drivers/usb/storage/Kconfig usb/drivers/usb/storage/Kconfig
@@ -1,10 +1,11 @@
 #
 # USB Storage driver configuration
 #
+
 comment "SCSI support is needed for USB Storage"
 	depends on USB && SCSI=n
 
-config USB_STORAGE
+menuconfig USB_STORAGE
 	tristate "USB Mass Storage support"
 	depends on USB && SCSI
 	---help---
@@ -92,3 +93,4 @@
 	  Say Y here to include additional code to support the Lexar Jumpshot
 	  USB CompactFlash reader.
 
+# endmenuconfig
#5 lore raw
Quoted 1 line · Stephen Hemminger

- USB serial debugging can be enabled if module

It can be enabled _only_ if CONFIG_USB_SERIAL=y. If CONFIG_USB_SERIAL=m then the option should not show up, as it becomes a module paramater option. The original code was correct.

drivers/usb/input/Kconfig line 95

Quoted 3 lines
drivers/usb/input/Kconfig +0 -3
-menu "USB HID Boot Protocol drivers"
-	depends on USB!=n && USB_HID!=y
-

No, we _really_ want these tucked away where it is hard to find them. Almost noone should enable these, but if you really want them, you still can. Putting them into their own sub-menu was deemed the best for this.

thanks,

greg k-h

#6 lore raw
Quoted 1 line · On Thu, 31 Jul 2003 13:16:59 -0700 Greg KH <[email protected]> wrote:

then the option should not show up, as it becomes a module paramater

How is this (3rd try)...

drivers/usb/gadget/Kconfig +10 -11
diff -urN -X dontdiff linux-2.5/drivers/usb/gadget/Kconfig usb/drivers/usb/gadget/Kconfig
@@ -35,9 +35,6 @@
 #
 # USB Peripheral Controller Support
 #
-choice
-	prompt "USB Peripheral Controller Support"
-	depends on USB_GADGET
 
 config USB_NET2280
 	tristate "NetChip 2280 USB Peripheral Controller"
@@ -54,21 +51,23 @@
 	   dynamically linked module called "net2280" and force all
 	   gadget drivers to also be dynamically linked.
 
-endchoice
 
 #
 # USB Gadget Drivers
 #
-choice
-	prompt "USB Gadget Drivers"
+menu "USB Gadget Drivers"
 	depends on USB_GADGET
-	default USB_ETH
 
-# FIXME want a cleaner dependency/config approach for drivers.
+config USB_GADGET_CONTROL
+	bool
+	default y if USB_GADGET && (USB_DUMMY_HCD || USB_NET2280 || USB_PXA250 || USB_SA1100)
+
+comment "USB Gadgets need peripheral controller"
+	depends on !USB_GADGET_CONTROL
 
 config USB_ZERO
 	tristate "Gadget Zero (DEVELOPMENT)"
-	depends on USB_GADGET && (USB_DUMMY_HCD || USB_NET2280 || USB_PXA250 || USB_SA1100)
+	depends on USB_GADGET_CONTROL
 	help
 	  Gadget Zero is a two-configuration device.  It either sinks and
 	  sources bulk data; or it loops back a configurable number of
@@ -110,7 +109,7 @@
 
 config USB_ETH
 	tristate "Ethernet Gadget"
-	depends on USB_GADGET && (USB_DUMMY_HCD || USB_NET2280 || USB_PXA250 || USB_SA1100)
+	depends on USB_GADGET_CONTROL
 	help
 	  This driver implements the "Communication Device Class" (CDC)
 	  Ethernet Control Model.  That protocol is often avoided with pure
@@ -147,6 +146,6 @@
 	depends on USB_ETH && USB_SA1100
 	default y
 
-endchoice
+endmenu
 
 # endmenuconfig
drivers/usb/image/Kconfig +2 -1
diff -urN -X dontdiff linux-2.5/drivers/usb/image/Kconfig usb/drivers/usb/image/Kconfig
@@ -1,7 +1,7 @@
 #
 # USB Imageing devices configuration
 #
-comment "USB Imaging devices"
+menu "USB Imaging devices"
 	depends on USB
 
 config USB_MDC800
@@ -53,3 +53,4 @@
 	  The scanner will be accessible as a SCSI device.
 	  This can be compiled as a module, called hpusbscsi.
 
+endmenu
drivers/usb/input/Kconfig +2 -1
diff -urN -X dontdiff linux-2.5/drivers/usb/input/Kconfig usb/drivers/usb/input/Kconfig
@@ -1,7 +1,7 @@
 #
 # USB Input driver configuration
 #
-comment "USB Human Interface Devices (HID)"
+menu "USB Input devices"
 	depends on USB
 
 config USB_HID
@@ -205,3 +205,4 @@
 	  The module will be called xpad.  If you want to compile it as a
 	  module, say M here and read <file:Documentation/modules.txt>.
 
+endmenu
drivers/usb/media/Kconfig +2 -1
diff -urN -X dontdiff linux-2.5/drivers/usb/media/Kconfig usb/drivers/usb/media/Kconfig
@@ -1,7 +1,7 @@
 #
 # USB Multimedia device configuration
 #
-comment "USB Multimedia devices"
+menu "USB Multimedia devices"
 	depends on USB
 
 config USB_DABUSB
@@ -194,3 +194,4 @@
 	  The module will be called stv680. If you want to compile it as a
 	  module, say M here and read <file:Documentation/modules.txt>.
 
+endmenu
drivers/usb/misc/Kconfig +2 -2
diff -urN -X dontdiff linux-2.5/drivers/usb/misc/Kconfig usb/drivers/usb/misc/Kconfig
@@ -1,7 +1,7 @@
 #
 # USB Miscellaneous driver configuration
 #
-comment "USB Miscellaneous drivers"
+menu "USB Miscellaneous drivers"
 	depends on USB
 
 config USB_EMI26
@@ -117,4 +117,4 @@
 
 	  See <http://www.linux-usb.org/usbtest> for more information,
 	  including sample test device firmware and "how to use it".
-
+endmenu
drivers/usb/net/Kconfig +2 -1
diff -urN -X dontdiff linux-2.5/drivers/usb/net/Kconfig usb/drivers/usb/net/Kconfig
@@ -1,7 +1,7 @@
 #
 # USB Network devices configuration
 #
-comment "USB Network adaptors"
+menu "USB Network adaptors"
 	depends on USB
 
 comment "Networking support is needed for USB Networking device support"
@@ -266,3 +266,4 @@
 	  IEEE 802 "local assignment" bit is set in the address, a "usbX"
 	  name is used instead.
 
+endmenu
drivers/usb/serial/Kconfig +2 -8
diff -urN -X dontdiff linux-2.5/drivers/usb/serial/Kconfig usb/drivers/usb/serial/Kconfig
@@ -2,10 +2,7 @@
 # USB Serial device configuration
 #
 
-menu "USB Serial Converter support"
-	depends on USB!=n
-
-config USB_SERIAL
+menuconfig  USB_SERIAL
 	tristate "USB Serial Converter support"
 	depends on USB
 	---help---
@@ -438,8 +435,5 @@
 
 config USB_EZUSB
 	bool
-	depends on USB_SERIAL_KEYSPAN_PDA || USB_SERIAL_XIRCOM || USB_SERIAL_KEYSPAN || USB_SERIAL_WHITEHEAT
+	depends on USB_SERIAL && (USB_SERIAL_KEYSPAN_PDA || USB_SERIAL_XIRCOM || USB_SERIAL_KEYSPAN || USB_SERIAL_WHITEHEAT)
 	default y
-
-endmenu
-
drivers/usb/storage/Kconfig +2 -1
diff -urN -X dontdiff linux-2.5/drivers/usb/storage/Kconfig usb/drivers/usb/storage/Kconfig
@@ -1,10 +1,11 @@
 #
 # USB Storage driver configuration
 #
+
 comment "SCSI support is needed for USB Storage"
 	depends on USB && SCSI=n
 
-config USB_STORAGE
+menuconfig USB_STORAGE
 	tristate "USB Mass Storage support"
 	depends on USB && SCSI
 	---help---
#7 lore raw
In reply to Greg KH

Same again without the USB_GADGET changes. That menu is confusing but correct as it stands.

drivers/usb/image/Kconfig +2 -1
diff -urN -X dontdiff linux-2.5/drivers/usb/image/Kconfig usb/drivers/usb/image/Kconfig
@@ -1,7 +1,7 @@
 #
 # USB Imageing devices configuration
 #
-comment "USB Imaging devices"
+menu "USB Imaging devices"
 	depends on USB
 
 config USB_MDC800
@@ -53,3 +53,4 @@
 	  The scanner will be accessible as a SCSI device.
 	  This can be compiled as a module, called hpusbscsi.
 
+endmenu
drivers/usb/input/Kconfig +2 -1
diff -urN -X dontdiff linux-2.5/drivers/usb/input/Kconfig usb/drivers/usb/input/Kconfig
@@ -1,7 +1,7 @@
 #
 # USB Input driver configuration
 #
-comment "USB Human Interface Devices (HID)"
+menu "USB Input devices"
 	depends on USB
 
 config USB_HID
@@ -205,3 +205,4 @@
 	  The module will be called xpad.  If you want to compile it as a
 	  module, say M here and read <file:Documentation/modules.txt>.
 
+endmenu
drivers/usb/media/Kconfig +2 -1
diff -urN -X dontdiff linux-2.5/drivers/usb/media/Kconfig usb/drivers/usb/media/Kconfig
@@ -1,7 +1,7 @@
 #
 # USB Multimedia device configuration
 #
-comment "USB Multimedia devices"
+menu "USB Multimedia devices"
 	depends on USB
 
 config USB_DABUSB
@@ -194,3 +194,4 @@
 	  The module will be called stv680. If you want to compile it as a
 	  module, say M here and read <file:Documentation/modules.txt>.
 
+endmenu
drivers/usb/misc/Kconfig +2 -2
diff -urN -X dontdiff linux-2.5/drivers/usb/misc/Kconfig usb/drivers/usb/misc/Kconfig
@@ -1,7 +1,7 @@
 #
 # USB Miscellaneous driver configuration
 #
-comment "USB Miscellaneous drivers"
+menu "USB Miscellaneous drivers"
 	depends on USB
 
 config USB_EMI26
@@ -117,4 +117,4 @@
 
 	  See <http://www.linux-usb.org/usbtest> for more information,
 	  including sample test device firmware and "how to use it".
-
+endmenu
drivers/usb/net/Kconfig +2 -1
diff -urN -X dontdiff linux-2.5/drivers/usb/net/Kconfig usb/drivers/usb/net/Kconfig
@@ -1,7 +1,7 @@
 #
 # USB Network devices configuration
 #
-comment "USB Network adaptors"
+menu "USB Network adaptors"
 	depends on USB
 
 comment "Networking support is needed for USB Networking device support"
@@ -266,3 +266,4 @@
 	  IEEE 802 "local assignment" bit is set in the address, a "usbX"
 	  name is used instead.
 
+endmenu
drivers/usb/serial/Kconfig +2 -8
diff -urN -X dontdiff linux-2.5/drivers/usb/serial/Kconfig usb/drivers/usb/serial/Kconfig
@@ -2,10 +2,7 @@
 # USB Serial device configuration
 #
 
-menu "USB Serial Converter support"
-	depends on USB!=n
-
-config USB_SERIAL
+menuconfig  USB_SERIAL
 	tristate "USB Serial Converter support"
 	depends on USB
 	---help---
@@ -438,8 +435,5 @@
 
 config USB_EZUSB
 	bool
-	depends on USB_SERIAL_KEYSPAN_PDA || USB_SERIAL_XIRCOM || USB_SERIAL_KEYSPAN || USB_SERIAL_WHITEHEAT
+	depends on USB_SERIAL && (USB_SERIAL_KEYSPAN_PDA || USB_SERIAL_XIRCOM || USB_SERIAL_KEYSPAN || USB_SERIAL_WHITEHEAT)
 	default y
-
-endmenu
-
drivers/usb/storage/Kconfig +2 -1
diff -urN -X dontdiff linux-2.5/drivers/usb/storage/Kconfig usb/drivers/usb/storage/Kconfig
@@ -1,10 +1,11 @@
 #
 # USB Storage driver configuration
 #
+
 comment "SCSI support is needed for USB Storage"
 	depends on USB && SCSI=n
 
-config USB_STORAGE
+menuconfig USB_STORAGE
 	tristate "USB Mass Storage support"
 	depends on USB && SCSI
 	---help---
#8 lore raw
In reply to Stephen Hemminger
Quoted 13 lines · Stephen Hemminger
drivers/usb/gadget/Kconfig +0 -3
@@ -35,9 +35,6 @@
 #
 # USB Peripheral Controller Support
 #
-choice
-	prompt "USB Peripheral Controller Support"
-	depends on USB_GADGET
 
 config USB_NET2280
 	tristate "NetChip 2280 USB Peripheral Controller"

drivers/usb/gadget/Kconfig line 57

Quoted 4 lines
drivers/usb/gadget/Kconfig +0 -1
@@ -54,21 +51,23 @@
 	   dynamically linked module called "net2280" and force all
 	   gadget drivers to also be dynamically linked.
 
-endchoice

Why do you want to remove that choice menu? By doing that, you've enabled illegal configurations.

In this case: no more than one controller driver may be linked, since USB devices have exactly one upstream link. By detecting this at configuration time, the current menus prevent a link-time error.

This choice could be improved (at this point I'd likely desupport "dummy plus real controller as modules", and the more troublesome cases it carries along with it), but that's not how I'd do it.

drivers/usb/gadget/Kconfig line 112

Quoted 6 lines
drivers/usb/gadget/Kconfig +1 -1
@@ -110,7 +109,7 @@
 
 config USB_ETH
 	tristate "Ethernet Gadget"
-	depends on USB_GADGET && (USB_DUMMY_HCD || USB_NET2280 || USB_PXA250 || USB_SA1100)
+	depends on USB_GADGET_CONTROL

This approach allows illegal configurations too. The config-time dependencies prevent compile-time errors, by only enabling the configurations that are known to compile and work.

When an "au1x00_udc" controller is added, each gadget driver will need to be modified to know about its endpoints and config quirks, then tested. (And some gadget drivers won't be able to do that:
maybe they need lots of endpoints, or rely on config change events that particular hardware disallows.) By allowing arbitrary driver stacking, you'd be causing at least compile errors.

Likewise, when an "audio" gadget driver is added, it'll need testing on each controller. And since SA1100 can never support iso transfers, that configuration shouldn't even be allowed.

Both your proposed changes share a common feature: reducing the degree to which illegal configurations are prevented. Is that intentional?

- Dave

#9 lore raw
Quoted 17 lines · On Thu, 31 Jul 2003 14:07:35 -0700 David Brownell <[email protected]> wrote:
Quoted 16 lines · Stephen Hemminger
drivers/usb/gadget/Kconfig +0 -3
@@ -35,9 +35,6 @@
 #
 # USB Peripheral Controller Support
 #
-choice
-	prompt "USB Peripheral Controller Support"
-	depends on USB_GADGET
 
 config USB_NET2280
 	tristate "NetChip 2280 USB Peripheral Controller"
@@ -54,21 +51,23 @@
 	   dynamically linked module called "net2280" and force all
 	   gadget drivers to also be dynamically linked.
 
Quoted 4 lines

drivers/usb/gadget/Kconfig line 57

Quoted 1 line
drivers/usb/gadget/Kconfig +0 -1
-endchoice

Why do you want to remove that choice menu? By doing that, you've enabled illegal configurations.

Because the choice appears to be only useful for radio box type selections. Try the following with the linux-2.5 version of xconfig.

USB_GADGET=y
USB Peripheral Controller support = y (not module) USB Gadgets = y (not module)

The Netchip becomes a radio button.

And Gadget Zero and Gadget Ethernet become select one radio buttons.

#10 lore raw
Quoted 4 lines · Stephen Hemminger
Quoted 2 lines

Why do you want to remove that choice menu? By doing that, you've enabled illegal configurations.

Quoted 8 lines

Because the choice appears to be only useful for radio box type selections. Try the following with the linux-2.5 version of xconfig.

USB_GADGET=y
USB Peripheral Controller support = y (not module) USB Gadgets = y (not module)

The Netchip becomes a radio button.

As should be. If some hardware supports net2280 and another controller (maybe PCI, maybe not), only one of them can provide the device's single upstream port -- so choose only one.

Quoted 1 line

And Gadget Zero and Gadget Ethernet become select one radio buttons.

As should be. You can't use them at the same time, only one of them can "own" the controller driver -- so choose only one.

- Dave