[pvrusb2] Fw: getting at the serial number
Carsten Meier
cm at trexity.de
Fri Jan 16 22:42:33 CST 2009
Am Fri, 16 Jan 2009 22:30:21 -0600 (CST)
schrieb Mike Isely <isely at isely.net>:
>
> Carsten:
>
> I just learned something interesting that you'll want to know. The
> serial number *is* in fact already available in the USB configuration
> data. Thus you can do what Mauro is suggesting to identify the
> device: Use the bus_info field to find the udev-populated device node
> in /sys and then walk that to find the serial number.
>
> The reason I had never considered this is because the device's serial
> number is stored in its ROM, encoded in a format that is specific to
> Hauppauge and has nothing to do with USB. The pvrusb2 driver reads
> this by using the tveeprom module to parse the data. Since the
> pvrusb2 driver then never does anything with the result except to use
> it as the root node in its own sysfs interface, I had concluded that
> it wasn't available any other way.
>
> However it is in fact present in the USB configuration data. Just
> run the usbview generic tool and you'll see it. You'll see a field
> labeled "Serial Number:" and its value will be of the form
> "mmmm-xx-yyyyyyyy". The "mmmm" appears to match the model type, but
> the "yyyyyyyy" is an 8 digit hex number that when converted to
> decimal will match the number that the pvrusb2 driver puts in its
> sysfs interface. (The "xx" part appears to just be a pair of
> constant zeroes.)
>
> Why is this? Well I can't prove it, but I can think of two
> possibilities for how the serial number could have found its way into
> the USB configuration data without any help from the pvrusb2 driver:
>
> First the USB config data is also in that ROM - this is where the
> manufacturer and device ID are initially coded of course. But that's
> a different part of the ROM, formatted in a manner that the FX2
> processor's factory ROM initialization can directly read, i.e. this
> part is not specific to Hauppauge. So it's possible that the serial
> number is actually written in two places.
>
> A second possibility is that the FX2 is able to directly reinitialize
> its USB interface as it comes up. It can write its own configuration
> data. So it's theoretically possible that the Hauppauge-supplied FX2
> firmware is itself accessing the nearby Hauppauge ROM, extracting the
> serial number, and then stuffing it in to the USB configuration
> data. However until now I've never seen any actual evidence that the
> FX2 firmware will directly read that ROM (rather, the host driver
> reads it).
>
> But either way that would explain things.
>
> -Mike
>
I haven't looked at it in detail now (it's 5 am here) but then my app
only works for usb-devices, right? (or by parsing the bus_info-string
maybe only for pvrusb2-drien devices...)
Good night,
Carsten
More information about the pvrusb2
mailing list