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)
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)
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