aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/wfx/hif_tx_mib.h
diff options
context:
space:
mode:
authorJérôme Pouiller <jerome.pouiller@silabs.com>2020-01-15 13:54:13 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-01-16 20:59:46 +0100
commite52e68eee7d0a6731d2f8d9234ba3ab226f392dd (patch)
tree98e81bc2fbeb0cb7db160b0b353a4bcc786ed5ac /drivers/staging/wfx/hif_tx_mib.h
parentstaging: wfx: simplify hif_set_rcpi_rssi_threshold() usage (diff)
downloadlinux-dev-e52e68eee7d0a6731d2f8d9234ba3ab226f392dd.tar.xz
linux-dev-e52e68eee7d0a6731d2f8d9234ba3ab226f392dd.zip
staging: wfx: simplify hif_set_arp_ipv4_filter() usage
The structure hif_mib_arp_ip_addr_table come from hardware API. It is not intended to be manipulated in upper layers of the driver. In add, current code for hif_set_arp_ipv4_filter() is too dumb. It should pack data using the 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-9-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.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/staging/wfx/hif_tx_mib.h b/drivers/staging/wfx/hif_tx_mib.h
index a8082508fbfd..a325c870b4ea 100644
--- a/drivers/staging/wfx/hif_tx_mib.h
+++ b/drivers/staging/wfx/hif_tx_mib.h
@@ -260,12 +260,22 @@ static inline int hif_keep_alive_period(struct wfx_vif *wvif, int period)
&arg, sizeof(arg));
};
-static inline int hif_set_arp_ipv4_filter(struct wfx_vif *wvif,
- struct hif_mib_arp_ip_addr_table *fp)
+static inline int hif_set_arp_ipv4_filter(struct wfx_vif *wvif, int idx,
+ __be32 *addr)
{
+ struct hif_mib_arp_ip_addr_table arg = {
+ .condition_idx = idx,
+ .arp_enable = HIF_ARP_NS_FILTERING_DISABLE,
+ };
+
+ if (addr) {
+ // Caution: type of addr is __be32
+ memcpy(arg.ipv4_address, addr, sizeof(arg.ipv4_address));
+ arg.arp_enable = HIF_ARP_NS_FILTERING_ENABLE;
+ }
return hif_write_mib(wvif->wdev, wvif->id,
HIF_MIB_ID_ARP_IP_ADDRESSES_TABLE,
- fp, sizeof(*fp));
+ &arg, sizeof(arg));
}
static inline int hif_use_multi_tx_conf(struct wfx_dev *wdev,