Return to Training Programs

ADVANCED TRAINING & RESEARCH LABS

Course-Number: ATR-011

Course-Description: USB programming with Linux

Duration of course: 1 day.


Course Description:

This is a one day program that describes the USB protocol and how USB device drivers are written under linux to interface with various kinds of devices.

The course starts off with a detailed description of the USB standards. The USB architecture, Host Controller design, Types of data transfers, bandwidth negotiation, protocol etc. are explained clearly.

The course then looks at how devices are enumerated and how the hotplug mechanism is used to associate a suitable driver for the device. The course looks at vendor id, device id, and other vital product data available through querying the control pipe. The various descriptors are explained and interfaces, default interface and alternative configuration interfaces are covered in detail.

The course then looks at the important header file for all USB programming, usb.h and looks at the available data structures maintained inside the kernel for various USB related activities.

The programming APIs are explained in detail and the URB concept is also covered.

The course looks at a Host to Host USB Bridge Chipset from Prolific Technologies, PL-2301 as an example to demonstrate a simple driver.

Finally, the usbnet.o driver is explained to show how a complete networking stack is built on top of a simple serial cable.

Target Audience:

This course would be ideal for linux systems programmers who have not worked with USB earlier. The course would also be useful for systems programmers already familiar with the USB bus coming into linux for the first time, in case they are interested in knowing how linux works with the USB bus interface.

Pre-requisites:

Knowledge of 'C' programming is mandatory for this course. Also, some knowledge of linux internals and kernel programming is deemed necessary since these are not part of the 1-day course.

Day

Topic

Duration

Contents

1          

The USB Bus standard    

1.5 hrs

The USB 2.0 specifications, USB architecture,  host controller design, data flow, protocol, bus operations, pipes, types of data transfers etc.


USB utilities under linux

1.5 hrs

The USB hotplug mechanism, table-driven driver registration, proc file interface, syfs interface, usbfs, usermode acess to USB devices ( libusb ).


USB programming APIs

1.5 hrs

Important data structures & descriptors, usb related APIs, URBs, control transfers, bulk transfers, isochronous transfers, interrupt transfers.


Case study - Prolific PL-2301 chipset

1.5 hrs

Discusses how to build a complete USB driver using the  PL-2301 chipset.
Also discusses the usbnet.o ethernet class driver.

(C) 2006 -  www.atr-labs.com   All Rights Reserved.

Return to Training Programs