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

By accessing the configuration management interface only in the first channel in a multi-channel GMAC, using the first Ethernet controller to obtain the Ethernet physical layer state and save the device pointer, the problem of not being able to initialize the unconventional PHY chip is solved, the initialization of the second Ethernet controller is realized, and the selection range of chip types is expanded.

CN119484276BActive Publication Date: 2025-04-15LOONGSON TECH CORP
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510025580.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-08
Publication Date
2025-04-15
Estimated Expiration
2045-01-08

AI Technical Summary

Technical Problem

The prior art cannot adapt to some unconventional PHY chips whose connection methods are different from conventional chips, resulting in the inability to initialize these chips.

Method used

In the case where the first access configuration management interface is only in the multi-channel GMAC, the first Ethernet controller acquires the Ethernet physical layer state and saves the device pointer through the global variable, initializes the Ethernet physical layer connected to the second Ethernet controller.

Benefits of technology

In the case where the second Ethernet controller and the Ethernet physical layer are not connected through the configuration management interface, initialization of the second Ethernet controller can also be completed, expanding the selection range of chip types.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119484276B_ABST
    Figure CN119484276B_ABST
Patent Text Reader

Abstract

The embodiment of the present application provides an Ethernet card initialization processing method, device, equipment and storage medium. The Ethernet card includes a first Ethernet controller, a second Ethernet controller and an Ethernet physical layer. The first Ethernet controller accesses the configuration management interface; responds to the device member pointed to by the current device pointer; when the device member is the first Ethernet controller, a global variable is used to save the device pointer; the first Ethernet controller is controlled to poll each corresponding Ethernet physical layer address in turn, and perform initialization of the Ethernet physical layer connected to the first Ethernet controller; when the device member is the second Ethernet controller, the first Ethernet controller pointed to by the global variable is called to continue polling each corresponding Ethernet physical layer address, and perform initialization of the Ethernet physical layer connected to the second Ethernet controller. In this method, the multi-channel GMAC can complete the initialization of the multi-channel GMAC and PHY chip only when the first channel accesses the configuration management interface.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of Ethernet cards, and in particular to an Ethernet card initialization processing method, device, equipment and storage medium. Background Art

[0002] From the perspective of architecture, Ethernet cards include Ethernet controllers and Ethernet physical layers. The Ethernet controller is a general term for the data link layer chips in Ethernet cards, and the Ethernet physical layer is a general term for the physical layer chips in Ethernet cards (or simply referred to as PHY chips). During the initialization process of the Ethernet card, it is necessary to read the status of the PHY chip through the GMAC interface, and then configure the PHY to complete the initialization process.

[0003] With the development of science and technology, some unconventional chips have emerged, and their connection methods are different from those of conventional chips. The current related systems do not have drivers adapted to such chips, resulting in the inability to complete the initialization of such chip applications. Summary of the invention

[0004] The embodiments of the present application provide an Ethernet card initialization processing method, apparatus, device and storage medium, which are used to achieve the effect of completing the initialization of multiple GMACs and PHY chips of the board card only when the first access configuration management interface is connected.

[0005] In a first aspect, an embodiment of the present application provides an Ethernet card initialization processing method, wherein the Ethernet card includes a first Ethernet controller, a second Ethernet controller and an Ethernet physical layer, wherein the first Ethernet controller is connected to the Ethernet physical layer through a configuration management interface, and the method includes:

[0006] Respond to the device member pointed to by the current device pointer;

[0007] When the device member is the first Ethernet controller, using a global variable to save the device pointer;

[0008] Controlling the first Ethernet controller to sequentially poll each corresponding Ethernet physical layer address, so as to perform initialization of the Ethernet physical layer connected to the first Ethernet controller through the acquired Ethernet physical layer status;

[0009] When the device member is a second Ethernet controller, the first Ethernet controller pointed to by the global variable is called to continue polling its corresponding Ethernet physical layer addresses, so as to perform initialization of the Ethernet physical layer connected to the second Ethernet controller through the acquired Ethernet physical layer status.

[0010] In a possible implementation, the method further includes:

[0011] After completing the initialization of the Ethernet physical layer connected to the first Ethernet controller, recording the current polling number;

[0012] When the device member is a second Ethernet controller, calling the first Ethernet controller pointed to by the global variable to continue polling each corresponding Ethernet physical layer address, so as to perform initialization of the Ethernet physical layer connected to the second Ethernet controller through the acquired Ethernet physical layer state, including:

[0013] When the device member is the second Ethernet controller, calling the first Ethernet controller pointed to by the global variable, starting from the next Ethernet physical layer address of the current polling number, continuing to send query instructions to each Ethernet physical layer address in sequence;

[0014] When the return value of the Ethernet physical layer address received by the first Ethernet controller is not a preset value, it is determined that the Ethernet physical layer connected to the Ethernet physical layer address is a second target device corresponding to the second Ethernet controller, and the second target device is initialized.

[0015] In a possible implementation manner, controlling the first Ethernet controller to sequentially poll each corresponding Ethernet physical layer address to perform initialization of the Ethernet physical layer connected to the first Ethernet controller through the acquired Ethernet physical layer state includes:

[0016] Controlling the first Ethernet controller to send query instructions to each corresponding Ethernet physical layer address in sequence;

[0017] When the return value of the Ethernet physical layer address received by the first Ethernet controller is not a preset value, it is determined that the Ethernet physical layer connected to the Ethernet physical layer address is a first target device corresponding to the first Ethernet controller, and the first target device is initialized.

[0018] In a possible implementation manner, the initializing the second target device includes:

[0019] According to the second Ethernet controller and the Ethernet physical layer connected thereto, and the device driver matching the second Ethernet controller, a device instance of the Ethernet card is formed;

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

[0021] In a possible implementation manner, the initializing the first target device includes:

[0022] According to the first Ethernet controller and the Ethernet physical layer connected thereto, and the device driver matching the first Ethernet controller, a device instance of the Ethernet card is formed;

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

[0024] In a possible implementation, the method further includes:

[0025] Calling a network interface information acquisition function in a preset PHY chip, and reconstructing the network interface information acquisition function in a board support package of the Ethernet card;

[0026] In response to the synchronous network link status function, the network interface information obtained by the network interface information obtaining function is called to update the link information of the network interface.

[0027] In a second aspect, an embodiment of the present application provides an Ethernet card initialization processing device, comprising:

[0028] The response module is used to determine the device member pointed to according to the device pointer currently scanned;

[0029] A processing module, used for determining that the device member is a first Ethernet controller, and using a global variable to save the device pointer;

[0030] The control module is used to control the first Ethernet controller to poll the corresponding Ethernet physical layer addresses in sequence, so as to obtain the Ethernet physical layer status and perform initialization of the Ethernet physical layer connected to the first Ethernet controller.

[0031] The processing module is further configured to determine that the device member is a second Ethernet controller, and call the first Ethernet controller pointed to by the global variable;

[0032] The control module is further used to control the first Ethernet controller to continue polling its corresponding Ethernet physical layer addresses, so as to obtain the Ethernet physical layer status and perform initialization of the Ethernet physical layer connected to the second Ethernet controller.

[0033] In a third aspect, an embodiment of the present application provides an electronic device, including: a memory, a processor;

[0034] The memory stores computer-executable instructions;

[0035] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the above first aspect and / or various possible implementations of the first aspect.

[0036] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the first aspect above and / or various possible implementations of the first aspect.

[0037] In a fifth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the above first aspect and / or various possible implementation methods of the first aspect.

[0038] The embodiment of the present application provides an Ethernet card initialization processing method, device, equipment and storage medium. In an application where a multi-channel Ethernet controller is only connected to the Ethernet physical layer through a configuration management interface on the first channel, the first Ethernet controller is called to obtain the Ethernet physical layer status to complete the initialization of the multi-channel Ethernet controller. When the first Ethernet controller is initialized, the device pointer of the first Ethernet controller is saved as a global variable, and when the second Ethernet controller is initialized, the global variable is used as a pointer for the second Ethernet controller to obtain the Ethernet physical layer address. When the initialization process is executed, the device pointer of the first Ethernet controller can be called through the global variable, and then the first Ethernet controller can be called to obtain the Ethernet physical layer status. When the second Ethernet controller obtains the Ethernet physical layer status, the initialization of the Ethernet physical layer connected to the second Ethernet controller can be completed. Therefore, even if the second Ethernet controller is not connected to the Ethernet physical layer through a configuration management interface, the initialization of the second Ethernet controller can be achieved. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0040] Figure 1 A schematic diagram of a scenario of an Ethernet card initialization processing method provided in this application;

[0041] Figure 2 A schematic diagram of the process of initializing an Ethernet card provided in this application Figure 1 ;

[0042] Figure 3 A schematic diagram of the process of initializing an Ethernet card provided in this application Figure 2 ;

[0043] Figure 4 A schematic diagram of the process of initializing an Ethernet card provided in this application Figure 3 ;

[0044] Figure 5 A schematic diagram of the structure of an Ethernet card initialization processing device provided by the present application;

[0045] Figure 6 A schematic diagram of the structure of the electronic device provided in this application.

[0046] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0047] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0048] From the perspective of architecture, Ethernet cards include Ethernet controllers and Ethernet physical layers. The Ethernet controller is a general term for the data link layer chips in Ethernet cards (or GMAC), and the Ethernet physical layer is a general term for the physical layer chips in Ethernet cards (or PHY chips).

[0049] With the development of technology, some PHY chips are different from conventional PHY chips. These PHY chips are used to control the multi-channel GMAC of the board, such as GMAC0, GMAC1, GMAC2, GMAC3...GMACn. In terms of hardware wiring, the configuration management interface of the PHY chip (such as Management Data Input / Output, MDIO is a configuration interface between the PHY chip and the Ethernet GMAC, allowing the software to read and write PHY registers) is connected to the board, while the configuration management interface of the PHY chip is not connected to other GMACs except GMAC0 (such as GMAC1, GMAC2, GMAC3...GMACn).

[0050] The GMAC initialization process includes reading the status of the PHY chip through the configuration management interface (such as GMAC_MDIO) to identify the PHY chip model, so as to load the appropriate PHY driver and complete the initialization of the Ethernet physical layer. GMAC1 and the PHY chip are not connected through the configuration management interface, and other GMACs (such as GMAC1, GMAC2, GMAC3...GMACn) except GMAC0 cannot be identified during the initialization process, resulting in initialization failure. Based on this, the embodiment of the present application is used to solve the above problem.

[0051] When GMAC1, GMAC2, GMAC3...GMACn are the same and are not connected to the configuration management interface of the PHY chip, GMAC1, GMAC2, GMAC3...GMACn can be initialized in the same way. For ease of understanding, GMAC1, GMAC2, GMAC3...GMACn are collectively referred to as the second Ethernet controller GMAC1 below, and the initialization method of the multi-channel second Ethernet controller GMAC1 is explained by taking a board including multiple GMACs, namely GMAC0 and multiple GMAC1 as an example.

[0052] Figure 1 A schematic diagram of a scenario of an Ethernet card initialization processing method provided in this application, such as Figure 1 As shown, the specific application scenario of the present application includes an Ethernet card, the Ethernet card includes a board and an Ethernet physical layer (or PHY chip for short), the board includes a first Ethernet controller (or GMAC0 for short) and a second Ethernet controller (or GMAC1 for short), and the Ethernet physical layer includes a PORT0 interface and a PORT1 interface. Among them, GMAC0 and PORT0 interfaces are connected through a configuration management interface. Exemplarily, when the configuration management interface is MIDO, the connection mode of GMAC0 and the PHY chip is: GMAC0-MIDO and PORT0-MDIO connection; GMAC1 communicates with the PORT0 interface, and is not connected through MIDO.

[0053] The Ethernet card is driven under a certain system. During the initialization process, it is necessary to complete the initialization of each GMAC. It is necessary to find the Ethernet physical layer through the MII bus and use the address of the PORT device of the Ethernet physical layer to complete the PORT initialization process. Because the multi-channel PHY chip under the Ethernet card can only read the status of PORT0 and PORT1 through GMAC0, and when the GMAC1 device enters the relevant initialization function (such as the miiBusDevInstInit2 function), it is unable to find the status of the second Ethernet physical layer through miiBus Read, resulting in the failure of the initialization of the second Ethernet physical layer.

[0054] The Ethernet card initialization processing method provided in the present application, when GMAC1 is initialized, calls the device pointer saved when GMAC0 is initialized to obtain the status of PORT1 of the second Ethernet physical layer (GMAC0 and GMAC1 share a set of Ethernet physical layer addresses), and then completes the initialization of the second Ethernet physical layer connected to GMAC1, so as to solve the technical problem that GMAC1 cannot be recognized and causes initialization failure.

[0055] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0056] Figure 2 Schematic diagram of the process of Ethernet card initialization processing method provided in this application Figure 1 ,like Figure 2 As shown, the method includes:

[0057] S201, responding to the device member pointed to by the current device pointer;

[0058] The Ethernet card includes a first Ethernet controller (GMAC0), a second Ethernet controller (GMAC1) and an Ethernet physical layer (PHY chip). In an optional embodiment, the Ethernet card may also include three or more Ethernet controllers, for example, one Ethernet controller and two or more second Ethernet controllers. The initialization method of two or more second Ethernet controllers is the same as the initialization method of one second Ethernet controller. Therefore, for ease of understanding, the embodiment of the present application is described with one second Ethernet controller.

[0059] In the embodiment of the present application, since the second Ethernet controller is not connected to the Ethernet physical layer through the configuration management interface, it is necessary to access the Ethernet physical layer through the address of the first Ethernet controller during the initialization configuration process to perform subsequent configuration. Therefore, there is a difference between the configuration process of the first Ethernet controller and the second Ethernet controller. In order to determine whether the first Ethernet controller or the second Ethernet controller is currently entering the initialization process, the first Ethernet controller and the second Ethernet controller are distinguished by defining a device member in the device pointer.

[0060] As an example, the device pointer defines device members including 0 and 1 (e.g., pDve->unitNumber=0; pDve->unitNumber=1), where member 0 corresponds to the first Ethernet controller; member 1 corresponds to the second Ethernet controller. When entering the relevant initialization function, responding to the device member pointed to by the device pointer, it can be determined whether the first Ethernet controller or the second Ethernet controller is currently entering the relevant initialization function for initialization, and then initialization is performed in a corresponding manner.

[0061] S202, when the device member is the first Ethernet controller, using a global variable to save the device pointer;

[0062] It should be noted that the device pointer stored in the global variable is a pointer structure of the first Ethernet controller. The device pointer points to the device address, and then the miiBusRead function can be called through the device address to read the Ethernet physical layer status through the Ethernet physical address.

[0063] Considering that when the second Ethernet controller is initialized, it is necessary to obtain PORT1 of the Ethernet physical layer through the first Ethernet controller, when it is determined that the device pointer points to the first Ethernet controller, the value of the device pointer is backed up through a global variable. When the second Ethernet controller is initialized, the device pointer is obtained through the global variable, and the Ethernet physical layer status can be read based on the device pointer.

[0064] S203, controlling the first Ethernet controller to sequentially poll each corresponding Ethernet physical layer address, so as to initialize the Ethernet physical layer connected to the first Ethernet controller through the acquired Ethernet physical layer status;

[0065] When the device pointer points to the first Ethernet controller, since the first Ethernet controller is connected to the Ethernet physical layer through the configuration management interface, the first Ethernet controller can directly obtain the status of PORT0 through the configuration management interface. Optionally, the first Ethernet controller obtains the Ethernet physical layer status by polling each Ethernet physical layer address.

[0066] When the Ethernet physical layer state meets the set conditions, the Ethernet physical layer corresponding to the Ethernet physical layer state is connected to the first Ethernet controller. At this time, the device information of the Ethernet physical layer can be obtained based on the configuration management interface, and the first Ethernet controller creates an Ethernet physical layer device and initializes the Ethernet physical layer.

[0067] S204, when the device member is the second Ethernet controller, the first Ethernet controller pointed to by the global variable is called to continue polling its corresponding Ethernet physical layer addresses, so as to perform initialization of the Ethernet physical layer connected to the second Ethernet controller through the acquired Ethernet physical layer status.

[0068] When the device pointer points to the second Ethernet controller, that is, the second Ethernet controller enters initialization, the second Ethernet physical layer needs to be initialized. Since the second Ethernet controller is not connected to the Ethernet physical layer through the configuration management interface, the second Ethernet controller cannot obtain the status of PORT1 through the configuration management interface. The device pointer of the first Ethernet controller is called through the global variable, and the remaining Ethernet physical layer addresses are continued to be polled through the first Ethernet controller to find the Ethernet physical layer connected to the second Ethernet controller, and then the Ethernet physical layer is initialized. If there are multiple second Ethernet controllers, the first Ethernet controller continues to poll the remaining Ethernet physical layer addresses based on the Ethernet physical layer address polled last time, so as to initialize multiple second Ethernet controllers.

[0069] In an optional embodiment, the above configuration management interface includes but is not limited to one of MIDO, I2C, GPIO analog MDIO and MDIO-GPIO.

[0070] MIDO, I2C, GPIO simulated MDIO, and MDIO-GPIO interfaces are mainly used to configure and manage network devices, especially Ethernet PHY chips. They allow the host or controller to access and modify the registers of the PHY chip, thereby controlling the behavior and status of the PHY. They all work on the principle of serial communication, transmitting data between devices through one or more data lines. This serial communication method helps to reduce the number of physical connections required and simplify circuit design. Although these interfaces work in different scenarios and conditions, they are all designed to provide flexibility and compatibility. For example, I2C is a general serial bus, while GPIO simulated MDIO provides an alternative when there is no dedicated MDIO hardware. In general, these interfaces provide a mechanism that enables network devices (such as Ethernet controllers) to communicate and interact with physical layer devices (such as PHY chips) to achieve network configuration, status monitoring, and performance optimization. Therefore, in an Ethernet card, one of the above interfaces can be used to implement communication between the Ethernet controller and the Ethernet physical layer (PHY chip).

[0071] The Ethernet card initialization processing method provided in the embodiment of the present application, since the second Ethernet controller cannot obtain the state of the connected Ethernet physical layer through the configuration management interface, obtains the state of the Ethernet physical layer by calling the first Ethernet controller, and when the first Ethernet controller is initialized, the device pointer of the first Ethernet controller is saved as a global variable, and when the second Ethernet controller is initialized, the global variable is obtained, and the device pointer of the first Ethernet controller is called through the global variable, thereby realizing calling the first Ethernet controller to obtain the state of the Ethernet physical layer. When the second Ethernet controller obtains the state of the Ethernet physical layer, the initialization of the Ethernet physical layer connected to the second Ethernet controller can be completed. Therefore, when the second Ethernet controller is not connected to the Ethernet physical layer through the configuration management interface, the initialization of the second Ethernet controller can also be realized.

[0072] Figure 3 Schematic diagram of the process of Ethernet card initialization processing method provided in this application Figure 2 ,like Figure 3 As shown, in this embodiment Figure 2 Based on the embodiment, the initialization processing method is described in detail, and the method includes:

[0073] S301, responding to the device member pointed to by the current device pointer;

[0074] S302, when the device member is the first Ethernet controller, using a global variable to save the device pointer;

[0075] In this embodiment, steps S301 and S302 are the same as those described above. Figure 2 S201 and S202 in the embodiment are the same. The detailed description of S301 and S302 in this embodiment can refer to the relevant description of S201 and S202 in the above embodiment.

[0076] S303, controlling the first Ethernet controller to send query instructions to each corresponding Ethernet physical layer address in sequence;

[0077] During the initialization of the network interface, the PHY chip status needs to be queried. Optionally, the PHY chip status query includes sending a specific read command (ie, a query instruction) to the PHY register, and determining the PHY chip status by parsing the returned data.

[0078] A polling query instruction is added to the member function of the Ethernet controller driver so that the interface corresponding to the Ethernet physical layer address can be queried. For the first Ethernet controller, the first Ethernet controller can be controlled to send a query instruction to its corresponding Ethernet physical layer address, and the query instruction can be used to query the return value of the interface corresponding to the Ethernet physical layer address. The Ethernet physical layer address can be the address of each interface used by the first Ethernet controller to connect to the Ethernet physical layer, and the interface is used for the communication connection between the first Ethernet controller and the Ethernet physical layer.

[0079] In one example, the first Ethernet controller is provided with 32 interfaces for communicating with the Ethernet physical layer, and each interface is assigned a corresponding Ethernet physical layer address. For example, 0 to 31 can be set as the Ethernet physical layer address corresponding to a certain Ethernet controller. When the interface corresponding to the Ethernet physical layer address is connected to the Ethernet physical layer, the interface can query the identification data of the Ethernet physical layer (stored in the register of the Ethernet physical layer). That is, the corresponding interface can be read through the Ethernet physical layer address of 0-31 to determine the address connected to the Ethernet physical layer.

[0080] In one example, the first Ethernet controller sequentially polls each Ethernet physical layer address in the order in which the Ethernet physical addresses are arranged. For example, if 0 to 31 are Ethernet physical layer addresses corresponding to the first Ethernet controller, the first Ethernet controller starts polling from the Ethernet physical layer address of address 0 (sending query instructions to each corresponding Ethernet physical layer address in turn) until the Ethernet physical address of address 31 is polled.

[0081] S304: When the return value of the Ethernet physical layer address received by the first Ethernet controller is not a preset value, determine that the Ethernet physical layer connected to the Ethernet physical layer address is a first target device corresponding to the first Ethernet controller, and initialize the first target device.

[0082] In this embodiment, the Ethernet physical layer state is determined by the return value of the Ethernet physical layer address. For example, when the return value of the Ethernet physical layer address is a preset value, it is determined that the Ethernet physical layer is in a disconnected state.

[0083] The preset value may be "0xffff" or "0" or other values, which are not limited in this embodiment. The preset value is used to indicate that no Ethernet physical layer identifier is read from the interface, which means that the current interface is not connected to an Ethernet physical layer.

[0084] Each time the first Ethernet controller sends a query instruction to an Ethernet physical layer address, the Ethernet physical layer address responds to the query instruction and returns a value to the first Ethernet controller, and the return value may be a preset value or an Ethernet physical layer identifier. When the return value is a preset value, the first Ethernet controller sends a query instruction to the next Ethernet physical layer address and continues to query. When the return value is not a preset value, it may be the connected Ethernet physical layer identifier, indicating that the current interface is connected to an Ethernet physical layer, and the Ethernet physical layer is the first target device initialized by the first Ethernet controller this time.

[0085] The Ethernet physical layer identifier is pre-stored in a register on the Ethernet physical layer and returned by the Ethernet physical layer through the Ethernet physical layer address corresponding thereto, and the Ethernet physical identifier represents the Ethernet physical layer state. In addition, the Ethernet physical layer identifiers pre-stored in different Ethernet physical layers may be different, which is not limited in this embodiment.

[0086] For example, if the return value of the Ethernet physical layer address with address 0 received by the first Ethernet controller is not a preset value, it indicates that the interface corresponding to the Ethernet physical layer address with address 0 is connected to the Ethernet physical layer, and the Ethernet physical layer is initialized.

[0087] As an example, initializing the first target device includes:

[0088] According to the first Ethernet controller and the Ethernet physical layer connected thereto, and the device driver matching the first Ethernet controller, a device instance of the Ethernet card is formed;

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

[0090] As an example, the process of forming a device instance of an Ethernet card includes: after determining a first target device, creating a PHY device in an operating system, that is, registering the first target device in the system. After registering the PHY device, the operating system queries a driver that matches the PHY device, that is, a device driver that matches the first Ethernet controller. Optionally, the operating system loads a specific driver according to the model of the PHY device. Optionally, if a specific driver cannot be loaded, a general PHY driver is used.

[0091] After finding a matching driver, the initialization function of the driver can be called to initialize the PHY device.

[0092] Optionally, the process of initializing the created device instance includes: configuring parameters of the PHY device, including but not limited to setting the working mode of the PHY device, such as speed, duplex mode, auto-negotiation capability, etc. Starting the auto-negotiation process to determine specific parameters of the network connection.

[0093] Establish network communication, monitor the network connection status (link status) of the PHY chip by polling or interruption, and confirm whether the physical link has been established.

[0094] When the physical connection is established, the link state change must be processed until the link state of the PH chip Y is stable and the network link has been established, then the PHY chip initialization process is completed.

[0095] It should be noted that when the Link state of the PHY chip changes (for example, from no link to link), the operating system will call the corresponding callback function to update the state of the network interface.

[0096] In the embodiment of the present application, after completing the initialization of multiple GMAC0 and GMAC1 and PHY, when the link state of PHY changes, it is necessary to timely update the information of the network interface (such as configuration information), such as connection rate, full-duplex and semi-tethered mode, etc. Among them, the network interface information is synchronously updated through the synchronous network connection state function (which can be the synlinkupdate function), and when the synchronous network connection state function performs the link state update operation, it is necessary to call the network interface information acquisition function of the PHY chip (which can be the miiBusModeGet function) to obtain the network interface information, and then update the acquired information to update the link state.

[0097] In the embodiment of the present application, since the PHY chip connected to the GMAC is different from the conventional PHY chip, in the application of the Ethernet card, the PHY chip does not have a network interface information acquisition function, and the link status cannot be updated. Based on this, the network interface information acquisition function in other PHY chips is called to complete the acquisition of the network interface information.

[0098] As an example, the method further includes:

[0099] Calling a network interface information acquisition function in a preset Ethernet physical layer, and reconstructing the network interface information acquisition function in a board support package of the Ethernet card;

[0100] The preset Ethernet physical layer is a chip for conventional applications, that is, the preset Ethernet physical layer and the Ethernet physical layer included in the Ethernet card in this embodiment are different devices. In this embodiment, by moving the logic of the network interface information acquisition function in the preset conventional application chip to the BSP of the Ethernet card, the network interface information acquisition function is reconstructed in the BSP to adapt to the Ethernet physical layer of the embodiment of the present application, thereby facilitating the calling of the synchronous network link status function.

[0101] Optionally, the network interface information acquisition function may be reconstructed after the first target device and the second target device are initialized, or may be reconstructed before the first target device and the second target device are initialized, which is not limited here.

[0102] In response to the synchronous network link status function, the network interface information acquisition function is called to obtain the network interface information, and the link information of the network interface is updated.

[0103] By reconstructing and placing the network interface information acquisition function in the BSP, after the first target device and the second target device are initialized, if the synchronous network link status function performs a link status update operation, the network interface information is obtained through the network interface information acquisition function to complete the configuration and update of the connection rate, full-duplex and half-duplex information when link up and link down.

[0104] After the Ethernet physical layer connected to the first Ethernet controller is initialized, S305 is executed to record the current polling number;

[0105] The current polling number refers to the polling number corresponding to the Ethernet physical address polled after the first Ethernet controller completes initialization (finds the first target device). For example, when the first Ethernet controller sends a query instruction to the Ethernet physical layer address with address 0, and the return value of the address is not a preset value, the Ethernet physical layer corresponding to the address is initialized, and the current polling number of the first Ethernet controller is 1. If the first Ethernet controller sends a query instruction to the Ethernet physical layer address with address 0, and the return value of the address is a preset value, the first Ethernet controller continues to poll the next Ethernet physical layer address, that is, sends a query instruction to the Ethernet physical layer address with address 1, and when the return value of the address is not a preset value, the Ethernet physical layer corresponding to the address is initialized, and the current polling number of the first Ethernet controller is 2. By analogy, the current polling number of the first Ethernet controller actually represents the number of Ethernet physical layer addresses currently polled. If one Ethernet physical layer address is currently polled, the current polling number is 1, and if two Ethernet physical layer addresses are currently polled, the current polling number is 2.

[0106] S306, when the device member is the second Ethernet controller, calling the first Ethernet controller pointed to by the global variable, starting from the next Ethernet physical layer address of the current polling number, and continuing to send query instructions to each Ethernet physical layer address in sequence;

[0107] When the second Ethernet controller enters initialization, since the second Ethernet controller cannot obtain the Ethernet physical layer status through MIDO, a global variable is used as a device pointer of the second Ethernet controller, and the device pointer is called to obtain the Ethernet physical layer status.

[0108] The global variable stores the device pointer of the first Ethernet controller. Therefore, when the global variable is called, the first Ethernet controller is called to query the Ethernet physical layer status.

[0109] When the second Ethernet controller enters initialization, since the Ethernet physical layer status is obtained through the first Ethernet controller, if the first Ethernet controller starts polling from the Ethernet physical layer address with address 0, then the Ethernet physical layer address corresponding to the first target device queried when the first Ethernet controller is initialized will also return a non-preset value to the first Ethernet controller when the second Ethernet controller is initialized. In this case, the query result is not the Ethernet physical layer to which the second Ethernet controller is actually connected, resulting in the failure of the initialization of the second Ethernet controller. Based on this, the embodiment of the present application controls the first Ethernet controller to start from the next Ethernet physical layer address of the current polling number, and continue to send query instructions to each Ethernet physical layer address in turn. That is, the Ethernet physical layer is searched from the Ethernet physical address that has never been polled.

[0110] For example, if the current polling count is 1, it means that the interface corresponding to the Ethernet physical layer address with address 0 is connected to PHY, and this PHY is the first target device. In this way, when the second Ethernet controller enters initialization, it calls the first Ethernet controller to start polling from the Ethernet physical address with address 1, which can avoid querying the Ethernet physical layer address with address 0, thereby avoiding repeated querying of the PHY connected to the interface corresponding to the address. If the current polling count is 2, it means that the interface corresponding to the Ethernet physical layer address with address 1 is connected to PHY, and this PHY is the first target device. In this way, when the second Ethernet controller enters initialization, it calls the first Ethernet controller to start polling from the Ethernet physical address with address 2.

[0111] It should be noted that in this step, the first Ethernet controller starts polling from the next Ethernet physical layer address of the current polling number, and polls the remaining Ethernet physical addresses that have not been polled. The polling method is the same as that of the above S303.

[0112] S307: When the return value of the Ethernet physical layer address received by the first Ethernet controller is not a preset value, it is determined that the Ethernet physical layer connected to the Ethernet physical layer address is a second target device corresponding to the second Ethernet controller, and the second target device is initialized.

[0113] In this step, the Ethernet physical layer state is also determined by the return value of the Ethernet physical layer address.

[0114] In this step, the manner of determining the second target device and initializing the second target device is the same as that of S304 above. For the specific implementation manner, reference may be made to the detailed description of S304 above, which will not be repeated here.

[0115] In this step, the second target device is initialized, including:

[0116] According to the second Ethernet controller and the Ethernet physical layer connected thereto, and the device driver matching the second Ethernet controller, a device instance of the Ethernet card is formed;

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

[0118] The process of forming a device instance and initializing the Ethernet card is the same as the process of forming and initializing the device instance of the first target device. Please refer to the description of the initialization process of the first target device, which will not be repeated here.

[0119] In an optional implementation, if the board includes multiple second Ethernet controllers, after completing the Ethernet physical layer initialization for one second Ethernet controller, the current polling number is recorded, so that when the next second Ethernet controller is initialized, the Ethernet physical layer address is queried through the first Ethernet controller, starting from the next Ethernet physical layer address of the current polling number, to initialize the next second Ethernet controller. Repeat the above process to complete the initialization of multiple second Ethernet controllers in sequence.

[0120] The Ethernet card initialization processing method provided by the embodiment of the present application, MII_STAT_REG includes multiple bit fields for indicating the working status of the PHY chip, and the status of the PHY chip is obtained through MII_STAT_REG, and when the second Ethernet controller enters initialization, a global variable is used as a query parameter of the miiBusRead function to call the value corresponding to the global variable to query the PHY status, wherein the global variable is the device pointer corresponding to the initialization of the first Ethernet controller, and the first Ethernet controller is connected to the Ethernet physical layer through the configuration management interface, and the Ethernet physical layer address can be accurately obtained to initialize the second Ethernet controller. It is realized that the initialization of multiple GMACs is completed when the first GMAC is connected to the PHY chip through the configuration management interface. In chip applications, the selection range of chip types is increased.

[0121] Figure 4 Schematic diagram of the process of Ethernet card initialization processing method provided in this application Figure 3 ,like Figure 3 As shown, this embodiment, based on various embodiments, takes a certain language environment as an example, based on the drivers of certain systems, to describe in detail the process of initialization processing:

[0122] S401, determining that the first Ethernet controller is currently being initialized through the device member pointed to by the device pointer, and using a global variable to save the device pointer obtained by the first Ethernet controller;

[0123] In this embodiment, the device pointer defined in the relevant initialization function includes device members, and each device member points to a different device, such as pointing to the first Ethernet controller or the second Ethernet controller.

[0124] Execute the relevant initialization function, determine that the device member pointed to by the device pointer is the first Ethernet controller, then determine that the first Ethernet controller enters the initialization process, and initialize the Ethernet physical layer connected to the first Ethernet controller.

[0125] Before starting to execute the for loop to query the Ethernet physical layer address corresponding to the first Ethernet controller connected to the Ethernet physical layer, a global variable is first used to save the device pointer of the first Ethernet controller for calling when the second Ethernet controller is initialized.

[0126] For example, members are defined for GMAC0 and GMAC1, GMA0 is defined as pDve->unitNumber = 0; GMA1 is defined as pDve->unitNumber = 1. If the current scan reaches GMAC0 and enters initialization, pDve-temp0 (global variable) is used to back up pDev (device pointer) of GMA0.

[0127] S402, update the return value to zero;

[0128] The return value is updated to zero, ensuring that the return value received by the first Ethernet controller is the current query value.

[0129] S403, controlling the first Ethernet controller to send a query instruction to its corresponding Nth Ethernet physical layer address;

[0130] Wherein, N is 1, 2, 3, ... 32, corresponding to the Ethernet physical layer addresses 0 to 31. For example, the first Ethernet physical layer address corresponds to 0, the second Ethernet physical layer address corresponds to 1, and so on, the 32nd Ethernet physical layer address corresponds to 31.

[0131] During the initialization of the network interface, the PHY state needs to be queried. Optionally, the PHY state query includes sending a specific read command (ie, a query instruction) to the PHY register and determining the PHY state by parsing the returned data.

[0132] Optionally, querying the PHY status involves read and write operations using MII or similar interfaces. For example, the miiBusRead function is used to read the status register of the PHY, such as the status register (MII_BMSR), the control register (MII_BMCR), etc. In this embodiment, the query instruction is an instruction for querying the PHY status, which is obtained by reading the status register of the PHY through the miiBusRead function.

[0133] Since the first Ethernet controller does not know the interface corresponding to the Ethernet physical layer address connected to the PHY, it is necessary to determine the target interface by polling 32 Ethernet physical addresses, and then initialize the PHY connected to the interface.

[0134] S404, determining whether the return value of the Ethernet physical layer address received by the first Ethernet controller is a preset value;

[0135] When the return value of the Ethernet physical layer address received by the first Ethernet controller is a preset value, execute S405, update N to N+1, and return to execute steps S402, S403 and S404;

[0136] If the return value is the preset value, it means that the Ethernet physical layer address is not connected to the PHY, and the next Ethernet physical layer is polled. Before executing the for loop, the polling times of the for loop are increased, that is, N is increased by 1, and the first Ethernet controller polls the next Ethernet physical layer address. Polling is continued until the return value is not the preset value.

[0137] When the return value of the Ethernet physical layer address received by the first Ethernet controller is not a preset value, S406 is executed to determine that the Ethernet physical layer connected to the Nth Ethernet physical layer address is the first target device corresponding to the first Ethernet controller, and the first target device is initialized.

[0138] If the returned value is not a preset value, it means that the Ethernet physical layer address is connected to PHY, and the PHY connected to the interface corresponding to the Ethernet physical layer address is the target device, and the target device is initialized.

[0139] S407, record the polling number N;

[0140] When the return value of the polled Nth Ethernet physical layer address is not a preset value, N is recorded as the polling number, that is, the Ethernet physical layer address currently polled is the Nth address.

[0141] S408, determining that the second Ethernet controller is currently being initialized through the device member pointed to by the device pointer;

[0142] Execute the relevant initialization function, determine that the device member pointed to by the device pointer is the second Ethernet controller, then determine that the second Ethernet controller enters the initialization process, and initialize the Ethernet physical layer connected to the second Ethernet controller.

[0143] The second Ethernet controller needs to obtain the Ethernet physical layer status through the first Ethernet controller, and after determining that the second Ethernet controller is initialized, enters a for loop and calls the first Ethernet controller in the for loop.

[0144] S409, update the return value to zero;

[0145] The return value is updated to zero, ensuring that the return value received by the first Ethernet controller is the current query value.

[0146] S410, calling the first Ethernet controller pointed to by the global variable, and sending a query instruction to the N+1th Ethernet physical layer address;

[0147] The global variable includes the device pointer of the first Ethernet controller. In this step, the device pointer of the first Ethernet controller is obtained through the global variable, and then the Ethernet physical layer address is queried through the device pointer. The first Ethernet controller starts polling from the N+1th Ethernet physical layer address, that is, starts querying from the next Ethernet physical layer address of the current polling number.

[0148] S411, determining whether the return value of the Ethernet physical layer address received by the first Ethernet controller is a preset value;

[0149] When the return value of the Ethernet physical layer address received by the first Ethernet controller is a preset value, S412 is executed, N+1 is updated to N+2, and the process returns to execute steps S409, S410 and S411.

[0150] When the return value of the Ethernet physical layer address received by the first Ethernet controller is not a preset value, S413 is executed to determine that the Ethernet physical layer connected to the N+1th Ethernet physical layer address is the second target device corresponding to the second Ethernet controller, and the second target device is initialized.

[0151] S410 to S413 are the search process and initialization process of the second target device corresponding to the second Ethernet controller, which is the same as the search process and initialization process of the first target device corresponding to the first Ethernet controller. For details, please refer to the above description.

[0152] The difference is that when the second Ethernet controller enters initialization, the for loop N+1 starts, that is, the polling of the Ethernet physical layer address corresponding to the first target device is skipped (the Nth Ethernet physical layer address will no longer be polled), and the Ethernet physical layer found is the PHY corresponding to the second Ethernet controller.

[0153] Exemplarily, if the card board includes multiple second Ethernet controllers GMAC1, after executing step S413, the polling number N=N+1 is recorded, and then the above steps S408 to S413 are repeatedly executed to complete the initialization of the multiple second Ethernet controllers GMAC1.

[0154] The Ethernet card initialization processing method provided in the embodiment of the present application realizes that the initialization of multiple GMACs is completed only when the first access configuration management interface is connected to the multiple GMACs.

[0155] Figure 5 The schematic diagram of the structure of the Ethernet card initialization processing device provided by the present application is as follows: Figure 5 As shown, the Ethernet card initialization processing device 50 provided in this embodiment includes:

[0156] A response module 501 is used to determine the device member pointed to according to the device pointer currently scanned;

[0157] Processing module 502, used to determine that the device member is a first Ethernet controller, and use a global variable to save a device pointer;

[0158] The control module 503 is used to control the first Ethernet controller to poll the corresponding Ethernet physical layer addresses in sequence, so as to obtain the Ethernet physical layer status and perform initialization of the Ethernet physical layer connected to the first Ethernet controller.

[0159] The processing module 502 is further used to determine that the device member is the second Ethernet controller, and call the first Ethernet controller pointed to by the global variable;

[0160] The control module 503 is further used to control the first Ethernet controller to continue polling its corresponding Ethernet physical layer addresses, so as to obtain the Ethernet physical layer status and perform initialization of the Ethernet physical layer connected to the second Ethernet controller.

[0161] The Ethernet card initialization processing device provided in this embodiment can execute the method provided in the above method embodiment. Its implementation principle and technical effect are similar, and this embodiment will not be described in detail here.

[0162] Figure 6 This is a schematic diagram of the structure of the electronic device provided in this application. Figure 6 As shown, the electronic device 60 provided in this embodiment includes: at least one processor 601 and a memory 602. Optionally, the device 60 also includes a communication component 603. The processor 601, the memory 602 and the communication component 603 are connected via a bus 604.

[0163] In a specific implementation process, at least one processor 601 executes the computer execution instructions stored in the memory 602, so that at least one processor 601 executes the above method.

[0164] The specific implementation process of the processor 601 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.

[0165] In the above embodiments, it should be understood that the processor can be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the invention can be directly implemented as a hardware processor, or can be implemented by a combination of hardware and software modules in the processor.

[0166] The memory may include a high-speed memory (Random Access Memory, RAM), and may also include a non-volatile memory (NVM), such as at least one disk storage.

[0167] 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, the bus in the drawings of this application is not limited to only one bus or one type of bus.

[0168] The present application also provides a computer program product, including a computer program, which implements the above method when executed by a processor.

[0169] The present application also provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the above method is implemented.

[0170] The above-mentioned readable storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.

[0171] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.

[0172] The division of units is only a logical function division, and there may be other divisions in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be an indirect coupling or communication connection through some interface, device or unit, which can be electrical, mechanical or other forms.

[0173] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0174] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0175] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0176] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0177] Finally, it should be noted that those skilled in the art will readily conceive of other embodiments of the present invention after considering the specification and practicing the invention disclosed herein. The present invention is intended to cover any variations, uses or adaptations of the present invention, which follow the general principles of the present invention and include common knowledge or customary technical means in the art not disclosed by the present invention, are not limited to the precise structure described above and shown in the drawings, and may be modified and changed in various ways without departing from the scope thereof. The scope of the present invention is limited only by the appended claims.

Claims

1. An Ethernet card initialization processing method, characterized in that: The Ethernet card includes a first Ethernet controller, a second Ethernet controller and an Ethernet physical layer, the first Ethernet controller is connected to the Ethernet physical layer through a configuration management interface, and the second Ethernet controller is not connected to the Ethernet physical layer through the configuration management interface, and the method includes: Determine the device member pointed to according to the currently scanned device pointer; when the device member is the first Ethernet controller, use a global variable to save the device pointer; Controlling the first Ethernet controller to sequentially poll each corresponding Ethernet physical layer address, so as to initialize the Ethernet physical layer connected to the first Ethernet controller through the acquired Ethernet physical layer status; When the device member is a second Ethernet controller, the first Ethernet controller pointed to by the global variable is called to continue polling its corresponding Ethernet physical layer addresses, so as to perform initialization of the Ethernet physical layer connected to the second Ethernet controller through the acquired Ethernet physical layer status.

2. The method according to claim 1, characterized in that: The method further comprises: After completing the initialization of the Ethernet physical layer connected to the first Ethernet controller, recording the current polling number; When the device member is a second Ethernet controller, calling the first Ethernet controller pointed to by the global variable to continue polling each corresponding Ethernet physical layer address, so as to perform initialization of the Ethernet physical layer connected to the second Ethernet controller through the acquired Ethernet physical layer state, including: When the device member is a second Ethernet controller, the first Ethernet controller pointed to by the global variable is called, and query instructions are continuously sent to each Ethernet physical layer address in sequence starting from the next Ethernet physical layer address corresponding to the current polling number; when the return value of the Ethernet physical layer address received by the first Ethernet controller is not a preset value, the Ethernet physical layer connected to the Ethernet physical layer address is determined to be a second target device corresponding to the second Ethernet controller, and the second target device is initialized; The preset value is used to indicate that the current interface is not connected to an Ethernet physical layer.

3. The method according to claim 1, characterized in that The controlling the first Ethernet controller to sequentially poll each corresponding Ethernet physical layer address to perform initialization of the Ethernet physical layer connected to the first Ethernet controller through the acquired Ethernet physical layer state includes: Controlling the first Ethernet controller to send query instructions to each corresponding Ethernet physical layer address in sequence; When the return value of the Ethernet physical layer address received by the first Ethernet controller is not a preset value, determining that the Ethernet physical layer connected to the Ethernet physical layer address is a first target device corresponding to the first Ethernet controller, and initializing the first target device; The preset value is used to indicate that the current interface is not connected to an Ethernet physical layer.

4. The method according to claim 2, characterized in that: The initializing the second target device includes: According to the second Ethernet controller and the Ethernet physical layer connected thereto, and the device driver matching the second Ethernet controller, a device instance of the Ethernet card is formed; Based on the formed device instance of the Ethernet card, the initialization of the Ethernet card is completed.

5. The method according to claim 3, characterized in that: The initializing the first target device includes: According to the first Ethernet controller and the Ethernet physical layer connected thereto, and the device driver matching the first Ethernet controller, a device instance of the Ethernet card is formed; Based on the formed device instance of the Ethernet card, the initialization of the Ethernet card is completed.

6. The method according to any one of claims 1 to 5, characterized in that: The method further comprises: Calling a network interface information acquisition function in a preset Ethernet physical layer, and reconstructing the network interface information acquisition function in a board support package of the Ethernet card, wherein the preset Ethernet physical layer and the Ethernet physical layer in the Ethernet card are different devices; In response to the synchronous network link status function, the network interface information obtained by the network interface information obtaining function is called to update the link information of the network interface.

7. An Ethernet card initialization processing device, the Ethernet card comprising a first Ethernet controller, a second Ethernet controller and an Ethernet physical layer, the first Ethernet controller is connected to the Ethernet physical layer through a configuration management interface, and the second Ethernet controller is not connected to the Ethernet physical layer through the configuration management interface, characterized in that: include: The response module is used to determine the device member pointed to according to the device pointer currently scanned; A processing module, used for determining that the device member is a first Ethernet controller, and using a global variable to save the device pointer; A control module, used for controlling the first Ethernet controller to sequentially poll each corresponding Ethernet physical layer address, so as to obtain the Ethernet physical layer status and perform initialization of the Ethernet physical layer connected to the first Ethernet controller; The processing module is further configured to determine that the device member is the second Ethernet controller, and call the first Ethernet controller pointed to by the global variable; The control module is further used to control the first Ethernet controller to continue polling its corresponding Ethernet physical layer addresses, so as to obtain the Ethernet physical layer status and perform initialization of the Ethernet physical layer connected to the second Ethernet controller.

8. An electronic device, characterized in that: include: Memory, processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory, so that the processor performs the method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 6 when executed by a processor.

10. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 6 when being executed by a processor.

Citation Information

Patent Citations

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

    CN117014305A

  • Communication control method and device

    CN117395177A