Nowadays the term plug and play is not repeated everywhere, the reason is very simple, all peripherals are plug and play but there was a time when the system had no way of knowing what type of peripheral it was. communicating and it was necessary to manually touch some parameters.
This ended with the implementation of the first PCI port, now evolved in the different generations of PCI Express, and of USB later, which in their standards use identification codes that identify each of the devices. who are in it
Identification on PCI and PCI Express devices: the PCI ID
Any device connected to a PCI or PCI Express port is identified by a hexadecimal code divided into two parts:
- The first digits belong to the manufacturer, this identification is assigned perpetually by the PCI-SIG, which is the consortium which develops the various standards of the PCI Express bus, as well as its various advances.
- The second part of the ID is assigned by the manufacturer.
Each of the two parts of the identification code is stored as two 16-bit integers, which are stored in a specific register. This means that there can be up to 65536 PCI device device manufacturers and each of them can make 65536 devices that use this interface, let us tell you that even the most experienced hardware manufacturers do not have managed to manufacture this number of devices. This time.
Many manufacturers subdivide the product ID into several sub-IDs, which can mark things like the generation of the material, its nature, the type of variant, etc. So, unlike what happens with USB ID, each of the hardware manufacturers have more freedom to assign IDs, but the trade-off is that it is more difficult to assign generic drivers to PCIe devices. .
Identification on USB devices: USB ID
The USB bus was designed so that the host system can identify the device connected through the USB port, which is why, like with PCI devices, these also have identification but operate differently. But they work a little differently from PCI IDs.
First of all, there are a number of common identifications that are used to classify the different types of devices that we can connect to a USB port, among which:
- User Interface Descriptor (HID): It is used by keyboards, mice and even tablets and game controllers such as gamepads and gamepads. Many such devices do not have their own controllers and use generic ones for this type. device.
- Mass Storage Descriptor (MSD): It is used for external storage such as hard drives, pen drives, etc.
There are different types of identifications per type of device, these identifications are called classes, for example the human interface descriptor is a type of class then the subclass for the type of hardware, for example a subclass would be the keyboard. facilitating the loading of generic drivers for each type of hardware.
In addition to classes and subclasses, other descriptors are also included, which are as follows:
- Supplier ID (VID): The identification code of the seller of the USB device, each manufacturer of USB devices, regardless of their type, has a unique identification.
- Product ID (PID): The identification code of the device, this is granted by the manufacturer of the device.
- Revision: In the event that there are several opinions on the same product, these can also have an identification.
The revision descriptor is used in very specific cases, especially when there has been a small improvement that requires the use of a new type of driver while the software can use it.
Finally, it should be noted that the ID should not be confused with the drivers, both the USB ID and the PCI ID are used by the operating system to find the appropriate driver that will be used to communicate with this specific hardware, either between system files or from an online repository.