Re: [Libusbx-devel] libusbx-devel Digest, Vol 8, Issue 39

2012-10-31 Thread 付帅兵
I  can`t  do with  the  URB_GET_MS_FEATURE_DESCRIPTOR  packet  on linux 2.6.30! 





From: libusbx-devel-request
Date: 2012-10-31 16:26
To: libusbx-devel
Subject: libusbx-devel Digest, Vol 8, Issue 39
Send libusbx-devel mailing list submissions to
libusbx-devel@lists.sourceforge.net

To subscribe or unsubscribe via the World Wide Web, visit
https://lists.sourceforge.net/lists/listinfo/libusbx-devel
or, via email, send a message with subject or body 'help' to
libusbx-devel-requ...@lists.sourceforge.net

You can reach the person managing the list at
libusbx-devel-ow...@lists.sourceforge.net

When replying, please edit your Subject line so it is more specific
than Re: Contents of libusbx-devel digest...


Today's Topics:

   1. Questions about libusb on OS X (Sven K?hler)
   2. Re: Questions about libusb on OS X (Xiaofan Chen)
   3. Re: Example udev rules file (Xiaofan Chen)
   4. Re: Example udev rules file (Xiaofan Chen)
   5. Re: Building git code on Mac; CMake support? (Xiaofan Chen)
   6. Re: Example udev rules file (David Grant)
   7. Re: Building git code on Mac; CMake support? (Ludovic Rousseau)


--

Message: 1
Date: Wed, 31 Oct 2012 00:41:23 +0100
From: Sven K?hler sven.koeh...@gmail.com
Subject: [Libusbx-devel] Questions about libusb on OS X
To: libusbx-devel@lists.sourceforge.net
Message-ID: k6poiu$pmp$1...@ger.gmane.org
Content-Type: text/plain; charset=ISO-8859-15

Hi,

I'm a developer of the leJOS open source project. We're currently
looking for new ways for talking to USB devices. On Linux, we already
use libusb with great success (however, port to libusb 1.0 and libusbx
is pending). Some issues remain, like the one with
libusb_detach_kernel_driver, which cannot be used reliably. (Explanation
below)

Now on OS X, we need to talk to USB devices. A driver for these devices
might already be installed. So that would probably need to be detached.
Furthermore, the program that uses libusb is not running with elevated
rights. it must be possible for a normal user to talk to these devices
without having any special priviledges.

Now on Linux, most of that is straight forward. In order to grant users
access to certain devices, users are added to certain group and the
matching udev rules are create. What would be the equivalent of that on
OS X?

Now detaching an already active driver is the next problem. On Linux,
libusb_detach_kernel_driver is implement. Well, it suffers from a pretty
annoying issue: libusb can detach libusb. Or as far as I understand: if
libusb detaches a driver, it puts some kind of general driver in
charge of the device. And if another process calls
libusb_detach_kernel_driver, then this general driver is detached which
kills the connection to the device for the process which is already
talking to that device. And of course first getting the name of the
attached driver, and then detaching it depending on the name gives birth
to a race condition.
When I mentioned that issue, it was thrown at me, that I should perform
external synchronization. You know, like with serial devices, which you
don't open unless you have locked a certain lock file. Now what's the
default location of the lock files for USB devices?
(Yes, I know that it doesn't exist. It's sarcasm.)

Does a similar issue exist for OS X? I mean if detaching a driver is
possible at all?

Now device I'm talking about is the Lego NXT. Most of the time, it's
some not very specific USB device that doesn't implement any special
profile. But sometimes (in firmware update mode), it claims to be a
cdc_acm device. I believe the driver by Lego handles the device in both
modes.



Regards,
  Sven





--

Message: 2
Date: Wed, 31 Oct 2012 09:14:15 +0800
From: Xiaofan Chen xiaof...@gmail.com
Subject: Re: [Libusbx-devel] Questions about libusb on OS X
To: libusbx-devel@lists.sourceforge.net
Message-ID:
CAGjSPUDTfXSJCVGKsb3HpyUS9=45kvfpqjb+nymdp9p862d...@mail.gmail.com
Content-Type: text/plain; charset=ISO-8859-1

On Wed, Oct 31, 2012 at 7:41 AM, Sven K?hler sven.koeh...@gmail.com wrote:

 Now on OS X, we need to talk to USB devices. A driver for these devices
 might already be installed. So that would probably need to be detached.
 Furthermore, the program that uses libusb is not running with elevated
 rights. it must be possible for a normal user to talk to these devices
 without having any special privileges.

I do not see any problems with privileges under either Mac OS X or
Windows. On the other hand, driver detaching is a big problem for
Windows and even more troublesome under Mac OS X.

 Now on Linux, most of that is straight forward. In order to grant users
 access to certain devices, users are added to certain group and the
 matching udev rules are create. What would be the equivalent of that on
 OS X?

No need to do anything with regard to this point.

 Now detaching an already active driver is the next problem. On Linux,
 

Re: [Libusbx-devel] libusbx-devel Digest, Vol 8, Issue 39

2012-10-31 Thread Xiaofan Chen
On Thu, Nov 1, 2012 at 11:03 AM, 付帅兵 fushuaib...@centerm.com.cn wrote:
 I  can`t  do with  the  URB_GET_MS_FEATURE_DESCRIPTOR  packet  on linux
 2.6.30!

Firstly please trim your email and use a proper subject.

Secondly why is this related to libusbx? You may want to ask
in the linux-usb mailing list.


-- 
Xiaofan

--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
___
libusbx-devel mailing list
libusbx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libusbx-devel