diff options
author | Jérôme Pouiller <jerome.pouiller@silabs.com> | 2020-05-12 17:04:11 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-05-13 13:49:45 +0200 |
commit | ecda229e7ce3224fe9937d23c41e5ef74d4e6db3 (patch) | |
tree | 6cb78ea3d18434771f135c64e5a5b7144b0516fd /drivers/staging/wfx/data_tx.c | |
parent | staging: wfx: fix access to le32 attribute 'len' (diff) | |
download | linux-dev-ecda229e7ce3224fe9937d23c41e5ef74d4e6db3.tar.xz linux-dev-ecda229e7ce3224fe9937d23c41e5ef74d4e6db3.zip |
staging: wfx: fix endianness of the field 'status'
The field 'status' appears in most of structs returned by the hardware.
This field is encoded as little endian. Sparse complains this field is
not always correctly accessed:
drivers/staging/wfx/data_rx.c:53:16: warning: restricted __le32 degrades to integer
drivers/staging/wfx/data_rx.c:84:16: warning: restricted __le32 degrades to integer
drivers/staging/wfx/data_tx.c:526:24: warning: restricted __le32 degrades to integer
drivers/staging/wfx/data_tx.c:569:23: warning: restricted __le32 degrades to integer
drivers/staging/wfx/hif_rx.c:128:33: warning: restricted __le32 degrades to integer
drivers/staging/wfx/./traces.h:401:1: warning: restricted __le32 degrades to integer
drivers/staging/wfx/./traces.h:401:1: warning: restricted __le32 degrades to integer
In most of cases, this field is only compared with HIF_STATUS values.
Finally, it is more convenient to solve the problem by defining the
HIF_STATUS values directly in little endian.
It is also the right time to make some clean up in the HIF_STATUS names.
Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com>
Link: https://lore.kernel.org/r/20200512150414.267198-15-Jerome.Pouiller@silabs.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wfx/data_tx.c')
-rw-r--r-- | drivers/staging/wfx/data_tx.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c index 014fa36c8f78..4a2910897b6f 100644 --- a/drivers/staging/wfx/data_tx.c +++ b/drivers/staging/wfx/data_tx.c @@ -528,7 +528,7 @@ void wfx_tx_confirm_cb(struct wfx_vif *wvif, const struct hif_cnf_tx *arg) if (rate->idx < 0) break; if (tx_count < rate->count && - arg->status == HIF_STATUS_RETRY_EXCEEDED && + arg->status == HIF_STATUS_TX_FAIL_RETRIES && arg->ack_failures) dev_dbg(wvif->wdev->dev, "all retries were not consumed: %d != %d\n", @@ -568,7 +568,7 @@ void wfx_tx_confirm_cb(struct wfx_vif *wvif, const struct hif_cnf_tx *arg) tx_info->flags |= IEEE80211_TX_STAT_NOACK_TRANSMITTED; else tx_info->flags |= IEEE80211_TX_STAT_ACK; - } else if (arg->status == HIF_REQUEUE) { + } else if (arg->status == HIF_STATUS_TX_FAIL_REQUEUE) { WARN(!arg->tx_result_flags.requeue, "incoherent status and result_flags"); if (tx_info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM) { |