Page MenuHomeFreeBSD

Bump __FreeBSD_version for sound(4) KPI changes
AbandonedPublic

Authored by christos on Wed, Nov 13, 6:52 PM.
Tags
None
Referenced Files
F103143771: D47540.diff
Thu, Nov 21, 2:00 PM
Unknown Object (File)
Mon, Nov 18, 9:33 PM
Unknown Object (File)
Mon, Nov 18, 3:54 PM
Unknown Object (File)
Sun, Nov 17, 1:53 PM
Unknown Object (File)
Sat, Nov 16, 1:22 PM
Subscribers

Details

Summary

Bump __FreeBSD_version for sound(4) KPI changes

516a9c0212b0 ("sound: Make device registration more intuitive")
introduced changes to the device registration KPI which break unpatched
out-of-tree drivers.

More specifically, up until 516a9c0212b0, drivers would usually register
a device as follows:

  • pcm_register(dev, softc, playchans, recchans)
  • pcm_addchan(...)
  • pcm_setstatus(dev, statustr)

Drivers now should register as follows:

  • pcm_init(dev, softc)
  • pcm_addchan(...)
  • pcm_register(dev, statustr)

Essentially, to patch a driver to use the new KPI:

  1. Use pcm_init() in place of pcm_register(), and remove return value checks, as pcm_init() is void.
  2. Use pcm_register() in place of pcm_setstatus() and _do_ check for the return value.

Sponsored by: The FreeBSD Foundation
MFC after: 2 days

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 60522
Build 57406: arc lint + arc unit

Event Timeline

markj added inline comments.
sys/sys/param.h
76

This is out of date (current value is 1500026), but yes the change is fine.

The commit message should describe in more detail what changed, so that it's easier for maintainers to update their code.

This revision is now accepted and ready to land.Wed, Nov 13, 6:55 PM
christos marked an inline comment as done.

Use correct version value.

This revision now requires review to proceed.Wed, Nov 13, 7:13 PM
This revision is now accepted and ready to land.Wed, Nov 13, 7:25 PM

Someone else just bumped FreeBSD_version to 1500027, so I would suggest piggy-backing off of that. That is, there's no need to bump FreeBSD_version again; just use 1500027 as the guard.

On stable/14, I suspect that the change should be reverted to avoid breaking the cx88 port.

imp requested changes to this revision.Thu, Nov 14, 4:15 PM

I'd piggyback...

This revision now requires changes to proceed.Thu, Nov 14, 4:15 PM

These values are documented in the porters handbook https://docs.freebsd.org/en/books/porters-handbook/versions/
I don't see 1500027 there yet, but we will want to have it mention both changes.

Abandoning since __FreeBSD_version was bumped already. Also reverted KPI changes for stable/14: https://cgit.freebsd.org/src/commit/?h=stable/14&id=b64867e332f8196cb61947fc189ff108ca1065db