Commit graph

5 commits

Author SHA1 Message Date
Vladimir Kondratyev
2d0694b953 LinuxKPI: Constantly use _LINUXKPI_ prefix in include guards
MFC after:	1 week
Reviewed by:	bz, emaste, hselasky, manu
Differential Revision:	https://reviews.freebsd.org/D33562

(cherry picked from commit 307f78f3ed)
2022-01-22 22:34:38 +03:00
Bjoern A. Zeeb
2f6e37eded LinuxKPI: bitfields add more *replace_bits()
Add or extend the already existing *_replace_bits() implementations
using macros as we do for the other parts in the file for
le<n>p_replace_bits(), u<n>p_replace_bits(), and _u<n>_replace_bits().

Reviewed by:	hselasky
Differential Revision: https://reviews.freebsd.org/D33799

(cherry picked from commit 2fb0569f1f)
2022-01-16 22:38:57 +00:00
Bjoern A. Zeeb
3ce981ee8e LinuxKPI: fix bug in le32p_replace_bits()
Fix a bug that slipped in in 90707c4e44
using the correct field in le32p_replace_bits().

Sponsored by:	The FreeBSD Foundation

(cherry picked from commit 22e20d852f)
2021-11-19 00:01:23 +00:00
Bjoern A. Zeeb
2314243b4a LinuxKPI: bitfield.h cleanup
Add a missing tab and remove an unnecessary return.
No functional changes.

(cherry picked from commit 4c8af633d1)
2021-11-19 00:01:23 +00:00
Bjoern A. Zeeb
90707c4e44 LinuxKPI: add a bitfield.h implementation.
This code was iteratively implemented during the work on various WiFi
drivers -- from individual functions to a macro-created implementations
for the various bit sized needed (and then extended to more for
comepleteness). Some of the bit combinations do not seem to make sense
so are left out.

The __bf_shf(x) was obtained from D26681 [1].

Requested by:		manu [1]
Reviewed by:		hselasky, manu
MFC after:		1 week
Sponsored by:		The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D26708
2020-10-07 22:07:26 +00:00