9
votes

I m bit confused by the following statement in linux device drivers book. http://www.linuxdriver.co.il/ldd3/

13.2. USB and Sysfs To help understand what this long device path means, we describe how the kernel labels the USB devices. The first USB device is a root hub. This is the USB controller, usually contained in a PCI device. The controller is so named because it controls the whole USB bus connected to it. The controller is a bridge between the PCI bus and the USB bus, as well as being the first USB device on that bus.

Especially the statement "The controller is a bridge between the PCI bus and the USB bus"

Is it so? I m under the impression that PCI and USB are both distinct Buses. Please clarify.

4

4 Answers

7
votes

The "Controller" refer to above is a piece of Hardware. It houses functionality to "bridge" communications between a USB interface and a PCI interface.

By "bridging" it is meant that USB protocol packets are transferred to/from the CPU / USB ports but usually through a PCI "bus".

The reasons a hop through a PCI bus is used probably comes down to 2:

  • 1 interface is better than two (cost & complexity wise)
  • USB is much slower speed than PCI (certainly PCI-Express): it is easy just to "encapsulate" USB protocol packets onto PCI for shuttling those around the motherboard.

Note: there is often confusion when it comes to naming hardware chips. For efficient (read $$) reasons, it is quite common to have chips that house multiple functions. It is not because the main function of a chip is "PCI bridge" that it must be limited to perform "PCI bridging".

7
votes

They are indeed distinct busses, which is why you need a bridge between them so the CPU can, over PCI, through the bridge, communicate with stuff on the USB bus.

CPU ---(front-side bus)----  PCI controller ----(PCI-bus)-+--   USB controller ----(USB-bus)--+-- USB mouse
                                                          |                                   +--- USB printer
                                                          +--   SATA controller
2
votes

The USB controller communicates both USB and PCI. USB does not directly talk to the CPU, but rather across the PCI bus first.

2
votes

Two very simple flow diagrams:

Userspace -> Kernel -> PCI -> USB Controller -> USB Device

USB Device -> USB Controller -> PCI -> Kernel -> Userspace

Or, better put:

Userspace -> Kernel -> [CARD_ARCHITECTURE] -> USB Controller -> USB Device

USB Device -> USB Controller -> [CARD_ARCHITECTURE] -> Kernel -> Userspace

... as you see, PCI is rather incidental. Are you writing a device driver?