[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200512150414.267198-9-Jerome.Pouiller@silabs.com>
Date: Tue, 12 May 2020 17:04:05 +0200
From: Jerome Pouiller <Jerome.Pouiller@...abs.com>
To: devel@...verdev.osuosl.org, linux-wireless@...r.kernel.org
Cc: netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Kalle Valo <kvalo@...eaurora.org>,
"David S . Miller" <davem@...emloft.net>,
Jérôme Pouiller
<jerome.pouiller@...abs.com>
Subject: [PATCH v2 08/17] staging: wfx: fix access to le32 attribute 'ps_mode_error'
From: Jérôme Pouiller <jerome.pouiller@...abs.com>
The attribute ps_mode_error is little-endian. We have to take to the
endianness when we access it.
Signed-off-by: Jérôme Pouiller <jerome.pouiller@...abs.com>
---
drivers/staging/wfx/hif_rx.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/staging/wfx/hif_rx.c
index 83c3fdbb10fa..87d5107a7757 100644
--- a/drivers/staging/wfx/hif_rx.c
+++ b/drivers/staging/wfx/hif_rx.c
@@ -158,6 +158,7 @@ static int hif_event_indication(struct wfx_dev *wdev,
{
struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface);
const struct hif_ind_event *body = buf;
+ int cause;
if (!wvif) {
dev_warn(wdev->dev, "received event for non-existent vif\n");
@@ -176,10 +177,10 @@ static int hif_event_indication(struct wfx_dev *wdev,
dev_dbg(wdev->dev, "ignore BSSREGAINED indication\n");
break;
case HIF_EVENT_IND_PS_MODE_ERROR:
+ cause = le32_to_cpu(body->event_data.ps_mode_error);
dev_warn(wdev->dev, "error while processing power save request: %d\n",
- body->event_data.ps_mode_error);
- if (body->event_data.ps_mode_error ==
- HIF_PS_ERROR_AP_NOT_RESP_TO_POLL) {
+ cause);
+ if (cause == HIF_PS_ERROR_AP_NOT_RESP_TO_POLL) {
wvif->bss_not_support_ps_poll = true;
schedule_work(&wvif->update_pm_work);
}
--
2.26.2
Powered by blists - more mailing lists