<?xml version="1.0" encoding="utf-8"?>
<!-- If you are running a bot please visit this policy page outlining rules you must respect. http://www.livejournal.com/bots/ -->
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:lj="http://www.livejournal.com">
  <id>urn:lj:livejournal.com:atom1:usblog</id>
  <title>usblog</title>
  <subtitle>usblog</subtitle>
  <author>
    <name>usblog</name>
  </author>
  <link rel="alternate" type="text/html" href="http://usblog.livejournal.com/"/>
  <link rel="self" type="text/xml" href="http://usblog.livejournal.com/data/atom"/>
  <updated>2005-05-20T04:05:43Z</updated>
  <lj:journal userid="5166019" username="usblog" type="personal"/>
  <link rel="service.feed" type="application/x.atom+xml" href="http://usblog.livejournal.com/data/atom" title="usblog"/>
  <link rel="hub" href="http://pubsubhubbub.appspot.com/"/>
  <entry>
    <id>urn:lj:livejournal.com:atom1:usblog:2981</id>
    <link rel="alternate" type="text/html" href="http://usblog.livejournal.com/2981.html"/>
    <link rel="self" type="text/xml" href="http://usblog.livejournal.com/data/atom/?itemid=2981"/>
    <title>USB on OLS2005</title>
    <published>2005-05-20T04:05:43Z</published>
    <updated>2005-05-20T04:05:43Z</updated>
    <content type="html">Hello,&lt;br /&gt;&lt;br /&gt;Pete Zaitcev from  Red Hat, Inc., will talk about&lt;br /&gt;"The usbmon: USB monitoring framework" in OLS 2005&lt;br /&gt;see&lt;br /&gt;&lt;a href="http://www.linuxsymposium.org/2005/speakers.php?types=TALK"&gt;http://www.linuxsymposium.org/2005/speakers.php?types=TALK&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;RRX</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:usblog:2691</id>
    <link rel="alternate" type="text/html" href="http://usblog.livejournal.com/2691.html"/>
    <link rel="self" type="text/xml" href="http://usblog.livejournal.com/data/atom/?itemid=2691"/>
    <title>A change in Linux Kernel USB api - 2.6.12 kernel</title>
    <published>2005-03-17T14:55:45Z</published>
    <updated>2005-03-17T14:55:45Z</updated>
    <content type="html">Hello, &lt;br /&gt;Haven't post a blog here for a while; Sorry ; there was some pressure at&lt;br /&gt;work.&lt;br /&gt;There is a little change in Linux Kernel USB api from 2.6.12 kernel.&lt;br /&gt;&lt;br /&gt;In 2 USB methods:&lt;br /&gt;   usb_bulk_msg() and usb_control_msg(),&lt;br /&gt;The timeout parameter value is changed to milliseconds.&lt;br /&gt;&lt;br /&gt;(It was in jiffies in prior kernels).&lt;br /&gt;&lt;br /&gt;Notice that the timeout is in both cases an int,&lt;br /&gt;so the compiler will not shout if you are using &lt;br /&gt;usb drivers which were not fixed according to this &lt;br /&gt;change.&lt;br /&gt;&lt;br /&gt; What will happen if you **DO** try to use such &lt;br /&gt;an unpatched drivers ? well , maybe you can&lt;br /&gt;tell me?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;USBLOG</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:usblog:2305</id>
    <link rel="alternate" type="text/html" href="http://usblog.livejournal.com/2305.html"/>
    <link rel="self" type="text/xml" href="http://usblog.livejournal.com/data/atom/?itemid=2305"/>
    <title>LDD3 is out ! (a sample chapter on USB is available from Oreilly)</title>
    <published>2005-02-10T14:20:12Z</published>
    <updated>2005-02-10T14:20:12Z</updated>
    <content type="html">LDD3 is out !&lt;br /&gt;Hello,&lt;br /&gt;&lt;br /&gt;LDD3 is out !&lt;br /&gt;&lt;br /&gt;A big day is today ; the LDD3 (Linux Device Drivers , 3r edition) is publised and can be bought at&lt;br /&gt;Amazon and other online stores.&lt;br /&gt;&lt;br /&gt;I had ordered it from Amazon;&lt;br /&gt;see&lt;br /&gt;&lt;a href="http://www.amazon.com/exec/obidos/ASIN/0596005903/ref%3Dnosim/oreillycom-20/002-8086181-9156864"&gt;http://www.amazon.com/exec/obidos/ASIN/0596005903/ref%3Dnosim/oreillycom-20/002-8086181-9156864&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I cannot wait till this 636 pages book will come ;&lt;br /&gt;there is a free sample chapter (chapter 13) about USB&lt;br /&gt;which can be downloaded from &lt;a href="http://www.oreilly.com/catalog/linuxdrive3"&gt;http://www.oreilly.com/catalog/linuxdrive3&lt;/a&gt;&lt;br /&gt;I am reading it now; interesting (I assume Greg KH wrote it ? )&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;USBLOG</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:usblog:2248</id>
    <link rel="alternate" type="text/html" href="http://usblog.livejournal.com/2248.html"/>
    <link rel="self" type="text/xml" href="http://usblog.livejournal.com/data/atom/?itemid=2248"/>
    <title>Pete Zaitcev's blog</title>
    <published>2004-12-26T16:27:02Z</published>
    <updated>2004-12-26T16:27:02Z</updated>
    <content type="html">Hello, &lt;br /&gt;&lt;br /&gt;You might find the follwoing blog (of Pete Zaitcev) interesting ; many posts deals with USB:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.livejournal.com/users/zaitcev/"&gt;http://www.livejournal.com/users/zaitcev/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Special interest I found in a posting from &lt;br /&gt;December 20th, 2004&lt;br /&gt;about a usbmon utility he wrote&lt;br /&gt;see also: &lt;a href="http://lkml.org/lkml/2004/12/20/40"&gt;http://lkml.org/lkml/2004/12/20/40&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;USBLOG</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:usblog:1895</id>
    <link rel="alternate" type="text/html" href="http://usblog.livejournal.com/1895.html"/>
    <link rel="self" type="text/xml" href="http://usblog.livejournal.com/data/atom/?itemid=1895"/>
    <title>USB subsystem 6</title>
    <published>2004-12-23T07:33:20Z</published>
    <updated>2004-12-23T07:33:20Z</updated>
    <content type="html">USB subsystem 6 - USB Mass Storage Driver for Linux &lt;br /&gt;&lt;br /&gt;Hello,&lt;br /&gt;&lt;br /&gt;I had some pressure in work so it had been a while since last post. &lt;br /&gt;Sorry about this. I will try to post more often in the near future.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;This driver is for mass storage usb devices, like USB disks and &lt;br /&gt;USB DiskOnKeys, with which I will dill here.All what is below is relevant &lt;br /&gt;to DiskOnKey (but I assume also USB disks behave more or less the &lt;br /&gt;same).&lt;br /&gt;&lt;br /&gt;First , for mounting diskonkey you should run (after creating a &lt;br /&gt;mounting point, let's say /mnt/dok):&lt;br /&gt;&lt;br /&gt;mount /dev/sda /mnt/dok&lt;br /&gt;&lt;br /&gt;(Note that when we mount an IDE  disk it is ususally /dev/hda1 or /dev/hda2  and so on; there are /dev/sda1 till /dev/sda15 special device files; but this is not so impotant).&lt;br /&gt;&lt;br /&gt;The code for USB Mass Storage Driver resides, naturally, under&lt;br /&gt;drivers/usb/storage . &lt;br /&gt;The module name is usb-storage.ko ; it uses SCSI emulation ; we will deal &lt;br /&gt;SCSI emulation in the future.&lt;br /&gt;&lt;br /&gt;The us_data structure (from storage/usb.h)&lt;br /&gt;is probably the most important struct in storage mass storage.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The protocol we use is Transparent SCSI&lt;br /&gt;The transport layer is :  Bulk (corresponds to US_PR_BULK in &lt;br /&gt;usb/transport.h).&lt;br /&gt;&lt;br /&gt;The use of SCSI emulation appears also in ATAPI devices &lt;br /&gt;like CD-RW devices. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;It is a good question why we use this emulation at all. Why not use IDE &lt;br /&gt;interface ? I wonder what is the reason (It does not seems to me related &lt;br /&gt;to the fact that IDE disks are not hot plugged while USB disk can be &lt;br /&gt;hot plugged. )&lt;br /&gt;&lt;br /&gt;The usb_stor_control_thread() is a daemon thread which controls the &lt;br /&gt;usb device.&lt;br /&gt;&lt;br /&gt;It adds the PF_NOFREEZE flag to the current process.&lt;br /&gt;&lt;br /&gt;Aside from in this module, use of PF_NOFREEZE is only in 2 other places under drivers: &lt;br /&gt;&lt;br /&gt;in block/loop.c: &lt;br /&gt;loop_thread(void *data) &lt;br /&gt;&lt;br /&gt;in scsi/scsi_error.c:&lt;br /&gt;scsi_error_handler(void *data)&lt;br /&gt;&lt;br /&gt;The use of PF_NOFREEZE flag is for Swsusp : Software Suspend for Linux&lt;br /&gt;(the Linux equivalent of Windows' hibernate).&lt;br /&gt;see &lt;a href="http://softwaresuspend.berlios.de/"&gt;http://softwaresuspend.berlios.de/&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You can see a little on USB Mass Storage Driver for Linux in &lt;br /&gt;&lt;a href="http://www2.one-eyed-alien.net/~mdharm/linux-usb/"&gt;http://www2.one-eyed-alien.net/~mdharm/linux-usb/&lt;/a&gt; but take in &lt;br /&gt;account that this site was last updated in July 2002.&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;USBLOG</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:usblog:1773</id>
    <link rel="alternate" type="text/html" href="http://usblog.livejournal.com/1773.html"/>
    <link rel="self" type="text/xml" href="http://usblog.livejournal.com/data/atom/?itemid=1773"/>
    <title>Video4linux</title>
    <published>2004-12-06T08:01:15Z</published>
    <updated>2004-12-06T08:01:15Z</updated>
    <content type="html">Hello,&lt;br /&gt;&lt;br /&gt;As duke_igthorn noted in his blog, in &lt;br /&gt;&lt;a href="http://www.livejournal.com/users/usblog/506.html"&gt;http://www.livejournal.com/users/usblog/506.html&lt;/a&gt;,&lt;br /&gt; "With all due respect, combining USB and V4L into one blog does not seem &lt;br /&gt;reasonable." I agree with him. In any case, I had posted &lt;br /&gt;some introductory blog on Video4Linux and Video Apps ; it is in &lt;br /&gt;&lt;a href="http://www.livejournal.com/users/rrx/15216.html"&gt;http://www.livejournal.com/users/rrx/15216.html&lt;/a&gt; in case anyone is interested.&lt;br /&gt;I decided not to post it (and subsequent Video4Linux blogs) here. I will only&lt;br /&gt;mention it in this blog when some vide4linux is posted in RRX blog &lt;br /&gt;(which will not be often), since it may be of interest to some of you.&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;USBLOG</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:usblog:1472</id>
    <link rel="alternate" type="text/html" href="http://usblog.livejournal.com/1472.html"/>
    <link rel="self" type="text/xml" href="http://usblog.livejournal.com/data/atom/?itemid=1472"/>
    <title>Usb (5):  miscallnous USB topics</title>
    <published>2004-11-30T14:58:01Z</published>
    <updated>2004-11-30T14:58:01Z</updated>
    <content type="html">Usb (5):  miscallnous USB topics&lt;br /&gt;&lt;br /&gt;Hello,&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1)&lt;br /&gt;&lt;br /&gt;I got an answer, in usb-devel-group, to my question regarding &lt;br /&gt;the benefits in hardware of OHCI against UHCI (Intel Host Controller) &lt;br /&gt;&lt;br /&gt;The question was . to remind you:&lt;br /&gt;&lt;br /&gt;"In drivers/usb/host/Kconfig, (linux 2.6.7) they say:&lt;br /&gt; &lt;br /&gt; 		"The Open Host Controller Interface (OHCI) is a standard for accessing&lt;br /&gt; 	  USB 1.1 host controller hardware.  It does more in hardware than Intel's&lt;br /&gt; 	  UHCI specification."&lt;br /&gt; &lt;br /&gt; 		What does ot do more in hardware than Intel's&lt;br /&gt; 	  UHCI specification ?" &lt;br /&gt;		&lt;br /&gt;		&lt;br /&gt;And the answe I got from  David Brownell was: &lt;br /&gt;&lt;br /&gt;"One example:  sending a 4 KB buffer takes one TD with OHCI,&lt;br /&gt;covering 64+ packets; with UHCI, each packet takes one TD.&lt;br /&gt;&lt;br /&gt;Another:  OHCI has separate schedules for control, bulk,&lt;br /&gt;and periodic transfers.  UHCI has just one."&lt;br /&gt;&lt;br /&gt;2) USB tools:&lt;br /&gt;&lt;br /&gt;  While working with USB subsystem, I found the following tools helpful:&lt;br /&gt;	&lt;br /&gt;	1) USBVIEW: &lt;br /&gt;	A GTK+ 1.2-based tool written by Greg Kroach Hartman.&lt;br /&gt;  &lt;br /&gt;	see &lt;a href="http://www.kroah.com/linux-usb/"&gt;http://www.kroah.com/linux-usb/&lt;/a&gt;&lt;br /&gt;	&lt;br /&gt;	Enables you to see the cahracteristics of the USB devices. &lt;br /&gt;	&lt;br /&gt;	This tool displays the topography of the devices that &lt;br /&gt;	are plugged into the USB bus on a Linux machine. &lt;br /&gt;	while plugging and unplugging the USB device, this display &lt;br /&gt;	is updated and refreshed in real time.&lt;br /&gt;	&lt;br /&gt;	The source code is available.&lt;br /&gt;	&lt;br /&gt;	&lt;br /&gt;2) &lt;a href="http://usbsnoop.sourceforge.net"&gt;http://usbsnoop.sourceforge.net&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;	   This is somekind of a USB sniffer; runs only on Windows. &lt;br /&gt;		 &lt;br /&gt;		 &lt;br /&gt;		 I also encountered a Project of some student from Scotland who &lt;br /&gt;		 began developinh a Java based USB sniffer , but it seem to me &lt;br /&gt;		 that he abondoned it.&lt;br /&gt;&lt;br /&gt;3) Interesting USB links:		 &lt;br /&gt; &lt;br /&gt;The GNU/Linux "usbnet" Driver - David Brownell&lt;br /&gt;  on &lt;a href="http://www.linux-usb.org/usbnet"&gt;http://www.linux-usb.org/usbnet&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;	&lt;br /&gt;libusb on &lt;a href="http://libusb.sourceforge.net"&gt;http://libusb.sourceforge.net&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;The libusb project aim is to create a library for use by user level &lt;br /&gt;applications to access USB devices regardless of OS.&lt;br /&gt;There is an article in linuxjournal by Greg Kroach Hartman (02/11/2004) &lt;br /&gt;in which he demonstrates use of the libusb: &lt;br /&gt;see &lt;a href="http://www.linuxjournal.com/article/7795"&gt;http://www.linuxjournal.com/article/7795&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;RRX</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:usblog:1232</id>
    <link rel="alternate" type="text/html" href="http://usblog.livejournal.com/1232.html"/>
    <link rel="self" type="text/xml" href="http://usblog.livejournal.com/data/atom/?itemid=1232"/>
    <title>khubd thread and plugging/unplugging a usb device.</title>
    <published>2004-11-29T14:12:36Z</published>
    <updated>2004-11-29T14:12:36Z</updated>
    <content type="html">Hello,&lt;br /&gt;&lt;br /&gt;Usb (4): khubd thread and plugging/unplugging a usb device.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The following text will describe, in short, what happens in the &lt;br /&gt;khubd thread when we plug and unplug a usb device.&lt;br /&gt;&lt;br /&gt;Khubd is a daemon thread. After its creation we call daemonize(), &lt;br /&gt;and the daemonize() blocks all signals (see daemonize implementation in /kernel/exit.c) . &lt;br /&gt;&lt;br /&gt;We want to be able to send a kill signal (SIGKILL) when cleaning up,&lt;br /&gt;so we enable this by calling 	allow_signal(SIGKILL) immediately after &lt;br /&gt;it creation.&lt;br /&gt;&lt;br /&gt;In fact, the only place where we send this signal is usb_hub_cleanup()&lt;br /&gt;(in hub.c) ; and there are only 2 places where there are calls to this methods in the kernel : one is in usb_init() , which is called when we load usbcore, and when we do not succeed in hub initialization ; &lt;br /&gt;and the second is in usb_exit() , when we unload the usbcore module. &lt;br /&gt;(Both are in core/usb.c). (More on what is usbcore is at the end &lt;br /&gt;of this post).&lt;br /&gt;&lt;br /&gt;Usually , when you'll run ps -aux and look at the khubd process, &lt;br /&gt;you will see that it is in a state of sleeping (denoted by the letter 'S').&lt;br /&gt;drivers/usb/core/hub.c is part of usbcore.&lt;br /&gt;&lt;br /&gt;Until recently there was a (little) bug (and maybe there still is?) &lt;br /&gt;in &lt;a href="http://www.mail-archive.com/linux-usb-devel@lists.sourceforge.net/msg30070.html"&gt;http://www.mail-archive.com/linux-usb-devel@lists.sourceforge.net/msg30070.html&lt;/a&gt;&lt;br /&gt;Andrew Morton says:&lt;br /&gt;"I made the mistake of forgetting to unmount the fat filesystem before&lt;br /&gt; unplugging the USB cable from the digital camera.  I then tried to unmount the old mountpoint.  khubd is sitting there chewing 100% CPU and I have a reboot in my near future."&lt;br /&gt;&lt;br /&gt;And James Bottomley says Mike Christie had fixed it and the fix will soon be integrated.&lt;br /&gt;see:&lt;br /&gt;&lt;a href="http://marc.theaimsgroup.com/?l=linux-usb-devel&amp;m=110061842631005&amp;w=2"&gt;http://marc.theaimsgroup.com/?l=linux-usb-devel&amp;m=110061842631005&amp;w=2&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Plugging a USB device:&lt;br /&gt;&lt;br /&gt;When we plug in a usb device (like a USB webcam) into the USB port, &lt;br /&gt;the hardware initiates an interrupt; we reach the hub_irq() method.&lt;br /&gt;the hub data (struct usb_hub) is passed to the hub_irq() method as &lt;br /&gt;part of the urb (the context member of struct urb). &lt;br /&gt;&lt;br /&gt;There is a global list of hub events(called hub_event_list);&lt;br /&gt;if this list is empty we add event to this list, so that the khubd thread &lt;br /&gt;will handle it.&lt;br /&gt;&lt;br /&gt;We also call wake_up(&amp;khubd_wait);&lt;br /&gt;since the khubd is in a waiting status. Waking up causes us to call hub_events().&lt;br /&gt;&lt;br /&gt;We also reach the host controller irq (for example, I am working with &lt;br /&gt;ohci and I reach ohci_irq() ) (More on it in the future).&lt;br /&gt;&lt;br /&gt;We delete the hub from the event list in hub_events(). &lt;br /&gt;&lt;br /&gt;(The hub driver writers admit that restarting the list every time to avoid a deadlock with deleting hubs downstream from this current hub is bot the most efficient , but it's safe).&lt;br /&gt;&lt;br /&gt;Unplugging a USB device:&lt;br /&gt;&lt;br /&gt;When we unplug a USB device (like a webcam) out from it USB port,&lt;br /&gt;the process described earlier is repeated until &lt;br /&gt;we reach hub_events(); there we call hub_port_connect_change() method (implemented in hub.c).&lt;br /&gt;The second parameter of this method is the port number,&lt;br /&gt;So this method disconnect any existing devices under this port, &lt;br /&gt;by calling usb_disconnect(); usb_disconnect(struct usb_device **pdev) is also a usbcore method ,implementation usb.c.&lt;br /&gt;&lt;br /&gt;The usb_disconnect() calls usb_disable_device() which disable all the &lt;br /&gt;endpoints for a USB device.&lt;br /&gt;&lt;br /&gt;It also removes that USB device endpoints from under /proc/bus/usb/devices by calling usbfs_remove_device(dev);&lt;br /&gt;&lt;br /&gt;NOTE: hub_disconnect() is NOT called in this process !! &lt;br /&gt;hub_disconnect() is called when we perform rmmod ohci_hcd , when working with ohci, for example. It is also called in the probing process (in boot); more specifically,hub_probe() calls hub_disconnect() as it's last step,before returning.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;And finally,in short, what is usbcore composed of? &lt;br /&gt;&lt;br /&gt;The 9 mandatory ingredients of the USBCORE are:&lt;br /&gt;usb.c,hub.c,hcd.c, urb.c, message.c ,config.c, file.c, buffer.c and sysfs.c.&lt;br /&gt;&lt;br /&gt;If , when configuring th kernel , you set CONFIG_USB_DEVICEFS to y, add 3 to it:&lt;br /&gt;devio.c inode.c and devices.c.&lt;br /&gt;&lt;br /&gt;(the inode.c implements the usbfs ; it has a call &lt;br /&gt;to register_filesystem of the usbfs file system).&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Note: &lt;br /&gt;&lt;br /&gt;The entries under /sys/usb/usb/drivers/hub &lt;br /&gt;are NOT removed when REMOVED after unplugging a device.&lt;br /&gt;They are removed , for example , after rmmod ohci_hcd. (&lt;br /&gt;assuming that you work with ohci_hcd .)&lt;br /&gt;More on it in the future. &lt;br /&gt;&lt;br /&gt;This text is based on 2.67 kernel.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;USBLOG</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:usblog:962</id>
    <link rel="alternate" type="text/html" href="http://usblog.livejournal.com/962.html"/>
    <link rel="self" type="text/xml" href="http://usblog.livejournal.com/data/atom/?itemid=962"/>
    <title>USB (3) : Tasklets and deferred work in a video driver</title>
    <published>2004-11-21T10:54:55Z</published>
    <updated>2004-11-21T10:54:55Z</updated>
    <content type="html">Hello,&lt;br /&gt;&lt;br /&gt;I came to know today with a new driver,SPCA.&lt;br /&gt;&lt;br /&gt;SPCA driver is a LINUX USB webcam driver. &lt;br /&gt;see &lt;a href="http://spca50x.sourceforge.net/spca50x.php"&gt;http://spca50x.sourceforge.net/spca50x.php&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;According to the web site, it supports 77 types of WebCams &lt;br /&gt;see &lt;a href="http://spca50x.sourceforge.net/spca50x.php?page=cams"&gt;http://spca50x.sourceforge.net/spca50x.php?page=cams&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;I had tested it on a camera not from the list, and it was OK.&lt;br /&gt;&lt;br /&gt;This is the *FIRST* Linux USB webcam driver I know which &lt;br /&gt;uses tasklets (deferred execution,bottom handlers).&lt;br /&gt;It's interesting why a use of tasklets was done here. &lt;br /&gt;Grepping the "media" subtree of USB in the kernel for tasklets gives 0 results.&lt;br /&gt;(that media subtree is where the video drivers reside)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For more info on takslets and deferring work see : &lt;br /&gt;&lt;br /&gt;1) Tasklets and Bottom-Half Processing in Chapter 9  &lt;br /&gt;(Interrupt Handling of Linux Device Drivers) of Linux Device Drivers book.  &lt;br /&gt;also online:&lt;br /&gt;&lt;a href="http://www.xml.com/ldd/chapter/book/ch09.html"&gt;http://www.xml.com/ldd/chapter/book/ch09.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;2) "Introduction to linux device drivers" (a lecture given by Mulix): &lt;br /&gt;&lt;a href="http://www.mulix.org/lectures/intro_to_linux_device_drivers/intro_linux_device_drivers.pdf"&gt;http://www.mulix.org/lectures/intro_to_linux_device_drivers/intro_linux_device_drivers.pdf&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Tasklets or not, It still also uses completion handlers for urb messages.&lt;br /&gt;As you can see , this driver was based on Omnivision OV511 driver&lt;br /&gt;see &lt;a href="http://mxhaard.free.fr/sview.html"&gt;http://mxhaard.free.fr/sview.html&lt;/a&gt;. &lt;br /&gt;However, ov5111.c does not contain tasklets.&lt;br /&gt;&lt;br /&gt;There are also tools for this driver (including a grabber and an &lt;br /&gt;SDL player)&lt;br /&gt;see &lt;br /&gt;SpcaView &amp; SpcaTools Howto by Michel Xhaard in  &lt;br /&gt;&lt;a href="http://mxhaard.free.fr/sview.html"&gt;http://mxhaard.free.fr/sview.html&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;USBLOG</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:usblog:629</id>
    <link rel="alternate" type="text/html" href="http://usblog.livejournal.com/629.html"/>
    <link rel="self" type="text/xml" href="http://usblog.livejournal.com/data/atom/?itemid=629"/>
    <title>Linux USB SubSystem (2)</title>
    <published>2004-11-17T08:38:28Z</published>
    <updated>2004-11-17T08:38:28Z</updated>
    <content type="html">Hello,&lt;br /&gt;&lt;br /&gt;Linux USB SubSystem (2)&lt;br /&gt;--------------------------&lt;br /&gt;&lt;br /&gt;The following text is based on 2.67 kernel.&lt;br /&gt;I assume that the current posting was better to be &lt;br /&gt;the first in the USB SubSystem series since it &lt;br /&gt;is better as an introduction. I apologize on &lt;br /&gt;that.&lt;br /&gt;&lt;br /&gt;The most important header files which define the USB interface  &lt;br /&gt;are include/linux/usb.h and include/linux/usb_ch9.h.  &lt;br /&gt;&lt;br /&gt;The header file called usb_ch9.h&lt;br /&gt;hold constants and structures for usb.&lt;br /&gt;The name came from chapter 9 of the USB 2.0 specification.&lt;br /&gt;&lt;br /&gt;There are 2 specs for USB: 2.0 and 1.1.&lt;br /&gt;&lt;br /&gt;We have USB 2.0 , which operates at "High Speed" : 60 Mbyte/sec (480 Mbit/sec) &lt;br /&gt;(40 times faster than USB full speed),&lt;br /&gt;&lt;br /&gt;and USB 1.1 ,which operates at    "Full Speed" 12 Mbit/sec (1.5 MByte/sec)&lt;br /&gt;                                      or - "Low Speed" 1.5 Mbit/sec&lt;br /&gt;&lt;br /&gt;The USB_SPEED_LOW,USB_SPEED_FULL, and USB_SPEED_HIGH (usb 2.0) are defined in &lt;br /&gt;usb_ch9.h. You'll encounter them in the USB sources (but not to much). &lt;br /&gt;	&lt;br /&gt;When you connect High speed devices to USB 1.1 systems , &lt;br /&gt;they slow down to USB 1.1 speeds. &lt;br /&gt;&lt;br /&gt;The USB subsystem is based on message passing transactions.&lt;br /&gt;The messages are called URB. &lt;br /&gt;URB stands for USB Request Block.&lt;br /&gt;you send URBS by calling usb_submit_urb(struct urb *urb, int mem_flags); &lt;br /&gt;This is ans asynchronous calls; it returns immediately. The URB is put &lt;br /&gt;in a queue; later, it reaches a completion handler; the completion &lt;br /&gt;handler is 	a member of the URB structure , called complete (a pointer &lt;br /&gt;to a function). &lt;br /&gt;In the completion handler, you can check the urb-&amp;gt;status&lt;br /&gt;for errors. &lt;br /&gt;&lt;br /&gt;You can cancel pending requests by using usb_unlink_urb().&lt;br /&gt;URBs are allocated by calling usb_alloc_urb() ; &lt;br /&gt;they are freed with a call to usb_free_urb().&lt;br /&gt;&lt;br /&gt;There are 3 helper method which help to fill URBs: &lt;br /&gt;usb_fill_control_urb() (control_urb)&lt;br /&gt;usb_fill_bulk_urb      (bulk urb)&lt;br /&gt;usb_fill_int_urb       (interrupt urb)&lt;br /&gt;&lt;br /&gt;More on completion handlers and submitting URBs in the future.&lt;br /&gt;&lt;br /&gt;There are 4 types of transfers:&lt;br /&gt;Control transfers , bulk transfers,&lt;br /&gt;interrupt transfers transfers, &lt;br /&gt;and High Speed Isochronous (ISO) transfer. &lt;br /&gt;&lt;br /&gt;Usually USB WebCams use ISO transfer. You can rarely &lt;br /&gt;find use of bulk transfers in USB WebCams. &lt;br /&gt;&lt;br /&gt;The URB struct resides in usb.h.&lt;br /&gt;&lt;br /&gt;																			&lt;br /&gt;Links:&lt;br /&gt;&lt;br /&gt;Maybe this link should be termed : the USB portal: &lt;a href="http://www.linux-usb.org"&gt;http://www.linux-usb.org&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;USeful Information about linux decvice drivers:  &lt;a href="http://www.qbik.ch/usb/devices"&gt;http://www.qbik.ch/usb/devices&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;&lt;a href="http://www.usb.org"&gt;http://www.usb.org&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;mailing lists:&lt;br /&gt;linux-usb-users archive : &lt;a href="http://marc.theaimsgroup.com/?l=linux-usb-users&amp;r=1&amp;w=2"&gt;http://marc.theaimsgroup.com/?l=linux-usb-users&amp;r=1&amp;w=2&lt;/a&gt;&lt;br /&gt;linux-usb-develepoer archive: &lt;a href="http://marc.theaimsgroup.com/?l=linux-usb-devel&amp;r=1&amp;w=2"&gt;http://marc.theaimsgroup.com/?l=linux-usb-devel&amp;r=1&amp;w=2&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;USB Host Controlleres: &lt;br /&gt;========================&lt;br /&gt;In the kernel source tree (under /drivers/usb/host)&lt;br /&gt;, you will find 5 types of USB Host Controlleres:&lt;br /&gt;&lt;br /&gt;1) ehci - for USB2.0. &lt;br /&gt;   ehci stands for : Enhanced Host Controller Interface.&lt;br /&gt;	 &lt;br /&gt;&lt;br /&gt;2) ohci -  implements OpenHCI -- Open Host Controller Interface&lt;br /&gt;According to /usb/host/Kconfig ,"It does more in hardware than Intel's&lt;br /&gt;	  UHCI specification."&lt;br /&gt;		TODO: find out more details (what exactly it does more).&lt;br /&gt;		&lt;br /&gt;3) uhci - Universal Host Controller Interface&lt;br /&gt;The Linux kernel maintainer of usb-uhci is  Alan Stern&lt;br /&gt;It is originated from Intel: &lt;br /&gt;see &lt;a href="http://developer.intel.com/technology/usb/uhci11d.htm"&gt;http://developer.intel.com/technology/usb/uhci11d.htm&lt;/a&gt;&lt;br /&gt;Usually boards with Intel PCI chipsets use this standard.&lt;br /&gt;&lt;br /&gt;4) sl811 host controller: &lt;br /&gt;manufactured by cypress.&lt;br /&gt;&lt;a href="http://www.cypress.com/products/datasheet.cfm?partnum=SL811HS"&gt;http://www.cypress.com/products/datasheet.cfm?partnum=SL811HS&lt;/a&gt;&lt;br /&gt;(has 256 bytes Internal SRAM buffer).&lt;br /&gt;&lt;br /&gt;5)SA-1111 host controller:&lt;br /&gt;&lt;a href="http://www.intel.com/design/pca/applicationsprocessors/1111_brf.htm"&gt;http://www.intel.com/design/pca/applicationsprocessors/1111_brf.htm&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;You can find the drivers for theses controllers under &lt;br /&gt;/drivers/usb/host (sometimes they are referred to HCD = Host Controller Driver). &lt;br /&gt;&lt;br /&gt;You are welocamed to question/ask/remark eahtecer you think.&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;RRX</content>
  </entry>
  <entry>
    <id>urn:lj:livejournal.com:atom1:usblog:506</id>
    <link rel="alternate" type="text/html" href="http://usblog.livejournal.com/506.html"/>
    <link rel="self" type="text/xml" href="http://usblog.livejournal.com/data/atom/?itemid=506"/>
    <title>Linux USB SubSystem (1)</title>
    <published>2004-11-16T14:12:53Z</published>
    <updated>2004-11-16T14:12:53Z</updated>
    <content type="html">Hello, &lt;br /&gt;&lt;br /&gt;This blog is soleley dedicated for USB susbsystem and Video4Linux applications&lt;br /&gt;and drivers. &lt;br /&gt;&lt;br /&gt;The posting in this blog are taken from &lt;br /&gt;&lt;a href="http://www.livejournal.com/users/rrx"&gt;http://www.livejournal.com/users/rrx&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;(I am rrx and I an researching the Linux USB susbsystem with &lt;br /&gt;empasis on Video4Linux). &lt;br /&gt;&lt;br /&gt;I intend to add postings here regarding this &lt;br /&gt;issues quite soon. Stay tuned.&lt;br /&gt;These postings will appear here and also in &lt;br /&gt;&lt;a href="http://www.livejournal.com/users/rrx"&gt;http://www.livejournal.com/users/rrx&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;However , &lt;a href="http://www.livejournal.com/users/rrx"&gt;http://www.livejournal.com/users/rrx&lt;/a&gt; is &lt;br /&gt;a general blog , and it d&lt;br /&gt;deals also with other matters (mainly Linux programming,kernel,gcc,&lt;br /&gt;and other goodies). &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;There are 2 reasons for that:&lt;br /&gt;&lt;br /&gt;1) To dedicate one blog for this issue.&lt;br /&gt;&lt;br /&gt;2) To ease finding it using search engines.&lt;br /&gt;&lt;br /&gt;I hope linux community will find this blog helpful &lt;br /&gt;and enjoy it. &lt;br /&gt;&lt;br /&gt;You are invited to  comment / question / remark.&lt;br /&gt;&lt;br /&gt;the following post is from Sunday, November 14th, 2004:&lt;br /&gt;&lt;br /&gt;Linux USB SubSystem (1) : &lt;br /&gt;usb_init() &lt;br /&gt;&lt;br /&gt;The following text is based on 2.67 kernel.&lt;br /&gt;So what do we have in the usb initialization? &lt;br /&gt;Let's have a look at usb_init() in inode.c (/drivers/usb/core/usb.c):&lt;br /&gt;&lt;br /&gt;We call 6 initialization routines: only 3 of them are &lt;br /&gt;part of the sub subsystem.&lt;br /&gt;&lt;br /&gt;1) bus_register(&amp;usb_bus_type);&lt;br /&gt;The bus_register() method is not a part of the USB subsystem. &lt;br /&gt;It's a general bus method ; it's implementation is in /drivers/base/bus.c.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;2)usb_host_init(); calls class_register(); again ,this is not a part of the &lt;br /&gt;USB subsystem. It's implementation is in /drivers/base/class.c&lt;br /&gt;&lt;br /&gt;3)usb_major_init();&lt;br /&gt;&lt;br /&gt;This calls register_chre_dev(); The MAJOR number of USB is 180.&lt;br /&gt;and also devfs_mk_dir("usb") and class_register(). &lt;br /&gt;&lt;br /&gt;All entries under /dev/usb have major number 180 (except &lt;br /&gt;/dev/ttyUSB* , which have major number 188).&lt;br /&gt;&lt;br /&gt;the call to class_register() is relatively new (It did not exist &lt;br /&gt;in 2.4 kernel). We should not be surprised; Greg Kroach Hartman, which &lt;br /&gt;is the maintainer of usb subsystem, is also deeply involved &lt;br /&gt;in the new device model (see for example his &lt;br /&gt;talk in OLS2004 kobjects and krefs - Lockless Reference Counting for Kernel &lt;br /&gt;Structure&lt;br /&gt;(&lt;a href="http://www.kroah.com/linux/talks/ols_2004_kref_talk"&gt;http://www.kroah.com/linux/talks/ols_2004_kref_talk&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;4) usbfs_init(); usually, in most distros , the usbfs (which is &lt;br /&gt;also called usbdevfs) , is mounted under /proc/bus.&lt;br /&gt;(Needless to say: This of course can be changed by issuing umount and then mount &lt;br /&gt;on a different mounting point,or changing /etc/fstab).&lt;br /&gt;&lt;br /&gt;This is a filesystem which resembles in some ways ordinary file systems &lt;br /&gt;like etxt3 or xfs; what I mean is that you call register_filesystem() &lt;br /&gt;(in /drivers/usb/core/inode.c) in order to register the filesystem. &lt;br /&gt;And you pass a pointer to file_system_type. &lt;br /&gt;&lt;br /&gt;The usbfs is responsible for creating and updating the devices file&lt;br /&gt;(/proc/bus/usb/devices). &lt;br /&gt;The devices file is updated dynamically; if you insert a webcam , (or any other &lt;br /&gt;USB device), and run cat /proc/bus/usb/devices , you will find that some &lt;br /&gt;configuration entries were added to the devices file.If you will remove the &lt;br /&gt;webcam and run cat /proc/bus/usb/devices, you will find that these devices were&lt;br /&gt;removed from the devices file.&lt;br /&gt;&lt;br /&gt;Creating the devices file is done, eventually,by calling regular &lt;br /&gt;filesystem methods (like d_instantiate() and dget () from dcache.c).&lt;br /&gt;More on it in the future.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;5) usb_hub_init(): creates a kernel daemon thread named khubd.&lt;br /&gt;(implenentation in /drivers/usb/core/hub.c).&lt;br /&gt;The khubd thread is responsible for configuring devices.&lt;br /&gt;More on it in the future.&lt;br /&gt;&lt;br /&gt;6) driver_register();&lt;br /&gt;This method is again not a part of the &lt;br /&gt;USB subsystem. It's implementation is in /drivers/base/driver.c&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;USBLOG</content>
  </entry>
</feed>
