Re: [PATCH] USB: option: Add USB ID for Novatel Ovation MC551

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, 2012-06-23 at 21:46 -0400, Alan Stern wrote:
> On Sat, 23 Jun 2012, Bjørn Mork wrote:
> 
> > > Maybe you're not aware that libusb-1.0 has a compatibility layer that
> > > provides the old libusb-0.1 bindings. 
> > 
> > That's correct.  I was not aware of this.  Thanks.  Learning something
> > every day makes me feel younger.  This mailing list is something of a
> > Fountain of Youth :-)
> > 
> > > It's probably in a package called libusb-compat or something similar.
> > 
> > Cannot find any such package in Debian. "apt-cache search libusb compat"
> > returns nothing.
> 
> I don't know what it's called, and Debian might not even have packaged
> it.  (It doesn't seem to be present in Fedora 16, for that matter.)  
> But even if they didn't, it can always be built from the source.

So the compat package doesn't actually work either.  That's what Fedora
is using for the older libusb.  And here's why...  new libusb has a
symbol libusb_init() that replaces usb_init().  The compat library does
this:

API_EXPORTED void usb_init(void)
{
	int r;
	usbi_dbg("");

	if (!ctx) {
		r = libusb_init(&ctx);
		if (r < 0) {

But guess what USB.pm does?

#
#  Internal-only, one-time init function.
my $init_ref;
$init_ref = sub
{
    libusb_init();
    $init_ref = sub {};
};

<snip>

void libusb_init()
{
    usb_init();
}

Guess which libusb_init() actually gets called?  So when loading
Device::USB on a system with the compat library, we loop for infinity
calling usb_init() -> libusb_init() -> usb_init() -> (etc).  Yay.  I'll
fix this up locally for me at least.  But beware :)

Dan

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux