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)
Mon, Nov 25, 7:58 PM
Unknown Object (File)
Mon, Nov 25, 7:53 PM
Unknown Object (File)
Mon, Nov 25, 12:10 PM
Unknown Object (File)
Mon, Nov 25, 1:54 AM
Unknown Object (File)
Fri, Nov 22, 9:48 AM
Unknown Object (File)
Thu, Nov 14, 6:04 PM
Unknown Object (File)
Mon, Nov 11, 12:29 PM
Unknown Object (File)
Mon, Nov 11, 12:23 PM
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 14389
Build 14542: 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.