Abstract:
Some embodiments relate to an apparatus, method and computer-medium for interacting with a peripheral device (e.g. a mobile phone device) via a USB port. Some embodiments relate to a routine and host device whereby using a technique of function interception, it I possible to intercept the plug-and-play (PnP) handler of the USB hub driver executing on the host device so as to prevent the loading into memory of the host device of a device driver which matches a hardware ID received by the host from a peripheral device. In some embodiments, it is possible to change the received hardware ID to a different hardware ID, and to load, into memory of the host device, a device driver which matches the different hardware ID.

Description:
CROSS-REFERENCE TO RELATED APPLICATIONS 
       [0001]    This patent application claims the benefit of U.S. 61/349,937 filed on May 31, 2010 by the present inventor, which is incorporated herein by reference in its entirety. 
     
    
     BACKGROUND AND RELATED ART 
       [0002]    Over the years, for some groups of devices, unified interfaces were established. For example, any off-the-shelf mouse you plug into a computer will function similarly: you don&#39;t have to install special word-processing software for each mouse. In contrast, mobile phones do not have similar “standard” interfaces. Partly due to historical lack of leadership, partly due to very differing functionality offered by phone vendors, each phone is represented to the host computer as a different set of interfaces (some standard, some not). 
         [0003]    In  FIG. 1 , the problem is evident: connected a Sony K310 phone results in two “modem” devices and two “port” devices. Connecting a Nokia N95 phone results in a different set of devices: one “modem”, one “portable device”, one “port” device, and two “wireless communications” devices. 
         [0004]    Moreover, each phone requires specialized software to manage it: the address-book synchronization software is specialized, the media management software is specialized, etc. 
         [0005]    Not only does phone management by a PC require specialized drivers and software, but under the Windows operating system, connecting multiple phones in sequence results in an overload on the system, up to a point requiring rebooting. 
         [0000]    In an ideal world, the mobile phone connectivity would be standardized, unified, with a single driver so all application software would be able to manage all mobile phones. The patent described here accomplishes this feat despite the irregularity existing today. The result is shown in  FIG. 2 , in which a new “mobile phone” device is created per connected device. A much cleaner and simpler view than the previous one, and it allows unified management of either of the phones. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0006]      FIGS. 1A-1B  illustrate the “Mess” caused by connecting either a Sony mobile phone (left) or a Nokia mobile phone (right), without any presently-disclosed apparatus, methods or computer-readable medium. 
           [0007]      FIG. 2  illustrates the “unified” device structure with the presently disclosed mobile phone device (MPD) platform, showing two simultaneously connected mobile phones. 
           [0008]      FIG. 3  provides a very high-level structure of a MPD system. 
           [0009]      FIG. 4  illustrates a SerialUSB smart connector. 
           [0010]      FIG. 5  illustrates hardware identity manipulation. 
       
    
    
     DETAILED DESCRIPTION OF EMBODIMENTS 
       [0011]    Some embodiments of the present invention allow controlled co-existence of the “legacy” system and the new “unified” approach. We (or applications with the decision authority) can choose if to expose only the “legacy” interfaces, only the new unified interface, or some combination, even partial, of the two. This allows smooth migrations and leaves a fall-back to stable, legacy solutions. 
         [0012]    Yet another possibility allows is networked management of connected devices. We can create a separation within the infrastructure, in one of several suitable places, allowing a “thin client” to be connected to the device, while the bulk of the processing takes place on a remote server. The local “thin client” may run a minimal MCE driver or no MCE. 
         [0013]    For the present disclosure, any “MCE” software driver or system or apparatus refers to a driver or system or apparatus or method 
         [0014]    Embodiments of the present invention are relevant t to any group of devices having dissimilar properties, but where some sort of unified API is desired. Mobile phones are one example. Even printers, each with own capabilities, should benefit from this presently-disclosed techniques. 
         [0015]    Disclosed embodiments are relevant for the Windows operating system, as well as for the Mac and Linux operating systems, with minor changes to the software. 
       A Discussion of FIG. 3 
       [0016]      FIG. 3  describes a routine comprising 4 stages. 
       Stage 1—Physical Connectivity Unification 
       [0017]    While the vast majority of mobile phones use USB as a connectivity medium with a PC, some model communicate via serial RS-232, using proprietary connectors and wiring. Some embodiments relate to a set of “Smart Cables” (Block #6) that convert the RS-232 connection to USB connection, while “faking” a USB identity. A synthetic USB code is generated to identify the phone as uniquely as possible to the PC. (Perhaps this stages is entitled a separate patent, we have included it as part of the grand plan. We shall detail it separately from the software modules). 
       Stage 2—Interception and Modification of Device Identity 
       [0018]    When a hardware device, such as external memory, printer, or mobile phone, is connected to a computer through USB (and also some other methods), the device identifies itself by specific codes, the computer loads device drivers that are registered to handle that hardware. 
         [0019]    To load a single, unified driver, we need to trick the system into believing a “unified mobile phone” device (a device class we invented) has been connected. Block #1 takes care of that. MPD can, in real-time, “update” the identity to its original value, resulting to loading of the legacy device drivers for special purposes (e.g. flashing updated software onto the phone). 
       Stage 3—Device-Specific Translation 
       [0020]    Since each mobile phone is actually different, with unique protocols, capabilities, logic, and data representations, the unification feat is accomplished through an extensive knowledge-base (Block #3) that translates the unified API&#39;s commands, queries, and data into the connected phone&#39;s native language. Some of the implementation may entitle a separate patent. 
       Stage 4—A New Single Unified Device Driver 
       [0021]    Instead of the special, numerous, per-phone device drivers, MPD creates and loads a single device driver (Block #2) which communicates with any connected phone, and provides a unified interface (Block #4) for the applications (Block #5), so the application is indifferent an even unaware which mobile phone is connected. The Driver provides high-level functionality using available resource provided by the phone. 
       A Discussion of FIG. 4 
       [0022]    Physical Connectivity Unification—RS-232&lt;- -&gt;USB converters aren&#39;t new. But our converter also allows identification of the connected device by responding to a specific query from the host, based on a hardware coding of the serial cable.
       A “Smart Dongle” design is now disclosed to enable:       
 
         [0024]    USB to Serial RS232 conversion, including: 
         [0025]    RS232 control instructions handling 
         [0026]    RS232 RX/TX handling 
         [0027]    Unique identification for Mobile device HW connector cable. 
         [0028]    The main concept of uniquely identifying the connector cable relies on the ability of measuring the resistance of a resistor wired to the cable, using an A-to-D component controlled by the main controller of the dongle, in addition to providing the basic USB Serial functionality. 
         [0000]    The Smart Dongle solution includes 2 types of HW components
 
1. Single USB client dongle
 
2. Multiple Mobile Device HW connector cables.
 
 FIG. 4  illustrates a Serial&lt;- -&gt;USB smart connector
 
         [0029]    The system may include some or all of the following components: 
         [0000]    A. Mobile Device HW Connector Cable including some or all of:
 
1. Mobile Device side connector—device specific
 
2. RS232 connector (RJ 45)
 
       3. Wires: 
       [0030]    a. RX
 
b. TX
 
c. Ground
 
d. Identification wire with a unique resistance value resistor.
 
B. USB client dongle (an example) including some or all of:
 
1. Main controller (CPU+USB Device functionality: detailed below in “USB Descriptor example for Smart Dongle”)
 
2. A-to-D component
 
3. UART component
 
4. USB socket (type B)
 
5. RS232 socket (RJ 45)
 
The main controller USB stack implements 3 endpoints:
 
1. control endpoint (interrupt)
 
a. RS232 control instructions
 
b. Connector identification instructions
 
2. RX endpoint (bulk)
 
3. TX endpoint (bulk)
 
Below are some details USB Descriptor according to one non-limiting example implementation of the smart dongle:
 
         [0031]    Hub Power: Self Power 
         [0032]    Number of Ports: 2 
         [0033]    Power switching: None 
         [0034]    Compound device: No 
         [0035]    Over-current Protection: None (Bus Power Only) 
         [0036]    Device Descriptor
       USB Version: 1.1   Device Class: (0) Reserved (defined in Interface Descriptor)   Device Subclass: 0   Device Protocol: 0   Max Packet Size: 0x40 (64) bytes   Vendor: 0x______ (mce systems, Inc)   Product ID: 0x______   Product Version 0x______   Manufacturer: 1
           0x______: mce systems Inc.   
           Product: 2
           0x______: USB-Serial Controller   
           SerialNumber: 0   Number of Configurations: 1       
 
         [0051]    Connection Status Device Connected 
         [0052]    Current Configuration: 1 
         [0053]    Device Bus Speed: Full 
         [0054]    Device Address 0x01 
         [0055]    Number of Open Pipes: 3 
         [0056]    Configuration Descriptor (1)
       Total Length: 39 bytes   Number of Interfaces: 1   Configuration Value: 1   Configuration: 0   Attributes: 0x80
           Bus Powered   
           Max Power: 0x32 (100 Ma)       
 
         [0064]    Interface Descriptor (0)
       Interface Number: 0   Alternate Setting 0x00   Number of Endpoints: 0x03   Interface Class: (255) Vendor Specific   Interface Subclass: 0   Interface Protocol: 0   Interface: 0       
 
         [0072]    Endpoint Descriptor (Addr: 0x81)
       Endpoint Address: 0x81, Input   Transfer Type Interrupt   Max Packet Size: 0x000a (10) bytes   Interval: 0x01       
 
         [0077]    Endpoint Descriptor (Addr: 0x02)
       Endpoint Address: 0x02, Output   Transfer Type Bulk   Max Packet Size: 0x0040 (64) bytes   Interval: 0x00       
 
         [0082]    Endpoint Descriptor (Addr: 0x83)
       Endpoint Address: 0x83, Input   Transfer Type Bulk   Max Packet Size: 0x0040 (64) bytes   Interval: 0x00
 
A Discussion of Interception and Modification of Device Identity with Reference to  FIG. 5 
       
 
         [0087]    Below is one possible implementation of device identity manipulation. It involves the components as shown in  FIG. 5 , which exist in various operating systems, such as Windows, Linux, MAC OS: 
         [0000]    a. Modifying the Device Identity from within the Hub Driver. 
         [0088]    Each USB hardware is represented by a hub driver. It is a mutual attribute of Windows, Linux and Mac OS. The hub driver passes through the hardware identifiers associated with the USB. The original ID is depicted as “X1” in  FIG. 5  below. 
         [0000]    Using a technique of kernel-mode interrupt interception, we intercept the PnP handler of usbhub.sys, the hub driver. We look for IRP_MN_QUERY_ID (function drivers and filter drivers do not handle this IRP), we change the hardware ID to our own special ID, depicted as “Y0”. We also listen to IRP_MN_QUERY_CAPABILITIES, to disable the flag “unique” so single mpdbus.sys will be loaded even if phones are changed. Another method to perform this identity modification can be achieved by replacing altogether the hub driver. We believe the former approach is more robust and requires less interference with the system. 
         [0089]    The operating system is instructed to load our own Composite Bus Driver, mpdbus.sys, when the ID “Y0” is encountered. 
         [0000]    b. MPD&#39;s Composite Bus Driver 
         [0090]    A composite bus driver natural task is dynamic loading and unloading of various devices per connected hardware. Since MPD&#39;s bus driver was loaded, due to the change of hardware ID, we can manipulate the behavior of the bus driver to do the following: 
         [0000]    1. Announce the existence of the original hardware, “X1”, which will cause the loading of the original bus driver and all subsequent original drivers. In this case, the bus driver will function as “pass through”, it will be as if MCE-SYS&#39;s drivers are not installed.
 
2. Announce the existence of MPD&#39;s special hardware, “Y1”, which will load MPD&#39;s Phone Driver. No original drivers will load.
 
3. A combination of the two above. For example, the original device may expose several interfaces, such as MSD and MODEM. We can choose to expose only MODEM in addition to MPD&#39;s Phone Driver.
 
c. Kernel-Mode MPD Driver
 
       Generic; 
       [0091]    Single instance per physically connected device of type “Y1” (in the case of mobile phones);
 
Thin kernel-mode layer (most logic in user-mode layer).
 
d. Identity Manager
 
         [0092]    The decision which devices or interfaces to expose can be dynamically controlled through the Identity Manager. The Identity Manager can be accessed from applicative layers. For example, a security policy may require disabling all MSD interfaces, or a special software update utility may require temporary use of original drivers. 
       Device-Specific Translation 
     The “Profile” Concept 
       [0093]    A Profile is a collection of all the information required for successful management of the connected device. For mobile phones, it may include: USB endpoints, data formats, data structures, protocols, etc. 
         [0094]    This knowledge may be available through prior investigation of the phone, or through run-time investigation, or some combination thereof. 
         [0095]    The following software components are used to implement the aspects of the profile. 
       The “Connection” Concept 
       [0096]    A representation of a physically connected device. 
       Port Component Interface 
       [0097]    The low-level communication with connected devices is often based on one or more of several known interfaces (some phone-related examples include: CDC-ACM (MODEM/Virual Comm-port), CDC-ECM (network interface), MTP, WMCDC, MSD), and vendor-proprietary (e.g Blackberry&#39;s, Motorola&#39;s). 
         [0098]    The services provided by these interfaces are unified by our “Port Component” into a simple, generic interface with the following API: 
         [0099]    Open 
         [0100]    Close 
         [0101]    Read 
         [0102]    Write 
         [0103]    IO Control 
         [0000]    The Port Component implements internally all the required logic to actually communicate with the connected devices. It uses a “connection” as logical address of the device. 
       Protocol Interface (Aka “Folder”) 
       [0104]    Folder is an abstraction of a list of items of a specific type (with mobile phones, examples include: SMS received, SMS sent, contacts). Its API includes, among others, the following actions: 
         [0105]    Open/Close 
         [0106]    Find First item (with optional filter) 
         [0107]    Find Next item 
         [0108]    Read/Write/Delete/Create content item 
         [0109]    Folder Value Get/Set/IO Control 
         [0110]    Register Notification 
         [0111]    The Protocol actions use the Port Component Interface. It implements internally the appropriate communication protocol stack (such as OBEX, SyncML, AT-Commands, Qualcomm-BREW) for implementing the general folder functionality. 
       Format Filter 
       [0112]    The Format Filter converts data types from various (sometimes proprietary) formats to other formats. In the mobile phone domain, for example, contacts are usually stored in the VCard format, but there are some private variations. 
         [0000]    The Format Filter API includes, among others: 
         [0113]    Set/Query parameters 
         [0114]    Conversion IO Control (from, to) 
       Structure Adaptor 
       [0115]    This is a helper service for structural conversion between folders. For example, converting change-based folders to content-based folders, creating change folder from two content folders, or flattening tree-structured folders to one big folder. Its API is identical to that of the Protocol Interface. 
       Mobile Service 
       [0116]    Represents a general collection of data relevant to sessions involving mobile phone(s), such as ESN, software versions etc. The data is collected in the appropriate manner from the specific devices connected. 
         [0000]    The API&#39;s important functions include: 
         [0117]    Get/Set value 
       Recognizer 
       [0118]    A component that helps a new connection establish the identity of the connected device. It interrogates the connection for some attributes that allows consulting the device profile database to identify the connected device. 
       Knowledge-Base (Profile Collection) 
       [0119]    A collection of per-device information. It is used to identify the mobile phone and to communicate with it in its specific “language”. The various modules listed above use the information from this knowledge base to interact in the right protocols, using the correct data types. 
       New Single Unified API 
     The “Session” Concept 
       [0120]    The interaction with a profile (specific phone) over a “connection” (specific physical port). 
       Content Type Manager 
       [0121]    The top-level manager implementing the “Session” of the Mobile Phone API. It creates other objects based on the specific device connected. 
       Mobile Phone API 
       [0122]    Creation of sessions and management of mobile phones is done via new, general API. It may provide support or implement some or all of the following functions: 
       General: 
       [0123]    MobilePhoneAPIStartupA 
         [0124]    MobilePhoneAPIStartupW 
         [0125]    MobilePhoneAPICleanup 
       Profile Functions: 
       [0126]    MobilePhoneProfileFindFirst 
         [0127]    MobilePhoneProfileFindNext 
         [0128]    MobilePhoneProfileFree 
         [0129]    MobilePhoneProfileFindClose 
         [0130]    MobilePhoneProfileQueryValueA 
         [0131]    MobilePhoneProfileQueryValueW 
       Connection Functions: 
       [0132]    MobilePhoneConnectionFindFirst 
         [0133]    MobilePhoneConnectionFindNext 
         [0134]    MobilePhoneConnectionFree 
         [0135]    MobilePhoneConnectionFindClose 
         [0136]    MobilePhoneConnectionQueryValueA 
         [0137]    MobilePhoneConnectionQueryValueW 
         [0138]    MobilePhoneConnectionNotifyChange 
         [0139]    MobilePhoneConnectionCancelNotifyChange 
         [0140]    MobilePhoneConnectionGetSupportedProfiles 
         [0141]    MobilePhoneConnectionFreeSupportedProfiles 
       Session Functions: 
       [0142]    MobilePhoneSessionCreate 
         [0143]    MobilePhoneSessionDestroy 
         [0144]    MobilePhoneSessionQueryValueA 
         [0145]    MobilePhoneSessionQueryValueW 
         [0146]    MobilePhoneSessionSetValueA 
         [0147]    MobilePhoneSessionSetValueW 
         [0148]    MobilePhoneSessionOpenIOFolderA 
         [0149]    MobilePhoneSessionOpenIOFolderW 
         [0150]    MobilePhoneSessionCloseIOFolder 
         [0151]    MobilePhoneSessionIOFolderQueryValueA 
         [0152]    MobilePhoneSessionIOFolderQueryValueW 
         [0153]    MobilePhoneSessionIOFolderSetValueA 
         [0154]    MobilePhoneSessionIOFolderSetValueW 
         [0155]    MobilePhoneSessionIOControl 
         [0156]    MobilePhoneSessionFilterIOControl 
         [0157]    MobilePhoneSessionIOListingFirst 
         [0158]    MobilePhoneSessionIOListingNext 
         [0159]    MobilePhoneSessionIOItemFree 
         [0160]    MobilePhoneSessionIOItemRead 
         [0161]    MobilePhoneSessionIOItemCreate 
         [0162]    MobilePhoneSessionIOItemWrite 
         [0163]    MobilePhoneSessionIOItemDelete 
         [0164]    MobilePhoneSessionIOItemQueryValueA 
         [0165]    MobilePhoneSessionIOItemQueryValueW 
         [0166]    MobilePhoneSessionIOItemSetValueA 
         [0167]    MobilePhoneSessionIOItemSetValueW 
         [0168]    MobilePhoneSessionRegisterNotification 
         [0169]    MobilePhoneSessionUnregisterNotification 
       Additional APIs 
       [0170]    On top of the Mobile Phone API we can implement standard services like MTP, RAPI etc.