Skip to contentSkip to conversation

PRODUCT code has a float in it rather than an int

DISCUSSION Ben Woodard 2 participants 4 messages Mar 29, 2001

lore
Share & tools
lore
#0 lore raw

I'm running 2.2.18 with modultils 2.4.5 and it appears that the PRODUCT is coming back as a float rather than as an int. This is consistant with what I see in /proc/usb/devices:

ben@trill:/etc/hotplug$ grep ^P /proc/bus/usb/devices 
P:  Vendor00 ProdID00 Rev= 0.00
P:  Vendorf0 ProdID04 Rev= 1.00

This causes some problems in the usb.agent script becase usb_bcdDevice is declared -i?

This leads me to believe that that usb_bcdDevice should not be declared -i or it should be multiplied out so that it is an integer.

What do you guys think? I'm happy to try to code up the changes but I'd like to know which direction I should take it.

-ben

_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#1 lore raw

It's a bug in 2.2.18 ... a 2.4 fix wasn't backported.

"bcdDevice" is binary coded decimal, fixed point. It's presented as integer to simplify things.

One fix would be to have the hotplug scripts see they've got that bug, and work around it. (Until 2.2.* syncs that with 2.4!)

- Dave

----- Original Message -----
From: "Ben Woodard" <[email protected]>
To: <[email protected]>
Cc: <[email protected]>; <[email protected]>
Sent: Thursday, March 29, 2001 8:43 AM
Subject: PRODUCT code has a float in it rather than an int

Quoted 23 lines

I'm running 2.2.18 with modultils 2.4.5 and it appears that the PRODUCT is coming back as a float rather than as an int. This is consistant with what I see in /proc/usb/devices:

ben@trill:/etc/hotplug$ grep ^P /proc/bus/usb/devices 
P:  Vendor00 ProdID00 Rev= 0.00
P:  Vendorf0 ProdID04 Rev= 1.00

This causes some problems in the usb.agent script becase usb_bcdDevice is declared -i?

This leads me to believe that that usb_bcdDevice should not be declared -i or it should be multiplied out so that it is an integer.

What do you guys think? I'm happy to try to code up the changes but I'd like to know which direction I should take it.

-ben

Quoted 4 lines

_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#2 lore raw
In reply to Ben Woodard
Quoted 8 lines

It's a bug in 2.2.18 ... a 2.4 fix wasn't backported.

"bcdDevice" is binary coded decimal, fixed point. It's presented as integer to simplify things.

One fix would be to have the hotplug scripts see they've got that bug, and work around it. (Until 2.2.* syncs that with 2.4!)

I can do this. I'll contribute a patch. Just let me make sure that I'm sure I understand what you mean by a bcd.
decimal binary hex

0.00    0000 0000 0000 0000 0x0000
1.00    0000 0001 0000 0000 0x0100
7.45    0000 0111 0010 0101 0x0745
11.93   0001 0001 1001 0011 0x1193

is that pretty much correct? If it is, let me know and I will code it up.

-ben

Quoted 39 lines

- Dave

----- Original Message -----
From: "Ben Woodard" <[email protected]>
To: <[email protected]>
Cc: <[email protected]>; <[email protected]>
Sent: Thursday, March 29, 2001 8:43 AM
Subject: PRODUCT code has a float in it rather than an int

Quoted 27 lines

I'm running 2.2.18 with modultils 2.4.5 and it appears that the PRODUCT is coming back as a float rather than as an int. This is consistant with what I see in /proc/usb/devices:

ben@trill:/etc/hotplug$ grep ^P /proc/bus/usb/devices 
P:  Vendor00 ProdID00 Rev= 0.00
P:  Vendorf0 ProdID04 Rev= 1.00

This causes some problems in the usb.agent script becase usb_bcdDevice is declared -i?

This leads me to believe that that usb_bcdDevice should not be declared -i or it should be multiplied out so that it is an integer.

What do you guys think? I'm happy to try to code up the changes but I'd like to know which direction I should take it.

-ben

_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

#3 lore raw
In reply to Ben Woodard

Consult the USB (2.0) spec in case of confusion,
but you're basically correct.

Range is 00.00 to 99.99, which in hex is 0000 to 9999 ...

- Dave

----- Original Message -----
From: "Ben Woodard" <[email protected]>
To: "David Brownell" <[email protected]>
Cc: <[email protected]>; <[email protected]>; <[email protected]>
Sent: Thursday, March 29, 2001 9:31 AM
Subject: Re: PRODUCT code has a float in it rather than an int

Quoted 63 lines
Quoted 8 lines

It's a bug in 2.2.18 ... a 2.4 fix wasn't backported.

"bcdDevice" is binary coded decimal, fixed point. It's presented as integer to simplify things.

One fix would be to have the hotplug scripts see they've got that bug, and work around it. (Until 2.2.* syncs that with 2.4!)

I can do this. I'll contribute a patch. Just let me make sure that I'm sure I understand what you mean by a bcd.
decimal binary hex

0.00    0000 0000 0000 0000 0x0000
1.00    0000 0001 0000 0000 0x0100
7.45    0000 0111 0010 0101 0x0745
11.93   0001 0001 1001 0011 0x1193

is that pretty much correct? If it is, let me know and I will code it up.

-ben

Quoted 39 lines

- Dave

----- Original Message -----
From: "Ben Woodard" <[email protected]>
To: <[email protected]>
Cc: <[email protected]>; <[email protected]>
Sent: Thursday, March 29, 2001 8:43 AM
Subject: PRODUCT code has a float in it rather than an int

Quoted 27 lines

I'm running 2.2.18 with modultils 2.4.5 and it appears that the PRODUCT is coming back as a float rather than as an int. This is consistant with what I see in /proc/usb/devices:

ben@trill:/etc/hotplug$ grep ^P /proc/bus/usb/devices 
P:  Vendor00 ProdID00 Rev= 0.00
P:  Vendorf0 ProdID04 Rev= 1.00

This causes some problems in the usb.agent script becase usb_bcdDevice is declared -i?

This leads me to believe that that usb_bcdDevice should not be declared -i or it should be multiplied out so that it is an integer.

What do you guys think? I'm happy to try to code up the changes but I'd like to know which direction I should take it.

-ben

_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

Quoted 4 lines

_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

_______________________________________________
Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net
[email protected]
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel