Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Jun 2020 17:56:14 +0200
From:      Tomasz CEDRO <tomek@cedro.info>
To:        Jan Behrens <jbe-mlist@magnetkern.de>
Cc:        Hans Petter Selasky <hps@selasky.org>, CeDeROM <cederom@tlen.pl>,  "freebsd-usb@FreeBSD.org" <freebsd-usb@freebsd.org>
Subject:   Re: USB reset fails when using a LimeSDR Mini on FreeBSD
Message-ID:  <CAM8r67AF%2BfGiqBr9A0863Za_zR-fG1FxGfNAqEvvafW=wTRmyQ@mail.gmail.com>
In-Reply-To: <20200626172851.872f3a08fa6e632666683230@magnetkern.de>
References:  <20200625121052.e9f7e7cbeb68fad264ec80a9@magnetkern.de> <CAM8r67DFFeFCHMh6mAxw=x2LKYnFGwasOLgceo-EQSMOvMHbeg@mail.gmail.com> <20200625200849.6af81489a80c2f97d4f89ee6@magnetkern.de> <CAM8r67AE1K9AK%2BaL4RCn6_BWajvzKO7K99bYZMdH0mr-HQdyGw@mail.gmail.com> <20200625224522.44d6584465cb6e20d17be320@magnetkern.de> <0ec3e5a3-7f31-d1cd-6862-6066c431aa80@selasky.org> <20200626135151.e5542cf97fad213c4ad661f2@magnetkern.de> <5c0729f9-9e98-52f7-a5cb-6c5dfd2287a3@selasky.org> <20200626172851.872f3a08fa6e632666683230@magnetkern.de>

next in thread | previous in thread | raw e-mail | index | archive | help
pt., 26 cze 2020, 17:28 u=C5=BCytkownik Jan Behrens <jbe-mlist@magnetkern.d=
e>
napisa=C5=82:

> Does this mean that depending on the device, it will either be a
> no-operation or a re-enumeration, and in the latter case, root
> privileges are required, otherwise not?
>
> Or did you mean that if you are non-root, it will/should always be a
> no-operation?
>

I guess that root is required for some administrative operations like port
reset etc that are not really possible to achieve even through /dev/usb*
permissions.

When in trouble always try to test at root especially when working with
hardware. That may pinpoint the permissions issuses (not only /dev/usb*
permissions).


What I don't understand is that the Lime Suite SoapySDR module seems to
> work fine on Linux and other operating systems but makes trouble with
> FreeBSD. Is it a FreeBSD specific thing that libusb_reset_device()
> fails if called as non-root?
>

Linux as well as other operating systems usually uses dirty and quick
hacks. FreeBSD treats standards seriously and usually does not have these
kind of dirty hacks. This is the first difference. Second difference is
that FreeBSD has its own implementation of LibUSB. There may be a problem
here bu that would require detailed investigation and proofs. Very nice
exercise to perform :-


I could give recommendation to the Lime Suite developers to remove the
> libusb_reset_device() call on FreeBSD systems if it is not neccessary.
> However, I would like to understand why it is called and what's its
> usual purpose, and if there are side effects when removing the call, or
> whether the call should/could be replaced by a different call that
> "only" requires device privileges. Also: Why does this work on Linux
> but fails on FreeBSD? Is the API differently defined?


Very good approach to understand what is the problem and fix it rarher than
using dirty hacks just to make things work :-)

What particular LimeSDR device do you have? Is it expensive? Can you share
a spare one for testing? Can you acquire access to hardware USB sniffer?


Best regards :-)
Tomek

--
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAM8r67AF%2BfGiqBr9A0863Za_zR-fG1FxGfNAqEvvafW=wTRmyQ>