From: Greg KH <greg@kroah.com>
To: stefan_kopp@agilent.com
Cc: korgull@home.nl, stern@rowland.harvard.edu, oliver@neukum.org,
linux-usb@vger.kernel.org, me@felipebalbi.com,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] USB: add USB test and measurement class driver - round 2
Date: Fri, 29 Aug 2008 07:39:02 -0700 [thread overview]
Message-ID: <20080829143902.GC18136@kroah.com> (raw)
In-Reply-To: <7D8F552F9FFBAC438A816966BEC4516BFBA328@cos-us-mb07.cos.agilent.com>
On Fri, Aug 29, 2008 at 12:57:54AM -0600, stefan_kopp@agilent.com wrote:
> Hi all,
>
> I haven't been able to follow all the enhancements you did to the
> driver, but I can comment on the ratioale behind the orignal driver.
>
> The original driver used minor number 0 for "driver communication" (in
> contrast to "device communication"). The main purpose was to get a
> list of the USBTMC devices attached by doing a "cat /dev/usbtmc0"
> (which would point to minor number 0). The first device found would
> then use the next free minor number, usually 1. I believe the concept
> of "driver communication" has been removed from the driver, so a
> single minor number for a single device should be it.
cating that file was sending out a text file to userspace that needed to
be parsed, like a /proc file. Now you can just look at all of the
devices in /sys/class/usb/usbtmc* to see all of the different devices in
the system.
> The issue with using cat on the shell level is that it uses fread
> which has the (in this case) ugly behaviour of recalling the driver's
> read method until the full number of characters requested has been
> accumulated (or until zero characters are returned, indicating the end
> of file). With USBTMC instruments, this behavour is bad because the
> retry will not just return zero characters, it will cause a timeout
> with the associated error condition in the device. So, to enable the
> use of echo/cat, I added some fread handling to the driver (which
> catches the retries). I believe this also has been removed, so I
> assume cat/fread will not work (?).
I do not know, but we do not do wierd things in the kernel just because
of broken userspace programs. This logic should be done in userspace,
and programs should look at the return value of read() and handle it
properly. Otherwise it is a bug.
thanks,
greg k-h
next prev parent reply other threads:[~2008-08-29 14:39 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-08-27 17:20 [PATCH] USB: add USB test and measurement class driver - round 2 Greg KH
2008-08-27 18:28 ` Alan Stern
2008-08-27 18:36 ` Greg KH
2008-08-27 18:58 ` Alan Stern
2008-08-27 19:05 ` Oliver Neukum
2008-08-27 19:16 ` Alan Stern
2008-08-27 23:48 ` Greg KH
2008-08-27 23:47 ` Greg KH
2008-08-28 10:10 ` Oliver Neukum
2008-08-28 16:17 ` Greg KH
2008-08-28 21:29 ` Oliver Neukum
2008-08-28 16:58 ` Marcel Janssen
2008-08-28 20:38 ` Greg KH
2008-08-29 6:57 ` stefan_kopp
2008-08-29 7:46 ` Oliver Neukum
2008-08-29 8:14 ` stefan_kopp
2008-08-29 8:34 ` Oliver Neukum
2008-08-29 9:13 ` stefan_kopp
2008-08-29 11:33 ` Oliver Neukum
2008-08-29 14:39 ` Greg KH [this message]
2008-08-29 16:41 ` Marcel Janssen
2008-08-29 20:01 ` Greg KH
2008-08-27 18:37 ` Oliver Neukum
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080829143902.GC18136@kroah.com \
--to=greg@kroah.com \
--cc=korgull@home.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=me@felipebalbi.com \
--cc=oliver@neukum.org \
--cc=stefan_kopp@agilent.com \
--cc=stern@rowland.harvard.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox