Driving Method and Device of GMAC Network Card in UEFI Framework
By periodically detecting the GMAC network card in the UNDI layer of the UEFI framework and generating protocol objects, the problem that the UEFI framework cannot drive the GMAC network card is solved, and the plug-and-play and low-cost driver of the GMAC network card is realized.
Patent Information
- Application Number
- CN202110271733.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-12
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2041-03-12
AI Technical Summary
The existing UEFI framework cannot support the driver of GMAC network card, resulting in the incomplete network card.
In the UNDI layer of the UEFI framework, periodically detect whether the network port is inserted into the GMAC network card, and when the network port is inserted, a protocol object is generated, including the service interface of the GMAC network card, for the upper SNP layer call to drive.
The GMAC network card is plug-and-play, avoiding the situation where the system can be restarted to drive the network card, reducing the hardware detection cost, and improving the driver success rate and user experience.
Smart Images

Figure CN115080124B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of computer technology, and in particular to a method and device for driving a GMAC network card in a UEFI framework. Background Art
[0002] The Unified Extensible Firmware Interface (UEFI) framework is a computer system standard that defines the software interface between the operating system and system firmware. UEFI is responsible for power-on self-test, connecting to the operating system, and providing an interface between the operating system and hardware. To enable communication between computers and other electronic devices, the UEFI framework needs to support drivers for network cards.
[0003] However, the UEFI framework does not support a full range of network cards. Summary of the Invention
[0004] The embodiment of the present invention provides a method and device for driving a GMAC network card in a UEFI framework, so as to solve the problem that the UEFI framework in the prior art does not fully support network cards.
[0005] In a first aspect, an embodiment of the present invention provides a method for driving a GMAC network card in a UEFI framework, comprising:
[0006] Periodically detecting whether a network port is plugged into a GMAC network card in the UNDI layer of the UEFI framework;
[0007] When it is detected that the network port is inserted into the GMAC network card, a protocol object is generated in the UNDI layer according to the description structure of the GMAC network card, wherein the protocol object includes at least one service interface for the GMAC network card, and the service interface is used to provide services to the SNP layer in the UEFI framework;
[0008] The GMAC network card is driven through the service interface for driving the GMAC network card in the protocol object.
[0009] Optionally, the method further includes:
[0010] Initialize the GMAC network card in the UNDI layer.
[0011] Optionally, initializing the GMAC network card in the UNDI layer includes:
[0012] Initialize at least one of the following registers of the GMAC network card in the UNDI layer: a physical register, a media intervention control register, and a direct memory access register.
[0013] Optionally, before generating a protocol object according to the description structure of the GMAC network card, it further includes:
[0014] Reading the hardware information of the GMAC network card from the GMAC network card through the UNDI layer;
[0015] Writing the hardware information of the GMAC network card into the description structure of the GMAC network card in the UNDI layer.
[0016] Optionally, the description structure of the GMAC network card further includes information about the service interface of the GMAC network card.
[0017] Optionally, generating the protocol object according to the description structure of the GMAC network card includes:
[0018] Encapsulating the service interface into a list object according to the information about the service interface of the GMAC network card included in the description structure of the GMAC network card;
[0019] Generating the protocol object according to the address of the service interface in the list object.
[0020] Optionally, the method further includes:
[0021] Communicating through the service interface for communication in the GMAC network card and the protocol object;
[0022] And / or, managing the GMAC network card through the service interface for managing the GMAC network card in the protocol object.
[0023] In a second aspect, an embodiment of the present invention provides a driving device for a GMAC network card in a UEFI framework, including:
[0024] A periodic detection module, configured to periodically detect whether a GMAC network card is inserted into a network port in the UNDI layer of the UEFI framework;
[0025] A protocol object generation module, configured to generate a protocol object according to the description structure of the GMAC network card in the UNDI layer when it is detected that the network port inserts the GMAC network card, where the protocol object includes at least one service interface for the GMAC network card, and the service interface is used to provide services to the SNP layer in the UEFI framework;
[0026] A network card driving module, configured to drive the GMAC network card through the service interface for driving the GMAC network card in the protocol object.
[0027] Optionally, the device further includes:
[0028] An initialization module, configured to initialize the GMAC network card in the UNDI layer.
[0029] Optionally, the initialization module is further configured to:
[0030] Initialize at least one of the following registers of the GMAC network card in the UNDI layer: a physical register, a media access control register, and a direct memory access register.
[0031] Optionally, the device further includes:
[0032] A hardware information reading module, configured to read the hardware information of the GMAC network card from the GMAC network card through the UNDI layer;
[0033] A hardware information writing module, configured to write the hardware information of the GMAC network card into the description structure of the GMAC network card in the UNDI layer.
[0034] Optionally, the description structure of the GMAC network card further includes information about the service interface of the GMAC network card.
[0035] Optionally, the protocol object generation module is further configured to:
[0036] Encapsulate the service interface into a list object according to the information about the service interface of the GMAC network card included in the description structure of the GMAC network card;
[0037] Generate the protocol object according to the address of the service interface in the list object.
[0038] Optionally, the device further includes:
[0039] A communication module, configured to communicate through the GMAC network card and the service interface for communication in the protocol object;
[0040] And / or, a management module, configured to manage the GMAC network card through the service interface for managing the GMAC network card in the protocol object.
[0041] In a third aspect, an embodiment of the present invention provides an electronic device, including: at least one processor and a memory;
[0042] The memory stores computer execution instructions;
[0043] The at least one processor executes the computer execution instructions stored in the memory, so that the electronic device implements the method as described in the first aspect.
[0044] Fourthly, an embodiment of the present invention provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, cause a computing device to implement the method described in the first aspect above.
[0045] Fifthly, an embodiment of the present invention provides a computer program for implementing the method described in the first aspect above.
[0046] The driving method and device for a GMAC network card in the UEFI framework provided in this embodiment can periodically detect whether a GMAC network card is inserted into a network port in the UNDI layer of the UEFI framework; when it is detected that a GMAC network card is inserted into the network port, a protocol object is generated in the UNDI layer according to the description structure of the GMAC network card, and the protocol object includes at least one service interface for the GMAC network card, and the service interface is used to provide services to the SNP layer in the UEFI framework; the GMAC network card is driven through the service interface for driving the GMAC network card in the protocol object. An embodiment of the present invention can periodically detect whether a GMAC network card is inserted into a network port through the lowest UNDI layer in the UEFI framework, and generate a protocol object in the UNDI layer when the GMAC network card is inserted, so that the upper SNP protocol can call the protocol object to drive the GMAC network card. The detection period is usually determined according to the computer processing speed. Since the computer processing speed is usually very high, the period is very small. For example, at the millisecond level, the time difference between reinserting the GMAC network card and driving the GMAC network card is imperceptible to the user, that is, the GMAC network card starts to be driven after the GMAC network card is inserted. Description of the Drawings
[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.
[0048] Figure 1 Exemplarily shows a schematic diagram of a hierarchical structure involved in the network startup process of a UEFI framework provided by an embodiment of the present invention;
[0049] Figure 2 Exemplarily shows a flowchart of the steps of a driving method for a GMAC network card in a UEFI framework provided by an embodiment of the present invention;
[0050] Figure 3 Exemplarily shows a structural block diagram of a driving device for a GMAC network card in a UEFI framework provided by an embodiment of the present invention;
[0051] Figure 4 The structural schematic diagram of an electronic device provided by an embodiment of the present invention is exemplarily shown. Specific embodiments
[0052] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Apparently, the described embodiments are some but not all of the embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without making creative efforts shall fall within the protection scope of the present invention.
[0053] The embodiments of the present invention can be applied to the UEFI framework. Both the UEFI framework and the traditional BIOS (basic input / output system) are used in the startup process of an electronic device. Both are software that runs first when starting the electronic device. UEFI startup and traditional BIOS startup are two startup methods that can be switched by the user.
[0054] The traditional BIOS is used to detect whether the hardware of the electronic device is normal before starting the electronic device and to boot the operating system. Different from the traditional BIOS, the UEFI framework is used to load the operating system from a pre-boot operation environment to save the startup time of the electronic device. In addition, the traditional BIOS usually provides startup process information to the user through an English, black-and-white interface, which is not conducive to user operation. While the UEFI provides startup process information to the user through a graphical image interface, which is conducive to user operation.
[0055] UEFI startup requires an independent partition. The UEFI framework isolates the system startup files from the operating system itself, which can protect the startup of the operating system. Even if the operating system startup fails and needs to be reconfigured, simply reconfigure the startup partition. In addition, a trust source can be created between the UEFI secure startup and the certificates stored in the firmware and the platform firmware to ensure that before loading the operating system, "known secure" code and boot loader that have been signed and authenticated can be executed, preventing users from executing malicious code in the root path. At startup, the EFIShell can be called to load the specified hardware drivers and select the startup files. For example, after the default startup fails, the startup files on the U (Universal Serial Bus) disk can be loaded in the EFI (extensible firmware interface) shell to continue starting the system.
[0056] The above UEFI can provide startup modes to users during the startup process. Among them, the startup modes can include, but are not limited to: booting from a hard disk, booting from a USB flash drive, and network booting. Booting from a hard disk means booting the operating system on the hard disk. Booting from a USB flash drive means booting the operating system on the USB flash drive. Network booting means downloading the operating system image from a remote server through a network card to boot the operating system. The process of booting through the above different startup modes can include: First, the user clicks the F10 key after powering on to enter the UEFI startup interface. Then, the user selects the startup mode "HDD (hard disk drive)" in the startup options in the UEFI startup interface to achieve hard disk booting, or selects the startup mode "USB" to achieve USB flash drive booting, or selects the startup mode "PEE (preboot excution evironment)" to achieve network booting. Of course, UEFI can set a default startup mode. For example, the default is to boot from the hard disk.
[0057] Embodiments of the present invention can be applied to the network booting process of the UEFI framework. Figure 1 Exemplarily shows a schematic diagram of a hierarchical structure involved in a UEFI framework during network booting provided by an embodiment of the present invention. Refer to Figure 1 , the UEFI framework sequentially includes a UNDI (universal network driver interface) layer, an SNP (simple network protocol) layer, an MNP (manager network protocol) layer, a protocol adaptation layer, and an HTTP (hyper text transfer protocol) startup driver layer from bottom to top. The layers above depend on the layers below. For example, the SNP layer depends on the UNDI layer, the MNP layer depends on the SNP layer, the protocol adaptation layer depends on the MNP layer, and the HTTP startup driver layer depends on the protocol adaptation layer. Among them:
[0058] The UNDI layer is used to directly communicate with the network card and provide a service interface to the SNP layer through a protocol object to achieve communication between the SNP layer and the network card.
[0059] The SNP layer is used to call the service interface provided by the UNDI layer to manage the network card, provide an interface to the MNP layer for the MNP layer to call this interface, send the data sent by the MNP layer to the UNDI layer, and send the data sent by the UNDI layer to the MNP layer. Among them, the management of the network card can include, but is not limited to: initializing the network card, opening the network port, and closing the network port.
[0060] The MNP layer is used to manage network service binding protocols and network protocols, provide an interface for the protocol adaptation layer to call this interface, send the data sent by the protocol adaptation layer to the SNP layer, and send the data sent by the SNP layer to the protocol adaptation layer.
[0061] The protocol adaptation layer is used to convert the data of the first protocol received according to the Figure 1 protocol relationship in it into the data of the second protocol and then send it out. The scenarios for the protocol adaptation layer to send data mainly include two types: The first scenario is to send the data sent by the MNP layer to the HTTP startup driver layer, and the second scenario is to send the data sent by the HTTP startup driver layer to the MNP layer. For the first scenario, the first protocol is the TLS (transport layer security) protocol or the IP (internet protocol), and the second protocol is the HTTP, HTTPS (hyper text transfer protocol over secure socket layer), DNS (domain name system), or DHCP (dynamic host configuration protocol). For the second scenario, the first protocol is the HTTP, HTTPS, DNS protocol, or DHCP, and the second protocol is the TLS protocol or the IP.
[0062] From Figure 1 it can be seen that:
[0063] In the first scenario, the main process of converting the data of the IP into the data of the HTTP or HTTPS may include: first converting the data of the IP into the data of the TCP (transmission control protocol) and then converting it into the data of the HTTP or HTTPS.
[0064] In the first scenario, the main process of converting the data of the IP into the data of the DNS protocol may include: first converting the data of the IP into the data of the UDP (user datagram protocol) and then converting it into the data of the DNS protocol.
[0065] In the first scenario, the main process of converting the data of the IP into the data of the DHCP may include: first converting the data of the IP into the data of the UDP and then converting it into the data of the DHCP.
[0066] In the second scenario, the main process of converting HTTP or HTTPS data into IP data may include: first converting HTTP or HTTPS data into TCP data and then into IP data.
[0067] In the second scenario, the process of converting DNS protocol data into IP data may include: first converting DNS protocol data into UDP data and then into IP data.
[0068] In the second scenario, the process of converting DHCP data into IP data may include: first converting DHCP data into UDP data and then into IP data.
[0069] The HTTP startup driver layer is the top layer that drives the network card. It can call the remaining lower layers and the startup service discovery / startup service configuration located in the HTTP startup driver layer to implement the driving of the network card. The HTTP startup driver layer can process data of HTTP, DNS protocol, or DHCP, so the protocol adaptation layer is required to convert the data of the remaining protocols into data of HTTP, DNS protocol, or DHCP.
[0070] Any two adjacent layers above communicate through specified objects. For example, the UNDI layer and the SNP layer communicate through the protocol object Protocol, and the protocol object includes the service interfaces required for communication.
[0071] In the prior art, the above UEFI framework cannot support the driving of GMAC (gigabit media access controller) network cards, resulting in an incomplete range of network cards supported by the UEFI framework.
[0072] To solve the above problems, embodiments of the present invention can implement the driving of GMAC network cards in the bottommost UNDI layer of the UEFI framework. Specifically, the UNDI layer periodically detects whether a GMAC network card is inserted. When a GMAC network card is inserted, a protocol object is generated in the UNDI layer for the upper-layer SNP protocol to call the protocol object to drive the GMAC network card.
[0073] The following uses specific embodiments to detail the technical solutions of the embodiments of the present invention and how the technical solutions of the present invention solve the above technical problems. These several specific embodiments below can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The following will describe the embodiments of the present invention with reference to the accompanying drawings.
[0074] Figure 2 Exemplarily shows the step flowchart of a method for driving a GMAC network card in a UEFI framework provided by an embodiment of the present invention. Refer toFigure 2 , the method includes:
[0075] S101: Periodically detect whether a GMAC network card is inserted into the network port in the UNDI layer of the UEFI framework.
[0076] In an embodiment of the present invention, the insertion of the GMAC network card can be detected periodically by software. Specifically, a startup function can be set in the UNDI layer, and this startup function can be used to perform preparatory processing on the driver of the GMAC network card in the UNDI layer, that is, generate a protocol object. This startup function can call a network card insertion detection class to periodically detect whether a GMAC network card is inserted into the network port.
[0077] It can be understood that the startup function and the network card insertion detection class are software codes in the UNDI layer.
[0078] S102: When it is detected that a GMAC network card is inserted into the network port, generate a protocol object in the UNDI layer according to the description structure of the GMAC network card. The protocol object includes at least one service interface for the GMAC network card, and this service interface is used to provide services to the SNP layer in the UEFI framework.
[0079] Among them, the protocol object is the Protocol corresponding to gEfiNetworkInterfaceIdentifierProtocolGuid_31, and gEfiNetworkInterfaceIdentifierProtocolGuid_31 is an open-source interface in the UEFI framework for constructing a protocol object.
[0080] It can be understood that service interfaces are generated according to the information of the service interfaces in the description structure of the GMAC network card, and the service interfaces are added to the protocol object.
[0081] Optionally, generating the protocol object according to the description structure of the GMAC network card includes: First, encapsulate the service interfaces into a list object according to the information of the service interfaces of the GMAC network card included in the description structure of the GMAC network card; then, generate a protocol object according to the addresses of the service interfaces in the list object.
[0082] It can be understood that the address of the service interface in the protocol object can be used to uniquely identify the service interface, and the address of the service interface is related to the order among the service interfaces, so that the SNP layer can call the service interface through the address of the service interface.
[0083] S103: Drive the GMAC network card through the service interface in the protocol object for driving the GMAC network card.
[0084] Specifically, during the process of driving the GMAC network card, Figure 1 each layer in Figure 1 will implement the call between layers according to the dependency relationship between the layers in
[0085] Finally, the SNP layer obtains the corresponding service interface through the protocol object to realize the driving of the GMAC network card. In the embodiment of the present invention, the UNDI layer periodically detects whether a GMAC network card is inserted into the network port, and generates a protocol object when it detects that the GMAC network card is inserted into the network port to drive the GMAC network card and make the GMAC network card in an available state. Thus, after the GMAC network card is unplugged from the network port and re-inserted each time, the GMAC network card can be driven to be in an available state, avoiding the situation that the GMAC network card cannot work without restarting the system after the GMAC network card is re-inserted. In addition, the detection period is usually determined according to the computer processing speed. Since the computer processing speed is usually very high, the period is very small. For example, at the millisecond level, so the time difference between re-inserting the GMAC network card and driving the GMAC network card is imperceptible to the user, that is, the GMAC network card starts to be driven after the GMAC network card is inserted.
[0086] In addition, the embodiment of the present invention avoids the situation that the GMAC network card cannot work after the GMAC network card is re-inserted through the UNDI layer in UEFI, that is, avoids the situation that the GMAC network card cannot work after the GMAC network card is re-inserted through software. In the prior art, detecting whether the network card is unplugged and re-inserted through hardware requires a hardware detection circuit and reports to the software after re-insertion, so the hardware detection circuit results in a high cost of hardware detection. However, the present invention only requires a set of simple logic codes through software and does not require a hardware detection circuit, so the cost is low.
[0087] It can be understood that since the UNDI layer and the SNP layer communicate through the protocol object in the UEFI framework, the embodiment of the present invention can realize the driving of the GMAC network card by adding a service interface for driving the GMAC network card in the UNDI layer. In addition, in addition to driving the GMAC network card, it is also necessary to manage the GMAC network card and communicate through the GMAC network card. Therefore, the protocol object also needs to provide a service interface for managing the GMAC network card and a service interface for communicating through the GMAC network card.
[0088] Optionally, when it is detected that the GMAC network card is inserted into the network port, before generating the protocol object according to the description structure of the GMAC network card in the UNDI layer, it further includes: initializing the GMAC network card in the UNDI layer.
[0089] Specifically, an initialization class can be provided in the UNDI layer, and the initialization class can be used to initialize the hardware and software of the GMAC.
[0090] Among them, the hardware initialization can include initializing at least one of the following registers of the GMAC network card in the UNDI layer: physical register, media access control register, and direct memory access register. The initialization of the above registers can be: clearing the data in the register and / or writing configuration data to the register.
[0091] The software initialization can include but is not limited to: instantiating code and initializing variables in the software.
[0092] The embodiment of the present invention can implement the initialization of the GMAC network card in the UNDI layer, and since the initialization is before generating the protocol object, the GMAC network card can be in an available state before generating the protocol object. The information in the registers of the GMAC network card can be used during the process of generating the protocol object, which can ensure the accurate generation of the protocol object and thus improve the success rate of driving the GMAC network card.
[0093] Optionally, before generating the protocol object according to the description structure of the GMAC network card, it further includes:
[0094] Reading the hardware information of the GMAC network card from the GMAC network card through the UNDI layer; writing the hardware information of the GMAC network card into the description structure of the GMAC network card in the UNDI layer.
[0095] Among them, the hardware information of the GMAC network card can include but is not limited to: the version of the GMAC network card, the model of the GMAC network card, and the information of the registers. Among them, the information of the registers includes the type of the register and the size of the register.
[0096] The hardware information of the GMAC network card can be stored in any storage device of the GMAC, for example, a register.
[0097] The embodiment of the present invention can generate a class through the structure in the UNDI layer, read the hardware information and write it into the description structure. After the hardware information of the GMAC network card is updated, the description structure of the GMAC network card can be updated according to the hardware information before driving the GMAC network card, which improves the accuracy of the description structure and helps to better manage the GMAC network card.
[0098] Optionally, the description structure of the above GMAC network card further includes the information of the service interface of the GMAC network card.
[0099] Among them, the information of the service interface of the GMAC network card can be used to uniquely identify the service interface, and this information can be the name or starting address of the GMAC network card.
[0100] It can be understood that the protocol object includes various service interfaces required to manage the GMAC network card and communicate through the GMAC network card. Therefore, after driving the GMAC network card, the above method further includes: communicating through the GMAC network card and the service interface for communication in the protocol object; and / or, managing the GMAC network card through the service interface for managing the GMAC network card in the protocol object.
[0101] The above communication process may include two directions: the first direction, the UEFI framework sends data from the top layer to the bottom layer in the order of layers from top to bottom, the bottom layer sends the data to the GMAC network card, and the GMAC network card sends the data out through the wireless network; the second direction, the GMAC network card receives the data sent by the wireless network and sends the data to the bottom layer of the UEFI framework, and the UEFI framework sends the data from the bottom layer to the top layer in the order of layers from bottom to top.
[0102] During the above communication process or system startup process, it is necessary to manage the GMAC network card. Among them, the management of the GMAC network card may include but is not limited to: obtaining the status of the GMAC network card, driving the GMAC network card, stopping the GMAC network card, obtaining the initialization information of the GMAC network card, obtaining the configuration information of the GMAC network card, initializing the GMAC network card, recharging the GMAC network card, obtaining the network address of the GMAC network card.
[0103] It can be understood that when performing different management on the network card, the service interface corresponding to the management process is adopted. For example, when obtaining the status of the GMAC network card, the service interface for obtaining the status of the GMAC network card is adopted, and when initializing the GMAC network card, the initialization interface is adopted.
[0104] In summary, a method for driving a GMAC network card in a UEFI framework provided by an embodiment of the present invention can periodically detect whether a GMAC network card is inserted into a network port in the UNDI layer of the UEFI framework; when it is detected that the GMAC network card is inserted into the network port, a protocol object is generated in the UNDI layer according to the description structure of the GMAC network card, and the protocol object includes at least one service interface for the GMAC network card, and the service interface is used to provide services to the SNP layer in the UEFI framework; the GMAC network card is driven through the service interface for driving the GMAC network card in the protocol object. The embodiment of the present invention can periodically detect whether a GMAC network card is inserted into a network port through the bottommost UNDI layer in the UEFI framework, and generate a protocol object in the UNDI layer when the GMAC network card is inserted, so that the upper-layer SNP protocol can call the protocol object to drive the GMAC network card.
[0105] Corresponding to the method for driving a GMAC network card in the UEFI framework in the above embodimentFigure 3 The block diagram of a driving device for a GMAC network card in a UEFI framework provided by an embodiment of the present invention is exemplarily shown. For ease of description, only parts related to the embodiment of the present invention are shown. Refer to Figure 3 , the driving device 200 for the GMAC network card in the UEFI framework includes: a periodic detection module 201, a protocol object generation module 202, and a network card driving module 203.
[0106] Among them, the periodic detection module 201 is used to periodically detect whether a GMAC network card is inserted into the network port in the UNDI layer of the UEFI framework.
[0107] The protocol object generation module 202 is used to generate a protocol object in the UNDI layer according to the description structure of the GMAC network card when it is detected that the network card is inserted into the network port. The protocol object includes at least one service interface for the GMAC network card, and the service interface is used to provide services to the SNP layer in the UEFI framework.
[0108] The network card driving module 203 is used to drive the GMAC network card through the service interface in the protocol object for driving the GMAC network card.
[0109] Optionally, the device further includes:
[0110] An initialization module, which is used to initialize the GMAC network card in the UNDI layer.
[0111] Optionally, the initialization module is further used for:
[0112] Initializing at least one of the following registers of the GMAC network card in the UNDI layer: a physical register, a media access control register, and a direct memory access register.
[0113] Optionally, the device further includes a hardware information reading module and a hardware information writing module:
[0114] The hardware information reading module is used to read the hardware information of the GMAC network card from the GMAC network card through the UNDI layer.
[0115] The hardware information writing module is used to write the hardware information of the GMAC network card into the description structure of the GMAC network card in the UNDI layer.
[0116] Optionally, the description structure of the GMAC network card further includes information about the service interface of the GMAC network card.
[0117] Optionally, the protocol object generation module 202 is further configured to: encapsulate the service interface into a list object according to the information of the service interface of the GMAC network card included in the description structure of the GMAC network card; generate the protocol object according to the address of the service interface in the list object.
[0118] Optionally, the device further includes a communication module and / or a management module:
[0119] The communication module is configured to communicate through the GMAC network card and the service interface for communication in the protocol object.
[0120] The management module is configured to manage the GMAC network card through the service interface for managing the GMAC network card in the protocol object.
[0121] The driving device of the GMAC network card in the UEFI framework provided in this embodiment can be used to execute the technical solution of the method embodiment shown above. Figure 2 Its implementation principle and technical effect are similar, and will not be elaborated here in this embodiment.
[0122] Figure 4 Exemplarily shows a schematic structural diagram of an electronic device provided in an embodiment of the present invention. Referring to Figure 4 , the electronic device 600 includes a memory 602 and at least one processor 601;
[0123] Among them, the memory 602 stores computer execution instructions;
[0124] At least one processor 601 executes the computer execution instructions stored in the memory 602, so that the electronic device implements the method described above. Figure 2 in;
[0125] In addition, the electronic device 600 may further include a receiver 603 and a transmitter 604. The receiver 603 is configured to receive information from other devices or apparatuses and forward it to the processor 601, and the transmitter 604 is configured to send the information to other devices or apparatuses.
[0126] The electronic device provided in this embodiment can be used to execute the technical solution of the method embodiment shown above. Figure 2 Its implementation principle and technical effect are similar, and will not be elaborated here in this embodiment.
[0127] An embodiment of the present invention further provides a computer program, and the computer program is used to implement the method described above. Figure 2 in;
[0128] An embodiment of the present invention also provides a computer-readable storage medium. The computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, a computing device is enabled to implement the method as described above Figure 2 in the foregoing
[0129] The above description is only a preferred embodiment of the present invention and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of disclosure involved in the present invention is not limited to the technical solution formed by the specific combination of the above technical features. It should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosure concept. For example, a technical solution formed by mutually replacing the above features with technical features having similar functions (but not limited to) disclosed in the present invention.
[0130] In addition, although the operations are depicted in a particular order, this should not be construed as requiring that the operations be performed in the particular order shown or in sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, although a number of specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present invention. Certain features described in the context of separate embodiments may also be implemented combinatorially in a single embodiment. Conversely, the various features described in the context of a single embodiment may also be implemented separately or in any suitable sub-combination in multiple embodiments.
[0131] Although the subject matter has been described in language specific to structural features and / or methodological acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. On the contrary, the specific features and acts described above are merely example forms for implementing the claims.
Claims
1. A driving method for a GMAC network card in a UEFI framework, characterized in that, including: periodically detecting in the UNDI layer of the UEFI framework whether a GMAC network card is inserted into the network port; wherein, a startup function is set in the UNDI layer, and the startup function is used to call a network card insertion detection class to periodically detect whether a GMAC network card is inserted into the network port, and the detection period is determined according to the computer processing speed; when it is detected that the GMAC network card is inserted into the network port, reading the hardware information of the GMAC network card from the GMAC network card through the UNDI layer, writing the hardware information of the GMAC network card into the description structure of the GMAC network card in the UNDI layer, and generating a protocol object according to the description structure of the GMAC network card in the UNDI layer, wherein, the protocol object includes at least one service interface for the GMAC network card, and the service interface is used to provide services to the SNP layer in the UEFI framework; driving the GMAC network card through the service interface for driving the GMAC network card in the protocol object; an initialization class is further set in the UNDI layer, and the initialization class is used to initialize the hardware and software of the GMAC; before generating a protocol object according to the description structure of the GMAC network card in the UNDI layer, the method further includes: initializing the GMAC network card in the UNDI layer.
2. The method according to claim 1, characterized in that The initializing the GMAC network card in the UNDI layer includes: initializing at least one of the following registers of the GMAC network card in the UNDI layer: physical register, media access control register, and direct memory access register.
3. The method according to claim 1, characterized in that, The description structure of the GMAC network card further includes information about the service interface of the GMAC network card.
4. The method according to claim 1, wherein The generating a protocol object according to the description structure of the GMAC network card includes: encapsulating the service interface into a list object according to the information about the service interface of the GMAC network card included in the description structure of the GMAC network card; generating the protocol object according to the address of the service interface in the list object.
5. The method according to any one of claims 1 to 4, characterized in that The method further includes: communicating through the GMAC network card and the service interface for communication in the protocol object; and / or, managing the GMAC network card through the service interface for managing the GMAC network card in the protocol object.
6. A driving device for a GMAC network card in a UEFI framework, characterized in that, including: a periodic detection module, configured to periodically detect in the UNDI layer of the UEFI framework whether a GMAC network card is inserted into the network port; wherein, a startup function is set in the UNDI layer, and the startup function is used to call a network card insertion detection class to periodically detect whether a GMAC network card is inserted into the network port, and the detection period is determined according to the computer processing speed; A protocol object generation module, configured to, when detecting that the network interface is inserted into the GMAC network card, read the hardware information of the GMAC network card from the GMAC network card through the UNDI layer, write the hardware information of the GMAC network card into the description structure of the GMAC network card in the UNDI layer, and generate a protocol object according to the description structure of the GMAC network card in the UNDI layer, wherein at least one service interface for the GMAC network card is included in the protocol object, and the service interface is used to provide services to the SNP layer in the UEFI framework; A network card driver module, configured to drive the GMAC network card through the service interface in the protocol object for driving the GMAC network card; An initialization class is further provided in the UNDI layer, and the initialization class is used to initialize the hardware and software of the GMAC; the apparatus further includes: an initialization module, configured to initialize the GMAC network card in the UNDI layer.
7. An electronic device, characterized in that, Comprising: At least one processor and a memory; The memory stores computer execution instructions; The at least one processor executes the computer execution instructions stored in the memory, so that the electronic device implements the method according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, Computer execution instructions are stored in the computer-readable storage medium, and when the processor executes the computer execution instructions, the computing device implements the method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Method of realizing wireless card driver in UEFI (unified extensible firmware interface) layer
CN103853586A