WO2012151908A1 - Drive processing method and apparatus - Google Patents

Drive processing method and apparatus Download PDF

Info

Publication number
WO2012151908A1
WO2012151908A1 PCT/CN2011/082364 CN2011082364W WO2012151908A1 WO 2012151908 A1 WO2012151908 A1 WO 2012151908A1 CN 2011082364 W CN2011082364 W CN 2011082364W WO 2012151908 A1 WO2012151908 A1 WO 2012151908A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
protocol
processing module
interface
network driver
Prior art date
Application number
PCT/CN2011/082364
Other languages
French (fr)
Chinese (zh)
Inventor
李焰峰
范锁平
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2012151908A1 publication Critical patent/WO2012151908A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/64Hybrid switching systems
    • H04L12/6418Hybrid transport

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Telephone Function (AREA)
  • Information Transfer Systems (AREA)
  • Computer And Data Communications (AREA)

Abstract

Disclosed are a drive processing method and apparatus. The method includes: receiving a message and judging whether or not the protocol adopted by the message is a protocol supported by the original protocol processing module of the network drive, wherein the network drive is used for directly providing drive to a device; in the situation where the judgment result is no, sending the message to the previously added protocol processing module for processing; and in the situation where the judgment result is yes, sending the message to the original protocol processing module for processing. The present invention can make it easy to transplant to other systems a specific protocol in a certain operating system, thereby making the operating system more extensive.

Description

驱动处理方法及装置 技术领域 本发明涉及通信领域, 具体而言, 涉及一种驱动处理方法及装置。 背景技术 基于全球无线芯片的格局,高通和微软主推的网络驱动接口规范(network driver interface spec, 简称为 NDIS) +高通 MSM接口 (Qualcomm MSM Interface, 简称为 QMI) 的移动宽带设备高速接入方案成为当下移动宽带设备的主流接入方式之一; 但 DIS+QMI的方式目前只在 windows系统上得到了应用,这种接入方式并没有扩 展到更多操作系统上。 对于其他的接入方式也可能存在同样的问题, 即只能在某种 操作系统使用。 对于其他操作系统而言(例如, 安卓 Android移动操作系统), 应用也在不断的 推广, 因此在这些系统上适配各种移动宽带设备成为目前的主要工作之一; 而目前 对只能在某种特定系统上应用的驱动而言, 很难照搬到其他操作系统上来, 例如, 应用于 Windows系统上的 NDIS驱动是 Windows定义的一套规范,很难照搬或者移 植到 Android操作系统上, 因此在 Android系统上无法支持 NDIS设备接入的驱动。 在现有技术中存在对于在某种操作系统上特定的协议无法移植到其他操作系统上 的问题, 目前还没有解决方案。 发明内容 本发明提供了一种驱动处理方法及装置, 以至少解决上述问题。  TECHNICAL FIELD The present invention relates to the field of communications, and in particular to a driving processing method and apparatus. BACKGROUND OF THE INVENTION Based on the global wireless chip format, the high-speed access solution for mobile broadband devices of Qualcomm and Microsoft's network driver interface spec (NDIS) + Qualcomm MSM Interface (QMI) has become One of the mainstream access methods for mobile broadband devices; however, the DIS+QMI method is currently only applied on Windows systems, and this access method has not been extended to more operating systems. The same problem may exist with other access methods, that is, it can only be used in some operating systems. For other operating systems (for example, Android Android mobile operating system), applications are also constantly being promoted, so adapting various mobile broadband devices on these systems has become one of the main tasks at present; For a driver applied to a specific system, it is difficult to copy it to other operating systems. For example, the NDIS driver applied to a Windows system is a set of specifications defined by Windows, which is difficult to copy or port to the Android operating system, so The driver for NDIS device access cannot be supported on the Android system. In the prior art, there is a problem that a specific protocol cannot be ported to another operating system on an operating system, and there is currently no solution. SUMMARY OF THE INVENTION The present invention provides a driving processing method and apparatus to solve at least the above problems.
根据本发明的一方面, 提供了一种驱动处理方法, 包括以下步骤: 接收消息, 并判断所述消息所采用的协议是否为网络驱动的原有的协议处理模块所支持的协 议, 其中, 所述网络驱动用于提供对设备的直接驱动; 在判断结果为否的情况下, 将所述消息发送给预先在所述网络驱动中增加的协议处理模块进行处理; 在判断结 果为是的情况下, 将所述消息发送给所述原有的协议处理模块进行处理。  According to an aspect of the present invention, a driving processing method is provided, including the steps of: receiving a message, and determining whether a protocol adopted by the message is a protocol supported by a network-driven original protocol processing module, where The network driver is configured to provide direct driving to the device; if the determination result is negative, the message is sent to a protocol processing module added in advance in the network driver for processing; if the determination result is yes, Sending the message to the original protocol processing module for processing.
优选地, 所述增加的协议处理模块提供以下接口的至少之一用于支持所述网络 驱动: 初始化接口、 读接口、 写接口、 输入 /输出控制接口。  Preferably, the added protocol processing module provides at least one of the following interfaces for supporting the network driver: an initialization interface, a read interface, a write interface, and an input/output control interface.
优选地, 所述增加的协议处理模块通过所述读接口进行的读操作包括: 检测到 读操作的消息后, 将所述读操作的消息放入读队列中; 在接收到唤醒消息之后, 调 用所述读接口进行所述读操作。 优选地, 所述增加的协议处理模块通过所述写接口进行的写操作包括: 所述增 加的协议处理模块的所述写接口将所述消息以所述网络驱动所支持的格式发送给所 述设备。 Preferably, the read operation performed by the added protocol processing module by the read interface includes: after detecting the message of the read operation, putting the read operation message into the read queue; after receiving the wakeup message, calling The read interface performs the read operation. Preferably, the writing operation by the added protocol processing module by using the write interface comprises: sending, by the write interface of the added protocol processing module, the message to the format supported by the network driver device.
优选地, 所述网络驱动包括: USB设备类通讯-以太网控制模式 CDC-ECM。 优选地, 所述增加的协议处理模块所处理的协议包括: DIS和 /或 QMI。 根据本发明的另一方面, 提供了一种驱动处理装置, 包括: 判断模块, 设置为 接收消息, 并判断所述消息所采用的协议是否为网络驱动的原有的协议处理模块所 支持的协议, 其中, 所述网络驱动用于提供对设备的直接驱动; 处理模块, 设置为 在判断结果为否的情况下, 将所述消息发送给预先在所述网络驱动中增加的协议处 理模块进行处理; 在判断结果为是的情况下, 将所述消息发送给所述原有的协议处 理模块进行处理。  Preferably, the network driver comprises: a USB device type communication-Ethernet control mode CDC-ECM. Preferably, the protocol processed by the added protocol processing module comprises: DIS and / or QMI. According to another aspect of the present invention, a driving processing apparatus is provided, including: a determining module configured to receive a message, and determine whether a protocol adopted by the message is a protocol supported by a network-driven original protocol processing module The network driver is configured to provide direct driving to the device; and the processing module is configured to send the message to a protocol processing module added in advance in the network driver for processing if the determination result is negative. If the judgment result is yes, the message is sent to the original protocol processing module for processing.
优选地, 所述增加的协议处理模块提供以下接口的至少之一用于支持所述网络 驱动: 初始化接口、 读接口、 写接口、 输入 /输出控制接口。  Preferably, the added protocol processing module provides at least one of the following interfaces for supporting the network driver: an initialization interface, a read interface, a write interface, and an input/output control interface.
优选地, 所述网络驱动包括: USB CDC-ECM。  Preferably, the network driver comprises: a USB CDC-ECM.
优选地, 所述增加的协议处理模块所处理的协议包括: DIS和 /或 QMI。 通过本发明, 采用接收消息, 并判断所述消息所采用的协议是否为网络驱动的原 有的协议处理模块所支持的协议, 其中, 所述网络驱动用于提供对设备的直接驱动; 在判断结果为否的情况下, 将所述消息发送给预先在所述网络驱动中增加的协议处理 模块进行处理; 在判断结果为是的情况下, 将所述消息发送给所述原有的协议处理模 块进行处理, 解决了现有技术中存在对于在某种操作系统上特定的协议无法移植到其 他操作系统上问题, 可以使在某种操作系统上的特定的协议比较容易移植到其他系统 上来, 使操作系统有了较大的扩展性。 附图说明 此处所说明的附图用来提供对本发明的进一步理解, 构成本申请的一部分, 本 发明的示意性实施例及其说明用于解释本发明, 并不构成对本发明的不当限定。 在 附图中:  Preferably, the protocol processed by the added protocol processing module comprises: DIS and / or QMI. According to the present invention, the receiving message is used, and it is determined whether the protocol adopted by the message is a protocol supported by the original protocol processing module of the network driver, wherein the network driver is used to provide direct driving to the device; If the result is no, the message is sent to a protocol processing module added in advance in the network driver for processing; if the determination result is yes, the message is sent to the original protocol processing. The module is processed to solve the problem that the specific protocol in a certain operating system cannot be transplanted to other operating systems in the prior art, and the specific protocol on a certain operating system can be easily transplanted to other systems. Make the operating system more scalable. BRIEF DESCRIPTION OF THE DRAWINGS The accompanying drawings, which are set to illustrate,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, In the drawing:
图 1是根据本发明实施例的驱动处理方法的流程图;  1 is a flow chart of a driving processing method according to an embodiment of the present invention;
图 2是根据本发明实施例的驱动处理装置的结构框图;  2 is a block diagram showing the structure of a driving processing apparatus according to an embodiment of the present invention;
图 3是与本发明实施例相关的 Android系统的 USB以太网驱动的示意图; 图 4是根据本发明优选实施例的 Android系统 NDIS驱动方法的示意图; 图 5是根据本发明实施例的写操作的流程图; 图 6是根据本发明实施例的读操作的流程图。 具体实施方式 下文中将参考附图并结合实施例来详细说明本发明。 需要说明的是, 在不冲突 的情况下, 本申请中的实施例及实施例中的特征可以相互组合。 在本实施例中提供了一种驱动处理方法, 图 1是根据本发明实施例的驱动处理 方法的流程图, 如图 1所示, 该方法包括以下步骤: 3 is a schematic diagram of a USB Ethernet driver of an Android system related to an embodiment of the present invention; FIG. 4 is a schematic diagram of an NDIS driving method of an Android system according to a preferred embodiment of the present invention; Figure 5 is a flow diagram of a write operation in accordance with an embodiment of the present invention; Figure 6 is a flow diagram of a read operation in accordance with an embodiment of the present invention. BEST MODE FOR CARRYING OUT THE INVENTION Hereinafter, the present invention will be described in detail with reference to the accompanying drawings. It should be noted that the embodiments in the present application and the features in the embodiments may be combined with each other without conflict. A driving processing method is provided in this embodiment. FIG. 1 is a flowchart of a driving processing method according to an embodiment of the present invention. As shown in FIG. 1, the method includes the following steps:
步骤 S102, 接收消息, 并判断该消息所采用的协议是否为网络驱动的原有的协 议处理模块所支持的协议, 其中, 该网络驱动用于提供对设备的直接驱动;  Step S102: Receive a message, and determine whether the protocol used by the message is a protocol supported by an original protocol processing module of the network driver, where the network driver is used to provide direct driving to the device.
步骤 S104, 在判断结果为否的情况下, 将该消息发送给预先在该网络驱动中增 加的协议处理模块进行处理; 在判断结果为是的情况下, 将该消息发送给原有的协 议处理模块进行处理。  Step S104: If the determination result is negative, the message is sent to the protocol processing module added in advance in the network driver for processing; if the determination result is yes, the message is sent to the original protocol processing. The module processes it.
通过上述步骤, 基于操作系统中原有的网络驱动, 仅仅添加了对其他协议支持 的模块, 而开发者仅仅关注与协议模块的开发即可, 对于网络驱动的处理, 则交由 该操作系统的原有的网络驱动来进行, 对于原有的网络驱动仅仅添加判断的功能皆 可, 不需要进行大量的改动, 对该网络驱动的原有功能并没有带来任何影响, 即实 现了兼容, 又可以是对其他协议的支持很方便的进行移植, 从而使本实施例中的驱 动处理方式有很好的扩展性。  Through the above steps, based on the original network driver in the operating system, only the modules supported by other protocols are added, and the developer only pays attention to the development of the protocol module, and the processing of the network driver is handed over to the original of the operating system. Some network drivers are available. For the original network driver, only the function of adding judgments can be added. There is no need to make a large number of changes, and the original functions of the network driver are not affected, that is, compatibility is achieved, and It is convenient to transplant the support of other protocols, so that the driving processing method in this embodiment has good scalability.
优选地, 可以根据增加的协议处理模块的需要选择提供以下接口的至少之一以 支持网络驱动: 初始化接口、 读接口、 写接口、 输入 /输出控制接口。 在一个优选实施方式中, 对于读操作提供了一种较优的处理方式: 检测到读操 作的消息后, 将读操作的消息放入读队列中; 在接收到唤醒消息之后, 调用读接口 进行读操作。  Preferably, at least one of the following interfaces may be selected to support the network driver according to the needs of the added protocol processing module: an initialization interface, a read interface, a write interface, and an input/output control interface. In a preferred embodiment, a better processing manner is provided for the read operation: after the message of the read operation is detected, the read operation message is put into the read queue; after receiving the wake-up message, the read interface is called. Read operation.
在另一个较优的处理方式, 对于写操作也提供了一种较优的处理方式: 增加的 协议处理模块的写接口将消息以网络驱动所支持的格式发送给设备。 在本实施例中还提供了一种驱动处理装置, 该装置用于实现上述实施例及优选 实施方式, 已经进行过说明的不再赘述。 如以下所使用的, 术语"模块"可以实现预 定功能的软件和 /或硬件的组合。 尽管以下实施例所描述的装置较佳地以软件来实 现, 但是硬件, 或者软件和硬件的组合的实现也是可能并被构想的。 图 2是根据本 发明实施例的驱动处理装置的结构框图, 如图 2所示, 该装置包括判断模块 22和处 理模块 24, 下面对该装置涉及的模块进行说明。 判断模块 22, 设置为接收消息, 并判断该消息所采用的协议是否为网络驱动的 原有的协议处理模块所支持的协议,其中, 该网络驱动用于提供对设备的直接驱动; 处理模块 24, 设置为在判断结果为否的情况下, 将该消息发送给预先在网络驱动中 增加的协议处理模块进行处理; 在判断结果为是的情况下, 将该消息发送给原有的 协议处理模块进行处理。 In another preferred processing mode, a better processing method is also provided for the write operation: The write interface of the added protocol processing module sends the message to the device in a format supported by the network driver. In the embodiment, a driving processing device is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments, and has not been described again. As used hereinafter, the term "module" may implement a combination of software and/or hardware of a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware, is also possible and conceivable. 2 is a block diagram showing the structure of a driving processing apparatus according to an embodiment of the present invention. As shown in FIG. 2, the apparatus includes a judging module 22 and a processing module 24. The modules involved in the apparatus are described below. The determining module 22 is configured to receive the message, and determine whether the protocol used by the message is a protocol supported by the original protocol processing module of the network driver, where the network driver is used to provide direct driving to the device; the processing module 24 , if the judgment result is negative, the message is sent to the protocol processing module added in advance in the network driver for processing; if the determination result is yes, the message is sent to the original protocol processing module. Process it.
对于网络驱动而言可以使用 USB CDC-ECM ( Class Definitions for Communication Devices-Ethernet Control Model),例如在安卓系统中就采用的这种方 式, 在本实施例中, 可以移植的协议包括: NDIS和 /或 QMI, 但并不限于此, 以下 以此为例结合一个优选实施方式进行说明。  For the network driver, the USB CDC-ECM (Class Definitions for Communication Devices-Ethernet Control Model) can be used. For example, in the Android system, in this embodiment, the portable protocols include: NDIS and / Or QMI, but is not limited thereto, and the following description will be made by way of an example with reference to a preferred embodiment.
图 3是与本发明实施例相关的 Android系统的 USB以太网驱动的示意图, 如图 3 is a schematic diagram of a USB Ethernet driver of an Android system related to an embodiment of the present invention, as shown in FIG.
3所示, 包括 Read/Write (读 /写) 接口, 核心空间的 CDC ECM模块、 USB NET模 块和 USB CORE模块, 以及硬件设备 USB设备, USB CDC ECM驱动模型现有驱 动方式通过在 Android系统上枚举出以 USB以太网口,使用 USB CDC ECM驱动模 型所定义的控制协议作为请求, 这种方式是无法支持现有的 NDIS设备的, 更无法 在此驱动方式上实现对 QMI协议的支持。 USB CDC ECM驱动模型是 USB CDC协 议的一部分, 属于标准的 USB协议, 而目前的 NDIS设备并不完全遵守标准的 USB 协议, 它使用了 windows系统的 NDIS规范, 并使用高通自定义的 QMI协议做为主 机与设备通讯的控制协议, 而非 USB CDC ECM驱动模型所定义的控制协议。 3, including Read/Write (read/write) interface, core space CDC ECM module, USB NET module and USB CORE module, and hardware device USB device, USB CDC ECM driver model existing drive mode on Android system The control protocol defined by the USB CDC ECM driver model is enumerated as a request. This method cannot support the existing NDIS device, and it cannot support the QMI protocol in this driver mode. The USB CDC ECM driver model is part of the USB CDC protocol and is part of the standard USB protocol. The current NDIS device does not fully comply with the standard USB protocol. It uses the NDIS specification for Windows and uses Qualcomm's custom QMI protocol. The control protocol for the host to communicate with the device, not the control protocol defined by the USB CDC ECM driver model.
本优选实施例中提供了一种 Android系统上的驱动方法, 用于实现 Android系 统上高速移动宽带设备的驱动和数据接入。  In the preferred embodiment, a driving method on an Android system is provided for implementing driving and data access of a high speed mobile broadband device on an Android system.
现有的 Android系统上已经提供了 USB CDC-ECM的驱动, 本优选实施例在此 驱动的基础上, 实现 NDIS设备的驱动支持, 则既解决了目前 Android系统无法支 持 NDIS设备的接入难题,又为后续 Android系统支持 NDIS设备打下了坚实的基础。  The driver of the USB CDC-ECM has been provided on the existing Android system. On the basis of the driver, the preferred embodiment implements the driving support of the NDIS device, which solves the problem that the current Android system cannot support the access of the NDIS device. It also laid a solid foundation for the subsequent Android system to support NDIS devices.
图 4是根据本发明优选实施例的 Android系统 NDIS驱动方法的示意图,如图 4 所示, 使用了在现有的 USB CDC ECM驱动的基础上增加了 CDC_ENCAP模块, 并 修改了 CDC_ECM模块,其中,增加了 CDC_ENCAP模块,用于对自有协议的支持, 提供自定义的读, 写、 输入 /输出 (input/output, 简称为 I/O) 控制等接口; 修改了 CDC_ECM模块, 用于对设备接入的探测、状态检测、 CDC_ENCAP模块初始化等。 下面对 CDC_ECM模块和 CDC_ENCAP模块进行说明。 CDC_ECM模块 201 : 修改了 CDC_ECM模块, 用于对设备的直接驱动; 在本 模块中, 扩展了现有的驱动中对 USB CDC ECM协议的支持, 增添了 CDC状态检 测中对通知消息 RESPONSE—AVAILABLE的支持 (参考 《usb cdcl.2》 之 3.8.2节, 在此不再赘述), 使得来自移动宽带设备侧的自定义协议 (如 QMI协议) 消息都可 以得到处理; 其次在设备探测阶段(probe), 通过调用 cdc_enCap_init接口, 实现对 自定义协议处理函数, 互斥量、 消息队列的初始化, 从而使得对自定义协议处理的 流程可以转往 CDC_ENCAP模块进行处理。 4 is a schematic diagram of an NDIS driving method of an Android system according to a preferred embodiment of the present invention. As shown in FIG. 4, a CDC_ENCAP module is added to an existing USB CDC ECM driver, and a CDC_ECM module is modified. Added CDC_ENCAP module for support of own protocol, providing customized read, write, input/output (I/O) control interface; modified CDC_ECM module for device connection Intrusion detection, status detection, CDC_ENCAP module initialization, etc. The CDC_ECM module and the CDC_ENCAP module are described below. CDC_ECM module 201: The CDC_ECM module is modified for direct driving of the device; in this module, the support for the USB CDC ECM protocol in the existing driver is extended, and the notification message RESPONSE-AVAILABLE in the CDC state detection is added. Support (refer to section 3.8.2 of “usb cdcl.2”, which will not be described here), so that custom protocol (such as QMI protocol) messages from the mobile broadband device side can be processed; secondly in the device detection phase (probe) ), by calling the cdc_en C ap_init interface, to achieve Custom protocol processing functions, mutex, and message queue initialization, so that the process of custom protocol processing can be transferred to the CDC_ENCAP module for processing.
CDC_ENCAP模块 202: 增加了 CDC_ENCAP模块, 用于封装对自有协议的支 持; 在本模块中, 通过定义了 cdc encap init , cdc encap read, cdc encap write , cdc encap ioctl这样的文件接口,提供对 CDC_ECM模块的支持;其中 cdc_encap_init 接口实现对自定义协议处理函数, 互斥量、消息队列的初始化, 并通过对 linux系统 文件接口结构体 file_operations 的初始化完成了本驱动接口函数的注册; cdc_encap_read 接口通过对 USB 控制消息的形式读取移动终端侧自定义协议的响 应消息; cdc_encap_write接口通过 USB 控制消息的形式将封装好的自定义协议消 息发送到移动宽带设备侧; cdC_encap_i0ctl接口提供了其他 I/O类操作的支持。 CDC_ENCAP Module 202: Added CDC_ENCAP module to encapsulate support for proprietary protocols; In this module, CDC encap init, cdc encap read, cdc encap write, cdc encap ioctl file interface is provided, providing CDC_ECM Module support; the cdc_encap_init interface implements the initialization of the custom protocol handler, mutex, message queue, and the registration of the driver interface function through the initialization of the Linux system file interface structure file_operations; cdc_encap_read interface through USB The control message reads the response message of the mobile terminal side custom protocol; the cdc_encap_write interface sends the encapsulated custom protocol message to the mobile broadband device side in the form of a USB control message; cd C _ enca p_i 0 ctl interface provides other Support for I/O class operations.
USB NET模块 203和 USB CORE模块 204与现有的模块的功能相似, 在此不 再赘述。 下面结合上述模块, 对读写操作进行说明。  The functions of the USB NET module 203 and the USB CORE module 204 are similar to those of the existing modules and will not be described here. The following describes the read and write operations in conjunction with the above modules.
图 5是根据本发明实施例的写操作的流程图, 如图 5所示, 该流程包括如下步 骤:  FIG. 5 is a flowchart of a write operation according to an embodiment of the present invention. As shown in FIG. 5, the flow includes the following steps:
步骤 S501 , 用户态程序调用写操作。  Step S501: The user mode program invokes a write operation.
步骤 S502,驱动根据不同的消息类型,调用不同的处理流程;如果是 USB CDC ECM消息, 转往步骤 S503 ; 否则, 转往步骤 S504;  Step S502, the driver calls different processing processes according to different message types; if it is a USB CDC ECM message, go to step S503; otherwise, go to step S504;
步骤 S503 , 如果是 USB CDC ECM消息、 安装现有驱动的处理流程处理, 转往 步骤 S506; 步骤 S504,如果不是 USB CDC ECM消息,进入本发明驱动的写操作处理流程, 转往步骤 S505;  Step S503, if it is a USB CDC ECM message, the process flow of installing the existing driver, go to step S506; Step S504, if it is not a USB CDC ECM message, enter the write operation process flow driven by the present invention, go to step S505;
步骤 S505, 将上层的写数据, 通过调用 USB CORE的接口进行处理; 步骤 S506, 负责具体的 USB数据写操作;  Step S505, the upper layer of the write data is processed by calling the interface of the USB CORE; step S506, responsible for the specific USB data write operation;
步骤 S507, 判断数据是否写成功, 成功则转往步骤 S508, 否则转往步骤 S509; 步骤 S508, 数据写成功, 返回成功;  Step S507, determining whether the data is successfully written, if successful, proceeding to step S508, otherwise proceeding to step S509; step S508, the data writing is successful, and the return is successful;
步骤 S509, 数据写失败, 进入异常处理;  Step S509, the data write fails, and the exception processing is performed;
图 6是根据本发明实施例的读操作的流程图, 如图 6所示, 该流程包括如下步 骤:  6 is a flow chart of a read operation according to an embodiment of the present invention. As shown in FIG. 6, the flow includes the following steps:
步骤 S601 , 驱动初始化, 初始化读队列, 启动消息检测机制;  Step S601, driving initialization, initializing the read queue, and starting a message detection mechanism;
步骤 S602, 检测 CDC STATUS 消息 (CDC的状态消息), 判断消息类型, 如 果是 CONNECTION消息 (连接消息), 进入步骤 S607, 如果是 SPEED CHANGE 消息 (变速消息) 进入步骤 S608, 如果是 RESPONSE消息 (响应消息) 进入步骤 S609; 步骤 S603 , 用户态程序调用读操作。 Step S602, detecting a CDC STATUS message (a status message of the CDC), determining a message type, such as If it is a CONNECTION message (connection message), the process goes to step S607, if it is a SPEED CHANGE message (shift message) to step S608, if it is a RESPONSE message (response message), the process goes to step S609; in step S603, the user mode program calls the read operation.
步骤 S604, 进行用户态到和核心态的转换后, 进入 CDC_ENCAP模块; 步骤 S605, CDC_ENCAP模块搜到读操作的消息后, 将该消息放进读队列中; 步骤 S606, 读队列中的消息等待被唤醒;  Step S604, after the user state to the core state is converted, enter the CDC_ENCAP module; Step S605, after the CDC_ENCAP module searches for the read operation message, put the message into the read queue; Step S606, the message in the read queue waits to be Wake up
步骤 S607, 解析收到的 CONNECTION消息, 检测有效性后, 按照原有的处理 流程, 转往步骤 S615;  Step S607, parsing the received CONNECTION message, detecting the validity, according to the original processing flow, proceeding to step S615;
步骤 S608, 解析收到的 SPEED CHANGE消息, 检测有效性后, 按照原有的处 理流程, 转往步骤 S615;  Step S608, parsing the received SPEED CHANGE message, after detecting the validity, according to the original processing flow, proceeding to step S615;
步骤 S609, 解析收到的 SPEED CHANGE 消息, 检测有效性后, 唤醒 CDC_ENCAP模块中的读消息队列;  Step S609, parsing the received SPEED CHANGE message, and detecting the validity, waking up the read message queue in the CDC_ENCAP module;
步骤 S610, 判断读队列中的消息是否被唤醒, 唤醒转往步骤 S611 , 否则转往步 骤 S606; 步骤 S611 , 读队列被唤醒后, 判断队列中是否有消息, 如果有转往步骤 S612, 否则转往步骤 S616, 进行异常处理;  Step S610, determining whether the message in the read queue is awakened, and waking up to step S611, otherwise proceeding to step S606; step S611, after the read queue is awakened, determining whether there is a message in the queue, if there is a step S612, otherwise Go to step S616 to perform exception processing;
步骤 S612, 通过接口 CDC_ENCAP_READ进行读处理;  Step S612, performing read processing by using the interface CDC_ENCAP_READ;
步骤 S613 , 判断读处理是否成功, 如果成功则转往步骤 S613处理, 否则转往 步骤 S616, 进行异常处理; 步骤 S614, 返回读操作获取到的数据;  Step S613, determining whether the read processing is successful, if successful, proceeding to step S613, otherwise proceeding to step S616 to perform exception processing; step S614, returning data acquired by the read operation;
步骤 S615, 现有驱动已实现的消息处理流程;  Step S615, the message processing flow that the existing driver has implemented;
步骤 S616, 异常处理。 通过上述实施例实现了如下效果, 需要说明的是, 以下的效果并不是每个实施 均能达到的, 有些效果是有些优选实施例才具有的。  Step S616, exception processing. The following effects are achieved by the above embodiments, and it is to be noted that the following effects are not achieved by each of the embodiments, and some effects are possessed by some preferred embodiments.
1. 扩展了现有的 CDC ECM驱动, 使得现有 CDC ECM驱动既能支持原有的 USB CDC ECM设备, 又能支持新的 NDIS设备, 既兼容了原有的设备驱动, 又使 得一些操作系统 (例如, Android系统) 增加了对 NDIS设备的支持、 现有的 NDIS 设备不需要做任何的修改即可适配到 Android系统使用, 解决了某些操作系统无法 支持 NDIS设备和现有驱动无法有效提高与移动宽带设备之间传输速度的问题。 2. 通用性: NDIS设备无疑会是后续移动宽带设备主流的接入方式之一, 因此 在不支持该协议的操作系统上设计和实现对 NDIS设备的支持, 极大了符合了后续 多制式设备的接入方式和技术的发展趋势, 扩展了操作系统的功能和接入方式的通 用性。 1. Expanded the existing CDC ECM driver, enabling the existing CDC ECM driver to support both the original USB CDC ECM device and the new NDIS device. It is compatible with both the original device driver and some operating systems. (For example, Android system) Added support for NDIS devices, existing NDIS devices can be adapted to Android system without any modification, and some operating systems cannot support NDIS devices and existing drivers cannot be effective. Improve the speed of transmission between mobile broadband devices. 2. Versatility: NDIS equipment will undoubtedly be one of the mainstream access methods for subsequent mobile broadband devices. Therefore, the design and implementation of NDIS devices are supported on operating systems that do not support the protocol, which greatly complies with the subsequent multi-standard devices. The development trend of access methods and technologies extends the versatility of operating system functions and access methods.
3. 扩展性: 上述优选实施例的方案是将 DIS设备的接入方式融入到操作系统 现有的驱动中, 兼容了原有的设备驱动, 没有修改操作系统框架层的架构, 增加了 操作系统对移动宽带设备的接入方式, 增加了操作系统的扩展性; 同时增添了对自 定义协议(如高通的 QMI协议)的支持, 使得上述优选实施例中的驱动方法有更大 的扩展性。  3. Scalability: The solution of the preferred embodiment is to integrate the access mode of the DIS device into the existing driver of the operating system, compatible with the original device driver, without modifying the architecture of the operating system framework layer, and adding an operating system. The access mode of the mobile broadband device increases the scalability of the operating system; at the same time, the support for the custom protocol (such as Qualcomm's QMI protocol) is added, so that the driving method in the above preferred embodiment has greater scalability.
显然, 本领域的技术人员应该明白, 上述的本发明的各模块或各步骤可以用通 用的计算装置来实现, 它们可以集中在单个的计算装置上, 或者分布在多个计算装 置所组成的网络上, 可选地, 它们可以用计算装置可执行的程序代码来实现, 从而 可以将它们存储在存储装置中由计算装置来执行, 或者将它们分别制作成各个集成 电路模块, 或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样, 本发明不限制于任何特定的硬件和软件结合。 以上所述仅为本发明的优选实施例而已, 并不用于限制本发明, 对于本领域的技 术人员来说, 本发明可以有各种更改和变化。 凡在本发明的精神和原则之内, 所作的 任何修改、 等同替换、 改进等, 均应包含在本发明的保护范围之内。  Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general-purpose computing device, which can be concentrated on a single computing device or distributed over a network composed of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device so that they may be stored in the storage device by the computing device, or they may be separately fabricated into individual integrated circuit modules, or Multiple modules or steps are made into a single integrated circuit module. Thus, the invention is not limited to any specific combination of hardware and software. The above description is only a preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes can be made to the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and scope of the present invention are intended to be included within the scope of the present invention.

Claims

权 利 要 求 书 Claim
1. 一种驱动处理方法, 包括以下步骤: 1. A drive processing method comprising the following steps:
接收消息, 并判断所述消息所采用的协议是否为网络驱动的原有的协议处 理模块所支持的协议, 其中, 所述网络驱动用于提供对设备的直接驱动; 在判断结果为否的情况下, 将所述消息发送给预先在所述网络驱动中增加 的协议处理模块进行处理; 在判断结果为是的情况下, 将所述消息发送给所述 原有的协议处理模块进行处理。  Receiving a message, and determining whether the protocol used by the message is a protocol supported by an original protocol processing module of the network driver, where the network driver is used to provide direct driving to the device; And sending the message to a protocol processing module added in advance in the network driver for processing; if the determination result is yes, sending the message to the original protocol processing module for processing.
2. 根据权利要求 1所述的方法, 其中, 所述增加的协议处理模块提供以下接口的 至少之一用于支持所述网络驱动: 2. The method of claim 1, wherein the added protocol processing module provides at least one of the following interfaces for supporting the network driver:
初始化接口、 读接口、 写接口、 输入 /输出控制接口。  Initialize interface, read interface, write interface, input/output control interface.
3. 根据权利要求 2所述的方法, 其中, 所述增加的协议处理模块通过所述读接口 进行的读操作包括: The method according to claim 2, wherein the read operation performed by the added protocol processing module by using the read interface comprises:
检测到读操作的消息后, 将所述读操作的消息放入读队列中; 在接收到唤醒消息之后, 调用所述读接口进行所述读操作。  After detecting the message of the read operation, the message of the read operation is put into the read queue; after receiving the wake-up message, the read interface is called to perform the read operation.
4. 根据权利要求 2所述的方法, 其中, 所述增加的协议处理模块通过所述写接口 进行的写操作包括: 4. The method according to claim 2, wherein the writing by the added protocol processing module through the write interface comprises:
所述增加的协议处理模块的所述写接口将所述消息以所述网络驱动所支持 的格式发送给所述设备。  The write interface of the added protocol processing module sends the message to the device in a format supported by the network driver.
5. 根据权利要求 1 至 4 中任一项所述的方法, 其中, 所述网络驱动包括: USB CDC-ECM。 The method according to any one of claims 1 to 4, wherein the network driver comprises: a USB CDC-ECM.
6. 根据权利要求 5所述的方法, 其中, 所述增加的协议处理模块所处理的协议包 括: DIS和 /或 QMI。 6. The method according to claim 5, wherein the protocol processed by the added protocol processing module comprises: DIS and/or QMI.
7. 一种驱动处理装置, 包括: 7. A drive processing device comprising:
判断模块, 设置为接收消息, 并判断所述消息所采用的协议是否为网络驱 动的原有的协议处理模块所支持的协议, 其中, 所述网络驱动用于提供对设备 的直接驱动; 处理模块, 设置为在判断结果为否的情况下, 将所述消息发送给预先在所 述网络驱动中增加的协议处理模块进行处理; 在判断结果为是的情况下, 将所 述消息发送给所述原有的协议处理模块进行处理。 根据权利要求 7所述的装置, 其中, 所述增加的协议处理模块提供以下接口的 至少之一用于支持所述网络驱动: The determining module is configured to receive the message, and determine whether the protocol used by the message is a protocol supported by the original protocol processing module of the network driver, where the network driver is used to provide direct driving to the device; The processing module is configured to: if the determination result is negative, send the message to a protocol processing module added in advance in the network driver for processing; if the determination result is yes, send the message to The original protocol processing module performs processing. The apparatus of claim 7, wherein the added protocol processing module provides at least one of the following interfaces for supporting the network driver:
初始化接口、 读接口、 写接口、 输入 /输出控制接口。 根据权利要求 7或 8所述的装置, 其中, 所述网络驱动包括: USB设备类通讯 -以太网控制模式 CDC-ECM。 根据权利要求 7或 8所述的装置, 其中, 所述增加的协议处理模块所处理的协 议包括: 网络驱动接口规范 DIS和 /或高通 MSM接口 QMI。  Initialize interface, read interface, write interface, input/output control interface. The apparatus according to claim 7 or 8, wherein the network driver comprises: a USB device type communication - an Ethernet control mode CDC-ECM. The apparatus according to claim 7 or 8, wherein the protocol handled by the added protocol processing module comprises: a network driver interface specification DIS and/or a Qualcomm MSM interface QMI.
PCT/CN2011/082364 2011-08-16 2011-11-17 Drive processing method and apparatus WO2012151908A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201110234870.1A CN102385557B (en) 2011-08-16 2011-08-16 Drive processing method and processing device
CN201110234870.1 2011-08-16

Publications (1)

Publication Number Publication Date
WO2012151908A1 true WO2012151908A1 (en) 2012-11-15

Family

ID=45824986

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/082364 WO2012151908A1 (en) 2011-08-16 2011-11-17 Drive processing method and apparatus

Country Status (2)

Country Link
CN (1) CN102385557B (en)
WO (1) WO2012151908A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102707997B (en) * 2012-06-12 2014-06-11 中兴通讯股份有限公司 Device and method for driving multi-PDP data communication of mobile broadband equipment
CN103634944B (en) * 2012-08-20 2018-10-26 南京中兴新软件有限责任公司 The operating mode of data card type terminal determines method, apparatus and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1722688A (en) * 2004-02-13 2006-01-18 微软公司 Extensible framework for connecting to a wireless network
CN1912832A (en) * 2005-08-11 2007-02-14 技嘉科技股份有限公司 Communication device and its start method
US20070216944A1 (en) * 2006-03-17 2007-09-20 Canon Kabushiki Kaisha Information processing apparatus and print setting reflection method pertaining to an information processing apparatus

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1722688A (en) * 2004-02-13 2006-01-18 微软公司 Extensible framework for connecting to a wireless network
CN1912832A (en) * 2005-08-11 2007-02-14 技嘉科技股份有限公司 Communication device and its start method
US20070216944A1 (en) * 2006-03-17 2007-09-20 Canon Kabushiki Kaisha Information processing apparatus and print setting reflection method pertaining to an information processing apparatus

Also Published As

Publication number Publication date
CN102385557A (en) 2012-03-21
CN102385557B (en) 2018-01-30

Similar Documents

Publication Publication Date Title
KR101130474B1 (en) Generic usb drivers
CN102739634B (en) Host device suspending communication link to client device based on client device notification
JP5657799B2 (en) System and method for facilitating wireless communication during a pre-boot phase of a computer device
KR102482670B1 (en) An electronic device for transmitting and receiving data in a wireless communication system and a method thereof
US20110294500A1 (en) Power saving method of mobile device and communication system thereof
JP2007048262A (en) Multimedia program download control system and method for device provided with multimedia processor
WO2013178167A1 (en) Data card and communication method and system therefor
WO2009081593A1 (en) Communication terminal, communication method, and communication program
WO2022143295A1 (en) Method for upgrading firmware, and related device
JP4943650B2 (en) System for multimedia rendering on portable devices
US20190013962A1 (en) Modular communication framework
WO2012100504A1 (en) Wireless communication method, wireless communication system and wireless communication terminal
EP2193688A1 (en) Network allocation
JP5143191B2 (en) System, server device, and method for using peripheral device
WO2012151998A1 (en) Data processing method and drive apparatus for mobile broadband device
WO2012151908A1 (en) Drive processing method and apparatus
JP2009129450A (en) Techniques for providing software patch to computer system
JP2006277204A (en) Portable communication terminal device
US9619005B2 (en) Apparatus and method for saving power of USB device
CN110781014B (en) Recording data multi-process distribution method and system based on Android device
WO2016206437A1 (en) Rom package generation method and device
WO2016179944A1 (en) Function multiplexing method and apparatus for communication interface
US9367334B2 (en) Vibrator and audio resource sharing for mobile communication device
TWI413387B (en) Wireless communication unit and method of running code therein
TWI791316B (en) Method and system for implementing inter-process communications

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11865029

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11865029

Country of ref document: EP

Kind code of ref document: A1