Page MenuHomeFreeBSD

Introduce sim_dev and cam_sim_alloc_dev().
ClosedPublic

Authored by bz on Mar 29 2019, 9:46 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 12, 7:30 AM
Unknown Object (File)
Fri, Apr 12, 7:30 AM
Unknown Object (File)
Fri, Apr 12, 7:30 AM
Unknown Object (File)
Fri, Apr 12, 7:30 AM
Unknown Object (File)
Thu, Apr 11, 5:28 PM
Unknown Object (File)
Mar 9 2024, 6:06 AM
Unknown Object (File)
Mar 1 2024, 9:23 AM
Unknown Object (File)
Feb 17 2024, 2:54 PM
Subscribers

Details

Summary

Introduce sim_dev and cam_sim_alloc_dev().

Add cam_sim_alloc_dev() as a wrapper to cam_sim_alloc() which takes
a device_t instead of the unit_number (which we can derive from the
dev again).

Add device_t sim_dev to struct cam_sim. It will be used to pass through
the bus for cases when both sides of CAM speak newbus already and we want
to link them (yet make the calls through CAM for now).

SDIO will be the first consumer of this. For that make use of
cam_sim_alloc_dev() in sdhci under MMCCAM.

This will also allow people to start iterating more on the idea
to newbus-ify CAM without changing 50+ device drivers from the start.
Also to be clear there are callers to cam_sim_alloc() which do not
have a device_t (e.g., XPT) or provide their own unit number so we cannot
simply switch the KPI entirely.

Submitted by: kibab (original idea, see D12467)
Sponsored by: The FreeBSD Foundation
MFC After: 2 weeks

Diff Detail

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

Event Timeline

Use the correct field `sim_dev`` not `sim``.
Last minute cleanup changes are never a good idea without compiling/booting them,

I'd like to commit this the next days. Can someone please review? If not it'll go in by Sat 8 June.

The change looks reasonable to me. Are there any ABI issues with changing the size of struct cam_sim?

This revision is now accepted and ready to land.Jun 4 2019, 10:58 PM

The change looks reasonable to me. Are there any ABI issues with changing the size of struct cam_sim?

I think that's fine. The size of cam_sim is known only to cam_alloc_sim functions.

This revision was automatically updated to reflect the committed changes.