WO2013189388A2 - Usb network card access method, usb network card and pc - Google Patents

Usb network card access method, usb network card and pc Download PDF

Info

Publication number
WO2013189388A2
WO2013189388A2 PCT/CN2013/081897 CN2013081897W WO2013189388A2 WO 2013189388 A2 WO2013189388 A2 WO 2013189388A2 CN 2013081897 W CN2013081897 W CN 2013081897W WO 2013189388 A2 WO2013189388 A2 WO 2013189388A2
Authority
WO
WIPO (PCT)
Prior art keywords
descriptor
configuration information
network card
configuration
usb network
Prior art date
Application number
PCT/CN2013/081897
Other languages
French (fr)
Chinese (zh)
Other versions
WO2013189388A3 (en
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 WO2013189388A2 publication Critical patent/WO2013189388A2/en
Publication of WO2013189388A3 publication Critical patent/WO2013189388A3/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/4401Bootstrapping
    • G06F9/4406Loading of operating system

Definitions

  • the present invention relates to the field of embedded technologies, and in particular, to a method for accessing a universal serial BUS (USB) network card, a USB network card, and a PC.
  • USB universal serial BUS
  • USB virtual NICs are plug-and-play and hot-swappable as a common way to connect to the network.
  • CD-ROM Compact Disc-ROM
  • CM Connection Manager
  • Drivers are used to drive USB NICs.
  • CM software provides users with networking. And access interfaces for text messages, phone books, etc.
  • the above method will undoubtedly generate hardware costs, and each USB network card must be accompanied by a CD. Therefore, in order to solve this drawback, the USB virtual disc mechanism was used later.
  • the USB network card is first connected to the computer, and the user is presented with a virtual CD.
  • the CD media stores the CM installation program and driver installation program. After the user installs, the USB network card will perform a mode switch and switch to the normal working mode. Communicate with the USB network card through the installed CM software.
  • the above method is currently the most widely used method of USB network card, but there are still some problems in this way, the most significant being compatibility issues and user experience.
  • Compatibility problem performance The system used by the user has a MAC system and all windows systems, and may be Linux. For Windows alone, there are many yellow exclamation marks, which may cause the port to be unusable. Of course, there are many ports that cannot be connected and cannot be connected. Failure issues are related to a particular system.
  • User experience performance Because of the CM software and drivers installed, the user must wait a certain amount of time (a few minutes) to use the data card.
  • USB network card In response to the above deficiencies, the development of a free drive USB network card.
  • the drive-free USB NIC actually borrows the advantages of the Windows system and the MAC system and the Ethernet card driver that comes with the Linux system.
  • the NIC is the RNDIS (Remote Network Driver Interface Specification) and ECM (Ethernet Control). Model, Ethernet control model) device, the operating system comes with such device drivers, thus achieving drive-free.
  • the RNDIS driver needs a boot file to help the device install the driver, so it still needs an additional installation step, involving the installation, and therefore the virtual CD-ROM and mode switching, so the above-mentioned free drive is not really a drive-free.
  • the first SCSI is received
  • the technical problem to be solved by the present invention is to provide a method for accessing a USB network card, a USB network card and a PC, so as to realize a drive-free access to the wireless network.
  • the present invention provides a method for accessing a USB network card, including: after the USB network card accesses the PC to perform a power-on operation, the device descriptor and the configuration descriptor are reported according to the request of the PC;
  • the PC receives and selects configuration information supporting the current operating system according to the device descriptor and the configuration descriptor, and loads a device driver corresponding to the configuration information.
  • the PC selects configuration information supporting the current operating system according to the device descriptor and the configuration descriptor, and loads the device driver corresponding to the configuration information, including:
  • the PC sends a configuration request to the USB network card to support the Windows system;
  • the USB network card reports to the PC to support configuration information of the windows system
  • the PC After obtaining the string descriptor from the configuration information, the PC sends a request for obtaining the extended attribute descriptor of the Microsoft to the USB network card;
  • the USB network card After receiving the request, the USB network card reports the Microsoft extended attribute feature description to the PC; After receiving the Microsoft extended attribute feature descriptor, the PC loads the corresponding device driver according to the Microsoft extended attribute feature descriptor.
  • the configuration information supporting the windows system includes any one of the following:
  • Remote network drive interface specification configuration information configuration information
  • read-only disc configuration information configuration information
  • human interface device configuration information
  • the above method further has the following feature: the Microsoft extended attribute feature descriptor includes: an extended compatible ID feature descriptor and an extended attribute feature descriptor.
  • the PC selects and supports the configuration of the current operating system according to the device descriptor and the configuration descriptor, and loads the device driver corresponding to the configuration, including:
  • the PC sends a request for supporting the configuration of the non-windows system to the USB network card;
  • the USB network card reports configuration information of the non-windows system to the PC; the PC loads a device driver corresponding to the configuration information.
  • the configuration information of the non-windows system includes:
  • Ethernet control model device configuration information
  • the present invention further provides a USB network card, comprising: a data storage module, configured to: store hardware manufacturer device information, including multiple sets of configuration information and descriptor information;
  • the information reporting module is configured to: after the PC is powered on, report the device descriptor and the configuration descriptor according to the request of the PC.
  • the above USB network card further has the following features:
  • the information reporting module is further configured to: after receiving the configuration request sent by the PC to support the windows system, report the configuration information of the support windows system to the PC; and receive the extended extended attribute feature of the PC by receiving the PC After the request of the descriptor, report the Microsoft extension to the PC Exhibition attribute feature descriptor.
  • the above USB network card further has the following features:
  • the configuration information supporting the windows system includes any one of the following:
  • the Microsoft extended attribute feature descriptor includes:
  • Extended compatible ID feature descriptors and extended attribute feature descriptors are extended compatible ID feature descriptors and extended attribute feature descriptors.
  • the above USB network card further has the following features:
  • the information reporting module is further configured to: after receiving the configuration request sent by the PC to support the non-windows system, report the configuration information supporting the non-windows system to the PC.
  • the configuration information of the non-windows system includes:
  • Ethernet control model device configuration information
  • the present invention further provides a personal computer, comprising: a data receiving module, configured to: receive and select configuration information supporting a current operating system according to the device descriptor and the configuration descriptor;
  • Load the module set to: Load the device driver corresponding to the configuration information.
  • the data receiving module is configured to: when the operating system is a windows system, send a configuration request to the USB network card to support the windows system, and receive configuration information of the windows system supported by the USB network card, After obtaining the string descriptor from the configuration information, sending a request for acquiring the Microsoft extended attribute feature descriptor to the USB network card, and receiving the Microsoft extended attribute feature descriptor reported by the USB network card;
  • the loading module is configured to: load a corresponding device driver according to the Microsoft extended attribute feature descriptor.
  • the data receiving module is configured to: when the operating system is a non-windows system, send a configuration request to the USB network card to support the non-windows system, Receiving configuration information supported by the USB network card to support a non-windows system;
  • the loading module is configured to: load a device driver corresponding to the configuration information.
  • the embodiment of the present invention provides a method for accessing a USB network card, a USB network card, and a PC, which can solve the problem that the file installation and mode switching are required to access the wireless network in the above-mentioned drive-free solution, thereby improving the user experience.
  • FIG. 1 is a schematic diagram of a system for accessing a USB network card according to an embodiment of the present invention
  • FIG. 2 is a flowchart of a method for accessing a USB network card according to an embodiment of the present invention
  • FIG. 3 is a flow chart of a method for accessing a USB network card according to an embodiment of the present invention.
  • FIG. 1 is a schematic diagram of a system for accessing a USB network card according to an embodiment of the present invention.
  • the system of this embodiment includes: a USB device side (ie, a USB network card) and a PC, where
  • the USB NIC includes two modules: an information reporting module and a data storage module, wherein the data storage module is responsible for storing device information of the hardware manufacturer, including device hardware manufacturer information, multiple sets of configuration information, and feature descriptor information;
  • the information reporting module is responsible for dealing with the PC.
  • the information reporting module reads the corresponding data from the data storage module and returns it to the PC.
  • the information reporting module may be configured to: after accessing the PC to perform a power-on operation, report the device descriptor and the configuration descriptor according to the request of the PC.
  • the information reporting module may be further configured to: after receiving the configuration request sent by the PC to support the windows system, report the configuration information of the support windows system to the PC; and receive the extended extended attribute feature of the PC by receiving the PC After the request of the descriptor, the Microsoft extended attribute feature descriptor is reported to the PC.
  • the information reporting module may be further configured to: after receiving the configuration request sent by the PC to support the non-windows system, report the configuration information of the non-windows system to the PC.
  • the PC side may include two functional modules: a data receiving module and a loading module, wherein the data receiving module is responsible for communicating with the information reporting module on the USB device side, and the information reported by the USB side is stored in the data receiving module;
  • the load module provides a special mechanism for placing received data to a specified location by modifying the key values in the registry.
  • the data receiving module may be specifically configured to: when the operating system is a windows system, send a configuration request to the USB network card to support the windows system, and receive configuration information of the windows system supported by the USB network card. After obtaining the string descriptor from the configuration information, the request for obtaining the Microsoft extended attribute feature descriptor is sent to the USB network card, and the Microsoft extended attribute feature descriptor reported by the USB network card is received;
  • the loading module may be specifically configured to load a corresponding device driver according to the Microsoft extended attribute feature descriptor.
  • the data receiving module is specifically configured to: when the operating system is a non-windows system, send a support request to the USB network card to support the non-windows system, and receive the non-windows system reported by the USB network card.
  • Configuration information when the operating system is a non-windows system, send a support request to the USB network card to support the non-windows system, and receive the non-windows system reported by the USB network card.
  • the loading module is specifically configured to load a device driver corresponding to the configuration information.
  • FIG. 2 is a flowchart of a method for accessing a USB network card according to an embodiment of the present invention. As shown in FIG. 2, the method in this embodiment may include:
  • the PC receives and selects configuration information supporting the current operating system according to the device descriptor and the configuration descriptor, and loads a device driver corresponding to the configuration information.
  • FIG. 3 is a flowchart of a method for accessing a USB network card according to an embodiment of the present invention. As shown in FIG. 3, the following steps may be included:
  • Step 101 First, the USB network card is connected to the PC, and the power-on operation is performed.
  • Step 102 The USB network card receives the request for acquiring the descriptor sent by the PC, and performs reporting of the device descriptor, where the last digit of the device descriptor is set as the number of configuration descriptors.
  • the device descriptor is used to describe the overall information of the USB device, such as the device class, subclass information, vendor information, and the number of configurations supported by the device.
  • the configuration descriptor describes the number of interfaces supported by the configuration and the configuration values. .
  • Step 103 The PC sends a USB request for obtaining a configuration descriptor, and the USB network card performs reporting of multiple sets of configuration descriptors.
  • the Microsoft OS Descriptor provides a way for IHVs (Independent Hardware Vendors) to store various vendor-specific information in the device firmware called OS Feature Descriptors.
  • IHV Independent Hardware Vendors
  • OS Feature Descriptors For devices that implement new feature types, often without proper class and subclass code, IHV can circumvent this problem by storing information in the firmware as an extended compatible ID (Identifier) OS feature descriptor. Microsoft can then get this information when the USB device is plugged in and use it to help determine which default driver to load. Additional information or attributes that the vendor needs to provide to the OS can be stored in the extended attribute OS feature descriptor.
  • USB NIC must first choose which device type it needs to implement. It can report itself as an RNDIS device or a CDROM or HID (Human Interface Device) device type, provided that the Microsoft system comes with these devices. drive.
  • the USB NIC of this embodiment needs to support Microsoft OS descriptors (OS string descriptors and OS feature descriptors).
  • the OS string descriptor is stored in the string index OxEE location.
  • the USB NIC reports the non-zero bMS- VendorCode when the OS obtains the string descriptor (this is a field in the descriptor, which is the code defined by each vendor, which is provided for identification by the Microsoft operating system) and satisfies Microsoft's OS word.
  • the definition of the string descriptor then the operating system will further issue the OS feature descriptor.
  • This embodiment supports two feature descriptors, an extended compatible ID feature descriptor and an extended attribute feature descriptor.
  • the OS feature descriptor can carry data up to 16Mb in size. This size is sufficient. To place any data information that the hardware vendor wants to provide.
  • the extended compatible ID feature descriptor is used to help the OS find a compatible system driver, and the extended attribute descriptor is used to store some special information, such as UI (user interface) files, shortcuts, and the like.
  • the operating system will automatically read the remaining portion.
  • Step 104.1 Windows system does not support multiple sets of configuration, so only ask for the first set of configuration, that is, RNDIS configuration information, or other device types that the operating system can provide.
  • the PC sends a request to obtain a configuration descriptor to request, and the USB network card returns the RNDIS configuration information to the PC.
  • the RNDIS driver is a system driver. As long as the correct feature descriptor is provided, the driver can be automatically loaded, which is in line with the purpose of this embodiment. Due to some vulnerabilities in the XP system, the RNDIS driver cannot be automatically loaded.
  • the device side of this embodiment provides a special extended attribute descriptor, which can copy the inf file (the driven index file) and other information to the specified directory, so it can also be done. To drive free.
  • Step 104.2 The driver layer of the USB network card performs RNDIS configuration information or CDROM (read-only disc) configuration information or HID (Human Interface Device) configuration information, and the configuration information includes a communication interface and a device interface, and further includes necessary Function descriptor.
  • RNDIS configuration information or CDROM (read-only disc) configuration information or HID (Human Interface Device) configuration information
  • HID Human Interface Device
  • Step 104.3 the PC obtains the string descriptor of the OxEE location, writes the bMS_VendorCode value to the registry, and the operating system issues GET_MS_DESCRIPTOR (obtains the Microsoft extended attribute feature descriptor).
  • the driver layer of the USB NIC reports the feature descriptor. If the data length stored in the USB NIC device side buffer is greater than the maximum hexadecimal number OxFF of one byte, the operating system will continue to read the remaining data until the end. The data length is less than 0xFF.
  • Step 104.4 For the feature descriptor reported by the USB NIC, the extended compatible ID is used to instruct the operating system to load the corresponding device driver, and each attribute section of the extended attribute feature descriptor may guide the operating system to perform a series of actions, such as , storing information to a defined location, creating shortcuts, modifying the registry, etc. This series of actions can complete the installation of the web UI and PC UI. After the operating system and the USB device of the PC complete the remaining information interaction, go to step 106.
  • a series of actions such as , storing information to a defined location, creating shortcuts, modifying the registry, etc.
  • the operating system transfers the UI and other information that needs to be installed to the location specified on the PC (Personal Computer) side through the mechanism of the Microsoft OS Descriptor, thus realizing the automatic installation of the UI and other installation information during the USB device reporting process, without unnecessary
  • the reporting and mode switching process of the virtual optical disk device greatly improves the user experience and reduces the occurrence of compatibility problems.
  • USB NIC devices can be configured in two working modes, specifically embodied in device descriptors and configuration descriptors.
  • the value of bNumConfigurations (the number of configuration descriptors, which is a field of the descriptor) in the device descriptor needs to be set to the number of devices that the device can support.
  • the device stores the first configuration and the second configuration on the USB.
  • the first set is configured to support the RNDIS port mode of the Windows system
  • the second set is configured to support the ECM mode of the non-windows system.
  • the first set of configuration information is identified. If there is no matching system driver, then the second set of configurations is checked. If there is a matching system driver, the second set of configurations is used.
  • the port can be loaded in the shortest time >3 ⁇ 4 and the driver is loaded.
  • Step 105.1 non-windows systems will ask for the number of configuration descriptors reported by the device descriptor.
  • pattern matching is performed on multiple configuration descriptors provided by the USB network card device. If there is a corresponding driver, the corresponding system driver is loaded, and if not, the installation is not performed.
  • This embodiment provides two sets of configurations, one for the Windows system, one for the RNDIS device, one for the non-windows system, and the composite device for the ECM+ disc.
  • Non-windows systems will automatically select the second set of configurations.
  • Step 105.2 the USB device performs the reporting of the ECM and the optical disc composite device again.
  • Non-windows systems will ask for multiple sets of configurations one by one, and USB devices are configured according to the system.
  • the descriptor index is reported.
  • ECM+ discs are mainly used to place some software on the disc device, which makes it easier for users to use some functions of the data card, such as phone book, text message and so on.
  • the ECM device can also be used for reporting.
  • the device side can be set up to connect to the PC and then automatically connect to the network.
  • the PC After receiving the report, the PC selects which configuration to use based on whether there are several sets of configured drive information in the system. Since the non-windows system does not support the RNDIS driver, the PC automatically loads the ECM and the CD device driver. After that, the user can complete the installation of the software in the CD and perform the networking operation according to his own needs.
  • Step 106 Complete the entire enumeration process, and the USB network card is ready to enter the normal working mode.
  • the RNDIS device and the ECM device mentioned in the above embodiments it is possible to convert to other device types that other systems provide for driving.
  • the embodiment of the invention provides a method for accessing a USB network card, a USB network card and a PC, which can solve the problem that the file installation and mode switching need to be performed in the above-mentioned drive-free solution to access the wireless network, thereby improving the user experience.

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Systems (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

A USB network card access method, a USB network card and a PC. The method comprises: after accessing a PC to conduct a power-on operation, a USB network card reporting a device descriptor and a configuration descriptor according to a request of the PC; and the PC receiving same, selecting configuration information which supports the current operating system according to the device descriptor and the configuration descriptor, and loading a device drive corresponding to the configuration information. The embodiments of the present invention can solve the problem of accessing a wireless network but needing to conduct file installation and mode switching in the abovementioned drive-free solution, thereby improving the user experience.

Description

一种接入 USB网卡的方法、 USB网卡及 PC  Method for accessing USB network card, USB network card and PC
技术领域 Technical field
本发明涉及嵌入式技术领域,尤其涉及一种接入通用串行总线(Universal Serial BUS, 简称 USB ) 网卡的方法、 USB网卡及 PC。  The present invention relates to the field of embedded technologies, and in particular, to a method for accessing a universal serial BUS (USB) network card, a USB network card, and a PC.
背景技术 Background technique
随着 USB技术的不断成熟, USB虚拟网卡以即插即用和热插拔功能成 为连接网络的一种常用方式。 USB 网卡发展初期, 与 USB产品一起销售给 用户的还有一个光盘, 这个光盘提供了 CM ( Connection Manager, 连接管理 器)软件和驱动程序, 驱动程序用于驱动 USB网卡, CM软件提供给用户联 网以及短信、 电话本等的访问接口。  As USB technology continues to mature, USB virtual NICs are plug-and-play and hot-swappable as a common way to connect to the network. At the beginning of the development of USB NICs, there is also a CD-ROM that is sold to users along with USB products. This CD provides CM (Connection Manager) software and drivers. Drivers are used to drive USB NICs. CM software provides users with networking. And access interfaces for text messages, phone books, etc.
上面这种方式无疑会产生硬件成本, 每个 USB网卡都要附带一个光盘。 因此为了解决这个弊端, 后面釆用了 USB虚拟光盘机制。 USB 网卡首次接 入计算机, 呈现给用户的是一个虚拟的光盘, 光盘介质中存放有 CM安装程 序和驱动安装程序, 用户安装之后, USB网卡会进行一次模式切换, 切换到 正常工作模式,用户可以通过安装的 CM软件与 USB网卡进行通信。上面这 种方式是目前 USB网卡应用最广的一种使用方式,但是这种方式还是会存在 一定的问题, 最显著的就是兼容问题和用户体验。  The above method will undoubtedly generate hardware costs, and each USB network card must be accompanied by a CD. Therefore, in order to solve this drawback, the USB virtual disc mechanism was used later. The USB network card is first connected to the computer, and the user is presented with a virtual CD. The CD media stores the CM installation program and driver installation program. After the user installs, the USB network card will perform a mode switch and switch to the normal working mode. Communicate with the USB network card through the installed CM software. The above method is currently the most widely used method of USB network card, but there are still some problems in this way, the most significant being compatibility issues and user experience.
兼容问题表现:用户使用的系统有 MAC系统以及所有的 windows系统, 还有可能是 Linux, 单针对 windows, 就有很多黄叹号问题, 导致端口无法使 用; 当然还有很多无端口、 无法联网以及切换失败问题, 都与特定的系统有 关。 用户体验表现: 由于要安装 CM软件以及驱动, 用户必须要等待一定的 时间 (数分钟) 才能使用该数据卡。  Compatibility problem performance: The system used by the user has a MAC system and all windows systems, and may be Linux. For Windows alone, there are many yellow exclamation marks, which may cause the port to be unusable. Of course, there are many ports that cannot be connected and cannot be connected. Failure issues are related to a particular system. User experience performance: Because of the CM software and drivers installed, the user must wait a certain amount of time (a few minutes) to use the data card.
针对以上不足, 目前研发出了免驱 USB网卡。 免驱 USB网卡实际是借 用了 windows系统和 MAC系统以及 Linux系统自带的以太网卡驱动的优势, 将网卡上才艮为 RNDIS ( Remote Network Driver Interface Specification, 远程网 络驱动接口规范 )和 ECM ( Ethernet Control Model, 以太网控制模型 )设备, 操作系统中自带了这类设备驱动, 从而实现了免驱。 但是对于 windows系统 来说, RNDIS驱动需要一个引导文件来帮助设备安装驱动, 因此还是需要多 出一个安装步骤, 涉及到安装, 也就少不了虚拟光驱和模式切换, 因此上面 的免驱并非真正意义上的免驱。对于 MAC和 Linux系统,在收到第一条 SCSIIn response to the above deficiencies, the development of a free drive USB network card. The drive-free USB NIC actually borrows the advantages of the Windows system and the MAC system and the Ethernet card driver that comes with the Linux system. The NIC is the RNDIS (Remote Network Driver Interface Specification) and ECM (Ethernet Control). Model, Ethernet control model) device, the operating system comes with such device drivers, thus achieving drive-free. But for windows system In fact, the RNDIS driver needs a boot file to help the device install the driver, so it still needs an additional installation step, involving the installation, and therefore the virtual CD-ROM and mode switching, so the above-mentioned free drive is not really a drive-free. For MAC and Linux systems, the first SCSI is received
( Small Computer System Interface , 小型计算机系统专用接口)指令的时候 判断是否收到 OS ( Operating System, 操作系统 )描述符, 没有收到 OS描述 符, 那么切换到 ECM模式, 但是这种切换时间较晚, 必须要加载完成 MS(Small Computer System Interface, Small Computer System Interface) When determining whether to receive the OS (Operating System) descriptor and not receiving the OS descriptor, switch to ECM mode, but this switching time is later. , must be loaded to complete the MS
(微软)驱动和光驱驱动才行, 而且光盘设备会出现然后消失, 用户可以感 知到这一变化, 用户体验方便不是太好, 而且由于有电话本以及短信业务, 必须给用户一些访问接口, 所以免驱设备也进行了 CM软件的安装。 发明内容 (Microsoft) driver and CD-ROM drive, and the CD-ROM device will appear and then disappear, the user can perceive this change, the user experience is not very convenient, and because there are phone book and SMS service, the user must be given some access interface, so The drive-free device was also installed with the CM software. Summary of the invention
本发明要解决的技术问题是提供一种接入 USB 网卡的方法、 USB 网卡 及 PC, 以实现免驱接入无线网络。  The technical problem to be solved by the present invention is to provide a method for accessing a USB network card, a USB network card and a PC, so as to realize a drive-free access to the wireless network.
为了解决上述技术问题,本发明提供了一种接入 USB网卡的方法,包括: USB网卡接入 PC进行上电操作后, 根据所述 PC的请求, 上报设备描 述符和配置描述符;  In order to solve the above technical problem, the present invention provides a method for accessing a USB network card, including: after the USB network card accesses the PC to perform a power-on operation, the device descriptor and the configuration descriptor are reported according to the request of the PC;
所述 PC接收并根据所述设备描述符和所述配置描述符选择支持当前操 作系统的配置信息, 加载与该配置信息对应的设备驱动。  The PC receives and selects configuration information supporting the current operating system according to the device descriptor and the configuration descriptor, and loads a device driver corresponding to the configuration information.
优选地, 上述方法还具有下面特点: 所述 PC根据所述设备描述符和所 述配置描述符选择支持当前操作系统的配置信息, 加载与该配置信息对应的 设备驱动, 包括:  Preferably, the foregoing method further has the following features: the PC selects configuration information supporting the current operating system according to the device descriptor and the configuration descriptor, and loads the device driver corresponding to the configuration information, including:
如所述 PC当前操作系统为 windows系统, 则所述 PC向所述 USB网卡 发送索要支持 windows系统的配置请求;  If the current operating system of the PC is a windows system, the PC sends a configuration request to the USB network card to support the Windows system;
所述 USB网卡向所述 PC上报支持 windows系统的配置信息;  The USB network card reports to the PC to support configuration information of the windows system;
所述 PC从所述配置信息中获取字串描述符后, 向所述 USB网卡下发获 取微软扩展属性特征描述符的请求;  After obtaining the string descriptor from the configuration information, the PC sends a request for obtaining the extended attribute descriptor of the Microsoft to the USB network card;
所述 USB网卡接收到所述请求后向所述 PC上报微软扩展属性特征描述 付; 所述 PC接收到所述微软扩展属性特征描述符后, 根据所述微软扩展属 性特征描述符加载对应的设备驱动。 After receiving the request, the USB network card reports the Microsoft extended attribute feature description to the PC; After receiving the Microsoft extended attribute feature descriptor, the PC loads the corresponding device driver according to the Microsoft extended attribute feature descriptor.
优选地, 上述方法还具有下面特点: 所述支持 windows系统的配置信息 包括以下任一种:  Preferably, the above method further has the following features: The configuration information supporting the windows system includes any one of the following:
远程网络驱动接口规范配置信息、 只读光盘配置信息和人机接口设备配 置信息。  Remote network drive interface specification configuration information, read-only disc configuration information, and human interface device configuration information.
优选地,上述方法还具有下面特点:所述微软扩展属性特征描述符包括: 扩展兼容 ID特征描述符和扩展属性特征描述符。  Preferably, the above method further has the following feature: the Microsoft extended attribute feature descriptor includes: an extended compatible ID feature descriptor and an extended attribute feature descriptor.
优选地, 上述方法还具有下面特点: 所述 PC根据所述设备描述符和所 述配置描述符选择支持当前操作系统的配置,加载与该配置对应的设备驱动, 包括:  Preferably, the foregoing method further has the following features: the PC selects and supports the configuration of the current operating system according to the device descriptor and the configuration descriptor, and loads the device driver corresponding to the configuration, including:
如所述 PC当前操作系统为非 windows系统, 则所述 PC向所述 USB网 卡发送索要支持非 windows系统的配置的请求;  If the current operating system of the PC is a non-windows system, the PC sends a request for supporting the configuration of the non-windows system to the USB network card;
所述 USB网卡向所述 PC上报支持非 windows系统的配置信息; 所述 PC加载与该配置信息对应的设备驱动。  The USB network card reports configuration information of the non-windows system to the PC; the PC loads a device driver corresponding to the configuration information.
优选地, 上述方法还具有下面特点: 所述非 windows系统的配置信息包 括:  Preferably, the foregoing method further has the following features: The configuration information of the non-windows system includes:
以太网控制模型设备配置信息。  Ethernet control model device configuration information.
为了解决上述问题, 本发明还提供了一种 USB网卡, 其中, 包括: 数据存储模块, 设置为: 存储硬件厂商设备信息, 其中包括多套配置信 息以和描述符信息;  In order to solve the above problem, the present invention further provides a USB network card, comprising: a data storage module, configured to: store hardware manufacturer device information, including multiple sets of configuration information and descriptor information;
信息上报模块,设置为:接入 PC进行上电操作后,根据所述 PC的请求, 上报设备描述符和配置描述符。  The information reporting module is configured to: after the PC is powered on, report the device descriptor and the configuration descriptor according to the request of the PC.
优选地, 上述 USB网卡还具有下面特点:  Preferably, the above USB network card further has the following features:
所述信息上报模块,还设置为:接收到所述 PC发送的索要支持 windows 系统的配置请求后, 向所述 PC上报支持 windows系统的配置信息; 接收到 所述 PC下发获取微软扩展属性特征描述符的请求后,向所述 PC上报微软扩 展属性特征描述符。 The information reporting module is further configured to: after receiving the configuration request sent by the PC to support the windows system, report the configuration information of the support windows system to the PC; and receive the extended extended attribute feature of the PC by receiving the PC After the request of the descriptor, report the Microsoft extension to the PC Exhibition attribute feature descriptor.
优选地, 上述 USB网卡还具有下面特点:  Preferably, the above USB network card further has the following features:
所述支持 windows系统的配置信息包括以下任一种:  The configuration information supporting the windows system includes any one of the following:
远程网络驱动接口规范配置信息、 只读光盘配置信息和人机接口设备配 置信息,  Remote network drive interface specification configuration information, CD-ROM configuration information, and human interface device configuration information,
所述微软扩展属性特征描述符包括:  The Microsoft extended attribute feature descriptor includes:
扩展兼容 ID特征描述符和扩展属性特征描述符。  Extended compatible ID feature descriptors and extended attribute feature descriptors.
优选地, 上述 USB网卡还具有下面特点:  Preferably, the above USB network card further has the following features:
所述信息上报模块, 还设置为: 接收到所述 PC 发送的索要支持非 windows系统的配置请求后, 向所述 PC上报支持非 windows系统的配置信 息。  The information reporting module is further configured to: after receiving the configuration request sent by the PC to support the non-windows system, report the configuration information supporting the non-windows system to the PC.
优选地, 上述 USB网卡还具有下面特点: 所述非 windows系统的配置 信息包括:  Preferably, the above USB network card further has the following features: The configuration information of the non-windows system includes:
以太网控制模型设备配置信息。  Ethernet control model device configuration information.
为了解决上述问题, 本发明还提供了一种个人电脑, 其中, 包括: 数据接收模块, 设置为: 接收并根据所述设备描述符和所述配置描述符 选择支持当前操作系统的配置信息;  In order to solve the above problem, the present invention further provides a personal computer, comprising: a data receiving module, configured to: receive and select configuration information supporting a current operating system according to the device descriptor and the configuration descriptor;
加载模块, 设置为: 加载与该配置信息对应的设备驱动。  Load the module, set to: Load the device driver corresponding to the configuration information.
在一优选实施例中,所述数据接收模块,设置为: 当操作系统为 windows 系统,则向 USB网卡发送索要支持 windows系统的配置请求,接收所述 USB 网卡上报的支持 windows系统的配置信息, 从所述配置信息中获取字串描述 符后, 向所述 USB网卡下发获取微软扩展属性特征描述符的请求,接收所述 USB网卡上报的微软扩展属性特征描述符;  In a preferred embodiment, the data receiving module is configured to: when the operating system is a windows system, send a configuration request to the USB network card to support the windows system, and receive configuration information of the windows system supported by the USB network card, After obtaining the string descriptor from the configuration information, sending a request for acquiring the Microsoft extended attribute feature descriptor to the USB network card, and receiving the Microsoft extended attribute feature descriptor reported by the USB network card;
所述加载模块, 设置为: 根据所述微软扩展属性特征描述符加载对应的 设备驱动。  The loading module is configured to: load a corresponding device driver according to the Microsoft extended attribute feature descriptor.
在一优选实施例中, 所述数据接收模块, 设置为: 当操作系统为非 windows系统, 则向 USB网卡发送索要支持非 windows系统的配置请求后, 接收所述 USB网卡上报的支持非 windows系统的配置信息; In a preferred embodiment, the data receiving module is configured to: when the operating system is a non-windows system, send a configuration request to the USB network card to support the non-windows system, Receiving configuration information supported by the USB network card to support a non-windows system;
所述加载模块, 设置为: 加载与该配置信息对应的设备驱动。  The loading module is configured to: load a device driver corresponding to the configuration information.
综上, 本发明实施例提供一种接入 USB网卡的方法、 USB网卡及 PC, 可以解决上述免驱方案中需要进行文件安装以及模式切换才能接入无线网络 的问题, 提升用户体验。  In summary, the embodiment of the present invention provides a method for accessing a USB network card, a USB network card, and a PC, which can solve the problem that the file installation and mode switching are required to access the wireless network in the above-mentioned drive-free solution, thereby improving the user experience.
附图概述 BRIEF abstract
图 1是本发明实施例的接入 USB网卡的系统的示意图;  1 is a schematic diagram of a system for accessing a USB network card according to an embodiment of the present invention;
图 2为本发明实施例的接入 USB网卡的方法的流程图;  2 is a flowchart of a method for accessing a USB network card according to an embodiment of the present invention;
图 3是本发明一具体实施例的接入 USB网卡的方法的流程图。  3 is a flow chart of a method for accessing a USB network card according to an embodiment of the present invention.
本发明的较佳实施方式 Preferred embodiment of the invention
下文中将结合附图对本发明的实施例进行详细说明。 需要说明的是, 在 不冲突的情况下, 本申请中的实施例及实施例中的特征可以相互任意组合。  Embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that, in the case of no conflict, the features in the embodiments and the embodiments in the present application may be arbitrarily combined with each other.
图 1是本发明实施例的接入 USB网卡的系统的示意图,本实施例的系统 包括: USB设备侧 (即 USB网卡)和 PC, 其中,  1 is a schematic diagram of a system for accessing a USB network card according to an embodiment of the present invention. The system of this embodiment includes: a USB device side (ie, a USB network card) and a PC, where
USB网卡包含两个模块: 信息上报模块和数据存储模块, 其中, 数据存储模块负责硬件厂商设备信息的存储, 其中包括设备硬件厂商信 息、 多套配置信息以及特性描述符信息;  The USB NIC includes two modules: an information reporting module and a data storage module, wherein the data storage module is responsible for storing device information of the hardware manufacturer, including device hardware manufacturer information, multiple sets of configuration information, and feature descriptor information;
信息上报模块负责与 PC打交道,当 PC侧发送 USB控制请求给 USB设 备侧, 信息上报模块从数据存储模块读取对应的数据, 回复给 PC。  The information reporting module is responsible for dealing with the PC. When the PC side sends a USB control request to the USB device side, the information reporting module reads the corresponding data from the data storage module and returns it to the PC.
具体地, 信息上报模块, 可以用于接入 PC进行上电操作后, 根据所述 PC的请求, 上报设备描述符和配置描述符。  Specifically, the information reporting module may be configured to: after accessing the PC to perform a power-on operation, report the device descriptor and the configuration descriptor according to the request of the PC.
所述信息上报模块,还可以用于接收到所述 PC发送的索要支持 windows 系统的配置请求后, 向所述 PC上报支持 windows系统的配置信息; 接收到 所述 PC下发获取微软扩展属性特征描述符的请求后,向所述 PC上报微软扩 展属性特征描述符。 所述信息上报模块, 还可以用于接收到所述 PC 发送的索要支持非 windows系统的配置请求后, 向所述 PC上报支持非 windows系统的配置信 息。 The information reporting module may be further configured to: after receiving the configuration request sent by the PC to support the windows system, report the configuration information of the support windows system to the PC; and receive the extended extended attribute feature of the PC by receiving the PC After the request of the descriptor, the Microsoft extended attribute feature descriptor is reported to the PC. The information reporting module may be further configured to: after receiving the configuration request sent by the PC to support the non-windows system, report the configuration information of the non-windows system to the PC.
PC侧可以包含两个功能模块: 数据接收模块和加载模块, 其中, 数据接收模块负责与 USB设备侧的信息上报模块通信, USB侧上报的 信息被存储在数据接收模块; The PC side may include two functional modules: a data receiving module and a loading module, wherein the data receiving module is responsible for communicating with the information reporting module on the USB device side, and the information reported by the USB side is stored in the data receiving module;
加载模块提供了一种特殊的机制, 可以通过修改注册表中的键值, 可以 将接收到的数据放置到指定的位置。  The load module provides a special mechanism for placing received data to a specified location by modifying the key values in the registry.
在一优选实施例中, 所述数据接收模块, 具体可以用于当操作系统为 windows系统, 则向 USB网卡发送索要支持 windows系统的配置请求,接收 所述 USB 网卡上报的支持 windows系统的配置信息, 从所述配置信息中获 取字串描述符后,向所述 USB网卡下发获取微软扩展属性特征描述符的请求, 接收所述 USB网卡上报的微软扩展属性特征描述符;  In a preferred embodiment, the data receiving module may be specifically configured to: when the operating system is a windows system, send a configuration request to the USB network card to support the windows system, and receive configuration information of the windows system supported by the USB network card. After obtaining the string descriptor from the configuration information, the request for obtaining the Microsoft extended attribute feature descriptor is sent to the USB network card, and the Microsoft extended attribute feature descriptor reported by the USB network card is received;
所述加载模块, 具体可以用于根据所述微软扩展属性特征描述符加载对 应的设备驱动。  The loading module may be specifically configured to load a corresponding device driver according to the Microsoft extended attribute feature descriptor.
在一优选实施例中, 所述数据接收模块, 具体用于当操作系统为非 windows系统, 则向 USB网卡发送索要支持非 windows系统的配置请求后, 接收所述 USB网卡上报的支持非 windows系统的配置信息;  In a preferred embodiment, the data receiving module is specifically configured to: when the operating system is a non-windows system, send a support request to the USB network card to support the non-windows system, and receive the non-windows system reported by the USB network card. Configuration information;
所述加载模块, 具体用于加载与该配置信息对应的设备驱动。  The loading module is specifically configured to load a device driver corresponding to the configuration information.
图 2为本发明实施例的接入 USB网卡的方法的流程图,如图 2所示,本 实施例的方法可以包括:  FIG. 2 is a flowchart of a method for accessing a USB network card according to an embodiment of the present invention. As shown in FIG. 2, the method in this embodiment may include:
Sl l、 USB网卡接入 PC进行上电操作后, 根据所述 PC的请求, 上报设 备描述符和配置描述符;  Sl l, USB network card access PC after power-on operation, according to the request of the PC, report device descriptor and configuration descriptor;
S12、所述 PC接收并根据所述设备描述符和所述配置描述符选择支持当 前操作系统的配置信息, 加载与该配置信息对应的设备驱动。  S12. The PC receives and selects configuration information supporting the current operating system according to the device descriptor and the configuration descriptor, and loads a device driver corresponding to the configuration information.
这样, 通过本发明实施例的方法可以实现免驱接入无线网络。 图 3是本发明一具体实施例的接入 USB 网卡的方法的流程图, 如图 3 所示, 可以包括以下步骤: In this way, the method of the embodiment of the present invention can implement the drive-free access to the wireless network. FIG. 3 is a flowchart of a method for accessing a USB network card according to an embodiment of the present invention. As shown in FIG. 3, the following steps may be included:
步骤 101 , 首先 USB网卡接入 PC, 进行上电操作。  Step 101: First, the USB network card is connected to the PC, and the power-on operation is performed.
步骤 102, USB网卡接收到 PC发送的获取描述符的请求, 进行设备描 述符的上报, 其中设备描述符的最后一位代表设置为配置描述符的个数。  Step 102: The USB network card receives the request for acquiring the descriptor sent by the PC, and performs reporting of the device descriptor, where the last digit of the device descriptor is set as the number of configuration descriptors.
设备描述符用来描述 USB设备的总体信息,例如设备所属的设备类、子 类信息, 供应商信息以及设备所支持的配置数, 配置描述符描述了此配置所 支持的接口个数以及配置值。  The device descriptor is used to describe the overall information of the USB device, such as the device class, subclass information, vendor information, and the number of configurations supported by the device. The configuration descriptor describes the number of interfaces supported by the configuration and the configuration values. .
步骤 103 , PC发送获取配置描述符的 USB请求, USB网卡进行多套配 置描述符的上报。  Step 103: The PC sends a USB request for obtaining a configuration descriptor, and the USB network card performs reporting of multiple sets of configuration descriptors.
对于 windows系统来说, 微软 OS描述符为 IHV (独立硬件厂商 )提供 了一种在设备固件中存储被称为 OS特征描述符的描述各种厂商特定信息的 方法。 对于实现新特征类型的设备经常是还没有分到合适的类和子类码, IHV可以通过在固件中将信息存储为扩展兼容 ID (标识符) OS特征描述符 的方式来回避此问题。 然后微软就可以在 USB设备插入时获取到这个信息, 并利用其帮助确定要加载哪个默认驱动。 对于厂商需要提供给 OS的额外的 一些信息或属性, 可以存储在扩展属性 OS特征描述符中。  For Windows systems, the Microsoft OS Descriptor provides a way for IHVs (Independent Hardware Vendors) to store various vendor-specific information in the device firmware called OS Feature Descriptors. For devices that implement new feature types, often without proper class and subclass code, IHV can circumvent this problem by storing information in the firmware as an extended compatible ID (Identifier) OS feature descriptor. Microsoft can then get this information when the USB device is plugged in and use it to help determine which default driver to load. Additional information or attributes that the vendor needs to provide to the OS can be stored in the extended attribute OS feature descriptor.
因此对于 Windows 系统, USB 网卡首先要选择自己需要实现为何种设 备类型, 可以直接将自身上报为 RNDIS设备或者 CDROM或者 HID (人机 接口设备)设备类型, 前提是微软系统中自带了这些设备的驱动。  Therefore, for Windows systems, the USB NIC must first choose which device type it needs to implement. It can report itself as an RNDIS device or a CDROM or HID (Human Interface Device) device type, provided that the Microsoft system comes with these devices. drive.
本实施例的 USB 网卡需要支持微软 OS描述符 ( OS字串描述符和 OS 特征描述符)。 OS字串描述符被存储在字符串索引 OxEE位置。 USB网卡在 OS获取字串描述符时通过上报非零的 bMS— VendorCode(这是描述符当中的 一个字段, 是各个厂商定义的编码, 提供给微软操作系统识别用的) 并且满 足微软对 OS字串描述符的定义, 那么操作系统就会进一步下发 OS特征描 述符。  The USB NIC of this embodiment needs to support Microsoft OS descriptors (OS string descriptors and OS feature descriptors). The OS string descriptor is stored in the string index OxEE location. The USB NIC reports the non-zero bMS- VendorCode when the OS obtains the string descriptor (this is a field in the descriptor, which is the code defined by each vendor, which is provided for identification by the Microsoft operating system) and satisfies Microsoft's OS word. The definition of the string descriptor, then the operating system will further issue the OS feature descriptor.
本实施例支持两种特征描述符, 扩展兼容 ID特征描述符和扩展属性特 征描述符。 OS特征描述符可以携带最长为 16Mb大小的数据,这个大小足可 以放置那些硬件厂商想要提供的任何一些数据信息。 扩展兼容 ID特性描述 符用来帮助 OS找到兼容的系统驱动, 扩展属性描述符用来进行一些特殊信 息的存储, 例如 UI (用户界面)文件、 快捷方式等。 This embodiment supports two feature descriptors, an extended compatible ID feature descriptor and an extended attribute feature descriptor. The OS feature descriptor can carry data up to 16Mb in size. This size is sufficient. To place any data information that the hardware vendor wants to provide. The extended compatible ID feature descriptor is used to help the OS find a compatible system driver, and the extended attribute descriptor is used to store some special information, such as UI (user interface) files, shortcuts, and the like.
如果设备要提供的数据长度大于一个 USB请求所可以获取的最大长度 64K, 那么操作系统会自动读取剩余的部分。  If the device is to provide a data length greater than the maximum length of a USB request that can be obtained by 64K, the operating system will automatically read the remaining portion.
对于 windows系统, 包括以下步骤:  For windows systems, the following steps are included:
步骤 104.1 , windows系统不支持多套配置, 所以仅仅索要第一套配置, 也就是 RNDIS配置信息, 或者其他操作系统可以提供驱动的设备类型。  Step 104.1, Windows system does not support multiple sets of configuration, so only ask for the first set of configuration, that is, RNDIS configuration information, or other device types that the operating system can provide.
PC机发送获取配置描述符请求来索要, USB网卡将 RNDIS配置信息返 回给 PC机。  The PC sends a request to obtain a configuration descriptor to request, and the USB network card returns the RNDIS configuration information to the PC.
对于 XP以上的 windows系统, RNDIS驱动均为系统驱动, 只要提供正 确的特性描述符, 驱动就可以自动加载, 符合本实施例的免驱宗旨。 XP 系 统由于有一些漏洞, RNDIS驱动不能自动加载, 本实施例的设备侧提供了特 殊的扩展属性描述符, 可以将 inf 文件 (驱动的索引文件)和其他信息拷贝 到指定目录, 因此也可以做到免驱。  For Windows systems above XP, the RNDIS driver is a system driver. As long as the correct feature descriptor is provided, the driver can be automatically loaded, which is in line with the purpose of this embodiment. Due to some vulnerabilities in the XP system, the RNDIS driver cannot be automatically loaded. The device side of this embodiment provides a special extended attribute descriptor, which can copy the inf file (the driven index file) and other information to the specified directory, so it can also be done. To drive free.
步骤 104.2, USB网卡的驱动层进行 RNDIS配置信息或 CDROM (只读 光盘) 配置信息或 HID (人机接口设备) 配置信息的上报, 配置信息中包含 一个通信接口和一个设备接口, 另外还包括必要的功能描述符。  Step 104.2: The driver layer of the USB network card performs RNDIS configuration information or CDROM (read-only disc) configuration information or HID (Human Interface Device) configuration information, and the configuration information includes a communication interface and a device interface, and further includes necessary Function descriptor.
步骤 104.3 , PC获取 OxEE位置的字串描述符, 将 bMS— VendorCode值 写到注册表中, 进而操作系统会下发 GET— MS— DESCRIPTOR (获取微软扩 展属性特征描述符) 。  Step 104.3, the PC obtains the string descriptor of the OxEE location, writes the bMS_VendorCode value to the registry, and the operating system issues GET_MS_DESCRIPTOR (obtains the Microsoft extended attribute feature descriptor).
USB 网卡的驱动层随即上报特性描述符, 如果 USB 网卡设备侧緩冲区 中存放的数据长度大于一个字节的最大十六进制数 OxFF ,操作系统会不断去 读取剩余的数据, 直到最后的数据长度小于 0xFF。  The driver layer of the USB NIC reports the feature descriptor. If the data length stored in the USB NIC device side buffer is greater than the maximum hexadecimal number OxFF of one byte, the operating system will continue to read the remaining data until the end. The data length is less than 0xFF.
步骤 104.4,对于 USB网卡上报的特性描述符,扩展兼容 ID用于指导操 作系统加载对应的设备驱动, 扩展属性特性描述符的每个属性区段, 都可以 指导操作系统做一系列的动作, 例如, 存储信息到制定的位置, 创建快捷方 式, 修改注册表等, 这一系列的动作可以完成 web UI和 PC UI的安装, PC的操作系统和 USB设备完成剩余的信息交互后, 转步骤 106。 Step 104.4: For the feature descriptor reported by the USB NIC, the extended compatible ID is used to instruct the operating system to load the corresponding device driver, and each attribute section of the extended attribute feature descriptor may guide the operating system to perform a series of actions, such as , storing information to a defined location, creating shortcuts, modifying the registry, etc. This series of actions can complete the installation of the web UI and PC UI. After the operating system and the USB device of the PC complete the remaining information interaction, go to step 106.
操作系统通过微软 OS描述符的机制将需要安装的 UI以及其他信息传输 到 PC (个人电脑)侧指定的位置, 这样就实现了在 USB设备上报过程中 UI 和其他安装信息的自动安装, 不用多余的虚拟光盘设备的上报和模式切换过 程, 大大提高了用户体验, 减少了兼容问题的发生。  The operating system transfers the UI and other information that needs to be installed to the location specified on the PC (Personal Computer) side through the mechanism of the Microsoft OS Descriptor, thus realizing the automatic installation of the UI and other installation information during the USB device reporting process, without unnecessary The reporting and mode switching process of the virtual optical disk device greatly improves the user experience and reduces the occurrence of compatibility problems.
对于非 windows系统, 例如 MAC系统和 Linux系统, 不支持微软描述 符,但是支持多配置,所谓多配置就是 USB网卡设备可以配置为两种工作模 式, 具体在设备描述符和配置描述符中体现。 首先, 设备描述符中的 bNumConfigurations (配置描述符个数, 是描述 符的一个字段) 的值需要置为设备所能支持的设备个数, 设备将第一套配置 和第二套配置存储在 USB 协议栈中, 第一套配置为支持 windows 系统的 RNDIS端口模式, 第二套配置为支持非 windows系统的 ECM模式。  For non-windows systems, such as MAC systems and Linux systems, Microsoft descriptors are not supported, but multiple configurations are supported. The so-called multi-configuration is that USB NIC devices can be configured in two working modes, specifically embodied in device descriptors and configuration descriptors. First, the value of bNumConfigurations (the number of configuration descriptors, which is a field of the descriptor) in the device descriptor needs to be set to the number of devices that the device can support. The device stores the first configuration and the second configuration on the USB. In the protocol stack, the first set is configured to support the RNDIS port mode of the Windows system, and the second set is configured to support the ECM mode of the non-windows system.
操作系统获得两套配置之后, 会对第一套配置信息进行识别, 如果没有 匹配的系统驱动, 那么检查第二套配置, 如果有匹配的系统驱动, 那么就会 使用第二套配置。  After the operating system obtains two sets of configurations, the first set of configuration information is identified. If there is no matching system driver, then the second set of configurations is checked. If there is a matching system driver, the second set of configurations is used.
这样就避免了从光盘设备到 ECM设备或者利用微软描述符判断操作系 统之后才进行端口切换的弊端, 可以在最短的时间内完成端口的上>¾和驱动 的加载。  This avoids the drawback of port switching from the optical device to the ECM device or after judging the operating system with the Microsoft Descriptor. The port can be loaded in the shortest time >3⁄4 and the driver is loaded.
对于非 windows系统,相对 windows来说更加简单,可以包括以下步骤: 步骤 105.1 , 非 windows系统会根据设备描述符上报的配置描述符的个 数, 逐个索要。  For non-windows systems, it is simpler than windows. It can include the following steps: Step 105.1, non-windows systems will ask for the number of configuration descriptors reported by the device descriptor.
然后对 USB网卡设备提供的多个配置描述符进行模式匹配,如果有相应 的驱动, 那么加载上对应的系统驱动, 如果没有, 那么不进行安装。  Then, pattern matching is performed on multiple configuration descriptors provided by the USB network card device. If there is a corresponding driver, the corresponding system driver is loaded, and if not, the installation is not performed.
本实施例提供了两套配置, 一套用于 windows系统, 是 RNDIS设备, 一套是非 windows系统, 为 ECM+光盘的复合设备。  This embodiment provides two sets of configurations, one for the Windows system, one for the RNDIS device, one for the non-windows system, and the composite device for the ECM+ disc.
非 windows系统会自动选择第二套配置。  Non-windows systems will automatically select the second set of configurations.
步骤 105.2, USB设备再次进行 ECM和光盘复合设备的上报。  Step 105.2, the USB device performs the reporting of the ECM and the optical disc composite device again.
非 windows系统会对多套配置逐个索要, USB设备根据系统索要的配置 描述符索引进行上报。 Non-windows systems will ask for multiple sets of configurations one by one, and USB devices are configured according to the system. The descriptor index is reported.
上报为 ECM+光盘主要是为了在光盘设备中放置一些软件, 可以让用户 更方便的使用数据卡的一些功能, 例如电话本, 短信等等。 当然如果只单纯 上网的话, 上报单 ECM设备也可以,设备侧只要设置为连上 PC机之后自动 联网即可。  ECM+ discs are mainly used to place some software on the disc device, which makes it easier for users to use some functions of the data card, such as phone book, text message and so on. Of course, if you only use the Internet, the ECM device can also be used for reporting. The device side can be set up to connect to the PC and then automatically connect to the network.
PC接收到上报后,根据系统中是否有对应几套配置的驱动信息来选择使 用哪个配置。 由于非 windows系统不支持 RNDIS驱动, 所以 PC机自动加载 ECM和光盘设备驱动,之后用户可以根据自己的需要完成光盘内软件的安装, 进行联网操作。  After receiving the report, the PC selects which configuration to use based on whether there are several sets of configured drive information in the system. Since the non-windows system does not support the RNDIS driver, the PC automatically loads the ECM and the CD device driver. After that, the user can complete the installation of the software in the CD and perform the networking operation according to his own needs.
步骤 106,完成整个枚举流程, USB网卡准备就绪,进入正常工作模式。 对于上述实施例中提到的 RNDIS设备和 ECM设备, 可以转换为其他系 统提供驱动的其他设备类型。  Step 106: Complete the entire enumeration process, and the USB network card is ready to enter the normal working mode. For the RNDIS device and the ECM device mentioned in the above embodiments, it is possible to convert to other device types that other systems provide for driving.
此具体实施方法, 包括但不限于使用 RNDIS、 ECM设备、 微软的扩展 属性特征描述符, 类似技术均在本发明的包含范围之内。 本领域普通技术人员可以理解上述方法中的全部或部分步骤可通过程序 来指令相关硬件完成, 所述程序可以存储于计算机可读存储介质中, 如只读 存储器、 磁盘或光盘等。 可选地, 上述实施例的全部或部分步骤也可以使用 一个或多个集成电路来实现。 相应地, 上述实施例中的各模块 /单元可以釆用 硬件的形式实现, 也可以釆用软件功能模块的形式实现。 本发明不限制于任 何特定形式的硬件和软件的结合。 以上仅为本发明的优选实施例, 当然, 本发明还可有其他多种实施例, 在不背离本发明精神及其实质的情况下, 熟悉本领域的技术人员当可根据本 发明作出各种相应的改变和变形, 但这些相应的改变和变形都应属于本发明 所附的权利要求的保护范围。 工业实用性  This specific implementation method, including but not limited to the use of RNDIS, ECM devices, Microsoft Extended Attribute Feature Descriptors, and similar techniques are all within the scope of the present invention. One of ordinary skill in the art will appreciate that all or a portion of the above steps may be accomplished by a program instructing the associated hardware, such as a read-only memory, a magnetic disk, or an optical disk. Alternatively, all or part of the steps of the above embodiments may also be implemented using one or more integrated circuits. Correspondingly, each module/unit in the above embodiment may be implemented in the form of hardware or in the form of a software function module. The invention is not limited to any specific form of combination of hardware and software. The above is only a preferred embodiment of the present invention, and of course, the present invention may be embodied in various other embodiments without departing from the spirit and scope of the invention. Corresponding changes and modifications are intended to be included within the scope of the appended claims. Industrial applicability
本发明实施例提供一种接入 USB网卡的方法、 USB网卡及 PC, 可以解 决上述免驱方案中需要进行文件安装以及模式切换才能接入无线网络的问题, 提升用户体验。  The embodiment of the invention provides a method for accessing a USB network card, a USB network card and a PC, which can solve the problem that the file installation and mode switching need to be performed in the above-mentioned drive-free solution to access the wireless network, thereby improving the user experience.

Claims

权 利 要 求 书 claims
1、 一种接入 USB网卡的方法, 包括: 1. A method of accessing a USB network card, including:
USB网卡接入 PC进行上电操作后, 根据所述 PC的请求, 上报设备描 述符和配置描述符; After the USB network card is connected to the PC for power-on operation, it reports the device descriptor and configuration descriptor according to the request of the PC;
所述 PC接收并根据所述设备描述符和所述配置描述符选择支持当前操 作系统的配置信息, 加载与该配置信息对应的设备驱动。 The PC receives and selects configuration information that supports the current operating system according to the device descriptor and the configuration descriptor, and loads a device driver corresponding to the configuration information.
2、 如权利要求 1所述的方法, 其中, 所述 PC根据所述设备描述符和所 述配置描述符选择支持当前操作系统的配置信息, 加载与该配置信息对应的 设备驱动, 包括: 2. The method of claim 1, wherein the PC selects configuration information that supports the current operating system based on the device descriptor and the configuration descriptor, and loads a device driver corresponding to the configuration information, including:
如所述 PC当前操作系统为 windows系统, 则所述 PC向所述 USB网卡 发送索要支持 windows系统的配置请求; If the current operating system of the PC is a windows system, the PC sends a configuration request to support the windows system to the USB network card;
所述 USB网卡向所述 PC上报支持 windows系统的配置信息; The USB network card reports configuration information supporting the windows system to the PC;
所述 PC从所述配置信息中获取字串描述符后, 向所述 USB网卡下发获 取微软扩展属性特征描述符的请求; After obtaining the string descriptor from the configuration information, the PC sends a request to obtain the Microsoft extended attribute feature descriptor to the USB network card;
所述 USB网卡接收到所述请求后向所述 PC上报微软扩展属性特征描述 付; After receiving the request, the USB network card reports the Microsoft extended attribute feature description to the PC;
所述 PC接收到所述微软扩展属性特征描述符后, 根据所述微软扩展属 性特征描述符加载对应的设备驱动。 After receiving the Microsoft extended attribute feature descriptor, the PC loads the corresponding device driver according to the Microsoft extended attribute feature descriptor.
3、 如权利要求 2所述的方法, 其中, 所述支持 windows系统的配置信 息包括以下任一种: 3. The method of claim 2, wherein the configuration information supporting windows systems includes any of the following:
远程网络驱动接口规范配置信息、 只读光盘配置信息和人机接口设备配 置信息。 Remote network driver interface specification configuration information, read-only CD configuration information and human-machine interface device configuration information.
4、如权利要求 2所述的方法,其中,所述微软扩展属性特征描述符包括: 扩展兼容 ID特征描述符和扩展属性特征描述符。 4. The method of claim 2, wherein the Microsoft extended attribute feature descriptor includes: an extended compatible ID feature descriptor and an extended attribute feature descriptor.
5、 如权利要求 1所述的方法, 其中, 所述 PC根据所述设备描述符和所 述配置描述符选择支持当前操作系统的配置,加载与该配置对应的设备驱动, 包括: 如所述 PC当前操作系统为非 windows系统, 则所述 PC向所述 USB网 卡发送索要支持非 windows系统的配置的请求; 5. The method of claim 1, wherein the PC selects a configuration that supports the current operating system according to the device descriptor and the configuration descriptor, and loads a device driver corresponding to the configuration, including: If the current operating system of the PC is a non-windows system, the PC sends a request to the USB network card to support the configuration of the non-windows system;
所述 USB网卡向所述 PC上报支持非 windows系统的配置信息; 所述 PC加载与该配置信息对应的设备驱动。 The USB network card reports configuration information supporting non-windows systems to the PC; and the PC loads a device driver corresponding to the configuration information.
6、 如权利要求 5所述的方法, 其中, 所述非 windows系统的配置信息 包括: 6. The method of claim 5, wherein the configuration information of the non-windows system includes:
以太网控制模型设备配置信息。 Ethernet control model device configuration information.
7、 一种 USB网卡, 包括: 7. A USB network card, including:
数据存储模块, 设置为: 存储硬件厂商设备信息, 其中包括多套配置信 息以和描述符信息; The data storage module is set to: store hardware manufacturer device information, including multiple sets of configuration information and descriptor information;
信息上报模块,设置为:接入 PC进行上电操作后,根据所述 PC的请求, 上报设备描述符和配置描述符。 The information reporting module is set to: after accessing the PC for power-on operation, report the device descriptor and configuration descriptor according to the request of the PC.
8、 如权利要求 7所述的 USB网卡, 其中, 8. The USB network card as claimed in claim 7, wherein,
所述信息上报模块,还设置为:接收到所述 PC发送的索要支持 windows 系统的配置请求后, 向所述 PC上报支持 windows系统的配置信息; 接收到 所述 PC下发获取微软扩展属性特征描述符的请求后,向所述 PC上报微软扩 展属性特征描述符。 The information reporting module is also configured to: after receiving the configuration request sent by the PC to support the Windows system, report the configuration information supporting the Windows system to the PC; receive the Microsoft extended attribute features issued by the PC After requesting the descriptor, the Microsoft extended attribute feature descriptor is reported to the PC.
9、 如权利要求 8所述的 USB网卡, 其中, 9. The USB network card as claimed in claim 8, wherein,
所述支持 windows系统的配置信息包括以下任一种: The configuration information supporting Windows systems includes any of the following:
远程网络驱动接口规范配置信息、 只读光盘配置信息和人机接口设备配 置信息, Remote network driver interface specification configuration information, read-only CD configuration information and human-machine interface device configuration information,
所述微软扩展属性特征描述符包括: The Microsoft extended attribute feature descriptors include:
扩展兼容 ID特征描述符和扩展属性特征描述符。 Extended compatibility with ID feature descriptors and extended attribute feature descriptors.
10、 如权利要求 7所述的 USB网卡, 其中, 10. The USB network card as claimed in claim 7, wherein,
所述信息上报模块, 还设置为: 接收到所述 PC 发送的索要支持非 windows系统的配置请求后, 向所述 PC上报支持非 windows系统的配置信 息。 The information reporting module is further configured to: after receiving the configuration request sent by the PC to support non-windows systems, report the configuration information to support non-windows systems to the PC.
11、 如权利要求 10所述的 USB网卡, 其中, 所述非 windows系统的配 置信息包括: 11. The USB network card according to claim 10, wherein the configuration information of the non-windows system includes:
以太网控制模型设备配置信息。 Ethernet control model device configuration information.
12、 一种个人电脑, 包括: 12. A personal computer, including:
数据接收模块, 设置为: 接收并根据所述设备描述符和所述配置描述符 选择支持当前操作系统的配置信息; A data receiving module, configured to: receive and select configuration information that supports the current operating system according to the device descriptor and the configuration descriptor;
加载模块, 设置为: 加载与该配置信息对应的设备驱动。 Load module, set to: Load the device driver corresponding to the configuration information.
13、 如权利要求 12所述的个人电脑, 其中, 13. The personal computer of claim 12, wherein,
所述数据接收模块, 设置为: 当操作系统为 windows 系统, 则向 USB 网卡发送索要支持 windows系统的配置请求, 接收所述 USB网卡上报的支 持 windows系统的配置信息, 从所述配置信息中获取字串描述符后, 向所述 USB 网卡下发获取微软扩展属性特征描述符的请求, 接收所述 USB 网卡上 报的微软扩展属性特征描述符; The data receiving module is set to: when the operating system is a windows system, send a configuration request to support the windows system to the USB network card, receive the configuration information supporting the windows system reported by the USB network card, and obtain from the configuration information After reading the string descriptor, send a request to obtain the Microsoft extended attribute feature descriptor to the USB network card, and receive the Microsoft extended attribute feature descriptor reported by the USB network card;
所述加载模块, 设置为: 根据所述微软扩展属性特征描述符加载对应的 设备驱动。 The loading module is configured to: load the corresponding device driver according to the Microsoft extended attribute feature descriptor.
14、 如权利要求 12所述的个人电脑, 其中, 14. The personal computer of claim 12, wherein,
所述数据接收模块, 设置为: 当操作系统为非 windows系统, 则向 USB 网卡发送索要支持非 windows系统的配置请求后, 接收所述 USB网卡上报 的支持非 windows系统的配置信息; The data receiving module is set to: when the operating system is a non-windows system, after sending a configuration request to support the non-windows system to the USB network card, receive the configuration information reported by the USB network card to support the non-windows system;
所述加载模块, 设置为: 加载与该配置信息对应的设备驱动。 The loading module is set to: load the device driver corresponding to the configuration information.
PCT/CN2013/081897 2013-06-03 2013-08-20 Usb network card access method, usb network card and pc WO2013189388A2 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310219834.7 2013-06-03
CN201310219834.7A CN104216728A (en) 2013-06-03 2013-06-03 Method for connecting USB network card, USB network card and PC

Publications (2)

Publication Number Publication Date
WO2013189388A2 true WO2013189388A2 (en) 2013-12-27
WO2013189388A3 WO2013189388A3 (en) 2014-04-24

Family

ID=49769535

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/081897 WO2013189388A2 (en) 2013-06-03 2013-08-20 Usb network card access method, usb network card and pc

Country Status (2)

Country Link
CN (1) CN104216728A (en)
WO (1) WO2013189388A2 (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105872200A (en) * 2015-12-15 2016-08-17 乐视致新电子科技(天津)有限公司 Mobile phone and usb system
CN106250203A (en) * 2016-07-19 2016-12-21 浪潮(北京)电子信息产业有限公司 A kind of method and device of KVM virtual machine identification USB flash disk
CN111104170A (en) * 2018-10-26 2020-05-05 中兴通讯股份有限公司 Driving method and device for wireless internet access and computer readable medium
CN112540801A (en) * 2019-09-23 2021-03-23 西安中兴新软件有限责任公司 Network card configuration method, host device, network card device, and storage medium
CN113037737B (en) * 2021-03-02 2023-07-04 四川速宝网络科技有限公司 Method for external network card application of user terminal equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040203296A1 (en) * 2002-11-15 2004-10-14 Globespan Virata Inc. Method and system for attaching a USB network adapter supporting both RNDIS and non-RNDIS capable operating systems
CN102096646A (en) * 2011-01-30 2011-06-15 中兴通讯股份有限公司 Method and device for starting wireless communication terminal
CN102156648A (en) * 2011-01-30 2011-08-17 中兴通讯股份有限公司 Wireless communication terminal starting method and device
CN102176704A (en) * 2011-02-18 2011-09-07 中兴通讯股份有限公司 Method, system and device for accessing wireless network through universal serial bus (USB) virtual network card
CN102457990A (en) * 2010-10-28 2012-05-16 Tcl集团股份有限公司 Mobile terminal provided with WLAN (Wireless Local Area Network) card function and implementation method thereof
CN102693142A (en) * 2012-05-10 2012-09-26 中兴通讯股份有限公司南京分公司 Network adaptation method and device
WO2012169941A2 (en) * 2011-06-10 2012-12-13 Yota Devices Ipr Ltd Method of installing a driver to emulate a network card

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7171458B2 (en) * 2001-06-12 2007-01-30 International Business Machines Corporation Apparatus and method for managing configuration of computer systems on a computer network
CN1456976A (en) * 2003-06-04 2003-11-19 无敌科技(西安)有限公司 Driving programm installing method of USB interface facilities

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040203296A1 (en) * 2002-11-15 2004-10-14 Globespan Virata Inc. Method and system for attaching a USB network adapter supporting both RNDIS and non-RNDIS capable operating systems
CN102457990A (en) * 2010-10-28 2012-05-16 Tcl集团股份有限公司 Mobile terminal provided with WLAN (Wireless Local Area Network) card function and implementation method thereof
CN102096646A (en) * 2011-01-30 2011-06-15 中兴通讯股份有限公司 Method and device for starting wireless communication terminal
CN102156648A (en) * 2011-01-30 2011-08-17 中兴通讯股份有限公司 Wireless communication terminal starting method and device
CN102176704A (en) * 2011-02-18 2011-09-07 中兴通讯股份有限公司 Method, system and device for accessing wireless network through universal serial bus (USB) virtual network card
WO2012169941A2 (en) * 2011-06-10 2012-12-13 Yota Devices Ipr Ltd Method of installing a driver to emulate a network card
CN102693142A (en) * 2012-05-10 2012-09-26 中兴通讯股份有限公司南京分公司 Network adaptation method and device

Also Published As

Publication number Publication date
CN104216728A (en) 2014-12-17
WO2013189388A3 (en) 2014-04-24

Similar Documents

Publication Publication Date Title
US10445258B1 (en) Method for creation of device drivers and device objects for peripheral devices
TWI757809B (en) Universal serial bus smart hub
US8185759B1 (en) Methods and systems for interfacing bus powered devices with host devices providing limited power levels
JP5255703B2 (en) Firmware storage media with customized image
US20080126628A1 (en) Methods, devices and computer program products for automatically providing an alternate usb configuration of a usb compliant peripheral device for exposure to a host computer
WO2005086002A1 (en) Method for data processing device exchanging data with computer
WO2013189388A2 (en) Usb network card access method, usb network card and pc
WO2011003257A1 (en) Auto start method and system of universal serial bus data card
WO2017113879A1 (en) Method and device for controlling smart interface card
JP5129770B2 (en) Network equipment
WO2012109886A1 (en) Method, system and device for accessing wireless network through usb virtual network card
JP2007134782A (en) Communication apparatus and communication control method
JP2001242965A (en) Computer system, information processing device, and power supply system
WO2011120380A1 (en) Printer with universal serial bus interface, method and system for installing driver of printer
WO2012100498A1 (en) Method and system for switching port of usb device
WO2012100504A1 (en) Wireless communication method, wireless communication system and wireless communication terminal
WO2012097574A1 (en) Wireless communication terminal and self-starting method thereof
TWI361380B (en) Electronic devices and methods for managing mass storage devices
WO2011153770A1 (en) Method and system for terminal device installation
WO2013189432A2 (en) Usb device and method thereof for automatically recognizing microsoft windowing operating system version
JP2013513874A (en) Data card upgrade method and device
WO2014183358A1 (en) Method for identifying type of operating system, and usb device
WO2012126214A1 (en) Mobile broadband device and use method thereof
GB2450422A (en) Installing device drivers for a peripheral device when establishing a connection between the peripheral device and a computer
US7424580B2 (en) Data transfer control device, electronic instrument, program and method of fabricating electronic instrument

Legal Events

Date Code Title Description
122 Ep: pct application non-entry in european phase

Ref document number: 13807186

Country of ref document: EP

Kind code of ref document: A2