diff options
author | Jérôme Pouiller <jerome.pouiller@silabs.com> | 2020-01-15 13:54:48 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-01-16 20:59:49 +0100 |
commit | 46f044b965e62f07a9c1411328487bf8346dbc79 (patch) | |
tree | 9f981cd19ddf2e3b3f2fee7b99cf4d37e99446d3 /drivers/staging/wfx/hif_tx_mib.h | |
parent | a8ec12d419af85c8225222ae19b26ea9c8fd6980 (diff) |
staging: wfx: simplify hif_set_uc_mc_bc_condition()
The structure hif_mib_uc_mc_bc_data_frame_condition come from hardware
API. It is not intended to be manipulated in upper layers of the driver.
In add, current code for hif_set_uc_mc_bc_condition() is too dumb. It
should pack data with hardware representation instead of leaving all
work to the caller.
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200115135338.14374-32-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wfx/hif_tx_mib.h')
-rw-r--r-- | drivers/staging/wfx/hif_tx_mib.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/staging/wfx/hif_tx_mib.h b/drivers/staging/wfx/hif_tx_mib.h index eec6f4157e60..4d171e6cfc9a 100644 --- a/drivers/staging/wfx/hif_tx_mib.h +++ b/drivers/staging/wfx/hif_tx_mib.h @@ -246,12 +246,20 @@ static inline int hif_set_mac_addr_condition(struct wfx_vif *wvif, arg, sizeof(*arg)); } -static inline int hif_set_uc_mc_bc_condition(struct wfx_vif *wvif, - struct hif_mib_uc_mc_bc_data_frame_condition *arg) +// FIXME: use a bitfield instead of 3 boolean values +static inline int hif_set_uc_mc_bc_condition(struct wfx_vif *wvif, int idx, + bool unic, bool multic, bool broadc) { + struct hif_mib_uc_mc_bc_data_frame_condition val = { + .condition_idx = idx, + .param.bits.type_unicast = unic, + .param.bits.type_multicast = multic, + .param.bits.type_broadcast = broadc, + }; + return hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_UC_MC_BC_DATAFRAME_CONDITION, - arg, sizeof(*arg)); + &val, sizeof(val)); } static inline int hif_set_config_data_filter(struct wfx_vif *wvif, |