Page MenuHomeFreeBSD

Add USB Mass Storage CTL frontend.
ClosedPublic

Authored by trasz on Dec 14 2016, 8:41 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, May 8, 12:08 PM
Unknown Object (File)
Wed, May 8, 12:08 PM
Unknown Object (File)
Wed, May 8, 12:06 PM
Unknown Object (File)
Wed, May 8, 12:06 PM
Unknown Object (File)
Wed, May 8, 12:06 PM
Unknown Object (File)
Wed, May 8, 9:53 AM
Unknown Object (File)
Sun, May 5, 12:16 PM
Unknown Object (File)
Mon, Apr 15, 1:24 AM

Details

Summary

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.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

trasz retitled this revision from to Add USB Mass Storage CTL frontend..
trasz updated this object.
trasz edited the test plan for this revision. (Show Details)
bjk added inline comments.
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.

emaste added inline comments.
sys/dev/usb/storage/cfumass.c
389–390 ↗(On Diff #22903)

How do we resolve these questions?

849–854 ↗(On Diff #22903)

What do we do here?

emaste requested changes to this revision.Jan 24 2017, 9:22 PM
emaste added a reviewer: emaste.
emaste added inline comments.
sys/dev/usb/storage/cfumass.c
403–404 ↗(On Diff #22903)

Needs rebasing after rS312651

This revision now requires changes to proceed.Jan 24 2017, 9:22 PM
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
trasz edited edge metadata.

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.

trasz edited edge metadata.

Fix build on sparc64.

wblock added a reviewer: wblock.

Man page changes look good to me. Thanks!

sys/dev/usb/storage/cfumass.c
2 ↗(On Diff #25150)

Year update?

560–561 ↗(On Diff #25150)

this is just for the the start_stop ignore switch, correct? it's not clear from the name

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?

This revision was automatically updated to reflect the committed changes.