(19) United States (12) Patent Application Publication (10) Pub
Total Page:16
File Type:pdf, Size:1020Kb
US 20120054378Al (19) United States (12) Patent Application Publication (10) Pub. No.: US 2012/0054378 A1 Malamant et al. (43) Pub. Date: Mar. 1, 2012 (54) VIRTUAL USB COMPOUND DEVICE FOR Publication Classi?cation DISCHARGED BATTERY RECOVERY (51) Int. Cl. G06F 3/00 (2006.01) (75) Inventors: Igor Malamant, San Diego, CA (52) us. c1. ........................................................ .. 710/19 (US); Thomas E. Virgil, San Diego, CA (US) (57) ABSTRACT A system for implementing a virtual Universal Serial Bus (73) Assigneej QUALCOMM (USB) compound device With a simulated hub enables a INCORPORATED, San Diego, single physical USB device, such as a USB peripheral device, CA (Us) to expose multiple stand-alone functions on the USB bus. Logical functions on the single physical USB device can be added and removed d namicall Without re-enumeratin the (21) Appl' NO‘: 13/214’305 entire device and without affecliing the state of other film tions. Logical functions can also be independently imple (22) Filed: Aug. 22, 2011 mented on any of a number of processors in a system that has access to the USB hardware. Each processor can enumerate Related US. Application Data as one or more USB devices via the virtual hub. Initialization of logical functions can be performed via the virtual USB hub (60) Provisional application No. 61/378,159, ?led on Aug. to maintain a charging current level from a USB host in a 30, 2010. device having a discharged battery. r5432 Initialize USB controller 1 [5m Allocate hub endpoint resources in USB controller 1 f 500 Disconnect State USB Connect U SE Disconnect. K 598 Connect and ennm state using iii)’ 8 (1e sci'iptoi's ‘ r5 3 0 Connected State ‘ Pei-(gimmick) Noti?cation timn iillecttical iilvents Font-directed status ruins“ HOT coitimanti U SE controller on on Physical USB ‘he host {mm {m lmbf virtual port events port (connect/ (Sm OllFfdlurct (conmeet/disconnect, uiscoiinect, l remote wakeup) suspend-Te wine) Request'USB Send Status Request USB controller to Change controller to emulate notification to emulate _, A,‘ ~ . _ corresponding> USBI host over conespondmg_ ' gu’q n67‘ action on ihff interrupt actions on all ‘ 3 virtual} port endpoint virus-a1 ports \5i2 \514 \516 \5i8 Patent Application Publication Mar. 1, 2012 Sheet 1 0f 6 US 2012/0054378 A1 S1 Patent Application Publication Mar. 1, 2012 Sheet 2 0f 6 US 2012/0054378 A1 gmk wom/ yak mom Q325cm $3.6m @OTKU Patent Application Publication Mar. 1, 2012 Sheet 3 0f 6 US 2012/0054378 A1 PEG. 3 Patent Application Publication Mar. 1, 2012 Sheet 4 0f 6 US 2012/0054378 A1 Patent Application Publication Mar. 1, 2012 Sheet 6 0f 6 US 2012/0054378 A1 r602 ENUNTERATE AS VIRTUAL USB BU B ‘WTTH LQ‘W CURRENT l f 694 REQUEST HTGH CURRENT FGR THE SECOND USE E UNCTTQNALTTY ' [6G6 CHARGE BATTERY U SING TH HEGT-T QURRENT LEVEL FROM THE USE HOST SENT) PQRT STATUS T6 USE HOST ‘ r649 ENUMERATE SECGND USE FT) TCTI(ZBJALTTY VIA THE VTRTTL’SL HU B EEG. 6 US 2012/0054378 A1 Mar. 1, 2012 VIRTUAL USB COMPOUND DEVICE FOR nection of the USB device from/to the USB host. HoWever, DISCHARGED BATTERY RECOVERY this method is often susceptible to errors due to disconnection and reconnection of all logical interfaces, Which can tear CROSS REFERENCE TO RELATED doWn active application sessions in an unexpected manner. APPLICATION [0008] Opening and closing USB circuitry to alloW re [0001] The present application claims the bene?t of US. enumeration of USB functionality may also be problematic, Provisional Patent Application No. 61/378,159 to MALA for example, in the process of charging a dead battery of a MANT et al. ?led Aug. 30, 2010. USB peripheral device. According to the USB speci?cation, a USB peripheral device may draW up to 100 mA from a USB FIELD host before the USB peripheral device enumerates and may request up to 500 mA from the USB host after the USB [0002] Aspects of the present disclosure relate generally to peripheral device enumerates. HoWever, a USB peripheral Universal Serial Bus (U SB) devices and more particularly to device may have to draW more than 100 mA to load its enumeration of a virtual USB device. operating system. To recover from a discharged battery, a USB device may enumerate to a USB host early in a boot BACKGROUND loading process. The initial enumeration may occur before [0003] Universal Serial Bus (U SB) hosts such as USB host loading the USB peripheral operating system and may use personal computers (PC hosts) are designed to enable plug only up to 100 mA of current. and-play operation of a number of USB peripheral devices. [0009] To further conserve poWer during a boot process That is, the USB peripheral devices are automatically con?g With a discharged battery, a USB peripheral device may ini ured for communicating With the USB host When they are tially enumerate as a simpler USB peripheral device, such as physically connected to a USB port of the USB host. USB a USB human interface device (HID) Class device, for hosts may be capable of handling up to 127 USB peripheral example. After the initial enumeration of the USB peripheral devices and may provide mechanisms for dynamically load device is complete, the USB peripheral device may request up ing and unloading drivers for each device attached on a USB to 500 mA from the USB host. The additional current may be bus. used to ?nish loading the USB peripheral’s operating system. [0004] Unlike USB hosts, USB peripheral devices are gen Once the operating system is loaded, the USB peripheral erally unable to dynamically load and unload drivers for device Will generally re-enumerate to represent its actual various USB functionalities. Rather, the USB peripheral functionalities to the USB host as speci?ed by the operating devices enumerate a prede?ned static set of functions to the system. USB host When they are physically connected to the USB [0010] A re-enumeration may be performed by opening ho st. The set of static functions generally may not be extended and closing USB circuitry to simulate a reconnection of the in run-time. Certain neWer USB peripheral devices may be USB device as described above. HoWever, the USB speci? capable of multiple USB functionalities. HoWever, such cation Would then mandate reducing the charging current devices may only have a limited ability to con?gure desired from around 500 mA to a pre-enumeration level of less than functionalities due to the inability of USB peripheral devices 100 mA. Therefore, opening and closing the USB circuitry to to dynamically load and unload USB drivers for the function re-enumerate the USB device functionally can not be per alities. formed in a USB compliant manner until the battery is su?i [0005] Certain composite USB devices may alloW multiple ciently charged. USB functions to enumerate to a USB host on a single USB [0011] Simulating disconnection/reconnection of a USB port. USB speci?cations describe certain methods for design peripheral device may also cause other undesirable side ing such composite devices by alloWing the devices to enu effects. For example, the naming of hardWare ports in certain merate With multiple functions on a single USB port. operating systems may be automatically updated When the [0006] FIG. 1 shoWs a USB descriptor hierarchy 100 that operating system recogniZes a physical disconnection/recon can represent multiple logical functions Within a device in nection of a USB device. This may cause errors in processes accordance With USB speci?cations. At least three stages of that are accessing renamed ports. USB enumeration may occur When a USB device is plugged [0012] USB speci?cations de?ne a method of packaging in to a host. A device descriptor 102 represents a USB enu multiple USB devices Within a single compound device pack meration for a device. A number of con?guration descriptors age With an embedded USB hub. An example of a compound 104 represent USB enumeration for various con?gurations of device including an embedded USB hub is described With the device. A number of interface descriptors 106 may each reference to FIG. 2. A root hub 202 may be connected directly represent a USB enumeration for a corresponding one of the to a USB host 204 and a number of USB devices 206 may be USB functionalities. A number of endpoint descriptors 108 connected to the USB host 204 via the root hub 202.A number enumerate assignments for data channels to a particular inter of additional devices 208 may be connected to the root hub face. The endpoint descriptors 108 alloW a particular func 202 via a number of additional USB hubs 210. Certain com tionality to access speci?c data channels in order to transfer pound devices may include a USB hub 210 having one or data back and forth to the USB host, for example. more connected USB devices 208. [0007] Because the descriptor hierarchy 100 shoWn in FIG. [0013] Connecting a USB device to a USB host via one or 1 is static, additional interfaces generally may not be added to more USB hubs may solve some of the problems associated the hierarchy unless a physical disconnection and reconnec With recharging a USB device described above. Because the tion of the device occurs or is simulated. Certain USB devices USB hub is a comparatively simple device, it may enumerate alloW recon?guration of a descriptor hierarchy 100 by inter during an initial boot loading process Without a re-enumera nally opening and closing USB circuitry connecting the USB tion step.