This series of patches extends number of ports limitaion in application (vhci) side. 1. Background Assuming a system shown below that services distributerd devices in home or office via USB/IP, if the devices are set at every doors and windows, number devices may be up to tens. Home/SOHO/Enterprise Intranet/Internet +------+ +------+ USB/IP +---------+ +|device|--+|Linux |---------------------------|Service | |+------+ |+------+---------------------------|on Linux | +------+ +------+ +---------+ ex) Device Service sensors ................................... environment analysis cameras ................................... monitoring, recording ID/biometric readers ...................... authentication If USB/IP is used for ubiqitous devices or IoT devices, many devices might be handled. 2. About this patch set In current USB/IP, available number of ports (ie. number of supported devices) is VHCI_NPORTS(8) in drivers/usb/usbip/vhci.h. The value of the macro can be altered to USB_MAXCHILDREN(31). This limit is came from hub status bit array. See also the comment at USB_MAXCHILDREN include/uapi/linux/usb/ch11.h. There are two way to increase number of available ports. The first way is to put hub emulator under vhci. This can add ports up to 255 - the limit of USB 2.0 host controller. The second way is to add host controller. It's as same as machines have several host controllers: most desktop or note PCs have more than one host controller. Current USB/IP supports only one controller defined as 'the_controller' in drivers/usb/usbip/vhci_hcd.c. This patch takes the second way described above and adds virtual controllers. In this patch, the number is specified by kernel configuration. 3. Dynamic extension According to kernel configuration, vhci devices (platform device) will be added and removed when they are not used. When the vhci driver is loaded, USBIP_VHCI_INIT_HCS (default is 1) drivers are registered. They will be further registered upto USBIP_VHCI_MAX_HCS (default is 1). They are unregistered when number of free devices becomes more than VHCI_FREE_HCS(2) except the first device. 4. Wording Wording inconsistencies in function and variable names are corrected according to the rule below. They were not strict because only one host controller was handled. rhport, HC_PORTS: ports within a controller (or root hub). port, nports: ports across the controllers. 5. Dependencies This series depends on 'usbip: exporting devices' patch set because this includes changes to application side daemon which introduced the patch set. --- Version information v6) # Recreated based on linux-next 20160928. # Was '3/1 usbip: vhci extension: modifications to vhci driver' is excluded because it has been merged. v5) # Fixed dynamically allocated sysfs attribute checking error when CONFIG_DEBUG_LOCK_ALLOC is set. # Recreated based on linux-next 20160810. v4) # Changed the method to set number of controllers from a module parameter to kernel config. # Excluded event thread patch merged to 4.7-rc1. # Added dynamic extension. v3) # Fixed conflicts against linux-next 20160209. # Changed sysfs object and attribute name for old tools compatibility. # Changed nports status format not to include num_controllers value. # Fixed checkpatch errors and warnings. v2) # Added static to some functions and variables not called from other files. *** BLURB HERE *** Nobuo Iwata (2): usbip: vhci extension: modifications to userspace usbip: vhci extension: dynamic extension drivers/usb/usbip/Kconfig | 17 +- drivers/usb/usbip/vhci.h | 36 ++- drivers/usb/usbip/vhci_hcd.c | 250 ++++++++++++++--- drivers/usb/usbip/vhci_rx.c | 10 +- drivers/usb/usbip/vhci_sysfs.c | 49 ++-- drivers/usb/usbip/vhci_tx.c | 6 +- tools/usb/usbip/libsrc/vhci_driver.c | 398 +++++++++++++++------------ tools/usb/usbip/libsrc/vhci_driver.h | 45 +-- tools/usb/usbip/src/usbip_attach.c | 8 +- tools/usb/usbip/src/usbip_port.c | 13 +- tools/usb/usbip/src/usbipd_app.c | 48 ++-- 11 files changed, 546 insertions(+), 334 deletions(-) -- 2.1.0 -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html