]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Use bitfield for storing global ENA device states
authormw <mw@FreeBSD.org>
Thu, 30 May 2019 13:37:15 +0000 (13:37 +0000)
committermw <mw@FreeBSD.org>
Thu, 30 May 2019 13:37:15 +0000 (13:37 +0000)
commit3969c28504f23fa8b56f14709eaccd7673eae7b4
tree54e3dbf550e64ea09540852c91f850588a5bf233
parent3837ae24e3dc56200ed986523c4e1c874d0b7701
Use bitfield for storing global ENA device states

As the ENA can have multiple states turned on/off, it is more convenient
to store them in single bitfield instead of multiple boolean variables.

The bitset FreeBSD API was used for the bitfield implementation, as it
provides flexible structure together with API which also supports atomic
bitfield operations.

For better readability basic macros from API were wrapped into custom
ENA_FLAG_* macros, which are filling up common parameters for all calls.

Submitted by:  Michal Krawczyk <mk@semihalf.com>
Obtained from: Semihalf
Sponsored by:  Amazon, Inc.
sys/dev/ena/ena.c
sys/dev/ena/ena.h
sys/dev/ena/ena_sysctl.c