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, Dec 20, 9:16 PM
Unknown Object (File)
Fri, Dec 20, 5:27 PM
Unknown Object (File)
Fri, Dec 20, 4:39 PM
Unknown Object (File)
Fri, Dec 20, 11:40 AM
Unknown Object (File)
Thu, Dec 12, 1:56 AM
Unknown Object (File)
Mon, Dec 9, 5:10 PM
Unknown Object (File)
Nov 22 2024, 11:42 AM
Unknown Object (File)
Oct 10 2024, 4:43 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 23375

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.