What is the USB stack?

usb
13,630

Solution 1

The term "stack" refers to either the abstract data structure (not relevant for this), or to a collection of software that performs a specific function. In the case of a "USB stack", it's the collection of hardware, firmware, kernel modules, drivers, and user programs that allow communication over USB links.

The term "stack" is used because the software components are often layered on top of one another, each using the services of the layer(s) below it.

You may also hear about the "networking stack", or the "LAMP stack", or other similar phrases. Wikipedia has an article on Solution stack, which is the same idea.

Solution 2

USB stack, is just a phrase based on generic concept of 'software stack', such as TCP/IP stack, GSM stack, etc.

It's the framework, often provided by USB device manufacturers, or OS developers, that enables other developers to focus on the meat of their implementation, rather than worrying about implementing lower levels of USB correctly.

In case of USB, there are essentially layers of communication (everyone calls them slightly differently):

  • Link Layer (Serial IO) - deals with differential line transitions and signaling, and decode the stream to binary data, very often in hardware
  • USB Packet Layer - deals with structure of USB data packets
  • USB Required Functionality - enumeration, buffers, endpoints
  • USB higher level APIs - Audio, HID, etc, that have their own restrictions and needs.

It's similar to TCP/IP stack of a modern operating system:

  • Physical Layer (usually done in hardware on the ethernet card)
  • Link Layer (MAC address layer, often done in hardware on the ethernet card)
  • Network Layer (IP, routing)
  • Transport Layer (TCP)
  • Your application specific layers (HTTP stack, etc).
Share:
13,630
Ahmed
Author by

Ahmed

Hello , I love this site because all my questions were answered extensively and I am looking to be able to help others like I was helped many times but that's still far a bit.

Updated on June 25, 2022

Comments

  • Ahmed
    Ahmed almost 2 years

    I want to know what is meant by the USB stack and an example of it . I studied a lot about USB and I read some books like USB in a nutshell but "USB stack" wasn't mentioned .

  • Ahmed
    Ahmed about 12 years
    So it doesn't only refer to the software ? google.com/…
  • Greg Hewgill
    Greg Hewgill about 12 years
    Correct, the "stack" cuts across the different layers of implementation and includes many different types of components, including hardware in the case of USB.
  • Ahmed
    Ahmed about 12 years
    And the stack is dependent on the hardware ? There is a different stack for each chip ?
  • Greg Hewgill
    Greg Hewgill about 12 years
    No. The whole point of the stack is that the hardware drivers (a software component) are specific to the hardware chip. A different hardware chip may require different hardware drivers, but the important point is the remainder of the stack can stay the same.