[Nut-upsdev] newhidups subdriver_matcher incorrectly matches USB
hub
Peter Selinger
selinger at mathstat.dal.ca
Wed Aug 16 13:42:07 UTC 2006
Jonathan Dion wrote:
>
> Hello all,
>
> I was discusing before about those claim function.
>
> I'm currently, for the use of a print-ups-list tool, making a table,
> in the drivers, of the caracteristics of the UPS they support.
>
> VendorID and ProductID is a part of it.
>
> I thought of using it in the claim function, so it would only claim
> VendorID ProductID pair that are in this table, but I get reply that
> it could lead to not support anymore some device that are already
> supported (until at least we add them to the table).
>
> If you think it is finally a good idea (as it seems because you done
> something similar by doing this), I can rework the claim function to
> do the job. The claim function would then be in newhidups.c, reducing
> redundance.
I think it is a good idea, ultimately, to have a list of all supported
ProductID's for each subdriver. However, there should still be a
possibility to match devices by other criteria as well.
I don't think it is a good idea to move this information to
newhidups.c. The whole point of subdrivers is a modular design. What
is wrong with leaving the claim() functions in the subdriver, and
adding the new device table to the subdriver structure as well?
The claim() function would be partly standardized (reading the new
subdriver structure), but if left in the subdriver, it can be more
flexible, as it doesn't *have* to operate by reading a static table.
(Of course, newhidups.c could provide a helper function making the
table lookup easier).
> The fact is that we would need the VendorID and ProductID pair for
> each UPS supported. For that, we would need users to send it to us.
>
> The advantage is that we would only need to update those tables to add
> a supported UPS.
This would still be true if the device tables are in the subdrivers.
> Yes, MGE UPS are all under the ProductID 0001 or ffff. After asking my
> collaborators, I now have the list of each MGE UPS and the
> correspnding ProductID
Ok, excellent. -- Peter
More information about the Nut-upsdev
mailing list