mvp / uhubctl

uhubctl - USB hub per-port power control
Other
2.23k stars 232 forks source link

Add quirk for D-Link 7 port hubs port numbering #524

Closed bm16ton closed 1 year ago

bm16ton commented 1 year ago

Hello, So my 7 port D-Link hub has its numbers all mixed up from the software. Not blaming the software at all, I imagine if i looked at the placement of the hub chips and pinouts it probly makes sense and they just fixed it in the windows software. I wouldnt be surprised if you had no interest in patches like this, seems like if more kept being added it would hard to maintain. It doesnt help I couldnt see any sorta math I could do for the correct port numbers so its all hardcoded. But just in case I always at least send the PR so others can find it or in off chance the maintainer would actually use my Forrest Gumped code:) Ive said it before, but Thank You for this awesome software! It helps me overcome strange issues and problems all the time (IE not enuff hands and need power added/removed to blah).

mvp commented 1 year ago

Sorry, cannot accept this. This adds port renumbering only for one hub. Any code that I will accept must be generic, and serve most devices out there.

To solve your problem, I recommend to use label maker (most people use it to label items in their kitchen shelves) to print proper port numbering tape and attach it to your hub, so you can't mix things up. At least this solution is very generic, will work for any hub.

bm16ton commented 1 year ago

I totally understand. Adding a new quirck for each hub would not be manageable. Just out of curiosity would a generic port renumbering option be viable? I don't think I worded that well. Say an option where the end user specifies the order or a conf file that sets the correct order. A more generic option. The only reason I ask is to get a better understanding of the correct way to maintain projects, to become a better contributer (hopefully), or is it more the concept is flawed because it doesn't apply to all hubs equally? I find this subject very interesting, and very much appreciate your time, and being my better in such areas your opinion on such things. Hopefully someday ill have a better grasp on these aspects and hopefuly be able to give back to projects such as yours. Thank you again.

On Sat, Sep 16, 2023, 12:08 AM mvp @.***> wrote:

Closed #524 https://github.com/mvp/uhubctl/pull/524.

— Reply to this email directly, view it on GitHub https://github.com/mvp/uhubctl/pull/524#event-10388925392, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADAWMP74XOPDGVBSQNFWL3DX2UQ5VANCNFSM6AAAAAA42ISPQM . You are receiving this because you authored the thread.Message ID: @.***>

mvp commented 1 year ago

Port renumbering is technically possible. But we have to ask few important questions:

  1. Why add port renumbering feature? - As far as I can tell, only to give port numbers aligning to physical layout and make users slightly less confused
  2. What is the cost of supporting this for all USB hubs? - Cost is very high. It will require creating large database of all USB hubs that were ever released, and long time to collecting physical port numbers for all hubs ever released. But even that wouldn't work well - many high port count USB hubs (7+) are composed as multiple 4-port USBs daisy chained internally. For such hubs, one has to provide both location of daisy chained hub and it's port number (1 to 4). That makes supporting it incredibly difficult, if not impossible
  3. Does adding port renumbering have any simple workarounds that work for any hub? - Yes, label maker and 5 min of poking around at actual port numbering layout

It's hard for me to give you specific advice. But one thing that I noticed works well: try to make your solutions or fixes to be as generic as possible. E.g. I have tried really hard to make uhubctl to support any OS out of the box, and any USB hub that supports power switching at hardware level.