[Nut-upsdev] Powerware 3105 (USB) in FreeBSD

Kjell Claesson kjell.claesson at telia.com
Fri Nov 25 05:54:45 UTC 2005


Hi

tor 2005-11-24 klockan 22:05 +0100 skrev Fredrik Erlandsson:
> Well I have tryed the bcmxcp_usb driver and it doesn't seem to find the ups:
> 
> $ bcmxcp_usb -DDDD -u root auto
> Network UPS Tools - BCMXCP UPS driver 0.10 (2.1.0)
> 
> debug level is '4'
> Can't reset POWERWARE USB endpoint
> Unable to find POWERWARE UPS device on USB bus
> 

You need to handle the interrupt endpoint like a interrupt endpoint.
And it send a lot of data so it need to be buffered.
It is the same error if you try to run it under Linux on a 2.4 kernel. 


> 
> however the newhidups driver output the following data, is it possible
> to continue and write a sub-driver to newhidups?
> 

It is not a hid device. - And why does it answer like it do?

All usb devices have an enumerating process. And it is wrong of the
hid driver to report it as a hid device as the klass is 0 and
that mean that the klass is defined at interface level.

And if you look at interface level it say class=ff and it
mean vendor protocol.
8<-----------------------------------------------------
T:  Bus=01 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  2 Spd=1.5 MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0592 ProdID=0002 Rev= 0.80
S:  Manufacturer=Powerware
S:  Product=Powerware UPS
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  2mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=ff(vend.) Sub=00 Prot=00 Driver=usbfs
E:  Ad=81(I) Atr=03(Int.) MxPS=   8 Ivl=20ms
8<-------------------------------------------------------

So the solution is to make the usblib on freebsd handle
interrut endpoint's. The driver is working nice on Linux
running a 2.6 kernel.

And you may have a look on bcmxcp.c and the protocol code,
I don't think that Peter let this code go into the hid driver.

 
> $ newhidups -DDDD -u root -x generic -x vendorid= auto
> Network UPS Tools: New USB/HID UPS driver 0.28 (2.1.0)
> 
> debug level is '4'
> Checking device (0592/0002) (/dev/usb0//dev/ugen0)
> - VendorID: 0592
> - ProductID: 0002
> - Manufacturer: Powerware
> - Product: Powerware UPS
> - Serial Number: unknown
> - Bus: /dev/usb0
> Trying to match device
> Device matches
> HID descriptor retrieved (Reportlen = 0)
> Report descriptor retrieved (Reportlen = 0)
> Found HID device
> Report Descriptor size = 0
> Report Descriptor: (200 bytes) => 00 00 00 00 00 00 00 00 00 00 00 00
> 00 00 00 00
> Detected a UPS: Powerware/Powerware UPS
> Using subdriver: GENERIC HID 0.1
> entering identify_ups(0x0592, 0x0002)
> 
> upsdrv_updateinfo...
> dstate_init: sock /var/state/ups/newhidups-auto open on fd 5
> upsdrv_updateinfo...
> Waiting for notifications...
> ^CSignal 2: exiting
> Closing device

Regards
Kjell





More information about the Nut-upsdev mailing list