aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/wfx/hif_rx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/wfx/hif_rx.c')
-rw-r--r--drivers/staging/wfx/hif_rx.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/staging/wfx/hif_rx.c
index 9fca7f26372a..6963b54d5593 100644
--- a/drivers/staging/wfx/hif_rx.c
+++ b/drivers/staging/wfx/hif_rx.c
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
- * Implementation of chip-to-host event (aka indications) of WFxxx Split Mac
- * (WSM) API.
+ * Handling of the chip-to-host events (aka indications) of the hardware API.
*
* Copyright (c) 2017-2020, Silicon Laboratories, Inc.
* Copyright (c) 2010, ST-Ericsson
@@ -20,10 +19,10 @@
static int hif_generic_confirm(struct wfx_dev *wdev,
const struct hif_msg *hif, const void *buf)
{
- // All confirm messages start with status
+ /* All confirm messages start with status */
int status = le32_to_cpup((__le32 *)buf);
int cmd = hif->id;
- int len = le16_to_cpu(hif->len) - 4; // drop header
+ int len = le16_to_cpu(hif->len) - 4; /* drop header */
WARN(!mutex_is_locked(&wdev->hif_cmd.lock), "data locking error");
@@ -175,13 +174,14 @@ static int hif_scan_complete_indication(struct wfx_dev *wdev,
const void *buf)
{
struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface);
+ const struct hif_ind_scan_cmpl *body = buf;
if (!wvif) {
dev_warn(wdev->dev, "%s: received event for non-existent vif\n", __func__);
return -EIO;
}
- wfx_scan_complete(wvif);
+ wfx_scan_complete(wvif, body->num_channels_completed);
return 0;
}
@@ -244,7 +244,7 @@ static int hif_generic_indication(struct wfx_dev *wdev,
return 0;
case HIF_GENERIC_INDICATION_TYPE_RX_STATS:
mutex_lock(&wdev->rx_stats_lock);
- // Older firmware send a generic indication beside RxStats
+ /* Older firmware send a generic indication beside RxStats */
if (!wfx_api_older_than(wdev, 1, 4))
dev_info(wdev->dev, "Rx test ongoing. Temperature: %d degrees C\n",
body->data.rx_stats.current_temp);
@@ -297,7 +297,7 @@ static const struct {
"bus clock is too slow (<1kHz)" },
{ HIF_ERROR_HIF_RX_DATA_TOO_LARGE,
"HIF message too large" },
- // Following errors only exists in old firmware versions:
+ /* Following errors only exists in old firmware versions: */
{ HIF_ERROR_HIF_TX_QUEUE_FULL,
"HIF messages queue is full" },
{ HIF_ERROR_HIF_BUS,
@@ -374,7 +374,7 @@ static const struct {
{ HIF_IND_ID_GENERIC, hif_generic_indication },
{ HIF_IND_ID_ERROR, hif_error_indication },
{ HIF_IND_ID_EXCEPTION, hif_exception_indication },
- // FIXME: allocate skb_p from hif_receive_indication and make it generic
+ /* FIXME: allocate skb_p from hif_receive_indication and make it generic */
//{ HIF_IND_ID_RX, hif_receive_indication },
};
@@ -385,12 +385,13 @@ void wfx_handle_rx(struct wfx_dev *wdev, struct sk_buff *skb)
int hif_id = hif->id;
if (hif_id == HIF_IND_ID_RX) {
- // hif_receive_indication take care of skb lifetime
+ /* hif_receive_indication take care of skb lifetime */
hif_receive_indication(wdev, hif, hif->body, skb);
return;
}
- // Note: mutex_is_lock cause an implicit memory barrier that protect
- // buf_send
+ /* Note: mutex_is_lock cause an implicit memory barrier that protect
+ * buf_send
+ */
if (mutex_is_locked(&wdev->hif_cmd.lock) &&
wdev->hif_cmd.buf_send &&
wdev->hif_cmd.buf_send->id == hif_id) {