Add USB Mass Storage CTL frontend. Note that this is not the latest
version of the code; I'll update it after I have tested my changes.
Details
- Reviewers
emaste wblock - Group Reviewers
manpages - Commits
- rS313959: Add USB Mass Storage CTL frontend. This makes it possible
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
share/man/man4/cfumass.4 | ||
---|---|---|
71 ↗ | (On Diff #22903) | This could probably be another .Xr ctl 4. Also there's the Dq macro for putting quotes around things, though one could argue that .Pa is more appropriate for umassX. |
sys/dev/usb/storage/cfumass.c | ||
---|---|---|
836–837 ↗ | (On Diff #22903) | Compiling on sparc64: /scratch/tmp/emaste/freebsd/sys/modules/usb/cfumass/../../../dev/usb/storage/cfumass.c: In function 'cfumass_t_data_in_callback': /scratch/tmp/emaste/freebsd/sys/modules/usb/cfumass/../../../dev/usb/storage/cfumass.c:834: warning: format '%zd' expects type 'signed size_t', but argument 4 has type 'int' [-Wformat] /scratch/tmp/emaste/freebsd/sys/modules/usb/cfumass/../../../dev/usb/storage/cfumass.c:834: warning: format '%zd' expects type 'signed size_t', but argument 5 has type 'uint32_t' [-Wformat] |
Remember to update .Dd in the man pages where a .Xr has been added to this new man page.
Attached is a version of cfumass.4 with the changes mentioned above plus some other edits for clarity, markup, and corrected dates.
share/man/man4/cfumass.4 | ||
---|---|---|
47 ↗ | (On Diff #22903) | The driver can be loaded as a module at boot by placing this line in Yes, I know the old line has been reused so many times it is dogma. It's still halting and redundant. We can and should do better. |
62 ↗ | (On Diff #22903) | This is a long way of saying "To use", but this is a one-sentence paragraph with asides and several conditions. Using .Nm requires .Bl -bullet .It .Xr usb_template 4 must be loaded. .It The USB OTG port must be working in USB device-side mode. This happens automatically upon connection to a USB host. .It The USB Mass Storage template must be chosen by setting the .Va hw.usb.template sysctl to 0. .El |
Updated version with numerous small improvements here and there.
I've incorporated the man page updated with wblocked@, but did some
more changes; please tell me what you think.
Note that there's one important change in behaviour: the CTL port
is created on load, not on attach. This is nicer from ctld point
of view.
sys/dev/usb/storage/cfumass.c | ||
---|---|---|
389–390 ↗ | (On Diff #22903) | I've left the "XXX KDM" question here; it exists in (I believe literally) all CTL frontend drivers. The real answer would be to just get rid of the number altogether; it's not currently used. I need to discuss this with mav@, though. |
sys/dev/usb/storage/cfumass.c | ||
---|---|---|
560–561 ↗ | (On Diff #25150) | For now it's just for this single command, yeah, but we might grow something else in the future, thus the generic name. That's also why the command detection is inside the function. |
sys/dev/usb/storage/cfumass.c | ||
---|---|---|
560–561 ↗ | (On Diff #25150) | but could you add a comment about the return value? |