diff options
author | 2022-01-13 09:55:04 +0100 | |
---|---|---|
committer | 2022-01-25 16:19:41 +0100 | |
commit | af915de6bade0fe6a561e36a943ea2ada47756d1 (patch) | |
tree | 84dc9cb0cd518198895c08db3177a79b8c00a8d7 /drivers/staging/wfx/bh.c | |
parent | stagigg: wfx: replace magic number by HIF_ID_IS_INDICATION (diff) | |
download | wireguard-linux-af915de6bade0fe6a561e36a943ea2ada47756d1.tar.xz wireguard-linux-af915de6bade0fe6a561e36a943ea2ada47756d1.zip |
staging: wfx: preserve endianness of struct hif_ind_startup
The hardware fills struct hif_ind_startup with little endian values. So,
declare it with little endian fields.
It is now a bit more verbose to access to fields of struct
hif_ind_startup, but it is less confusing.
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20220113085524.1110708-12-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wfx/bh.c')
-rw-r--r-- | drivers/staging/wfx/bh.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/staging/wfx/bh.c b/drivers/staging/wfx/bh.c index a0f9d1b53019..bbcf8d6a39c4 100644 --- a/drivers/staging/wfx/bh.c +++ b/drivers/staging/wfx/bh.c @@ -182,9 +182,9 @@ static void tx_helper(struct wfx_dev *wdev, struct hif_msg *hif) wdev->hif.tx_seqnum = (wdev->hif.tx_seqnum + 1) % (HIF_COUNTER_MAX + 1); data = hif; - WARN(len > wdev->hw_caps.size_inp_ch_buf, - "%s: request exceed the chip capability: %zu > %d\n", __func__, - len, wdev->hw_caps.size_inp_ch_buf); + WARN(len > le16_to_cpu(wdev->hw_caps.size_inp_ch_buf), + "request exceed the chip capability: %zu > %d\n", + len, le16_to_cpu(wdev->hw_caps.size_inp_ch_buf)); len = wdev->hwbus_ops->align_size(wdev->hwbus_priv, len); ret = wfx_data_write(wdev, data, len); if (ret) @@ -204,7 +204,7 @@ static int bh_work_tx(struct wfx_dev *wdev, int max_msg) for (i = 0; i < max_msg; i++) { hif = NULL; - if (wdev->hif.tx_buffers_used < wdev->hw_caps.num_inp_ch_bufs) { + if (wdev->hif.tx_buffers_used < le16_to_cpu(wdev->hw_caps.num_inp_ch_bufs)) { if (try_wait_for_completion(&wdev->hif_cmd.ready)) { WARN(!mutex_is_locked(&wdev->hif_cmd.lock), "data locking error"); hif = wdev->hif_cmd.buf_send; |