networkupstools / nut

The Network UPS Tools repository. UPS management protocol Informational RFC 9271 published by IETF at https://www.rfc-editor.org/info/rfc9271 Please star NUT on GitHub, this helps with sponsorships!
https://networkupstools.org/
Other
2.03k stars 350 forks source link

Remove redundant usb_set_altinterface() #138

Closed clepple closed 6 years ago

clepple commented 10 years ago

This call to usb_set_altinterface() is redundant, and on OS X, prevents tripplite_usb from connecting to an OMNIVS1000:

https://github.com/networkupstools/nut/blob/d7a5c6e5e0f9c0bdbfe4029287dc45b50f2ab207/drivers/libusb.c#L224

I'd just comment it out, but I think we should have a parameter in case some other equipment is relying on this behavior.

Need testing of branch 'issue_138_altinterface_value' on:

clepple commented 10 years ago

There is another instance of usb_set_altinterface() in drivers/richcomm_usb.c, but since that device has a suspect USB VID:PID, I am not changing that driver.

aquette commented 10 years ago

@clepple : hum, it seems that bug should have been closed 2 times... and is still opened. can we close it?

clepple commented 10 years ago

@clepple : hum, it seems that bug should have been closed 2 times... and is still opened. can we close it?

@aquette: Not merged yet, because nobody has tested it yet. Want to help? :-)=

aquette commented 10 years ago

tested branch 'issue_138_altinterface_value' and compared against 2.7.1 on Linux: no regression at startup, no upsc diff. This is also valid for #121 Context: Linux kernel 3.14-2-amd64 ; libusb 0.1.12-24 ; UPS Eaton Ellipse MAX I will also do some endurance testing. Other platforms (BSD, Solaris, Windows) would also be worth testing. @balooloo : would you be able to test on Windows? @jimklimov : same for Solaris? @clepple : same for OSX and BSD?

clepple commented 10 years ago

@aquette already tested on Ubuntu, Debian, FreeBSD 9.3 and 10.0, and of course, OS X 10.9 (which drove the need for the patch).

aquette commented 10 years ago

@clepple : you byte me ;) (pun intended)

clepple commented 10 years ago

@aquette I'm taking OpenBSD off the testing list because I only have a VM, and the general state of USB in OpenBSD seems experimental at best. We can test more later, but I'm not going to hold up 2.7.3 because of that.

aquette commented 10 years ago

@clepple : very valid comment ;) @balooloo : if you could just please acknowledge on the feasibility of this test, would be great! I'll try to check on my side for Solaris (FYI @jimklimov )

clepple commented 10 years ago

For future reference, the extra usb_set_altinterface() also prevents an Emerson/Liebert GXT3 from working on Debian Linux:

http://news.gmane.org/find-root.php?message_id=13122026.871724.1412171218361.JavaMail.www%40wsfrf1117

clepple commented 10 years ago

I'm merging this. Worst case, people can use the driver option to restore the old behavior.

clepple commented 9 years ago

Seems to be an issue on FreeBSD 10.2: http://article.gmane.org/gmane.comp.monitoring.nut.user/9286

clepple commented 6 years ago

Closing since FreeBSD 10.2 is EOL as of 2016-12-31, and this will probably be overtaken by #300 (and maybe related to #490).