#[repr(C)]
#[derive(Default, Copy, Clone)]
pub(crate) struct ethtool_sfeatures
{
cmd: u32,
pub(crate) size: u32,
features: __IncompleteArrayField<ethtool_set_features_block>,
}
impl EthtoolCommand for ethtool_sfeatures
{
#[inline(always)]
fn command(&self) -> u32
{
self.cmd
}
}
impl VariablySizedEthtoolCommand for ethtool_sfeatures
{
type ArrayElement = ethtool_set_features_block;
#[inline(always)]
fn array_length(&self) -> u32
{
self.size
}
}
impl VariablySizedEthtoolCommandWrapper<ethtool_sfeatures>
{
#[allow(dead_code)]
#[inline(always)]
pub(crate) fn valid_is_set(&self, feature: NETIF_F) -> bool
{
feature.is_set_field_locator(self.array_elements(), |ethtool_set_features_block| ethtool_set_features_block.valid)
}
#[allow(dead_code)]
#[inline(always)]
pub(crate) fn requested_is_set(&self, feature: NETIF_F) -> bool
{
feature.is_set_field_locator(self.array_elements(), |ethtool_set_features_block| ethtool_set_features_block.requested)
}
#[inline(always)]
pub(crate) fn set_to_be_changed(&mut self, feature: NETIF_F, value: bool)
{
feature.set_field_locator(self.array_elements_mut(), |ethtool_set_features_block| &mut ethtool_set_features_block.valid);
if value
{
feature.set_field_locator(self.array_elements_mut(), |ethtool_set_features_block| &mut ethtool_set_features_block.requested);
}
else
{
feature.unset_field_locator(self.array_elements_mut(), |ethtool_set_features_block| &mut ethtool_set_features_block.requested);
}
}
}
impl ethtool_sfeatures
{
#[inline(always)]
pub(crate) fn new() -> VariablySizedEthtoolCommandWrapper<Self>
{
Self::new_with_initialized_header_but_uninitialized_array
(
Self
{
cmd: ETHTOOL_SFEATURES,
size: NETIF_F::SafeSize as u32,
features: __IncompleteArrayField::new(),
}
)
}
}