From: Greg KH <greg@kroah.com>
To: David Lopez <dave.l.lopez@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-usb-devel@lists.sourceforge.net
Subject: Re: [PATCH] USB: add driver for LabJack USB DAQ devices
Date: Fri, 1 Dec 2006 23:48:26 -0800 [thread overview]
Message-ID: <20061202074825.GA15982@kroah.com> (raw)
In-Reply-To: <571a92f0612011612w13409d7u792b5afc20cc3e98@mail.gmail.com>
On Fri, Dec 01, 2006 at 05:12:56PM -0700, David Lopez wrote:
> On 12/1/06, Greg KH <greg@kroah.com> wrote:
> >On Fri, Dec 01, 2006 at 01:37:22PM -0700, David Lopez wrote:
> >> From: David Lopez <dave.l.lopez@gmail.com>
> >
>
> >The patch seems linewrapped, which doesn't make it easy to apply :(
> >
> >Can you resend this?
>
> Sorry about that. Is it ok to send the patch as an attachment? It
> seems like gmail likes to linewrap plain text. Also, when I resend
> the patch after a little fixing should I send it as a reply.
A plain text attachment should work.
> >> + /* Gets the Product ID for the device */
> >> + case IOCTL_LJ_GET_PRODUCT_ID:
> >> + retval = put_user(dev->udev->descriptor.idProduct,
> >> + (unsigned int __user
> >*)arg);
> >> + break;
> >
> >You can get this from sysfs or usbfs today. Don't duplicate it please.
>
> I didn't look at sysfs or usbfs. I just needed a way to determine the
> device from a device node in /dev from user space, and it seemed easy
> to use ioctl.
Ok, but as there are other ways to get this information, can you take it
out please?
> >> + /* Sets the bulk in endpoint for the next read from an
> >> integer argument.
> >> + * There are two bulk endpoints, which are endpoints 0 and
> >1
> >> when
> >> + * setting the integer argument. */
> >> + case IOCTL_LJ_SET_BULK_IN_ENDPOINT:
> >> + data = (void __user *) arg;
> >> + if (data == NULL)
> >> + break;
> >> +
> >> + if (copy_from_user(&ep, data, sizeof(int))) {
> >> + retval = -EFAULT;
> >> + break;
> >> + }
> >> +
> >> + if(ep > N_BULK_IN_ENDPOINTS || ep < 0)
> >> + retval = -EINVAL;
> >> + else
> >> + dev->next_bulk_in_endpoint = ep;
> >> + break;
> >
> >Why is this needed?
>
> The devices have a stream mode which can only be read from the second
> bulk in endpoint. All other communications are done from the first
> bulk in and bulk out endpoints, and I needed some way to indicate that
> the the next read should be from second bulk in endpoint keeping in
> mind that first bulk in endpoint can still be used. Is there a better
> way to do this?
Can you just create a new device node for the second endpoint? That way
your userspace tools don't have to toggle anything, and it might make
things for users simpler. Just use the second device node to read from
the endpoint used for streaming. Writing on it might not need to do
anything (or you could tie the write into the single out endpoint,
that's up to you.)
Would that work?
thanks,
greg k-h
next prev parent reply other threads:[~2006-12-02 7:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-01 20:37 [PATCH] USB: add driver for LabJack USB DAQ devices David Lopez
2006-12-01 21:18 ` Greg KH
2006-12-02 0:12 ` David Lopez
2006-12-02 7:48 ` Greg KH [this message]
2006-12-02 19:51 ` David Lopez
2006-12-02 12:52 ` Pavel Machek
2006-12-02 18:33 ` David Lopez
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=20061202074825.GA15982@kroah.com \
--to=greg@kroah.com \
--cc=dave.l.lopez@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb-devel@lists.sourceforge.net \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.