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.
Details
- Reviewers
• hselasky - Group Reviewers
manpages - Commits
- rS328194: Add sysctls to control device side USB identifiers. This makes it
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
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.
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 ↗ | (On Diff #37980) | I think this "i++" is wrong - not needed. |
sys/dev/usb/template/usb_template.c | ||
---|---|---|
133 ↗ | (On Diff #37980) | technically "size_t i;" ?? |
sys/dev/usb/template/usb_template.c | ||
---|---|---|
133 ↗ | (On Diff #37980) | Huh, you're right; not sure why I put it there. Seems to work fine without it. |