CN111459867B - Method, device, converter and storage medium for converting USB (Universal Serial bus) into SMI (SMI) - Google Patents
Method, device, converter and storage medium for converting USB (Universal Serial bus) into SMI (SMI) Download PDFInfo
- Publication number
- CN111459867B CN111459867B CN202010126646.XA CN202010126646A CN111459867B CN 111459867 B CN111459867 B CN 111459867B CN 202010126646 A CN202010126646 A CN 202010126646A CN 111459867 B CN111459867 B CN 111459867B
- Authority
- CN
- China
- Prior art keywords
- smi
- data
- instruction
- cpu
- usb
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 38
- 238000006243 chemical reaction Methods 0.000 claims abstract description 22
- 238000004590 computer program Methods 0.000 claims description 21
- 230000004044 response Effects 0.000 claims description 15
- 230000005540 biological transmission Effects 0.000 claims description 3
- 238000010586 diagram Methods 0.000 description 7
- 230000006870 function Effects 0.000 description 7
- 230000006872 improvement Effects 0.000 description 6
- 238000004364 calculation method Methods 0.000 description 3
- 238000013461 design Methods 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 238000004088 simulation Methods 0.000 description 2
- 230000001413 cellular effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/42—Bus transfer protocol, e.g. handshake; Synchronisation
- G06F13/4282—Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Bus Control (AREA)
Abstract
The invention discloses a method for converting USB to SMI, which is suitable for a converter, wherein the converter is connected with a CPU through a USB bus, and is connected with network equipment through an SMI bus; the method comprises the following steps: when the USB interface is in an initial state, receiving an operation instruction sent by the CPU through the USB bus; wherein the operation instruction comprises a read instruction and a write instruction; responding to the operation instruction, switching the initial state to a state corresponding to the operation instruction, and receiving operation data sent by the CPU; converting the operation data into SMI operation data, and sending the SMI operation data to the SMI bus to access the network equipment; and after the operation is finished, switching the current state into the initial state. The invention also discloses a device for converting the USB into the SMI, a converter and a storage medium, which can effectively solve the problem of poor universality caused by simulating the SMI bus through the GPIO, are simple and convenient to operate and can effectively improve the conversion efficiency.
Description
Technical Field
The invention relates to the technical field of network equipment, in particular to a method, a device, a converter and a storage medium for converting USB (universal serial bus) to SMI (SMI).
Background
Currently, the CPU or MAC controls and manages the physical layer device or other network devices through SMI access. Normally, the embedded CPU carries the bus, but general purpose CPUs such as X86 CPU do not carry this function. This results in that under the CPU device, the network devices connected on the bus, which are to be accessed, must be emulated using existing hardware resources. The cost of simulating the SMI bus is typically low by GPIOs, and can be implemented relatively simply if there is sufficient GPIO support on the hardware. But the usability is poor because the GPIO uses a specific PIN, and if the CPU uses this GPIO as the interface for converting SMIs, all modules that are adapted to it must use this PIN connection, which is poor in flexibility.
Disclosure of Invention
The embodiment of the invention provides a method, a device, a converter and a storage medium for converting USB (universal serial bus) to SMI (SMI standard), which can effectively solve the problem of poor universality caused by simulating an SMI bus through a GPIO (general purpose input/output), are simple and convenient to operate and can effectively improve the conversion efficiency.
An embodiment of the present invention provides a method for converting USB to SMI, which is applicable to a converter, wherein the converter is connected to a CPU through a USB bus, and the converter is connected to a network device through an SMI bus; the method comprises the following steps:
when the USB interface is in an initial state, receiving an operation instruction sent by the CPU through the USB bus; wherein the operation instruction comprises a read instruction and a write instruction;
responding to the operation instruction, switching the initial state to a state corresponding to the operation instruction, and receiving operation data sent by the CPU;
converting the operation data into SMI operation data, and sending the SMI operation data to the SMI bus to access the network equipment;
and after the operation is finished, switching the current state into the initial state.
As an improvement of the above solution, the method further includes, when the operation instruction is the read instruction, an operation step of:
when the operation instruction is the reading instruction, responding to the reading instruction, switching the initial state into a reading state, and receiving the read data sent by the CPU; the read data comprises a PHY address, a Register address and a port number of a protocol;
converting the read data into SMI read data;
reading data corresponding to the SMI reading data is obtained from the network equipment through the SMI bus so as to return the reading data to the CPU;
and after reading is finished, switching the reading state into the initial state.
As an improvement of the above scheme, the method further includes, when the operation instruction is the write instruction, an operation step of:
when the operation instruction is the writing instruction, responding to the writing instruction, switching the initial state into a writing state, and receiving writing data sent by the CPU; wherein the write data comprises a PHY address, a Register address and a port number of a protocol;
converting the write data into SMI write data, and sending the SMI write data to the network equipment through the SMI bus;
and after the writing is finished, switching the writing state into the initial state.
As an improvement of the above, the method further comprises:
responding to a protocol version acquisition instruction sent by the CPU, switching the initial state into a data acquisition state, and sending a currently running protocol version number to the CPU through the USB bus;
and after the transmission is finished, switching the data acquisition state into the initial state.
The invention correspondingly provides a device for converting USB to SMI, which is suitable for a converter, wherein the converter is connected with a CPU through a USB bus, and is connected with network equipment through an SMI bus; the device comprises:
the instruction receiving module is used for receiving an operation instruction sent by the CPU through the USB bus when the USB bus is in an initial state; wherein the operation instruction comprises a read instruction and a write instruction;
the instruction response module is used for responding to the operation instruction, switching the initial state into a state corresponding to the operation instruction and receiving operation data sent by the CPU;
the data conversion module is used for converting the operation data into SMI operation data and sending the SMI operation data to the SMI bus so as to access the network equipment;
and the operation completion module is used for switching the current state into the initial state after the operation is completed.
As an improvement of the above, the apparatus further comprises:
a read instruction response unit, configured to, when the operation instruction is the read instruction, respond to the read instruction, switch the initial state to a read state, and receive read data sent by the CPU; the read data comprises a PHY address, a Register address and a port number of a protocol;
a read data conversion unit, configured to convert the read data into SMI read data;
a data reading unit, configured to acquire, from the network device through the SMI bus, read data corresponding to the SMI read data, so as to return the read data to the CPU;
and the reading ending unit is used for switching the reading state into the initial state after reading is ended.
As an improvement of the above, the apparatus further comprises:
a write instruction response unit, configured to, when the operation instruction is the write instruction, respond to the write instruction, switch the initial state to a write state, and receive write data sent by the CPU; wherein the write data comprises a PHY address, a Register address and a port number of a protocol;
a write data conversion unit, configured to convert the write data into SMI write data, and send the SMI write data to the network device through the SMI bus;
and the writing ending unit is used for switching the writing state into the initial state after the writing is ended.
As an improvement of the above, the apparatus further comprises:
a protocol version acquisition instruction response unit, configured to respond to a protocol version acquisition instruction sent by the CPU, switch the initial state to a data acquisition state, and send a currently running protocol version number to the CPU through the USB bus;
and the sending completion unit is used for switching the data acquisition state into the initial state after the sending is completed.
Compared with the prior art, the method and the device for converting the USB into the SMI are suitable for the converter, the converter is connected with the CPU through the USB bus, the converter is connected with the network equipment through the SMI bus, and further receives the operation instruction sent by the CPU through the USB bus when the converter is in the initial state, wherein the operation instruction comprises a read instruction and a write instruction, the initial state is switched to the state corresponding to the operation instruction in response to the operation instruction, the operation data sent by the CPU is received, the operation data is converted into the SMI operation data, the SMI operation data is sent to the SMI bus to access the network equipment, and after the operation is completed, the current state is switched to the initial state. Through setting up the external module converter, realize that the CPU that does not have SMI bus support passes through general USB hardware bus and visits network equipment, can effectively solve through GPIO simulation SMI bus like this and appear the poor problem of commonality, can effectively reduce the degree of dependence to CPU resource, have the characteristics that the commonality is strong, strong adaptability. In addition, the method has the characteristics of simplicity and high efficiency, can effectively reduce the calculation complexity, further can effectively reduce the requirements on computer hardware, greatly reduces the design cost, can realize the access to network equipment by adopting less USB broadband occupation, is simple and convenient to operate, and can effectively improve the conversion efficiency.
Another embodiment of the present invention provides a converter, which includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, and when the processor executes the computer program, the converter implements the USB to SMI method according to the above embodiment of the present invention.
Another embodiment of the present invention provides a storage medium, where the computer-readable storage medium includes a stored computer program, where when the computer program runs, the apparatus where the computer-readable storage medium is located is controlled to execute the method for converting USB to SMI according to the above-mentioned embodiment of the present invention.
Drawings
Fig. 1 is a schematic flowchart illustrating a method for converting USB to SMI according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of the converter, the CPU and the network device according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a USB to SMI conversion apparatus according to a second embodiment of the present invention;
fig. 4 is a schematic structural diagram of a converter according to a third embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example one
Fig. 1 is a schematic flow chart of a method for converting USB to SMI according to an embodiment of the present invention, and fig. 2 is a schematic connection diagram of a converter, a CPU, and a network device according to an embodiment of the present invention. The method is applicable to a converter 11, the connections of which are shown in fig. 2, the converter 11 being connected to the CPU12 via a USB bus, and the converter 11 being connected to the network device 13 via an SMI bus.
It should be noted that the CPU12 accesses the converter 11 through the USB bus, and the converter 11 sends an operation command of the CPU12 to the SMI bus, so that the CPU12 can access any register of any network device 13 on the SMI bus. In this embodiment, the converter 11 is a peripheral hardware module. The external module performs conversion using the USB interface as an extension, and does not fail due to the exchange of the CPU 12. In addition, because the USB interface is a very common interface, the CPU12 has sufficient resources, and such resources are easily expanded when used, and the conversion of the protocol is completed in an external module, and there is no problem of software failure due to the change of the CPU 12.
Referring to fig. 1, the method includes steps S101 to S104.
S101, receiving an operation instruction sent by the CPU through the USB bus when the USB bus is in an initial state; wherein the operation instruction comprises a read instruction and a write instruction.
S102, responding to the operation instruction, switching the initial state to a state corresponding to the operation instruction, and receiving operation data sent by the CPU.
S103, converting the operation data into SMI operation data, and sending the SMI operation data to the SMI bus to access the network equipment.
And S104, after the operation is finished, switching the current state into the initial state.
Illustratively, the byte stream of the conversion protocol in the converter is as follows: the operation instruction and protocol version acquisition instruction is 8 bits, the Phy _ addr is 3 bits, Reg is that addr is 3 bits, 3 bits are reserved after conversion, the Smi _ port is 2 bits, and the higher 3 bits of Phy _ addr are 3 bits; wherein Phy _ addr is a PHY address in the Smi protocol, Reg is that addr is a register address in the Smi protocol, and Smi _ port is a port number in the Smi protocol. In this embodiment, the initial state is the initial state of the converter state machine, and the initial state is entered first after the converter is started. Further, an instruction received from the USB bus is detected in an initial state. For example, if the received data is 0X0060, it is considered as a protocol version acquisition instruction, and the initial state is switched to a data acquisition state. If the received data is 0X00EC, the command is considered as a read command, and a read operation is entered. If the received data is 0X00EA, the command is considered to be a write command, and the state enters a write state.
Based on the foregoing embodiment, preferably, the method further includes an operation step when the operation instruction is the read instruction:
when the operation instruction is the reading instruction, responding to the reading instruction, switching the initial state into a reading state, and receiving the read data sent by the CPU; the read data comprises a PHY address, a Register address and a port number of a protocol;
converting the read data into SMI read data;
reading data corresponding to the SMI reading data is obtained from the network equipment through the SMI bus so as to return the reading data to the CPU;
and after reading is finished, switching the reading state into the initial state.
In this embodiment, after entering the read state, the converter starts to detect data received from the USB bus, where the data is read data. The read data includes PHY address, Register address, port number, and the like, which are necessary information for performing an SMI bus read operation. Further, the converter converts the read data into SMI read data, transmits the SMI read data to the SMI bus of the converter, reads required data from the network device from the SMI bus, transmits the read data to the CPU through the USB bus, and then enters an initial state.
Based on the foregoing embodiment, preferably, the method further includes an operation step when the operation instruction is the write instruction:
when the operation instruction is the writing instruction, responding to the writing instruction, switching the initial state into a writing state, and receiving writing data sent by the CPU; wherein the write data comprises a PHY address, a Register address and a port number of a protocol;
converting the write data into SMI write data, and sending the SMI write data to the network equipment through the SMI bus;
and after the writing is finished, switching the writing state into the initial state.
In this embodiment, after entering the write state, the converter starts to detect data received from the USB bus, where the data is write data. The write data includes an address of the PHY, a Register address, a port number, and the like, which are necessary information for performing the write operation of the SMI bus. Further, the converter converts the write data into SMI write data, sends the SMI write data to the converter on the SMI bus, writes the network device, and then enters the initial state.
Based on the above embodiment, preferably, the method further includes:
responding to a protocol version acquisition instruction sent by the CPU, switching the initial state into a data acquisition state, and sending a currently running protocol version number to the CPU through the USB bus;
and after the transmission is finished, switching the data acquisition state into the initial state.
The method for converting the USB into the SMI is suitable for a converter, the converter is connected with a CPU through a USB bus, the converter is connected with network equipment through the SMI bus, and further receives an operation instruction sent by the CPU through the USB bus when the converter is in an initial state, wherein the operation instruction comprises a read instruction and a write instruction, the initial state is further switched to a state corresponding to the operation instruction in response to the operation instruction, the operation data sent by the CPU is received, the operation data is converted into SMI operation data, the SMI operation data is sent to the SMI bus to access the network equipment, and after the operation is completed, the current state is switched to the initial state. Through setting up the external module converter, realize that the CPU that does not have SMI bus support passes through general USB hardware bus and visits network equipment, can effectively solve through GPIO simulation SMI bus like this and appear the poor problem of commonality, can effectively reduce the degree of dependence to CPU resource, have the characteristics that the commonality is strong, strong adaptability. In addition, the method has the characteristics of simplicity and high efficiency, can effectively reduce the calculation complexity, further can effectively reduce the requirements on computer hardware, greatly reduces the design cost, can realize the access to network equipment by adopting less USB broadband occupation, is simple and convenient to operate, and can effectively improve the conversion efficiency.
Example two
Referring to fig. 3, it is a schematic structural diagram of a USB to SMI conversion apparatus according to a second embodiment of the present invention, which is suitable for a converter, where the converter is connected to a CPU through a USB bus, and the converter is connected to a network device through an SMI bus; the device comprises:
an instruction receiving module 201, configured to receive, through the USB bus, an operation instruction sent by the CPU when the USB bus is in an initial state; wherein the operation instruction comprises a read instruction and a write instruction;
an instruction response module 202, configured to respond to the operation instruction, switch the initial state to a state corresponding to the operation instruction, and receive operation data sent by the CPU;
a data conversion module 203, configured to convert the operation data into SMI operation data, and send the SMI operation data to the SMI bus to access the network device;
and an operation completion module 204, configured to switch the current state to the initial state after the operation is completed.
Preferably, the apparatus further comprises:
a read instruction response unit, configured to, when the operation instruction is the read instruction, respond to the read instruction, switch the initial state to a read state, and receive read data sent by the CPU; the read data comprises a PHY address, a Register address and a port number of a protocol;
a read data conversion unit, configured to convert the read data into SMI read data;
a data reading unit, configured to acquire, from the network device through the SMI bus, read data corresponding to the SMI read data, so as to return the read data to the CPU;
and the reading ending unit is used for switching the reading state into the initial state after reading is ended.
Preferably, the apparatus further comprises:
a write instruction response unit, configured to, when the operation instruction is the write instruction, respond to the write instruction, switch the initial state to a write state, and receive write data sent by the CPU; wherein the write data comprises a PHY address, a Register address and a port number of a protocol;
a write data conversion unit, configured to convert the write data into SMI write data, and send the SMI write data to the network device through the SMI bus;
and the writing ending unit is used for switching the writing state into the initial state after the writing is ended.
Preferably, the apparatus further comprises:
a protocol version acquisition instruction response unit, configured to respond to a protocol version acquisition instruction sent by the CPU, switch the initial state to a data acquisition state, and send a currently running protocol version number to the CPU through the USB bus;
and the sending completion unit is used for switching the data acquisition state into the initial state after the sending is completed.
The device for converting the USB into the SMI is suitable for a converter, the converter is connected with a CPU through a USB bus, the converter is connected with network equipment through the SMI bus, and further receives an operation instruction sent by the CPU through the USB bus when the converter is in an initial state through a setting instruction receiving module, wherein the operation instruction comprises a read instruction and a write instruction; responding to the operation instruction by setting an instruction response module, switching the initial state into a state corresponding to the operation instruction, and receiving operation data sent by the CPU; thereby, by setting a data conversion module, converting the operation data into SMI operation data, and sending the SMI operation data to the SMI bus to access the network device; and through setting an operation completion module, after the operation is completed, the current state is switched to the initial state. By adopting the external module converter, the CPU without SMI bus support can access the network equipment through the universal USB hardware bus, thus effectively solving the problem of poor universality caused by simulating the SMI bus through GPIO, effectively reducing the dependence on CPU resources and having the characteristics of strong universality and strong adaptability. In addition, the device has the characteristics of simplicity and high efficiency, can effectively reduce the calculation complexity, further effectively reduce the requirements on computer hardware, greatly reduce the design cost, realize the access to network equipment by adopting less USB broadband occupation, is simple and convenient to operate and can effectively improve the conversion efficiency.
EXAMPLE III
Fig. 4 is a schematic structural diagram of a converter according to a third embodiment of the present invention. The converter of this embodiment includes: a processor 301, a memory 302, and a computer program, such as a USB to SMI program, stored in the memory 302 and operable on the processor 301. The processor 301 implements the steps in the above embodiments of the USB to SMI method when executing the computer program. Alternatively, the processor 301 implements the functions of the modules/units in the above device embodiments when executing the computer program.
Illustratively, the computer program may be partitioned into one or more modules/units that are stored in the memory and executed by the processor 301 to implement the present invention. The one or more modules/units may be a series of computer program instruction segments capable of performing specific functions, which are used to describe the execution of the computer program in the converter.
The converter can be a desktop computer, a notebook, a palm computer, a cloud server and other computing equipment. The converter may include, but is not limited to, a processor, a memory. It will be appreciated by those skilled in the art that the schematic diagram is merely an example of a converter and is not intended to be limiting and may include more or fewer components than shown, or some components in combination, or different components, e.g., the converter may also include input output devices, network access devices, buses, etc.
The Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. The general purpose processor may be a microprocessor or the processor may be any conventional processor or the like, which is the control center for the converter, with various interfaces and lines connecting the various parts of the overall converter.
The memory may be used to store the computer programs and/or modules, and the processor may implement the various functions of the converter by running or executing the computer programs and/or modules stored in the memory, as well as by invoking data stored in the memory. The memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required by at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area may store data (such as audio data, a phonebook, etc.) created according to the use of the cellular phone, and the like. In addition, the memory may include high speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other volatile solid state storage device.
Wherein the converter integrated module/unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the method according to the embodiments of the present invention may also be implemented by a computer program, which may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method embodiments may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, usb disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution medium, and the like. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
It should be noted that the above-described device embodiments are merely illustrative, where the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. In addition, in the drawings of the embodiment of the apparatus provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, and may be specifically implemented as one or more communication buses or signal lines. One of ordinary skill in the art can understand and implement it without inventive effort.
While the foregoing is directed to the preferred embodiment of the present invention, it will be understood by those skilled in the art that various changes and modifications may be made without departing from the spirit and scope of the invention.
Claims (10)
1. A method for converting USB to SMI is characterized in that the method is applicable to a converter, the converter is connected with a CPU through a USB bus, and the converter is connected with network equipment through an SMI bus; the method comprises the following steps:
when the USB interface is in an initial state, receiving an operation instruction sent by the CPU through the USB bus; wherein the operation instruction comprises a read instruction and a write instruction;
responding to the operation instruction, switching the initial state to a state corresponding to the operation instruction, and receiving operation data sent by the CPU;
converting the operation data into SMI operation data, and sending the SMI operation data to the SMI bus to access the network equipment;
and after the operation is finished, switching the current state into the initial state.
2. The method for converting USB to SMI according to claim 1, wherein the method further comprises the operation when the operation command is the read command:
when the operation instruction is the reading instruction, responding to the reading instruction, switching the initial state into a reading state, and receiving the read data sent by the CPU; the read data comprises a PHY address, a Register address and a port number of a protocol;
converting the read data into SMI read data;
reading data corresponding to the SMI reading data is obtained from the network equipment through the SMI bus so as to return the reading data to the CPU;
and after reading is finished, switching the reading state into the initial state.
3. The USB to SMI method of claim 1, wherein the method further comprises the operation when the operation command is the write command of:
when the operation instruction is the writing instruction, responding to the writing instruction, switching the initial state into a writing state, and receiving writing data sent by the CPU; wherein the write data comprises a PHY address, a Register address and a port number of a protocol;
converting the write data into SMI write data, and sending the SMI write data to the network equipment through the SMI bus;
and after the writing is finished, switching the writing state into the initial state.
4. The USB to SMI method of claim 1, wherein the method further comprises:
responding to a protocol version acquisition instruction sent by the CPU, switching the initial state into a data acquisition state, and sending a currently running protocol version number to the CPU through the USB bus;
and after the transmission is finished, switching the data acquisition state into the initial state.
5. A USB to SMI conversion apparatus adapted to a converter, said converter being connected to a CPU via a USB bus and said converter being connected to a network device via an SMI bus; the device comprises:
the instruction receiving module is used for receiving an operation instruction sent by the CPU through the USB bus when the USB bus is in an initial state; wherein the operation instruction comprises a read instruction and a write instruction;
the instruction response module is used for responding to the operation instruction, switching the initial state into a state corresponding to the operation instruction and receiving operation data sent by the CPU;
the data conversion module is used for converting the operation data into SMI operation data and sending the SMI operation data to the SMI bus so as to access the network equipment;
and the operation completion module is used for switching the current state into the initial state after the operation is completed.
6. The USB to SMI device of claim 5, wherein the device further comprises:
a read instruction response unit, configured to, when the operation instruction is the read instruction, respond to the read instruction, switch the initial state to a read state, and receive read data sent by the CPU; the read data comprises a PHY address, a Register address and a port number of a protocol;
a read data conversion unit, configured to convert the read data into SMI read data;
a data reading unit, configured to acquire, from the network device through the SMI bus, read data corresponding to the SMI read data, so as to return the read data to the CPU;
and the reading ending unit is used for switching the reading state into the initial state after reading is ended.
7. The USB to SMI device of claim 5, wherein the device further comprises:
a write instruction response unit, configured to, when the operation instruction is the write instruction, respond to the write instruction, switch the initial state to a write state, and receive write data sent by the CPU; wherein the write data comprises a PHY address, a Register address and a port number of a protocol;
a write data conversion unit, configured to convert the write data into SMI write data, and send the SMI write data to the network device through the SMI bus;
and the writing ending unit is used for switching the writing state into the initial state after the writing is ended.
8. The USB to SMI device of claim 5, wherein the device further comprises:
a protocol version acquisition instruction response unit, configured to respond to a protocol version acquisition instruction sent by the CPU, switch the initial state to a data acquisition state, and send a currently running protocol version number to the CPU through the USB bus;
and the sending completion unit is used for switching the data acquisition state into the initial state after the sending is completed.
9. A converter comprising a processor, a memory and a computer program stored in the memory and configured to be executed by the processor, the processor when executing the computer program implementing the USB to SMI method of any one of claims 1 to 4.
10. A computer-readable storage medium, comprising a stored computer program, wherein the computer program, when executed, controls a device on which the computer-readable storage medium is located to perform the USB to SMI method according to any one of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010126646.XA CN111459867B (en) | 2020-02-28 | 2020-02-28 | Method, device, converter and storage medium for converting USB (Universal Serial bus) into SMI (SMI) |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010126646.XA CN111459867B (en) | 2020-02-28 | 2020-02-28 | Method, device, converter and storage medium for converting USB (Universal Serial bus) into SMI (SMI) |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111459867A CN111459867A (en) | 2020-07-28 |
CN111459867B true CN111459867B (en) | 2022-04-15 |
Family
ID=71685862
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010126646.XA Active CN111459867B (en) | 2020-02-28 | 2020-02-28 | Method, device, converter and storage medium for converting USB (Universal Serial bus) into SMI (SMI) |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111459867B (en) |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10078568B1 (en) * | 2015-11-30 | 2018-09-18 | Amazon Technologies, Inc. | Debugging a computing device |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101692215B (en) * | 2009-08-28 | 2011-06-22 | 福建星网锐捷网络有限公司 | Method and device for controlling serial management interface |
US9277651B2 (en) * | 2013-03-15 | 2016-03-01 | Intel Corporation | Differential passive equalizer |
CN103279441B (en) * | 2013-05-21 | 2017-04-05 | 山东超越数控电子有限公司 | A kind of USB based on domestic embedded OS turns CF/SD driving methods |
CN106980493B (en) * | 2016-01-18 | 2021-06-18 | 中兴通讯股份有限公司 | Firmware management method and device |
CN109815184A (en) * | 2017-11-21 | 2019-05-28 | 中兴通讯股份有限公司 | Debugging single board device and its control method, computer readable storage medium |
CN107948701A (en) * | 2017-11-22 | 2018-04-20 | 深圳市微盾科技有限公司 | A kind of intelligent transmitting device for digital television signal transmission |
US10630494B2 (en) * | 2017-12-15 | 2020-04-21 | Crestron Electronics, Inc. | PoE powered device with link layer startup processor |
-
2020
- 2020-02-28 CN CN202010126646.XA patent/CN111459867B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10078568B1 (en) * | 2015-11-30 | 2018-09-18 | Amazon Technologies, Inc. | Debugging a computing device |
Non-Patent Citations (1)
Title |
---|
基于μC/OS-Ⅱ的以太网设备远程管理软件设计与实现;贾丽;《中国优秀博硕士学位论文全文数据库(硕士)信息科技辑》;20120215;I138-336 * |
Also Published As
Publication number | Publication date |
---|---|
CN111459867A (en) | 2020-07-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US5649128A (en) | Multiple bus interface adapter for connection to a plurality of computer bus architectures | |
CN100492334C (en) | Serial Peripheral Interface Device | |
CN109324991B (en) | Hot plug device, method, medium and system of PCIE (peripheral component interface express) equipment | |
US8566416B2 (en) | Method and system for accessing storage device | |
CN113742269B (en) | Data transmission method, processing device and medium for EPA device | |
CN111901164A (en) | Adaptive control method, device, equipment and system for OCP NIC network card | |
CN105205025A (en) | Chip interconnection method, chips and device | |
US9665522B2 (en) | Protocol neutral fabric | |
CN114417373A (en) | Data access method and device for NVMe-oF user mode client | |
CN115981730B (en) | System, method and device for accessing device operating system through interconnection | |
CN110209605B (en) | Register reading and writing method and computing device of PCIE bus network card | |
TW202143061A (en) | I3c hub promoting backward compatibility with ic | |
CN107704407A (en) | A system and method for data processing between SPI and UART | |
CN112527715B (en) | An automatic configuration method and related equipment for server multi-IO expansion | |
CN111459867B (en) | Method, device, converter and storage medium for converting USB (Universal Serial bus) into SMI (SMI) | |
CN111897760A (en) | Electronic product, expansion device thereof, control method and control device | |
CN110765065A (en) | System on chip | |
WO2023186143A1 (en) | Data processing method, host, and related device | |
CN112559402B (en) | PCI slave interface control circuit based on FPGA and FPGA | |
US20210019274A1 (en) | Virtual com port bridge supporting host-to-host usb transmission | |
CN114238160A (en) | Address access method and device and electronic equipment | |
KR100922812B1 (en) | Peripheral Control Method and System | |
CN216014148U (en) | Server and server backboard | |
CN117436405B (en) | A simulation verification method, device and electronic equipment | |
CN113868158B (en) | System-on-chip and data comparison method, device, equipment and computer medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |