Method and device for realizing MB protocol driver of USB interface in UEFI environment
By obtaining the device ID and MB interface information of the external device, determining the target configuration, initializing and loading deployment, the problem of lack of USB MB interface driver for MBB devices in the UEFI environment is solved, and the driver implementation efficiency and configuration speed are improved.
Patent Information
- Application Number
- CN202411637325.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-15
- Publication Date
- 2025-02-28
AI Technical Summary
In the UEFI environment, the prior art lacks USB MB interface drivers that support MBB devices, resulting in large driver matching workload, low interface configuration efficiency and long time.
By obtaining the device ID of the external device, it is determined whether it is a Quectel MBB device, and sends a basic descriptor to it to obtain MB interface information. Based on this information, the target configuration is determined and initialized and loaded through Usb Mb InterfaceDxe to implement MB protocol drivers.
It improves the efficiency of the MB protocol driver implementation of USB interface in the UEFI environment, reduces the workload of driver matching and interface configuration time, and achieves fast matching and loading.
Smart Images

Figure CN119537269A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of network communication technology, and in particular to a method for implementing MB protocol driver of a USB interface in a UEFI environment, a device for implementing MB protocol driver of a USB interface in a UEFI environment, a storage medium, and an electronic device. Background Art
[0002] UEFI (Unified Extensible Firmware Interface) is an interface standard between the operating system and the platform firmware. In the UEFI (Unified Extensible Firmware Interface) environment, the driver implementation of the USB interface usually follows the UEFI driver model, especially for the USB MB (Mobile Broadband) protocol, which usually involves the interaction between the UEFI block I / O protocol and the USB protocol stack. In particular, it involves the implementation of the USB MB interface driver of the MBB device in the UEFI environment. However, in the existing situation, the UEFI development environment provides the underlying USB Host controller Driver, but does not support the USB MB interface driver of the MBB device. Secondly, the strategy adopted by the USB MB interface in the enumeration of the conventional Host (UEFI) Driver for multi-configuration USB MBB devices requires traversing the configuration / interface / endpoint descriptor information configuration / interface / endpoint descriptor information in the access USB Host controller Driver. In the case of multiple configurations / interfaces / endpoints, this will undoubtedly increase the workload of driver matching, reduce the efficiency of interface configuration, and prolong the interface configuration time. Summary of the invention
[0003] In view of this, the embodiments of the present disclosure are intended to provide a method for implementing an MB protocol driver for a USB interface in a UEFI environment, an apparatus for implementing an MB protocol driver for a USB interface in a UEFI environment, a storage medium, and an electronic device.
[0004] The technical solution of the present disclosure is achieved as follows:
[0005] In a first aspect, the present disclosure provides a method for implementing an MB protocol driver of a USB interface in a UEFI environment, which is applied to a host side.
[0006] The MB protocol driver implementation method of the USB interface in the UEFI environment provided by the embodiment of the present disclosure includes:
[0007] Get the device ID of the external device;
[0008] Determining whether the external device belongs to a Quectel MBB device based on the device ID of the external device;
[0009] If the external device belongs to a Quectel MBB device, a basic descriptor is sent to the external device to obtain MB interface information of the external device; wherein the MB interface information includes at least one of the following information: a configuration ID, an interface ID, and an endpoint ID to which the MB interface belongs;
[0010] Determining, based on the MB interface information of the external device, a target configuration that matches the MB interface information of the external device among the multiple MBB device USB configurations supported in the external device;
[0011] The external device is initialized by recording the USB configuration ID, interface ID and endpoint ID of the target configuration through Usb Mb InterfaceDxe, and the Usb Mb InterfaceDxe installation program is entered to complete the Usb MbInterfaceDxe loading deployment.
[0012] In some embodiments, the determining, based on the MB interface information of the external device, a target configuration in the USB configuration supporting multiple MBB devices in the external device that matches the MB interface information of the external device includes:
[0013] Add the MB interface information supporting the target configuration to the descriptor table of the USB Gadget layer Request standard.
[0014] In some embodiments, the entering the Usb Mb InterfaceDxe installation program and completing the Usb MbInterfaceDxe loading deployment includes:
[0015] Open the USB bus controller driver protocol of the Unified Extensible Firmware Interface UEFI standard and obtain the operation handle UsbIo Handle;
[0016] Based on the USB bus controller driver protocol method function of the unified extensible firmware interface UEFI standard, switch the MBB device USB MB driver to the host's Control Interface control interface;
[0017] Creating a fictitious wireless wide area network WWAN Protocol, and implementing the MB control interface protocol in the wireless wide area network WWAN Protocol;
[0018] Install the MB control interface protocol implemented in the wireless wide area network WWAN Protocol to the unified extensible firmware interface UEFI, and provide Write / read method functions for accessing the upper layer application service to the MB control interface protocol in the wireless wide area network WWAN Protocol;
[0019] Based on the USB bus controller driver protocol method function of the unified extensible firmware interface UEFI standard, switch the MBB device USB MB driver to the Data Interface data interface;
[0020] Establishing data layer communication between the host side and the external device by implementing the MB data interface protocol in the wireless wide area network WWAN Protocol;
[0021] Install the MB data interface protocol in the wireless wide area network WWAN Protocol to the unified extensible firmware interface UEFI, and implement the simple network protocol in the wireless wide area network WWAN Protocol;
[0022] The simple network protocol implemented in the wireless wide area network WWAN Protocol is installed into the SNPstack network protocol stack of EDK2 to complete the routing of IP data packet services to the MB data interface of the MBB device in the unified extensible firmware interface UEFI environment.
[0023] In some embodiments, after creating a fictitious wireless wide area network WWAN Protocol and implementing the MB control interface protocol in the wireless wide area network WWAN Protocol, before installing the MB control interface protocol implemented in the wireless wide area network WWAN Protocol in the unified extensible firmware interface UEFI, the method includes:
[0024] Control interface protocol and communication method functions in the wireless wide area network WWAN Protocol to complete the USB MBcontrol Interface endpoint control scheduling data transmission;
[0025] The USB control interface communication method function is scheduled based on the control interface protocol and Write / read method functions in the wireless wide area network WWAN Protocol.
[0026] In some embodiments, the establishing of data layer communication between the host side and the external device by implementing the MB data interface protocol in the wireless wide area network WWAN Protocol includes:
[0027] Create the USB MB data interface protocol BulkIn endpoint data queue;
[0028] Create a USB MB data interface BulkIn endpoint timing scheduling method function and store it in the BulkIn endpoint data queue;
[0029] Create a fictitious simple network protocol for the MB data interface protocol in the wireless wide area network WWAN Protocol, and implement the MB data interface protocol access to the EDK2 network protocol stack to achieve global sharing of the MBB device network in the UEFI environment;
[0030] Implement the Start / Initialize method function in the simple network protocol to complete the initialization of the MB data interface ntb of the MBB device;
[0031] Implement the sending method function Transmit in the simple network protocol, complete the simplenetwork protocol stack IP data packet in the UEFI environment to pack the USB MB data interface NTP message, and send the packed USB MB data interface NTP message to the USB MB data interface Bulk out endpoint;
[0032] The sending method function Receive is implemented in the simple network protocol model to complete reading the original NTP data packet of the MBB device in the BulkIn endpoint data queue, and unpacking the NTP message into an IP data packet and submitting it to the simple network protocol stack.
[0033] In a second aspect, the present disclosure provides a device for implementing MB protocol driver of a USB interface in a UEFI environment, which is applied to a host side, and the device includes:
[0034] A first information acquisition module, used to acquire a device ID of an external device;
[0035] An information determination module, configured to determine whether the external device belongs to a Quectel MBB device based on the device ID of the external device;
[0036] a second information acquisition module, configured to send a basic descriptor to the external device to acquire MB interface information of the external device if the external device belongs to a Quectel MBB device; wherein the MB interface information includes at least one of the following information: a configuration ID, an interface ID, and an endpoint ID to which the MB interface belongs;
[0037] a configuration determination module, configured to determine, based on the MB interface information of the external device, a target configuration matching the MB interface information of the external device among the multiple MBB device USB configurations supported in the external device;
[0038] The driver loading module is used to initialize the external device by recording the USB configuration ID, interface ID and endpoint ID of the target configuration through Usb Mb InterfaceDxe, and enter the Usb Mb InterfaceDxe installation program to complete the Usb Mb InterfaceDxe loading deployment.
[0039] In some embodiments, the configuration determination module is used to
[0040] Add the MB interface information supporting the target configuration to the descriptor table of the USB Gadget layer Request standard.
[0041] In some embodiments, the driver loading module is used to
[0042] Open the USB bus controller driver protocol of the Unified Extensible Firmware Interface UEFI standard and obtain the operation handle UsbIo Handle;
[0043] Based on the USB bus controller driver protocol device function of the unified extensible firmware interface UEFI standard, switch the MBB device USB MB driver to the host's Control Interface control interface;
[0044] Creating a fictitious wireless wide area network WWAN Protocol, and implementing the MB control interface protocol in the wireless wide area network WWAN Protocol;
[0045] Install the MB control interface protocol implemented in the wireless wide area network WWAN Protocol to the unified extensible firmware interface UEFI, and provide Write / read method functions for accessing the upper layer application service to the MB control interface protocol in the wireless wide area network WWAN Protocol;
[0046] Based on the USB bus controller driver protocol method function of the unified extensible firmware interface UEFI standard, switch the MBB device USB MB driver to the Data Interface data interface;
[0047] Establishing data layer communication between the host side and the external device by implementing the MB data interface protocol in the wireless wide area network WWAN Protocol;
[0048] Install the MB data interface protocol in the wireless wide area network WWAN Protocol to the unified extensible firmware interface UEFI, and implement the simple network protocol in the wireless wide area network WWAN Protocol;
[0049] The simple network protocol implemented in the wireless wide area network WWAN Protocol is installed into the SNPstack network protocol stack of EDK2 to complete the routing of IP data packet services to the MB data interface of the MBB device in the unified extensible firmware interface UEFI environment.
[0050] In a third aspect, the present disclosure provides a computer-readable storage medium on which is stored an MB protocol driver implementation program for a USB interface under a UEFI environment. When the MB protocol driver implementation program for a USB interface under a UEFI environment is executed by a processor, the MB protocol driver implementation method for a USB interface under a UEFI environment described in the first aspect above is implemented.
[0051] In a fourth aspect, the present disclosure provides an electronic device, comprising a memory, a processor, and an MB protocol driver implementation program for a USB interface in a UEFI environment, which is stored in the memory and can be run on the processor. When the processor executes the MB protocol driver implementation program for the USB interface in the UEFI environment, the MB protocol driver implementation method for the USB interface in the UEFI environment described in the first aspect above is implemented.
[0052] According to the MB protocol driver implementation method of the USB interface under the UEFI environment of the embodiment of the present disclosure, the method includes obtaining a device ID of an external device; judging whether the external device belongs to a Quectel MBB device based on the device ID of the external device; if the external device belongs to the Quectel MBB device, sending a basic descriptor to the external device to obtain MB interface information of the external device; wherein the MB interface information includes at least one of the following information: a configuration ID, an interface ID, and an endpoint ID to which the MB interface belongs; determining, based on the MB interface information of the external device, a target configuration matching the MB interface information of the external device in a USB configuration supporting multiple sets of MBB devices; initializing the external device by recording the USB configuration ID, the interface ID, and the endpoint ID of the target configuration through Usb Mb InterfaceDxe, and entering the Usb Mb InterfaceDxe installation program to complete the Usb Mb InterfaceDxe loading deployment. In this application, a basic descriptor is sent to an external device to obtain the MB interface information of the external device; based on the MB interface information of the external device, a target configuration that matches the MB interface information of the external device in the USB configuration supporting multiple sets of MBB devices is determined, and then the Usb Mb InterfaceDxe program adapted to the target configuration is loaded and deployed to complete the MB protocol driver implementation of the USB interface in the UEFI environment, so as to replace the MB interface enumeration matching under the USB configuration of multiple sets of MBB devices, thereby facilitating rapid matching to the target configuration for MB protocol driver implementation.
[0053] Additional aspects and advantages of the present disclosure will be given in part in the following description and in part will be obvious from the following description or learned through practice of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0054] Figure 1 is a flow chart of a method for implementing MB protocol driver of a USB interface in a UEFI environment according to an exemplary embodiment;
[0055] Figure 2 is a flowchart of MB protocol driver implementation of USB interface in UEFI environment according to an exemplary embodiment;
[0056] Figure 3 The present invention is a schematic diagram of the structure of a device for implementing MB protocol driver of a USB interface in a UEFI environment according to an exemplary embodiment. DETAILED DESCRIPTION
[0057] Embodiments of the present disclosure are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present disclosure, and should not be construed as limiting the present disclosure.
[0058] UEFI (Unified Extensible Firmware Interface) is an interface standard between the operating system and platform firmware. In the UEFI (Unified Extensible Firmware Interface) environment, the driver implementation of the USB interface usually follows the UEFI driver model, especially for the USB MB (Mobile Broadband) protocol, which usually involves the interaction between the UEFI block I / O protocol and the USB protocol stack. In particular, it involves the implementation of the USB MB interface driver for MBB devices in the UEFI environment.
[0059] In view of the above situation, the present disclosure provides a method for implementing MB protocol driver of USB interface in UEFI environment. Figure 1 The MB protocol driver implementation method of the USB interface in the UEFI environment is shown according to an exemplary embodiment. Figure 1 .like Figure 1 As shown, the MB protocol driver implementation method of the USB interface in the UEFI environment includes:
[0060] Step 10, obtain the device ID of the external device;
[0061] Step 11: determining whether the external device belongs to a Quectel MBB device based on the device ID of the external device;
[0062] Step 12: If the external device is a Quectel MBB device, send a basic descriptor to the external device to obtain MB interface information of the external device; wherein the MB interface information includes at least one of the following information: a configuration ID, an interface ID, and an endpoint ID to which the MB interface belongs;
[0063] Step 13: Based on the MB interface information of the external device, determine a target configuration that matches the MB interface information of the external device among the USB configurations supporting multiple MBB devices in the external device;
[0064] Step 14: Initialize the external device by recording the USB configuration ID, interface ID and endpoint ID of the target configuration through Usb Mb InterfaceDxe, enter the Usb Mb InterfaceDxe installation program, and complete the Usb MbInterfaceDxe loading deployment.
[0065] In this exemplary embodiment, Quectel MBB (Mobile Broadband) equipment is widely used in the fields of Internet of Things (IoT), vehicle communications, smart homes, industrial control, etc., providing users with high-speed and reliable wireless connection services.
[0066] In this exemplary embodiment, the basic descriptor includes a configuration descriptor, an interface descriptor, an endpoint descriptor, etc. The configuration descriptor, the interface descriptor, and the endpoint descriptor are sent to the external device to obtain the configuration ID, the interface ID, and the endpoint ID to which the MB interface of the external device belongs. Based on the configuration ID, the interface ID, and the endpoint ID to which the MB interface of the external device belongs, a target configuration matching the MB interface information of the external device in the USB configuration supporting multiple sets of MBB devices in the external device is determined.
[0067] According to the MB protocol driver implementation method of the USB interface under the UEFI environment of the embodiment of the present disclosure, the method includes obtaining a device ID of an external device; judging whether the external device belongs to a Quectel MBB device based on the device ID of the external device; if the external device belongs to the Quectel MBB device, sending a basic descriptor to the external device to obtain MB interface information of the external device; wherein the MB interface information includes at least one of the following information: a configuration ID, an interface ID, and an endpoint ID to which the MB interface belongs; determining, based on the MB interface information of the external device, a target configuration matching the MB interface information of the external device in a USB configuration supporting multiple sets of MBB devices; initializing the external device by recording the USB configuration ID, the interface ID, and the endpoint ID of the target configuration through Usb Mb InterfaceDxe, and entering the Usb Mb InterfaceDxe installation program to complete the Usb Mb InterfaceDxe loading deployment. In this application, a basic descriptor is sent to an external device to obtain the MB interface information of the external device; based on the MB interface information of the external device, a target configuration that matches the MB interface information of the external device in the USB configuration supporting multiple sets of MBB devices is determined, and then the Usb Mb InterfaceDxe program adapted to the target configuration is loaded and deployed to complete the MB protocol driver implementation of the USB interface in the UEFI environment, so as to replace the MB interface enumeration matching under the USB configuration of multiple sets of MBB devices, thereby facilitating rapid matching to the target configuration for MB protocol driver implementation.
[0068] In some embodiments, the determining, based on the MB interface information of the external device, a target configuration in the USB configuration supporting multiple MBB devices in the external device that matches the MB interface information of the external device includes:
[0069] Add the MB interface information supporting the target configuration to the descriptor table of the USB Gadget layer Request standard.
[0070] In this exemplary embodiment, by adding the MB interface information supporting the target configuration to the descriptor table of the USB Gadget layer Request standard, subsequent installation of the Usb Mb Interface Dxe program is facilitated.
[0071] In this exemplary embodiment, some USB MB devices support the Extended Configuration Descriptor. Through this descriptor, the interface information and endpoint information of the MB device can be quickly found. The WWAN Protocol supports this feature, so that when the protocol is initialized, it does not need to traverse the usbDescriptor to find the relevant information of the MB device, but can quickly configure through the Extended Configuration Descriptor, completing the initialization operation of the device more quickly.
[0072] In some embodiments, the entering the Usb Mb InterfaceDxe installation program and completing the Usb MbInterfaceDxe loading deployment includes:
[0073] Open the USB bus controller driver protocol of the Unified Extensible Firmware Interface UEFI standard and obtain the operation handle UsbIo Handle;
[0074] Based on the USB bus controller driver protocol method function of the unified extensible firmware interface UEFI standard, switch the MBB device USB MB driver to the host's Control Interface control interface;
[0075] Creating a fictitious wireless wide area network WWAN Protocol, and implementing the MB control interface protocol in the wireless wide area network WWAN Protocol;
[0076] Install the MB control interface protocol implemented in the wireless wide area network WWAN Protocol to the unified extensible firmware interface UEFI, and provide Write / read method functions for accessing the upper layer application service to the MB control interface protocol in the wireless wide area network WWAN Protocol;
[0077] Based on the USB bus controller driver protocol method function of the unified extensible firmware interface UEFI standard, switch the MBB device USB MB driver to the Data Interface data interface;
[0078] Establishing data layer communication between the host side and the external device by implementing the MB data interface protocol in the wireless wide area network WWAN Protocol;
[0079] Install the MB data interface protocol in the wireless wide area network WWAN Protocol to the unified extensible firmware interface UEFI, and implement the simple network protocol in the wireless wide area network WWAN Protocol;
[0080] The simple network protocol implemented in the wireless wide area network WWAN Protocol is installed into the SNPstack network protocol stack of EDK2 to complete the routing of IP data packet services to the MB data interface of the MBB device in the unified extensible firmware interface UEFI environment.
[0081] In this exemplary embodiment, the WWAN Protocol driver can provide two protocols to the outside, one of which encapsulates the control interface of the USB MB device and provides an interface to the outside. The external protocol or APP can perform specific business operations through the interface without worrying about how the specific data reaches the USB MB device.
[0082] The other one encapsulates the data interface of the USB MBIM device. In addition to completing the relevant interface functions required by the UEFI simplenetwork framework, it also provides relevant interfaces for obtaining and setting the status of the network card, so that the network card can be disabled or enabled externally.
[0083] In some embodiments, after creating a fictitious wireless wide area network WWAN Protocol and implementing the MB control interface protocol in the wireless wide area network WWAN Protocol, before installing the MB control interface protocol implemented in the wireless wide area network WWAN Protocol in the unified extensible firmware interface UEFI, the method includes:
[0084] Control interface protocol and communication method functions in the wireless wide area network WWAN Protocol to complete the USB MBcontrol Interface endpoint control scheduling data transmission;
[0085] The USB control interface communication method function is scheduled based on the control interface protocol and Write / read method functions in the wireless wide area network WWAN Protocol.
[0086] In this exemplary embodiment, WWAN Protocol provides multiple write / read modes for use by other protocols and apps, such as sync and async, which callers can use according to their own business scenarios, making development using WWAN Protocol more flexible.
[0087] In some embodiments, the establishing of data layer communication between the host side and the external device by implementing the MB data interface protocol in the wireless wide area network WWAN Protocol includes:
[0088] Create the USB MB data interface protocol BulkIn endpoint data queue;
[0089] Create a USB MB data interface BulkIn endpoint timing scheduling method function and store it in the BulkIn endpoint data queue;
[0090] Create a fictitious simple network protocol for the MB data interface protocol in the wireless wide area network WWAN Protocol, and implement the MB data interface protocol access to the EDK2 network protocol stack to achieve global sharing of the MBB device network in the UEFI environment;
[0091] Implement the Start / Initialize method function in the simple network protocol to complete the initialization of the MB data interface ntb of the MBB device;
[0092] Implement the sending method function Transmit in the simple network protocol, complete the simplenetwork protocol stack IP data packet in the UEFI environment to pack the USB MB data interface NTP message, and send the packed USB MB data interface NTP message to the USB MB data interface Bulk out endpoint;
[0093] The sending method function Receive is implemented in the simple network protocol model to complete reading the original NTP data packet of the MBB device in the BulkIn endpoint data queue, and unpacking the NTP message into an IP data packet and submitting it to the simple network protocol stack.
[0094] In this exemplary embodiment, UEFI currently only supports Ethernet data, which makes it difficult for MB devices to transmit IP. The IP transmission format of USB MB is NCM format. In addition to providing the interface required by the Simple NetWork framework, WWAN Protocol also implements multiple network protocols, such as ARP protocol. At the same time, it can convert the Ethernet IP packet format into NCM format, and convert NCM format data into Ethernet format. In this way, it is possible to access the Internet through MB devices under UEFI.
[0095] Figure 2 FIG. 1 is a flowchart of MB protocol driver implementation of USB interface in UEFI environment according to an exemplary embodiment. Figure 2As shown in the figure, the MB protocol driver implementation process of the USB interface in the UEFI environment includes:
[0096] Step 20, complete the registration of Quectel USB MB interface driver, EFI component protocol, and edk2 standard USB protocol driver in UEFI environment;
[0097] Step 21. Install Quectel USB MB interface driver EFI Component Nameprotocol;
[0098] Step 22: Register the Supported / Start / Stop CBI of the implemented instance MBB interface protocol component in the UEFI environment;
[0099] Step 23: Bind the AT interface, the MBB interface, and the Diag interface to the USB Gadget of the USB MBB device, where the USB MBB device contains multiple sets of MBB configurations, and the AT interface, the MBB interface, and the Diag interface each correspond to a set of MBB configurations;
[0100] Step 24: Add the MB interface information under the Nth configuration of the MBB device supporting multiple USB configurations to the descriptor table of the USBGadget layer Request standard;
[0101] Step 25: After detecting that the MBB device is connected, call the registered MB interface driver to match the MB interface protocol;
[0102] Step 26: Send a basic descriptor to the external device to obtain MB interface information of the external device;
[0103] Step 27: Based on the MB interface information of the external device, determine a target configuration that matches the MB interface information of the external device among the multiple MBB device USB configurations supported in the external device;
[0104] Step 28: The host side requests configuration of the target configuration supporting the MB interface, and performs MB interface configuration;
[0105] Step 29: Initialize the external device by recording the USB configuration ID, interface ID and endpoint ID of the target configuration through Usb MbInterfaceDxe, and enter the Usb MbInterfaceDxe installation program to complete the Usb MbInterfaceDxe loading deployment.
[0106] The present invention discloses a device for implementing MB protocol driver of a USB interface in a UEFI environment, which is applied to a host side. Figure 3FIG. 1 is a schematic diagram of a device structure for implementing MB protocol driver of a USB interface in a UEFI environment according to an exemplary embodiment. Figure 3 As shown, the MB protocol driver implementation device of the USB interface in the UEFI environment includes:
[0107] The first information acquisition module 30 is used to obtain the device ID of the external device;
[0108] An information determination module 31, configured to determine whether the external device belongs to a Quectel MBB device based on the device ID of the external device;
[0109] The second information acquisition module 32 is configured to send a basic descriptor to the external device to acquire MB interface information of the external device if the external device belongs to a Quectel MBB device; wherein the MB interface information includes at least one of the following information: a configuration ID, an interface ID, and an endpoint ID to which the MB interface belongs;
[0110] A configuration determination module 33 is configured to determine, based on the MB interface information of the external device, a target configuration that matches the MB interface information of the external device among the USB configurations supporting multiple MBB devices in the external device;
[0111] The driver loading module 34 is used to initialize the external device by recording the USB configuration ID, interface ID and endpoint ID of the target configuration through Usb Mb InterfaceDxe, and enter the Usb Mb InterfaceDxe installation program to complete the Usb Mb InterfaceDxe loading deployment.
[0112] In this exemplary embodiment, Quectel MBB (Mobile Broadband) equipment is widely used in the fields of Internet of Things (IoT), vehicle communications, smart homes, industrial control, etc., providing users with high-speed and reliable wireless connection services.
[0113] In this exemplary embodiment, the basic descriptor includes a configuration descriptor, an interface descriptor, an endpoint descriptor, etc. The configuration descriptor, the interface descriptor, and the endpoint descriptor are sent to the external device to obtain the configuration ID, the interface ID, and the endpoint ID to which the MB interface of the external device belongs. Based on the configuration ID, the interface ID, and the endpoint ID to which the MB interface of the external device belongs, a target configuration matching the MB interface information of the external device in the USB configuration supporting multiple sets of MBB devices in the external device is determined.
[0114] According to the MB protocol driver implementation device of the USB interface under the UEFI environment of the embodiment of the present disclosure, the device is used to obtain the device ID of the external device; determine whether the external device belongs to the Quectel MBB device based on the device ID of the external device; if the external device belongs to the Quectel MBB device, send a basic descriptor to the external device to obtain the MB interface information of the external device; wherein the MB interface information includes at least one of the following information: the configuration ID, interface ID, and endpoint ID to which the MB interface belongs; based on the MB interface information of the external device, determine the target configuration matching the MB interface information of the external device in the USB configuration supporting multiple sets of MBB devices; initialize the external device by recording the USB configuration ID, interface ID, and endpoint ID of the target configuration through Usb Mb InterfaceDxe, enter the Usb Mb InterfaceDxe installation program, and complete the Usb Mb InterfaceDxe loading deployment. In this application, a basic descriptor is sent to an external device to obtain the MB interface information of the external device; based on the MB interface information of the external device, a target configuration that matches the MB interface information of the external device in the USB configuration supporting multiple sets of MBB devices is determined, and then the Usb Mb InterfaceDxe program adapted to the target configuration is loaded and deployed to complete the MB protocol driver implementation of the USB interface in the UEFI environment, so as to replace the MB interface enumeration matching under the USB configuration of multiple sets of MBB devices, thereby facilitating rapid matching to the target configuration for MB protocol driver implementation.
[0115] In some embodiments, the configuration determination module is used to
[0116] Add the MB interface information supporting the target configuration to the descriptor table of the USB Gadget layer Request standard.
[0117] In this exemplary embodiment, by adding the MB interface information supporting the target configuration to the descriptor table of the USB Gadget layer Request standard, subsequent installation of the Usb Mb Interface Dxe program is facilitated.
[0118] In this exemplary embodiment, some USB MB devices support Extended Configuration Descriptor. Through this descriptor, the interface information and endpoint information of the MB device can be quickly found. The WWAN Protocol supports this feature, so that when the protocol is initialized, it does not need to traverse the USB Descriptor to find the relevant information of the MB device, but can quickly configure through the Extended Configuration Descriptor, completing the initialization operation of the device more quickly.
[0119] In some embodiments, the driver loading module is used to
[0120] Open the USB bus controller driver protocol of the Unified Extensible Firmware Interface UEFI standard and obtain the operation handle UsbIo Handle;
[0121] Based on the USB bus controller driver protocol device function of the unified extensible firmware interface UEFI standard, switch the MBB device USB MB driver to the host's Control Interface control interface;
[0122] Creating a fictitious wireless wide area network WWAN Protocol, and implementing the MB control interface protocol in the wireless wide area network WWAN Protocol;
[0123] Install the MB control interface protocol implemented in the wireless wide area network WWAN Protocol to the unified extensible firmware interface UEFI, and provide Write / read method functions for accessing the upper layer application service to the MB control interface protocol in the wireless wide area network WWAN Protocol;
[0124] Based on the USB bus controller driver protocol method function of the unified extensible firmware interface UEFI standard, switch the MBB device USB MB driver to the Data Interface data interface;
[0125] Establishing data layer communication between the host side and the external device by implementing the MB data interface protocol in the wireless wide area network WWAN Protocol;
[0126] Install the MB data interface protocol in the wireless wide area network WWAN Protocol to the unified extensible firmware interface UEFI, and implement the simple network protocol in the wireless wide area network WWAN Protocol;
[0127] The simple network protocol implemented in the wireless wide area network WWAN Protocol is installed into the SNPstack network protocol stack of EDK2 to complete the routing of IP data packet services to the MB data interface of the MBB device in the unified extensible firmware interface UEFI environment.
[0128] In this exemplary embodiment, the WWAN Protocol driver can provide two protocols to the outside world.
[0129] One of them encapsulates the control interface of the USB MB device and provides an interface to the outside. External protocols or apps can perform specific business operations through the interface without worrying about how the specific data reaches the USB MB device.
[0130] The other one encapsulates the data interface of the USB MBIM device. In addition to completing the relevant interface functions required by the UEFI simplenetwork framework, it also provides relevant interfaces for obtaining and setting the status of the network card, so that the network card can be disabled or enabled externally.
[0131] In some embodiments, after creating a fictitious wireless wide area network WWAN Protocol and implementing the MB control interface protocol in the wireless wide area network WWAN Protocol, before installing the MB control interface protocol implemented in the wireless wide area network WWAN Protocol to the unified extensible firmware interface UEFI, the driver loading module is used to
[0132] Control interface protocol and communication method functions in the wireless wide area network WWAN Protocol to complete the USB MBcontrol Interface endpoint control scheduling data transmission;
[0133] The USB control interface communication method function is scheduled based on the control interface protocol and Write / read method functions in the wireless wide area network WWAN Protocol.
[0134] In this exemplary embodiment, WWAN Protocol provides multiple write / read modes for use by other protocols and apps, such as sync and async modes, which callers can use according to their own business scenarios, making development using WWAN Protocol more flexible.
[0135] In some embodiments, the driver loading module is used to
[0136] Create the USB MB data interface protocol BulkIn endpoint data queue;
[0137] Create a USB MB data interface BulkIn endpoint timing scheduling method function and store it in the BulkIn endpoint data queue;
[0138] Create a fictitious simple network protocol for the MB data interface protocol in the wireless wide area network WWAN Protocol, and implement the MB data interface protocol access to the EDK2 network protocol stack to achieve global sharing of the MBB device network in the UEFI environment;
[0139] Implement the Start / Initialize method function in the simple network protocol to complete the initialization of the MB data interface ntb of the MBB device;
[0140] Implement the sending method function Transmit in the simple network protocol, complete the simplenetwork protocol stack IP data packet in the UEFI environment to pack the USB MB data interface NTP message, and send the packed USB MB data interface NTP message to the USB MB data interface Bulk out endpoint;
[0141] The sending method function Receive is implemented in the simple network protocol model to complete reading the original NTP data packet of the MBB device in the BulkIn endpoint data queue, and unpacking the NTP message into an IP data packet and submitting it to the simple network protocol stack.
[0142] In this exemplary embodiment, UEFI currently only supports Ethernet data, which makes it difficult for MB devices to transmit IP. The IP transmission format of USB MB is NCM format. In addition to providing the interface required by the Simple NetWork framework, WWAN Protocol also implements multiple network protocols, such as ARP protocol. At the same time, it can convert the Ethernet IP packet format into NCM format, and convert NCM format data into Ethernet format. In this way, it is possible to access the Internet through MB devices under UEFI.
[0143] The present disclosure provides a computer-readable storage medium, on which an MB protocol driver implementation program for a USB interface in a UEFI environment is stored. When the MB protocol driver implementation program for a USB interface in a UEFI environment is executed by a processor, the MB protocol driver implementation method for a USB interface in a UEFI environment described in the above embodiments is implemented.
[0144] The present disclosure provides an electronic device, including a memory, a processor, and an MB protocol driver implementation program for a USB interface in a UEFI environment, which is stored in the memory and can be run on the processor. When the processor executes the MB protocol driver implementation program for the USB interface in the UEFI environment, the MB protocol driver implementation method for the USB interface in the UEFI environment described in the above embodiments is implemented.
[0145] It should be noted that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can obtain instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection portion with one or more wirings (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or otherwise processing in a suitable manner if necessary, and then stored in a computer memory.
[0146] It should be understood that the various parts of the present disclosure can be implemented in hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0147] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present disclosure. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0148] In the description of the present disclosure, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", "axial", "radial", "circumferential" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present disclosure and simplifying the description, and do not indicate or imply that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present disclosure.
[0149] In addition, the terms "first", "second", etc. used in the embodiments of the present disclosure are only used for descriptive purposes and should not be understood as indicating or implying relative importance, or implicitly indicating the number of technical features indicated in the embodiments. Therefore, the features defined by the terms "first", "second", etc. in the embodiments of the present disclosure may explicitly or implicitly indicate that at least one of the features is included in the embodiment. In the description of the present disclosure, the word "multiple" means at least two or two or more, such as two, three, four, etc., unless otherwise clearly and specifically defined in the embodiments.
[0150] In the present disclosure, unless otherwise clearly specified or limited in the embodiments, the terms "installed", "connected", "connected" and "fixed" etc. appearing in the embodiments should be understood in a broad sense. For example, the connection can be a fixed connection, a detachable connection, or an integrated connection. It can be understood that it can also be a mechanical connection, an electrical connection, etc.; of course, it can also be a direct connection, or an indirect connection through an intermediate medium, or it can be the internal connection of two elements, or the interaction relationship between two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present disclosure can be understood according to the specific implementation situation.
[0151] In the present disclosure, unless otherwise clearly specified and limited, a first feature being "above" or "below" a second feature may mean that the first and second features are in direct contact, or the first and second features are in indirect contact through an intermediate medium. Moreover, a first feature being "above", "above" or "above" a second feature may mean that the first feature is directly above or obliquely above the second feature, or simply means that the first feature is higher in level than the second feature. A first feature being "below", "below" or "below" a second feature may mean that the first feature is directly below or obliquely below the second feature, or simply means that the first feature is lower in level than the second feature.
[0152] Although the embodiments of the present disclosure have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present disclosure. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present disclosure.
Claims
1. A method for implementing MB protocol driver of USB interface under UEFI environment, characterized in that: Applied to the host side, the method includes: Get the device ID of the external device; Determining whether the external device belongs to a Quectel MBB device based on the device ID of the external device; If the external device belongs to a Quectel MBB device, a basic descriptor is sent to the external device to obtain MB interface information of the external device; wherein the MB interface information includes at least one of the following information: a configuration ID, an interface ID, and an endpoint ID to which the MB interface belongs; Determining, based on the MB interface information of the external device, a target configuration that matches the MB interface information of the external device among the multiple MBB device USB configurations supported in the external device; The external device is initialized by recording the USB configuration ID, interface ID and endpoint ID of the target configuration through Usb Mb InterfaceDxe, and the Usb Mb InterfaceDxe installation program is entered to complete the Usb Mb InterfaceDxe loading deployment.
2. The MB protocol driver implementation method of the USB interface under the UEFI environment according to claim 1, characterized in that: The determining, based on the MB interface information of the external device, a target configuration in the USB configuration supporting multiple sets of MBB devices in the external device that matches the MB interface information of the external device includes: Add the MB interface information supporting the target configuration to the descriptor table of the USB Gadget layer Request standard.
3. The MB protocol driver implementation method of the USB interface under the UEFI environment according to claim 1 is characterized in that: Enter the Usb Mb InterfaceDxe installation program to complete the Usb Mb InterfaceDxe loading deployment, including: Open the USB bus controller driver protocol of the Unified Extensible Firmware Interface UEFI standard and obtain the operation handle Usb IoHandle; Based on the USB bus controller driver protocol method function of the unified extensible firmware interface UEFI standard, switch the MBB device USB MB driver to the host's Control Interface control interface; Creating a fictitious wireless wide area network WWAN Protocol, and implementing the MB control interface protocol in the wireless wide area network WWAN Protocol; Install the MB control interface protocol implemented in the wireless wide area network WWAN Protocol to the unified extensible firmware interface UEFI, and provide Write / read method functions for accessing the upper layer application service to the MB control interface protocol in the wireless wide area network WWAN Protocol; Based on the USB bus controller driver protocol method function of the unified extensible firmware interface UEFI standard, switch the MBB device USB MB driver to the Data Interface data interface; Establishing data layer communication between the host side and the external device by implementing the MB data interface protocol in the wireless wide area network WWAN Protocol; Install the MB data interface protocol in the wireless wide area network WWAN Protocol to the unified extensible firmware interface UEFI, and implement the simple network protocol in the wireless wide area network WWAN Protocol; The simple network protocol implemented in the wireless wide area network WWAN Protocol is installed into the SNPstack network protocol stack of EDK2 to complete the routing of IP data packet services to the MB data interface of the MBB device in the unified extensible firmware interface UEFI environment.
4. The MB protocol driver implementation method of the USB interface under the UEFI environment according to claim 3 is characterized in that: After creating a fictitious wireless wide area network WWAN Protocol and implementing the MB control interface protocol in the wireless wide area network WWAN Protocol, before installing the MB control interface protocol implemented in the wireless wide area network WWAN Protocol to the unified extensible firmware interface UEFI, the method includes: Control interface protocol and communication method functions in the wireless wide area network WWAN Protocol to complete USB MB controlInterface endpoint control scheduling data transmission; The USB control interface communication method function is scheduled based on the control interface protocol and Write / read method functions in the wireless wide area network WWAN Protocol.
5. The MB protocol driver implementation method of the USB interface under the UEFI environment according to claim 3 is characterized in that: The method of establishing data layer communication between the host side and the external device by implementing the MB data interface protocol in the wireless wide area network WWAN Protocol includes: Create the USB MB data interface protocol BulkIn endpoint data queue; Create a USB MB data interface BulkIn endpoint timing scheduling method function and store it in the BulkIn endpoint data queue; Create a fictitious simple network protocol for the MB data interface protocol in the wireless wide area network WWAN Protocol, and implement the MB data interface protocol access to the EDK2 network protocol stack to achieve global sharing of the MBB device network in the UEFI environment; Implement the Start / Initialize method function in the simple network protocol to complete the initialization of the MB data interface ntb of the MBB device; Implement the sending method function Transmit in the simple network protocol, complete the simplenetwork protocol stack IP data packet in the UEFI environment to pack the USB MB data interface NTP message, and send the packed USB MB data interface NTP message to the USB MB data interface Bulk out endpoint; The sending method function Receive is implemented in the simple network protocol model to complete reading the original NTP data packet of the MBB device in the BulkIn endpoint data queue, and unpacking the NTP message into an IP data packet and submitting it to the simple network protocol stack.
6. A device for implementing MB protocol driver of USB interface in UEFI environment, characterized in that: Applied to the host side, the device comprises: A first information acquisition module, used to acquire a device ID of an external device; An information determination module, configured to determine whether the external device belongs to a Quectel MBB device based on the device ID of the external device; a second information acquisition module, configured to send a basic descriptor to the external device to acquire MB interface information of the external device if the external device belongs to a Quectel MBB device; wherein the MB interface information includes at least one of the following information: a configuration ID, an interface ID, and an endpoint ID to which the MB interface belongs; a configuration determination module, configured to determine, based on the MB interface information of the external device, a target configuration matching the MB interface information of the external device among the multiple MBB device USB configurations supported in the external device; The driver loading module is used to initialize the external device by recording the USB configuration ID, interface ID and endpoint ID of the target configuration through Usb Mb InterfaceDxe, and enter the Usb Mb InterfaceDxe installation program to complete the UsbMb InterfaceDxe loading deployment.
7. The MB protocol driver implementation device for the USB interface under the UEFI environment according to claim 6, characterized in that: The configuration determination module is used Add the MB interface information supporting the target configuration to the descriptor table of the USB Gadget layer Request standard.
8. The MB protocol driver implementation device for the USB interface under the UEFI environment according to claim 7, characterized in that: The driver loading module is used to Open the USB bus controller driver protocol of the Unified Extensible Firmware Interface UEFI standard and obtain the operation handle Usb IoHandle; Based on the USB bus controller driver protocol device function of the unified extensible firmware interface UEFI standard, switch the MBB device USB MB driver to the host's Control Interface control interface; Creating a fictitious wireless wide area network WWAN Protocol, and implementing the MB control interface protocol in the wireless wide area network WWAN Protocol; Install the MB control interface protocol implemented in the wireless wide area network WWAN Protocol to the unified extensible firmware interface UEFI, and provide Write / read method functions for accessing the upper layer application service to the MB control interface protocol in the wireless wide area network WWAN Protocol; Based on the USB bus controller driver protocol method function of the unified extensible firmware interface UEFI standard, switch the MBB device USB MB driver to the Data Interface data interface; Establishing data layer communication between the host side and the external device by implementing the MB data interface protocol in the wireless wide area network WWAN Protocol; Install the MB data interface protocol in the wireless wide area network WWAN Protocol to the unified extensible firmware interface UEFI, and implement the simple network protocol in the wireless wide area network WWAN Protocol; The simple network protocol implemented in the wireless wide area network WWAN Protocol is installed into the SNPstack network protocol stack of EDK2 to complete the routing of IP data packet services to the MB data interface of the MBB device in the unified extensible firmware interface UEFI environment.
9. A computer-readable storage medium, characterized in that: An MB protocol driver implementation program for a USB interface in a UEFI environment is stored thereon. When the MB protocol driver implementation program for a USB interface in a UEFI environment is executed by a processor, the MB protocol driver implementation method for a USB interface in a UEFI environment described in any one of claims 1 to 5 is implemented.
10. An electronic device, characterized in that: The invention comprises a memory, a processor and an MB protocol driver implementation program of a USB interface in a UEFI environment which is stored in the memory and can be run on the processor. When the processor executes the MB protocol driver implementation program of the USB interface in the UEFI environment, the MB protocol driver implementation method of the USB interface in the UEFI environment described in any one of claims 1 to 5 is implemented.