(12) United States Patent (10) Patent No.: US 8,850,082 B2 Malamant Et Al
Total Page:16
File Type:pdf, Size:1020Kb
USOO8850O82B2 (12) United States Patent (10) Patent No.: US 8,850,082 B2 Malamant et al. (45) Date of Patent: Sep. 30, 2014 (54) VIRTUAL USB COMPOUND DEVICE 7,577,776 B2 8/2009 Hsueh ENUMERATION 2007/0088967 A1* 4/2007 Fu et al........................ T13,340 2009, 0217304 A1 8, 2009 Shih et al. (75) Inventors: Igor Malamant, San Diego, CA (US); 2010, 0138564 A1 6, 2010 Lee et al. Thomas E. Virgil, San Diego, CA (US) FOREIGN PATENT DOCUMENTS (73) Assignee: QUALCOMM Incorporated, San JP 2002185548 A 6, 2002 Diego, CA (US) JP 2008146419 A 6, 2008 JP 2010 140269. A 6, 2010 (*) Notice: Subject to any disclaimer, the term of this WO 2009 125586 A1 10, 2009 patent is extended or adjusted under 35 OTHER PUBLICATIONS U.S.C. 154(b) by 355 days. DON: “Universal Serial Bus system architecture”, 2001, pp. 80-83, (21) Appl. No.: 13/214,305 Adison Wesley, XP002662720, ISBN: 0201309750. International Search Report and Written Opinion—PCT/US2011/ (22) Filed: Aug. 22, 2011 049750 ISA/EPO Nov. 15, 2011. (65) Prior Publication Data * cited by examiner US 2012/0054378A1 Mar. 1, 2012 Primary Examiner — Zachary K Huson Related U.S. Application Data (74) Attorney, Agent, or Firm — Nicholas J. Pauley; Peter (60) Provisional application No. 61/378,159, filed on Aug. Michael Kamarchik; Joseph Agusta 30, 2010. (57) ABSTRACT (51) Int. Cl. A system for implementing a virtual Universal Serial Bus G06F 3/00 (2006.01) (USB) compound device with a simulated hub enables a G06F5/00 (2006.01) single physical USB device, such as a USB peripheral device, G6F 3/42 (2006.01) to expose multiple stand-alone functions on the USB bus. (52) U.S. Cl. Logical functions on the single physical USB device can be CPC .................................. G06F 13/4295 (2013.01) added and removed dynamically without re-enumerating the USPC .................................. 710/19, 710/10; 710/41 entire device and without affecting the state of other func (58) Field of Classification Search tions. Logical functions can also be independently imple None mented on any of a number of processors in a system that has See application file for complete search history. access to the USB hardware. Each processor can enumerate as one or more USB devices via the virtual hub. Initialization (56) References Cited of logical functions can be performed via the virtual USB hub to maintain a charging current level from a USB host in a U.S. PATENT DOCUMENTS device having a discharged battery. 6,862,643 B2 3, 2005 Wu et al. 6,976,105 B1 12/2005 Wright 23 Claims, 6 Drawing Sheets -602 NMERA's AS WITHE LOW CURRENT 2. REQUEST HIGH CURRENT FR THE SEN iS USC&NA. 88: ARGE BA RY iSigE JRRENEER TEJSS 2. Six SAS CANET3 JS3 CS ER&ESEC N SEFENCNA WIAEwBA JB U.S. Patent Sep. 30, 2014 Sheet 1 of 6 US 8,850,082 B2 -{{}} U.S. Patent Sep. 30, 2014 Sheet 2 of 6 US 8,850,082 B2 ${}? U.S. Patent Sep. 30, 2014 Sheet 3 of 6 US 8,850,082 B2 F.G. 3 U.S. Patent Sep. 30, 2014 Sheet 4 of 6 US 8,850,082 B2 (S) A. U.S. Patent Sep. 30, 2014 Sheet 5 of 6 US 8,850,082 B2 52 initialize JSE (toiler Aliocate hub endpoint resources in USB citrier USS Disconnect Connect and enlinerate using HUB descriptors Corrected State NEification firr; Electricai Eyests Port-directed Status Port-directed request from coininzini JSB controit; (ii (in Physical ISB the host for the hist virtual port events port connect (Get PortStatus {Set Fort Feature, (coinect/discopieci. disco flect, CitearPortfeature Fenote wakeup suspend/resultae) Respond with virtual port Request JSB Serai Status Request JSB SaS contries it Change contrailer to (connected eluiate otification to entiaie discontected corresponding JSE (St Over CGFTesponding Suspended actici (i. the interrupt acticis of ai etc.) virtual port endpoint virtual ports 5 Sz. F.G. 5 U.S. Patent Sep. 30, 2014 Sheet 6 of 6 US 8,850,082 B2 ENMERAE AS WRA USB 3. WTH LCW CRRENT REQUEST HGH CJRRENT FOR THE SEC{N} USB FUNCONALTY (CHARGE BAERY USNG E - G CJRRENT LEVE FROM HE USS HOST SEN PORT STAJS CHANGE USB H{OS ENUMERAE SECON } USB FUNCTONALTY WA E WRA - B F.G. 6 US 8,850,082 B2 1. 2 VIRTUAL USB COMPOUND DEVICE and reconnection of all logical interfaces, which can tear ENUMERATION down active application sessions in an unexpected manner. Opening and closing USB circuitry to allow re-enumera CROSS REFERENCE TO RELATED tion of USB functionality may also be problematic, for APPLICATION example, in the process of charging a dead battery of a USB peripheral device. According to the USB specification, a USB The present application claims the benefit of U.S. Provi peripheral device may draw up to 100 mA from a USB host sional Patent Application No. 61/378,159 to MALAMANTet before the USB peripheral device enumerates and may al. filed Aug. 30, 2010. request up to 500 mA from the USB host after the USB 10 peripheral device enumerates. However, a USB peripheral device may have to draw more than 100 mA to load its FIELD operating system. To recover from a discharged battery, a USB device may enumerate to a USB host early in a boot Aspects of the present disclosure relate generally to Uni loading process. The initial enumeration may occur before versal Serial Bus (USB) devices and more particularly to 15 loading the USB peripheral operating system and may use enumeration of a virtual USB device. only up to 100 mA of current. To further conserve power during a boot process with a BACKGROUND discharged battery, a USB peripheral device may initially enumerate as a simpler USB peripheral device, such as a USB Universal Serial Bus (USB) hosts such as USB host per human interface device (HID) Class device, for example. Sonal computers (PC hosts) are designed to enable plug-and After the initial enumeration of the USB peripheral device is play operation of a number of USB peripheral devices. That complete, the USB peripheral device may request up to 500 is, the USB peripheral devices are automatically configured mA from the USB host. The additional current may be used to for communicating with the USB host when they are physi finish loading the USB peripheral's operating system. Once cally connected to a USB port of the USB host. USB hosts 25 the operating system is loaded, the USB peripheral device may be capable of handling up to 127 USB peripheral devices will generally re-enumerate to represent its actual function and may provide mechanisms for dynamically loading and alities to the USB host as specified by the operating system. unloading drivers for each device attached on a USB bus. A re-enumeration may be performed by opening and clos Unlike USB hosts, USB peripheral devices are generally ing USB circuitry to simulate a reconnection of the USB unable to dynamically load and unload drivers for various 30 device as described above. However, the USB specification USB functionalities. Rather, the USB peripheral devices enu would then mandate reducing the charging current from merate a predefined static set of functions to the USB host around 500 mA to a pre-enumeration level of less than 100 when they are physically connected to the USB host. The set mA. Therefore, opening and closing the USB circuitry to of static functions generally may not be extended in run-time. re-enumerate the USB device functionally can not be per Certain newer USB peripheral devices may be capable of 35 formed in a USB compliant manner until the battery is suffi multiple USB functionalities. However, such devices may ciently charged. only have a limited ability to configure desired functionalities Simulating disconnection/reconnection of a USB periph due to the inability of USB peripheral devices to dynamically eral device may also cause other undesirable side effects. For load and unload USB drivers for the functionalities. example, the naming of hardware ports in certain operating Certain composite USB devices may allow multiple USB 40 systems may be automatically updated when the operating functions to enumerate to a USB host on a single USB port. system recognizes a physical disconnection/reconnection of a USB specifications describe certain methods for designing USB device. This may cause errors in processes that are Such composite devices by allowing the devices to enumerate accessing renamed ports. with multiple functions on a single USB port. USB specifications define a method of packaging multiple FIG. 1 shows a USB descriptor hierarchy 100 that can 45 USB devices within a single compound device package with represent multiple logical functions within a device in accor an embedded USB hub. An example of a compound device dance with USB specifications. At least three stages of USB including an embedded USB hub is described with reference enumeration may occur when a USB device is plugged in to to FIG. 2. A root hub 202 may be connected directly to a USB a host. A device descriptor 102 represents a USB enumeration host 204 and a number of USB devices 206 may be connected for a device. A number of configuration descriptors 104 rep 50 to the USB host 204 via the root hub 202. A number of resent USB enumeration for various configurations of the additional devices 208 may be connected to the root hub 202 device. A number of interface descriptors 106 may each rep via a number of additional USB hubs 210. Certain compound resent a USB enumeration for a corresponding one of the devices may include a USB hub 210 having one or more USB functionalities.