<?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/  -->
<rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/' xmlns:media='http://search.yahoo.com/mrss/' xmlns:atom10='http://www.w3.org/2005/Atom'>
<channel>
  <title>usblog</title>
  <link>http://usblog.livejournal.com/</link>
  <description>usblog - LiveJournal.com</description>
  <lastBuildDate>Fri, 20 May 2005 04:05:43 GMT</lastBuildDate>
  <generator>LiveJournal / LiveJournal.com</generator>
  <lj:journal>usblog</lj:journal>
  <lj:journalid>5166019</lj:journalid>
  <lj:journaltype>personal</lj:journaltype>
  <atom10:link rel='hub' href='http://pubsubhubbub.appspot.com/' />
  <image>
    <url>http://l-userpic.livejournal.com/22262398/5166019</url>
    <title>usblog</title>
    <link>http://usblog.livejournal.com/</link>
    <width>86</width>
    <height>49</height>
  </image>

<item>
  <guid isPermaLink='true'>http://usblog.livejournal.com/2981.html</guid>
  <pubDate>Fri, 20 May 2005 04:05:43 GMT</pubDate>
  <title>USB on OLS2005</title>
  <link>http://usblog.livejournal.com/2981.html</link>
  <description>Hello,&lt;br /&gt;&lt;br /&gt;Pete Zaitcev from  Red Hat, Inc., will talk about&lt;br /&gt;&quot;The usbmon: USB monitoring framework&quot; in OLS 2005&lt;br /&gt;see&lt;br /&gt;&lt;a href=&quot;http://www.linuxsymposium.org/2005/speakers.php?types=TALK&quot;&gt;http://www.linuxsymposium.org/2005/speakers.php?types=TALK&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;RRX</description>
  <comments>http://usblog.livejournal.com/2981.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://usblog.livejournal.com/2691.html</guid>
  <pubDate>Thu, 17 Mar 2005 14:55:45 GMT</pubDate>
  <title>A change in Linux Kernel USB api - 2.6.12 kernel</title>
  <link>http://usblog.livejournal.com/2691.html</link>
  <description>Hello, &lt;br /&gt;Haven&apos;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</description>
  <comments>http://usblog.livejournal.com/2691.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://usblog.livejournal.com/2305.html</guid>
  <pubDate>Thu, 10 Feb 2005 14:20:12 GMT</pubDate>
  <title>LDD3 is out ! (a sample chapter on USB is available from Oreilly)</title>
  <link>http://usblog.livejournal.com/2305.html</link>
  <description>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=&quot;http://www.amazon.com/exec/obidos/ASIN/0596005903/ref%3Dnosim/oreillycom-20/002-8086181-9156864&quot;&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=&quot;http://www.oreilly.com/catalog/linuxdrive3&quot;&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</description>
  <comments>http://usblog.livejournal.com/2305.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://usblog.livejournal.com/2248.html</guid>
  <pubDate>Sun, 26 Dec 2004 16:27:02 GMT</pubDate>
  <title>Pete Zaitcev&apos;s blog</title>
  <link>http://usblog.livejournal.com/2248.html</link>
  <description>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=&quot;http://www.livejournal.com/users/zaitcev/&quot;&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=&quot;http://lkml.org/lkml/2004/12/20/40&quot;&gt;http://lkml.org/lkml/2004/12/20/40&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;USBLOG</description>
  <comments>http://usblog.livejournal.com/2248.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>2</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://usblog.livejournal.com/1895.html</guid>
  <pubDate>Thu, 23 Dec 2004 07:33:20 GMT</pubDate>
  <title>USB subsystem 6</title>
  <link>http://usblog.livejournal.com/1895.html</link>
  <description>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&apos;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&apos; hibernate).&lt;br /&gt;see &lt;a href=&quot;http://softwaresuspend.berlios.de/&quot;&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=&quot;http://www2.one-eyed-alien.net/~mdharm/linux-usb/&quot;&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</description>
  <comments>http://usblog.livejournal.com/1895.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://usblog.livejournal.com/1773.html</guid>
  <pubDate>Mon, 06 Dec 2004 08:01:15 GMT</pubDate>
  <title>Video4linux</title>
  <link>http://usblog.livejournal.com/1773.html</link>
  <description>Hello,&lt;br /&gt;&lt;br /&gt;As duke_igthorn noted in his blog, in &lt;br /&gt;&lt;a href=&quot;http://www.livejournal.com/users/usblog/506.html&quot;&gt;http://www.livejournal.com/users/usblog/506.html&lt;/a&gt;,&lt;br /&gt; &quot;With all due respect, combining USB and V4L into one blog does not seem &lt;br /&gt;reasonable.&quot; 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=&quot;http://www.livejournal.com/users/rrx/15216.html&quot;&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</description>
  <comments>http://usblog.livejournal.com/1773.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://usblog.livejournal.com/1472.html</guid>
  <pubDate>Tue, 30 Nov 2004 14:58:01 GMT</pubDate>
  <title>Usb (5):  miscallnous USB topics</title>
  <link>http://usblog.livejournal.com/1472.html</link>
  <description>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;&quot;In drivers/usb/host/Kconfig, (linux 2.6.7) they say:&lt;br /&gt; &lt;br /&gt; 		&quot;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&apos;s&lt;br /&gt; 	  UHCI specification.&quot;&lt;br /&gt; &lt;br /&gt; 		What does ot do more in hardware than Intel&apos;s&lt;br /&gt; 	  UHCI specification ?&quot; &lt;br /&gt;		&lt;br /&gt;		&lt;br /&gt;And the answe I got from  David Brownell was: &lt;br /&gt;&lt;br /&gt;&quot;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.&quot;&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=&quot;http://www.kroah.com/linux-usb/&quot;&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=&quot;http://usbsnoop.sourceforge.net&quot;&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 &quot;usbnet&quot; Driver - David Brownell&lt;br /&gt;  on &lt;a href=&quot;http://www.linux-usb.org/usbnet&quot;&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=&quot;http://libusb.sourceforge.net&quot;&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=&quot;http://www.linuxjournal.com/article/7795&quot;&gt;http://www.linuxjournal.com/article/7795&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;RRX</description>
  <comments>http://usblog.livejournal.com/1472.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://usblog.livejournal.com/1232.html</guid>
  <pubDate>Mon, 29 Nov 2004 14:12:36 GMT</pubDate>
  <title>khubd thread and plugging/unplugging a usb device.</title>
  <link>http://usblog.livejournal.com/1232.html</link>
  <description>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&apos;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 &apos;S&apos;).&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=&quot;http://www.mail-archive.com/linux-usb-devel@lists.sourceforge.net/msg30070.html&quot;&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;&quot;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.&quot;&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=&quot;http://marc.theaimsgroup.com/?l=linux-usb-devel&amp;m=110061842631005&amp;w=2&quot;&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&apos;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&apos;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</description>
  <comments>http://usblog.livejournal.com/1232.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>3</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://usblog.livejournal.com/962.html</guid>
  <pubDate>Sun, 21 Nov 2004 10:54:55 GMT</pubDate>
  <title>USB (3) : Tasklets and deferred work in a video driver</title>
  <link>http://usblog.livejournal.com/962.html</link>
  <description>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=&quot;http://spca50x.sourceforge.net/spca50x.php&quot;&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=&quot;http://spca50x.sourceforge.net/spca50x.php?page=cams&quot;&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&apos;s interesting why a use of tasklets was done here. &lt;br /&gt;Grepping the &quot;media&quot; 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=&quot;http://www.xml.com/ldd/chapter/book/ch09.html&quot;&gt;http://www.xml.com/ldd/chapter/book/ch09.html&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;2) &quot;Introduction to linux device drivers&quot; (a lecture given by Mulix): &lt;br /&gt;&lt;a href=&quot;http://www.mulix.org/lectures/intro_to_linux_device_drivers/intro_linux_device_drivers.pdf&quot;&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=&quot;http://mxhaard.free.fr/sview.html&quot;&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=&quot;http://mxhaard.free.fr/sview.html&quot;&gt;http://mxhaard.free.fr/sview.html&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;USBLOG</description>
  <comments>http://usblog.livejournal.com/962.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>1</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://usblog.livejournal.com/629.html</guid>
  <pubDate>Wed, 17 Nov 2004 08:38:28 GMT</pubDate>
  <title>Linux USB SubSystem (2)</title>
  <link>http://usblog.livejournal.com/629.html</link>
  <description>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 &quot;High Speed&quot; : 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    &quot;Full Speed&quot; 12 Mbit/sec (1.5 MByte/sec)&lt;br /&gt;                                      or - &quot;Low Speed&quot; 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&apos;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=&quot;http://www.linux-usb.org&quot;&gt;http://www.linux-usb.org&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;USeful Information about linux decvice drivers:  &lt;a href=&quot;http://www.qbik.ch/usb/devices&quot;&gt;http://www.qbik.ch/usb/devices&lt;/a&gt; &lt;br /&gt;&lt;br /&gt;&lt;a href=&quot;http://www.usb.org&quot;&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=&quot;http://marc.theaimsgroup.com/?l=linux-usb-users&amp;r=1&amp;w=2&quot;&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=&quot;http://marc.theaimsgroup.com/?l=linux-usb-devel&amp;r=1&amp;w=2&quot;&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 ,&quot;It does more in hardware than Intel&apos;s&lt;br /&gt;	  UHCI specification.&quot;&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=&quot;http://developer.intel.com/technology/usb/uhci11d.htm&quot;&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=&quot;http://www.cypress.com/products/datasheet.cfm?partnum=SL811HS&quot;&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=&quot;http://www.intel.com/design/pca/applicationsprocessors/1111_brf.htm&quot;&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</description>
  <comments>http://usblog.livejournal.com/629.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://usblog.livejournal.com/506.html</guid>
  <pubDate>Tue, 16 Nov 2004 14:12:53 GMT</pubDate>
  <title>Linux USB SubSystem (1)</title>
  <link>http://usblog.livejournal.com/506.html</link>
  <description>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=&quot;http://www.livejournal.com/users/rrx&quot;&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=&quot;http://www.livejournal.com/users/rrx&quot;&gt;http://www.livejournal.com/users/rrx&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;However , &lt;a href=&quot;http://www.livejournal.com/users/rrx&quot;&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&apos;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&apos;s a general bus method ; it&apos;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&apos;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(&quot;usb&quot;) 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=&quot;http://www.kroah.com/linux/talks/ols_2004_kref_talk&quot;&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&apos;s implementation is in /drivers/base/driver.c&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Cheers,&lt;br /&gt;USBLOG</description>
  <comments>http://usblog.livejournal.com/506.html</comments>
  <lj:security>public</lj:security>
  <lj:reply-count>2</lj:reply-count>
</item>
</channel>
</rss>
