Page MenuHomeFreeBSD

Add sysctls to control device side USB identifiers.
ClosedPublic

Authored by trasz on Jan 15 2018, 5:33 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 22 2023, 11:10 PM
Unknown Object (File)
Nov 28 2023, 8:09 PM
Unknown Object (File)
Nov 1 2023, 11:05 PM
Unknown Object (File)
Sep 5 2023, 9:36 PM
Unknown Object (File)
Aug 26 2023, 9:03 PM
Unknown Object (File)
Aug 14 2023, 5:12 AM
Unknown Object (File)
Jul 8 2023, 7:38 AM
Unknown Object (File)
Jul 8 2023, 12:40 AM
Subscribers

Details

Summary

Add sysctls to control device side USB identifiers. This makes it possible to change string and numeric vendor and product identifiers, as well as anything else there might be to change for a particular device side template, eg the MAC address.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 14412
Build 14564: arc lint + arc unit

Event Timeline

trasz added a reviewer: hselasky.

Note there are some other minor changes I'd like to do - such as adding missing "manufacturer" identifiers for some of the templates, or unifying that field's contents for all templates. I'd prefer to do this in a subsequent commit - this one here closely preserves the existing behaviour.

I'll have a look at this tomorrow. Getting late now.

Ah, before you ask - the "deduplication". I hadn't done that for two reasons. First, most of the settings for each template need to be separate anyway, since you'll want different product IDs and strings. Pretty much the only common thing would be the vendor, and complicating things just for that seems a bit... superfluous. Also, in some cases you might actually want a separate vendor/manufacturer anyway - if, for example, you wanted a template that closely mimics the FTDI.

Also, looking at this code again, I think the interface strings are not really needed. I think I'll just #ifdef out the sysctls for those, so people can reenable them if they need them for some reason.

sys/dev/usb/template/usb_template.c
133

I think this "i++" is wrong - not needed.

sys/dev/usb/template/usb_template.c
133

technically "size_t i;" ??

trasz edited the summary of this revision. (Show Details)

Fixes from hselasky@, plus comment out the sysctl nodes for interface strings.

... and add back the man page.

trasz added inline comments.
sys/dev/usb/template/usb_template.c
133

Huh, you're right; not sure why I put it there. Seems to work fine without it.

This revision is now accepted and ready to land.Jan 16 2018, 4:02 PM
This revision was automatically updated to reflect the committed changes.
trasz marked an inline comment as done.