Ethernet card initialization processing method, device and equipment and readable storage medium

By detecting the connection status between the Ethernet controller and the Ethernet physical layer of the Ethernet card, reliable initialization of the Ethernet card is ensured even when the Ethernet controller and the Ethernet physical layer are set up separately, thus avoiding initialization failure and system crashes.

CN117014305BActive Publication Date: 2026-11-24LOONGSON TECH CORP
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210465737.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-29
Publication Date
2026-11-24
Estimated Expiration
2042-04-29

AI Technical Summary

Technical Problem

Existing technologies cannot effectively determine whether an Ethernet card has undergone initialization and cannot achieve reliable initialization, especially when the Ethernet controller and the Ethernet physical layer are set up separately, which may lead to initialization failure and operating system crashes.

Method used

The process involves detecting whether the Ethernet controller of the Ethernet card is connected to the Ethernet physical layer. If a connection exists, initialization is performed based on that connection; otherwise, the initialization process is stopped.

Benefits of technology

Ensuring reliable initialization of the Ethernet card avoids unnecessary processing, improving the initialization success rate and system stability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117014305B_ABST
    Figure CN117014305B_ABST
Patent Text Reader

Abstract

This application provides an Ethernet card initialization processing method, apparatus, device, and readable storage medium. The method includes: detecting whether at least one Ethernet controller connected to an Ethernet physical layer exists in the Ethernet controller of the Ethernet card, wherein the Ethernet controller and the Ethernet physical layer are separately configured. If at least one Ethernet controller connected to the Ethernet physical layer exists, the Ethernet card is initialized based on the Ethernet controller connected to the Ethernet physical layer and the Ethernet physical layer connected thereto; if no Ethernet controller connected to the Ethernet physical layer exists, the initialization of the Ethernet card is stopped. The solution provided by this application solves the technical problems in the prior art of being unable to effectively determine whether Ethernet card initialization processing can be performed, and the inability to achieve reliable initialization of Ethernet cards.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of Ethernet card technology, and in particular to an Ethernet card initialization processing method, apparatus, device, and readable storage medium. Background Technology

[0002] With the rapid development of computer network technology, Ethernet cards are widely used in the computer network field to meet the needs of various application environments and application layers. Architecturally, an Ethernet card consists of an Ethernet controller and an Ethernet physical layer. The Ethernet controller is a general term for the data link layer chips in the Ethernet card, while the Ethernet physical layer is a general term for the physical layer chips. Based on the Ethernet controller and the Ethernet physical layer, the initialization process of the Ethernet card can be completed.

[0003] Currently, for Ethernet card structures where the Ethernet controller and Ethernet physical layer are separated, it is impossible to effectively determine whether the Ethernet card can be initialized, and if it can be initialized, how to achieve reliable initialization. Therefore, how to effectively determine whether the Ethernet card can be initialized and how to achieve reliable initialization of the Ethernet card are problems that urgently need to be solved. Summary of the Invention

[0004] This application provides an Ethernet card initialization processing method, apparatus, device, and readable storage medium to ensure reliable initialization of the Ethernet card.

[0005] In a first aspect, embodiments of this application provide an Ethernet card initialization processing method, comprising: detecting whether there is at least one Ethernet controller connected to an Ethernet physical layer in the Ethernet controller of the Ethernet card, wherein the Ethernet controller and the Ethernet physical layer are separately configured; if there is at least one Ethernet controller connected to an Ethernet physical layer, then performing initialization of the Ethernet card based on the Ethernet controller connected to the Ethernet physical layer and the Ethernet physical layer connected thereto; if there is no Ethernet controller connected to the Ethernet physical layer, then stopping the initialization of the Ethernet card.

[0006] Furthermore, in the method described above, detecting whether there is at least one Ethernet controller connected to the Ethernet physical layer among the Ethernet controllers of the Ethernet card includes: for each Ethernet controller of the Ethernet card, controlling the Ethernet controller to send a query command to its corresponding Ethernet physical layer address, wherein the Ethernet physical layer address is the address used by the Ethernet controller to connect to each interface of the Ethernet physical layer; if the Ethernet controller receives a return value of any Ethernet physical layer address that is not a preset value, then it is determined that the Ethernet controller is an Ethernet controller connected to the Ethernet physical layer.

[0007] Furthermore, in the method described above, after controlling each Ethernet controller of the Ethernet card to send query instructions to its corresponding Ethernet physical layer addresses, the method includes: for each Ethernet physical layer address corresponding to the Ethernet controller, if the query results are all preset values ​​or no return value is received, then it is determined that the Ethernet controller is not connected to an Ethernet physical layer.

[0008] Furthermore, in the method described above, before detecting whether there is at least one Ethernet controller connected to the Ethernet physical layer in the Ethernet controller of the Ethernet card, the method further includes: matching the Ethernet controller of the Ethernet card with the device driver of each device.

[0009] Further, in the method described above, the device driver includes a device identifier; the matching of the Ethernet controller of the Ethernet card with the device drivers of each device includes: obtaining the device identifier of the Ethernet controller of the Ethernet card; checking whether there is a device driver in the device drivers of each device that matches the identifier of the Ethernet controller of the Ethernet card; if a matching device driver exists, the matching is successful.

[0010] Furthermore, in the method described above, the Ethernet card is provided with multiple Ethernet controllers; the initialization of the Ethernet card based on the Ethernet controller connected to the Ethernet physical layer and the Ethernet physical layer connected thereto includes: for the Ethernet controller connected to the Ethernet physical layer in the Ethernet card, forming a device instance of the Ethernet card according to the Ethernet controller, the Ethernet physical layer connected thereto, and the device driver matched with the Ethernet controller; and completing the initialization of the Ethernet card based on the formed device instance of the Ethernet card.

[0011] Secondly, embodiments of this application provide an Ethernet card initialization processing apparatus, comprising: a detection module, configured to detect whether at least one Ethernet controller connected to an Ethernet physical layer exists among the Ethernet controllers of the Ethernet card, wherein the Ethernet controller and the Ethernet physical layer are separately configured; a processing module, configured to perform initialization of the Ethernet card based on the Ethernet controller connected to the Ethernet physical layer and the Ethernet physical layer connected thereto when at least one Ethernet controller connected to the Ethernet physical layer exists; the processing module is further configured to stop performing initialization of the Ethernet card when no Ethernet controller connected to the Ethernet physical layer exists.

[0012] Further, in the apparatus described above, the detection module includes: a sending unit, configured to control each Ethernet controller of the Ethernet card to send a query command to its corresponding Ethernet physical layer address, wherein the Ethernet physical layer address is the address of each interface of the Ethernet controller used to connect to the Ethernet physical layer; and a determining unit, configured to determine that the Ethernet controller is an Ethernet controller connected to the Ethernet physical layer when the Ethernet controller receives a return value of any Ethernet physical layer address that is not a preset value.

[0013] Thirdly, embodiments of this application provide an electronic device, including: a memory and a processor; wherein the memory is used to store instructions executable by the processor; and the processor is used to call the program instructions in the memory to execute the Ethernet card initialization processing method as described in the first aspect.

[0014] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the Ethernet card initialization processing method as described in the first aspect.

[0015] This application provides an Ethernet card initialization processing method, apparatus, device, and computer-readable storage medium, applicable to Ethernet cards where the Ethernet controller and Ethernet physical layer are separately configured. In this application's solution, an Ethernet controller connected to the Ethernet physical layer is first detected. Then, based on the Ethernet controller connected to the Ethernet physical layer and the Ethernet physical layer connected to it, the Ethernet card initialization is performed. If none of the Ethernet controllers are connected to the Ethernet physical layer, the Ethernet card initialization is stopped. In other words, in this embodiment, for cases where the Ethernet controller and Ethernet physical layer are separately configured, the connection status between the Ethernet controller and the Ethernet physical layer is first detected. Only if at least one Ethernet controller is currently connected to the Ethernet physical layer is the Ethernet card initialization performed; otherwise, the initialization is stopped. This effectively and reliably ensures that the Ethernet card completes initialization and avoids unnecessary processing.

[0016] It should be understood that the content described in the foregoing summary section is not intended to limit the key or essential features of the embodiments of this application, nor is it intended to limit the scope of this application. Other features of this application will become readily apparent from the following description. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application.

[0018] Figure 1 This is a flowchart of the Ethernet card initialization process provided in Embodiment 1 of this application;

[0019] Figure 2 This is a flowchart of the Ethernet card initialization process provided in Embodiment 2 of this application;

[0020] Figure 3 This is a flowchart of the Ethernet card initialization process provided in Embodiment 3 of this application;

[0021] Figure 4 A flowchart illustrating another Ethernet card initialization process provided in this application embodiment;

[0022] Figure 5 This is a schematic diagram of the Ethernet card initialization processing device provided in the embodiments of this application;

[0023] Figure 6 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Detailed Implementation

[0024] Embodiments of this application will now be described in more detail with reference to the accompanying drawings. While some embodiments of this application are shown in the drawings, it should be understood that this application can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this application. It should be understood that the drawings and embodiments of this application are for illustrative purposes only and are not intended to limit the scope of protection of this application.

[0025] The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented, for example, in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0026] Currently, Ethernet cards primarily integrate the Ethernet controller and the Ethernet physical layer onto a single chip. However, with the continuous development of technologies across various fields and the trend towards diversification and flexibility, a new type of Ethernet card separates the Ethernet controller and the Ethernet physical layer. This structure is well-suited for various scenarios where integration is not critical and easy component replacement is required.

[0027] For Ethernet cards with the above structure, since the Ethernet controller and Ethernet physical layer are set separately, there may be situations in practical applications where the Ethernet controller is not connected to the Ethernet physical layer. When such an Ethernet card without an Ethernet physical layer is used in some specific operating systems, since the operating system needs to form a complete device instance before it can successfully initialize the device, if the Ethernet controller is not connected to the Ethernet physical layer, a complete device instance cannot be formed, which may lead to the Ethernet card initialization failure, and in turn, cause the operating system to freeze and other problems.

[0028] The specific operating system can be a real-time operating system (RTOS), also known as an instantaneous operating system, which runs and manages system resources in a sorted manner and provides a consistent foundation for application development. For example, the real-time operating system provided in this application embodiment can be VxWorks, RT-Linux, or other real-time operating systems.

[0029] To address the aforementioned problems, this application provides an Ethernet card initialization processing method, apparatus, device, and readable storage medium to solve these problems. The following embodiments illustrate the solution of this application.

[0030] Example 1

[0031] Figure 1 The flowchart of the Ethernet card initialization process method provided in Embodiment 1 of this application is as follows: Figure 1 As shown, the Ethernet card initialization method provided in this embodiment includes the following steps:

[0032] Step 101: Check whether there is at least one Ethernet controller connected to the Ethernet physical layer in the Ethernet controller of the Ethernet card, wherein the Ethernet controller and the Ethernet physical layer are set separately.

[0033] It should be noted that the execution entity of the Ethernet card initialization processing method provided in this embodiment is an Ethernet card initialization processing device. In practical applications, this Ethernet card initialization processing device can be implemented by a computer program, or by a medium storing the relevant computer program, such as a USB flash drive and / or optical disc; or it can be implemented by a physical device that integrates or installs the relevant computer program, such as a chip.

[0034] In this embodiment, the Ethernet card may contain only one Ethernet controller, or multiple Ethernet controllers may exist simultaneously. For separately configured Ethernet controllers, one Ethernet controller may be connected to one Ethernet physical layer.

[0035] The separation of the Ethernet controller and the Ethernet physical layer can refer to the fact that the Ethernet controller and the Ethernet physical layer are not integrated into the same chip. For example, the Ethernet controller and the Ethernet physical layer are integrated into different chips, and they can be connected through the physical interfaces of their respective chips. In practical applications, the Ethernet card initialization can only be guaranteed to be successful when the Ethernet controller and the Ethernet physical layer are connected. Therefore, to avoid unnecessary processing and ensure normal Ethernet card initialization, in this embodiment, the Ethernet card initialization processing device first detects whether there is at least one Ethernet controller connected to the Ethernet physical layer in the Ethernet controller of the Ethernet card, so that the following corresponding processing can be taken based on the connection status of the Ethernet controller.

[0036] To illustrate with a practical example, the number of Ethernet controllers in an Ethernet card can vary. In one scenario, if the Ethernet card integrates one Ethernet controller, the Ethernet card initialization processing device can detect whether that Ethernet controller is connected to the Ethernet physical layer. Conversely, in another scenario, if the Ethernet card integrates two or more Ethernet controllers, the Ethernet card initialization processing device can detect whether each Ethernet controller is connected to the Ethernet physical layer separately.

[0037] Furthermore, the specific detection method was described with examples in Example 2, and is not limited in this example.

[0038] Step 102: If there is at least one Ethernet controller connected to the Ethernet physical layer, then perform initialization of the Ethernet card based on the Ethernet controller connected to the Ethernet physical layer and the Ethernet physical layer connected to it.

[0039] In this embodiment, in order to ensure successful initialization, after the Ethernet card initialization processing device detects whether there is at least one Ethernet controller connected to the Ethernet physical layer in the Ethernet controller of the Ethernet card, it can decide whether to perform the initialization of the Ethernet card based on the detection result.

[0040] Specifically, if at least one Ethernet controller connected to the Ethernet physical layer exists, the initialization of the Ethernet card can proceed. For example, if the Ethernet card integrates only one Ethernet controller, and the Ethernet card initialization processing device detects that this Ethernet controller is connected to the Ethernet physical layer, then the Ethernet card is considered to have successfully initialized. Therefore, the Ethernet card initialization processing device can perform initialization of the Ethernet card based on the Ethernet controller connected to the Ethernet physical layer and the Ethernet physical layer connected to it. As another example, if the Ethernet card integrates two or more Ethernet controllers, and the Ethernet card initialization processing device detects that one or more Ethernet controllers connected to the Ethernet physical layer exist in the Ethernet card, then the Ethernet card is also considered to have successfully initialized. Therefore, the Ethernet card initialization processing device can perform initialization of the Ethernet card based on the Ethernet controller connected to the Ethernet physical layer and the Ethernet physical layer connected to it.

[0041] Step 103: If there is no Ethernet controller connected to the Ethernet physical layer, stop the initialization of the Ethernet card.

[0042] In this embodiment, to avoid unnecessary processing, if the Ethernet card initialization processing device detects that there is no Ethernet controller connected to the Ethernet physical layer in the Ethernet controller of the Ethernet card, it can stop the initialization of the Ethernet card.

[0043] The Ethernet card initialization method provided in this embodiment is applied to Ethernet cards where the Ethernet controller and Ethernet physical layer are separately configured. In this embodiment, the Ethernet controller connected to the Ethernet physical layer is first detected. Based on the Ethernet controller connected to the Ethernet physical layer and the Ethernet physical layer connected to it, the Ethernet card initialization is performed. If none of the Ethernet controllers are connected to the Ethernet physical layer, the initialization of the Ethernet card is stopped. In other words, in this embodiment, for cases where the Ethernet controller and Ethernet physical layer are separately configured, the connection status between the Ethernet controller and the Ethernet physical layer is first detected. Initialization of the Ethernet card is only performed if at least one Ethernet controller is currently connected to the Ethernet physical layer; otherwise, the initialization is stopped. This effectively and reliably ensures that the Ethernet card completes initialization and avoids unnecessary processing.

[0044] Example 2

[0045] Figure 2 This is a flowchart of the Ethernet card initialization process method provided in Embodiment 2 of this application, as follows: Figure 2 As shown, the Ethernet card initialization processing method provided in this embodiment is a further refinement of step 101 based on Embodiment 1 of this application. Therefore, the Ethernet card initialization processing method provided in this embodiment includes the following steps:

[0046] Step 201: For each Ethernet controller of the Ethernet card, control the Ethernet controller to send a query command to its corresponding Ethernet physical layer address, where the Ethernet physical layer address is the address used by the Ethernet controller to connect to each interface of the Ethernet physical layer.

[0047] In this embodiment, as an example, to detect the connection status between the Ethernet controller and the Ethernet physical layer, a polling query instruction can be added to the member functions of each Ethernet controller driver, thereby querying the interface corresponding to the Ethernet physical layer address. Specifically, the Ethernet card initialization processing device can control each Ethernet controller of the Ethernet card to send a query instruction to its corresponding Ethernet physical layer address. This query instruction can be used to check whether the return value of the interface corresponding to the Ethernet physical layer address is a preset value. Here, the Ethernet physical layer address can be the address of each interface used by the Ethernet controller to connect to the Ethernet physical layer, and the interface is used for communication between the Ethernet controller and the Ethernet physical layer.

[0048] In practical applications, to achieve communication between the Ethernet controller and the Ethernet physical layer, each Ethernet controller can be configured with an interface for communication with the Ethernet physical layer. The addresses of these interfaces are called Ethernet physical layer addresses. In one example, each Ethernet controller has 32 interfaces for communication with the Ethernet physical layer, and each interface is assigned a corresponding Ethernet physical layer address. For example, addresses 0 to 31 can be set as the Ethernet physical layer address corresponding to a certain Ethernet controller; that is, the corresponding interface can be read using the Ethernet physical layer address from 0 to 31. This embodiment does not limit the method of setting the Ethernet physical layer address.

[0049] Step 202: If the Ethernet controller receives a return value for any Ethernet physical layer address that is not a preset value, then the Ethernet controller is determined to be an Ethernet controller connected to an Ethernet physical layer.

[0050] In this embodiment, after the Ethernet card initialization processing device controls each Ethernet controller of the Ethernet card to send a query command to its corresponding Ethernet physical layer address, it can determine whether the Ethernet controller is an Ethernet controller connected to the Ethernet physical layer based on the return value of the Ethernet physical layer address.

[0051] Specifically, if the Ethernet controller receives an Ethernet physical layer address and the return value is Ethernet physical layer identification data, then the Ethernet controller can be determined to be an Ethernet controller connected to an Ethernet physical layer. When the Ethernet controller receives an Ethernet physical layer address and the return value is Ethernet physical layer identification data, that is, when the return value of the Ethernet controller receiving an Ethernet physical layer address is not a preset value, the Ethernet controller records this Ethernet physical layer address and Ethernet physical layer identification.

[0052] The Ethernet physical layer identifier is pre-stored in a register on the Ethernet physical layer and returned by the Ethernet physical layer through its corresponding Ethernet physical layer address. Furthermore, the pre-stored Ethernet physical layer identifiers can be different in different Ethernet physical layers; this embodiment does not impose any limitations on this.

[0053] The preset value can be "0xffff" or other values, and this embodiment does not limit it. This preset value is used to indicate that no Ethernet physical layer identifier was read from the interface, that is, it indicates that the current interface is not connected to an Ethernet physical layer.

[0054] For example, if an Ethernet controller receives a return value for an Ethernet physical layer address of address 15 that is not the preset value, it indicates that the interface corresponding to the Ethernet physical layer address of address 15 is connected to an Ethernet physical layer, and it can be determined that the Ethernet controller is an Ethernet controller connected to an Ethernet physical layer.

[0055] The Ethernet card initialization method provided in this embodiment controls each Ethernet controller of the Ethernet card to send query commands to its corresponding Ethernet physical layer addresses. If the Ethernet controller receives an Ethernet physical layer identifier returned by any Ethernet physical layer address, it is determined that the Ethernet controller is connected to the Ethernet physical layer. In other words, by sending query commands, the connection status between the Ethernet controller and the Ethernet physical layer is determined. This method can objectively and accurately identify Ethernet controllers connected to the Ethernet physical layer, thus ensuring successful Ethernet card initialization. Furthermore, since the Ethernet physical layer address is usually a fixed address, the polling query command code set in different Ethernet controller drivers can be the same, exhibiting strong versatility.

[0056] Based on the above embodiment 2, in order to further illustrate the Ethernet card initialization processing method of this application, after step 201 in the above embodiment 2, it may also include: for each Ethernet physical layer address corresponding to the Ethernet controller, if the query result is a preset value or no return value is received, then it is determined that the Ethernet controller is not connected to an Ethernet physical layer.

[0057] In this embodiment, after the Ethernet card initialization processing device controls each Ethernet controller of the Ethernet card to send a query command to its corresponding Ethernet physical layer address, if the Ethernet controller receives "0xffff" as the return value of all Ethernet physical layer addresses, which is a non-Ethernet physical layer identifier, or if no return value is received within a predetermined time, it can be determined that the Ethernet controller is not connected to the Ethernet physical layer.

[0058] The Ethernet card initialization method provided in this embodiment determines that the Ethernet controller is not connected to the Ethernet physical layer if the Ethernet controller does not receive the Ethernet physical layer identifier. This method can objectively and accurately determine the Ethernet controller that is not connected to the Ethernet physical layer, thereby providing an accurate judgment on whether to perform Ethernet card initialization.

[0059] Example 3

[0060] Based on any of the above embodiments, in order to further illustrate the Ethernet card initialization processing method of this application, before step 101 in the above embodiment, it may also include: matching the Ethernet controller of the Ethernet card with the device driver of each device.

[0061] In practical applications, the device initialization process under a certain operating system is roughly as follows: there are three concepts in the operating system: device information, device driver, and device instance. When the device information and driver are successfully matched, a device instance is formed, and then the device instance can be initialized.

[0062] Taking the Ethernet card initialization scenario as an example, when the operating system performs a device scan, it saves the device information of the scanned Ethernet controller, for example, by saving it to the corresponding linked list. Subsequently, when the Ethernet controller driver is registered, it will match the devices supported by the driver with the previously saved device information. If the match is successful, a device instance is formed and device initialization begins.

[0063] Specifically, if the Ethernet controller of the Ethernet card successfully matches the device driver, the initialization process continues; otherwise, subsequent processing of that Ethernet controller stops. The successfully matched device driver can be the driver for the Ethernet card. For example, for an Ethernet card with only one Ethernet controller, if the matching fails, the initialization process for the entire Ethernet card stops. For an Ethernet card with multiple Ethernet controllers, if the device information of one Ethernet controller fails to match the driver of the Ethernet card, matching of other Ethernet controllers can continue, and subsequent processes can be executed. Through this implementation, before detecting the connection status between the Ethernet controller and the Ethernet physical layer, the matching status of the Ethernet controller's device driver is checked, and the corresponding process is executed based on the detection result, thereby avoiding unnecessary processing and improving the efficiency and reliability of initialization.

[0064] In one alternative implementation, the device driver may include the device's identifier. Accordingly, Figure 3 This is a flowchart of the Ethernet card initialization process method provided in Embodiment 3 of this application, as follows: Figure 3 As shown, matching the Ethernet controller of the Ethernet card with the device driver of each device may include the following steps:

[0065] Step 301: Obtain the device identifier of the Ethernet controller of the Ethernet card.

[0066] Step 302: Check if there is a device driver in the device driver of each device that matches the identifier of the Ethernet controller of the Ethernet card.

[0067] Step 303: If a matching device driver exists, the match is successful.

[0068] In this embodiment, since the Ethernet card needs to be connected to a user terminal such as a desktop computer or laptop computer to be used, it needs to be matched with the device driver in the user terminal's operating system before use.

[0069] Specifically, the Ethernet card initialization processing device can obtain the device identifier of the Ethernet controller of the Ethernet card. The device identifier can be a device name or other suitable device identifier; this embodiment does not limit this. Furthermore, this device identifier can be one that has been pre-stored in a corresponding linked list through device scanning when the Ethernet card is connected to the user terminal.

[0070] Next, the Ethernet card initialization processing unit searches among the device drivers of various devices in the operating system to see if a device driver exists that matches the identifier of the Ethernet controller of the Ethernet card. If a matching device driver exists, meaning that the device driver can support the operation of the Ethernet card, then the match is successful.

[0071] The Ethernet card initialization method provided in this embodiment obtains the device identifier of the Ethernet controller of the Ethernet card, and searches for a device driver in the device driver of each device that matches the identifier of the Ethernet controller of the Ethernet card. If a matching device driver is found, the match is successful, ensuring that the Ethernet card is an Ethernet card supported by the user terminal operating system, thus providing a prerequisite for the initialization of the Ethernet card.

[0072] Example 4

[0073] Furthermore, based on the above embodiment three, the Ethernet card can be configured with multiple Ethernet controllers, and correspondingly, step 102 may include the following steps:

[0074] For an Ethernet controller connected to an Ethernet physical layer in an Ethernet card, a device instance of the Ethernet card is formed based on the Ethernet controller, the Ethernet physical layer connected to it, and the device driver matched with the Ethernet controller.

[0075] Based on the device instance of the formed Ethernet card, the initialization of the Ethernet card is completed.

[0076] In this embodiment, the Ethernet card can be configured with multiple Ethernet controllers. For the Ethernet controller connected to the Ethernet physical layer in the Ethernet card, the Ethernet card initialization processing device can form a device instance of the Ethernet card according to the Ethernet controller, the Ethernet physical layer connected to it, and the device driver matched with the Ethernet controller, and complete the initialization of the Ethernet card based on the formed device instance of the Ethernet card.

[0077] The device driver matching the Ethernet controller can be an Ethernet card driver, which consists of two parts: an Ethernet controller driver and an Ethernet physical layer driver. For example, an Ethernet controller instance can be formed based on the Ethernet controller and the Ethernet controller driver in the matching Ethernet card driver, and an Ethernet physical layer instance can be formed based on the Ethernet physical layer connected to the Ethernet controller and the Ethernet physical layer driver in the matching Ethernet card driver. This Ethernet controller instance and the Ethernet physical layer instance together form the device instance of the Ethernet card.

[0078] The Ethernet card initialization method provided in this embodiment targets an Ethernet controller connected to an Ethernet physical layer within the Ethernet card. Based on the Ethernet controller, the connected Ethernet physical layer, and the device driver matching the Ethernet controller, a device instance of the Ethernet card is formed. The initialization of the Ethernet card is then completed based on this device instance. In other words, by using the Ethernet controller connected to the Ethernet physical layer and the device driver matching the Ethernet controller to jointly form a device instance of the Ethernet card, the initialization of the Ethernet card is completed, effectively ensuring successful initialization.

[0079] Figure 4 A flowchart of another Ethernet card initialization process provided in the embodiments of this application is shown below. Figure 4 As shown, the Ethernet card initialization method provided in this embodiment may include the following steps:

[0080] Step 401: Match the Ethernet controller of the Ethernet card with the device driver of each device.

[0081] Step 402: Determine if there is at least one successfully matched Ethernet controller.

[0082] Step 403: If not, end the Ethernet card initialization process.

[0083] Step 404: If yes, then for each successfully matched Ethernet controller, determine whether the Ethernet controller is connected to the Ethernet physical layer.

[0084] Step 405: If yes, then based on the Ethernet controller and the Ethernet physical layer connected to it, and the device driver matched with the Ethernet controller, a device instance of the Ethernet card is formed, and based on the formed device instance of the Ethernet card, the initialization of the Ethernet card is completed.

[0085] Step 406: If not, stop the initialization of the Ethernet card.

[0086] It should be noted that the specific execution method and effect of the Ethernet card initialization processing method provided in this embodiment can be found in the relevant content of the foregoing embodiments, and will not be repeated here.

[0087] Example 5

[0088] Figure 5 This is a schematic diagram of the Ethernet card initialization processing device provided in the embodiments of this application, as shown below. Figure 5As shown, the Ethernet card initialization processing device provided in this embodiment includes a detection module 51 and a processing module 52. The detection module 51 is used to detect whether at least one Ethernet controller connected to an Ethernet physical layer exists in the Ethernet controller of the Ethernet card, wherein the Ethernet controller and the Ethernet physical layer are separately configured. The processing module 52 is used to perform Ethernet card initialization based on the Ethernet controller connected to the Ethernet physical layer and the Ethernet physical layer connected to it when at least one Ethernet controller connected to the Ethernet physical layer exists. The processing module 52 is also used to stop the Ethernet card initialization process when no Ethernet controller connected to the Ethernet physical layer exists.

[0089] The Ethernet card initialization processing device provided in this embodiment is applied to Ethernet cards where the Ethernet controller and Ethernet physical layer are separately configured. The device first detects the Ethernet controller connected to the Ethernet physical layer, and then performs Ethernet card initialization based on the Ethernet controller connected to the Ethernet physical layer and the Ethernet physical layer connected to it. If none of the Ethernet controllers are connected to the Ethernet physical layer, the initialization of the Ethernet card is stopped. In other words, the device provided in this embodiment, for cases where the Ethernet controller and Ethernet physical layer are separately configured, first detects the connection status between the Ethernet controller and the Ethernet physical layer. Only if at least one Ethernet controller is currently connected to the Ethernet physical layer will the Ethernet card initialization be performed; otherwise, the initialization is stopped. This effectively and reliably ensures that the Ethernet card completes initialization and avoids unnecessary processing.

[0090] In an optional embodiment, the detection module 51 includes:

[0091] The sending unit is used to control each Ethernet controller of the Ethernet card to send query commands to its corresponding Ethernet physical layer addresses, where the Ethernet physical layer addresses are the addresses of the interfaces used by the Ethernet controller to connect to the Ethernet physical layer. The determining unit is used to determine that the Ethernet controller is an Ethernet controller connected to the Ethernet physical layer when the return value of any Ethernet physical layer address received by the Ethernet controller is not a preset value.

[0092] In an optional embodiment, the determining unit is further configured to determine that the Ethernet controller is not connected to an Ethernet physical layer when the query results for each Ethernet physical layer address corresponding to the Ethernet controller are all returned as preset values ​​or no return value is received.

[0093] In an optional embodiment, the Ethernet card initialization processing device further includes a matching module 53, used to match the Ethernet controller of the Ethernet card with the device driver of each device.

[0094] In an optional embodiment, the device driver includes a device identifier. The matching module 53 includes: an acquisition unit, configured to acquire the device identifier of the Ethernet controller of the Ethernet card; and a matching unit, configured to check whether there exists a device driver in the device drivers of each device that matches the identifier of the Ethernet controller of the Ethernet card. The matching unit is further configured to determine that a match is successful when a matching device driver exists.

[0095] In an optional embodiment, the processing module 52 is specifically configured to, when at least one Ethernet controller connected to an Ethernet physical layer exists, form a device instance of the Ethernet card based on the Ethernet controller connected to the Ethernet physical layer, the Ethernet physical layer connected to it, and the device driver matched with the Ethernet controller, for the Ethernet controller connected to the Ethernet physical layer in the Ethernet card. The processing module 52 is further configured to initialize the Ethernet card based on the formed device instance of the Ethernet card.

[0096] Example 6

[0097] Figure 6 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application, such as... Figure 6 As shown, this application also provides an electronic device 600, including: a memory 601 and a processor 602.

[0098] Memory 601 is used to store programs. Specifically, the program may include program code, which includes computer-executable instructions. Memory 601 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.

[0099] Processor 602 is used to execute programs stored in memory 601.

[0100] The computer program is stored in memory 601 and configured to be executed by processor 602 to implement the Ethernet card initialization processing method provided in any embodiment of this application. Related descriptions can be understood by referring to the relevant descriptions and effects corresponding to the steps in the accompanying drawings, and will not be elaborated upon here.

[0101] In this embodiment, the memory 601 and the processor 602 are connected via a bus. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0102] Example 7

[0103] This application also provides a readable storage medium storing a computer program thereon, which is executed by a processor to implement the Ethernet card initialization processing method provided in any embodiment of this application.

[0104] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.

[0105] The modules described as separate components may or may not be physically separate. Similarly, the components shown as modules may or may not be physical modules; they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0106] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated module can be implemented in hardware or in a combination of hardware and software functional modules.

[0107] The program code used to implement the methods of this application may be written in any combination of one or more programming languages. This program code may be provided to the processor or controller of a general-purpose computer, special-purpose computer, or other programmable Ethernet card initialization processing device, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on the machine, partially on the machine, as a standalone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0108] In the context of this application, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0109] Furthermore, although the operations are described in a specific order, this should be understood as requiring that such operations be performed in the specific order shown or in sequential order, or requiring that all illustrated operations be performed to achieve the desired result. In certain environments, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this application. Certain features described in the context of individual embodiments may also be implemented in combination in a single implementation. Conversely, various features described in the context of a single implementation may also be implemented individually or in any suitable sub-combination in multiple implementations.

[0110] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.

Claims

1. An Ethernet card initialization processing method, characterized in that, include: For each Ethernet controller of the Ethernet card, the Ethernet controller is controlled to send a query command to its corresponding Ethernet physical layer address to detect whether there is at least one Ethernet controller connected to the Ethernet physical layer among the Ethernet controllers of the Ethernet card. The Ethernet controller and the Ethernet physical layer are set separately, and the Ethernet physical layer address is the address of the Ethernet controller used to connect to the various interfaces of the Ethernet physical layer. If the Ethernet controller receives a return value for any Ethernet physical layer address that is not a preset value, then the Ethernet controller is determined to be an Ethernet controller connected to an Ethernet physical layer. Based on the Ethernet controller connected to the Ethernet physical layer and the Ethernet physical layer connected to it, the initialization of the Ethernet card is performed; wherein, the preset value is used to indicate that the Ethernet physical layer identifier is not read from the interface. If no Ethernet controller with an Ethernet physical layer is connected, the initialization of the Ethernet card will be stopped.

2. The method according to claim 1, characterized in that, The process of controlling each Ethernet controller for an Ethernet card to send query commands to its corresponding Ethernet physical layer addresses includes: If the query results for each Ethernet physical layer address corresponding to the Ethernet controller are all preset values ​​or no return value is received, it is determined that the Ethernet controller is not connected to an Ethernet physical layer.

3. The method according to claim 1 or 2, characterized in that, Before determining whether at least one Ethernet controller connected to the Ethernet physical layer exists in the Ethernet controller used to detect the Ethernet card, the method further includes: Match the Ethernet controller of the Ethernet card with the device driver of each device.

4. The method according to claim 3, characterized in that, The device driver includes the device identifier; the matching of the Ethernet controller of the Ethernet card with the device driver of each device includes: Obtain the device identifier of the Ethernet controller for the Ethernet card; Check if there is a device driver in the device driver of each device that matches the identifier of the Ethernet controller of the Ethernet card; If a matching device driver exists, the match is successful.

5. The method according to claim 3, characterized in that, The Ethernet card is equipped with multiple Ethernet controllers; the initialization of the Ethernet card is performed based on the Ethernet controllers connected to the Ethernet physical layer and the Ethernet physical layer connected thereto, including: For an Ethernet controller connected to an Ethernet physical layer in an Ethernet card, a device instance of the Ethernet card is formed based on the Ethernet controller, the Ethernet physical layer connected to it, and the device driver matched with the Ethernet controller. Based on the device instance of the formed Ethernet card, the initialization of the Ethernet card is completed.

6. An Ethernet card initialization processing device, characterized in that, include: The detection module is used to detect whether there is at least one Ethernet controller connected to the Ethernet physical layer in the Ethernet controller of the Ethernet card, wherein the Ethernet controller and the Ethernet physical layer are set separately. The processing module is configured to perform initialization of the Ethernet card based on the Ethernet controller connected to the Ethernet physical layer and the Ethernet physical layer connected thereto when at least one Ethernet controller connected to the Ethernet physical layer is present. The processing module is also used to stop the initialization of the Ethernet card when there is no Ethernet controller connected to the Ethernet physical layer; The detection module includes: a sending unit, configured to control each Ethernet controller of the Ethernet card to send query commands to its corresponding Ethernet physical layer addresses, wherein the Ethernet physical layer addresses are the addresses of the interfaces used by the Ethernet controller to connect to the Ethernet physical layer; and a determining unit, configured to determine that the Ethernet controller is an Ethernet controller connected to the Ethernet physical layer when the Ethernet controller receives a return value from any Ethernet physical layer address that is not a preset value, wherein the preset value is used to indicate that the Ethernet physical layer identifier was not read from the interface.

7. An electronic device, characterized in that, include: Memory and processor; The memory is used to store instructions that can be executed by the processor; The processor is used to call program instructions in the memory to execute the Ethernet card initialization process method as described in any one of claims 1-5.

8. A readable storage medium, characterized in that, The readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the Ethernet card initialization process method as described in any one of claims 1-5.

Citation Information

Patent Citations

  • Physical layer and data link interface with ethernet pre-negotiation

    US6795881B1