0

This is a pretty broad question. The hardware buffer for USB ports, where is it typically located? I have heard they are typically in the USB controller. I attach what looks like a generic image to me of USB ports. I see each port has a big capacitor, and they run to two different chips. Are these chips the "USB controller" and is the hardware buffer contained inside them in the integrated circuit? The question can be answered very broadly and answers do not need to use the image I attach.

Why I ask: I am trying to learn basic I/O for computers. I have a pretty good understanding of how CPU works (have simulated on from scratch in VHDL), how RAM works (simulated it too), and the next step seemed to be I/O, how interrupts work, how interrupt handler in kernel works, etc.

enter image description here

6
  • You can easily check what each chip does by just Googling the chip labels. The upper chip is a 4-port USB 3.0 hub, the lower chip is the USB 3.0 controller (again with 4 ports).
    – Daniel B
    Commented Jan 17, 2023 at 10:01
  • @DanielB OK. For me to be clear on my question about hardware buffer (and USB controller), I would like to ask: Generally, does the "hub" have similar role to a hub in Ethernet network (as in, just forwards traffic), and the "controller" serves as the "controller" for all 7 USB ports? And I assume then, the hardware buffer is mostly in the controller (as that is what I was told earlier)?
    – BipedalJoe
    Commented Jan 18, 2023 at 12:31
  • Please check Nikita’s answer on that topic. The term “buffer” is very ambiguous. // Also, no, USB hubs are not at all comparable to Ethernet hubs.
    – Daniel B
    Commented Jan 18, 2023 at 12:45
  • So far from what I can see they (the USB "hub") definitely seem like something that treats those 4 USB ports as if they were 1, as seen from the USB controller, which is similar to what a ethernet hub does. But maybe you misinterpreted my question (ethernet hub for example copies to all connected devices, but this usb hub only copies to the controller), the analogy I was thinking about was just that many signals would exit via same place. The context of why I ask is: I would assume the hardware buffer functionality is in the controller and not the "hub".
    – BipedalJoe
    Commented Jan 18, 2023 at 12:56
  • No, USB "hub" is absolutely not similar to Ethernet "hub", because overall function and architecture of USB is far away from the function and architecture of Ethernet. First of all, all nodes in Ethernet are equal and any can send anytime to anyone, while in USB there is host and there are devices, and only host can initiate transfers in any direction, direct transfer between devices is impossible. USB hub is more like SATA port multiplier, or your ordinary electric extension cord (used properly). // Again, which hardware buffer you are talking about, electric buffer or data buffer? Commented Jan 24, 2023 at 3:58

1 Answer 1

1

USB is absolutely not the best way to learn basic I/O. It is not basic, actually it is pretty advanced and complicated interface. It's specs are not widely accessible (you have to pay for it), and so on. However, let me describe the device you have on the photo and where it has buffers.

Two chips you see are: the upper one (with "TAIWAN" on it) is Renesas μPD720210. the 4-port USB 3.0 hub, while the other one (with "CHINA" on it) is Renesas μPD720201, the PCIe gen2 USB 3.0 xHCI interface with built-in 4-port hub. I suggest you to google their markings to find and explore their datasheets.

They are connected in a daisy chain, you can easily recognize wires that connect various components. The configuration you'll see with e.g. lsusb -t is that two external ports (USB1 and USB2) and the internal port appear as being behind the root hub, and the second hub is attached to the remaining port of the root hub and it has four ports that are all external on this card (USB3 to USB6). (This is typical structure of the "7-port USB hub"; I've seen many different such devices and all of them happened to be two 4-port hubs in a daisy chain.)

The SATA power connector there just for power; on the old such cards we had the IDE power connector (colloquially known as "Molex connector", albeit this one is Molex's invention too) for the same reason.

And, finally, the buffer. This happens to be some ambiguity in this term:

  • In electronics, the buffer is the kind of the circuit which adapts the impedance of the source and the sink and/or sanitizes the digital signal. There are different kinds of buffer for different tasks. Indeed, both chips contain some electronic buffers of various kinds.
  • In computer science the buffer is the dedicated memory where data could be hold temporarily, in this case either received data until the application (OS) requests it or where it puts the data to be transmitted.

The word "buffer" happens in the first chip datasheet exactly once, in the context "pins that provide the power for the I/O buffer". The second chip is more sophisticated, because it has the PCIe interface which has registers that are memory mapped and it actually has some I/O buffers. The best is to read the xHCI specification to better know how USB buffers are accessed; for the example you can look into the source code of Linux driver for this chip. It will reveal some insigts into how it works.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .