Driverless Multi-channel SMI Adapter
By using the Raspberry Pi Pi development board and open source driver, efficient communication of multi-channel SMI adapters is achieved, and the operation inconvenience and multiple access problems of Ethernet chip management interface adapters are solved, and the efficiency of device management is improved.
Patent Information
- Application Number
- CN202311237833.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-22
- Publication Date
- 2025-08-01
- Estimated Expiration
- 2043-09-22
AI Technical Summary
The adapter applications of the existing Ethernet chip management interface are very differentiated, inconvenient to operate, and do not support multiple access, resulting in inconvenient use in the case of multi-device cascade.
The Raspberry Pi Pi development board is used as the SMI adapter body, and its own Micro USB interface and GPIO interface are used, combined with WinUSB driver and Libusb driver to realize the communication of multiple SMI interfaces. The host and Ethernet devices are adapted through the adaptation algorithm, and the Clause22 and Clause45 protocols are supported.
It realizes flexible configuration and efficient management of multiple devices, simplifies the hardware development process, reduces costs, and does not need to install additional drivers, and supports simultaneous access of multiple SMI interfaces.
Smart Images

Figure CN117176566B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of Ethernet communication, and in particular relates to a driver-free multi-channel SMI adapter. Background Art
[0002] In the prior art, the Ethernet chip management interface is generally a Serial Management Interface (SMI). During development, debugging, testing, and actual application, the Ethernet chip needs to be managed and configured through the SMI interface.
[0003] Typically, chip or system manufacturers design their own SMI adapter hardware and provide corresponding drivers, resulting in significant differences in SMI adapter applications and extremely inconvenient operation. Furthermore, traditional SMI adapters do not support multi-access. Therefore, when cascading multiple devices, multiple SMI adapters must be managed separately, which is very inconvenient. Summary of the Invention
[0004] In view of the above-mentioned shortcomings of the prior art, the object of the present invention is to provide a driver-free multi-channel SMI adapter that can realize flexible configuration of Ethernet devices quickly and efficiently.
[0005] In order to overcome the shortcomings of the above-mentioned prior art, the present invention provides a driver-free multi-way SMI adapter, comprising: an SMI adapter body, used to realize communication between a host and an Ethernet device; a Micro USB interface, connected to the SMI adapter body, used to realize communication between the host and the SMI adapter body based on the USB protocol; multiple SMI interfaces, connected to the SMI adapter body, each SMI interface being used to realize communication between a connected Ethernet device and the SMI adapter body.
[0006] In one embodiment of the present invention, the SMI adapter body adopts a Raspberry Pi Pico development board.
[0007] In one embodiment of the present invention, the Micro USB interface uses the Micro USB interface provided by the Raspberry Pi development board.
[0008] In one embodiment of the present invention, the SMI interface uses the GPIO interface of the Raspberry Pi development board.
[0009] In one embodiment of the present invention, the Micro USB interface uses WinUSB driver and Libusb driver.
[0010] In an embodiment of the present invention, an adaptation algorithm is provided on the SMI adapter body, and the adaptation algorithm includes an application layer, a protocol driver layer, and a hardware driver layer;
[0011] The application layer is used to implement software adaptation between the host and the Ethernet device based on the USB driver protocol and the SMI driver protocol;
[0012] The protocol driver layer is used to provide the USB driver protocol and the SMI driver protocol;
[0013] The hardware driver layer is used to provide a Micro USB interface driver and an SMI interface driver.
[0014] In an embodiment of the present invention, the SMI driver protocol includes a Clause22 protocol and a Clause45 protocol.
[0015] In an embodiment of the present invention, the SMI adapter body realizes communication between the host and the Ethernet device through the following steps:
[0016] The SMI adapter obtains the message sent by the host via the Micro USB interface;
[0017] Parse the message to obtain an SMI command;
[0018] Execute the SMI command;
[0019] Send the execution response of the SMI command to the host via the Micro USB interface.
[0020] In an embodiment of the present invention, the SMI command includes an SMI configuration command, an SMI read command, and an SMI write command.
[0021] In an embodiment of the present invention, the SMI command includes an SMI interface number, and the SMI command is executed based on the SMI interface number through the corresponding SMI interface.
[0022] As described above, the driverless multi-channel SMI adapter of the present invention has the following beneficial effects:
[0023] (1) Developed using mature open-source hardware, eliminating the hardware development process, shortening the development cycle, and reducing costs;
[0024] (2) Based on the standard USB driver program to implement the USB interface, it can be used without driver installation, which greatly facilitates the user;
[0025] (3) Realize multiple SMI interfaces, enabling simultaneous configuration management of multiple devices, which greatly improves efficiency. Description of the Drawings
[0026] Figure 1 Shown is a schematic structural diagram of the driverless multi-channel SMI adapter of the present invention in an embodiment;
[0027] Figure 2 Shown is a schematic application diagram of the driverless multi-channel SMI adapter of the present invention in an embodiment;
[0028] Figure 3 Shown is a flowchart of the packet processing by the driverless multi-channel SMI adapter of the present invention in an embodiment. Detailed implementation manners
[0029] The following uses specific specific examples to illustrate the implementation manners of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific implementation manners. Various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, without conflict, the following embodiments and the features in the embodiments can be combined with each other.
[0030] It should be noted that the diagrams provided in the following embodiments only illustrate the basic concept of the present invention in a schematic manner. Therefore, only the components related to the present invention are shown in the diagrams, rather than being drawn according to the number, shape, and size of the components in actual implementation. The types, quantities, and ratios of the components in actual implementation can be arbitrarily changed, and the component layout type may also be more complex.
[0031] The technical solutions in the embodiments of the present invention will be described in detail below with reference to the accompanying drawings in the embodiments of the present invention.
[0032] As Figure 1 and Figure 2 shown, the driverless multi-channel SMI adapter of the present invention includes an SMI adapter body 1, a MicroUSB interface 2, and a multi-channel SMI interface 3.
[0033] The SMI adapter body 1 is used to implement communication between the host and the Ethernet device.
[0034] The Micro USB interface 2 is connected to the SMI adapter body 1 and is used to realize the communication between the host and the SMI adapter body based on the USB protocol. Due to the use of the Micro USB interface 2, driver-free SMI adaptation can be achieved without the need for additional development and installation of USB drivers. In one embodiment of the present invention, the Micro USB interface adopts WinUSB driver and Libusb driver. Among them, WinUSB driver is a new USB device driver added to Windows since the Vista operating system. It can not only drive the entire USB device, but also drive some interface functions of the composite device, greatly increasing the flexibility of development and debugging. Libusb driver is an open source software library for USB devices. It is independent of the operating system, which is convenient for developers to write portable USB applications.
[0035] Multiple SMI interfaces 3 are connected to the SMI adapter body 1, and each SMI interface 3 is used to implement communication between a connected Ethernet device and the SMI adapter body 1. Due to the provision of the multiple SMI interfaces 3, the SMI adapter body 1 can access multiple Ethernet devices simultaneously, realizing parallel processing of Ethernet devices, thereby greatly improving efficiency.
[0036] In one embodiment, the SMI adapter body adopts a Raspberry Pico development board. The Raspberry Pico development board has a built-in Micro USB interface and a GPIO interface. Therefore, in the present invention, the Micro USB interface of the Raspberry Pico development board is used as the Micro USB interface of the driver-free multi-way SMI adapter, and the multiple GPIO interfaces of the Raspberry Pico development board are used as the multiple SMI interfaces of the driver-free multi-way SMI adapter, thereby greatly simplifying the structure of the driver-free multi-way SMI adapter of the present invention. The Raspberry Pico development board uses the open source TinyUSB library to develop USB device software. TinyUSB has the advantages of compatibility with multiple hardware platforms and complete support for USB hosts and devices.
[0037] In the driver-free multi-channel SMI adapter of the present invention, an adaptation algorithm is provided on the SMI adapter body. The SMI adapter software is developed based on the PICO-SDK provided by the Raspberry Pi and the open-source software TinyUSB. In one embodiment, the adaptation algorithm includes an application layer, a protocol driver layer, and a hardware driver layer.
[0038] The application layer is used to implement software adaptation between the host and the Ethernet device based on the USB driver protocol and the SMI driver protocol. Specifically, the application layer calls the protocol driver layer API, initializes the USB and SMI modules, and registers message receiving, processing, and sending functions.
[0039] The protocol driver layer is used to provide a USB driver protocol and an SMI driver protocol. Among them, the protocol driver layer implements the definition and reporting of USB descriptors of the WinUSB device class, etc.; it implements operations such as SMI configuration, reading, and writing of SMI devices. In one embodiment, the SMI driver protocol includes Clause22 protocol and Clause45 protocol.
[0040] The hardware driver layer is used to provide a Micro USB interface driver and an SMI interface driver.
[0041] As Figure 3 shown, in one embodiment, the communication between the host and the Ethernet device implemented by the SMI adapter body includes the following steps:
[0042] 31) The SMI adapter obtains the message sent by the host via the Micro USB interface.
[0043] 32) Parse the message to obtain an SMI command. Among them, the SMI command includes an SMI configuration command, an SMI read command, and an SMI write command.
[0044] 32) Execute the SMI command. Among them, corresponding operations are executed according to the type of the SMI command, such as SMI configuration operation, SMI read operation, and SMI write operation.
[0045] 32) Send the execution response of the SMI command to the host via the Micro USB interface. Among them, the execution response includes execution success and an execution error code. The execution response is sent to the host in the form of a message through the MicroUSB interface.
[0046] Among them, the SMI configuration command is used to configure the current SMI rate and Clause protocol, and the SMI configuration command response is used to return whether the configuration is successful and the current software version number.
[0047] The SMI read command is used to read data based on the SMI interface, and the SMI read command response is used to return whether the SMI read is successful.
[0048] The SMI write command is used to write data based on the SMI interface, and the SMI write command response is used to return whether the SMI write is successful.
[0049] In one embodiment, the format of the SMI command is shown in Table 1.
[0050] Table 1. Format of SMI command
[0051] CMD / RESP 0 1 2 3 4 5 6 CMD_CFG CMD_ID LEN RSV Clause Speed RSV RSV RESP_CFG CMD_ID RET RSV MajorV MinorV RSV RSV CMD_WRITE CMD_ID LEN BUS_ID AddrH AddrL ValueH ValueL RESP_WRITE CMD_ID RET BUS_ID RSV RSV RSV RSV CMD_READ CMD_ID LEN BUS_ID AddrH AddrL RSV RSV RESP_READ CMD_ID RET BUS_ID RSV RSV ValueH ValueL
[0052] Among them, the SMI command includes an SMI interface number, i.e., BUS_ID, and the SMI adapter body executes the SMI command through the corresponding SMI interface based on the SMI interface number. In one embodiment, the SMI adapter body can support multiple SMI interfaces (at least 8 channels) simultaneously, allowing the host to access multiple levels of SMI devices simultaneously. To ensure thread safety, each command, as an atomic operation, carries BUS_ID information, and the SMI adapter body sends the command to the SMI interface with the corresponding number based on this.
[0053] The above embodiments merely illustrate the principles and effects of the present invention, rather than limiting the present invention. Any person familiar with this technology can modify or change the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or changes completed by those with ordinary knowledge in the technical field without departing from the spirit and technical idea disclosed by the present invention should still be covered by the claims of the present invention.
Claims
1. A driverless multi-channel SMI adapter, characterized in that, include: SMI adapter body, used to realize communication between host and Ethernet device; A Micro USB interface connected to the SMI adapter body, used to implement communication between the host and the SMI adapter body based on the USB protocol; Multiple SMI interfaces connected to the SMI adapter body, each SMI interface being used to implement communication between a connected Ethernet device and the SMI adapter body; The SMI adapter body implements communication between the host and the Ethernet device, including the following steps: The SMI adapter obtains the message sent by the host via the Micro USB interface; Parsing the message to obtain the SMI command; Executing the SMI command; The execution response of the SMI command is sent to the host via the Micro USB interface.
2. The driverless multi-channel SMI adapter according to claim 1, characterized in that: The SMI adapter body adopts the Raspberry Pi Pico development board.
3. The driverless multi-channel SMI adapter according to claim 2, wherein: The Micro USB interface uses the Micro USB interface provided by the Raspberry Pico development board.
4. The driverless multi-channel SMI adapter according to claim 2, wherein: The SMI interface uses the GPIO interface of the Raspberry Pi development board.
5. The driverless multi-channel SMI adapter according to claim 1, wherein: The Micro USB interface uses WinUSB driver and Libusb driver.
6. The driverless multi-channel SMI adapter according to claim 1, characterized in that: The SMI adapter body is provided with an adaptation algorithm, which includes an application layer, a protocol driver layer and a hardware driver layer; The application layer is used to implement software adaptation between the host and the Ethernet device based on the USB driver protocol and the SMI driver protocol; The protocol driver layer is used to provide USB driver protocol and SMI driver protocol; The hardware driver layer is used to provide Micro USB interface driver and SMI interface driver.
7. The driverless multi-channel SMI adapter according to claim 6, characterized in that: The SMI driver protocol includes Clause 22 protocol and Clause 45 protocol.
8. The driverless multi-channel SMI adapter according to claim 1, characterized in that: The SMI commands include SMI configuration commands, SMI read commands and SMI write commands.
9. The driverless multi-channel SMI adapter according to claim 1, wherein: The SMI command includes an SMI interface number, so that the SMI command is executed through a corresponding SMI interface based on the SMI interface number.
Citation Information
Patent Citations
On-site bus serial communication and Ethernet ascendency complementary system
CN201266317Y