Thanks Hans for prompt reply, as always.

I reverse engineered a driver by sniffing USB traffic. The first two things
this driver did was SET_CONFIG and SET_INTERFACE.  My implementation worked
fine under Linux but stumbled onto this (permission) problem on FreeBSD.

However, it seems to work fine if I skip the SET_CONFIG and SET_INTERFACE
calls so I can use my driver as normal user.

Thanks!

On Sat, Sep 13, 2014 at 11:00 PM, Hans Petter Selasky <h...@selasky.org>
wrote:

> On 09/13/14 14:04, Lundberg, Johannes wrote:
>
>> Hi
>>
>> I tried now for hours but no luck with this.. I have a special usb device
>> to which I connect with libusb. Everything works find as root but I can
>> seem to be able to access with normal user no matter how I configure
>> devfs.
>>
>> I changed both conf and rules and even set myself as owner and group and
>> 777 permission to /dev/ugen* /dev/usb and /dev/usb/* but no luck...
>>
>> I can connect to the device and claim interface but then it fails at the
>> first libusb_control_transfer with error -4
>>
>> I have done this before without problems. I am running the newest
>> 11-CURRENT snapshot so could there be any bug that causes this or has
>> anything changed in configurations?
>>
>> Grateful for any advice...
>> --
>> Johannes Lundberg
>>
>>
> Hi,
>
> You only need to "chmod /dev/usb/X.Y.0" .
>
> Some control transfers are always restricted to root user:
>
>         /*
>          * Avoid requests that would damage the bus integrity:
>          */
>         if (((req->bmRequestType == UT_WRITE_DEVICE) &&
>             (req->bRequest == UR_SET_ADDRESS)) ||
>             ((req->bmRequestType == UT_WRITE_DEVICE) &&
>             (req->bRequest == UR_SET_CONFIG)) ||
>             ((req->bmRequestType == UT_WRITE_INTERFACE) &&
>             (req->bRequest == UR_SET_INTERFACE))) {
>                 /*
>                  * These requests can be useful for testing USB drivers.
>                  */
>                 error = priv_check(curthread, PRIV_DRIVER);
>                 if (error) {
>                         return (error);
>                 }
>         }
>
> You need to use their libusb counterpart to avoid problems!
>
> --HPS
>

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
秘密保持について:この電子メールは、名宛人に送信したものであり、秘匿特権の対象となる情報を含んでいます。
もし、名宛人以外の方が受信された場合、このメールの破棄、およびこのメールに関する一切の開示、
複写、配布、その他の利用、または記載内容に基づくいかなる行動もされないようお願い申し上げます。
---
CONFIDENTIALITY NOTE: The information in this email is confidential
and intended solely for the addressee.
Disclosure, copying, distribution or any other action of use of this
email by person other than intended recipient, is prohibited.
If you are not the intended recipient and have received this email in
error, please destroy the original message.
_______________________________________________
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to "freebsd-usb-unsubscr...@freebsd.org"

Reply via email to