-->
Navigation
Bootstrap yourself with Linux-USB Stack, Course Technology PTR

Bootstrap yourself with Linux-USB Stack, Course Technology PTR

Now pay Easier and Secure using Paypal
Price:

Read more

E-books Shop
Bootstrap yourself with Linux-USB Stack

Design, Develop, Debug, and Validate Embedded USB


About the Author
Rajaram Regupathy has more than a decade of experience in designing and
managing embedded and programming tool products. He loves to design and
program new and emerging technology products and has successfully engineered
products based on universal serial bus (USB) from scratch.
A Linux and open source enthusiast, Rajaram has published open source articles for Linux for You and Embedded.com, among others. In his free time, he enjoys watching National Geographic and playing with his daughter.  Rajaram’s Web site (http://www. kernelkahani.com) is a good place to obtain additional resources and get in touch with him.

Introduction
Before starting a new task, you generally do research so you can avoid mistakes. In
the computer realm, bootstrap sessions provide a head start and help you
minimize mistakes and surprises. As an example, to design a protocol stack, build
a bootstrap session so you can understand the protocol specification and the
system on which it is to be developed.
This book discusses how the Linux USB host and device stacks are designed and
how different Linux USB modules export interfaces to pass on information.
Understanding the pains of test development, this book provides comprehensive
coverage of the necessary frameworks available on Linux for USB systems to
effectively debug, test, and interface with USB devices.

Course Technology, a part of Cengage Learning
20 Channel Center Street
Boston, MA 02210
USA
Cengage Learning is a leading provider of customized learning solutions
with office locations around the globe, including Singapore, the United
Kingdom, Australia, Mexico, Brazil, and Japan. Locate your local office at:
Cengage Learning products are represented in Canada by Nelson
Education, Ltd.
For your lifelong learning solutions, visit courseptr.com.
Visit our corporate Web site at cengage.com.

Table of Contents

Introduction
Chapter 1 USB and Linux: Introduction
USB: The Path and the Market . . . . .  . 2
USB Hardware . . . . . . . . . 3
USB Market . . . . . . . .  . 9
Linux USB . . . . . . . . . .. 9
Summary . . . . . . . . .  11
Chapter 2 USB: An Overview
USB System Architecture . . . . 15
USB Host . . . . . .. . 16
USB Device . . . . . . .. . . 18
Communication Flow . . . . . . 19
Endpoints . . . . . . . . . .19
Pipes . . . . . . . . .. . 20
Enumeration . . . . . . . . . . . . 21
Descriptors . . .  . 22
USB Transfers . . . . . . . 24
Control Transfer . . . .. . . . . 24
Bulk Transfer . . . . . . . . 24
Interrupt Transfer . . . . .. . . . 25
Isochronous Transfer . . .  . . 25
Terms to Remember . . . 26
Summary . . . .. . . . . . 26
More Reading . . . .. . . . . . 27
Chapter 3 Overview of the Linux USB Subsystem
Linux USB Host Subsystem . . . . . . . 31
USB HCD Driver Menu . . . . . . . 32
USB Class Driver Menu . . . . . .. 35
Miscellaneous Host Drivers . . . . 40
Linux USB Gadget Subsystem . . . . . . . . 41
Summary . . . . . . . . . . . 47
More Reading . . . . . . . .. 47
PART I USB HOST
Chapter 4 Linux USB Host Driver
Overview of a General USB Host Stack Architecture .  . . 51
Host Software . . . . . . . . . . .  . 52
USB Driver . . . . . . . . . . . 52
HCD . . . . . . . . . . . 53
Overview of Linux USB Host Stack Architecture .  . . . 53
usbcore . . . . . . . . . . 53
Linux USB HCD . . . . . . . . 55
Summary . . . . . . . . . . 55
More Reading . . . . . . .. . . 55
Chapter 5 USB Device Notification
Bootstrap: Notifier Chain . . . . . 58
Linux USB Notification . . . . .  . . . . 60
Writing a Simple USB Notification-Subscriber . .. . 65
Summary . . . . . .. . . . 69
More Reading . . .. . . . 69
Chapter 6 Device File System
Bootstrap Essentials: Virtual File System  . 72
Linux USB Device File System . . . . 76
Creating the Linux USB File System . .. . 80
Summary . . . . . . . . . . 84
More Reading .. . . . . . . 84
Chapter 7 Power Management 
Bootstrap Essentials: Power Management .  . 86
Linux USB Power Management . . . . . 90
Setting Up Linux-USB Power Management . . . . 96
Summary . .  . . . . 100
More Reading .. . . . . . 100
Chapter 8 Hub
Bootstrap Essentials: Linux USB Hub .  . . 102
Linux USB Hub Framework . . . . 105
Summary . . . . . 110
More Reading . . .. 110
Chapter 9 Generic Driver
Bootstrap Essentials: Linux USB Generic Driver .112
Linux USB usbcore-generic Driver Framework . . . . . 119
Developing a USB Device Driver .. . 124
Summary . .  . 127
More Reading . . . . 127
Chapter 10 Host Driver for Embedded Controller
Bootstrap Linux USB HCD . . . . . . 130
Linux USB HCD . .  . . . 134
Sample Implementation of USB HCD .  . 137
Summary .  . . . . . 140
More Reading . . . . . . 140
PART II USB DEVICE
Chapter 11 Linux USB Gadget Driver
Overview of USB Device Stack Architecture . . 143
Device Firmware Driver . . 144
Chapter—9: Driver/USB Device Framework
USB Class Driver . . . . . . . 144
Overview of Linux USB Gadget Driver Architecture .  . . . . 145
USB Controller Driver . . . . 145
Gadget Driver . .. . . 146
Class Driver . .   . . 146
Summary . . . . . 147
More Reading . . . . . 147
Chapter 12 Peripheral Device Controller Driver
Bootstrap Essentials: Platform Driver . 150
Linux USB Peripheral Controller Driver . . 153
USB Device Controller Driver . . . 155
Summary . . . .. . . . 159
More Reading . . . .. . . . 159
Chapter 13 Gadget Driver 
Bootstrap Essentials: Gadget Driver . . 162
USB Gadget Data Structure and Methods . .. . . 162
USB Endpoint Data Structure and Methods . . . . 164
Gadget Driver Data Structure and Methods .. . 168
USB Request Data Structure . . . . 170
Gadget Driver Utility Functions . . . 170
Gadget Driver: Design . . . . . . . . 171
gadget register . . . .  .  . 171
gadget unregister . . . .. . . 172
USB Enumeration . . . . . . . 173
Power Management . . . .  . . 176
OUT Transfer . . . . . . 176
IN Transfer . . . . . . . . . . 178
Gadget Driver: Implementation . . . . . 179
Summary . . . .  . . . 183
More Reading . . . . . 183
Chapter 14 Class Driver
Bootstrap Essentials: Class Drivers .. 187
Class Driver: Design . .. . 190
Simple Composite Class Driver: Loopback  . . . . 194
Summary . . . . . 197
More Reading . . . . 197
PART III USB OTG
Chapter 15 Linux USB OTG Driver
Bootstrap Essentials: OTG Driver . .. 202
OTG Driver Framework . . . 205
OTG Framework: Sample . .  . 208
Summary . . . . . . 211
More Reading . .. . . . 211
PART IV MISCELLANEOUS LINUX USB SUBSYSTEMS 
Chapter 16 USB Virtual File Systems
Overview of usbfs . . . . . . . .. . 216
usbfs: devices File . . . . . 217
Application Based on the devices File . . . . . 220
usbfs: BBB/DDD Files . . . . . . . 222
Overview of sysfs . . . . . . . . 224
Application of sysfs: /sys/bus/usb Files . . . .  . . 227
Overview of gadgetfs . . . . . . 229
Application of gadgetfs: /dev/gadget Files . . . 229
Gadget Debug FS . .  . . . . . 231
Summary . . . . .. . . . . 232
More Reading . .. . . . 232
Chapter 17 User Space USB Drivers
Overview: USB User Mode Drivers . .. . 234
USB User Mode Driver Using libusb . . 235
Utilities Using libusb . . . .. 237
A Simple USB Test Application Using libusb . .. 241
USB User Mode Driver Using UIO . . . . 243
Bootstrap: Linux UIO . . .. . . 243
UIO-Based USB Controller Driver .  . . 246
User Mode Driver Using gadgetfs . . . 249
Summary . . . . . . . 252
More Reading . . . . . . . 253
Chapter 18 Debugging Using Linux USB
USB Monitor: usbmon . . .. . 256
Bootstrap: USB Monitor . .  . . 259
USB Monitor Internals . .. . . 261
How to Use usbmon .. . . 266
Debug Using usbfs_snoop . . .. . . 269
Verbose Debugging for Host-Side USB .  . . . 272
Summary . . . . . 273
More Reading . . . . . 274
Chapter 19 Test Using Linux USB
Linux USB Unit Test Driver . . .. 276
Linux USB Functional Test . . .  279
Storage USB Gadget . . 279
Serial USB Gadget . . .. 281
USB Network Gadget . . . . 283
HID (Human Interface Devices) USB Gadget .. . . 284
Summary . . . . . . . . 285
More Reading .. . . 285
Appendix USB Regression Tool .. . . 287
Overview of USB Regression Tool . .. . . 288
Script Definitions . .  . . . 289
Generic USB Functions .  . . . 289
Utility Functions . . . . . 291
Summary . . . . 292
Index . . . .. . . 293


 Screenshot 

E-book Shop

Purchase Now !
Just with Paypal



Product details
 Price
 File Size
 3,600 KB
 Pages
 321 p
 File Type
 PDF format
 ISBN-13
 ISBN-10
 978-1-4354-5786-7
 1-4354-5786-2
 Copyright
 2012 Course Technology, 
 a part of Cengage Learning  
●▬▬▬▬▬❂❂❂▬▬▬▬▬●
●▬▬❂❂▬▬●
●▬❂▬●


═════ ═════