Click here to learn
about this Sponsor:
Home  |  News  |  Articles  |  Polls  |  Forum

Keywords: Match:
About the new Linux USB Device support
by Stuart Lynne (April 15, 2002)

Lineo has released Linux USB Device software, which was developed to support the Sharp Zaurus Linux PDA, under the GNU GPL open source license. The software can be freely downloaded from Lineo's open source website. This software provides a "stack" which implements USB Devices under Linux.

"But doesn't the Linux kernel (2.4 and later) already contain built-in USB support?", you ask.

Well yes; and no. Read on . . .

One key point to understand about the architecture of USB is that it based on a strict master/slave relationship. On any USB bus, there is a single master, generally referred to as a USB Host, and there can be multiple slaves, generally referred to as USB Devices. The USB support that is present in the currently released Linux kernel implements the USB Host function, only. Therefore, for a device which uses Embedded Linux as it's internal OS to act as a USB Device, new support was required.

A second important point about USB is that it implements a (usually reliable) data transport layer between the USB Host and the various USB Devices that are attached to it. But there is no specific device model, such as a serial or printer port, NIC, CDROM, etc., implemented by USB. Instead each USB Device implements a function that talks to a driver on the USB Host, that knows what the USB Function does (e.g. a serial or printer port, NIC, CDROM, etc.).

The typical way the USB Host implementations do this, under both Windows and Linux, is to seperate the high level protocol handlers into seperate drivers (typically called class or client) that are independant of the actual host interface drivers (usually UHCI or OHCI for most desktop computers).

So what we did was to implement a similar structure on the USB Device side, resulting in something like the following:



Currently you must compile the USB Device stack in the kernel environement. That is, untar the source in linux/drivers and make a couple of minor changes (typically drivers/Makefile and arch/???/config.in). The end result is three modules, typically something like . . .
  • usbdcore.o
  • net_fd.o
  • sa1100_bi.o
. . . which are then loaded to implement what looks like a network interface using USB to connect you to the USB Host.

Currently, there are two available function drivers . . .
  • network
  • serial
And there are bus interface drivers for . . .
  • StrongARM SA1110
  • ScanLogic SL11
  • Linkup L7205
  • Hitachi SH7727
. . . with work in progress to support Xscale and several other platforms.

The data path has been optimized for speed. For example, on a 206Mhz StrongARM (e.g. Sharp Zaurus), it is possible to download (Host to Device) at up to 850Kbytes/sec and upload (Device to Host) at 800Kbytes/sec (urlget over network connection). This is fairly close to the maximum throughput available for transfers using Bulk IO transactions.

For the Embedded developer, the following questions need to be asked . . .
  1. What bus interface driver?
  2. What function driver?
  3. What class driver for Linux?
  4. what class driver for Windows?
If the device already has a bus interface driver implemented, then it should not be difficult to use. However, depending on the device, some adaptation may be required. It may be necessary to support things like detecting when the device is attached to the bus, and controlling when the device enables itself onto the bus. Such functions are not always implemented in the basic USB function hardware.

If the required function driver has been implemented (currently serial and network), then it should work without change. If a new function is required, then it would be implemented as a separate driver module.

Typically, for testing, at least a Linux USB Host Client driver will be required (again, both serial and network compatible client drivers have already been implemented). If a new function is being developed, then a new Linux Host driver may also be required -- unless an existing driver can be used, or modified for use.

Finally, the most difficult (or expensive) decision is, in many ways, determining what to use for a Windows USB Host Client driver. In some cases, it may be possible to use an existing (i.e. provided by Microsoft) driver. But in many cases, if your underlying USB Device hardware does not have enough resources (endpoints, ability to support multiple interfaces), then a custom driver may be required. Commercial USB device drivers exist that can be licensed, or a driver can be implemented from scratch. Unfortunately, few high quality open source drivers for Windows are currently available.




About the author: Stuart Lynne, a Senior Engineer at Lineo Inc., has been a Unix/Linux developer since 1984. He has worked on fax software, web servers, network authentication via radius and LDAP, mail, and imap servers, and network, 802.11 wireless, flash, and USB drivers.


(Click here for further information)


FUEL Database on MontaVista Linux
Whether building a mobile handset, a car navigation system, a package tracking device, or a home entertainment console, developers need capable software systems, including an operating system, development tools, and supporting libraries, to gain maximum benefit from their hardware platform and to meet aggressive time-to-market goals.

Breaking New Ground: The Evolution of Linux Clustering
With a platform comprising a complete Linux distribution, enhanced for clustering, and tailored for HPC, Penguin Computing¿s Scyld Software provides the building blocks for organizations from enterprises to workgroups to deploy, manage, and maintain Linux clusters, regardless of their size.

Data Monitoring with NightStar LX
Unlike ordinary debuggers, NightStar LX doesn¿t leave you stranded in the dark. It¿s more than just a debugger, it¿s a whole suite of integrated diagnostic tools designed for time-critical Linux applications to reduce test time, increase productivity and lower costs. You can debug, monitor, analyze and tune with minimal intrusion, so you see real execution behavior. And that¿s positively illuminating.

Virtualizing Service Provider Networks with Vyatta
This paper highlights Vyatta's unique ability to virtualize networking functions using Vyatta's secure routing software in service provider environments.

High Availability Messaging Solution Using AXIGEN, Heartbeat and DRBD
This white paper discusses a high-availability messaging solution relying on the AXIGEN Mail Server, Heartbeat and DRBD. Solution architecture and implementation, as well as benefits of using AXIGEN for this setup are all presented in detail.

Understanding the Financial Benefits of Open Source
Will open source pay off? Open source is becoming standard within enterprises, often because of cost savings. Find out how much of a financial impact it can have on your organization. Get this methodology and calculator now, compliments of JBoss.

Embedded Hardware and OS Technology Empower PC-Based Platforms
The modern embedded computer is the jack of all trades appearing in many forms.

Data Management for Real-Time Distributed Systems
This paper provides an overview of the network-centric computing model, data distribution services, and distributed data management. It then describes how the SkyBoard integration and synchronization service, coupled with an implementation of the OMG¿s Data Distribution Service (DDS) standard, can be used to create an efficient data distribution, storage, and retrieval system.

7 Advantages of D2D Backup
For decades, tape has been the backup medium of choice. But, now, disk-to-disk (D2D) backup is gaining in favor. Learn why you should make the move in this whitepaper.

 


Got a HOT tip?   please tell us!
Free weekly newsletter
Enter your email...
Click here for a profile of each sponsor:
PLATINUM SPONSORS
GOLD SPONSORS
(Become a sponsor)

ADVERTISEMENT
(Advertise here)

Check out the latest Linux powered...

mobile phones!

other cool
gadgets



BREAKING NEWS

• Netbooks free with cellular contract?
• Linux leads Wind River revenues upwards
• Wind River buys Mizi Research
• Home automation panel runs Poky Linux
• "Green" integrated PC runs Linux
• Intel acquires Linux distro developer
• Linux Space Cube ready for blast-off
• Nettop is "almost fanless"
• Tutorial sounds alarm for Nokia tablets
• CG Linux distro supports multicore MIPS64
• Embedded Linux guide updated
• Patent dispute threatens GPS imports
• MIDs offer Atom, HSDPA
• Software connects Linux MIDs to PC media
• Linux radio keeps it simple


Most popular stories -- past 90 days:
• Open source phone goes mass-market
• Updated! Linux Mobile Phones Showcase
• World's cheapest Linux-based laptop?
• Garmin Nav devices run Gnome Linux
• First Atom-based notebook runs Linux
• ARM9 board boots Debian in 0.69 seconds
• Open source camera records geotagged video to SATA HDD
• Linux-friendly Beagle fetches $150
• "PDA phone" runs Linux
• Intel offers $80 "Little Falls" Atom mobo
• Netflix Player runs Linux


DesktopLinux headlines:
• Summit debuts for Linux end users
• "UbuntuLite" reviewed
• Linux in the SME
• Linux: not yet photo-friendly
• Linux to gain anti-virus software
• Linux gains backup utility
• Testing Lenny
• HP offers Linux on low-end mini-notes
• Dell shipping five Hardy Heron systems
• IBM pushes "Microsoft-free" desktops


Also visit our sister site:


Sign up for LinuxDevices.com's...

news feed

Home  |  News  |  Articles  |  Polls  |  Forum  |  About  |  Contact
 

Ziff Davis Enterprise Home | Contact Us | Advertise | Link to Us | Reprints | Magazine Subscriptions | Newsletters
Tech RSS Feeds | White Papers | ROI Calculators | Tech Podcasts | Tech Video | VARs | Channel News

Baseline | Careers | Channel Insider | CIO Insight | DesktopLinux | DeviceForge | DevSource | eSeminars |
eWEEK | Enterprise Network Security | LinuxDevices | Linux Watch | Microsoft Watch | Mid-market | Networking | PDF Zone |
Publish | Security IT Hub | Strategic Partner | Web Buyer's Guide | Windows for Devices

Developer Shed | Dev Shed | ASP Free | Dev Articles | Dev Hardware | SEO Chat | Tutorialized | Scripts |
Code Walkers | Web Hosters | Dev Mechanic | Dev Archives | igrep

Use of this site is governed by our Terms of Service and Privacy Policy. Except where otherwise specified, the contents of this site are copyright © 1999-2008 Ziff Davis Enterprise Holdings Inc. All Rights Reserved. Reproduction in whole or in part in any form or medium without express written permission of Ziff Davis Enterprise is prohibited. Linux is a registered trademark of Linus Torvalds. All other marks are the property of their respective owners.