2022-01-13 08:55:54

by Jérôme Pouiller

[permalink] [raw]
Subject: [PATCH 00/31] staging/wfx: apply suggestions from the linux-wireless review

From: Jérôme Pouiller <[email protected]>

Most of the patches of this series are the result of the review process on
linux-wireless[1].

The patches 1 to 25 are cosmetics. The last 3 patches are not fully backward
compatible. I believe it is not a problem in the staging area.

[1]: https://lore.kernel.org/netdev/[email protected]/T/


Jérôme Pouiller (31):
staging: wfx: fix Makefile and Kconfig licenses
staging: wfx: fix HIF API license
staging: wfx: fix missing headers
staging: wfx: fix comment correctness
staging: wfx: explain uncommon Makefile statement
staging: wfx: remove unnecessary braces
staging: wfx: remove useless #ifdef
staging: wfx: use IS_ALIGNED()
staging: wfx: replace magic value by WFX_HIF_BUFFER_SIZE
stagigg: wfx: replace magic number by HIF_ID_IS_INDICATION
staging: wfx: preserve endianness of struct hif_ind_startup
staging: wfx: fix ambiguous function name
staging: wfx: fix ambiguous function name
staging: wfx: prefix functions from hif_*.h with wfx_
staging: wfx: prefix functions from hwio.h with wfx_
staging: wfx: prefix functions from debug.h with wfx_
staging: wfx: prefix tx_policy_is_equal() with wfx_
staging: wfx: prefix structs hif_* with wfx_
staging: wfx: prefix structs tx_policy and hwbus_ops with wfx_
staging: wfx: reformat code on 100 columns
staging: wfx: reformat comments on 100 columns
staging: wfx: fix structs alignments
staging: wfx: use explicit labels for errors
staging: wfx: replace compiletime_assert() by BUILD_BUG_ON_MSG()
staging: wfx: do not display functions names in logs
staging: wfx: remove force_ps_timeout
staging: wfx: map 'compatible' attribute with board name
staging: wfx: fix firmware location
staging: wfx: drop legacy compatible values
staging: wfx: rename "config-file" DT attribute
staging: wfx: do not probe the device if not in the DT

.../bindings/net/wireless/silabs,wfx.yaml | 23 +-
drivers/staging/wfx/Kconfig | 5 +
drivers/staging/wfx/Makefile | 3 +-
drivers/staging/wfx/bh.c | 67 +++---
drivers/staging/wfx/bh.h | 1 +
drivers/staging/wfx/bus.h | 8 +-
drivers/staging/wfx/bus_sdio.c | 97 +++++----
drivers/staging/wfx/bus_spi.c | 98 +++++----
drivers/staging/wfx/data_rx.c | 10 +-
drivers/staging/wfx/data_rx.h | 5 +-
drivers/staging/wfx/data_tx.c | 144 ++++++-------
drivers/staging/wfx/data_tx.h | 20 +-
drivers/staging/wfx/debug.c | 80 ++-----
drivers/staging/wfx/debug.h | 6 +-
drivers/staging/wfx/fwio.c | 113 +++++-----
drivers/staging/wfx/hif_api_cmd.h | 150 ++++++-------
drivers/staging/wfx/hif_api_general.h | 64 +++---
drivers/staging/wfx/hif_api_mib.h | 68 +++---
drivers/staging/wfx/hif_rx.c | 168 +++++++--------
drivers/staging/wfx/hif_tx.c | 194 ++++++++---------
drivers/staging/wfx/hif_tx.h | 67 +++---
drivers/staging/wfx/hif_tx_mib.c | 202 ++++++++----------
drivers/staging/wfx/hif_tx_mib.h | 67 +++---
drivers/staging/wfx/hwio.c | 171 +++++++--------
drivers/staging/wfx/hwio.h | 35 +--
drivers/staging/wfx/key.c | 84 +++-----
drivers/staging/wfx/key.h | 5 +-
drivers/staging/wfx/main.c | 183 +++++++---------
drivers/staging/wfx/main.h | 12 +-
drivers/staging/wfx/queue.c | 51 ++---
drivers/staging/wfx/queue.h | 13 +-
drivers/staging/wfx/scan.c | 27 +--
drivers/staging/wfx/sta.c | 194 +++++++----------
drivers/staging/wfx/sta.h | 22 +-
drivers/staging/wfx/traces.h | 33 ++-
drivers/staging/wfx/wfx.h | 94 ++++----
36 files changed, 1171 insertions(+), 1413 deletions(-)

--
2.34.1


2022-01-13 08:55:55

by Jérôme Pouiller

[permalink] [raw]
Subject: [PATCH 03/31] staging: wfx: fix missing headers

From: Jérôme Pouiller <[email protected]>

Each headers files should include every types it needs to compile (ie.
"gcc $CFLAGS -xc file.h" should compile)

Signed-off-by: Jérôme Pouiller <[email protected]>
---
drivers/staging/wfx/bh.h | 1 +
drivers/staging/wfx/hif_tx.h | 4 ++++
drivers/staging/wfx/hif_tx_mib.h | 7 ++++++-
3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/wfx/bh.h b/drivers/staging/wfx/bh.h
index 6c121ce4dd3f..a44c8b421b7c 100644
--- a/drivers/staging/wfx/bh.h
+++ b/drivers/staging/wfx/bh.h
@@ -10,6 +10,7 @@

#include <linux/atomic.h>
#include <linux/wait.h>
+#include <linux/completion.h>
#include <linux/workqueue.h>

struct wfx_dev;
diff --git a/drivers/staging/wfx/hif_tx.h b/drivers/staging/wfx/hif_tx.h
index e57eabdcfa77..f7895845686f 100644
--- a/drivers/staging/wfx/hif_tx.h
+++ b/drivers/staging/wfx/hif_tx.h
@@ -10,6 +10,10 @@
#ifndef WFX_HIF_TX_H
#define WFX_HIF_TX_H

+#include <linux/types.h>
+#include <linux/mutex.h>
+#include <linux/completion.h>
+
struct ieee80211_channel;
struct ieee80211_bss_conf;
struct ieee80211_tx_queue_params;
diff --git a/drivers/staging/wfx/hif_tx_mib.h b/drivers/staging/wfx/hif_tx_mib.h
index 2a3b84868ee4..fe08a69412ab 100644
--- a/drivers/staging/wfx/hif_tx_mib.h
+++ b/drivers/staging/wfx/hif_tx_mib.h
@@ -9,8 +9,13 @@
#ifndef WFX_HIF_TX_MIB_H
#define WFX_HIF_TX_MIB_H

-struct wfx_vif;
+#include <linux/types.h>
+
struct sk_buff;
+struct wfx_vif;
+struct wfx_dev;
+struct hif_ie_table_entry;
+struct hif_mib_extended_count_table;

int hif_set_output_power(struct wfx_vif *wvif, int val);
int hif_set_beacon_wakeup_period(struct wfx_vif *wvif,
--
2.34.1

2022-01-13 08:56:00

by Jérôme Pouiller

[permalink] [raw]
Subject: [PATCH 04/31] staging: wfx: fix comment correctness

From: Jérôme Pouiller <[email protected]>

Using DMA with stack allocated buffers is not supported, whatever the
value of CONFIG_VMAP_STACK.

Signed-off-by: Jérôme Pouiller <[email protected]>
---
drivers/staging/wfx/hwio.c | 12 ------------
drivers/staging/wfx/hwio.h | 4 ++++
2 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/drivers/staging/wfx/hwio.c b/drivers/staging/wfx/hwio.c
index 30eb888830d2..393bcb1e2f4e 100644
--- a/drivers/staging/wfx/hwio.c
+++ b/drivers/staging/wfx/hwio.c
@@ -14,18 +14,6 @@
#include "bus.h"
#include "traces.h"

-/*
- * Internal helpers.
- *
- * About CONFIG_VMAP_STACK:
- * When CONFIG_VMAP_STACK is enabled, it is not possible to run DMA on stack
- * allocated data. Functions below that work with registers (aka functions
- * ending with "32") automatically reallocate buffers with kmalloc. However,
- * functions that work with arbitrary length buffers let's caller to handle
- * memory location. In doubt, enable CONFIG_DEBUG_SG to detect badly located
- * buffer.
- */
-
static int read32(struct wfx_dev *wdev, int reg, u32 *val)
{
int ret;
diff --git a/drivers/staging/wfx/hwio.h b/drivers/staging/wfx/hwio.h
index ff09575dd1af..d34baae47017 100644
--- a/drivers/staging/wfx/hwio.h
+++ b/drivers/staging/wfx/hwio.h
@@ -12,6 +12,10 @@

struct wfx_dev;

+/* Caution: in the functions below, 'buf' will used with a DMA. So, it must be
+ * kmalloc'd (do not use stack allocated buffers). In doubt, enable
+ * CONFIG_DEBUG_SG to detect badly located buffer.
+ */
int wfx_data_read(struct wfx_dev *wdev, void *buf, size_t buf_len);
int wfx_data_write(struct wfx_dev *wdev, const void *buf, size_t buf_len);

--
2.34.1

2022-01-13 08:56:01

by Jérôme Pouiller

[permalink] [raw]
Subject: [PATCH 05/31] staging: wfx: explain uncommon Makefile statement

From: Jérôme Pouiller <[email protected]>

I have got questions about this line from several reviewers. A comment
is definitively welcome.

Signed-off-by: Jérôme Pouiller <[email protected]>
---
drivers/staging/wfx/Makefile | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/staging/wfx/Makefile b/drivers/staging/wfx/Makefile
index 1e99e6ffe044..ae94c6552d77 100644
--- a/drivers/staging/wfx/Makefile
+++ b/drivers/staging/wfx/Makefile
@@ -20,6 +20,7 @@ wfx-y := \
sta.o \
debug.o
wfx-$(CONFIG_SPI) += bus_spi.o
+# When CONFIG_MMC == m, append to 'wfx-y' (and not to 'wfx-m')
wfx-$(subst m,y,$(CONFIG_MMC)) += bus_sdio.o

obj-$(CONFIG_WFX) += wfx.o
--
2.34.1

2022-01-13 08:56:10

by Jérôme Pouiller

[permalink] [raw]
Subject: [PATCH 06/31] staging: wfx: remove unnecessary braces

From: Jérôme Pouiller <[email protected]>

Braces are not necessary for single statement blocks

Signed-off-by: Jérôme Pouiller <[email protected]>
---
drivers/staging/wfx/main.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c
index 858d778cc589..ddc95ea16b6d 100644
--- a/drivers/staging/wfx/main.c
+++ b/drivers/staging/wfx/main.c
@@ -438,12 +438,11 @@ int wfx_probe(struct wfx_dev *wdev)
eth_zero_addr(wdev->addresses[i].addr);
err = of_get_mac_address(wdev->dev->of_node,
wdev->addresses[i].addr);
- if (!err) {
+ if (!err)
wdev->addresses[i].addr[ETH_ALEN - 1] += i;
- } else {
+ else
ether_addr_copy(wdev->addresses[i].addr,
wdev->hw_caps.mac_addr[i]);
- }
if (!is_valid_ether_addr(wdev->addresses[i].addr)) {
dev_warn(wdev->dev, "using random MAC address\n");
eth_random_addr(wdev->addresses[i].addr);
--
2.34.1

2022-01-13 08:56:14

by Jérôme Pouiller

[permalink] [raw]
Subject: [PATCH 07/31] staging: wfx: remove useless #ifdef

From: Jérôme Pouiller <[email protected]>

In the old days, this file was shared with other projects. Obviously,
this "#ifdef __KERNEL__" have no reasons to be in the kernel.

Signed-off-by: Jérôme Pouiller <[email protected]>
---
drivers/staging/wfx/hif_api_general.h | 6 ------
1 file changed, 6 deletions(-)

diff --git a/drivers/staging/wfx/hif_api_general.h b/drivers/staging/wfx/hif_api_general.h
index 3e5c92e12d35..8244676112a5 100644
--- a/drivers/staging/wfx/hif_api_general.h
+++ b/drivers/staging/wfx/hif_api_general.h
@@ -8,14 +8,8 @@
#ifndef WFX_HIF_API_GENERAL_H
#define WFX_HIF_API_GENERAL_H

-#ifdef __KERNEL__
#include <linux/types.h>
#include <linux/if_ether.h>
-#else
-#include <net/ethernet.h>
-#include <stdint.h>
-#define __packed __attribute__((__packed__))
-#endif

#define HIF_ID_IS_INDICATION 0x80
#define HIF_COUNTER_MAX 7
--
2.34.1

2022-01-13 08:56:16

by Jérôme Pouiller

[permalink] [raw]
Subject: [PATCH 12/31] staging: wfx: fix ambiguous function name

From: Jérôme Pouiller <[email protected]>

The prefix 'ieee80211' is reserved for mac80211. It should not been
used.

Signed-off-by: Jérôme Pouiller <[email protected]>
---
drivers/staging/wfx/scan.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.c
index 668ef2c60837..a1fd0f850481 100644
--- a/drivers/staging/wfx/scan.c
+++ b/drivers/staging/wfx/scan.c
@@ -12,8 +12,8 @@
#include "sta.h"
#include "hif_tx_mib.h"

-static void __ieee80211_scan_completed_compat(struct ieee80211_hw *hw,
- bool aborted)
+static void wfx_ieee80211_scan_completed_compat(struct ieee80211_hw *hw,
+ bool aborted)
{
struct cfg80211_scan_info info = {
.aborted = aborted,
@@ -120,7 +120,7 @@ void wfx_hw_scan_work(struct work_struct *work)
} while (ret >= 0 && chan_cur < hw_req->req.n_channels);
mutex_unlock(&wvif->scan_lock);
mutex_unlock(&wvif->wdev->conf_mutex);
- __ieee80211_scan_completed_compat(wvif->wdev->hw, ret < 0);
+ wfx_ieee80211_scan_completed_compat(wvif->wdev->hw, ret < 0);
}

int wfx_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
--
2.34.1

2022-01-13 08:56:21

by Jérôme Pouiller

[permalink] [raw]
Subject: [PATCH 13/31] staging: wfx: fix ambiguous function name

From: Jérôme Pouiller <[email protected]>

The prefix 'ieee80211' is reserved for mac80211. It should not been
used.

Signed-off-by: Jérôme Pouiller <[email protected]>
---
drivers/staging/wfx/data_tx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c
index 5492375fe80a..9ff9cca5eb66 100644
--- a/drivers/staging/wfx/data_tx.c
+++ b/drivers/staging/wfx/data_tx.c
@@ -207,7 +207,7 @@ void wfx_tx_policy_init(struct wfx_vif *wvif)

/* Tx implementation */

-static bool ieee80211_is_action_back(struct ieee80211_hdr *hdr)
+static bool wfx_is_action_back(struct ieee80211_hdr *hdr)
{
struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)hdr;

@@ -420,7 +420,7 @@ void wfx_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control,
/* Because of TX_AMPDU_SETUP_IN_HW, mac80211 does not try to send any
* BlockAck session management frame. The check below exist just in case.
*/
- if (ieee80211_is_action_back(hdr)) {
+ if (wfx_is_action_back(hdr)) {
dev_info(wdev->dev, "drop BA action\n");
goto drop;
}
--
2.34.1

2022-01-13 08:56:34

by Jérôme Pouiller

[permalink] [raw]
Subject: [PATCH 10/31] stagigg: wfx: replace magic number by HIF_ID_IS_INDICATION

From: Jérôme Pouiller <[email protected]>

Magic values are not recommended.

Signed-off-by: Jérôme Pouiller <[email protected]>
---
drivers/staging/wfx/hif_rx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/staging/wfx/hif_rx.c
index 6963b54d5593..5e675d2c3e82 100644
--- a/drivers/staging/wfx/hif_rx.c
+++ b/drivers/staging/wfx/hif_rx.c
@@ -405,7 +405,7 @@ void wfx_handle_rx(struct wfx_dev *wdev, struct sk_buff *skb)
goto free;
}
}
- if (hif_id & 0x80)
+ if (hif_id & HIF_ID_IS_INDICATION)
dev_err(wdev->dev, "unsupported HIF indication: ID %02x\n",
hif_id);
else
--
2.34.1

2022-01-13 08:56:37

by Jérôme Pouiller

[permalink] [raw]
Subject: [PATCH 11/31] staging: wfx: preserve endianness of struct hif_ind_startup

From: Jérôme Pouiller <[email protected]>

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 <[email protected]>
---
drivers/staging/wfx/bh.c | 8 ++++----
drivers/staging/wfx/data_tx.c | 4 ++--
drivers/staging/wfx/hif_api_general.h | 12 ++++--------
drivers/staging/wfx/hif_rx.c | 5 -----
4 files changed, 10 insertions(+), 19 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;
diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c
index 052a19161dc5..5492375fe80a 100644
--- a/drivers/staging/wfx/data_tx.c
+++ b/drivers/staging/wfx/data_tx.c
@@ -359,10 +359,10 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta,
hif_msg->len = cpu_to_le16(skb->len);
hif_msg->id = HIF_REQ_ID_TX;
hif_msg->interface = wvif->id;
- if (skb->len > wvif->wdev->hw_caps.size_inp_ch_buf) {
+ if (skb->len > le16_to_cpu(wvif->wdev->hw_caps.size_inp_ch_buf)) {
dev_warn(wvif->wdev->dev,
"requested frame size (%d) is larger than maximum supported (%d)\n",
- skb->len, wvif->wdev->hw_caps.size_inp_ch_buf);
+ skb->len, le16_to_cpu(wvif->wdev->hw_caps.size_inp_ch_buf));
skb_pull(skb, wmsg_len);
return -EIO;
}
diff --git a/drivers/staging/wfx/hif_api_general.h b/drivers/staging/wfx/hif_api_general.h
index 8244676112a5..a57789ceb209 100644
--- a/drivers/staging/wfx/hif_api_general.h
+++ b/drivers/staging/wfx/hif_api_general.h
@@ -108,16 +108,12 @@ enum hif_api_rate_index {
};

struct hif_ind_startup {
- /* As the others, this struct is interpreted as little endian by the
- * device. However, this struct is also used by the driver. We prefer to
- * declare it in native order and doing byte swap on reception.
- */
__le32 status;
- u16 hardware_id;
+ __le16 hardware_id;
u8 opn[14];
u8 uid[8];
- u16 num_inp_ch_bufs;
- u16 size_inp_ch_buf;
+ __le16 num_inp_ch_bufs;
+ __le16 size_inp_ch_buf;
u8 num_links_ap;
u8 num_interfaces;
u8 mac_addr[2][ETH_ALEN];
@@ -138,7 +134,7 @@ struct hif_ind_startup {
u8 phy1_region:3;
u8 phy0_region:3;
u8 otp_phy_ver:2;
- u32 supported_rate_mask;
+ __le32 supported_rate_mask;
u8 firmware_label[128];
} __packed;

diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/staging/wfx/hif_rx.c
index 5e675d2c3e82..ea6d192ce28c 100644
--- a/drivers/staging/wfx/hif_rx.c
+++ b/drivers/staging/wfx/hif_rx.c
@@ -81,11 +81,6 @@ static int hif_startup_indication(struct wfx_dev *wdev,
return -EINVAL;
}
memcpy(&wdev->hw_caps, body, sizeof(struct hif_ind_startup));
- le16_to_cpus((__le16 *)&wdev->hw_caps.hardware_id);
- le16_to_cpus((__le16 *)&wdev->hw_caps.num_inp_ch_bufs);
- le16_to_cpus((__le16 *)&wdev->hw_caps.size_inp_ch_buf);
- le32_to_cpus((__le32 *)&wdev->hw_caps.supported_rate_mask);
-
complete(&wdev->firmware_ready);
return 0;
}
--
2.34.1

2022-01-13 08:56:43

by Jérôme Pouiller

[permalink] [raw]
Subject: [PATCH 14/31] staging: wfx: prefix functions from hif_*.h with wfx_

From: Jérôme Pouiller <[email protected]>

All the functions related to a driver should use the same prefix.

Signed-off-by: Jérôme Pouiller <[email protected]>
---
drivers/staging/wfx/data_tx.c | 2 +-
drivers/staging/wfx/debug.c | 2 +-
drivers/staging/wfx/hif_rx.c | 103 +++++++++---------
drivers/staging/wfx/hif_tx.c | 48 +++++----
drivers/staging/wfx/hif_tx.h | 48 ++++-----
drivers/staging/wfx/hif_tx_mib.c | 177 ++++++++++++++++---------------
drivers/staging/wfx/hif_tx_mib.h | 67 ++++++------
drivers/staging/wfx/key.c | 4 +-
drivers/staging/wfx/main.c | 12 +--
drivers/staging/wfx/scan.c | 10 +-
drivers/staging/wfx/sta.c | 92 ++++++++--------
11 files changed, 291 insertions(+), 274 deletions(-)

diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c
index 9ff9cca5eb66..54ff9bca78d6 100644
--- a/drivers/staging/wfx/data_tx.c
+++ b/drivers/staging/wfx/data_tx.c
@@ -173,7 +173,7 @@ static int wfx_tx_policy_upload(struct wfx_vif *wvif)
policies[i].uploaded = true;
memcpy(tmp_rates, policies[i].rates, sizeof(tmp_rates));
spin_unlock_bh(&wvif->tx_policy_cache.lock);
- hif_set_tx_rate_retry_policy(wvif, i, tmp_rates);
+ wfx_hif_set_tx_rate_retry_policy(wvif, i, tmp_rates);
} else {
spin_unlock_bh(&wvif->tx_policy_cache.lock);
}
diff --git a/drivers/staging/wfx/debug.c b/drivers/staging/wfx/debug.c
index 9f93268a3202..e5f940f19bbe 100644
--- a/drivers/staging/wfx/debug.c
+++ b/drivers/staging/wfx/debug.c
@@ -66,7 +66,7 @@ static int wfx_counters_show(struct seq_file *seq, void *v)
struct hif_mib_extended_count_table counters[3];

for (i = 0; i < ARRAY_SIZE(counters); i++) {
- ret = hif_get_counters_table(wdev, i, counters + i);
+ ret = wfx_hif_get_counters_table(wdev, i, counters + i);
if (ret < 0)
return ret;
if (ret > 0)
diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/staging/wfx/hif_rx.c
index ea6d192ce28c..7a2a32e3ceb9 100644
--- a/drivers/staging/wfx/hif_rx.c
+++ b/drivers/staging/wfx/hif_rx.c
@@ -16,8 +16,8 @@
#include "data_rx.h"
#include "hif_api_cmd.h"

-static int hif_generic_confirm(struct wfx_dev *wdev,
- const struct hif_msg *hif, const void *buf)
+static int wfx_hif_generic_confirm(struct wfx_dev *wdev,
+ const struct hif_msg *hif, const void *buf)
{
/* All confirm messages start with status */
int status = le32_to_cpup((__le32 *)buf);
@@ -50,8 +50,8 @@ static int hif_generic_confirm(struct wfx_dev *wdev,
return status;
}

-static int hif_tx_confirm(struct wfx_dev *wdev,
- const struct hif_msg *hif, const void *buf)
+static int wfx_hif_tx_confirm(struct wfx_dev *wdev,
+ const struct hif_msg *hif, const void *buf)
{
const struct hif_cnf_tx *body = buf;

@@ -59,8 +59,8 @@ static int hif_tx_confirm(struct wfx_dev *wdev,
return 0;
}

-static int hif_multi_tx_confirm(struct wfx_dev *wdev,
- const struct hif_msg *hif, const void *buf)
+static int wfx_hif_multi_tx_confirm(struct wfx_dev *wdev,
+ const struct hif_msg *hif, const void *buf)
{
const struct hif_cnf_multi_transmit *body = buf;
int i;
@@ -71,8 +71,9 @@ static int hif_multi_tx_confirm(struct wfx_dev *wdev,
return 0;
}

-static int hif_startup_indication(struct wfx_dev *wdev,
- const struct hif_msg *hif, const void *buf)
+static int wfx_hif_startup_indication(struct wfx_dev *wdev,
+ const struct hif_msg *hif,
+ const void *buf)
{
const struct hif_ind_startup *body = buf;

@@ -85,8 +86,8 @@ static int hif_startup_indication(struct wfx_dev *wdev,
return 0;
}

-static int hif_wakeup_indication(struct wfx_dev *wdev,
- const struct hif_msg *hif, const void *buf)
+static int wfx_hif_wakeup_indication(struct wfx_dev *wdev,
+ const struct hif_msg *hif, const void *buf)
{
if (!wdev->pdata.gpio_wakeup ||
gpiod_get_value(wdev->pdata.gpio_wakeup) == 0) {
@@ -96,9 +97,9 @@ static int hif_wakeup_indication(struct wfx_dev *wdev,
return 0;
}

-static int hif_receive_indication(struct wfx_dev *wdev,
- const struct hif_msg *hif,
- const void *buf, struct sk_buff *skb)
+static int wfx_hif_receive_indication(struct wfx_dev *wdev,
+ const struct hif_msg *hif,
+ const void *buf, struct sk_buff *skb)
{
struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface);
const struct hif_ind_rx *body = buf;
@@ -114,8 +115,8 @@ static int hif_receive_indication(struct wfx_dev *wdev,
return 0;
}

-static int hif_event_indication(struct wfx_dev *wdev,
- const struct hif_msg *hif, const void *buf)
+static int wfx_hif_event_indication(struct wfx_dev *wdev,
+ const struct hif_msg *hif, const void *buf)
{
struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface);
const struct hif_ind_event *body = buf;
@@ -149,9 +150,9 @@ static int hif_event_indication(struct wfx_dev *wdev,
return 0;
}

-static int hif_pm_mode_complete_indication(struct wfx_dev *wdev,
- const struct hif_msg *hif,
- const void *buf)
+static int wfx_hif_pm_mode_complete_indication(struct wfx_dev *wdev,
+ const struct hif_msg *hif,
+ const void *buf)
{
struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface);

@@ -164,9 +165,9 @@ static int hif_pm_mode_complete_indication(struct wfx_dev *wdev,
return 0;
}

-static int hif_scan_complete_indication(struct wfx_dev *wdev,
- const struct hif_msg *hif,
- const void *buf)
+static int wfx_hif_scan_complete_indication(struct wfx_dev *wdev,
+ const struct hif_msg *hif,
+ const void *buf)
{
struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface);
const struct hif_ind_scan_cmpl *body = buf;
@@ -181,9 +182,9 @@ static int hif_scan_complete_indication(struct wfx_dev *wdev,
return 0;
}

-static int hif_join_complete_indication(struct wfx_dev *wdev,
- const struct hif_msg *hif,
- const void *buf)
+static int wfx_hif_join_complete_indication(struct wfx_dev *wdev,
+ const struct hif_msg *hif,
+ const void *buf)
{
struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface);

@@ -196,9 +197,9 @@ static int hif_join_complete_indication(struct wfx_dev *wdev,
return 0;
}

-static int hif_suspend_resume_indication(struct wfx_dev *wdev,
- const struct hif_msg *hif,
- const void *buf)
+static int wfx_hif_suspend_resume_indication(struct wfx_dev *wdev,
+ const struct hif_msg *hif,
+ const void *buf)
{
const struct hif_ind_suspend_resume_tx *body = buf;
struct wfx_vif *wvif;
@@ -225,8 +226,9 @@ static int hif_suspend_resume_indication(struct wfx_dev *wdev,
return 0;
}

-static int hif_generic_indication(struct wfx_dev *wdev,
- const struct hif_msg *hif, const void *buf)
+static int wfx_hif_generic_indication(struct wfx_dev *wdev,
+ const struct hif_msg *hif,
+ const void *buf)
{
const struct hif_ind_generic *body = buf;
int type = le32_to_cpu(body->type);
@@ -305,8 +307,8 @@ static const struct {
"secure link params (nonce or tag) mismatch" },
};

-static int hif_error_indication(struct wfx_dev *wdev,
- const struct hif_msg *hif, const void *buf)
+static int wfx_hif_error_indication(struct wfx_dev *wdev,
+ const struct hif_msg *hif, const void *buf)
{
const struct hif_ind_error *body = buf;
int type = le32_to_cpu(body->type);
@@ -332,8 +334,9 @@ static int hif_error_indication(struct wfx_dev *wdev,
return 0;
};

-static int hif_exception_indication(struct wfx_dev *wdev,
- const struct hif_msg *hif, const void *buf)
+static int wfx_hif_exception_indication(struct wfx_dev *wdev,
+ const struct hif_msg *hif,
+ const void *buf)
{
const struct hif_ind_exception *body = buf;
int type = le32_to_cpu(body->type);
@@ -356,21 +359,21 @@ static const struct {
const struct hif_msg *hif, const void *buf);
} hif_handlers[] = {
/* Confirmations */
- { HIF_CNF_ID_TX, hif_tx_confirm },
- { HIF_CNF_ID_MULTI_TRANSMIT, hif_multi_tx_confirm },
+ { HIF_CNF_ID_TX, wfx_hif_tx_confirm },
+ { HIF_CNF_ID_MULTI_TRANSMIT, wfx_hif_multi_tx_confirm },
/* Indications */
- { HIF_IND_ID_STARTUP, hif_startup_indication },
- { HIF_IND_ID_WAKEUP, hif_wakeup_indication },
- { HIF_IND_ID_JOIN_COMPLETE, hif_join_complete_indication },
- { HIF_IND_ID_SET_PM_MODE_CMPL, hif_pm_mode_complete_indication },
- { HIF_IND_ID_SCAN_CMPL, hif_scan_complete_indication },
- { HIF_IND_ID_SUSPEND_RESUME_TX, hif_suspend_resume_indication },
- { HIF_IND_ID_EVENT, hif_event_indication },
- { 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 */
- //{ HIF_IND_ID_RX, hif_receive_indication },
+ { HIF_IND_ID_STARTUP, wfx_hif_startup_indication },
+ { HIF_IND_ID_WAKEUP, wfx_hif_wakeup_indication },
+ { HIF_IND_ID_JOIN_COMPLETE, wfx_hif_join_complete_indication },
+ { HIF_IND_ID_SET_PM_MODE_CMPL, wfx_hif_pm_mode_complete_indication },
+ { HIF_IND_ID_SCAN_CMPL, wfx_hif_scan_complete_indication },
+ { HIF_IND_ID_SUSPEND_RESUME_TX, wfx_hif_suspend_resume_indication },
+ { HIF_IND_ID_EVENT, wfx_hif_event_indication },
+ { HIF_IND_ID_GENERIC, wfx_hif_generic_indication },
+ { HIF_IND_ID_ERROR, wfx_hif_error_indication },
+ { HIF_IND_ID_EXCEPTION, wfx_hif_exception_indication },
+ /* FIXME: allocate skb_p from wfx_hif_receive_indication and make it generic */
+ //{ HIF_IND_ID_RX, wfx_hif_receive_indication },
};

void wfx_handle_rx(struct wfx_dev *wdev, struct sk_buff *skb)
@@ -380,8 +383,8 @@ 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(wdev, hif, hif->body, skb);
+ /* wfx_hif_receive_indication take care of skb lifetime */
+ wfx_hif_receive_indication(wdev, hif, hif->body, skb);
return;
}
/* Note: mutex_is_lock cause an implicit memory barrier that protect
@@ -390,7 +393,7 @@ void wfx_handle_rx(struct wfx_dev *wdev, struct sk_buff *skb)
if (mutex_is_locked(&wdev->hif_cmd.lock) &&
wdev->hif_cmd.buf_send &&
wdev->hif_cmd.buf_send->id == hif_id) {
- hif_generic_confirm(wdev, hif, hif->body);
+ wfx_hif_generic_confirm(wdev, hif, hif->body);
goto free;
}
for (i = 0; i < ARRAY_SIZE(hif_handlers); i++) {
diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c
index 2fd8bbd36e25..7c9d3d86c22e 100644
--- a/drivers/staging/wfx/hif_tx.c
+++ b/drivers/staging/wfx/hif_tx.c
@@ -122,7 +122,7 @@ int wfx_cmd_send(struct wfx_dev *wdev, struct hif_msg *request,
/* This function is special. After HIF_REQ_ID_SHUT_DOWN, chip won't reply to any
* request anymore. Obviously, only call this function during device unregister.
*/
-int hif_shutdown(struct wfx_dev *wdev)
+int wfx_hif_shutdown(struct wfx_dev *wdev)
{
int ret;
struct hif_msg *hif;
@@ -140,7 +140,7 @@ int hif_shutdown(struct wfx_dev *wdev)
return ret;
}

-int hif_configuration(struct wfx_dev *wdev, const u8 *conf, size_t len)
+int wfx_hif_configuration(struct wfx_dev *wdev, const u8 *conf, size_t len)
{
int ret;
size_t buf_len = sizeof(struct hif_req_configuration) + len;
@@ -157,7 +157,7 @@ int hif_configuration(struct wfx_dev *wdev, const u8 *conf, size_t len)
return ret;
}

-int hif_reset(struct wfx_vif *wvif, bool reset_stat)
+int wfx_hif_reset(struct wfx_vif *wvif, bool reset_stat)
{
int ret;
struct hif_msg *hif;
@@ -172,8 +172,8 @@ int hif_reset(struct wfx_vif *wvif, bool reset_stat)
return ret;
}

-int hif_read_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id,
- void *val, size_t val_len)
+int wfx_hif_read_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id,
+ void *val, size_t val_len)
{
int ret;
struct hif_msg *hif;
@@ -208,8 +208,8 @@ int hif_read_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id,
return ret;
}

-int hif_write_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id,
- void *val, size_t val_len)
+int wfx_hif_write_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id,
+ void *val, size_t val_len)
{
int ret;
struct hif_msg *hif;
@@ -227,8 +227,8 @@ int hif_write_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id,
return ret;
}

-int hif_scan(struct wfx_vif *wvif, struct cfg80211_scan_request *req,
- int chan_start_idx, int chan_num)
+int wfx_hif_scan(struct wfx_vif *wvif, struct cfg80211_scan_request *req,
+ int chan_start_idx, int chan_num)
{
int ret, i;
struct hif_msg *hif;
@@ -276,7 +276,7 @@ int hif_scan(struct wfx_vif *wvif, struct cfg80211_scan_request *req,
return ret;
}

-int hif_stop_scan(struct wfx_vif *wvif)
+int wfx_hif_stop_scan(struct wfx_vif *wvif)
{
int ret;
struct hif_msg *hif;
@@ -291,8 +291,8 @@ int hif_stop_scan(struct wfx_vif *wvif)
return ret;
}

-int hif_join(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf,
- struct ieee80211_channel *channel, const u8 *ssid, int ssidlen)
+int wfx_hif_join(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf,
+ struct ieee80211_channel *channel, const u8 *ssid, int ssidlen)
{
int ret;
struct hif_msg *hif;
@@ -322,7 +322,7 @@ int hif_join(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf,
return ret;
}

-int hif_set_bss_params(struct wfx_vif *wvif, int aid, int beacon_lost_count)
+int wfx_hif_set_bss_params(struct wfx_vif *wvif, int aid, int beacon_lost_count)
{
int ret;
struct hif_msg *hif;
@@ -340,7 +340,7 @@ int hif_set_bss_params(struct wfx_vif *wvif, int aid, int beacon_lost_count)
return ret;
}

-int hif_add_key(struct wfx_dev *wdev, const struct hif_req_add_key *arg)
+int wfx_hif_add_key(struct wfx_dev *wdev, const struct hif_req_add_key *arg)
{
int ret;
struct hif_msg *hif;
@@ -364,7 +364,7 @@ int hif_add_key(struct wfx_dev *wdev, const struct hif_req_add_key *arg)
return ret;
}

-int hif_remove_key(struct wfx_dev *wdev, int idx)
+int wfx_hif_remove_key(struct wfx_dev *wdev, int idx)
{
int ret;
struct hif_msg *hif;
@@ -379,8 +379,8 @@ int hif_remove_key(struct wfx_dev *wdev, int idx)
return ret;
}

-int hif_set_edca_queue_params(struct wfx_vif *wvif, u16 queue,
- const struct ieee80211_tx_queue_params *arg)
+int wfx_hif_set_edca_queue_params(struct wfx_vif *wvif, u16 queue,
+ const struct ieee80211_tx_queue_params *arg)
{
int ret;
struct hif_msg *hif;
@@ -410,7 +410,7 @@ int hif_set_edca_queue_params(struct wfx_vif *wvif, u16 queue,
return ret;
}

-int hif_set_pm(struct wfx_vif *wvif, bool ps, int dynamic_ps_timeout)
+int wfx_hif_set_pm(struct wfx_vif *wvif, bool ps, int dynamic_ps_timeout)
{
int ret;
struct hif_msg *hif;
@@ -434,8 +434,8 @@ int hif_set_pm(struct wfx_vif *wvif, bool ps, int dynamic_ps_timeout)
return ret;
}

-int hif_start(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf,
- const struct ieee80211_channel *channel)
+int wfx_hif_start(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf,
+ const struct ieee80211_channel *channel)
{
int ret;
struct hif_msg *hif;
@@ -458,7 +458,7 @@ int hif_start(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf,
return ret;
}

-int hif_beacon_transmit(struct wfx_vif *wvif, bool enable)
+int wfx_hif_beacon_transmit(struct wfx_vif *wvif, bool enable)
{
int ret;
struct hif_msg *hif;
@@ -475,7 +475,8 @@ int hif_beacon_transmit(struct wfx_vif *wvif, bool enable)
return ret;
}

-int hif_map_link(struct wfx_vif *wvif, bool unmap, u8 *mac_addr, int sta_id, bool mfp)
+int wfx_hif_map_link(struct wfx_vif *wvif, bool unmap, u8 *mac_addr, int sta_id,
+ bool mfp)
{
int ret;
struct hif_msg *hif;
@@ -494,7 +495,8 @@ int hif_map_link(struct wfx_vif *wvif, bool unmap, u8 *mac_addr, int sta_id, boo
return ret;
}

-int hif_update_ie_beacon(struct wfx_vif *wvif, const u8 *ies, size_t ies_len)
+int wfx_hif_update_ie_beacon(struct wfx_vif *wvif,
+ const u8 *ies, size_t ies_len)
{
int ret;
struct hif_msg *hif;
diff --git a/drivers/staging/wfx/hif_tx.h b/drivers/staging/wfx/hif_tx.h
index f7895845686f..b28a2ee5350a 100644
--- a/drivers/staging/wfx/hif_tx.h
+++ b/drivers/staging/wfx/hif_tx.h
@@ -36,29 +36,29 @@ void wfx_init_hif_cmd(struct wfx_hif_cmd *wfx_hif_cmd);
int wfx_cmd_send(struct wfx_dev *wdev, struct hif_msg *request,
void *reply, size_t reply_len, bool async);

-int hif_shutdown(struct wfx_dev *wdev);
-int hif_configuration(struct wfx_dev *wdev, const u8 *conf, size_t len);
-int hif_reset(struct wfx_vif *wvif, bool reset_stat);
-int hif_read_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id,
- void *buf, size_t buf_size);
-int hif_write_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id,
- void *buf, size_t buf_size);
-int hif_scan(struct wfx_vif *wvif, struct cfg80211_scan_request *req80211,
- int chan_start, int chan_num);
-int hif_stop_scan(struct wfx_vif *wvif);
-int hif_join(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf,
- struct ieee80211_channel *channel, const u8 *ssid, int ssidlen);
-int hif_set_pm(struct wfx_vif *wvif, bool ps, int dynamic_ps_timeout);
-int hif_set_bss_params(struct wfx_vif *wvif, int aid, int beacon_lost_count);
-int hif_add_key(struct wfx_dev *wdev, const struct hif_req_add_key *arg);
-int hif_remove_key(struct wfx_dev *wdev, int idx);
-int hif_set_edca_queue_params(struct wfx_vif *wvif, u16 queue,
- const struct ieee80211_tx_queue_params *arg);
-int hif_start(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf,
- const struct ieee80211_channel *channel);
-int hif_beacon_transmit(struct wfx_vif *wvif, bool enable);
-int hif_map_link(struct wfx_vif *wvif,
- bool unmap, u8 *mac_addr, int sta_id, bool mfp);
-int hif_update_ie_beacon(struct wfx_vif *wvif, const u8 *ies, size_t ies_len);
+int wfx_hif_read_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id,
+ void *buf, size_t buf_size);
+int wfx_hif_write_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id,
+ void *buf, size_t buf_size);
+int wfx_hif_start(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf,
+ const struct ieee80211_channel *channel);
+int wfx_hif_reset(struct wfx_vif *wvif, bool reset_stat);
+int wfx_hif_join(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf,
+ struct ieee80211_channel *channel, const u8 *ssid, int ssidlen);
+int wfx_hif_map_link(struct wfx_vif *wvif,
+ bool unmap, u8 *mac_addr, int sta_id, bool mfp);
+int wfx_hif_add_key(struct wfx_dev *wdev, const struct hif_req_add_key *arg);
+int wfx_hif_remove_key(struct wfx_dev *wdev, int idx);
+int wfx_hif_set_pm(struct wfx_vif *wvif, bool ps, int dynamic_ps_timeout);
+int wfx_hif_set_bss_params(struct wfx_vif *wvif, int aid, int beacon_lost_count);
+int wfx_hif_set_edca_queue_params(struct wfx_vif *wvif, u16 queue,
+ const struct ieee80211_tx_queue_params *arg);
+int wfx_hif_beacon_transmit(struct wfx_vif *wvif, bool enable);
+int wfx_hif_update_ie_beacon(struct wfx_vif *wvif, const u8 *ies, size_t ies_len);
+int wfx_hif_scan(struct wfx_vif *wvif, struct cfg80211_scan_request *req80211,
+ int chan_start, int chan_num);
+int wfx_hif_stop_scan(struct wfx_vif *wvif);
+int wfx_hif_configuration(struct wfx_dev *wdev, const u8 *conf, size_t len);
+int wfx_hif_shutdown(struct wfx_dev *wdev);

#endif
diff --git a/drivers/staging/wfx/hif_tx_mib.c b/drivers/staging/wfx/hif_tx_mib.c
index 97e961e6bcf6..b79ffdf6fcd2 100644
--- a/drivers/staging/wfx/hif_tx_mib.c
+++ b/drivers/staging/wfx/hif_tx_mib.c
@@ -14,20 +14,20 @@
#include "hif_tx_mib.h"
#include "hif_api_mib.h"

-int hif_set_output_power(struct wfx_vif *wvif, int val)
+int wfx_hif_set_output_power(struct wfx_vif *wvif, int val)
{
struct hif_mib_current_tx_power_level arg = {
.power_level = cpu_to_le32(val * 10),
};

- return hif_write_mib(wvif->wdev, wvif->id,
- HIF_MIB_ID_CURRENT_TX_POWER_LEVEL,
- &arg, sizeof(arg));
+ return wfx_hif_write_mib(wvif->wdev, wvif->id,
+ HIF_MIB_ID_CURRENT_TX_POWER_LEVEL,
+ &arg, sizeof(arg));
}

-int hif_set_beacon_wakeup_period(struct wfx_vif *wvif,
- unsigned int dtim_interval,
- unsigned int listen_interval)
+int wfx_hif_set_beacon_wakeup_period(struct wfx_vif *wvif,
+ unsigned int dtim_interval,
+ unsigned int listen_interval)
{
struct hif_mib_beacon_wake_up_period arg = {
.wakeup_period_min = dtim_interval,
@@ -37,13 +37,13 @@ int hif_set_beacon_wakeup_period(struct wfx_vif *wvif,

if (dtim_interval > 0xFF || listen_interval > 0xFFFF)
return -EINVAL;
- return hif_write_mib(wvif->wdev, wvif->id,
- HIF_MIB_ID_BEACON_WAKEUP_PERIOD,
- &arg, sizeof(arg));
+ return wfx_hif_write_mib(wvif->wdev, wvif->id,
+ HIF_MIB_ID_BEACON_WAKEUP_PERIOD,
+ &arg, sizeof(arg));
}

-int hif_set_rcpi_rssi_threshold(struct wfx_vif *wvif,
- int rssi_thold, int rssi_hyst)
+int wfx_hif_set_rcpi_rssi_threshold(struct wfx_vif *wvif,
+ int rssi_thold, int rssi_hyst)
{
struct hif_mib_rcpi_rssi_threshold arg = {
.rolling_average_count = 8,
@@ -60,37 +60,39 @@ int hif_set_rcpi_rssi_threshold(struct wfx_vif *wvif,
arg.lower_threshold = (arg.lower_threshold + 110) * 2;
}

- return hif_write_mib(wvif->wdev, wvif->id,
- HIF_MIB_ID_RCPI_RSSI_THRESHOLD, &arg, sizeof(arg));
+ return wfx_hif_write_mib(wvif->wdev, wvif->id,
+ HIF_MIB_ID_RCPI_RSSI_THRESHOLD,
+ &arg, sizeof(arg));
}

-int hif_get_counters_table(struct wfx_dev *wdev, int vif_id,
- struct hif_mib_extended_count_table *arg)
+int wfx_hif_get_counters_table(struct wfx_dev *wdev, int vif_id,
+ struct hif_mib_extended_count_table *arg)
{
if (wfx_api_older_than(wdev, 1, 3)) {
/* extended_count_table is wider than count_table */
memset(arg, 0xFF, sizeof(*arg));
- return hif_read_mib(wdev, vif_id, HIF_MIB_ID_COUNTERS_TABLE,
+ return wfx_hif_read_mib(wdev, vif_id, HIF_MIB_ID_COUNTERS_TABLE,
arg, sizeof(struct hif_mib_count_table));
} else {
- return hif_read_mib(wdev, vif_id,
+ return wfx_hif_read_mib(wdev, vif_id,
HIF_MIB_ID_EXTENDED_COUNTERS_TABLE, arg,
sizeof(struct hif_mib_extended_count_table));
}
}

-int hif_set_macaddr(struct wfx_vif *wvif, u8 *mac)
+int wfx_hif_set_macaddr(struct wfx_vif *wvif, u8 *mac)
{
struct hif_mib_mac_address arg = { };

if (mac)
ether_addr_copy(arg.mac_addr, mac);
- return hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_DOT11_MAC_ADDRESS,
- &arg, sizeof(arg));
+ return wfx_hif_write_mib(wvif->wdev, wvif->id,
+ HIF_MIB_ID_DOT11_MAC_ADDRESS,
+ &arg, sizeof(arg));
}

-int hif_set_rx_filter(struct wfx_vif *wvif,
- bool filter_bssid, bool filter_prbreq)
+int wfx_hif_set_rx_filter(struct wfx_vif *wvif,
+ bool filter_bssid, bool filter_prbreq)
{
struct hif_mib_rx_filter arg = { };

@@ -98,12 +100,12 @@ int hif_set_rx_filter(struct wfx_vif *wvif,
arg.bssid_filter = 1;
if (!filter_prbreq)
arg.fwd_probe_req = 1;
- return hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_RX_FILTER,
- &arg, sizeof(arg));
+ return wfx_hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_RX_FILTER,
+ &arg, sizeof(arg));
}

-int hif_set_beacon_filter_table(struct wfx_vif *wvif, int tbl_len,
- const struct hif_ie_table_entry *tbl)
+int wfx_hif_set_beacon_filter_table(struct wfx_vif *wvif, int tbl_len,
+ const struct hif_ie_table_entry *tbl)
{
int ret;
struct hif_mib_bcn_filter_table *arg;
@@ -114,37 +116,38 @@ int hif_set_beacon_filter_table(struct wfx_vif *wvif, int tbl_len,
return -ENOMEM;
arg->num_of_info_elmts = cpu_to_le32(tbl_len);
memcpy(arg->ie_table, tbl, flex_array_size(arg, ie_table, tbl_len));
- ret = hif_write_mib(wvif->wdev, wvif->id,
- HIF_MIB_ID_BEACON_FILTER_TABLE, arg, buf_len);
+ ret = wfx_hif_write_mib(wvif->wdev, wvif->id,
+ HIF_MIB_ID_BEACON_FILTER_TABLE, arg, buf_len);
kfree(arg);
return ret;
}

-int hif_beacon_filter_control(struct wfx_vif *wvif,
- int enable, int beacon_count)
+int wfx_hif_beacon_filter_control(struct wfx_vif *wvif,
+ int enable, int beacon_count)
{
struct hif_mib_bcn_filter_enable arg = {
.enable = cpu_to_le32(enable),
.bcn_count = cpu_to_le32(beacon_count),
};
- return hif_write_mib(wvif->wdev, wvif->id,
- HIF_MIB_ID_BEACON_FILTER_ENABLE,
- &arg, sizeof(arg));
+ return wfx_hif_write_mib(wvif->wdev, wvif->id,
+ HIF_MIB_ID_BEACON_FILTER_ENABLE,
+ &arg, sizeof(arg));
}

-int hif_set_operational_mode(struct wfx_dev *wdev, enum hif_op_power_mode mode)
+int wfx_hif_set_operational_mode(struct wfx_dev *wdev,
+ enum hif_op_power_mode mode)
{
struct hif_mib_gl_operational_power_mode arg = {
.power_mode = mode,
.wup_ind_activation = 1,
};

- return hif_write_mib(wdev, -1, HIF_MIB_ID_GL_OPERATIONAL_POWER_MODE,
- &arg, sizeof(arg));
+ return wfx_hif_write_mib(wdev, -1, HIF_MIB_ID_GL_OPERATIONAL_POWER_MODE,
+ &arg, sizeof(arg));
}

-int hif_set_template_frame(struct wfx_vif *wvif, struct sk_buff *skb,
- u8 frame_type, int init_rate)
+int wfx_hif_set_template_frame(struct wfx_vif *wvif, struct sk_buff *skb,
+ u8 frame_type, int init_rate)
{
struct hif_mib_template_frame *arg;

@@ -155,11 +158,11 @@ int hif_set_template_frame(struct wfx_vif *wvif, struct sk_buff *skb,
arg->init_rate = init_rate;
arg->frame_type = frame_type;
arg->frame_length = cpu_to_le16(skb->len);
- return hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_TEMPLATE_FRAME,
- arg, sizeof(*arg) + skb->len);
+ return wfx_hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_TEMPLATE_FRAME,
+ arg, sizeof(*arg) + skb->len);
}

-int hif_set_mfp(struct wfx_vif *wvif, bool capable, bool required)
+int wfx_hif_set_mfp(struct wfx_vif *wvif, bool capable, bool required)
{
struct hif_mib_protected_mgmt_policy arg = { };

@@ -170,25 +173,26 @@ int hif_set_mfp(struct wfx_vif *wvif, bool capable, bool required)
}
if (!required)
arg.unpmf_allowed = 1;
- return hif_write_mib(wvif->wdev, wvif->id,
- HIF_MIB_ID_PROTECTED_MGMT_POLICY,
- &arg, sizeof(arg));
+ return wfx_hif_write_mib(wvif->wdev, wvif->id,
+ HIF_MIB_ID_PROTECTED_MGMT_POLICY,
+ &arg, sizeof(arg));
}

-int hif_set_block_ack_policy(struct wfx_vif *wvif,
- u8 tx_tid_policy, u8 rx_tid_policy)
+int wfx_hif_set_block_ack_policy(struct wfx_vif *wvif,
+ u8 tx_tid_policy, u8 rx_tid_policy)
{
struct hif_mib_block_ack_policy arg = {
.block_ack_tx_tid_policy = tx_tid_policy,
.block_ack_rx_tid_policy = rx_tid_policy,
};

- return hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_BLOCK_ACK_POLICY,
- &arg, sizeof(arg));
+ return wfx_hif_write_mib(wvif->wdev, wvif->id,
+ HIF_MIB_ID_BLOCK_ACK_POLICY,
+ &arg, sizeof(arg));
}

-int hif_set_association_mode(struct wfx_vif *wvif, int ampdu_density,
- bool greenfield, bool short_preamble)
+int wfx_hif_set_association_mode(struct wfx_vif *wvif, int ampdu_density,
+ bool greenfield, bool short_preamble)
{
struct hif_mib_set_association_mode arg = {
.preambtype_use = 1,
@@ -199,12 +203,13 @@ int hif_set_association_mode(struct wfx_vif *wvif, int ampdu_density,
.mpdu_start_spacing = ampdu_density,
};

- return hif_write_mib(wvif->wdev, wvif->id,
- HIF_MIB_ID_SET_ASSOCIATION_MODE, &arg, sizeof(arg));
+ return wfx_hif_write_mib(wvif->wdev, wvif->id,
+ HIF_MIB_ID_SET_ASSOCIATION_MODE,
+ &arg, sizeof(arg));
}

-int hif_set_tx_rate_retry_policy(struct wfx_vif *wvif,
- int policy_index, u8 *rates)
+int wfx_hif_set_tx_rate_retry_policy(struct wfx_vif *wvif,
+ int policy_index, u8 *rates)
{
struct hif_mib_set_tx_rate_retry_policy *arg;
size_t size = struct_size(arg, tx_rate_retry_policy, 1);
@@ -222,23 +227,25 @@ int hif_set_tx_rate_retry_policy(struct wfx_vif *wvif,
arg->tx_rate_retry_policy[0].count_init = 1;
memcpy(&arg->tx_rate_retry_policy[0].rates, rates,
sizeof(arg->tx_rate_retry_policy[0].rates));
- ret = hif_write_mib(wvif->wdev, wvif->id,
- HIF_MIB_ID_SET_TX_RATE_RETRY_POLICY, arg, size);
+ ret = wfx_hif_write_mib(wvif->wdev, wvif->id,
+ HIF_MIB_ID_SET_TX_RATE_RETRY_POLICY,
+ arg, size);
kfree(arg);
return ret;
}

-int hif_keep_alive_period(struct wfx_vif *wvif, int period)
+int wfx_hif_keep_alive_period(struct wfx_vif *wvif, int period)
{
struct hif_mib_keep_alive_period arg = {
.keep_alive_period = cpu_to_le16(period),
};

- return hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_KEEP_ALIVE_PERIOD,
- &arg, sizeof(arg));
+ return wfx_hif_write_mib(wvif->wdev, wvif->id,
+ HIF_MIB_ID_KEEP_ALIVE_PERIOD,
+ &arg, sizeof(arg));
};

-int hif_set_arp_ipv4_filter(struct wfx_vif *wvif, int idx, __be32 *addr)
+int wfx_hif_set_arp_ipv4_filter(struct wfx_vif *wvif, int idx, __be32 *addr)
{
struct hif_mib_arp_ip_addr_table arg = {
.condition_idx = idx,
@@ -250,22 +257,22 @@ int hif_set_arp_ipv4_filter(struct wfx_vif *wvif, int idx, __be32 *addr)
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,
- &arg, sizeof(arg));
+ return wfx_hif_write_mib(wvif->wdev, wvif->id,
+ HIF_MIB_ID_ARP_IP_ADDRESSES_TABLE,
+ &arg, sizeof(arg));
}

-int hif_use_multi_tx_conf(struct wfx_dev *wdev, bool enable)
+int wfx_hif_use_multi_tx_conf(struct wfx_dev *wdev, bool enable)
{
struct hif_mib_gl_set_multi_msg arg = {
.enable_multi_tx_conf = enable,
};

- return hif_write_mib(wdev, -1, HIF_MIB_ID_GL_SET_MULTI_MSG,
- &arg, sizeof(arg));
+ return wfx_hif_write_mib(wdev, -1, HIF_MIB_ID_GL_SET_MULTI_MSG,
+ &arg, sizeof(arg));
}

-int hif_set_uapsd_info(struct wfx_vif *wvif, unsigned long val)
+int wfx_hif_set_uapsd_info(struct wfx_vif *wvif, unsigned long val)
{
struct hif_mib_set_uapsd_information arg = { };

@@ -277,48 +284,50 @@ int hif_set_uapsd_info(struct wfx_vif *wvif, unsigned long val)
arg.trig_be = 1;
if (val & BIT(IEEE80211_AC_BK))
arg.trig_bckgrnd = 1;
- return hif_write_mib(wvif->wdev, wvif->id,
- HIF_MIB_ID_SET_UAPSD_INFORMATION,
- &arg, sizeof(arg));
+ return wfx_hif_write_mib(wvif->wdev, wvif->id,
+ HIF_MIB_ID_SET_UAPSD_INFORMATION,
+ &arg, sizeof(arg));
}

-int hif_erp_use_protection(struct wfx_vif *wvif, bool enable)
+int wfx_hif_erp_use_protection(struct wfx_vif *wvif, bool enable)
{
struct hif_mib_non_erp_protection arg = {
.use_cts_to_self = enable,
};

- return hif_write_mib(wvif->wdev, wvif->id,
- HIF_MIB_ID_NON_ERP_PROTECTION, &arg, sizeof(arg));
+ return wfx_hif_write_mib(wvif->wdev, wvif->id,
+ HIF_MIB_ID_NON_ERP_PROTECTION,
+ &arg, sizeof(arg));
}

-int hif_slot_time(struct wfx_vif *wvif, int val)
+int wfx_hif_slot_time(struct wfx_vif *wvif, int val)
{
struct hif_mib_slot_time arg = {
.slot_time = cpu_to_le32(val),
};

- return hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_SLOT_TIME,
- &arg, sizeof(arg));
+ return wfx_hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_SLOT_TIME,
+ &arg, sizeof(arg));
}

-int hif_wep_default_key_id(struct wfx_vif *wvif, int val)
+int wfx_hif_wep_default_key_id(struct wfx_vif *wvif, int val)
{
struct hif_mib_wep_default_key_id arg = {
.wep_default_key_id = val,
};

- return hif_write_mib(wvif->wdev, wvif->id,
- HIF_MIB_ID_DOT11_WEP_DEFAULT_KEY_ID,
- &arg, sizeof(arg));
+ return wfx_hif_write_mib(wvif->wdev, wvif->id,
+ HIF_MIB_ID_DOT11_WEP_DEFAULT_KEY_ID,
+ &arg, sizeof(arg));
}

-int hif_rts_threshold(struct wfx_vif *wvif, int val)
+int wfx_hif_rts_threshold(struct wfx_vif *wvif, int val)
{
struct hif_mib_dot11_rts_threshold arg = {
.threshold = cpu_to_le32(val >= 0 ? val : 0xFFFF),
};

- return hif_write_mib(wvif->wdev, wvif->id,
- HIF_MIB_ID_DOT11_RTS_THRESHOLD, &arg, sizeof(arg));
+ return wfx_hif_write_mib(wvif->wdev, wvif->id,
+ HIF_MIB_ID_DOT11_RTS_THRESHOLD,
+ &arg, sizeof(arg));
}
diff --git a/drivers/staging/wfx/hif_tx_mib.h b/drivers/staging/wfx/hif_tx_mib.h
index fe08a69412ab..9b4c16ad5ecf 100644
--- a/drivers/staging/wfx/hif_tx_mib.h
+++ b/drivers/staging/wfx/hif_tx_mib.h
@@ -17,38 +17,39 @@ struct wfx_dev;
struct hif_ie_table_entry;
struct hif_mib_extended_count_table;

-int hif_set_output_power(struct wfx_vif *wvif, int val);
-int hif_set_beacon_wakeup_period(struct wfx_vif *wvif,
- unsigned int dtim_interval,
- unsigned int listen_interval);
-int hif_set_rcpi_rssi_threshold(struct wfx_vif *wvif,
- int rssi_thold, int rssi_hyst);
-int hif_get_counters_table(struct wfx_dev *wdev, int vif_id,
- struct hif_mib_extended_count_table *arg);
-int hif_set_macaddr(struct wfx_vif *wvif, u8 *mac);
-int hif_set_rx_filter(struct wfx_vif *wvif,
- bool filter_bssid, bool fwd_probe_req);
-int hif_set_beacon_filter_table(struct wfx_vif *wvif, int tbl_len,
- const struct hif_ie_table_entry *tbl);
-int hif_beacon_filter_control(struct wfx_vif *wvif,
- int enable, int beacon_count);
-int hif_set_operational_mode(struct wfx_dev *wdev, enum hif_op_power_mode mode);
-int hif_set_template_frame(struct wfx_vif *wvif, struct sk_buff *skb,
- u8 frame_type, int init_rate);
-int hif_set_mfp(struct wfx_vif *wvif, bool capable, bool required);
-int hif_set_block_ack_policy(struct wfx_vif *wvif,
- u8 tx_tid_policy, u8 rx_tid_policy);
-int hif_set_association_mode(struct wfx_vif *wvif, int ampdu_density,
- bool greenfield, bool short_preamble);
-int hif_set_tx_rate_retry_policy(struct wfx_vif *wvif,
- int policy_index, u8 *rates);
-int hif_keep_alive_period(struct wfx_vif *wvif, int period);
-int hif_set_arp_ipv4_filter(struct wfx_vif *wvif, int idx, __be32 *addr);
-int hif_use_multi_tx_conf(struct wfx_dev *wdev, bool enable);
-int hif_set_uapsd_info(struct wfx_vif *wvif, unsigned long val);
-int hif_erp_use_protection(struct wfx_vif *wvif, bool enable);
-int hif_slot_time(struct wfx_vif *wvif, int val);
-int hif_wep_default_key_id(struct wfx_vif *wvif, int val);
-int hif_rts_threshold(struct wfx_vif *wvif, int val);
+int wfx_hif_set_output_power(struct wfx_vif *wvif, int val);
+int wfx_hif_set_beacon_wakeup_period(struct wfx_vif *wvif,
+ unsigned int dtim_interval,
+ unsigned int listen_interval);
+int wfx_hif_set_rcpi_rssi_threshold(struct wfx_vif *wvif,
+ int rssi_thold, int rssi_hyst);
+int wfx_hif_get_counters_table(struct wfx_dev *wdev, int vif_id,
+ struct hif_mib_extended_count_table *arg);
+int wfx_hif_set_macaddr(struct wfx_vif *wvif, u8 *mac);
+int wfx_hif_set_rx_filter(struct wfx_vif *wvif,
+ bool filter_bssid, bool fwd_probe_req);
+int wfx_hif_set_beacon_filter_table(struct wfx_vif *wvif, int tbl_len,
+ const struct hif_ie_table_entry *tbl);
+int wfx_hif_beacon_filter_control(struct wfx_vif *wvif,
+ int enable, int beacon_count);
+int wfx_hif_set_operational_mode(struct wfx_dev *wdev,
+ enum hif_op_power_mode mode);
+int wfx_hif_set_template_frame(struct wfx_vif *wvif, struct sk_buff *skb,
+ u8 frame_type, int init_rate);
+int wfx_hif_set_mfp(struct wfx_vif *wvif, bool capable, bool required);
+int wfx_hif_set_block_ack_policy(struct wfx_vif *wvif,
+ u8 tx_tid_policy, u8 rx_tid_policy);
+int wfx_hif_set_association_mode(struct wfx_vif *wvif, int ampdu_density,
+ bool greenfield, bool short_preamble);
+int wfx_hif_set_tx_rate_retry_policy(struct wfx_vif *wvif,
+ int policy_index, u8 *rates);
+int wfx_hif_keep_alive_period(struct wfx_vif *wvif, int period);
+int wfx_hif_set_arp_ipv4_filter(struct wfx_vif *wvif, int idx, __be32 *addr);
+int wfx_hif_use_multi_tx_conf(struct wfx_dev *wdev, bool enable);
+int wfx_hif_set_uapsd_info(struct wfx_vif *wvif, unsigned long val);
+int wfx_hif_erp_use_protection(struct wfx_vif *wvif, bool enable);
+int wfx_hif_slot_time(struct wfx_vif *wvif, int val);
+int wfx_hif_wep_default_key_id(struct wfx_vif *wvif, int val);
+int wfx_hif_rts_threshold(struct wfx_vif *wvif, int val);

#endif
diff --git a/drivers/staging/wfx/key.c b/drivers/staging/wfx/key.c
index 65134a174683..6069be161154 100644
--- a/drivers/staging/wfx/key.c
+++ b/drivers/staging/wfx/key.c
@@ -205,7 +205,7 @@ static int wfx_add_key(struct wfx_vif *wvif, struct ieee80211_sta *sta,
wfx_free_key(wdev, idx);
return -EOPNOTSUPP;
}
- ret = hif_add_key(wdev, &k);
+ ret = wfx_hif_add_key(wdev, &k);
if (ret) {
wfx_free_key(wdev, idx);
return -EOPNOTSUPP;
@@ -220,7 +220,7 @@ static int wfx_remove_key(struct wfx_vif *wvif, struct ieee80211_key_conf *key)
{
WARN(key->hw_key_idx >= MAX_KEY_ENTRIES, "corrupted hw_key_idx");
wfx_free_key(wvif->wdev, key->hw_key_idx);
- return hif_remove_key(wvif->wdev, key->hw_key_idx);
+ return wfx_hif_remove_key(wvif->wdev, key->hw_key_idx);
}

int wfx_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c
index ddc95ea16b6d..abc1a6d43300 100644
--- a/drivers/staging/wfx/main.c
+++ b/drivers/staging/wfx/main.c
@@ -201,8 +201,8 @@ int wfx_send_pds(struct wfx_dev *wdev, u8 *buf, size_t len)
buf[i] = 0;
dev_dbg(wdev->dev, "send PDS '%s}'\n", buf + start);
buf[i] = '}';
- ret = hif_configuration(wdev, buf + start,
- i - start + 1);
+ ret = wfx_hif_configuration(wdev, buf + start,
+ i - start + 1);
if (ret > 0) {
dev_err(wdev->dev, "PDS bytes %d to %d: invalid data (unsupported options?)\n",
start, i);
@@ -418,7 +418,7 @@ int wfx_probe(struct wfx_dev *wdev)
if (err)
goto err0;

- err = hif_use_multi_tx_conf(wdev, true);
+ err = wfx_hif_use_multi_tx_conf(wdev, true);
if (err)
dev_err(wdev->dev, "misconfigured IRQ?\n");

@@ -429,9 +429,9 @@ int wfx_probe(struct wfx_dev *wdev)
wdev->pdata.file_pds);
gpiod_set_value_cansleep(wdev->pdata.gpio_wakeup, 1);
control_reg_write(wdev, 0);
- hif_set_operational_mode(wdev, HIF_OP_POWER_MODE_QUIESCENT);
+ wfx_hif_set_operational_mode(wdev, HIF_OP_POWER_MODE_QUIESCENT);
} else {
- hif_set_operational_mode(wdev, HIF_OP_POWER_MODE_DOZE);
+ wfx_hif_set_operational_mode(wdev, HIF_OP_POWER_MODE_DOZE);
}

for (i = 0; i < ARRAY_SIZE(wdev->addresses); i++) {
@@ -478,7 +478,7 @@ int wfx_probe(struct wfx_dev *wdev)
void wfx_release(struct wfx_dev *wdev)
{
ieee80211_unregister_hw(wdev->hw);
- hif_shutdown(wdev);
+ wfx_hif_shutdown(wdev);
wdev->hwbus_ops->irq_unsubscribe(wdev->hwbus_priv);
wfx_bh_unregister(wdev);
}
diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.c
index a1fd0f850481..f61c6b2db352 100644
--- a/drivers/staging/wfx/scan.c
+++ b/drivers/staging/wfx/scan.c
@@ -33,7 +33,7 @@ static int update_probe_tmpl(struct wfx_vif *wvif,
return -ENOMEM;

skb_put_data(skb, req->ie, req->ie_len);
- hif_set_template_frame(wvif, skb, HIF_TMPLT_PRBREQ, 0);
+ wfx_hif_set_template_frame(wvif, skb, HIF_TMPLT_PRBREQ, 0);
dev_kfree_skb(skb);
return 0;
}
@@ -56,14 +56,14 @@ static int send_scan_req(struct wfx_vif *wvif,
wfx_tx_lock_flush(wvif->wdev);
wvif->scan_abort = false;
reinit_completion(&wvif->scan_complete);
- ret = hif_scan(wvif, req, start_idx, i - start_idx);
+ ret = wfx_hif_scan(wvif, req, start_idx, i - start_idx);
if (ret) {
wfx_tx_unlock(wvif->wdev);
return -EIO;
}
ret = wait_for_completion_timeout(&wvif->scan_complete, 1 * HZ);
if (!ret) {
- hif_stop_scan(wvif);
+ wfx_hif_stop_scan(wvif);
ret = wait_for_completion_timeout(&wvif->scan_complete, 1 * HZ);
dev_dbg(wvif->wdev->dev, "scan timeout (%d channels done)\n",
wvif->scan_nb_chan_done);
@@ -80,7 +80,7 @@ static int send_scan_req(struct wfx_vif *wvif,
ret = wvif->scan_nb_chan_done;
}
if (req->channels[start_idx]->max_power != wvif->vif->bss_conf.txpower)
- hif_set_output_power(wvif, wvif->vif->bss_conf.txpower);
+ wfx_hif_set_output_power(wvif, wvif->vif->bss_conf.txpower);
wfx_tx_unlock(wvif->wdev);
return ret;
}
@@ -139,7 +139,7 @@ void wfx_cancel_hw_scan(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv;

wvif->scan_abort = true;
- hif_stop_scan(wvif);
+ wfx_hif_stop_scan(wvif);
}

void wfx_scan_complete(struct wfx_vif *wvif, int nb_chan_done)
diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index 23c0425e3929..d384f2df329c 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -89,10 +89,12 @@ static void wfx_filter_beacon(struct wfx_vif *wvif, bool filter_beacon)
};

if (!filter_beacon) {
- hif_beacon_filter_control(wvif, 0, 1);
+ wfx_hif_beacon_filter_control(wvif, 0, 1);
} else {
- hif_set_beacon_filter_table(wvif, ARRAY_SIZE(filter_ies), filter_ies);
- hif_beacon_filter_control(wvif, HIF_BEACON_FILTER_ENABLE, 0);
+ wfx_hif_set_beacon_filter_table(wvif, ARRAY_SIZE(filter_ies),
+ filter_ies);
+ wfx_hif_beacon_filter_control(wvif,
+ HIF_BEACON_FILTER_ENABLE, 0);
}
}

@@ -143,7 +145,7 @@ void wfx_configure_filter(struct ieee80211_hw *hw, unsigned int changed_flags,
filter_prbreq = false;
else
filter_prbreq = true;
- hif_set_rx_filter(wvif, filter_bssid, filter_prbreq);
+ wfx_hif_set_rx_filter(wvif, filter_bssid, filter_prbreq);

mutex_unlock(&wvif->scan_lock);
}
@@ -210,7 +212,7 @@ int wfx_update_pm(struct wfx_vif *wvif)
TU_TO_JIFFIES(512)))
dev_warn(wvif->wdev->dev,
"timeout while waiting of set_pm_mode_complete\n");
- return hif_set_pm(wvif, ps, ps_timeout);
+ return wfx_hif_set_pm(wvif, ps, ps_timeout);
}

int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
@@ -224,10 +226,10 @@ int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,

mutex_lock(&wdev->conf_mutex);
assign_bit(queue, &wvif->uapsd_mask, params->uapsd);
- hif_set_edca_queue_params(wvif, queue, params);
+ wfx_hif_set_edca_queue_params(wvif, queue, params);
if (wvif->vif->type == NL80211_IFTYPE_STATION &&
old_uapsd != wvif->uapsd_mask) {
- hif_set_uapsd_info(wvif, wvif->uapsd_mask);
+ wfx_hif_set_uapsd_info(wvif, wvif->uapsd_mask);
wfx_update_pm(wvif);
}
mutex_unlock(&wdev->conf_mutex);
@@ -240,7 +242,7 @@ int wfx_set_rts_threshold(struct ieee80211_hw *hw, u32 value)
struct wfx_vif *wvif = NULL;

while ((wvif = wvif_iterate(wdev, wvif)) != NULL)
- hif_rts_threshold(wvif, value);
+ wfx_hif_rts_threshold(wvif, value);
return 0;
}

@@ -276,7 +278,7 @@ void wfx_set_default_unicast_key(struct ieee80211_hw *hw,
{
struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv;

- hif_wep_default_key_id(wvif, idx);
+ wfx_hif_wep_default_key_id(wvif, idx);
}

void wfx_reset(struct wfx_vif *wvif)
@@ -284,10 +286,10 @@ void wfx_reset(struct wfx_vif *wvif)
struct wfx_dev *wdev = wvif->wdev;

wfx_tx_lock_flush(wdev);
- hif_reset(wvif, false);
+ wfx_hif_reset(wvif, false);
wfx_tx_policy_init(wvif);
if (wvif_count(wdev) <= 1)
- hif_set_block_ack_policy(wvif, 0xFF, 0xFF);
+ wfx_hif_set_block_ack_policy(wvif, 0xFF, 0xFF);
wfx_tx_unlock(wdev);
wvif->join_in_progress = false;
cancel_delayed_work_sync(&wvif->beacon_loss_work);
@@ -305,7 +307,7 @@ int wfx_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
sta_priv->vif_id = wvif->id;

if (vif->type == NL80211_IFTYPE_STATION)
- hif_set_mfp(wvif, sta->mfp, sta->mfp);
+ wfx_hif_set_mfp(wvif, sta->mfp, sta->mfp);

/* In station mode, the firmware interprets new link-id as a TDLS peer */
if (vif->type == NL80211_IFTYPE_STATION && !sta->tdls)
@@ -314,7 +316,7 @@ int wfx_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
wvif->link_id_map |= BIT(sta_priv->link_id);
WARN_ON(!sta_priv->link_id);
WARN_ON(sta_priv->link_id >= HIF_LINK_ID_MAX);
- hif_map_link(wvif, false, sta->addr, sta_priv->link_id, sta->mfp);
+ wfx_hif_map_link(wvif, false, sta->addr, sta_priv->link_id, sta->mfp);

return 0;
}
@@ -329,7 +331,7 @@ int wfx_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
if (!sta_priv->link_id)
return 0;
/* FIXME add a mutex? */
- hif_map_link(wvif, true, sta->addr, sta_priv->link_id, false);
+ wfx_hif_map_link(wvif, true, sta->addr, sta_priv->link_id, false);
wvif->link_id_map &= ~BIT(sta_priv->link_id);
return 0;
}
@@ -341,15 +343,15 @@ static int wfx_upload_ap_templates(struct wfx_vif *wvif)
skb = ieee80211_beacon_get(wvif->wdev->hw, wvif->vif);
if (!skb)
return -ENOMEM;
- hif_set_template_frame(wvif, skb, HIF_TMPLT_BCN,
- API_RATE_INDEX_B_1MBPS);
+ wfx_hif_set_template_frame(wvif, skb, HIF_TMPLT_BCN,
+ API_RATE_INDEX_B_1MBPS);
dev_kfree_skb(skb);

skb = ieee80211_proberesp_get(wvif->wdev->hw, wvif->vif);
if (!skb)
return -ENOMEM;
- hif_set_template_frame(wvif, skb, HIF_TMPLT_PRBRES,
- API_RATE_INDEX_B_1MBPS);
+ wfx_hif_set_template_frame(wvif, skb, HIF_TMPLT_PRBRES,
+ API_RATE_INDEX_B_1MBPS);
dev_kfree_skb(skb);
return 0;
}
@@ -375,7 +377,7 @@ static void wfx_set_mfp_ap(struct wfx_vif *wvif)
ptr += 1 + akm_suite_size * *ptr;
if (WARN_ON(ptr > (u16 *)skb_tail_pointer(skb)))
return;
- hif_set_mfp(wvif, *ptr & BIT(7), *ptr & BIT(6));
+ wfx_hif_set_mfp(wvif, *ptr & BIT(7), *ptr & BIT(6));
}
}

@@ -390,7 +392,7 @@ int wfx_start_ap(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
wfx_update_pm(wvif);
wvif = (struct wfx_vif *)vif->drv_priv;
wfx_upload_ap_templates(wvif);
- ret = hif_start(wvif, &vif->bss_conf, wvif->channel);
+ ret = wfx_hif_start(wvif, &vif->bss_conf, wvif->channel);
if (ret > 0)
return -EIO;
wfx_set_mfp_ap(wvif);
@@ -437,7 +439,7 @@ static void wfx_join(struct wfx_vif *wvif)
cfg80211_put_bss(wvif->wdev->hw->wiphy, bss);

wvif->join_in_progress = true;
- ret = hif_join(wvif, conf, wvif->channel, ssid, ssidlen);
+ ret = wfx_hif_join(wvif, conf, wvif->channel, ssid, ssidlen);
if (ret) {
ieee80211_connection_loss(wvif->vif);
wfx_reset(wvif);
@@ -470,14 +472,14 @@ static void wfx_join_finalize(struct wfx_vif *wvif,
rcu_read_unlock();

wvif->join_in_progress = false;
- hif_set_association_mode(wvif, ampdu_density, greenfield,
- info->use_short_preamble);
- hif_keep_alive_period(wvif, 0);
+ wfx_hif_set_association_mode(wvif, ampdu_density, greenfield,
+ info->use_short_preamble);
+ wfx_hif_keep_alive_period(wvif, 0);
/* beacon_loss_count is defined to 7 in net/mac80211/mlme.c. Let's use
* the same value.
*/
- hif_set_bss_params(wvif, info->aid, 7);
- hif_set_beacon_wakeup_period(wvif, 1, 1);
+ wfx_hif_set_bss_params(wvif, info->aid, 7);
+ wfx_hif_set_beacon_wakeup_period(wvif, 1, 1);
wfx_update_pm(wvif);
}

@@ -508,7 +510,7 @@ static void wfx_enable_beacon(struct wfx_vif *wvif, bool enable)
wvif->after_dtim_tx_allowed = true;
wfx_bh_request_tx(wvif->wdev);
}
- hif_beacon_transmit(wvif, enable);
+ wfx_hif_beacon_transmit(wvif, enable);
}

void wfx_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
@@ -541,8 +543,8 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
if (vif->type != NL80211_IFTYPE_STATION)
dev_warn(wdev->dev, "%s: misunderstood change: BEACON_INFO\n",
__func__);
- hif_set_beacon_wakeup_period(wvif, info->dtim_period,
- info->dtim_period);
+ wfx_hif_set_beacon_wakeup_period(wvif, info->dtim_period,
+ info->dtim_period);
/* We temporary forwarded beacon for join process. It is now no
* more necessary.
*/
@@ -557,7 +559,7 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
arp_addr = NULL;
if (i >= info->arp_addr_cnt)
arp_addr = NULL;
- hif_set_arp_ipv4_filter(wvif, i, arp_addr);
+ wfx_hif_set_arp_ipv4_filter(wvif, i, arp_addr);
}
}

@@ -569,21 +571,21 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
wfx_enable_beacon(wvif, info->enable_beacon);

if (changed & BSS_CHANGED_KEEP_ALIVE)
- hif_keep_alive_period(wvif, info->max_idle_period *
- USEC_PER_TU / USEC_PER_MSEC);
+ wfx_hif_keep_alive_period(wvif, info->max_idle_period *
+ USEC_PER_TU / USEC_PER_MSEC);

if (changed & BSS_CHANGED_ERP_CTS_PROT)
- hif_erp_use_protection(wvif, info->use_cts_prot);
+ wfx_hif_erp_use_protection(wvif, info->use_cts_prot);

if (changed & BSS_CHANGED_ERP_SLOT)
- hif_slot_time(wvif, info->use_short_slot ? 9 : 20);
+ wfx_hif_slot_time(wvif, info->use_short_slot ? 9 : 20);

if (changed & BSS_CHANGED_CQM)
- hif_set_rcpi_rssi_threshold(wvif, info->cqm_rssi_thold,
- info->cqm_rssi_hyst);
+ wfx_hif_set_rcpi_rssi_threshold(wvif, info->cqm_rssi_thold,
+ info->cqm_rssi_hyst);

if (changed & BSS_CHANGED_TXPOWER)
- hif_set_output_power(wvif, info->txpower);
+ wfx_hif_set_output_power(wvif, info->txpower);

if (changed & BSS_CHANGED_PS)
wfx_update_pm(wvif);
@@ -614,7 +616,7 @@ static int wfx_update_tim(struct wfx_vif *wvif)
tim_ptr[4] &= ~1;
}

- hif_update_ie_beacon(wvif, tim_ptr, tim_length);
+ wfx_hif_update_ie_beacon(wvif, tim_ptr, tim_length);
dev_kfree_skb(skb);

return 0;
@@ -774,7 +776,7 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
}
WARN(i == ARRAY_SIZE(wdev->vif), "try to instantiate more vif than supported");

- hif_set_macaddr(wvif, vif->addr);
+ wfx_hif_set_macaddr(wvif, vif->addr);

mutex_unlock(&wdev->conf_mutex);

@@ -782,9 +784,9 @@ int wfx_add_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
while ((wvif = wvif_iterate(wdev, wvif)) != NULL) {
/* Combo mode does not support Block Acks. We can re-enable them */
if (wvif_count(wdev) == 1)
- hif_set_block_ack_policy(wvif, 0xFF, 0xFF);
+ wfx_hif_set_block_ack_policy(wvif, 0xFF, 0xFF);
else
- hif_set_block_ack_policy(wvif, 0x00, 0x00);
+ wfx_hif_set_block_ack_policy(wvif, 0x00, 0x00);
}
return ret;
}
@@ -800,8 +802,8 @@ void wfx_remove_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
mutex_lock(&wdev->conf_mutex);
WARN(wvif->link_id_map != 1, "corrupted state");

- hif_reset(wvif, false);
- hif_set_macaddr(wvif, NULL);
+ wfx_hif_reset(wvif, false);
+ wfx_hif_set_macaddr(wvif, NULL);
wfx_tx_policy_init(wvif);

cancel_delayed_work_sync(&wvif->beacon_loss_work);
@@ -814,9 +816,9 @@ void wfx_remove_interface(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
while ((wvif = wvif_iterate(wdev, wvif)) != NULL) {
/* Combo mode does not support Block Acks. We can re-enable them */
if (wvif_count(wdev) == 1)
- hif_set_block_ack_policy(wvif, 0xFF, 0xFF);
+ wfx_hif_set_block_ack_policy(wvif, 0xFF, 0xFF);
else
- hif_set_block_ack_policy(wvif, 0x00, 0x00);
+ wfx_hif_set_block_ack_policy(wvif, 0x00, 0x00);
}
}

--
2.34.1

2022-01-13 08:56:45

by Jérôme Pouiller

[permalink] [raw]
Subject: [PATCH 15/31] staging: wfx: prefix functions from hwio.h with wfx_

From: Jérôme Pouiller <[email protected]>

All the functions related to a driver should use the same prefix.

Signed-off-by: Jérôme Pouiller <[email protected]>
---
drivers/staging/wfx/bh.c | 8 +--
drivers/staging/wfx/fwio.c | 78 ++++++++++----------
drivers/staging/wfx/hif_tx.c | 2 +-
drivers/staging/wfx/hwio.c | 135 +++++++++++++++++++----------------
drivers/staging/wfx/hwio.h | 32 ++++-----
drivers/staging/wfx/main.c | 2 +-
6 files changed, 133 insertions(+), 124 deletions(-)

diff --git a/drivers/staging/wfx/bh.c b/drivers/staging/wfx/bh.c
index bbcf8d6a39c4..b7fa0aeafd78 100644
--- a/drivers/staging/wfx/bh.c
+++ b/drivers/staging/wfx/bh.c
@@ -227,11 +227,11 @@ static void ack_sdio_data(struct wfx_dev *wdev)
{
u32 cfg_reg;

- config_reg_read(wdev, &cfg_reg);
+ wfx_config_reg_read(wdev, &cfg_reg);
if (cfg_reg & 0xFF) {
dev_warn(wdev->dev, "chip reports errors: %02x\n",
cfg_reg & 0xFF);
- config_reg_write_bits(wdev, 0xFF, 0x00);
+ wfx_config_reg_write_bits(wdev, 0xFF, 0x00);
}
}

@@ -270,7 +270,7 @@ void wfx_bh_request_rx(struct wfx_dev *wdev)
{
u32 cur, prev;

- control_reg_read(wdev, &cur);
+ wfx_control_reg_read(wdev, &cur);
prev = atomic_xchg(&wdev->hif.ctrl_reg, cur);
complete(&wdev->hif.ctrl_ready);
queue_work(system_highpri_wq, &wdev->hif.bh);
@@ -304,7 +304,7 @@ void wfx_bh_poll_irq(struct wfx_dev *wdev)
WARN(!wdev->poll_irq, "unexpected IRQ polling can mask IRQ");
start = ktime_get();
for (;;) {
- control_reg_read(wdev, &reg);
+ wfx_control_reg_read(wdev, &reg);
now = ktime_get();
if (reg & 0xFFF)
break;
diff --git a/drivers/staging/wfx/fwio.c b/drivers/staging/wfx/fwio.c
index 98a9391b2bee..c9a54c519e8a 100644
--- a/drivers/staging/wfx/fwio.c
+++ b/drivers/staging/wfx/fwio.c
@@ -79,8 +79,8 @@ static const char * const fwio_errors[] = {
* NOTE: it may also be possible to use 'pages' from struct firmware and avoid
* bounce buffer
*/
-static int sram_write_dma_safe(struct wfx_dev *wdev, u32 addr, const u8 *buf,
- size_t len)
+static int wfx_sram_write_dma_safe(struct wfx_dev *wdev, u32 addr,
+ const u8 *buf, size_t len)
{
int ret;
const u8 *tmp;
@@ -92,7 +92,7 @@ static int sram_write_dma_safe(struct wfx_dev *wdev, u32 addr, const u8 *buf,
} else {
tmp = buf;
}
- ret = sram_buf_write(wdev, addr, tmp, len);
+ ret = wfx_sram_buf_write(wdev, addr, tmp, len);
if (tmp != buf)
kfree(tmp);
return ret;
@@ -156,7 +156,7 @@ static int wait_ncp_status(struct wfx_dev *wdev, u32 status)

start = ktime_get();
for (;;) {
- ret = sram_reg_read(wdev, WFX_DCA_NCP_STATUS, &reg);
+ ret = wfx_sram_reg_read(wdev, WFX_DCA_NCP_STATUS, &reg);
if (ret < 0)
return -EIO;
now = ktime_get();
@@ -192,7 +192,7 @@ static int upload_firmware(struct wfx_dev *wdev, const u8 *data, size_t len)
break;
if (ktime_after(now, ktime_add_ms(start, DCA_TIMEOUT)))
return -ETIMEDOUT;
- ret = sram_reg_read(wdev, WFX_DCA_GET, &bytes_done);
+ ret = wfx_sram_reg_read(wdev, WFX_DCA_GET, &bytes_done);
if (ret < 0)
return ret;
}
@@ -200,9 +200,9 @@ static int upload_firmware(struct wfx_dev *wdev, const u8 *data, size_t len)
dev_dbg(wdev->dev, "answer after %lldus\n",
ktime_us_delta(now, start));

- ret = sram_write_dma_safe(wdev, WFX_DNLD_FIFO +
- (offs % DNLD_FIFO_SIZE),
- data + offs, DNLD_BLOCK_SIZE);
+ ret = wfx_sram_write_dma_safe(wdev,
+ WFX_DNLD_FIFO + (offs % DNLD_FIFO_SIZE),
+ data + offs, DNLD_BLOCK_SIZE);
if (ret < 0)
return ret;

@@ -210,7 +210,7 @@ static int upload_firmware(struct wfx_dev *wdev, const u8 *data, size_t len)
* during first loop
*/
offs += DNLD_BLOCK_SIZE;
- ret = sram_reg_write(wdev, WFX_DCA_PUT, offs);
+ ret = wfx_sram_reg_write(wdev, WFX_DCA_PUT, offs);
if (ret < 0)
return ret;
}
@@ -221,10 +221,10 @@ static void print_boot_status(struct wfx_dev *wdev)
{
u32 reg;

- sram_reg_read(wdev, WFX_STATUS_INFO, &reg);
+ wfx_sram_reg_read(wdev, WFX_STATUS_INFO, &reg);
if (reg == 0x12345678)
return;
- sram_reg_read(wdev, WFX_ERR_INFO, &reg);
+ wfx_sram_reg_read(wdev, WFX_ERR_INFO, &reg);
if (reg < ARRAY_SIZE(fwio_errors) && fwio_errors[reg])
dev_info(wdev->dev, "secure boot: %s\n", fwio_errors[reg]);
else
@@ -245,36 +245,36 @@ static int load_firmware_secure(struct wfx_dev *wdev)
if (!buf)
return -ENOMEM;

- sram_reg_write(wdev, WFX_DCA_HOST_STATUS, HOST_READY);
+ wfx_sram_reg_write(wdev, WFX_DCA_HOST_STATUS, HOST_READY);
ret = wait_ncp_status(wdev, NCP_INFO_READY);
if (ret)
goto error;

- sram_buf_read(wdev, WFX_BOOTLOADER_LABEL, buf, BOOTLOADER_LABEL_SIZE);
+ wfx_sram_buf_read(wdev, WFX_BOOTLOADER_LABEL, buf, BOOTLOADER_LABEL_SIZE);
buf[BOOTLOADER_LABEL_SIZE] = 0;
dev_dbg(wdev->dev, "bootloader: \"%s\"\n", buf);

- sram_buf_read(wdev, WFX_PTE_INFO, buf, PTE_INFO_SIZE);
+ wfx_sram_buf_read(wdev, WFX_PTE_INFO, buf, PTE_INFO_SIZE);
ret = get_firmware(wdev, buf[PTE_INFO_KEYSET_IDX], &fw, &fw_offset);
if (ret)
goto error;
header_size = fw_offset + FW_SIGNATURE_SIZE + FW_HASH_SIZE;

- sram_reg_write(wdev, WFX_DCA_HOST_STATUS, HOST_INFO_READ);
+ wfx_sram_reg_write(wdev, WFX_DCA_HOST_STATUS, HOST_INFO_READ);
ret = wait_ncp_status(wdev, NCP_READY);
if (ret)
goto error;

- sram_reg_write(wdev, WFX_DNLD_FIFO, 0xFFFFFFFF); /* Fifo init */
- sram_write_dma_safe(wdev, WFX_DCA_FW_VERSION, "\x01\x00\x00\x00",
- FW_VERSION_SIZE);
- sram_write_dma_safe(wdev, WFX_DCA_FW_SIGNATURE, fw->data + fw_offset,
- FW_SIGNATURE_SIZE);
- sram_write_dma_safe(wdev, WFX_DCA_FW_HASH,
- fw->data + fw_offset + FW_SIGNATURE_SIZE,
- FW_HASH_SIZE);
- sram_reg_write(wdev, WFX_DCA_IMAGE_SIZE, fw->size - header_size);
- sram_reg_write(wdev, WFX_DCA_HOST_STATUS, HOST_UPLOAD_PENDING);
+ wfx_sram_reg_write(wdev, WFX_DNLD_FIFO, 0xFFFFFFFF); /* Fifo init */
+ wfx_sram_write_dma_safe(wdev, WFX_DCA_FW_VERSION, "\x01\x00\x00\x00",
+ FW_VERSION_SIZE);
+ wfx_sram_write_dma_safe(wdev, WFX_DCA_FW_SIGNATURE, fw->data + fw_offset,
+ FW_SIGNATURE_SIZE);
+ wfx_sram_write_dma_safe(wdev, WFX_DCA_FW_HASH,
+ fw->data + fw_offset + FW_SIGNATURE_SIZE,
+ FW_HASH_SIZE);
+ wfx_sram_reg_write(wdev, WFX_DCA_IMAGE_SIZE, fw->size - header_size);
+ wfx_sram_reg_write(wdev, WFX_DCA_HOST_STATUS, HOST_UPLOAD_PENDING);
ret = wait_ncp_status(wdev, NCP_DOWNLOAD_PENDING);
if (ret)
goto error;
@@ -287,14 +287,14 @@ static int load_firmware_secure(struct wfx_dev *wdev)
dev_dbg(wdev->dev, "firmware load after %lldus\n",
ktime_us_delta(ktime_get(), start));

- sram_reg_write(wdev, WFX_DCA_HOST_STATUS, HOST_UPLOAD_COMPLETE);
+ wfx_sram_reg_write(wdev, WFX_DCA_HOST_STATUS, HOST_UPLOAD_COMPLETE);
ret = wait_ncp_status(wdev, NCP_AUTH_OK);
/* Legacy ROM support */
if (ret < 0)
ret = wait_ncp_status(wdev, NCP_PUB_KEY_RDY);
if (ret < 0)
goto error;
- sram_reg_write(wdev, WFX_DCA_HOST_STATUS, HOST_OK_TO_JUMP);
+ wfx_sram_reg_write(wdev, WFX_DCA_HOST_STATUS, HOST_OK_TO_JUMP);

error:
kfree(buf);
@@ -320,8 +320,8 @@ static int init_gpr(struct wfx_dev *wdev)
};

for (i = 0; i < ARRAY_SIZE(gpr_init); i++) {
- ret = igpr_reg_write(wdev, gpr_init[i].index,
- gpr_init[i].value);
+ ret = wfx_igpr_reg_write(wdev, gpr_init[i].index,
+ gpr_init[i].value);
if (ret < 0)
return ret;
dev_dbg(wdev->dev, " index %02x: %08x\n",
@@ -341,13 +341,13 @@ int wfx_init_device(struct wfx_dev *wdev)
reg = CFG_DIRECT_ACCESS_MODE | CFG_CPU_RESET | CFG_BYTE_ORDER_ABCD;
if (wdev->pdata.use_rising_clk)
reg |= CFG_CLK_RISE_EDGE;
- ret = config_reg_write(wdev, reg);
+ ret = wfx_config_reg_write(wdev, reg);
if (ret < 0) {
dev_err(wdev->dev, "bus returned an error during first write access. Host configuration error?\n");
return -EIO;
}

- ret = config_reg_read(wdev, &reg);
+ ret = wfx_config_reg_read(wdev, &reg);
if (ret < 0) {
dev_err(wdev->dev, "bus returned an error during first read access. Bus configuration error?\n");
return -EIO;
@@ -374,12 +374,12 @@ int wfx_init_device(struct wfx_dev *wdev)
if (ret < 0)
return ret;

- ret = control_reg_write(wdev, CTRL_WLAN_WAKEUP);
+ ret = wfx_control_reg_write(wdev, CTRL_WLAN_WAKEUP);
if (ret < 0)
return -EIO;
start = ktime_get();
for (;;) {
- ret = control_reg_read(wdev, &reg);
+ ret = wfx_control_reg_read(wdev, &reg);
now = ktime_get();
if (reg & CTRL_WLAN_READY)
break;
@@ -391,15 +391,15 @@ int wfx_init_device(struct wfx_dev *wdev)
dev_dbg(wdev->dev, "chip wake up after %lldus\n",
ktime_us_delta(now, start));

- ret = config_reg_write_bits(wdev, CFG_CPU_RESET, 0);
+ ret = wfx_config_reg_write_bits(wdev, CFG_CPU_RESET, 0);
if (ret < 0)
return ret;
ret = load_firmware_secure(wdev);
if (ret < 0)
return ret;
- return config_reg_write_bits(wdev,
- CFG_DIRECT_ACCESS_MODE |
- CFG_IRQ_ENABLE_DATA |
- CFG_IRQ_ENABLE_WRDY,
- CFG_IRQ_ENABLE_DATA);
+ return wfx_config_reg_write_bits(wdev,
+ CFG_DIRECT_ACCESS_MODE |
+ CFG_IRQ_ENABLE_DATA |
+ CFG_IRQ_ENABLE_WRDY,
+ CFG_IRQ_ENABLE_DATA);
}
diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c
index 7c9d3d86c22e..9899e7b62203 100644
--- a/drivers/staging/wfx/hif_tx.c
+++ b/drivers/staging/wfx/hif_tx.c
@@ -135,7 +135,7 @@ int wfx_hif_shutdown(struct wfx_dev *wdev)
if (wdev->pdata.gpio_wakeup)
gpiod_set_value(wdev->pdata.gpio_wakeup, 0);
else
- control_reg_write(wdev, 0);
+ wfx_control_reg_write(wdev, 0);
kfree(hif);
return ret;
}
diff --git a/drivers/staging/wfx/hwio.c b/drivers/staging/wfx/hwio.c
index 977b9325f496..c53b36d36687 100644
--- a/drivers/staging/wfx/hwio.c
+++ b/drivers/staging/wfx/hwio.c
@@ -17,7 +17,7 @@

#define WFX_HIF_BUFFER_SIZE 0x2000

-static int read32(struct wfx_dev *wdev, int reg, u32 *val)
+static int wfx_read32(struct wfx_dev *wdev, int reg, u32 *val)
{
int ret;
__le32 *tmp = kmalloc(sizeof(u32), GFP_KERNEL);
@@ -36,7 +36,7 @@ static int read32(struct wfx_dev *wdev, int reg, u32 *val)
return ret;
}

-static int write32(struct wfx_dev *wdev, int reg, u32 val)
+static int wfx_write32(struct wfx_dev *wdev, int reg, u32 val)
{
int ret;
__le32 *tmp = kmalloc(sizeof(u32), GFP_KERNEL);
@@ -53,29 +53,30 @@ static int write32(struct wfx_dev *wdev, int reg, u32 val)
return ret;
}

-static int read32_locked(struct wfx_dev *wdev, int reg, u32 *val)
+static int wfx_read32_locked(struct wfx_dev *wdev, int reg, u32 *val)
{
int ret;

wdev->hwbus_ops->lock(wdev->hwbus_priv);
- ret = read32(wdev, reg, val);
+ ret = wfx_read32(wdev, reg, val);
_trace_io_read32(reg, *val);
wdev->hwbus_ops->unlock(wdev->hwbus_priv);
return ret;
}

-static int write32_locked(struct wfx_dev *wdev, int reg, u32 val)
+static int wfx_write32_locked(struct wfx_dev *wdev, int reg, u32 val)
{
int ret;

wdev->hwbus_ops->lock(wdev->hwbus_priv);
- ret = write32(wdev, reg, val);
+ ret = wfx_write32(wdev, reg, val);
_trace_io_write32(reg, val);
wdev->hwbus_ops->unlock(wdev->hwbus_priv);
return ret;
}

-static int write32_bits_locked(struct wfx_dev *wdev, int reg, u32 mask, u32 val)
+static int wfx_write32_bits_locked(struct wfx_dev *wdev,
+ int reg, u32 mask, u32 val)
{
int ret;
u32 val_r, val_w;
@@ -83,13 +84,13 @@ static int write32_bits_locked(struct wfx_dev *wdev, int reg, u32 mask, u32 val)
WARN_ON(~mask & val);
val &= mask;
wdev->hwbus_ops->lock(wdev->hwbus_priv);
- ret = read32(wdev, reg, &val_r);
+ ret = wfx_read32(wdev, reg, &val_r);
_trace_io_read32(reg, val_r);
if (ret < 0)
goto err;
val_w = (val_r & ~mask) | val;
if (val_w != val_r) {
- ret = write32(wdev, reg, val_w);
+ ret = wfx_write32(wdev, reg, val_w);
_trace_io_write32(reg, val_w);
}
err:
@@ -97,8 +98,8 @@ static int write32_bits_locked(struct wfx_dev *wdev, int reg, u32 mask, u32 val)
return ret;
}

-static int indirect_read(struct wfx_dev *wdev, int reg, u32 addr,
- void *buf, size_t len)
+static int wfx_indirect_read(struct wfx_dev *wdev, int reg, u32 addr,
+ void *buf, size_t len)
{
int ret;
int i;
@@ -115,20 +116,20 @@ static int indirect_read(struct wfx_dev *wdev, int reg, u32 addr,
else
return -ENODEV;

- ret = write32(wdev, WFX_REG_BASE_ADDR, addr);
+ ret = wfx_write32(wdev, WFX_REG_BASE_ADDR, addr);
if (ret < 0)
goto err;

- ret = read32(wdev, WFX_REG_CONFIG, &cfg);
+ ret = wfx_read32(wdev, WFX_REG_CONFIG, &cfg);
if (ret < 0)
goto err;

- ret = write32(wdev, WFX_REG_CONFIG, cfg | prefetch);
+ ret = wfx_write32(wdev, WFX_REG_CONFIG, cfg | prefetch);
if (ret < 0)
goto err;

for (i = 0; i < 20; i++) {
- ret = read32(wdev, WFX_REG_CONFIG, &cfg);
+ ret = wfx_read32(wdev, WFX_REG_CONFIG, &cfg);
if (ret < 0)
goto err;
if (!(cfg & prefetch))
@@ -148,46 +149,46 @@ static int indirect_read(struct wfx_dev *wdev, int reg, u32 addr,
return ret;
}

-static int indirect_write(struct wfx_dev *wdev, int reg, u32 addr,
- const void *buf, size_t len)
+static int wfx_indirect_write(struct wfx_dev *wdev, int reg, u32 addr,
+ const void *buf, size_t len)
{
int ret;

WARN_ON(len >= WFX_HIF_BUFFER_SIZE);
WARN_ON(reg != WFX_REG_AHB_DPORT && reg != WFX_REG_SRAM_DPORT);
- ret = write32(wdev, WFX_REG_BASE_ADDR, addr);
+ ret = wfx_write32(wdev, WFX_REG_BASE_ADDR, addr);
if (ret < 0)
return ret;

return wdev->hwbus_ops->copy_to_io(wdev->hwbus_priv, reg, buf, len);
}

-static int indirect_read_locked(struct wfx_dev *wdev, int reg, u32 addr,
- void *buf, size_t len)
+static int wfx_indirect_read_locked(struct wfx_dev *wdev, int reg, u32 addr,
+ void *buf, size_t len)
{
int ret;

wdev->hwbus_ops->lock(wdev->hwbus_priv);
- ret = indirect_read(wdev, reg, addr, buf, len);
+ ret = wfx_indirect_read(wdev, reg, addr, buf, len);
_trace_io_ind_read(reg, addr, buf, len);
wdev->hwbus_ops->unlock(wdev->hwbus_priv);
return ret;
}

-static int indirect_write_locked(struct wfx_dev *wdev, int reg, u32 addr,
- const void *buf, size_t len)
+static int wfx_indirect_write_locked(struct wfx_dev *wdev, int reg, u32 addr,
+ const void *buf, size_t len)
{
int ret;

wdev->hwbus_ops->lock(wdev->hwbus_priv);
- ret = indirect_write(wdev, reg, addr, buf, len);
+ ret = wfx_indirect_write(wdev, reg, addr, buf, len);
_trace_io_ind_write(reg, addr, buf, len);
wdev->hwbus_ops->unlock(wdev->hwbus_priv);
return ret;
}

-static int indirect_read32_locked(struct wfx_dev *wdev, int reg,
- u32 addr, u32 *val)
+static int wfx_indirect_read32_locked(struct wfx_dev *wdev, int reg,
+ u32 addr, u32 *val)
{
int ret;
__le32 *tmp = kmalloc(sizeof(u32), GFP_KERNEL);
@@ -195,7 +196,7 @@ static int indirect_read32_locked(struct wfx_dev *wdev, int reg,
if (!tmp)
return -ENOMEM;
wdev->hwbus_ops->lock(wdev->hwbus_priv);
- ret = indirect_read(wdev, reg, addr, tmp, sizeof(u32));
+ ret = wfx_indirect_read(wdev, reg, addr, tmp, sizeof(u32));
*val = le32_to_cpu(*tmp);
_trace_io_ind_read32(reg, addr, *val);
wdev->hwbus_ops->unlock(wdev->hwbus_priv);
@@ -203,8 +204,8 @@ static int indirect_read32_locked(struct wfx_dev *wdev, int reg,
return ret;
}

-static int indirect_write32_locked(struct wfx_dev *wdev, int reg,
- u32 addr, u32 val)
+static int wfx_indirect_write32_locked(struct wfx_dev *wdev, int reg,
+ u32 addr, u32 val)
{
int ret;
__le32 *tmp = kmalloc(sizeof(u32), GFP_KERNEL);
@@ -213,7 +214,7 @@ static int indirect_write32_locked(struct wfx_dev *wdev, int reg,
return -ENOMEM;
*tmp = cpu_to_le32(val);
wdev->hwbus_ops->lock(wdev->hwbus_priv);
- ret = indirect_write(wdev, reg, addr, tmp, sizeof(u32));
+ ret = wfx_indirect_write(wdev, reg, addr, tmp, sizeof(u32));
_trace_io_ind_write32(reg, addr, val);
wdev->hwbus_ops->unlock(wdev->hwbus_priv);
kfree(tmp);
@@ -252,92 +253,100 @@ int wfx_data_write(struct wfx_dev *wdev, const void *buf, size_t len)
return ret;
}

-int sram_buf_read(struct wfx_dev *wdev, u32 addr, void *buf, size_t len)
+int wfx_sram_buf_read(struct wfx_dev *wdev, u32 addr, void *buf, size_t len)
{
- return indirect_read_locked(wdev, WFX_REG_SRAM_DPORT, addr, buf, len);
+ return wfx_indirect_read_locked(wdev, WFX_REG_SRAM_DPORT,
+ addr, buf, len);
}

-int ahb_buf_read(struct wfx_dev *wdev, u32 addr, void *buf, size_t len)
+int wfx_ahb_buf_read(struct wfx_dev *wdev, u32 addr, void *buf, size_t len)
{
- return indirect_read_locked(wdev, WFX_REG_AHB_DPORT, addr, buf, len);
+ return wfx_indirect_read_locked(wdev, WFX_REG_AHB_DPORT,
+ addr, buf, len);
}

-int sram_buf_write(struct wfx_dev *wdev, u32 addr, const void *buf, size_t len)
+int wfx_sram_buf_write(struct wfx_dev *wdev, u32 addr,
+ const void *buf, size_t len)
{
- return indirect_write_locked(wdev, WFX_REG_SRAM_DPORT, addr, buf, len);
+ return wfx_indirect_write_locked(wdev, WFX_REG_SRAM_DPORT,
+ addr, buf, len);
}

-int ahb_buf_write(struct wfx_dev *wdev, u32 addr, const void *buf, size_t len)
+int wfx_ahb_buf_write(struct wfx_dev *wdev, u32 addr,
+ const void *buf, size_t len)
{
- return indirect_write_locked(wdev, WFX_REG_AHB_DPORT, addr, buf, len);
+ return wfx_indirect_write_locked(wdev, WFX_REG_AHB_DPORT,
+ addr, buf, len);
}

-int sram_reg_read(struct wfx_dev *wdev, u32 addr, u32 *val)
+int wfx_sram_reg_read(struct wfx_dev *wdev, u32 addr, u32 *val)
{
- return indirect_read32_locked(wdev, WFX_REG_SRAM_DPORT, addr, val);
+ return wfx_indirect_read32_locked(wdev, WFX_REG_SRAM_DPORT,
+ addr, val);
}

-int ahb_reg_read(struct wfx_dev *wdev, u32 addr, u32 *val)
+int wfx_ahb_reg_read(struct wfx_dev *wdev, u32 addr, u32 *val)
{
- return indirect_read32_locked(wdev, WFX_REG_AHB_DPORT, addr, val);
+ return wfx_indirect_read32_locked(wdev, WFX_REG_AHB_DPORT,
+ addr, val);
}

-int sram_reg_write(struct wfx_dev *wdev, u32 addr, u32 val)
+int wfx_sram_reg_write(struct wfx_dev *wdev, u32 addr, u32 val)
{
- return indirect_write32_locked(wdev, WFX_REG_SRAM_DPORT, addr, val);
+ return wfx_indirect_write32_locked(wdev, WFX_REG_SRAM_DPORT, addr, val);
}

-int ahb_reg_write(struct wfx_dev *wdev, u32 addr, u32 val)
+int wfx_ahb_reg_write(struct wfx_dev *wdev, u32 addr, u32 val)
{
- return indirect_write32_locked(wdev, WFX_REG_AHB_DPORT, addr, val);
+ return wfx_indirect_write32_locked(wdev, WFX_REG_AHB_DPORT, addr, val);
}

-int config_reg_read(struct wfx_dev *wdev, u32 *val)
+int wfx_config_reg_read(struct wfx_dev *wdev, u32 *val)
{
- return read32_locked(wdev, WFX_REG_CONFIG, val);
+ return wfx_read32_locked(wdev, WFX_REG_CONFIG, val);
}

-int config_reg_write(struct wfx_dev *wdev, u32 val)
+int wfx_config_reg_write(struct wfx_dev *wdev, u32 val)
{
- return write32_locked(wdev, WFX_REG_CONFIG, val);
+ return wfx_write32_locked(wdev, WFX_REG_CONFIG, val);
}

-int config_reg_write_bits(struct wfx_dev *wdev, u32 mask, u32 val)
+int wfx_config_reg_write_bits(struct wfx_dev *wdev, u32 mask, u32 val)
{
- return write32_bits_locked(wdev, WFX_REG_CONFIG, mask, val);
+ return wfx_write32_bits_locked(wdev, WFX_REG_CONFIG, mask, val);
}

-int control_reg_read(struct wfx_dev *wdev, u32 *val)
+int wfx_control_reg_read(struct wfx_dev *wdev, u32 *val)
{
- return read32_locked(wdev, WFX_REG_CONTROL, val);
+ return wfx_read32_locked(wdev, WFX_REG_CONTROL, val);
}

-int control_reg_write(struct wfx_dev *wdev, u32 val)
+int wfx_control_reg_write(struct wfx_dev *wdev, u32 val)
{
- return write32_locked(wdev, WFX_REG_CONTROL, val);
+ return wfx_write32_locked(wdev, WFX_REG_CONTROL, val);
}

-int control_reg_write_bits(struct wfx_dev *wdev, u32 mask, u32 val)
+int wfx_control_reg_write_bits(struct wfx_dev *wdev, u32 mask, u32 val)
{
- return write32_bits_locked(wdev, WFX_REG_CONTROL, mask, val);
+ return wfx_write32_bits_locked(wdev, WFX_REG_CONTROL, mask, val);
}

-int igpr_reg_read(struct wfx_dev *wdev, int index, u32 *val)
+int wfx_igpr_reg_read(struct wfx_dev *wdev, int index, u32 *val)
{
int ret;

*val = ~0; /* Never return undefined value */
- ret = write32_locked(wdev, WFX_REG_SET_GEN_R_W, IGPR_RW | index << 24);
+ ret = wfx_write32_locked(wdev, WFX_REG_SET_GEN_R_W, IGPR_RW | index << 24);
if (ret)
return ret;
- ret = read32_locked(wdev, WFX_REG_SET_GEN_R_W, val);
+ ret = wfx_read32_locked(wdev, WFX_REG_SET_GEN_R_W, val);
if (ret)
return ret;
*val &= IGPR_VALUE;
return ret;
}

-int igpr_reg_write(struct wfx_dev *wdev, int index, u32 val)
+int wfx_igpr_reg_write(struct wfx_dev *wdev, int index, u32 val)
{
- return write32_locked(wdev, WFX_REG_SET_GEN_R_W, index << 24 | val);
+ return wfx_write32_locked(wdev, WFX_REG_SET_GEN_R_W, index << 24 | val);
}
diff --git a/drivers/staging/wfx/hwio.h b/drivers/staging/wfx/hwio.h
index d34baae47017..8c8fe76871f8 100644
--- a/drivers/staging/wfx/hwio.h
+++ b/drivers/staging/wfx/hwio.h
@@ -19,17 +19,17 @@ struct wfx_dev;
int wfx_data_read(struct wfx_dev *wdev, void *buf, size_t buf_len);
int wfx_data_write(struct wfx_dev *wdev, const void *buf, size_t buf_len);

-int sram_buf_read(struct wfx_dev *wdev, u32 addr, void *buf, size_t len);
-int sram_buf_write(struct wfx_dev *wdev, u32 addr, const void *buf, size_t len);
+int wfx_sram_buf_read(struct wfx_dev *wdev, u32 addr, void *buf, size_t len);
+int wfx_sram_buf_write(struct wfx_dev *wdev, u32 addr, const void *buf, size_t len);

-int ahb_buf_read(struct wfx_dev *wdev, u32 addr, void *buf, size_t len);
-int ahb_buf_write(struct wfx_dev *wdev, u32 addr, const void *buf, size_t len);
+int wfx_ahb_buf_read(struct wfx_dev *wdev, u32 addr, void *buf, size_t len);
+int wfx_ahb_buf_write(struct wfx_dev *wdev, u32 addr, const void *buf, size_t len);

-int sram_reg_read(struct wfx_dev *wdev, u32 addr, u32 *val);
-int sram_reg_write(struct wfx_dev *wdev, u32 addr, u32 val);
+int wfx_sram_reg_read(struct wfx_dev *wdev, u32 addr, u32 *val);
+int wfx_sram_reg_write(struct wfx_dev *wdev, u32 addr, u32 val);

-int ahb_reg_read(struct wfx_dev *wdev, u32 addr, u32 *val);
-int ahb_reg_write(struct wfx_dev *wdev, u32 addr, u32 val);
+int wfx_ahb_reg_read(struct wfx_dev *wdev, u32 addr, u32 *val);
+int wfx_ahb_reg_write(struct wfx_dev *wdev, u32 addr, u32 val);

#define CFG_ERR_SPI_FRAME 0x00000001 /* only with SPI */
#define CFG_ERR_SDIO_BUF_MISMATCH 0x00000001 /* only with SDIO */
@@ -59,21 +59,21 @@ int ahb_reg_write(struct wfx_dev *wdev, u32 addr, u32 val);
#define CFG_DEVICE_ID_MAJOR 0x07000000
#define CFG_DEVICE_ID_RESERVED 0x78000000
#define CFG_DEVICE_ID_TYPE 0x80000000
-int config_reg_read(struct wfx_dev *wdev, u32 *val);
-int config_reg_write(struct wfx_dev *wdev, u32 val);
-int config_reg_write_bits(struct wfx_dev *wdev, u32 mask, u32 val);
+int wfx_config_reg_read(struct wfx_dev *wdev, u32 *val);
+int wfx_config_reg_write(struct wfx_dev *wdev, u32 val);
+int wfx_config_reg_write_bits(struct wfx_dev *wdev, u32 mask, u32 val);

#define CTRL_NEXT_LEN_MASK 0x00000FFF
#define CTRL_WLAN_WAKEUP 0x00001000
#define CTRL_WLAN_READY 0x00002000
-int control_reg_read(struct wfx_dev *wdev, u32 *val);
-int control_reg_write(struct wfx_dev *wdev, u32 val);
-int control_reg_write_bits(struct wfx_dev *wdev, u32 mask, u32 val);
+int wfx_control_reg_read(struct wfx_dev *wdev, u32 *val);
+int wfx_control_reg_write(struct wfx_dev *wdev, u32 val);
+int wfx_control_reg_write_bits(struct wfx_dev *wdev, u32 mask, u32 val);

#define IGPR_RW 0x80000000
#define IGPR_INDEX 0x7F000000
#define IGPR_VALUE 0x00FFFFFF
-int igpr_reg_read(struct wfx_dev *wdev, int index, u32 *val);
-int igpr_reg_write(struct wfx_dev *wdev, int index, u32 val);
+int wfx_igpr_reg_read(struct wfx_dev *wdev, int index, u32 *val);
+int wfx_igpr_reg_write(struct wfx_dev *wdev, int index, u32 val);

#endif
diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c
index abc1a6d43300..43947f8f2e0c 100644
--- a/drivers/staging/wfx/main.c
+++ b/drivers/staging/wfx/main.c
@@ -428,7 +428,7 @@ int wfx_probe(struct wfx_dev *wdev)
"enable 'quiescent' power mode with wakeup GPIO and PDS file %s\n",
wdev->pdata.file_pds);
gpiod_set_value_cansleep(wdev->pdata.gpio_wakeup, 1);
- control_reg_write(wdev, 0);
+ wfx_control_reg_write(wdev, 0);
wfx_hif_set_operational_mode(wdev, HIF_OP_POWER_MODE_QUIESCENT);
} else {
wfx_hif_set_operational_mode(wdev, HIF_OP_POWER_MODE_DOZE);
--
2.34.1

2022-01-13 08:56:48

by Jérôme Pouiller

[permalink] [raw]
Subject: [PATCH 17/31] staging: wfx: prefix tx_policy_is_equal() with wfx_

From: Jérôme Pouiller <[email protected]>

tx_policy_is_equal() was the only function from data_tx.c without the
prefix wfx_.

Signed-off-by: Jérôme Pouiller <[email protected]>
---
drivers/staging/wfx/data_tx.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c
index 54ff9bca78d6..c3efbcdcc8c3 100644
--- a/drivers/staging/wfx/data_tx.c
+++ b/drivers/staging/wfx/data_tx.c
@@ -66,8 +66,8 @@ static void wfx_tx_policy_build(struct wfx_vif *wvif, struct tx_policy *policy,
}
}

-static bool tx_policy_is_equal(const struct tx_policy *a,
- const struct tx_policy *b)
+static bool wfx_tx_policy_is_equal(const struct tx_policy *a,
+ const struct tx_policy *b)
{
return !memcmp(a->rates, b->rates, sizeof(a->rates));
}
@@ -78,10 +78,10 @@ static int wfx_tx_policy_find(struct tx_policy_cache *cache,
struct tx_policy *it;

list_for_each_entry(it, &cache->used, link)
- if (tx_policy_is_equal(wanted, it))
+ if (wfx_tx_policy_is_equal(wanted, it))
return it - cache->cache;
list_for_each_entry(it, &cache->free, link)
- if (tx_policy_is_equal(wanted, it))
+ if (wfx_tx_policy_is_equal(wanted, it))
return it - cache->cache;
return -1;
}
--
2.34.1

2022-01-13 08:56:55

by Jérôme Pouiller

[permalink] [raw]
Subject: [PATCH 09/31] staging: wfx: replace magic value by WFX_HIF_BUFFER_SIZE

From: Jérôme Pouiller <[email protected]>

Magic values are not recommended.

Signed-off-by: Jérôme Pouiller <[email protected]>
---
drivers/staging/wfx/hwio.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wfx/hwio.c b/drivers/staging/wfx/hwio.c
index a2a37efc51a6..977b9325f496 100644
--- a/drivers/staging/wfx/hwio.c
+++ b/drivers/staging/wfx/hwio.c
@@ -15,6 +15,8 @@
#include "bus.h"
#include "traces.h"

+#define WFX_HIF_BUFFER_SIZE 0x2000
+
static int read32(struct wfx_dev *wdev, int reg, u32 *val)
{
int ret;
@@ -103,7 +105,7 @@ static int indirect_read(struct wfx_dev *wdev, int reg, u32 addr,
u32 cfg;
u32 prefetch;

- WARN_ON(len >= 0x2000);
+ WARN_ON(len >= WFX_HIF_BUFFER_SIZE);
WARN_ON(reg != WFX_REG_AHB_DPORT && reg != WFX_REG_SRAM_DPORT);

if (reg == WFX_REG_AHB_DPORT)
@@ -151,7 +153,7 @@ static int indirect_write(struct wfx_dev *wdev, int reg, u32 addr,
{
int ret;

- WARN_ON(len >= 0x2000);
+ WARN_ON(len >= WFX_HIF_BUFFER_SIZE);
WARN_ON(reg != WFX_REG_AHB_DPORT && reg != WFX_REG_SRAM_DPORT);
ret = write32(wdev, WFX_REG_BASE_ADDR, addr);
if (ret < 0)
--
2.34.1

2022-01-13 08:57:03

by Jérôme Pouiller

[permalink] [raw]
Subject: [PATCH 08/31] staging: wfx: use IS_ALIGNED()

From: Jérôme Pouiller <[email protected]>

It "IS_ALIGNED(ptr, 4)" is more explicit than "ptr & 3".

Signed-off-by: Jérôme Pouiller <[email protected]>
---
drivers/staging/wfx/bus_sdio.c | 9 +++++----
drivers/staging/wfx/hwio.c | 5 +++--
2 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/wfx/bus_sdio.c b/drivers/staging/wfx/bus_sdio.c
index a670176ba06f..42aeab30bf0a 100644
--- a/drivers/staging/wfx/bus_sdio.c
+++ b/drivers/staging/wfx/bus_sdio.c
@@ -12,6 +12,7 @@
#include <linux/interrupt.h>
#include <linux/of_irq.h>
#include <linux/irq.h>
+#include <linux/align.h>

#include "bus.h"
#include "wfx.h"
@@ -40,8 +41,8 @@ static int wfx_sdio_copy_from_io(void *priv, unsigned int reg_id,
int ret;

WARN(reg_id > 7, "chip only has 7 registers");
- WARN(((uintptr_t)dst) & 3, "unaligned buffer size");
- WARN(count & 3, "unaligned buffer address");
+ WARN(!IS_ALIGNED((uintptr_t)dst, 4), "unaligned buffer address");
+ WARN(!IS_ALIGNED(count, 4), "unaligned buffer size");

/* Use queue mode buffers */
if (reg_id == WFX_REG_IN_OUT_QUEUE)
@@ -61,8 +62,8 @@ static int wfx_sdio_copy_to_io(void *priv, unsigned int reg_id,
int ret;

WARN(reg_id > 7, "chip only has 7 registers");
- WARN(((uintptr_t)src) & 3, "unaligned buffer size");
- WARN(count & 3, "unaligned buffer address");
+ WARN(!IS_ALIGNED((uintptr_t)src, 4), "unaligned buffer address");
+ WARN(!IS_ALIGNED(count, 4), "unaligned buffer size");

/* Use queue mode buffers */
if (reg_id == WFX_REG_IN_OUT_QUEUE)
diff --git a/drivers/staging/wfx/hwio.c b/drivers/staging/wfx/hwio.c
index 393bcb1e2f4e..a2a37efc51a6 100644
--- a/drivers/staging/wfx/hwio.c
+++ b/drivers/staging/wfx/hwio.c
@@ -8,6 +8,7 @@
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/slab.h>
+#include <linux/align.h>

#include "hwio.h"
#include "wfx.h"
@@ -221,7 +222,7 @@ int wfx_data_read(struct wfx_dev *wdev, void *buf, size_t len)
{
int ret;

- WARN((long)buf & 3, "%s: unaligned buffer", __func__);
+ WARN(!IS_ALIGNED((uintptr_t)buf, 4), "unaligned buffer");
wdev->hwbus_ops->lock(wdev->hwbus_priv);
ret = wdev->hwbus_ops->copy_from_io(wdev->hwbus_priv,
WFX_REG_IN_OUT_QUEUE, buf, len);
@@ -237,7 +238,7 @@ int wfx_data_write(struct wfx_dev *wdev, const void *buf, size_t len)
{
int ret;

- WARN((long)buf & 3, "%s: unaligned buffer", __func__);
+ WARN(!IS_ALIGNED((uintptr_t)buf, 4), "unaligned buffer");
wdev->hwbus_ops->lock(wdev->hwbus_priv);
ret = wdev->hwbus_ops->copy_to_io(wdev->hwbus_priv,
WFX_REG_IN_OUT_QUEUE, buf, len);
--
2.34.1

2022-01-13 08:57:10

by Jérôme Pouiller

[permalink] [raw]
Subject: [PATCH 19/31] staging: wfx: prefix structs tx_policy and hwbus_ops with wfx_

From: Jérôme Pouiller <[email protected]>

All the types related to a driver should use the same prefix.

Signed-off-by: Jérôme Pouiller <[email protected]>
---
drivers/staging/wfx/bus.h | 2 +-
drivers/staging/wfx/bus_sdio.c | 2 +-
drivers/staging/wfx/bus_spi.c | 2 +-
drivers/staging/wfx/data_tx.c | 38 +++++++++++++++++-----------------
drivers/staging/wfx/data_tx.h | 10 ++++-----
drivers/staging/wfx/hif_rx.c | 4 ++--
drivers/staging/wfx/main.c | 2 +-
drivers/staging/wfx/main.h | 4 ++--
drivers/staging/wfx/wfx.h | 6 +++---
9 files changed, 35 insertions(+), 35 deletions(-)

diff --git a/drivers/staging/wfx/bus.h b/drivers/staging/wfx/bus.h
index ca04b3da6204..91b5a545b8ff 100644
--- a/drivers/staging/wfx/bus.h
+++ b/drivers/staging/wfx/bus.h
@@ -20,7 +20,7 @@
#define WFX_REG_SET_GEN_R_W 0x6
#define WFX_REG_FRAME_OUT 0x7

-struct hwbus_ops {
+struct wfx_hwbus_ops {
int (*copy_from_io)(void *bus_priv, unsigned int addr,
void *dst, size_t count);
int (*copy_to_io)(void *bus_priv, unsigned int addr,
diff --git a/drivers/staging/wfx/bus_sdio.c b/drivers/staging/wfx/bus_sdio.c
index 42aeab30bf0a..abcb507a48b3 100644
--- a/drivers/staging/wfx/bus_sdio.c
+++ b/drivers/staging/wfx/bus_sdio.c
@@ -159,7 +159,7 @@ static size_t wfx_sdio_align_size(void *priv, size_t size)
return sdio_align_size(bus->func, size);
}

-static const struct hwbus_ops wfx_sdio_hwbus_ops = {
+static const struct wfx_hwbus_ops wfx_sdio_hwbus_ops = {
.copy_from_io = wfx_sdio_copy_from_io,
.copy_to_io = wfx_sdio_copy_to_io,
.irq_subscribe = wfx_sdio_irq_subscribe,
diff --git a/drivers/staging/wfx/bus_spi.c b/drivers/staging/wfx/bus_spi.c
index 55ffcd7c42e2..99d33a128830 100644
--- a/drivers/staging/wfx/bus_spi.c
+++ b/drivers/staging/wfx/bus_spi.c
@@ -168,7 +168,7 @@ static size_t wfx_spi_align_size(void *priv, size_t size)
return ALIGN(size, 4);
}

-static const struct hwbus_ops wfx_spi_hwbus_ops = {
+static const struct wfx_hwbus_ops wfx_spi_hwbus_ops = {
.copy_from_io = wfx_spi_copy_from_io,
.copy_to_io = wfx_spi_copy_to_io,
.irq_subscribe = wfx_spi_irq_subscribe,
diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c
index c004f455bb47..fec30d773e62 100644
--- a/drivers/staging/wfx/data_tx.c
+++ b/drivers/staging/wfx/data_tx.c
@@ -44,7 +44,7 @@ static int wfx_get_hw_rate(struct wfx_dev *wdev,

/* TX policy cache implementation */

-static void wfx_tx_policy_build(struct wfx_vif *wvif, struct tx_policy *policy,
+static void wfx_tx_policy_build(struct wfx_vif *wvif, struct wfx_tx_policy *policy,
struct ieee80211_tx_rate *rates)
{
struct wfx_dev *wdev = wvif->wdev;
@@ -66,16 +66,16 @@ static void wfx_tx_policy_build(struct wfx_vif *wvif, struct tx_policy *policy,
}
}

-static bool wfx_tx_policy_is_equal(const struct tx_policy *a,
- const struct tx_policy *b)
+static bool wfx_tx_policy_is_equal(const struct wfx_tx_policy *a,
+ const struct wfx_tx_policy *b)
{
return !memcmp(a->rates, b->rates, sizeof(a->rates));
}

-static int wfx_tx_policy_find(struct tx_policy_cache *cache,
- struct tx_policy *wanted)
+static int wfx_tx_policy_find(struct wfx_tx_policy_cache *cache,
+ struct wfx_tx_policy *wanted)
{
- struct tx_policy *it;
+ struct wfx_tx_policy *it;

list_for_each_entry(it, &cache->used, link)
if (wfx_tx_policy_is_equal(wanted, it))
@@ -86,15 +86,15 @@ static int wfx_tx_policy_find(struct tx_policy_cache *cache,
return -1;
}

-static void wfx_tx_policy_use(struct tx_policy_cache *cache,
- struct tx_policy *entry)
+static void wfx_tx_policy_use(struct wfx_tx_policy_cache *cache,
+ struct wfx_tx_policy *entry)
{
++entry->usage_count;
list_move(&entry->link, &cache->used);
}

-static int wfx_tx_policy_release(struct tx_policy_cache *cache,
- struct tx_policy *entry)
+static int wfx_tx_policy_release(struct wfx_tx_policy_cache *cache,
+ struct wfx_tx_policy *entry)
{
int ret = --entry->usage_count;

@@ -107,9 +107,9 @@ static int wfx_tx_policy_get(struct wfx_vif *wvif,
struct ieee80211_tx_rate *rates, bool *renew)
{
int idx;
- struct tx_policy_cache *cache = &wvif->tx_policy_cache;
- struct tx_policy wanted;
- struct tx_policy *entry;
+ struct wfx_tx_policy_cache *cache = &wvif->tx_policy_cache;
+ struct wfx_tx_policy wanted;
+ struct wfx_tx_policy *entry;

wfx_tx_policy_build(wvif, &wanted, rates);

@@ -127,7 +127,7 @@ static int wfx_tx_policy_get(struct wfx_vif *wvif,
* entry in "free" list
*/
*renew = true;
- entry = list_entry(cache->free.prev, struct tx_policy, link);
+ entry = list_entry(cache->free.prev, struct wfx_tx_policy, link);
memcpy(entry->rates, wanted.rates, sizeof(entry->rates));
entry->uploaded = false;
entry->usage_count = 0;
@@ -143,7 +143,7 @@ static int wfx_tx_policy_get(struct wfx_vif *wvif,
static void wfx_tx_policy_put(struct wfx_vif *wvif, int idx)
{
int usage, locked;
- struct tx_policy_cache *cache = &wvif->tx_policy_cache;
+ struct wfx_tx_policy_cache *cache = &wvif->tx_policy_cache;

if (idx == HIF_TX_RETRY_POLICY_INVALID)
return;
@@ -157,7 +157,7 @@ static void wfx_tx_policy_put(struct wfx_vif *wvif, int idx)

static int wfx_tx_policy_upload(struct wfx_vif *wvif)
{
- struct tx_policy *policies = wvif->tx_policy_cache.cache;
+ struct wfx_tx_policy *policies = wvif->tx_policy_cache.cache;
u8 tmp_rates[12];
int i, is_used;

@@ -192,7 +192,7 @@ void wfx_tx_policy_upload_work(struct work_struct *work)

void wfx_tx_policy_init(struct wfx_vif *wvif)
{
- struct tx_policy_cache *cache = &wvif->tx_policy_cache;
+ struct wfx_tx_policy_cache *cache = &wvif->tx_policy_cache;
int i;

memset(cache, 0, sizeof(*cache));
@@ -435,8 +435,8 @@ void wfx_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control,

static void wfx_skb_dtor(struct wfx_vif *wvif, struct sk_buff *skb)
{
- struct wfx_hif_msg *hif = (struct hif_msg *)skb->data;
- struct wfx_hif_req_tx *req = (struct hif_req_tx *)hif->body;
+ struct wfx_hif_msg *hif = (struct wfx_hif_msg *)skb->data;
+ struct wfx_hif_req_tx *req = (struct wfx_hif_req_tx *)hif->body;
unsigned int offset = sizeof(struct wfx_hif_msg) +
sizeof(struct wfx_hif_req_tx) +
req->fc_offset;
diff --git a/drivers/staging/wfx/data_tx.h b/drivers/staging/wfx/data_tx.h
index c901a03ee4d8..040f731e62ae 100644
--- a/drivers/staging/wfx/data_tx.h
+++ b/drivers/staging/wfx/data_tx.h
@@ -18,15 +18,15 @@ struct wfx_tx_priv;
struct wfx_dev;
struct wfx_vif;

-struct tx_policy {
+struct wfx_tx_policy {
struct list_head link;
int usage_count;
u8 rates[12];
bool uploaded;
};

-struct tx_policy_cache {
- struct tx_policy cache[HIF_TX_RETRY_POLICY_MAX];
+struct wfx_tx_policy_cache {
+ struct wfx_tx_policy cache[HIF_TX_RETRY_POLICY_MAX];
/* FIXME: use a trees and drop hash from tx_policy */
struct list_head used;
struct list_head free;
@@ -59,8 +59,8 @@ static inline struct wfx_tx_priv *wfx_skb_tx_priv(struct sk_buff *skb)

static inline struct wfx_hif_req_tx *wfx_skb_txreq(struct sk_buff *skb)
{
- struct wfx_hif_msg *hif = (struct hif_msg *)skb->data;
- struct wfx_hif_req_tx *req = (struct hif_req_tx *)hif->body;
+ struct wfx_hif_msg *hif = (struct wfx_hif_msg *)skb->data;
+ struct wfx_hif_req_tx *req = (struct wfx_hif_req_tx *)hif->body;

return req;
}
diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/staging/wfx/hif_rx.c
index f2564a20bdcf..2073ac43bebd 100644
--- a/drivers/staging/wfx/hif_rx.c
+++ b/drivers/staging/wfx/hif_rx.c
@@ -110,7 +110,7 @@ static int wfx_hif_receive_indication(struct wfx_dev *wdev,
__func__, hif->interface);
return -EIO;
}
- skb_pull(skb, sizeof(struct wfx_hif_msg) + sizeof(struct hif_ind_rx));
+ skb_pull(skb, sizeof(struct wfx_hif_msg) + sizeof(struct wfx_hif_ind_rx));
wfx_rx_cb(wvif, body, skb);

return 0;
@@ -380,7 +380,7 @@ static const struct {
void wfx_handle_rx(struct wfx_dev *wdev, struct sk_buff *skb)
{
int i;
- const struct wfx_hif_msg *hif = (const struct hif_msg *)skb->data;
+ const struct wfx_hif_msg *hif = (const struct wfx_hif_msg *)skb->data;
int hif_id = hif->id;

if (hif_id == HIF_IND_ID_RX) {
diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c
index f34cfed503d4..7b9d75f219fb 100644
--- a/drivers/staging/wfx/main.c
+++ b/drivers/staging/wfx/main.c
@@ -262,7 +262,7 @@ static void wfx_free_common(void *data)

struct wfx_dev *wfx_init_common(struct device *dev,
const struct wfx_platform_data *pdata,
- const struct hwbus_ops *hwbus_ops,
+ const struct wfx_hwbus_ops *hwbus_ops,
void *hwbus_priv)
{
struct ieee80211_hw *hw;
diff --git a/drivers/staging/wfx/main.h b/drivers/staging/wfx/main.h
index 115abd2d4378..68a7807c5fb6 100644
--- a/drivers/staging/wfx/main.h
+++ b/drivers/staging/wfx/main.h
@@ -16,7 +16,7 @@
#include "hif_api_general.h"

struct wfx_dev;
-struct hwbus_ops;
+struct wfx_hwbus_ops;

struct wfx_platform_data {
/* Keyset and ".sec" extension will be appended to this string */
@@ -31,7 +31,7 @@ struct wfx_platform_data {

struct wfx_dev *wfx_init_common(struct device *dev,
const struct wfx_platform_data *pdata,
- const struct hwbus_ops *hwbus_ops,
+ const struct wfx_hwbus_ops *hwbus_ops,
void *hwbus_priv);

int wfx_probe(struct wfx_dev *wdev);
diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h
index 1c06430e5996..189b96cd3d13 100644
--- a/drivers/staging/wfx/wfx.h
+++ b/drivers/staging/wfx/wfx.h
@@ -25,7 +25,7 @@
#define USEC_PER_TXOP 32 /* see struct ieee80211_tx_queue_params */
#define USEC_PER_TU 1024

-struct hwbus_ops;
+struct wfx_hwbus_ops;

struct wfx_dev {
struct wfx_platform_data pdata;
@@ -33,7 +33,7 @@ struct wfx_dev {
struct ieee80211_hw *hw;
struct ieee80211_vif *vif[2];
struct mac_address addresses[2];
- const struct hwbus_ops *hwbus_ops;
+ const struct wfx_hwbus_ops *hwbus_ops;
void *hwbus_priv;

u8 keyset;
@@ -74,7 +74,7 @@ struct wfx_vif {
struct delayed_work beacon_loss_work;

struct wfx_queue tx_queue[4];
- struct tx_policy_cache tx_policy_cache;
+ struct wfx_tx_policy_cache tx_policy_cache;
struct work_struct tx_policy_upload_work;

struct work_struct update_tim_work;
--
2.34.1

2022-01-13 08:57:13

by Jérôme Pouiller

[permalink] [raw]
Subject: [PATCH 16/31] staging: wfx: prefix functions from debug.h with wfx_

From: Jérôme Pouiller <[email protected]>

All the functions related to a driver should use the same prefix.

Signed-off-by: Jérôme Pouiller <[email protected]>
---
drivers/staging/wfx/debug.c | 6 +++---
drivers/staging/wfx/debug.h | 6 +++---
drivers/staging/wfx/hif_tx.c | 8 ++++----
3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/wfx/debug.c b/drivers/staging/wfx/debug.c
index e5f940f19bbe..9324248b1d20 100644
--- a/drivers/staging/wfx/debug.c
+++ b/drivers/staging/wfx/debug.c
@@ -44,17 +44,17 @@ static const char *get_symbol(unsigned long val,
return "unknown";
}

-const char *get_hif_name(unsigned long id)
+const char *wfx_get_hif_name(unsigned long id)
{
return get_symbol(id, hif_msg_print_map);
}

-const char *get_mib_name(unsigned long id)
+const char *wfx_get_mib_name(unsigned long id)
{
return get_symbol(id, hif_mib_print_map);
}

-const char *get_reg_name(unsigned long id)
+const char *wfx_get_reg_name(unsigned long id)
{
return get_symbol(id, wfx_reg_print_map);
}
diff --git a/drivers/staging/wfx/debug.h b/drivers/staging/wfx/debug.h
index 4b9c49a9fffb..3840575e5e28 100644
--- a/drivers/staging/wfx/debug.h
+++ b/drivers/staging/wfx/debug.h
@@ -12,8 +12,8 @@ struct wfx_dev;

int wfx_debug_init(struct wfx_dev *wdev);

-const char *get_hif_name(unsigned long id);
-const char *get_mib_name(unsigned long id);
-const char *get_reg_name(unsigned long id);
+const char *wfx_get_hif_name(unsigned long id);
+const char *wfx_get_mib_name(unsigned long id);
+const char *wfx_get_reg_name(unsigned long id);

#endif
diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c
index 9899e7b62203..67f1847c1fc1 100644
--- a/drivers/staging/wfx/hif_tx.c
+++ b/drivers/staging/wfx/hif_tx.c
@@ -106,15 +106,15 @@ int wfx_cmd_send(struct wfx_dev *wdev, struct hif_msg *request,

if (ret &&
(cmd == HIF_REQ_ID_READ_MIB || cmd == HIF_REQ_ID_WRITE_MIB)) {
- mib_name = get_mib_name(((u16 *)request)[2]);
+ mib_name = wfx_get_mib_name(((u16 *)request)[2]);
mib_sep = "/";
}
if (ret < 0)
dev_err(wdev->dev, "hardware request %s%s%s (%#.2x) on vif %d returned error %d\n",
- get_hif_name(cmd), mib_sep, mib_name, cmd, vif, ret);
+ wfx_get_hif_name(cmd), mib_sep, mib_name, cmd, vif, ret);
if (ret > 0)
dev_warn(wdev->dev, "hardware request %s%s%s (%#.2x) on vif %d returned status %d\n",
- get_hif_name(cmd), mib_sep, mib_name, cmd, vif, ret);
+ wfx_get_hif_name(cmd), mib_sep, mib_name, cmd, vif, ret);

return ret;
}
@@ -196,7 +196,7 @@ int wfx_hif_read_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id,
}
if (ret == -ENOMEM)
dev_err(wdev->dev, "buffer is too small to receive %s (%zu < %d)\n",
- get_mib_name(mib_id), val_len,
+ wfx_get_mib_name(mib_id), val_len,
le16_to_cpu(reply->length));
if (!ret)
memcpy(val, &reply->mib_data, le16_to_cpu(reply->length));
--
2.34.1

2022-01-13 08:57:15

by Jérôme Pouiller

[permalink] [raw]
Subject: [PATCH 18/31] staging: wfx: prefix structs hif_* with wfx_

From: Jérôme Pouiller <[email protected]>

All the types related to a driver should use the same prefix.

Signed-off-by: Jérôme Pouiller <[email protected]>
---
drivers/staging/wfx/bh.c | 12 +--
drivers/staging/wfx/data_rx.c | 2 +-
drivers/staging/wfx/data_rx.h | 4 +-
drivers/staging/wfx/data_tx.c | 30 +++---
drivers/staging/wfx/data_tx.h | 8 +-
drivers/staging/wfx/debug.c | 10 +-
drivers/staging/wfx/hif_api_cmd.h | 142 +++++++++++++-------------
drivers/staging/wfx/hif_api_general.h | 44 ++++----
drivers/staging/wfx/hif_api_mib.h | 66 ++++++------
drivers/staging/wfx/hif_rx.c | 57 ++++++-----
drivers/staging/wfx/hif_tx.c | 95 ++++++++---------
drivers/staging/wfx/hif_tx.h | 20 ++--
drivers/staging/wfx/hif_tx_mib.c | 54 +++++-----
drivers/staging/wfx/hif_tx_mib.h | 10 +-
drivers/staging/wfx/key.c | 20 ++--
drivers/staging/wfx/main.c | 4 +-
drivers/staging/wfx/queue.c | 22 ++--
drivers/staging/wfx/queue.h | 2 +-
drivers/staging/wfx/sta.c | 2 +-
drivers/staging/wfx/traces.h | 10 +-
drivers/staging/wfx/wfx.h | 6 +-
21 files changed, 311 insertions(+), 309 deletions(-)

diff --git a/drivers/staging/wfx/bh.c b/drivers/staging/wfx/bh.c
index b7fa0aeafd78..872f3298dc87 100644
--- a/drivers/staging/wfx/bh.c
+++ b/drivers/staging/wfx/bh.c
@@ -67,7 +67,7 @@ static void device_release(struct wfx_dev *wdev)
static int rx_helper(struct wfx_dev *wdev, size_t read_len, int *is_cnf)
{
struct sk_buff *skb;
- struct hif_msg *hif;
+ struct wfx_hif_msg *hif;
size_t alloc_len;
size_t computed_len;
int release_count;
@@ -88,9 +88,9 @@ static int rx_helper(struct wfx_dev *wdev, size_t read_len, int *is_cnf)
piggyback = le16_to_cpup((__le16 *)(skb->data + alloc_len - 2));
_trace_piggyback(piggyback, false);

- hif = (struct hif_msg *)skb->data;
+ hif = (struct wfx_hif_msg *)skb->data;
WARN(hif->encrypted & 0x3, "encryption is unsupported");
- if (WARN(read_len < sizeof(struct hif_msg), "corrupted read"))
+ if (WARN(read_len < sizeof(struct wfx_hif_msg), "corrupted read"))
goto err;
computed_len = le16_to_cpu(hif->len);
computed_len = round_up(computed_len, 2);
@@ -105,7 +105,7 @@ static int rx_helper(struct wfx_dev *wdev, size_t read_len, int *is_cnf)
if (!(hif->id & HIF_ID_IS_INDICATION)) {
(*is_cnf)++;
if (hif->id == HIF_CNF_ID_MULTI_TRANSMIT)
- release_count = ((struct hif_cnf_multi_transmit *)hif->body)->num_tx_confs;
+ release_count = ((struct wfx_hif_cnf_multi_transmit *)hif->body)->num_tx_confs;
else
release_count = 1;
WARN(wdev->hif.tx_buffers_used < release_count, "corrupted buffer counter");
@@ -169,7 +169,7 @@ static int bh_work_rx(struct wfx_dev *wdev, int max_msg, int *num_cnf)
return i;
}

-static void tx_helper(struct wfx_dev *wdev, struct hif_msg *hif)
+static void tx_helper(struct wfx_dev *wdev, struct wfx_hif_msg *hif)
{
int ret;
void *data;
@@ -199,7 +199,7 @@ static void tx_helper(struct wfx_dev *wdev, struct hif_msg *hif)

static int bh_work_tx(struct wfx_dev *wdev, int max_msg)
{
- struct hif_msg *hif;
+ struct wfx_hif_msg *hif;
int i;

for (i = 0; i < max_msg; i++) {
diff --git a/drivers/staging/wfx/data_rx.c b/drivers/staging/wfx/data_rx.c
index bfc3961b7b89..3fe67c4815e7 100644
--- a/drivers/staging/wfx/data_rx.c
+++ b/drivers/staging/wfx/data_rx.c
@@ -35,7 +35,7 @@ static void wfx_rx_handle_ba(struct wfx_vif *wvif, struct ieee80211_mgmt *mgmt)
}

void wfx_rx_cb(struct wfx_vif *wvif,
- const struct hif_ind_rx *arg, struct sk_buff *skb)
+ const struct wfx_hif_ind_rx *arg, struct sk_buff *skb)
{
struct ieee80211_rx_status *hdr = IEEE80211_SKB_RXCB(skb);
struct ieee80211_hdr *frame = (struct ieee80211_hdr *)skb->data;
diff --git a/drivers/staging/wfx/data_rx.h b/drivers/staging/wfx/data_rx.h
index 84d0e3c0507b..7d77cdbbc31b 100644
--- a/drivers/staging/wfx/data_rx.h
+++ b/drivers/staging/wfx/data_rx.h
@@ -10,9 +10,9 @@

struct wfx_vif;
struct sk_buff;
-struct hif_ind_rx;
+struct wfx_hif_ind_rx;

void wfx_rx_cb(struct wfx_vif *wvif,
- const struct hif_ind_rx *arg, struct sk_buff *skb);
+ const struct wfx_hif_ind_rx *arg, struct sk_buff *skb);

#endif
diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c
index c3efbcdcc8c3..c004f455bb47 100644
--- a/drivers/staging/wfx/data_tx.c
+++ b/drivers/staging/wfx/data_tx.c
@@ -329,16 +329,16 @@ static int wfx_tx_get_icv_len(struct ieee80211_key_conf *hw_key)
static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta,
struct sk_buff *skb)
{
- struct hif_msg *hif_msg;
- struct hif_req_tx *req;
+ struct wfx_hif_msg *hif_msg;
+ struct wfx_hif_req_tx *req;
struct wfx_tx_priv *tx_priv;
struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
struct ieee80211_key_conf *hw_key = tx_info->control.hw_key;
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
int queue_id = skb_get_queue_mapping(skb);
size_t offset = (size_t)skb->data & 3;
- int wmsg_len = sizeof(struct hif_msg) +
- sizeof(struct hif_req_tx) + offset;
+ int wmsg_len = sizeof(struct wfx_hif_msg) +
+ sizeof(struct wfx_hif_req_tx) + offset;

WARN(queue_id >= IEEE80211_NUM_ACS, "unsupported queue_id");
wfx_tx_fixup_rates(tx_info->driver_rates);
@@ -355,7 +355,7 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta,
skb_put(skb, tx_priv->icv_size);
skb_push(skb, wmsg_len);
memset(skb->data, 0, wmsg_len);
- hif_msg = (struct hif_msg *)skb->data;
+ hif_msg = (struct wfx_hif_msg *)skb->data;
hif_msg->len = cpu_to_le16(skb->len);
hif_msg->id = HIF_REQ_ID_TX;
hif_msg->interface = wvif->id;
@@ -368,7 +368,7 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta,
}

/* Fill tx request */
- req = (struct hif_req_tx *)hif_msg->body;
+ req = (struct wfx_hif_req_tx *)hif_msg->body;
/* packet_id just need to be unique on device. 32bits are more than
* necessary for that task, so we tae advantage of it to add some extra
* data for debug.
@@ -435,10 +435,10 @@ void wfx_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control,

static void wfx_skb_dtor(struct wfx_vif *wvif, struct sk_buff *skb)
{
- struct hif_msg *hif = (struct hif_msg *)skb->data;
- struct hif_req_tx *req = (struct hif_req_tx *)hif->body;
- unsigned int offset = sizeof(struct hif_msg) +
- sizeof(struct hif_req_tx) +
+ struct wfx_hif_msg *hif = (struct hif_msg *)skb->data;
+ struct wfx_hif_req_tx *req = (struct hif_req_tx *)hif->body;
+ unsigned int offset = sizeof(struct wfx_hif_msg) +
+ sizeof(struct wfx_hif_req_tx) +
req->fc_offset;

if (!wvif) {
@@ -452,7 +452,7 @@ static void wfx_skb_dtor(struct wfx_vif *wvif, struct sk_buff *skb)

static void wfx_tx_fill_rates(struct wfx_dev *wdev,
struct ieee80211_tx_info *tx_info,
- const struct hif_cnf_tx *arg)
+ const struct wfx_hif_cnf_tx *arg)
{
struct ieee80211_tx_rate *rate;
int tx_count;
@@ -488,7 +488,7 @@ static void wfx_tx_fill_rates(struct wfx_dev *wdev,
dev_dbg(wdev->dev, "%d more retries than expected\n", tx_count);
}

-void wfx_tx_confirm_cb(struct wfx_dev *wdev, const struct hif_cnf_tx *arg)
+void wfx_tx_confirm_cb(struct wfx_dev *wdev, const struct wfx_hif_cnf_tx *arg)
{
const struct wfx_tx_priv *tx_priv;
struct ieee80211_tx_info *tx_info;
@@ -503,7 +503,7 @@ void wfx_tx_confirm_cb(struct wfx_dev *wdev, const struct hif_cnf_tx *arg)
}
tx_info = IEEE80211_SKB_CB(skb);
tx_priv = wfx_skb_tx_priv(skb);
- wvif = wdev_to_wvif(wdev, ((struct hif_msg *)skb->data)->interface);
+ wvif = wdev_to_wvif(wdev, ((struct wfx_hif_msg *)skb->data)->interface);
WARN_ON(!wvif);
if (!wvif)
return;
@@ -572,7 +572,7 @@ void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
struct wfx_dev *wdev = hw->priv;
struct sk_buff_head dropped;
struct wfx_vif *wvif;
- struct hif_msg *hif;
+ struct wfx_hif_msg *hif;
struct sk_buff *skb;

skb_queue_head_init(&dropped);
@@ -588,7 +588,7 @@ void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
if (wdev->chip_frozen)
wfx_pending_drop(wdev, &dropped);
while ((skb = skb_dequeue(&dropped)) != NULL) {
- hif = (struct hif_msg *)skb->data;
+ hif = (struct wfx_hif_msg *)skb->data;
wvif = wdev_to_wvif(wdev, hif->interface);
ieee80211_tx_info_clear_status(IEEE80211_SKB_CB(skb));
wfx_skb_dtor(wvif, skb);
diff --git a/drivers/staging/wfx/data_tx.h b/drivers/staging/wfx/data_tx.h
index 15590a8faefe..c901a03ee4d8 100644
--- a/drivers/staging/wfx/data_tx.h
+++ b/drivers/staging/wfx/data_tx.h
@@ -43,7 +43,7 @@ void wfx_tx_policy_upload_work(struct work_struct *work);

void wfx_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control,
struct sk_buff *skb);
-void wfx_tx_confirm_cb(struct wfx_dev *wdev, const struct hif_cnf_tx *arg);
+void wfx_tx_confirm_cb(struct wfx_dev *wdev, const struct wfx_hif_cnf_tx *arg);
void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
u32 queues, bool drop);

@@ -57,10 +57,10 @@ static inline struct wfx_tx_priv *wfx_skb_tx_priv(struct sk_buff *skb)
return (struct wfx_tx_priv *)tx_info->rate_driver_data;
}

-static inline struct hif_req_tx *wfx_skb_txreq(struct sk_buff *skb)
+static inline struct wfx_hif_req_tx *wfx_skb_txreq(struct sk_buff *skb)
{
- struct hif_msg *hif = (struct hif_msg *)skb->data;
- struct hif_req_tx *req = (struct hif_req_tx *)hif->body;
+ struct wfx_hif_msg *hif = (struct hif_msg *)skb->data;
+ struct wfx_hif_req_tx *req = (struct hif_req_tx *)hif->body;

return req;
}
diff --git a/drivers/staging/wfx/debug.c b/drivers/staging/wfx/debug.c
index 9324248b1d20..f0796eb2afff 100644
--- a/drivers/staging/wfx/debug.c
+++ b/drivers/staging/wfx/debug.c
@@ -63,7 +63,7 @@ static int wfx_counters_show(struct seq_file *seq, void *v)
{
int ret, i;
struct wfx_dev *wdev = seq->private;
- struct hif_mib_extended_count_table counters[3];
+ struct wfx_hif_mib_extended_count_table counters[3];

for (i = 0; i < ARRAY_SIZE(counters); i++) {
ret = wfx_hif_get_counters_table(wdev, i, counters + i);
@@ -153,7 +153,7 @@ static const char * const channel_names[] = {
static int wfx_rx_stats_show(struct seq_file *seq, void *v)
{
struct wfx_dev *wdev = seq->private;
- struct hif_rx_stats *st = &wdev->rx_stats;
+ struct wfx_hif_rx_stats *st = &wdev->rx_stats;
int i;

mutex_lock(&wdev->rx_stats_lock);
@@ -185,7 +185,7 @@ DEFINE_SHOW_ATTRIBUTE(wfx_rx_stats);
static int wfx_tx_power_loop_show(struct seq_file *seq, void *v)
{
struct wfx_dev *wdev = seq->private;
- struct hif_tx_power_loop_info *st = &wdev->tx_power_loop_info;
+ struct wfx_hif_tx_power_loop_info *st = &wdev->tx_power_loop_info;
int tmp;

mutex_lock(&wdev->tx_power_loop_info_lock);
@@ -247,13 +247,13 @@ static ssize_t wfx_send_hif_msg_write(struct file *file,
{
struct dbgfs_hif_msg *context = file->private_data;
struct wfx_dev *wdev = context->wdev;
- struct hif_msg *request;
+ struct wfx_hif_msg *request;

if (completion_done(&context->complete)) {
dev_dbg(wdev->dev, "read previous result before start a new one\n");
return -EBUSY;
}
- if (count < sizeof(struct hif_msg))
+ if (count < sizeof(struct wfx_hif_msg))
return -EINVAL;

/* wfx_cmd_send() checks that reply buffer is wide enough, but does not
diff --git a/drivers/staging/wfx/hif_api_cmd.h b/drivers/staging/wfx/hif_api_cmd.h
index b1829d01a5d9..463532b25939 100644
--- a/drivers/staging/wfx/hif_api_cmd.h
+++ b/drivers/staging/wfx/hif_api_cmd.h
@@ -12,7 +12,7 @@

#include "hif_api_general.h"

-enum hif_requests_ids {
+enum wfx_hif_requests_ids {
HIF_REQ_ID_RESET = 0x0a,
HIF_REQ_ID_READ_MIB = 0x05,
HIF_REQ_ID_WRITE_MIB = 0x06,
@@ -31,7 +31,7 @@ enum hif_requests_ids {
HIF_REQ_ID_MAP_LINK = 0x1c,
};

-enum hif_confirmations_ids {
+enum wfx_hif_confirmations_ids {
HIF_CNF_ID_RESET = 0x0a,
HIF_CNF_ID_READ_MIB = 0x05,
HIF_CNF_ID_WRITE_MIB = 0x06,
@@ -51,7 +51,7 @@ enum hif_confirmations_ids {
HIF_CNF_ID_MAP_LINK = 0x1c,
};

-enum hif_indications_ids {
+enum wfx_hif_indications_ids {
HIF_IND_ID_RX = 0x84,
HIF_IND_ID_SCAN_CMPL = 0x86,
HIF_IND_ID_JOIN_COMPLETE = 0x8f,
@@ -60,40 +60,40 @@ enum hif_indications_ids {
HIF_IND_ID_EVENT = 0x85
};

-struct hif_req_reset {
+struct wfx_hif_req_reset {
u8 reset_stat:1;
u8 reset_all_int:1;
u8 reserved1:6;
u8 reserved2[3];
} __packed;

-struct hif_cnf_reset {
+struct wfx_hif_cnf_reset {
__le32 status;
} __packed;

-struct hif_req_read_mib {
+struct wfx_hif_req_read_mib {
__le16 mib_id;
__le16 reserved;
} __packed;

-struct hif_cnf_read_mib {
+struct wfx_hif_cnf_read_mib {
__le32 status;
__le16 mib_id;
__le16 length;
u8 mib_data[];
} __packed;

-struct hif_req_write_mib {
+struct wfx_hif_req_write_mib {
__le16 mib_id;
__le16 length;
u8 mib_data[];
} __packed;

-struct hif_cnf_write_mib {
+struct wfx_hif_cnf_write_mib {
__le32 status;
} __packed;

-struct hif_req_update_ie {
+struct wfx_hif_req_update_ie {
u8 beacon:1;
u8 probe_resp:1;
u8 probe_req:1;
@@ -103,11 +103,11 @@ struct hif_req_update_ie {
u8 ie[];
} __packed;

-struct hif_cnf_update_ie {
+struct wfx_hif_cnf_update_ie {
__le32 status;
} __packed;

-struct hif_ssid_def {
+struct wfx_hif_ssid_def {
__le32 ssid_length;
u8 ssid[IEEE80211_MAX_SSID_LEN];
} __packed;
@@ -115,7 +115,7 @@ struct hif_ssid_def {
#define HIF_API_MAX_NB_SSIDS 2
#define HIF_API_MAX_NB_CHANNELS 14

-struct hif_req_start_scan_alt {
+struct wfx_hif_req_start_scan_alt {
u8 band;
u8 maintain_current_bss:1;
u8 periodic:1;
@@ -135,45 +135,45 @@ struct hif_req_start_scan_alt {
__le32 min_channel_time;
__le32 max_channel_time;
__le32 tx_power_level; /* signed value */
- struct hif_ssid_def ssid_def[HIF_API_MAX_NB_SSIDS];
+ struct wfx_hif_ssid_def ssid_def[HIF_API_MAX_NB_SSIDS];
u8 channel_list[];
} __packed;

-struct hif_cnf_start_scan {
+struct wfx_hif_cnf_start_scan {
__le32 status;
} __packed;

-struct hif_cnf_stop_scan {
+struct wfx_hif_cnf_stop_scan {
__le32 status;
} __packed;

-enum hif_pm_mode_status {
+enum wfx_hif_pm_mode_status {
HIF_PM_MODE_ACTIVE = 0x0,
HIF_PM_MODE_PS = 0x1,
HIF_PM_MODE_UNDETERMINED = 0x2
};

-struct hif_ind_scan_cmpl {
+struct wfx_hif_ind_scan_cmpl {
__le32 status;
u8 pm_mode;
u8 num_channels_completed;
__le16 reserved;
} __packed;

-enum hif_queue_id {
+enum wfx_hif_queue_id {
HIF_QUEUE_ID_BACKGROUND = 0x0,
HIF_QUEUE_ID_BESTEFFORT = 0x1,
HIF_QUEUE_ID_VIDEO = 0x2,
HIF_QUEUE_ID_VOICE = 0x3
};

-enum hif_frame_format {
+enum wfx_hif_frame_format {
HIF_FRAME_FORMAT_NON_HT = 0x0,
HIF_FRAME_FORMAT_MIXED_FORMAT_HT = 0x1,
HIF_FRAME_FORMAT_GF_HT_11N = 0x2
};

-struct hif_req_tx {
+struct wfx_hif_req_tx {
/* packet_id is not interpreted by the device, so it is not necessary to
* declare it little endian
*/
@@ -203,16 +203,16 @@ struct hif_req_tx {
u8 frame[];
} __packed;

-enum hif_qos_ackplcy {
+enum wfx_hif_qos_ackplcy {
HIF_QOS_ACKPLCY_NORMAL = 0x0,
HIF_QOS_ACKPLCY_TXNOACK = 0x1,
HIF_QOS_ACKPLCY_NOEXPACK = 0x2,
HIF_QOS_ACKPLCY_BLCKACK = 0x3
};

-struct hif_cnf_tx {
+struct wfx_hif_cnf_tx {
__le32 status;
- /* packet_id is copied from struct hif_req_tx without been interpreted
+ /* packet_id is copied from struct wfx_hif_req_tx without been interpreted
* by the device, so it is not necessary to declare it little endian
*/
u32 packet_id;
@@ -228,13 +228,13 @@ struct hif_cnf_tx {
__le32 tx_queue_delay;
} __packed;

-struct hif_cnf_multi_transmit {
+struct wfx_hif_cnf_multi_transmit {
u8 num_tx_confs;
u8 reserved[3];
- struct hif_cnf_tx tx_conf_payload[];
+ struct wfx_hif_cnf_tx tx_conf_payload[];
} __packed;

-enum hif_ri_flags_encrypt {
+enum wfx_hif_ri_flags_encrypt {
HIF_RI_FLAGS_UNENCRYPTED = 0x0,
HIF_RI_FLAGS_WEP_ENCRYPTED = 0x1,
HIF_RI_FLAGS_TKIP_ENCRYPTED = 0x2,
@@ -242,7 +242,7 @@ enum hif_ri_flags_encrypt {
HIF_RI_FLAGS_WAPI_ENCRYPTED = 0x4
};

-struct hif_ind_rx {
+struct wfx_hif_ind_rx {
__le32 status;
u8 channel_number;
u8 reserved1;
@@ -274,7 +274,7 @@ struct hif_ind_rx {
u8 frame[];
} __packed;

-struct hif_req_edca_queue_params {
+struct wfx_hif_req_edca_queue_params {
u8 queue_id;
u8 reserved1;
u8 aifsn;
@@ -286,11 +286,11 @@ struct hif_req_edca_queue_params {
__le32 reserved3;
} __packed;

-struct hif_cnf_edca_queue_params {
+struct wfx_hif_cnf_edca_queue_params {
__le32 status;
} __packed;

-struct hif_req_join {
+struct wfx_hif_req_join {
u8 infrastructure_bss_mode:1;
u8 reserved1:7;
u8 band;
@@ -312,15 +312,15 @@ struct hif_req_join {
__le32 basic_rate_set;
} __packed;

-struct hif_cnf_join {
+struct wfx_hif_cnf_join {
__le32 status;
} __packed;

-struct hif_ind_join_complete {
+struct wfx_hif_ind_join_complete {
__le32 status;
} __packed;

-struct hif_req_set_bss_params {
+struct wfx_hif_req_set_bss_params {
u8 lost_count_only:1;
u8 reserved:7;
u8 beacon_lost_count;
@@ -328,11 +328,11 @@ struct hif_req_set_bss_params {
__le32 operational_rate_set;
} __packed;

-struct hif_cnf_set_bss_params {
+struct wfx_hif_cnf_set_bss_params {
__le32 status;
} __packed;

-struct hif_req_set_pm_mode {
+struct wfx_hif_req_set_pm_mode {
u8 enter_psm:1;
u8 reserved:6;
u8 fast_psm:1;
@@ -341,17 +341,17 @@ struct hif_req_set_pm_mode {
u8 min_auto_ps_poll_period;
} __packed;

-struct hif_cnf_set_pm_mode {
+struct wfx_hif_cnf_set_pm_mode {
__le32 status;
} __packed;

-struct hif_ind_set_pm_mode_cmpl {
+struct wfx_hif_ind_set_pm_mode_cmpl {
__le32 status;
u8 pm_mode;
u8 reserved[3];
} __packed;

-struct hif_req_start {
+struct wfx_hif_req_start {
u8 mode;
u8 band;
u8 channel_number;
@@ -367,23 +367,23 @@ struct hif_req_start {
__le32 basic_rate_set;
} __packed;

-struct hif_cnf_start {
+struct wfx_hif_cnf_start {
__le32 status;
} __packed;

-struct hif_req_beacon_transmit {
+struct wfx_hif_req_beacon_transmit {
u8 enable_beaconing;
u8 reserved[3];
} __packed;

-struct hif_cnf_beacon_transmit {
+struct wfx_hif_cnf_beacon_transmit {
__le32 status;
} __packed;

#define HIF_LINK_ID_MAX 14
#define HIF_LINK_ID_NOT_ASSOCIATED (HIF_LINK_ID_MAX + 1)

-struct hif_req_map_link {
+struct wfx_hif_req_map_link {
u8 mac_addr[ETH_ALEN];
u8 unmap:1;
u8 mfpc:1;
@@ -391,11 +391,11 @@ struct hif_req_map_link {
u8 peer_sta_id;
} __packed;

-struct hif_cnf_map_link {
+struct wfx_hif_cnf_map_link {
__le32 status;
} __packed;

-struct hif_ind_suspend_resume_tx {
+struct wfx_hif_ind_suspend_resume_tx {
u8 resume:1;
u8 reserved1:2;
u8 bc_mc_only:1;
@@ -417,7 +417,7 @@ struct hif_ind_suspend_resume_tx {
#define HIF_API_RX_SEQUENCE_COUNTER_SIZE 8
#define HIF_API_IPN_SIZE 8

-enum hif_key_type {
+enum wfx_hif_key_type {
HIF_KEY_TYPE_WEP_DEFAULT = 0x0,
HIF_KEY_TYPE_WEP_PAIRWISE = 0x1,
HIF_KEY_TYPE_TKIP_GROUP = 0x2,
@@ -430,21 +430,21 @@ enum hif_key_type {
HIF_KEY_TYPE_NONE = 0x9
};

-struct hif_wep_pairwise_key {
+struct wfx_hif_wep_pairwise_key {
u8 peer_address[ETH_ALEN];
u8 reserved;
u8 key_length;
u8 key_data[HIF_API_WEP_KEY_DATA_SIZE];
} __packed;

-struct hif_wep_group_key {
+struct wfx_hif_wep_group_key {
u8 key_id;
u8 key_length;
u8 reserved[2];
u8 key_data[HIF_API_WEP_KEY_DATA_SIZE];
} __packed;

-struct hif_tkip_pairwise_key {
+struct wfx_hif_tkip_pairwise_key {
u8 peer_address[ETH_ALEN];
u8 reserved[2];
u8 tkip_key_data[HIF_API_TKIP_KEY_DATA_SIZE];
@@ -452,7 +452,7 @@ struct hif_tkip_pairwise_key {
u8 tx_mic_key[HIF_API_TX_MIC_KEY_SIZE];
} __packed;

-struct hif_tkip_group_key {
+struct wfx_hif_tkip_group_key {
u8 tkip_key_data[HIF_API_TKIP_KEY_DATA_SIZE];
u8 rx_mic_key[HIF_API_RX_MIC_KEY_SIZE];
u8 key_id;
@@ -460,20 +460,20 @@ struct hif_tkip_group_key {
u8 rx_sequence_counter[HIF_API_RX_SEQUENCE_COUNTER_SIZE];
} __packed;

-struct hif_aes_pairwise_key {
+struct wfx_hif_aes_pairwise_key {
u8 peer_address[ETH_ALEN];
u8 reserved[2];
u8 aes_key_data[HIF_API_AES_KEY_DATA_SIZE];
} __packed;

-struct hif_aes_group_key {
+struct wfx_hif_aes_group_key {
u8 aes_key_data[HIF_API_AES_KEY_DATA_SIZE];
u8 key_id;
u8 reserved[3];
u8 rx_sequence_counter[HIF_API_RX_SEQUENCE_COUNTER_SIZE];
} __packed;

-struct hif_wapi_pairwise_key {
+struct wfx_hif_wapi_pairwise_key {
u8 peer_address[ETH_ALEN];
u8 key_id;
u8 reserved;
@@ -481,53 +481,53 @@ struct hif_wapi_pairwise_key {
u8 mic_key_data[HIF_API_MIC_KEY_DATA_SIZE];
} __packed;

-struct hif_wapi_group_key {
+struct wfx_hif_wapi_group_key {
u8 wapi_key_data[HIF_API_WAPI_KEY_DATA_SIZE];
u8 mic_key_data[HIF_API_MIC_KEY_DATA_SIZE];
u8 key_id;
u8 reserved[3];
} __packed;

-struct hif_igtk_group_key {
+struct wfx_hif_igtk_group_key {
u8 igtk_key_data[HIF_API_IGTK_KEY_DATA_SIZE];
u8 key_id;
u8 reserved[3];
u8 ipn[HIF_API_IPN_SIZE];
} __packed;

-struct hif_req_add_key {
+struct wfx_hif_req_add_key {
u8 type;
u8 entry_index;
u8 int_id:2;
u8 reserved1:6;
u8 reserved2;
union {
- struct hif_wep_pairwise_key wep_pairwise_key;
- struct hif_wep_group_key wep_group_key;
- struct hif_tkip_pairwise_key tkip_pairwise_key;
- struct hif_tkip_group_key tkip_group_key;
- struct hif_aes_pairwise_key aes_pairwise_key;
- struct hif_aes_group_key aes_group_key;
- struct hif_wapi_pairwise_key wapi_pairwise_key;
- struct hif_wapi_group_key wapi_group_key;
- struct hif_igtk_group_key igtk_group_key;
+ struct wfx_hif_wep_pairwise_key wep_pairwise_key;
+ struct wfx_hif_wep_group_key wep_group_key;
+ struct wfx_hif_tkip_pairwise_key tkip_pairwise_key;
+ struct wfx_hif_tkip_group_key tkip_group_key;
+ struct wfx_hif_aes_pairwise_key aes_pairwise_key;
+ struct wfx_hif_aes_group_key aes_group_key;
+ struct wfx_hif_wapi_pairwise_key wapi_pairwise_key;
+ struct wfx_hif_wapi_group_key wapi_group_key;
+ struct wfx_hif_igtk_group_key igtk_group_key;
} key;
} __packed;

-struct hif_cnf_add_key {
+struct wfx_hif_cnf_add_key {
__le32 status;
} __packed;

-struct hif_req_remove_key {
+struct wfx_hif_req_remove_key {
u8 entry_index;
u8 reserved[3];
} __packed;

-struct hif_cnf_remove_key {
+struct wfx_hif_cnf_remove_key {
__le32 status;
} __packed;

-enum hif_event_ind {
+enum wfx_hif_event_ind {
HIF_EVENT_IND_BSSLOST = 0x1,
HIF_EVENT_IND_BSSREGAINED = 0x2,
HIF_EVENT_IND_RCPI_RSSI = 0x3,
@@ -535,7 +535,7 @@ enum hif_event_ind {
HIF_EVENT_IND_INACTIVITY = 0x5
};

-enum hif_ps_mode_error {
+enum wfx_hif_ps_mode_error {
HIF_PS_ERROR_NO_ERROR = 0,
HIF_PS_ERROR_AP_NOT_RESP_TO_POLL = 1,
HIF_PS_ERROR_AP_NOT_RESP_TO_UAPSD_TRIGGER = 2,
@@ -543,7 +543,7 @@ enum hif_ps_mode_error {
HIF_PS_ERROR_AP_NO_DATA_AFTER_TIM = 4
};

-struct hif_ind_event {
+struct wfx_hif_ind_event {
__le32 event_id;
union {
u8 rcpi_rssi;
diff --git a/drivers/staging/wfx/hif_api_general.h b/drivers/staging/wfx/hif_api_general.h
index a57789ceb209..4d400fdc2252 100644
--- a/drivers/staging/wfx/hif_api_general.h
+++ b/drivers/staging/wfx/hif_api_general.h
@@ -14,7 +14,7 @@
#define HIF_ID_IS_INDICATION 0x80
#define HIF_COUNTER_MAX 7

-struct hif_msg {
+struct wfx_hif_msg {
__le16 len;
u8 id;
u8 reserved:1;
@@ -24,7 +24,7 @@ struct hif_msg {
u8 body[];
} __packed;

-enum hif_general_requests_ids {
+enum wfx_hif_general_requests_ids {
HIF_REQ_ID_CONFIGURATION = 0x09,
HIF_REQ_ID_CONTROL_GPIO = 0x26,
HIF_REQ_ID_SET_SL_MAC_KEY = 0x27,
@@ -37,7 +37,7 @@ enum hif_general_requests_ids {
HIF_REQ_ID_SHUT_DOWN = 0x32,
};

-enum hif_general_confirmations_ids {
+enum wfx_hif_general_confirmations_ids {
HIF_CNF_ID_CONFIGURATION = 0x09,
HIF_CNF_ID_CONTROL_GPIO = 0x26,
HIF_CNF_ID_SET_SL_MAC_KEY = 0x27,
@@ -50,7 +50,7 @@ enum hif_general_confirmations_ids {
HIF_CNF_ID_SHUT_DOWN = 0x32,
};

-enum hif_general_indications_ids {
+enum wfx_hif_general_indications_ids {
HIF_IND_ID_EXCEPTION = 0xe0,
HIF_IND_ID_STARTUP = 0xe1,
HIF_IND_ID_WAKEUP = 0xe2,
@@ -81,7 +81,7 @@ enum hif_general_indications_ids {
#define HIF_STATUS_ROLLBACK_SUCCESS (cpu_to_le32(0x1234))
#define HIF_STATUS_ROLLBACK_FAIL (cpu_to_le32(0x1256))

-enum hif_api_rate_index {
+enum wfx_hif_api_rate_index {
API_RATE_INDEX_B_1MBPS = 0,
API_RATE_INDEX_B_2MBPS = 1,
API_RATE_INDEX_B_5P5MBPS = 2,
@@ -107,7 +107,7 @@ enum hif_api_rate_index {
API_RATE_NUM_ENTRIES = 22
};

-struct hif_ind_startup {
+struct wfx_hif_ind_startup {
__le32 status;
__le16 hardware_id;
u8 opn[14];
@@ -138,19 +138,19 @@ struct hif_ind_startup {
u8 firmware_label[128];
} __packed;

-struct hif_ind_wakeup {
+struct wfx_hif_ind_wakeup {
} __packed;

-struct hif_req_configuration {
+struct wfx_hif_req_configuration {
__le16 length;
u8 pds_data[];
} __packed;

-struct hif_cnf_configuration {
+struct wfx_hif_cnf_configuration {
__le32 status;
} __packed;

-enum hif_gpio_mode {
+enum wfx_hif_gpio_mode {
HIF_GPIO_MODE_D0 = 0x0,
HIF_GPIO_MODE_D1 = 0x1,
HIF_GPIO_MODE_OD0 = 0x2,
@@ -160,24 +160,24 @@ enum hif_gpio_mode {
HIF_GPIO_MODE_READ = 0x6
};

-struct hif_req_control_gpio {
+struct wfx_hif_req_control_gpio {
u8 gpio_label;
u8 gpio_mode;
} __packed;

-struct hif_cnf_control_gpio {
+struct wfx_hif_cnf_control_gpio {
__le32 status;
__le32 value;
} __packed;

-enum hif_generic_indication_type {
+enum wfx_hif_generic_indication_type {
HIF_GENERIC_INDICATION_TYPE_RAW = 0x0,
HIF_GENERIC_INDICATION_TYPE_STRING = 0x1,
HIF_GENERIC_INDICATION_TYPE_RX_STATS = 0x2,
HIF_GENERIC_INDICATION_TYPE_TX_POWER_LOOP_INFO = 0x3,
};

-struct hif_rx_stats {
+struct wfx_hif_rx_stats {
__le32 nb_rx_frame;
__le32 nb_crc_frame;
__le32 per_total;
@@ -193,7 +193,7 @@ struct hif_rx_stats {
s8 current_temp;
} __packed;

-struct hif_tx_power_loop_info {
+struct wfx_hif_tx_power_loop_info {
__le16 tx_gain_dig;
__le16 tx_gain_pa;
__le16 target_pout; /* signed value */
@@ -203,15 +203,15 @@ struct hif_tx_power_loop_info {
u8 reserved;
} __packed;

-struct hif_ind_generic {
+struct wfx_hif_ind_generic {
__le32 type;
union {
- struct hif_rx_stats rx_stats;
- struct hif_tx_power_loop_info tx_power_loop_info;
+ struct wfx_hif_rx_stats rx_stats;
+ struct wfx_hif_tx_power_loop_info tx_power_loop_info;
} data;
} __packed;

-enum hif_error {
+enum wfx_hif_error {
HIF_ERROR_FIRMWARE_ROLLBACK = 0x00,
HIF_ERROR_FIRMWARE_DEBUG_ENABLED = 0x01,
HIF_ERROR_SLK_OUTDATED_SESSION_KEY = 0x02,
@@ -232,17 +232,17 @@ enum hif_error {
HIF_ERROR_SLK_UNCONFIGURED = 0x11,
};

-struct hif_ind_error {
+struct wfx_hif_ind_error {
__le32 type;
u8 data[];
} __packed;

-struct hif_ind_exception {
+struct wfx_hif_ind_exception {
__le32 type;
u8 data[];
} __packed;

-enum hif_secure_link_state {
+enum wfx_hif_secure_link_state {
SEC_LINK_UNAVAILABLE = 0x0,
SEC_LINK_RESERVED = 0x1,
SEC_LINK_EVAL = 0x2,
diff --git a/drivers/staging/wfx/hif_api_mib.h b/drivers/staging/wfx/hif_api_mib.h
index be76e2766880..7b68b83866c9 100644
--- a/drivers/staging/wfx/hif_api_mib.h
+++ b/drivers/staging/wfx/hif_api_mib.h
@@ -13,7 +13,7 @@
#define HIF_API_IPV4_ADDRESS_SIZE 4
#define HIF_API_IPV6_ADDRESS_SIZE 16

-enum hif_mib_ids {
+enum wfx_hif_mib_ids {
HIF_MIB_ID_GL_OPERATIONAL_POWER_MODE = 0x2000,
HIF_MIB_ID_GL_BLOCK_ACK_INFO = 0x2001,
HIF_MIB_ID_GL_SET_MULTI_MSG = 0x2002,
@@ -63,39 +63,39 @@ enum hif_mib_ids {
HIF_MIB_ID_BEACON_STATS = 0x2056,
};

-enum hif_op_power_mode {
+enum wfx_hif_op_power_mode {
HIF_OP_POWER_MODE_ACTIVE = 0x0,
HIF_OP_POWER_MODE_DOZE = 0x1,
HIF_OP_POWER_MODE_QUIESCENT = 0x2
};

-struct hif_mib_gl_operational_power_mode {
+struct wfx_hif_mib_gl_operational_power_mode {
u8 power_mode:4;
u8 reserved1:3;
u8 wup_ind_activation:1;
u8 reserved2[3];
} __packed;

-struct hif_mib_gl_set_multi_msg {
+struct wfx_hif_mib_gl_set_multi_msg {
u8 enable_multi_tx_conf:1;
u8 reserved1:7;
u8 reserved2[3];
} __packed;

-enum hif_arp_ns_frame_treatment {
+enum wfx_hif_arp_ns_frame_treatment {
HIF_ARP_NS_FILTERING_DISABLE = 0x0,
HIF_ARP_NS_FILTERING_ENABLE = 0x1,
HIF_ARP_NS_REPLY_ENABLE = 0x2
};

-struct hif_mib_arp_ip_addr_table {
+struct wfx_hif_mib_arp_ip_addr_table {
u8 condition_idx;
u8 arp_enable;
u8 reserved[2];
u8 ipv4_address[HIF_API_IPV4_ADDRESS_SIZE];
} __packed;

-struct hif_mib_rx_filter {
+struct wfx_hif_mib_rx_filter {
u8 reserved1:1;
u8 bssid_filter:1;
u8 reserved2:1;
@@ -105,7 +105,7 @@ struct hif_mib_rx_filter {
u8 reserved4[3];
} __packed;

-struct hif_ie_table_entry {
+struct wfx_hif_ie_table_entry {
u8 ie_id;
u8 has_changed:1;
u8 no_longer:1;
@@ -116,23 +116,23 @@ struct hif_ie_table_entry {
u8 match_data[3];
} __packed;

-struct hif_mib_bcn_filter_table {
+struct wfx_hif_mib_bcn_filter_table {
__le32 num_of_info_elmts;
- struct hif_ie_table_entry ie_table[];
+ struct wfx_hif_ie_table_entry ie_table[];
} __packed;

-enum hif_beacon_filter {
+enum wfx_hif_beacon_filter {
HIF_BEACON_FILTER_DISABLE = 0x0,
HIF_BEACON_FILTER_ENABLE = 0x1,
HIF_BEACON_FILTER_AUTO_ERP = 0x2
};

-struct hif_mib_bcn_filter_enable {
+struct wfx_hif_mib_bcn_filter_enable {
__le32 enable;
__le32 bcn_count;
} __packed;

-struct hif_mib_extended_count_table {
+struct wfx_hif_mib_extended_count_table {
__le32 count_drop_plcp;
__le32 count_drop_fcs;
__le32 count_tx_frames;
@@ -164,7 +164,7 @@ struct hif_mib_extended_count_table {
__le32 reserved[12];
} __packed;

-struct hif_mib_count_table {
+struct wfx_hif_mib_count_table {
__le32 count_drop_plcp;
__le32 count_drop_fcs;
__le32 count_tx_frames;
@@ -190,35 +190,35 @@ struct hif_mib_count_table {
__le32 count_drop_bip_mic;
} __packed;

-struct hif_mib_mac_address {
+struct wfx_hif_mib_mac_address {
u8 mac_addr[ETH_ALEN];
__le16 reserved;
} __packed;

-struct hif_mib_wep_default_key_id {
+struct wfx_hif_mib_wep_default_key_id {
u8 wep_default_key_id;
u8 reserved[3];
} __packed;

-struct hif_mib_dot11_rts_threshold {
+struct wfx_hif_mib_dot11_rts_threshold {
__le32 threshold;
} __packed;

-struct hif_mib_slot_time {
+struct wfx_hif_mib_slot_time {
__le32 slot_time;
} __packed;

-struct hif_mib_current_tx_power_level {
+struct wfx_hif_mib_current_tx_power_level {
__le32 power_level; /* signed value */
} __packed;

-struct hif_mib_non_erp_protection {
+struct wfx_hif_mib_non_erp_protection {
u8 use_cts_to_self:1;
u8 reserved1:7;
u8 reserved2[3];
} __packed;

-enum hif_tmplt {
+enum wfx_hif_tmplt {
HIF_TMPLT_PRBREQ = 0x0,
HIF_TMPLT_BCN = 0x1,
HIF_TMPLT_NULL = 0x2,
@@ -231,7 +231,7 @@ enum hif_tmplt {

#define HIF_API_MAX_TEMPLATE_FRAME_SIZE 700

-struct hif_mib_template_frame {
+struct wfx_hif_mib_template_frame {
u8 frame_type;
u8 init_rate:7;
u8 mode:1;
@@ -239,7 +239,7 @@ struct hif_mib_template_frame {
u8 frame[];
} __packed;

-struct hif_mib_beacon_wake_up_period {
+struct wfx_hif_mib_beacon_wake_up_period {
u8 wakeup_period_min;
u8 receive_dtim:1;
u8 reserved1:7;
@@ -247,7 +247,7 @@ struct hif_mib_beacon_wake_up_period {
u8 reserved2;
} __packed;

-struct hif_mib_rcpi_rssi_threshold {
+struct wfx_hif_mib_rcpi_rssi_threshold {
u8 detection:1;
u8 rcpi_rssi:1;
u8 upperthresh:1;
@@ -260,14 +260,14 @@ struct hif_mib_rcpi_rssi_threshold {

#define DEFAULT_BA_MAX_RX_BUFFER_SIZE 16

-struct hif_mib_block_ack_policy {
+struct wfx_hif_mib_block_ack_policy {
u8 block_ack_tx_tid_policy;
u8 reserved1;
u8 block_ack_rx_tid_policy;
u8 block_ack_rx_max_buffer_size;
} __packed;

-enum hif_mpdu_start_spacing {
+enum wfx_hif_mpdu_start_spacing {
HIF_MPDU_START_SPACING_NO_RESTRIC = 0x0,
HIF_MPDU_START_SPACING_QUARTER = 0x1,
HIF_MPDU_START_SPACING_HALF = 0x2,
@@ -278,7 +278,7 @@ enum hif_mpdu_start_spacing {
HIF_MPDU_START_SPACING_SIXTEEN = 0x7
};

-struct hif_mib_set_association_mode {
+struct wfx_hif_mib_set_association_mode {
u8 preambtype_use:1;
u8 mode:1;
u8 rateset:1;
@@ -292,7 +292,7 @@ struct hif_mib_set_association_mode {
__le32 basic_rate_set;
} __packed;

-struct hif_mib_set_uapsd_information {
+struct wfx_hif_mib_set_uapsd_information {
u8 trig_bckgrnd:1;
u8 trig_be:1;
u8 trig_video:1;
@@ -308,7 +308,7 @@ struct hif_mib_set_uapsd_information {
__le16 auto_trigger_step;
} __packed;

-struct hif_tx_rate_retry_policy {
+struct wfx_hif_tx_rate_retry_policy {
u8 policy_index;
u8 short_retry_count;
u8 long_retry_count;
@@ -324,13 +324,13 @@ struct hif_tx_rate_retry_policy {
#define HIF_TX_RETRY_POLICY_MAX 15
#define HIF_TX_RETRY_POLICY_INVALID HIF_TX_RETRY_POLICY_MAX

-struct hif_mib_set_tx_rate_retry_policy {
+struct wfx_hif_mib_set_tx_rate_retry_policy {
u8 num_tx_rate_policies;
u8 reserved[3];
- struct hif_tx_rate_retry_policy tx_rate_retry_policy[];
+ struct wfx_hif_tx_rate_retry_policy tx_rate_retry_policy[];
} __packed;

-struct hif_mib_protected_mgmt_policy {
+struct wfx_hif_mib_protected_mgmt_policy {
u8 pmf_enable:1;
u8 unpmf_allowed:1;
u8 host_enc_auth_frames:1;
@@ -338,7 +338,7 @@ struct hif_mib_protected_mgmt_policy {
u8 reserved2[3];
} __packed;

-struct hif_mib_keep_alive_period {
+struct wfx_hif_mib_keep_alive_period {
__le16 keep_alive_period;
u8 reserved[2];
} __packed;
diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/staging/wfx/hif_rx.c
index 7a2a32e3ceb9..f2564a20bdcf 100644
--- a/drivers/staging/wfx/hif_rx.c
+++ b/drivers/staging/wfx/hif_rx.c
@@ -17,7 +17,7 @@
#include "hif_api_cmd.h"

static int wfx_hif_generic_confirm(struct wfx_dev *wdev,
- const struct hif_msg *hif, const void *buf)
+ const struct wfx_hif_msg *hif, const void *buf)
{
/* All confirm messages start with status */
int status = le32_to_cpup((__le32 *)buf);
@@ -51,18 +51,18 @@ static int wfx_hif_generic_confirm(struct wfx_dev *wdev,
}

static int wfx_hif_tx_confirm(struct wfx_dev *wdev,
- const struct hif_msg *hif, const void *buf)
+ const struct wfx_hif_msg *hif, const void *buf)
{
- const struct hif_cnf_tx *body = buf;
+ const struct wfx_hif_cnf_tx *body = buf;

wfx_tx_confirm_cb(wdev, body);
return 0;
}

static int wfx_hif_multi_tx_confirm(struct wfx_dev *wdev,
- const struct hif_msg *hif, const void *buf)
+ const struct wfx_hif_msg *hif, const void *buf)
{
- const struct hif_cnf_multi_transmit *body = buf;
+ const struct wfx_hif_cnf_multi_transmit *body = buf;
int i;

WARN(body->num_tx_confs <= 0, "corrupted message");
@@ -72,22 +72,23 @@ static int wfx_hif_multi_tx_confirm(struct wfx_dev *wdev,
}

static int wfx_hif_startup_indication(struct wfx_dev *wdev,
- const struct hif_msg *hif,
+ const struct wfx_hif_msg *hif,
const void *buf)
{
- const struct hif_ind_startup *body = buf;
+ const struct wfx_hif_ind_startup *body = buf;

if (body->status || body->firmware_type > 4) {
dev_err(wdev->dev, "received invalid startup indication");
return -EINVAL;
}
- memcpy(&wdev->hw_caps, body, sizeof(struct hif_ind_startup));
+ memcpy(&wdev->hw_caps, body, sizeof(struct wfx_hif_ind_startup));
complete(&wdev->firmware_ready);
return 0;
}

static int wfx_hif_wakeup_indication(struct wfx_dev *wdev,
- const struct hif_msg *hif, const void *buf)
+ const struct wfx_hif_msg *hif,
+ const void *buf)
{
if (!wdev->pdata.gpio_wakeup ||
gpiod_get_value(wdev->pdata.gpio_wakeup) == 0) {
@@ -98,28 +99,28 @@ static int wfx_hif_wakeup_indication(struct wfx_dev *wdev,
}

static int wfx_hif_receive_indication(struct wfx_dev *wdev,
- const struct hif_msg *hif,
+ const struct wfx_hif_msg *hif,
const void *buf, struct sk_buff *skb)
{
struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface);
- const struct hif_ind_rx *body = buf;
+ const struct wfx_hif_ind_rx *body = buf;

if (!wvif) {
dev_warn(wdev->dev, "%s: ignore rx data for non-existent vif %d\n",
__func__, hif->interface);
return -EIO;
}
- skb_pull(skb, sizeof(struct hif_msg) + sizeof(struct hif_ind_rx));
+ skb_pull(skb, sizeof(struct wfx_hif_msg) + sizeof(struct hif_ind_rx));
wfx_rx_cb(wvif, body, skb);

return 0;
}

static int wfx_hif_event_indication(struct wfx_dev *wdev,
- const struct hif_msg *hif, const void *buf)
+ const struct wfx_hif_msg *hif, const void *buf)
{
struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface);
- const struct hif_ind_event *body = buf;
+ const struct wfx_hif_ind_event *body = buf;
int type = le32_to_cpu(body->event_id);

if (!wvif) {
@@ -151,7 +152,7 @@ static int wfx_hif_event_indication(struct wfx_dev *wdev,
}

static int wfx_hif_pm_mode_complete_indication(struct wfx_dev *wdev,
- const struct hif_msg *hif,
+ const struct wfx_hif_msg *hif,
const void *buf)
{
struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface);
@@ -166,11 +167,11 @@ static int wfx_hif_pm_mode_complete_indication(struct wfx_dev *wdev,
}

static int wfx_hif_scan_complete_indication(struct wfx_dev *wdev,
- const struct hif_msg *hif,
+ const struct wfx_hif_msg *hif,
const void *buf)
{
struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface);
- const struct hif_ind_scan_cmpl *body = buf;
+ const struct wfx_hif_ind_scan_cmpl *body = buf;

if (!wvif) {
dev_warn(wdev->dev, "%s: received event for non-existent vif\n", __func__);
@@ -183,7 +184,7 @@ static int wfx_hif_scan_complete_indication(struct wfx_dev *wdev,
}

static int wfx_hif_join_complete_indication(struct wfx_dev *wdev,
- const struct hif_msg *hif,
+ const struct wfx_hif_msg *hif,
const void *buf)
{
struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface);
@@ -198,10 +199,10 @@ static int wfx_hif_join_complete_indication(struct wfx_dev *wdev,
}

static int wfx_hif_suspend_resume_indication(struct wfx_dev *wdev,
- const struct hif_msg *hif,
+ const struct wfx_hif_msg *hif,
const void *buf)
{
- const struct hif_ind_suspend_resume_tx *body = buf;
+ const struct wfx_hif_ind_suspend_resume_tx *body = buf;
struct wfx_vif *wvif;

if (body->bc_mc_only) {
@@ -227,10 +228,10 @@ static int wfx_hif_suspend_resume_indication(struct wfx_dev *wdev,
}

static int wfx_hif_generic_indication(struct wfx_dev *wdev,
- const struct hif_msg *hif,
+ const struct wfx_hif_msg *hif,
const void *buf)
{
- const struct hif_ind_generic *body = buf;
+ const struct wfx_hif_ind_generic *body = buf;
int type = le32_to_cpu(body->type);

switch (type) {
@@ -308,9 +309,9 @@ static const struct {
};

static int wfx_hif_error_indication(struct wfx_dev *wdev,
- const struct hif_msg *hif, const void *buf)
+ const struct wfx_hif_msg *hif, const void *buf)
{
- const struct hif_ind_error *body = buf;
+ const struct wfx_hif_ind_error *body = buf;
int type = le32_to_cpu(body->type);
int param = (s8)body->data[0];
int i;
@@ -335,10 +336,10 @@ static int wfx_hif_error_indication(struct wfx_dev *wdev,
};

static int wfx_hif_exception_indication(struct wfx_dev *wdev,
- const struct hif_msg *hif,
+ const struct wfx_hif_msg *hif,
const void *buf)
{
- const struct hif_ind_exception *body = buf;
+ const struct wfx_hif_ind_exception *body = buf;
int type = le32_to_cpu(body->type);

if (type == 4)
@@ -356,7 +357,7 @@ static int wfx_hif_exception_indication(struct wfx_dev *wdev,
static const struct {
int msg_id;
int (*handler)(struct wfx_dev *wdev,
- const struct hif_msg *hif, const void *buf);
+ const struct wfx_hif_msg *hif, const void *buf);
} hif_handlers[] = {
/* Confirmations */
{ HIF_CNF_ID_TX, wfx_hif_tx_confirm },
@@ -379,7 +380,7 @@ static const struct {
void wfx_handle_rx(struct wfx_dev *wdev, struct sk_buff *skb)
{
int i;
- const struct hif_msg *hif = (const struct hif_msg *)skb->data;
+ const struct wfx_hif_msg *hif = (const struct hif_msg *)skb->data;
int hif_id = hif->id;

if (hif_id == HIF_IND_ID_RX) {
diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c
index 67f1847c1fc1..429c70b991e1 100644
--- a/drivers/staging/wfx/hif_tx.c
+++ b/drivers/staging/wfx/hif_tx.c
@@ -22,7 +22,7 @@ void wfx_init_hif_cmd(struct wfx_hif_cmd *hif_cmd)
mutex_init(&hif_cmd->lock);
}

-static void wfx_fill_header(struct hif_msg *hif, int if_id,
+static void wfx_fill_header(struct wfx_hif_msg *hif, int if_id,
unsigned int cmd, size_t size)
{
if (if_id == -1)
@@ -37,16 +37,16 @@ static void wfx_fill_header(struct hif_msg *hif, int if_id,
hif->interface = if_id;
}

-static void *wfx_alloc_hif(size_t body_len, struct hif_msg **hif)
+static void *wfx_alloc_hif(size_t body_len, struct wfx_hif_msg **hif)
{
- *hif = kzalloc(sizeof(struct hif_msg) + body_len, GFP_KERNEL);
+ *hif = kzalloc(sizeof(struct wfx_hif_msg) + body_len, GFP_KERNEL);
if (*hif)
return (*hif)->body;
else
return NULL;
}

-int wfx_cmd_send(struct wfx_dev *wdev, struct hif_msg *request,
+int wfx_cmd_send(struct wfx_dev *wdev, struct wfx_hif_msg *request,
void *reply, size_t reply_len, bool no_reply)
{
const char *mib_name = "";
@@ -125,7 +125,7 @@ int wfx_cmd_send(struct wfx_dev *wdev, struct hif_msg *request,
int wfx_hif_shutdown(struct wfx_dev *wdev)
{
int ret;
- struct hif_msg *hif;
+ struct wfx_hif_msg *hif;

wfx_alloc_hif(0, &hif);
if (!hif)
@@ -143,9 +143,9 @@ int wfx_hif_shutdown(struct wfx_dev *wdev)
int wfx_hif_configuration(struct wfx_dev *wdev, const u8 *conf, size_t len)
{
int ret;
- size_t buf_len = sizeof(struct hif_req_configuration) + len;
- struct hif_msg *hif;
- struct hif_req_configuration *body = wfx_alloc_hif(buf_len, &hif);
+ size_t buf_len = sizeof(struct wfx_hif_req_configuration) + len;
+ struct wfx_hif_msg *hif;
+ struct wfx_hif_req_configuration *body = wfx_alloc_hif(buf_len, &hif);

if (!hif)
return -ENOMEM;
@@ -160,8 +160,8 @@ int wfx_hif_configuration(struct wfx_dev *wdev, const u8 *conf, size_t len)
int wfx_hif_reset(struct wfx_vif *wvif, bool reset_stat)
{
int ret;
- struct hif_msg *hif;
- struct hif_req_reset *body = wfx_alloc_hif(sizeof(*body), &hif);
+ struct wfx_hif_msg *hif;
+ struct wfx_hif_req_reset *body = wfx_alloc_hif(sizeof(*body), &hif);

if (!hif)
return -ENOMEM;
@@ -176,10 +176,10 @@ int wfx_hif_read_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id,
void *val, size_t val_len)
{
int ret;
- struct hif_msg *hif;
- int buf_len = sizeof(struct hif_cnf_read_mib) + val_len;
- struct hif_req_read_mib *body = wfx_alloc_hif(sizeof(*body), &hif);
- struct hif_cnf_read_mib *reply = kmalloc(buf_len, GFP_KERNEL);
+ struct wfx_hif_msg *hif;
+ int buf_len = sizeof(struct wfx_hif_cnf_read_mib) + val_len;
+ struct wfx_hif_req_read_mib *body = wfx_alloc_hif(sizeof(*body), &hif);
+ struct wfx_hif_cnf_read_mib *reply = kmalloc(buf_len, GFP_KERNEL);

if (!body || !reply) {
ret = -ENOMEM;
@@ -212,9 +212,9 @@ int wfx_hif_write_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id,
void *val, size_t val_len)
{
int ret;
- struct hif_msg *hif;
- int buf_len = sizeof(struct hif_req_write_mib) + val_len;
- struct hif_req_write_mib *body = wfx_alloc_hif(buf_len, &hif);
+ struct wfx_hif_msg *hif;
+ int buf_len = sizeof(struct wfx_hif_req_write_mib) + val_len;
+ struct wfx_hif_req_write_mib *body = wfx_alloc_hif(buf_len, &hif);

if (!hif)
return -ENOMEM;
@@ -231,10 +231,10 @@ int wfx_hif_scan(struct wfx_vif *wvif, struct cfg80211_scan_request *req,
int chan_start_idx, int chan_num)
{
int ret, i;
- struct hif_msg *hif;
- size_t buf_len =
- sizeof(struct hif_req_start_scan_alt) + chan_num * sizeof(u8);
- struct hif_req_start_scan_alt *body = wfx_alloc_hif(buf_len, &hif);
+ struct wfx_hif_msg *hif;
+ size_t buf_len = sizeof(struct wfx_hif_req_start_scan_alt) +
+ chan_num * sizeof(u8);
+ struct wfx_hif_req_start_scan_alt *body = wfx_alloc_hif(buf_len, &hif);

WARN(chan_num > HIF_API_MAX_NB_CHANNELS, "invalid params");
WARN(req->n_ssids > HIF_API_MAX_NB_SSIDS, "invalid params");
@@ -279,7 +279,7 @@ int wfx_hif_scan(struct wfx_vif *wvif, struct cfg80211_scan_request *req,
int wfx_hif_stop_scan(struct wfx_vif *wvif)
{
int ret;
- struct hif_msg *hif;
+ struct wfx_hif_msg *hif;
/* body associated to HIF_REQ_ID_STOP_SCAN is empty */
wfx_alloc_hif(0, &hif);

@@ -295,8 +295,8 @@ int wfx_hif_join(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf,
struct ieee80211_channel *channel, const u8 *ssid, int ssidlen)
{
int ret;
- struct hif_msg *hif;
- struct hif_req_join *body = wfx_alloc_hif(sizeof(*body), &hif);
+ struct wfx_hif_msg *hif;
+ struct wfx_hif_req_join *body = wfx_alloc_hif(sizeof(*body), &hif);

WARN_ON(!conf->beacon_int);
WARN_ON(!conf->basic_rates);
@@ -325,9 +325,9 @@ int wfx_hif_join(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf,
int wfx_hif_set_bss_params(struct wfx_vif *wvif, int aid, int beacon_lost_count)
{
int ret;
- struct hif_msg *hif;
- struct hif_req_set_bss_params *body =
- wfx_alloc_hif(sizeof(*body), &hif);
+ struct wfx_hif_msg *hif;
+ struct wfx_hif_req_set_bss_params *body = wfx_alloc_hif(sizeof(*body),
+ &hif);

if (!hif)
return -ENOMEM;
@@ -340,12 +340,12 @@ int wfx_hif_set_bss_params(struct wfx_vif *wvif, int aid, int beacon_lost_count)
return ret;
}

-int wfx_hif_add_key(struct wfx_dev *wdev, const struct hif_req_add_key *arg)
+int wfx_hif_add_key(struct wfx_dev *wdev, const struct wfx_hif_req_add_key *arg)
{
int ret;
- struct hif_msg *hif;
+ struct wfx_hif_msg *hif;
/* FIXME: only send necessary bits */
- struct hif_req_add_key *body = wfx_alloc_hif(sizeof(*body), &hif);
+ struct wfx_hif_req_add_key *body = wfx_alloc_hif(sizeof(*body), &hif);

if (!hif)
return -ENOMEM;
@@ -367,8 +367,8 @@ int wfx_hif_add_key(struct wfx_dev *wdev, const struct hif_req_add_key *arg)
int wfx_hif_remove_key(struct wfx_dev *wdev, int idx)
{
int ret;
- struct hif_msg *hif;
- struct hif_req_remove_key *body = wfx_alloc_hif(sizeof(*body), &hif);
+ struct wfx_hif_msg *hif;
+ struct wfx_hif_req_remove_key *body = wfx_alloc_hif(sizeof(*body), &hif);

if (!hif)
return -ENOMEM;
@@ -383,9 +383,9 @@ int wfx_hif_set_edca_queue_params(struct wfx_vif *wvif, u16 queue,
const struct ieee80211_tx_queue_params *arg)
{
int ret;
- struct hif_msg *hif;
- struct hif_req_edca_queue_params *body = wfx_alloc_hif(sizeof(*body),
- &hif);
+ struct wfx_hif_msg *hif;
+ struct wfx_hif_req_edca_queue_params *body = wfx_alloc_hif(sizeof(*body),
+ &hif);

if (!body)
return -ENOMEM;
@@ -413,8 +413,9 @@ int wfx_hif_set_edca_queue_params(struct wfx_vif *wvif, u16 queue,
int wfx_hif_set_pm(struct wfx_vif *wvif, bool ps, int dynamic_ps_timeout)
{
int ret;
- struct hif_msg *hif;
- struct hif_req_set_pm_mode *body = wfx_alloc_hif(sizeof(*body), &hif);
+ struct wfx_hif_msg *hif;
+ struct wfx_hif_req_set_pm_mode *body = wfx_alloc_hif(sizeof(*body),
+ &hif);

if (!body)
return -ENOMEM;
@@ -438,8 +439,8 @@ int wfx_hif_start(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf,
const struct ieee80211_channel *channel)
{
int ret;
- struct hif_msg *hif;
- struct hif_req_start *body = wfx_alloc_hif(sizeof(*body), &hif);
+ struct wfx_hif_msg *hif;
+ struct wfx_hif_req_start *body = wfx_alloc_hif(sizeof(*body), &hif);

WARN_ON(!conf->beacon_int);
if (!hif)
@@ -461,9 +462,9 @@ int wfx_hif_start(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf,
int wfx_hif_beacon_transmit(struct wfx_vif *wvif, bool enable)
{
int ret;
- struct hif_msg *hif;
- struct hif_req_beacon_transmit *body = wfx_alloc_hif(sizeof(*body),
- &hif);
+ struct wfx_hif_msg *hif;
+ struct wfx_hif_req_beacon_transmit *body = wfx_alloc_hif(sizeof(*body),
+ &hif);

if (!hif)
return -ENOMEM;
@@ -479,8 +480,8 @@ int wfx_hif_map_link(struct wfx_vif *wvif, bool unmap, u8 *mac_addr, int sta_id,
bool mfp)
{
int ret;
- struct hif_msg *hif;
- struct hif_req_map_link *body = wfx_alloc_hif(sizeof(*body), &hif);
+ struct wfx_hif_msg *hif;
+ struct wfx_hif_req_map_link *body = wfx_alloc_hif(sizeof(*body), &hif);

if (!hif)
return -ENOMEM;
@@ -499,9 +500,9 @@ int wfx_hif_update_ie_beacon(struct wfx_vif *wvif,
const u8 *ies, size_t ies_len)
{
int ret;
- struct hif_msg *hif;
- int buf_len = sizeof(struct hif_req_update_ie) + ies_len;
- struct hif_req_update_ie *body = wfx_alloc_hif(buf_len, &hif);
+ struct wfx_hif_msg *hif;
+ int buf_len = sizeof(struct wfx_hif_req_update_ie) + ies_len;
+ struct wfx_hif_req_update_ie *body = wfx_alloc_hif(buf_len, &hif);

if (!hif)
return -ENOMEM;
diff --git a/drivers/staging/wfx/hif_tx.h b/drivers/staging/wfx/hif_tx.h
index b28a2ee5350a..36caffa4d1eb 100644
--- a/drivers/staging/wfx/hif_tx.h
+++ b/drivers/staging/wfx/hif_tx.h
@@ -18,22 +18,22 @@ struct ieee80211_channel;
struct ieee80211_bss_conf;
struct ieee80211_tx_queue_params;
struct cfg80211_scan_request;
-struct hif_req_add_key;
+struct wfx_hif_req_add_key;
struct wfx_dev;
struct wfx_vif;

struct wfx_hif_cmd {
- struct mutex lock;
- struct completion ready;
- struct completion done;
- struct hif_msg *buf_send;
- void *buf_recv;
- size_t len_recv;
- int ret;
+ struct mutex lock;
+ struct completion ready;
+ struct completion done;
+ struct wfx_hif_msg *buf_send;
+ void *buf_recv;
+ size_t len_recv;
+ int ret;
};

void wfx_init_hif_cmd(struct wfx_hif_cmd *wfx_hif_cmd);
-int wfx_cmd_send(struct wfx_dev *wdev, struct hif_msg *request,
+int wfx_cmd_send(struct wfx_dev *wdev, struct wfx_hif_msg *request,
void *reply, size_t reply_len, bool async);

int wfx_hif_read_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id,
@@ -47,7 +47,7 @@ int wfx_hif_join(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf,
struct ieee80211_channel *channel, const u8 *ssid, int ssidlen);
int wfx_hif_map_link(struct wfx_vif *wvif,
bool unmap, u8 *mac_addr, int sta_id, bool mfp);
-int wfx_hif_add_key(struct wfx_dev *wdev, const struct hif_req_add_key *arg);
+int wfx_hif_add_key(struct wfx_dev *wdev, const struct wfx_hif_req_add_key *arg);
int wfx_hif_remove_key(struct wfx_dev *wdev, int idx);
int wfx_hif_set_pm(struct wfx_vif *wvif, bool ps, int dynamic_ps_timeout);
int wfx_hif_set_bss_params(struct wfx_vif *wvif, int aid, int beacon_lost_count);
diff --git a/drivers/staging/wfx/hif_tx_mib.c b/drivers/staging/wfx/hif_tx_mib.c
index b79ffdf6fcd2..daf966693f67 100644
--- a/drivers/staging/wfx/hif_tx_mib.c
+++ b/drivers/staging/wfx/hif_tx_mib.c
@@ -16,7 +16,7 @@

int wfx_hif_set_output_power(struct wfx_vif *wvif, int val)
{
- struct hif_mib_current_tx_power_level arg = {
+ struct wfx_hif_mib_current_tx_power_level arg = {
.power_level = cpu_to_le32(val * 10),
};

@@ -29,7 +29,7 @@ int wfx_hif_set_beacon_wakeup_period(struct wfx_vif *wvif,
unsigned int dtim_interval,
unsigned int listen_interval)
{
- struct hif_mib_beacon_wake_up_period arg = {
+ struct wfx_hif_mib_beacon_wake_up_period arg = {
.wakeup_period_min = dtim_interval,
.receive_dtim = 0,
.wakeup_period_max = listen_interval,
@@ -45,7 +45,7 @@ int wfx_hif_set_beacon_wakeup_period(struct wfx_vif *wvif,
int wfx_hif_set_rcpi_rssi_threshold(struct wfx_vif *wvif,
int rssi_thold, int rssi_hyst)
{
- struct hif_mib_rcpi_rssi_threshold arg = {
+ struct wfx_hif_mib_rcpi_rssi_threshold arg = {
.rolling_average_count = 8,
.detection = 1,
};
@@ -66,23 +66,23 @@ int wfx_hif_set_rcpi_rssi_threshold(struct wfx_vif *wvif,
}

int wfx_hif_get_counters_table(struct wfx_dev *wdev, int vif_id,
- struct hif_mib_extended_count_table *arg)
+ struct wfx_hif_mib_extended_count_table *arg)
{
if (wfx_api_older_than(wdev, 1, 3)) {
/* extended_count_table is wider than count_table */
memset(arg, 0xFF, sizeof(*arg));
return wfx_hif_read_mib(wdev, vif_id, HIF_MIB_ID_COUNTERS_TABLE,
- arg, sizeof(struct hif_mib_count_table));
+ arg, sizeof(struct wfx_hif_mib_count_table));
} else {
return wfx_hif_read_mib(wdev, vif_id,
HIF_MIB_ID_EXTENDED_COUNTERS_TABLE, arg,
- sizeof(struct hif_mib_extended_count_table));
+ sizeof(struct wfx_hif_mib_extended_count_table));
}
}

int wfx_hif_set_macaddr(struct wfx_vif *wvif, u8 *mac)
{
- struct hif_mib_mac_address arg = { };
+ struct wfx_hif_mib_mac_address arg = { };

if (mac)
ether_addr_copy(arg.mac_addr, mac);
@@ -94,7 +94,7 @@ int wfx_hif_set_macaddr(struct wfx_vif *wvif, u8 *mac)
int wfx_hif_set_rx_filter(struct wfx_vif *wvif,
bool filter_bssid, bool filter_prbreq)
{
- struct hif_mib_rx_filter arg = { };
+ struct wfx_hif_mib_rx_filter arg = { };

if (filter_bssid)
arg.bssid_filter = 1;
@@ -105,10 +105,10 @@ int wfx_hif_set_rx_filter(struct wfx_vif *wvif,
}

int wfx_hif_set_beacon_filter_table(struct wfx_vif *wvif, int tbl_len,
- const struct hif_ie_table_entry *tbl)
+ const struct wfx_hif_ie_table_entry *tbl)
{
int ret;
- struct hif_mib_bcn_filter_table *arg;
+ struct wfx_hif_mib_bcn_filter_table *arg;
int buf_len = struct_size(arg, ie_table, tbl_len);

arg = kzalloc(buf_len, GFP_KERNEL);
@@ -125,7 +125,7 @@ int wfx_hif_set_beacon_filter_table(struct wfx_vif *wvif, int tbl_len,
int wfx_hif_beacon_filter_control(struct wfx_vif *wvif,
int enable, int beacon_count)
{
- struct hif_mib_bcn_filter_enable arg = {
+ struct wfx_hif_mib_bcn_filter_enable arg = {
.enable = cpu_to_le32(enable),
.bcn_count = cpu_to_le32(beacon_count),
};
@@ -135,9 +135,9 @@ int wfx_hif_beacon_filter_control(struct wfx_vif *wvif,
}

int wfx_hif_set_operational_mode(struct wfx_dev *wdev,
- enum hif_op_power_mode mode)
+ enum wfx_hif_op_power_mode mode)
{
- struct hif_mib_gl_operational_power_mode arg = {
+ struct wfx_hif_mib_gl_operational_power_mode arg = {
.power_mode = mode,
.wup_ind_activation = 1,
};
@@ -149,11 +149,11 @@ int wfx_hif_set_operational_mode(struct wfx_dev *wdev,
int wfx_hif_set_template_frame(struct wfx_vif *wvif, struct sk_buff *skb,
u8 frame_type, int init_rate)
{
- struct hif_mib_template_frame *arg;
+ struct wfx_hif_mib_template_frame *arg;

WARN(skb->len > HIF_API_MAX_TEMPLATE_FRAME_SIZE, "frame is too big");
skb_push(skb, 4);
- arg = (struct hif_mib_template_frame *)skb->data;
+ arg = (struct wfx_hif_mib_template_frame *)skb->data;
skb_pull(skb, 4);
arg->init_rate = init_rate;
arg->frame_type = frame_type;
@@ -164,7 +164,7 @@ int wfx_hif_set_template_frame(struct wfx_vif *wvif, struct sk_buff *skb,

int wfx_hif_set_mfp(struct wfx_vif *wvif, bool capable, bool required)
{
- struct hif_mib_protected_mgmt_policy arg = { };
+ struct wfx_hif_mib_protected_mgmt_policy arg = { };

WARN(required && !capable, "incoherent arguments");
if (capable) {
@@ -181,7 +181,7 @@ int wfx_hif_set_mfp(struct wfx_vif *wvif, bool capable, bool required)
int wfx_hif_set_block_ack_policy(struct wfx_vif *wvif,
u8 tx_tid_policy, u8 rx_tid_policy)
{
- struct hif_mib_block_ack_policy arg = {
+ struct wfx_hif_mib_block_ack_policy arg = {
.block_ack_tx_tid_policy = tx_tid_policy,
.block_ack_rx_tid_policy = rx_tid_policy,
};
@@ -194,7 +194,7 @@ int wfx_hif_set_block_ack_policy(struct wfx_vif *wvif,
int wfx_hif_set_association_mode(struct wfx_vif *wvif, int ampdu_density,
bool greenfield, bool short_preamble)
{
- struct hif_mib_set_association_mode arg = {
+ struct wfx_hif_mib_set_association_mode arg = {
.preambtype_use = 1,
.mode = 1,
.spacing = 1,
@@ -211,7 +211,7 @@ int wfx_hif_set_association_mode(struct wfx_vif *wvif, int ampdu_density,
int wfx_hif_set_tx_rate_retry_policy(struct wfx_vif *wvif,
int policy_index, u8 *rates)
{
- struct hif_mib_set_tx_rate_retry_policy *arg;
+ struct wfx_hif_mib_set_tx_rate_retry_policy *arg;
size_t size = struct_size(arg, tx_rate_retry_policy, 1);
int ret;

@@ -236,7 +236,7 @@ int wfx_hif_set_tx_rate_retry_policy(struct wfx_vif *wvif,

int wfx_hif_keep_alive_period(struct wfx_vif *wvif, int period)
{
- struct hif_mib_keep_alive_period arg = {
+ struct wfx_hif_mib_keep_alive_period arg = {
.keep_alive_period = cpu_to_le16(period),
};

@@ -247,7 +247,7 @@ int wfx_hif_keep_alive_period(struct wfx_vif *wvif, int period)

int wfx_hif_set_arp_ipv4_filter(struct wfx_vif *wvif, int idx, __be32 *addr)
{
- struct hif_mib_arp_ip_addr_table arg = {
+ struct wfx_hif_mib_arp_ip_addr_table arg = {
.condition_idx = idx,
.arp_enable = HIF_ARP_NS_FILTERING_DISABLE,
};
@@ -264,7 +264,7 @@ int wfx_hif_set_arp_ipv4_filter(struct wfx_vif *wvif, int idx, __be32 *addr)

int wfx_hif_use_multi_tx_conf(struct wfx_dev *wdev, bool enable)
{
- struct hif_mib_gl_set_multi_msg arg = {
+ struct wfx_hif_mib_gl_set_multi_msg arg = {
.enable_multi_tx_conf = enable,
};

@@ -274,7 +274,7 @@ int wfx_hif_use_multi_tx_conf(struct wfx_dev *wdev, bool enable)

int wfx_hif_set_uapsd_info(struct wfx_vif *wvif, unsigned long val)
{
- struct hif_mib_set_uapsd_information arg = { };
+ struct wfx_hif_mib_set_uapsd_information arg = { };

if (val & BIT(IEEE80211_AC_VO))
arg.trig_voice = 1;
@@ -291,7 +291,7 @@ int wfx_hif_set_uapsd_info(struct wfx_vif *wvif, unsigned long val)

int wfx_hif_erp_use_protection(struct wfx_vif *wvif, bool enable)
{
- struct hif_mib_non_erp_protection arg = {
+ struct wfx_hif_mib_non_erp_protection arg = {
.use_cts_to_self = enable,
};

@@ -302,7 +302,7 @@ int wfx_hif_erp_use_protection(struct wfx_vif *wvif, bool enable)

int wfx_hif_slot_time(struct wfx_vif *wvif, int val)
{
- struct hif_mib_slot_time arg = {
+ struct wfx_hif_mib_slot_time arg = {
.slot_time = cpu_to_le32(val),
};

@@ -312,7 +312,7 @@ int wfx_hif_slot_time(struct wfx_vif *wvif, int val)

int wfx_hif_wep_default_key_id(struct wfx_vif *wvif, int val)
{
- struct hif_mib_wep_default_key_id arg = {
+ struct wfx_hif_mib_wep_default_key_id arg = {
.wep_default_key_id = val,
};

@@ -323,7 +323,7 @@ int wfx_hif_wep_default_key_id(struct wfx_vif *wvif, int val)

int wfx_hif_rts_threshold(struct wfx_vif *wvif, int val)
{
- struct hif_mib_dot11_rts_threshold arg = {
+ struct wfx_hif_mib_dot11_rts_threshold arg = {
.threshold = cpu_to_le32(val >= 0 ? val : 0xFFFF),
};

diff --git a/drivers/staging/wfx/hif_tx_mib.h b/drivers/staging/wfx/hif_tx_mib.h
index 9b4c16ad5ecf..e7e556b05c9a 100644
--- a/drivers/staging/wfx/hif_tx_mib.h
+++ b/drivers/staging/wfx/hif_tx_mib.h
@@ -14,8 +14,8 @@
struct sk_buff;
struct wfx_vif;
struct wfx_dev;
-struct hif_ie_table_entry;
-struct hif_mib_extended_count_table;
+struct wfx_hif_ie_table_entry;
+struct wfx_hif_mib_extended_count_table;

int wfx_hif_set_output_power(struct wfx_vif *wvif, int val);
int wfx_hif_set_beacon_wakeup_period(struct wfx_vif *wvif,
@@ -24,16 +24,16 @@ int wfx_hif_set_beacon_wakeup_period(struct wfx_vif *wvif,
int wfx_hif_set_rcpi_rssi_threshold(struct wfx_vif *wvif,
int rssi_thold, int rssi_hyst);
int wfx_hif_get_counters_table(struct wfx_dev *wdev, int vif_id,
- struct hif_mib_extended_count_table *arg);
+ struct wfx_hif_mib_extended_count_table *arg);
int wfx_hif_set_macaddr(struct wfx_vif *wvif, u8 *mac);
int wfx_hif_set_rx_filter(struct wfx_vif *wvif,
bool filter_bssid, bool fwd_probe_req);
int wfx_hif_set_beacon_filter_table(struct wfx_vif *wvif, int tbl_len,
- const struct hif_ie_table_entry *tbl);
+ const struct wfx_hif_ie_table_entry *tbl);
int wfx_hif_beacon_filter_control(struct wfx_vif *wvif,
int enable, int beacon_count);
int wfx_hif_set_operational_mode(struct wfx_dev *wdev,
- enum hif_op_power_mode mode);
+ enum wfx_hif_op_power_mode mode);
int wfx_hif_set_template_frame(struct wfx_vif *wvif, struct sk_buff *skb,
u8 frame_type, int init_rate);
int wfx_hif_set_mfp(struct wfx_vif *wvif, bool capable, bool required);
diff --git a/drivers/staging/wfx/key.c b/drivers/staging/wfx/key.c
index 6069be161154..dea8238f9916 100644
--- a/drivers/staging/wfx/key.c
+++ b/drivers/staging/wfx/key.c
@@ -30,7 +30,7 @@ static void wfx_free_key(struct wfx_dev *wdev, int idx)
wdev->key_map &= ~BIT(idx);
}

-static u8 fill_wep_pair(struct hif_wep_pairwise_key *msg,
+static u8 fill_wep_pair(struct wfx_hif_wep_pairwise_key *msg,
struct ieee80211_key_conf *key, u8 *peer_addr)
{
WARN(key->keylen > sizeof(msg->key_data), "inconsistent data");
@@ -40,7 +40,7 @@ static u8 fill_wep_pair(struct hif_wep_pairwise_key *msg,
return HIF_KEY_TYPE_WEP_PAIRWISE;
}

-static u8 fill_wep_group(struct hif_wep_group_key *msg,
+static u8 fill_wep_group(struct wfx_hif_wep_group_key *msg,
struct ieee80211_key_conf *key)
{
WARN(key->keylen > sizeof(msg->key_data), "inconsistent data");
@@ -50,7 +50,7 @@ static u8 fill_wep_group(struct hif_wep_group_key *msg,
return HIF_KEY_TYPE_WEP_DEFAULT;
}

-static u8 fill_tkip_pair(struct hif_tkip_pairwise_key *msg,
+static u8 fill_tkip_pair(struct wfx_hif_tkip_pairwise_key *msg,
struct ieee80211_key_conf *key, u8 *peer_addr)
{
u8 *keybuf = key->key;
@@ -67,7 +67,7 @@ static u8 fill_tkip_pair(struct hif_tkip_pairwise_key *msg,
return HIF_KEY_TYPE_TKIP_PAIRWISE;
}

-static u8 fill_tkip_group(struct hif_tkip_group_key *msg,
+static u8 fill_tkip_group(struct wfx_hif_tkip_group_key *msg,
struct ieee80211_key_conf *key,
struct ieee80211_key_seq *seq,
enum nl80211_iftype iftype)
@@ -92,7 +92,7 @@ static u8 fill_tkip_group(struct hif_tkip_group_key *msg,
return HIF_KEY_TYPE_TKIP_GROUP;
}

-static u8 fill_ccmp_pair(struct hif_aes_pairwise_key *msg,
+static u8 fill_ccmp_pair(struct wfx_hif_aes_pairwise_key *msg,
struct ieee80211_key_conf *key, u8 *peer_addr)
{
WARN(key->keylen != sizeof(msg->aes_key_data), "inconsistent data");
@@ -101,7 +101,7 @@ static u8 fill_ccmp_pair(struct hif_aes_pairwise_key *msg,
return HIF_KEY_TYPE_AES_PAIRWISE;
}

-static u8 fill_ccmp_group(struct hif_aes_group_key *msg,
+static u8 fill_ccmp_group(struct wfx_hif_aes_group_key *msg,
struct ieee80211_key_conf *key,
struct ieee80211_key_seq *seq)
{
@@ -113,7 +113,7 @@ static u8 fill_ccmp_group(struct hif_aes_group_key *msg,
return HIF_KEY_TYPE_AES_GROUP;
}

-static u8 fill_sms4_pair(struct hif_wapi_pairwise_key *msg,
+static u8 fill_sms4_pair(struct wfx_hif_wapi_pairwise_key *msg,
struct ieee80211_key_conf *key, u8 *peer_addr)
{
u8 *keybuf = key->key;
@@ -128,7 +128,7 @@ static u8 fill_sms4_pair(struct hif_wapi_pairwise_key *msg,
return HIF_KEY_TYPE_WAPI_PAIRWISE;
}

-static u8 fill_sms4_group(struct hif_wapi_group_key *msg,
+static u8 fill_sms4_group(struct wfx_hif_wapi_group_key *msg,
struct ieee80211_key_conf *key)
{
u8 *keybuf = key->key;
@@ -142,7 +142,7 @@ static u8 fill_sms4_group(struct hif_wapi_group_key *msg,
return HIF_KEY_TYPE_WAPI_GROUP;
}

-static u8 fill_aes_cmac_group(struct hif_igtk_group_key *msg,
+static u8 fill_aes_cmac_group(struct wfx_hif_igtk_group_key *msg,
struct ieee80211_key_conf *key,
struct ieee80211_key_seq *seq)
{
@@ -158,7 +158,7 @@ static int wfx_add_key(struct wfx_vif *wvif, struct ieee80211_sta *sta,
struct ieee80211_key_conf *key)
{
int ret;
- struct hif_req_add_key k = { };
+ struct wfx_hif_req_add_key k = { };
struct ieee80211_key_seq seq;
struct wfx_dev *wdev = wvif->wdev;
int idx = wfx_alloc_key(wvif->wdev);
diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c
index 43947f8f2e0c..f34cfed503d4 100644
--- a/drivers/staging/wfx/main.c
+++ b/drivers/staging/wfx/main.c
@@ -288,8 +288,8 @@ struct wfx_dev *wfx_init_common(struct device *dev,
hw->queues = 4;
hw->max_rates = 8;
hw->max_rate_tries = 8;
- hw->extra_tx_headroom = sizeof(struct hif_msg)
- + sizeof(struct hif_req_tx)
+ hw->extra_tx_headroom = sizeof(struct wfx_hif_msg)
+ + sizeof(struct wfx_hif_req_tx)
+ 4 /* alignment */ + 8 /* TKIP IV */;
hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
BIT(NL80211_IFTYPE_ADHOC) |
diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c
index 7a3ba3c38925..71c6ef94a904 100644
--- a/drivers/staging/wfx/queue.c
+++ b/drivers/staging/wfx/queue.c
@@ -127,13 +127,13 @@ void wfx_pending_drop(struct wfx_dev *wdev, struct sk_buff_head *dropped)
{
struct wfx_queue *queue;
struct wfx_vif *wvif;
- struct hif_msg *hif;
+ struct wfx_hif_msg *hif;
struct sk_buff *skb;

WARN(!wdev->chip_frozen, "%s should only be used to recover a frozen device",
__func__);
while ((skb = skb_dequeue(&wdev->tx_pending)) != NULL) {
- hif = (struct hif_msg *)skb->data;
+ hif = (struct wfx_hif_msg *)skb->data;
wvif = wdev_to_wvif(wdev, hif->interface);
if (wvif) {
queue = &wvif->tx_queue[skb_get_queue_mapping(skb)];
@@ -148,15 +148,15 @@ void wfx_pending_drop(struct wfx_dev *wdev, struct sk_buff_head *dropped)
struct sk_buff *wfx_pending_get(struct wfx_dev *wdev, u32 packet_id)
{
struct wfx_queue *queue;
- struct hif_req_tx *req;
+ struct wfx_hif_req_tx *req;
struct wfx_vif *wvif;
- struct hif_msg *hif;
+ struct wfx_hif_msg *hif;
struct sk_buff *skb;

spin_lock_bh(&wdev->tx_pending.lock);
skb_queue_walk(&wdev->tx_pending, skb) {
- hif = (struct hif_msg *)skb->data;
- req = (struct hif_req_tx *)hif->body;
+ hif = (struct wfx_hif_msg *)skb->data;
+ req = (struct wfx_hif_req_tx *)hif->body;
if (req->packet_id != packet_id)
continue;
spin_unlock_bh(&wdev->tx_pending.lock);
@@ -179,7 +179,7 @@ void wfx_pending_dump_old_frames(struct wfx_dev *wdev, unsigned int limit_ms)
{
ktime_t now = ktime_get();
struct wfx_tx_priv *tx_priv;
- struct hif_req_tx *req;
+ struct wfx_hif_req_tx *req;
struct sk_buff *skb;
bool first = true;

@@ -236,7 +236,7 @@ static struct sk_buff *wfx_tx_queues_get_skb(struct wfx_dev *wdev)
struct wfx_queue *queues[IEEE80211_NUM_ACS * ARRAY_SIZE(wdev->vif)];
int i, j, num_queues = 0;
struct wfx_vif *wvif;
- struct hif_msg *hif;
+ struct wfx_hif_msg *hif;
struct sk_buff *skb;

/* sort the queues */
@@ -265,7 +265,7 @@ static struct sk_buff *wfx_tx_queues_get_skb(struct wfx_dev *wdev)
* and only one vif can be AP, all queued frames has
* same interface id
*/
- hif = (struct hif_msg *)skb->data;
+ hif = (struct wfx_hif_msg *)skb->data;
WARN_ON(hif->interface != wvif->id);
WARN_ON(queues[i] !=
&wvif->tx_queue[skb_get_queue_mapping(skb)]);
@@ -289,7 +289,7 @@ static struct sk_buff *wfx_tx_queues_get_skb(struct wfx_dev *wdev)
return NULL;
}

-struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev)
+struct wfx_hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev)
{
struct wfx_tx_priv *tx_priv;
struct sk_buff *skb;
@@ -303,5 +303,5 @@ struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev)
wake_up(&wdev->tx_dequeue);
tx_priv = wfx_skb_tx_priv(skb);
tx_priv->xmit_timestamp = ktime_get();
- return (struct hif_msg *)skb->data;
+ return (struct wfx_hif_msg *)skb->data;
}
diff --git a/drivers/staging/wfx/queue.h b/drivers/staging/wfx/queue.h
index edd0d018b198..66596a9abe30 100644
--- a/drivers/staging/wfx/queue.h
+++ b/drivers/staging/wfx/queue.h
@@ -30,7 +30,7 @@ void wfx_tx_queues_init(struct wfx_vif *wvif);
void wfx_tx_queues_check_empty(struct wfx_vif *wvif);
bool wfx_tx_queues_has_cab(struct wfx_vif *wvif);
void wfx_tx_queues_put(struct wfx_vif *wvif, struct sk_buff *skb);
-struct hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev);
+struct wfx_hif_msg *wfx_tx_queues_get(struct wfx_dev *wdev);

bool wfx_tx_queue_empty(struct wfx_vif *wvif, struct wfx_queue *queue);
void wfx_tx_queue_drop(struct wfx_vif *wvif, struct wfx_queue *queue,
diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index d384f2df329c..620d8c912f95 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -63,7 +63,7 @@ void wfx_suspend_hot_dev(struct wfx_dev *wdev, enum sta_notify_cmd cmd)

static void wfx_filter_beacon(struct wfx_vif *wvif, bool filter_beacon)
{
- static const struct hif_ie_table_entry filter_ies[] = {
+ static const struct wfx_hif_ie_table_entry filter_ies[] = {
{
.ie_id = WLAN_EID_VENDOR_SPECIFIC,
.has_changed = 1,
diff --git a/drivers/staging/wfx/traces.h b/drivers/staging/wfx/traces.h
index e90dc73c4b01..99bd1808111e 100644
--- a/drivers/staging/wfx/traces.h
+++ b/drivers/staging/wfx/traces.h
@@ -158,7 +158,7 @@ hif_mib_list_enum
#define hif_mib_list hif_mib_list_enum { -1, NULL }

DECLARE_EVENT_CLASS(hif_data,
- TP_PROTO(const struct hif_msg *hif, int tx_fill_level, bool is_recv),
+ TP_PROTO(const struct wfx_hif_msg *hif, int tx_fill_level, bool is_recv),
TP_ARGS(hif, tx_fill_level, is_recv),
TP_STRUCT__entry(
__field(int, tx_fill_level)
@@ -192,7 +192,7 @@ DECLARE_EVENT_CLASS(hif_data,
}
__entry->buf_len = min_t(int, __entry->msg_len,
sizeof(__entry->buf))
- - sizeof(struct hif_msg) - header_len;
+ - sizeof(struct wfx_hif_msg) - header_len;
memcpy(__entry->buf, hif->body + header_len, __entry->buf_len);
),
TP_printk("%d:%d:%s_%s%s%s: %s%s (%d bytes)",
@@ -208,12 +208,12 @@ DECLARE_EVENT_CLASS(hif_data,
)
);
DEFINE_EVENT(hif_data, hif_send,
- TP_PROTO(const struct hif_msg *hif, int tx_fill_level, bool is_recv),
+ TP_PROTO(const struct wfx_hif_msg *hif, int tx_fill_level, bool is_recv),
TP_ARGS(hif, tx_fill_level, is_recv));
#define _trace_hif_send(hif, tx_fill_level)\
trace_hif_send(hif, tx_fill_level, false)
DEFINE_EVENT(hif_data, hif_recv,
- TP_PROTO(const struct hif_msg *hif, int tx_fill_level, bool is_recv),
+ TP_PROTO(const struct wfx_hif_msg *hif, int tx_fill_level, bool is_recv),
TP_ARGS(hif, tx_fill_level, is_recv));
#define _trace_hif_recv(hif, tx_fill_level)\
trace_hif_recv(hif, tx_fill_level, true)
@@ -364,7 +364,7 @@ TRACE_EVENT(bh_stats,
trace_bh_stats(ind, req, cnf, busy, release)

TRACE_EVENT(tx_stats,
- TP_PROTO(const struct hif_cnf_tx *tx_cnf, const struct sk_buff *skb,
+ TP_PROTO(const struct wfx_hif_cnf_tx *tx_cnf, const struct sk_buff *skb,
int delay),
TP_ARGS(tx_cnf, skb, delay),
TP_STRUCT__entry(
diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h
index f8df59ad1639..1c06430e5996 100644
--- a/drivers/staging/wfx/wfx.h
+++ b/drivers/staging/wfx/wfx.h
@@ -38,7 +38,7 @@ struct wfx_dev {

u8 keyset;
struct completion firmware_ready;
- struct hif_ind_startup hw_caps;
+ struct wfx_hif_ind_startup hw_caps;
struct wfx_hif hif;
struct delayed_work cooling_timeout_work;
bool poll_irq;
@@ -53,9 +53,9 @@ struct wfx_dev {
atomic_t packet_id;
u32 key_map;

- struct hif_rx_stats rx_stats;
+ struct wfx_hif_rx_stats rx_stats;
struct mutex rx_stats_lock;
- struct hif_tx_power_loop_info tx_power_loop_info;
+ struct wfx_hif_tx_power_loop_info tx_power_loop_info;
struct mutex tx_power_loop_info_lock;
int force_ps_timeout;
};
--
2.34.1

2022-01-13 08:57:22

by Jérôme Pouiller

[permalink] [raw]
Subject: [PATCH 20/31] staging: wfx: reformat code on 100 columns

From: Jérôme Pouiller <[email protected]>

Until now, this driver was written in 80 columns style. However, since
all the functions are prefixed with "wfx_", this constraint is no more
respected in the last patches.

From the perspective of kernel Coding Style, it is not a problem since
it is now allowed to write code on 100 columns.

This patch just unify the code to use 100 columns.

Signed-off-by: Jérôme Pouiller <[email protected]>
---
drivers/staging/wfx/bh.c | 12 ++---
drivers/staging/wfx/bus.h | 6 +--
drivers/staging/wfx/bus_sdio.c | 12 ++---
drivers/staging/wfx/bus_spi.c | 24 +++------
drivers/staging/wfx/data_rx.c | 6 +--
drivers/staging/wfx/data_rx.h | 3 +-
drivers/staging/wfx/data_tx.c | 71 +++++++++------------------
drivers/staging/wfx/data_tx.h | 6 +--
drivers/staging/wfx/debug.c | 27 ++++-------
drivers/staging/wfx/fwio.c | 33 +++++--------
drivers/staging/wfx/hif_rx.c | 60 ++++++++---------------
drivers/staging/wfx/hif_tx.c | 63 ++++++++----------------
drivers/staging/wfx/hif_tx.h | 9 ++--
drivers/staging/wfx/hif_tx_mib.c | 81 +++++++++++--------------------
drivers/staging/wfx/hif_tx_mib.h | 21 +++-----
drivers/staging/wfx/hwio.c | 51 +++++++-------------
drivers/staging/wfx/key.c | 62 +++++++++---------------
drivers/staging/wfx/key.h | 5 +-
drivers/staging/wfx/main.c | 56 +++++++++------------
drivers/staging/wfx/main.h | 6 +--
drivers/staging/wfx/queue.c | 24 +++------
drivers/staging/wfx/queue.h | 3 +-
drivers/staging/wfx/scan.c | 12 ++---
drivers/staging/wfx/sta.c | 83 +++++++++++---------------------
drivers/staging/wfx/sta.h | 22 +++------
drivers/staging/wfx/traces.h | 14 ++----
drivers/staging/wfx/wfx.h | 3 +-
27 files changed, 269 insertions(+), 506 deletions(-)

diff --git a/drivers/staging/wfx/bh.c b/drivers/staging/wfx/bh.c
index 872f3298dc87..b9a351913868 100644
--- a/drivers/staging/wfx/bh.c
+++ b/drivers/staging/wfx/bh.c
@@ -37,8 +37,7 @@ static void device_wakeup(struct wfx_dev *wdev)
* wait_for_completion_done_timeout()). So we have to emulate
* it.
*/
- if (wait_for_completion_timeout(&wdev->hif.ctrl_ready,
- msecs_to_jiffies(2))) {
+ if (wait_for_completion_timeout(&wdev->hif.ctrl_ready, msecs_to_jiffies(2))) {
complete(&wdev->hif.ctrl_ready);
return;
} else if (max_retry-- > 0) {
@@ -105,7 +104,8 @@ static int rx_helper(struct wfx_dev *wdev, size_t read_len, int *is_cnf)
if (!(hif->id & HIF_ID_IS_INDICATION)) {
(*is_cnf)++;
if (hif->id == HIF_CNF_ID_MULTI_TRANSMIT)
- release_count = ((struct wfx_hif_cnf_multi_transmit *)hif->body)->num_tx_confs;
+ release_count =
+ ((struct wfx_hif_cnf_multi_transmit *)hif->body)->num_tx_confs;
else
release_count = 1;
WARN(wdev->hif.tx_buffers_used < release_count, "corrupted buffer counter");
@@ -229,8 +229,7 @@ static void ack_sdio_data(struct wfx_dev *wdev)

wfx_config_reg_read(wdev, &cfg_reg);
if (cfg_reg & 0xFF) {
- dev_warn(wdev->dev, "chip reports errors: %02x\n",
- cfg_reg & 0xFF);
+ dev_warn(wdev->dev, "chip reports errors: %02x\n", cfg_reg & 0xFF);
wfx_config_reg_write_bits(wdev, 0xFF, 0x00);
}
}
@@ -261,8 +260,7 @@ static void bh_work(struct work_struct *work)
device_release(wdev);
release_chip = true;
}
- _trace_bh_stats(stats_ind, stats_req, stats_cnf,
- wdev->hif.tx_buffers_used, release_chip);
+ _trace_bh_stats(stats_ind, stats_req, stats_cnf, wdev->hif.tx_buffers_used, release_chip);
}

/* An IRQ from chip did occur */
diff --git a/drivers/staging/wfx/bus.h b/drivers/staging/wfx/bus.h
index 91b5a545b8ff..ccadfdd6873c 100644
--- a/drivers/staging/wfx/bus.h
+++ b/drivers/staging/wfx/bus.h
@@ -21,10 +21,8 @@
#define WFX_REG_FRAME_OUT 0x7

struct wfx_hwbus_ops {
- int (*copy_from_io)(void *bus_priv, unsigned int addr,
- void *dst, size_t count);
- int (*copy_to_io)(void *bus_priv, unsigned int addr,
- const void *src, size_t count);
+ int (*copy_from_io)(void *bus_priv, unsigned int addr, void *dst, size_t count);
+ int (*copy_to_io)(void *bus_priv, unsigned int addr, const void *src, size_t count);
int (*irq_subscribe)(void *bus_priv);
int (*irq_unsubscribe)(void *bus_priv);
void (*lock)(void *bus_priv);
diff --git a/drivers/staging/wfx/bus_sdio.c b/drivers/staging/wfx/bus_sdio.c
index abcb507a48b3..a3da661e355c 100644
--- a/drivers/staging/wfx/bus_sdio.c
+++ b/drivers/staging/wfx/bus_sdio.c
@@ -33,8 +33,7 @@ struct wfx_sdio_priv {
int of_irq;
};

-static int wfx_sdio_copy_from_io(void *priv, unsigned int reg_id,
- void *dst, size_t count)
+static int wfx_sdio_copy_from_io(void *priv, unsigned int reg_id, void *dst, size_t count)
{
struct wfx_sdio_priv *bus = priv;
unsigned int sdio_addr = reg_id << 2;
@@ -54,8 +53,7 @@ static int wfx_sdio_copy_from_io(void *priv, unsigned int reg_id,
return ret;
}

-static int wfx_sdio_copy_to_io(void *priv, unsigned int reg_id,
- const void *src, size_t count)
+static int wfx_sdio_copy_to_io(void *priv, unsigned int reg_id, const void *src, size_t count)
{
struct wfx_sdio_priv *bus = priv;
unsigned int sdio_addr = reg_id << 2;
@@ -126,8 +124,7 @@ static int wfx_sdio_irq_subscribe(void *priv)
flags = IRQF_TRIGGER_HIGH;
flags |= IRQF_ONESHOT;
ret = devm_request_threaded_irq(&bus->func->dev, bus->of_irq, NULL,
- wfx_sdio_irq_handler_ext, flags,
- "wfx", bus);
+ wfx_sdio_irq_handler_ext, flags, "wfx", bus);
if (ret)
return ret;
sdio_claim_host(bus->func);
@@ -176,8 +173,7 @@ static const struct of_device_id wfx_sdio_of_match[] = {
};
MODULE_DEVICE_TABLE(of, wfx_sdio_of_match);

-static int wfx_sdio_probe(struct sdio_func *func,
- const struct sdio_device_id *id)
+static int wfx_sdio_probe(struct sdio_func *func, const struct sdio_device_id *id)
{
struct device_node *np = func->dev.of_node;
struct wfx_sdio_priv *bus;
diff --git a/drivers/staging/wfx/bus_spi.c b/drivers/staging/wfx/bus_spi.c
index 99d33a128830..43bc6e147d5f 100644
--- a/drivers/staging/wfx/bus_spi.c
+++ b/drivers/staging/wfx/bus_spi.c
@@ -46,8 +46,7 @@ struct wfx_spi_priv {
* natively. The code below to support big endian host and commonly used SPI
* 8bits.
*/
-static int wfx_spi_copy_from_io(void *priv, unsigned int addr,
- void *dst, size_t count)
+static int wfx_spi_copy_from_io(void *priv, unsigned int addr, void *dst, size_t count)
{
struct wfx_spi_priv *bus = priv;
u16 regaddr = (addr << 12) | (count / 2) | SET_READ;
@@ -80,8 +79,7 @@ static int wfx_spi_copy_from_io(void *priv, unsigned int addr,
return ret;
}

-static int wfx_spi_copy_to_io(void *priv, unsigned int addr,
- const void *src, size_t count)
+static int wfx_spi_copy_to_io(void *priv, unsigned int addr, const void *src, size_t count)
{
struct wfx_spi_priv *bus = priv;
u16 regaddr = (addr << 12) | (count / 2);
@@ -149,8 +147,7 @@ static int wfx_spi_irq_subscribe(void *priv)
flags = IRQF_TRIGGER_HIGH;
flags |= IRQF_ONESHOT;
return devm_request_threaded_irq(&bus->func->dev, bus->func->irq, NULL,
- wfx_spi_irq_handler, IRQF_ONESHOT,
- "wfx", bus);
+ wfx_spi_irq_handler, IRQF_ONESHOT, "wfx", bus);
}

static int wfx_spi_irq_unsubscribe(void *priv)
@@ -190,14 +187,11 @@ static int wfx_spi_probe(struct spi_device *func)
return ret;
/* Trace below is also displayed by spi_setup() if compiled with DEBUG */
dev_dbg(&func->dev, "SPI params: CS=%d, mode=%d bits/word=%d speed=%d\n",
- func->chip_select, func->mode, func->bits_per_word,
- func->max_speed_hz);
+ func->chip_select, func->mode, func->bits_per_word, func->max_speed_hz);
if (func->bits_per_word != 16 && func->bits_per_word != 8)
- dev_warn(&func->dev, "unusual bits/word value: %d\n",
- func->bits_per_word);
+ dev_warn(&func->dev, "unusual bits/word value: %d\n", func->bits_per_word);
if (func->max_speed_hz > 50000000)
- dev_warn(&func->dev, "%dHz is a very high speed\n",
- func->max_speed_hz);
+ dev_warn(&func->dev, "%dHz is a very high speed\n", func->max_speed_hz);

bus = devm_kzalloc(&func->dev, sizeof(*bus), GFP_KERNEL);
if (!bus)
@@ -207,13 +201,11 @@ static int wfx_spi_probe(struct spi_device *func)
bus->need_swab = true;
spi_set_drvdata(func, bus);

- bus->gpio_reset = devm_gpiod_get_optional(&func->dev, "reset",
- GPIOD_OUT_LOW);
+ bus->gpio_reset = devm_gpiod_get_optional(&func->dev, "reset", GPIOD_OUT_LOW);
if (IS_ERR(bus->gpio_reset))
return PTR_ERR(bus->gpio_reset);
if (!bus->gpio_reset) {
- dev_warn(&func->dev,
- "gpio reset is not defined, trying to load firmware anyway\n");
+ dev_warn(&func->dev, "gpio reset is not defined, trying to load firmware anyway\n");
} else {
gpiod_set_consumer_name(bus->gpio_reset, "wfx reset");
if (spi_get_device_id(func)->driver_data & WFX_RESET_INVERTED)
diff --git a/drivers/staging/wfx/data_rx.c b/drivers/staging/wfx/data_rx.c
index 3fe67c4815e7..4beee2624998 100644
--- a/drivers/staging/wfx/data_rx.c
+++ b/drivers/staging/wfx/data_rx.c
@@ -34,8 +34,7 @@ static void wfx_rx_handle_ba(struct wfx_vif *wvif, struct ieee80211_mgmt *mgmt)
}
}

-void wfx_rx_cb(struct wfx_vif *wvif,
- const struct wfx_hif_ind_rx *arg, struct sk_buff *skb)
+void wfx_rx_cb(struct wfx_vif *wvif, const struct wfx_hif_ind_rx *arg, struct sk_buff *skb)
{
struct ieee80211_rx_status *hdr = IEEE80211_SKB_RXCB(skb);
struct ieee80211_hdr *frame = (struct ieee80211_hdr *)skb->data;
@@ -54,8 +53,7 @@ void wfx_rx_cb(struct wfx_vif *wvif,
}

hdr->band = NL80211_BAND_2GHZ;
- hdr->freq = ieee80211_channel_to_frequency(arg->channel_number,
- hdr->band);
+ hdr->freq = ieee80211_channel_to_frequency(arg->channel_number, hdr->band);

if (arg->rxed_rate >= 14) {
hdr->encoding = RX_ENC_HT;
diff --git a/drivers/staging/wfx/data_rx.h b/drivers/staging/wfx/data_rx.h
index 7d77cdbbc31b..cf708f16d602 100644
--- a/drivers/staging/wfx/data_rx.h
+++ b/drivers/staging/wfx/data_rx.h
@@ -12,7 +12,6 @@ struct wfx_vif;
struct sk_buff;
struct wfx_hif_ind_rx;

-void wfx_rx_cb(struct wfx_vif *wvif,
- const struct wfx_hif_ind_rx *arg, struct sk_buff *skb);
+void wfx_rx_cb(struct wfx_vif *wvif, const struct wfx_hif_ind_rx *arg, struct sk_buff *skb);

#endif
diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c
index fec30d773e62..0bfbf57cc035 100644
--- a/drivers/staging/wfx/data_tx.c
+++ b/drivers/staging/wfx/data_tx.c
@@ -17,8 +17,7 @@
#include "traces.h"
#include "hif_tx_mib.h"

-static int wfx_get_hw_rate(struct wfx_dev *wdev,
- const struct ieee80211_tx_rate *rate)
+static int wfx_get_hw_rate(struct wfx_dev *wdev, const struct ieee80211_tx_rate *rate)
{
struct ieee80211_supported_band *band;

@@ -66,14 +65,12 @@ static void wfx_tx_policy_build(struct wfx_vif *wvif, struct wfx_tx_policy *poli
}
}

-static bool wfx_tx_policy_is_equal(const struct wfx_tx_policy *a,
- const struct wfx_tx_policy *b)
+static bool wfx_tx_policy_is_equal(const struct wfx_tx_policy *a, const struct wfx_tx_policy *b)
{
return !memcmp(a->rates, b->rates, sizeof(a->rates));
}

-static int wfx_tx_policy_find(struct wfx_tx_policy_cache *cache,
- struct wfx_tx_policy *wanted)
+static int wfx_tx_policy_find(struct wfx_tx_policy_cache *cache, struct wfx_tx_policy *wanted)
{
struct wfx_tx_policy *it;

@@ -86,15 +83,13 @@ static int wfx_tx_policy_find(struct wfx_tx_policy_cache *cache,
return -1;
}

-static void wfx_tx_policy_use(struct wfx_tx_policy_cache *cache,
- struct wfx_tx_policy *entry)
+static void wfx_tx_policy_use(struct wfx_tx_policy_cache *cache, struct wfx_tx_policy *entry)
{
++entry->usage_count;
list_move(&entry->link, &cache->used);
}

-static int wfx_tx_policy_release(struct wfx_tx_policy_cache *cache,
- struct wfx_tx_policy *entry)
+static int wfx_tx_policy_release(struct wfx_tx_policy_cache *cache, struct wfx_tx_policy *entry)
{
int ret = --entry->usage_count;

@@ -103,8 +98,7 @@ static int wfx_tx_policy_release(struct wfx_tx_policy_cache *cache,
return ret;
}

-static int wfx_tx_policy_get(struct wfx_vif *wvif,
- struct ieee80211_tx_rate *rates, bool *renew)
+static int wfx_tx_policy_get(struct wfx_vif *wvif, struct ieee80211_tx_rate *rates, bool *renew)
{
int idx;
struct wfx_tx_policy_cache *cache = &wvif->tx_policy_cache;
@@ -164,8 +158,7 @@ static int wfx_tx_policy_upload(struct wfx_vif *wvif)
do {
spin_lock_bh(&wvif->tx_policy_cache.lock);
for (i = 0; i < ARRAY_SIZE(wvif->tx_policy_cache.cache); ++i) {
- is_used = memzcmp(policies[i].rates,
- sizeof(policies[i].rates));
+ is_used = memzcmp(policies[i].rates, sizeof(policies[i].rates));
if (!policies[i].uploaded && is_used)
break;
}
@@ -183,8 +176,7 @@ static int wfx_tx_policy_upload(struct wfx_vif *wvif)

void wfx_tx_policy_upload_work(struct work_struct *work)
{
- struct wfx_vif *wvif =
- container_of(work, struct wfx_vif, tx_policy_upload_work);
+ struct wfx_vif *wvif = container_of(work, struct wfx_vif, tx_policy_upload_work);

wfx_tx_policy_upload(wvif);
wfx_tx_unlock(wvif->wdev);
@@ -221,8 +213,7 @@ static bool wfx_is_action_back(struct ieee80211_hdr *hdr)
static u8 wfx_tx_get_link_id(struct wfx_vif *wvif, struct ieee80211_sta *sta,
struct ieee80211_hdr *hdr)
{
- struct wfx_sta_priv *sta_priv =
- sta ? (struct wfx_sta_priv *)&sta->drv_priv : NULL;
+ struct wfx_sta_priv *sta_priv = sta ? (struct wfx_sta_priv *)&sta->drv_priv : NULL;
const u8 *da = ieee80211_get_DA(hdr);

if (sta_priv && sta_priv->link_id)
@@ -276,8 +267,7 @@ static void wfx_tx_fixup_rates(struct ieee80211_tx_rate *rates)
if (rates[i].idx == -1) {
rates[i].idx = 0;
rates[i].count = 8; /* == hw->max_rate_tries */
- rates[i].flags = rates[i - 1].flags &
- IEEE80211_TX_RC_MCS;
+ rates[i].flags = rates[i - 1].flags & IEEE80211_TX_RC_MCS;
break;
}
}
@@ -286,8 +276,7 @@ static void wfx_tx_fixup_rates(struct ieee80211_tx_rate *rates)
rates[i].flags &= ~IEEE80211_TX_RC_SHORT_GI;
}

-static u8 wfx_tx_get_retry_policy_id(struct wfx_vif *wvif,
- struct ieee80211_tx_info *tx_info)
+static u8 wfx_tx_get_retry_policy_id(struct wfx_vif *wvif, struct ieee80211_tx_info *tx_info)
{
bool tx_policy_renew = false;
u8 ret;
@@ -326,8 +315,7 @@ static int wfx_tx_get_icv_len(struct ieee80211_key_conf *hw_key)
return hw_key->icv_len + mic_space;
}

-static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta,
- struct sk_buff *skb)
+static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta, struct sk_buff *skb)
{
struct wfx_hif_msg *hif_msg;
struct wfx_hif_req_tx *req;
@@ -337,8 +325,7 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta,
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
int queue_id = skb_get_queue_mapping(skb);
size_t offset = (size_t)skb->data & 3;
- int wmsg_len = sizeof(struct wfx_hif_msg) +
- sizeof(struct wfx_hif_req_tx) + offset;
+ int wmsg_len = sizeof(struct wfx_hif_msg) + sizeof(struct wfx_hif_req_tx) + offset;

WARN(queue_id >= IEEE80211_NUM_ACS, "unsupported queue_id");
wfx_tx_fixup_rates(tx_info->driver_rates);
@@ -396,16 +383,14 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta,
return 0;
}

-void wfx_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control,
- struct sk_buff *skb)
+void wfx_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control, struct sk_buff *skb)
{
struct wfx_dev *wdev = hw->priv;
struct wfx_vif *wvif;
struct ieee80211_sta *sta = control ? control->sta : NULL;
struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
- size_t driver_data_room = sizeof_field(struct ieee80211_tx_info,
- rate_driver_data);
+ size_t driver_data_room = sizeof_field(struct ieee80211_tx_info, rate_driver_data);

compiletime_assert(sizeof(struct wfx_tx_priv) <= driver_data_room,
"struct tx_priv is too large");
@@ -437,8 +422,7 @@ static void wfx_skb_dtor(struct wfx_vif *wvif, struct sk_buff *skb)
{
struct wfx_hif_msg *hif = (struct wfx_hif_msg *)skb->data;
struct wfx_hif_req_tx *req = (struct wfx_hif_req_tx *)hif->body;
- unsigned int offset = sizeof(struct wfx_hif_msg) +
- sizeof(struct wfx_hif_req_tx) +
+ unsigned int offset = sizeof(struct wfx_hif_msg) + sizeof(struct wfx_hif_req_tx) +
req->fc_offset;

if (!wvif) {
@@ -450,8 +434,7 @@ static void wfx_skb_dtor(struct wfx_vif *wvif, struct sk_buff *skb)
ieee80211_tx_status_irqsafe(wvif->wdev->hw, skb);
}

-static void wfx_tx_fill_rates(struct wfx_dev *wdev,
- struct ieee80211_tx_info *tx_info,
+static void wfx_tx_fill_rates(struct wfx_dev *wdev, struct ieee80211_tx_info *tx_info,
const struct wfx_hif_cnf_tx *arg)
{
struct ieee80211_tx_rate *rate;
@@ -465,8 +448,7 @@ static void wfx_tx_fill_rates(struct wfx_dev *wdev,
rate = &tx_info->status.rates[i];
if (rate->idx < 0)
break;
- if (tx_count < rate->count &&
- arg->status == HIF_STATUS_TX_FAIL_RETRIES &&
+ if (tx_count < rate->count && arg->status == HIF_STATUS_TX_FAIL_RETRIES &&
arg->ack_failures)
dev_dbg(wdev->dev, "all retries were not consumed: %d != %d\n",
rate->count, tx_count);
@@ -521,9 +503,8 @@ void wfx_tx_confirm_cb(struct wfx_dev *wdev, const struct wfx_hif_cnf_tx *arg)
memset(tx_info->pad, 0, sizeof(tx_info->pad));

if (!arg->status) {
- tx_info->status.tx_time =
- le32_to_cpu(arg->media_delay) -
- le32_to_cpu(arg->tx_queue_delay);
+ tx_info->status.tx_time = le32_to_cpu(arg->media_delay) -
+ le32_to_cpu(arg->tx_queue_delay);
if (tx_info->flags & IEEE80211_TX_CTL_NO_ACK)
tx_info->flags |= IEEE80211_TX_STAT_NOACK_TRANSMITTED;
else
@@ -539,8 +520,7 @@ void wfx_tx_confirm_cb(struct wfx_dev *wdev, const struct wfx_hif_cnf_tx *arg)
wfx_skb_dtor(wvif, skb);
}

-static void wfx_flush_vif(struct wfx_vif *wvif, u32 queues,
- struct sk_buff_head *dropped)
+static void wfx_flush_vif(struct wfx_vif *wvif, u32 queues, struct sk_buff_head *dropped)
{
struct wfx_queue *queue;
int i;
@@ -558,16 +538,13 @@ static void wfx_flush_vif(struct wfx_vif *wvif, u32 queues,
if (!(BIT(i) & queues))
continue;
queue = &wvif->tx_queue[i];
- if (wait_event_timeout(wvif->wdev->tx_dequeue,
- wfx_tx_queue_empty(wvif, queue),
+ if (wait_event_timeout(wvif->wdev->tx_dequeue, wfx_tx_queue_empty(wvif, queue),
msecs_to_jiffies(1000)) <= 0)
- dev_warn(wvif->wdev->dev,
- "frames queued while flushing tx queues?");
+ dev_warn(wvif->wdev->dev, "frames queued while flushing tx queues?");
}
}

-void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
- u32 queues, bool drop)
+void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u32 queues, bool drop)
{
struct wfx_dev *wdev = hw->priv;
struct sk_buff_head dropped;
diff --git a/drivers/staging/wfx/data_tx.h b/drivers/staging/wfx/data_tx.h
index 040f731e62ae..983470705e4b 100644
--- a/drivers/staging/wfx/data_tx.h
+++ b/drivers/staging/wfx/data_tx.h
@@ -41,11 +41,9 @@ struct wfx_tx_priv {
void wfx_tx_policy_init(struct wfx_vif *wvif);
void wfx_tx_policy_upload_work(struct work_struct *work);

-void wfx_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control,
- struct sk_buff *skb);
+void wfx_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control, struct sk_buff *skb);
void wfx_tx_confirm_cb(struct wfx_dev *wdev, const struct wfx_hif_cnf_tx *arg);
-void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
- u32 queues, bool drop);
+void wfx_flush(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u32 queues, bool drop);

static inline struct wfx_tx_priv *wfx_skb_tx_priv(struct sk_buff *skb)
{
diff --git a/drivers/staging/wfx/debug.c b/drivers/staging/wfx/debug.c
index f0796eb2afff..210e2336d43a 100644
--- a/drivers/staging/wfx/debug.c
+++ b/drivers/staging/wfx/debug.c
@@ -31,8 +31,7 @@ static const struct trace_print_flags wfx_reg_print_map[] = {
wfx_reg_list,
};

-static const char *get_symbol(unsigned long val,
- const struct trace_print_flags *symbol_array)
+static const char *get_symbol(unsigned long val, const struct trace_print_flags *symbol_array)
{
int i;

@@ -73,8 +72,7 @@ static int wfx_counters_show(struct seq_file *seq, void *v)
return -EIO;
}

- seq_printf(seq, "%-24s %12s %12s %12s\n",
- "", "global", "iface 0", "iface 1");
+ seq_printf(seq, "%-24s %12s %12s %12s\n", "", "global", "iface 0", "iface 1");

#define PUT_COUNTER(name) \
seq_printf(seq, "%-24s %12d %12d %12d\n", #name, \
@@ -159,10 +157,8 @@ static int wfx_rx_stats_show(struct seq_file *seq, void *v)
mutex_lock(&wdev->rx_stats_lock);
seq_printf(seq, "Timestamp: %dus\n", st->date);
seq_printf(seq, "Low power clock: frequency %uHz, external %s\n",
- le32_to_cpu(st->pwr_clk_freq),
- st->is_ext_pwr_clk ? "yes" : "no");
- seq_printf(seq,
- "Num. of frames: %d, PER (x10e4): %d, Throughput: %dKbps/s\n",
+ le32_to_cpu(st->pwr_clk_freq), st->is_ext_pwr_clk ? "yes" : "no");
+ seq_printf(seq, "Num. of frames: %d, PER (x10e4): %d, Throughput: %dKbps/s\n",
st->nb_rx_frame, st->per_total, st->throughput);
seq_puts(seq, " Num. of PER RSSI SNR CFO\n");
seq_puts(seq, " frames (x10e4) (dBm) (dB) (kHz)\n");
@@ -206,8 +202,7 @@ static int wfx_tx_power_loop_show(struct seq_file *seq, void *v)
}
DEFINE_SHOW_ATTRIBUTE(wfx_tx_power_loop);

-static ssize_t wfx_send_pds_write(struct file *file,
- const char __user *user_buf,
+static ssize_t wfx_send_pds_write(struct file *file, const char __user *user_buf,
size_t count, loff_t *ppos)
{
struct wfx_dev *wdev = file->private_data;
@@ -241,8 +236,7 @@ struct dbgfs_hif_msg {
int ret;
};

-static ssize_t wfx_send_hif_msg_write(struct file *file,
- const char __user *user_buf,
+static ssize_t wfx_send_hif_msg_write(struct file *file, const char __user *user_buf,
size_t count, loff_t *ppos)
{
struct dbgfs_hif_msg *context = file->private_data;
@@ -268,8 +262,7 @@ static ssize_t wfx_send_hif_msg_write(struct file *file,
kfree(request);
return -EINVAL;
}
- context->ret = wfx_cmd_send(wdev, request, context->reply,
- sizeof(context->reply), false);
+ context->ret = wfx_cmd_send(wdev, request, context->reply, sizeof(context->reply), false);

kfree(request);
complete(&context->complete);
@@ -354,11 +347,9 @@ int wfx_debug_init(struct wfx_dev *wdev)
d = debugfs_create_dir("wfx", wdev->hw->wiphy->debugfsdir);
debugfs_create_file("counters", 0444, d, wdev, &wfx_counters_fops);
debugfs_create_file("rx_stats", 0444, d, wdev, &wfx_rx_stats_fops);
- debugfs_create_file("tx_power_loop", 0444, d, wdev,
- &wfx_tx_power_loop_fops);
+ debugfs_create_file("tx_power_loop", 0444, d, wdev, &wfx_tx_power_loop_fops);
debugfs_create_file("send_pds", 0200, d, wdev, &wfx_send_pds_fops);
- debugfs_create_file("send_hif_msg", 0600, d, wdev,
- &wfx_send_hif_msg_fops);
+ debugfs_create_file("send_hif_msg", 0600, d, wdev, &wfx_send_hif_msg_fops);
debugfs_create_file("ps_timeout", 0600, d, wdev, &wfx_ps_timeout_fops);

return 0;
diff --git a/drivers/staging/wfx/fwio.c b/drivers/staging/wfx/fwio.c
index c9a54c519e8a..89a46fb0e789 100644
--- a/drivers/staging/wfx/fwio.c
+++ b/drivers/staging/wfx/fwio.c
@@ -79,8 +79,7 @@ static const char * const fwio_errors[] = {
* NOTE: it may also be possible to use 'pages' from struct firmware and avoid
* bounce buffer
*/
-static int wfx_sram_write_dma_safe(struct wfx_dev *wdev, u32 addr,
- const u8 *buf, size_t len)
+static int wfx_sram_write_dma_safe(struct wfx_dev *wdev, u32 addr, const u8 *buf, size_t len)
{
int ret;
const u8 *tmp;
@@ -112,8 +111,7 @@ static int get_firmware(struct wfx_dev *wdev, u32 keyset_chip,
if (ret) {
dev_info(wdev->dev, "can't load %s, falling back to %s.sec\n",
filename, wdev->pdata.file_fw);
- snprintf(filename, sizeof(filename), "%s.sec",
- wdev->pdata.file_fw);
+ snprintf(filename, sizeof(filename), "%s.sec", wdev->pdata.file_fw);
ret = request_firmware(fw, filename, wdev->dev);
if (ret) {
dev_err(wdev->dev, "can't load %s\n", filename);
@@ -166,8 +164,7 @@ static int wait_ncp_status(struct wfx_dev *wdev, u32 status)
return -ETIMEDOUT;
}
if (ktime_compare(now, start))
- dev_dbg(wdev->dev, "chip answer after %lldus\n",
- ktime_us_delta(now, start));
+ dev_dbg(wdev->dev, "chip answer after %lldus\n", ktime_us_delta(now, start));
else
dev_dbg(wdev->dev, "chip answer immediately\n");
return 0;
@@ -200,8 +197,7 @@ static int upload_firmware(struct wfx_dev *wdev, const u8 *data, size_t len)
dev_dbg(wdev->dev, "answer after %lldus\n",
ktime_us_delta(now, start));

- ret = wfx_sram_write_dma_safe(wdev,
- WFX_DNLD_FIFO + (offs % DNLD_FIFO_SIZE),
+ ret = wfx_sram_write_dma_safe(wdev, WFX_DNLD_FIFO + (offs % DNLD_FIFO_SIZE),
data + offs, DNLD_BLOCK_SIZE);
if (ret < 0)
return ret;
@@ -266,12 +262,10 @@ static int load_firmware_secure(struct wfx_dev *wdev)
goto error;

wfx_sram_reg_write(wdev, WFX_DNLD_FIFO, 0xFFFFFFFF); /* Fifo init */
- wfx_sram_write_dma_safe(wdev, WFX_DCA_FW_VERSION, "\x01\x00\x00\x00",
- FW_VERSION_SIZE);
+ wfx_sram_write_dma_safe(wdev, WFX_DCA_FW_VERSION, "\x01\x00\x00\x00", FW_VERSION_SIZE);
wfx_sram_write_dma_safe(wdev, WFX_DCA_FW_SIGNATURE, fw->data + fw_offset,
FW_SIGNATURE_SIZE);
- wfx_sram_write_dma_safe(wdev, WFX_DCA_FW_HASH,
- fw->data + fw_offset + FW_SIGNATURE_SIZE,
+ wfx_sram_write_dma_safe(wdev, WFX_DCA_FW_HASH, fw->data + fw_offset + FW_SIGNATURE_SIZE,
FW_HASH_SIZE);
wfx_sram_reg_write(wdev, WFX_DCA_IMAGE_SIZE, fw->size - header_size);
wfx_sram_reg_write(wdev, WFX_DCA_HOST_STATUS, HOST_UPLOAD_PENDING);
@@ -280,8 +274,7 @@ static int load_firmware_secure(struct wfx_dev *wdev)
goto error;

start = ktime_get();
- ret = upload_firmware(wdev, fw->data + header_size,
- fw->size - header_size);
+ ret = upload_firmware(wdev, fw->data + header_size, fw->size - header_size);
if (ret)
goto error;
dev_dbg(wdev->dev, "firmware load after %lldus\n",
@@ -320,12 +313,10 @@ static int init_gpr(struct wfx_dev *wdev)
};

for (i = 0; i < ARRAY_SIZE(gpr_init); i++) {
- ret = wfx_igpr_reg_write(wdev, gpr_init[i].index,
- gpr_init[i].value);
+ ret = wfx_igpr_reg_write(wdev, gpr_init[i].index, gpr_init[i].value);
if (ret < 0)
return ret;
- dev_dbg(wdev->dev, " index %02x: %08x\n",
- gpr_init[i].index, gpr_init[i].value);
+ dev_dbg(wdev->dev, " index %02x: %08x\n", gpr_init[i].index, gpr_init[i].value);
}
return 0;
}
@@ -360,8 +351,7 @@ int wfx_init_device(struct wfx_dev *wdev)

hw_revision = FIELD_GET(CFG_DEVICE_ID_MAJOR, reg);
if (hw_revision == 0) {
- dev_err(wdev->dev, "bad hardware revision number: %d\n",
- hw_revision);
+ dev_err(wdev->dev, "bad hardware revision number: %d\n", hw_revision);
return -ENODEV;
}
hw_type = FIELD_GET(CFG_DEVICE_ID_TYPE, reg);
@@ -388,8 +378,7 @@ int wfx_init_device(struct wfx_dev *wdev)
return -ETIMEDOUT;
}
}
- dev_dbg(wdev->dev, "chip wake up after %lldus\n",
- ktime_us_delta(now, start));
+ dev_dbg(wdev->dev, "chip wake up after %lldus\n", ktime_us_delta(now, start));

ret = wfx_config_reg_write_bits(wdev, CFG_CPU_RESET, 0);
if (ret < 0)
diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/staging/wfx/hif_rx.c
index 2073ac43bebd..1ddf8c51c303 100644
--- a/drivers/staging/wfx/hif_rx.c
+++ b/drivers/staging/wfx/hif_rx.c
@@ -32,8 +32,7 @@ static int wfx_hif_generic_confirm(struct wfx_dev *wdev,
}

if (cmd != wdev->hif_cmd.buf_send->id) {
- dev_warn(wdev->dev,
- "chip response mismatch request: 0x%.2x vs 0x%.2x\n",
+ dev_warn(wdev->dev, "chip response mismatch request: 0x%.2x vs 0x%.2x\n",
cmd, wdev->hif_cmd.buf_send->id);
return -EINVAL;
}
@@ -72,8 +71,7 @@ static int wfx_hif_multi_tx_confirm(struct wfx_dev *wdev,
}

static int wfx_hif_startup_indication(struct wfx_dev *wdev,
- const struct wfx_hif_msg *hif,
- const void *buf)
+ const struct wfx_hif_msg *hif, const void *buf)
{
const struct wfx_hif_ind_startup *body = buf;

@@ -87,19 +85,16 @@ static int wfx_hif_startup_indication(struct wfx_dev *wdev,
}

static int wfx_hif_wakeup_indication(struct wfx_dev *wdev,
- const struct wfx_hif_msg *hif,
- const void *buf)
+ const struct wfx_hif_msg *hif, const void *buf)
{
- if (!wdev->pdata.gpio_wakeup ||
- gpiod_get_value(wdev->pdata.gpio_wakeup) == 0) {
+ if (!wdev->pdata.gpio_wakeup || gpiod_get_value(wdev->pdata.gpio_wakeup) == 0) {
dev_warn(wdev->dev, "unexpected wake-up indication\n");
return -EIO;
}
return 0;
}

-static int wfx_hif_receive_indication(struct wfx_dev *wdev,
- const struct wfx_hif_msg *hif,
+static int wfx_hif_receive_indication(struct wfx_dev *wdev, const struct wfx_hif_msg *hif,
const void *buf, struct sk_buff *skb)
{
struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface);
@@ -144,16 +139,14 @@ static int wfx_hif_event_indication(struct wfx_dev *wdev,
le32_to_cpu(body->event_data.ps_mode_error));
break;
default:
- dev_warn(wdev->dev, "unhandled event indication: %.2x\n",
- type);
+ dev_warn(wdev->dev, "unhandled event indication: %.2x\n", type);
break;
}
return 0;
}

static int wfx_hif_pm_mode_complete_indication(struct wfx_dev *wdev,
- const struct wfx_hif_msg *hif,
- const void *buf)
+ const struct wfx_hif_msg *hif, const void *buf)
{
struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface);

@@ -167,8 +160,7 @@ static int wfx_hif_pm_mode_complete_indication(struct wfx_dev *wdev,
}

static int wfx_hif_scan_complete_indication(struct wfx_dev *wdev,
- const struct wfx_hif_msg *hif,
- const void *buf)
+ const struct wfx_hif_msg *hif, const void *buf)
{
struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface);
const struct wfx_hif_ind_scan_cmpl *body = buf;
@@ -184,8 +176,7 @@ static int wfx_hif_scan_complete_indication(struct wfx_dev *wdev,
}

static int wfx_hif_join_complete_indication(struct wfx_dev *wdev,
- const struct wfx_hif_msg *hif,
- const void *buf)
+ const struct wfx_hif_msg *hif, const void *buf)
{
struct wfx_vif *wvif = wdev_to_wvif(wdev, hif->interface);

@@ -199,8 +190,7 @@ static int wfx_hif_join_complete_indication(struct wfx_dev *wdev,
}

static int wfx_hif_suspend_resume_indication(struct wfx_dev *wdev,
- const struct wfx_hif_msg *hif,
- const void *buf)
+ const struct wfx_hif_msg *hif, const void *buf)
{
const struct wfx_hif_ind_suspend_resume_tx *body = buf;
struct wfx_vif *wvif;
@@ -228,8 +218,7 @@ static int wfx_hif_suspend_resume_indication(struct wfx_dev *wdev,
}

static int wfx_hif_generic_indication(struct wfx_dev *wdev,
- const struct wfx_hif_msg *hif,
- const void *buf)
+ const struct wfx_hif_msg *hif, const void *buf)
{
const struct wfx_hif_ind_generic *body = buf;
int type = le32_to_cpu(body->type);
@@ -246,14 +235,12 @@ static int wfx_hif_generic_indication(struct wfx_dev *wdev,
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);
- memcpy(&wdev->rx_stats, &body->data.rx_stats,
- sizeof(wdev->rx_stats));
+ memcpy(&wdev->rx_stats, &body->data.rx_stats, sizeof(wdev->rx_stats));
mutex_unlock(&wdev->rx_stats_lock);
return 0;
case HIF_GENERIC_INDICATION_TYPE_TX_POWER_LOOP_INFO:
mutex_lock(&wdev->tx_power_loop_info_lock);
- memcpy(&wdev->tx_power_loop_info,
- &body->data.tx_power_loop_info,
+ memcpy(&wdev->tx_power_loop_info, &body->data.tx_power_loop_info,
sizeof(wdev->tx_power_loop_info));
mutex_unlock(&wdev->tx_power_loop_info_lock);
return 0;
@@ -324,8 +311,7 @@ static int wfx_hif_error_indication(struct wfx_dev *wdev,
dev_err(wdev->dev, "asynchronous error: %s: %d\n",
hif_errors[i].str, param);
else
- dev_err(wdev->dev, "asynchronous error: %s\n",
- hif_errors[i].str);
+ dev_err(wdev->dev, "asynchronous error: %s\n", hif_errors[i].str);
else
dev_err(wdev->dev, "asynchronous error: unknown: %08x\n", type);
print_hex_dump(KERN_INFO, "hif: ", DUMP_PREFIX_OFFSET,
@@ -336,15 +322,13 @@ static int wfx_hif_error_indication(struct wfx_dev *wdev,
};

static int wfx_hif_exception_indication(struct wfx_dev *wdev,
- const struct wfx_hif_msg *hif,
- const void *buf)
+ const struct wfx_hif_msg *hif, const void *buf)
{
const struct wfx_hif_ind_exception *body = buf;
int type = le32_to_cpu(body->type);

if (type == 4)
- dev_err(wdev->dev, "firmware assert %d\n",
- le32_to_cpup((__le32 *)body->data));
+ dev_err(wdev->dev, "firmware assert %d\n", le32_to_cpup((__le32 *)body->data));
else
dev_err(wdev->dev, "firmware exception\n");
print_hex_dump(KERN_INFO, "hif: ", DUMP_PREFIX_OFFSET,
@@ -356,8 +340,7 @@ static int wfx_hif_exception_indication(struct wfx_dev *wdev,

static const struct {
int msg_id;
- int (*handler)(struct wfx_dev *wdev,
- const struct wfx_hif_msg *hif, const void *buf);
+ int (*handler)(struct wfx_dev *wdev, const struct wfx_hif_msg *hif, const void *buf);
} hif_handlers[] = {
/* Confirmations */
{ HIF_CNF_ID_TX, wfx_hif_tx_confirm },
@@ -392,8 +375,7 @@ void wfx_handle_rx(struct wfx_dev *wdev, struct sk_buff *skb)
* buf_send
*/
if (mutex_is_locked(&wdev->hif_cmd.lock) &&
- wdev->hif_cmd.buf_send &&
- wdev->hif_cmd.buf_send->id == hif_id) {
+ wdev->hif_cmd.buf_send && wdev->hif_cmd.buf_send->id == hif_id) {
wfx_hif_generic_confirm(wdev, hif, hif->body);
goto free;
}
@@ -405,11 +387,9 @@ void wfx_handle_rx(struct wfx_dev *wdev, struct sk_buff *skb)
}
}
if (hif_id & HIF_ID_IS_INDICATION)
- dev_err(wdev->dev, "unsupported HIF indication: ID %02x\n",
- hif_id);
+ dev_err(wdev->dev, "unsupported HIF indication: ID %02x\n", hif_id);
else
- dev_err(wdev->dev, "unexpected HIF confirmation: ID %02x\n",
- hif_id);
+ dev_err(wdev->dev, "unexpected HIF confirmation: ID %02x\n", hif_id);
free:
dev_kfree_skb(skb);
}
diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c
index 429c70b991e1..b88a73077b48 100644
--- a/drivers/staging/wfx/hif_tx.c
+++ b/drivers/staging/wfx/hif_tx.c
@@ -22,8 +22,7 @@ void wfx_init_hif_cmd(struct wfx_hif_cmd *hif_cmd)
mutex_init(&hif_cmd->lock);
}

-static void wfx_fill_header(struct wfx_hif_msg *hif, int if_id,
- unsigned int cmd, size_t size)
+static void wfx_fill_header(struct wfx_hif_msg *hif, int if_id, unsigned int cmd, size_t size)
{
if (if_id == -1)
if_id = 2;
@@ -190,14 +189,12 @@ int wfx_hif_read_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id,
ret = wfx_cmd_send(wdev, hif, reply, buf_len, false);

if (!ret && mib_id != le16_to_cpu(reply->mib_id)) {
- dev_warn(wdev->dev, "%s: confirmation mismatch request\n",
- __func__);
+ dev_warn(wdev->dev, "%s: confirmation mismatch request\n", __func__);
ret = -EIO;
}
if (ret == -ENOMEM)
dev_err(wdev->dev, "buffer is too small to receive %s (%zu < %d)\n",
- wfx_get_mib_name(mib_id), val_len,
- le16_to_cpu(reply->length));
+ wfx_get_mib_name(mib_id), val_len, le16_to_cpu(reply->length));
if (!ret)
memcpy(val, &reply->mib_data, le16_to_cpu(reply->length));
else
@@ -208,8 +205,7 @@ int wfx_hif_read_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id,
return ret;
}

-int wfx_hif_write_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id,
- void *val, size_t val_len)
+int wfx_hif_write_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id, void *val, size_t val_len)
{
int ret;
struct wfx_hif_msg *hif;
@@ -232,8 +228,7 @@ int wfx_hif_scan(struct wfx_vif *wvif, struct cfg80211_scan_request *req,
{
int ret, i;
struct wfx_hif_msg *hif;
- size_t buf_len = sizeof(struct wfx_hif_req_start_scan_alt) +
- chan_num * sizeof(u8);
+ size_t buf_len = sizeof(struct wfx_hif_req_start_scan_alt) + chan_num * sizeof(u8);
struct wfx_hif_req_start_scan_alt *body = wfx_alloc_hif(buf_len, &hif);

WARN(chan_num > HIF_API_MAX_NB_CHANNELS, "invalid params");
@@ -242,20 +237,16 @@ int wfx_hif_scan(struct wfx_vif *wvif, struct cfg80211_scan_request *req,
if (!hif)
return -ENOMEM;
for (i = 0; i < req->n_ssids; i++) {
- memcpy(body->ssid_def[i].ssid, req->ssids[i].ssid,
- IEEE80211_MAX_SSID_LEN);
- body->ssid_def[i].ssid_length =
- cpu_to_le32(req->ssids[i].ssid_len);
+ memcpy(body->ssid_def[i].ssid, req->ssids[i].ssid, IEEE80211_MAX_SSID_LEN);
+ body->ssid_def[i].ssid_length = cpu_to_le32(req->ssids[i].ssid_len);
}
body->num_of_ssids = HIF_API_MAX_NB_SSIDS;
body->maintain_current_bss = 1;
body->disallow_ps = 1;
- body->tx_power_level =
- cpu_to_le32(req->channels[chan_start_idx]->max_power);
+ body->tx_power_level = cpu_to_le32(req->channels[chan_start_idx]->max_power);
body->num_of_channels = chan_num;
for (i = 0; i < chan_num; i++)
- body->channel_list[i] =
- req->channels[i + chan_start_idx]->hw_value;
+ body->channel_list[i] = req->channels[i + chan_start_idx]->hw_value;
if (req->no_cck)
body->max_transmit_rate = API_RATE_INDEX_G_6MBPS;
else
@@ -309,8 +300,7 @@ int wfx_hif_join(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf,
body->probe_for_join = !(channel->flags & IEEE80211_CHAN_NO_IR);
body->channel_number = channel->hw_value;
body->beacon_interval = cpu_to_le32(conf->beacon_int);
- body->basic_rate_set =
- cpu_to_le32(wfx_rate_mask_to_hw(wvif->wdev, conf->basic_rates));
+ body->basic_rate_set = cpu_to_le32(wfx_rate_mask_to_hw(wvif->wdev, conf->basic_rates));
memcpy(body->bssid, conf->bssid, sizeof(body->bssid));
if (ssid) {
body->ssid_length = cpu_to_le32(ssidlen);
@@ -326,15 +316,13 @@ int wfx_hif_set_bss_params(struct wfx_vif *wvif, int aid, int beacon_lost_count)
{
int ret;
struct wfx_hif_msg *hif;
- struct wfx_hif_req_set_bss_params *body = wfx_alloc_hif(sizeof(*body),
- &hif);
+ struct wfx_hif_req_set_bss_params *body = wfx_alloc_hif(sizeof(*body), &hif);

if (!hif)
return -ENOMEM;
body->aid = cpu_to_le16(aid);
body->beacon_lost_count = beacon_lost_count;
- wfx_fill_header(hif, wvif->id, HIF_REQ_ID_SET_BSS_PARAMS,
- sizeof(*body));
+ wfx_fill_header(hif, wvif->id, HIF_REQ_ID_SET_BSS_PARAMS, sizeof(*body));
ret = wfx_cmd_send(wvif->wdev, hif, NULL, 0, false);
kfree(hif);
return ret;
@@ -355,8 +343,7 @@ int wfx_hif_add_key(struct wfx_dev *wdev, const struct wfx_hif_req_add_key *arg)
/* Legacy firmwares expect that add_key to be sent on right
* interface.
*/
- wfx_fill_header(hif, arg->int_id, HIF_REQ_ID_ADD_KEY,
- sizeof(*body));
+ wfx_fill_header(hif, arg->int_id, HIF_REQ_ID_ADD_KEY, sizeof(*body));
else
wfx_fill_header(hif, -1, HIF_REQ_ID_ADD_KEY, sizeof(*body));
ret = wfx_cmd_send(wdev, hif, NULL, 0, false);
@@ -384,8 +371,7 @@ int wfx_hif_set_edca_queue_params(struct wfx_vif *wvif, u16 queue,
{
int ret;
struct wfx_hif_msg *hif;
- struct wfx_hif_req_edca_queue_params *body = wfx_alloc_hif(sizeof(*body),
- &hif);
+ struct wfx_hif_req_edca_queue_params *body = wfx_alloc_hif(sizeof(*body), &hif);

if (!body)
return -ENOMEM;
@@ -403,8 +389,7 @@ int wfx_hif_set_edca_queue_params(struct wfx_vif *wvif, u16 queue,
body->queue_id = HIF_QUEUE_ID_BACKGROUND;
if (wfx_api_older_than(wvif->wdev, 2, 0) && queue == IEEE80211_AC_BK)
body->queue_id = HIF_QUEUE_ID_BESTEFFORT;
- wfx_fill_header(hif, wvif->id, HIF_REQ_ID_EDCA_QUEUE_PARAMS,
- sizeof(*body));
+ wfx_fill_header(hif, wvif->id, HIF_REQ_ID_EDCA_QUEUE_PARAMS, sizeof(*body));
ret = wfx_cmd_send(wvif->wdev, hif, NULL, 0, false);
kfree(hif);
return ret;
@@ -414,8 +399,7 @@ int wfx_hif_set_pm(struct wfx_vif *wvif, bool ps, int dynamic_ps_timeout)
{
int ret;
struct wfx_hif_msg *hif;
- struct wfx_hif_req_set_pm_mode *body = wfx_alloc_hif(sizeof(*body),
- &hif);
+ struct wfx_hif_req_set_pm_mode *body = wfx_alloc_hif(sizeof(*body), &hif);

if (!body)
return -ENOMEM;
@@ -449,8 +433,7 @@ int wfx_hif_start(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf,
body->short_preamble = conf->use_short_preamble;
body->channel_number = channel->hw_value;
body->beacon_interval = cpu_to_le32(conf->beacon_int);
- body->basic_rate_set =
- cpu_to_le32(wfx_rate_mask_to_hw(wvif->wdev, conf->basic_rates));
+ body->basic_rate_set = cpu_to_le32(wfx_rate_mask_to_hw(wvif->wdev, conf->basic_rates));
body->ssid_length = conf->ssid_len;
memcpy(body->ssid, conf->ssid, conf->ssid_len);
wfx_fill_header(hif, wvif->id, HIF_REQ_ID_START, sizeof(*body));
@@ -463,21 +446,18 @@ int wfx_hif_beacon_transmit(struct wfx_vif *wvif, bool enable)
{
int ret;
struct wfx_hif_msg *hif;
- struct wfx_hif_req_beacon_transmit *body = wfx_alloc_hif(sizeof(*body),
- &hif);
+ struct wfx_hif_req_beacon_transmit *body = wfx_alloc_hif(sizeof(*body), &hif);

if (!hif)
return -ENOMEM;
body->enable_beaconing = enable ? 1 : 0;
- wfx_fill_header(hif, wvif->id, HIF_REQ_ID_BEACON_TRANSMIT,
- sizeof(*body));
+ wfx_fill_header(hif, wvif->id, HIF_REQ_ID_BEACON_TRANSMIT, sizeof(*body));
ret = wfx_cmd_send(wvif->wdev, hif, NULL, 0, false);
kfree(hif);
return ret;
}

-int wfx_hif_map_link(struct wfx_vif *wvif, bool unmap, u8 *mac_addr, int sta_id,
- bool mfp)
+int wfx_hif_map_link(struct wfx_vif *wvif, bool unmap, u8 *mac_addr, int sta_id, bool mfp)
{
int ret;
struct wfx_hif_msg *hif;
@@ -496,8 +476,7 @@ int wfx_hif_map_link(struct wfx_vif *wvif, bool unmap, u8 *mac_addr, int sta_id,
return ret;
}

-int wfx_hif_update_ie_beacon(struct wfx_vif *wvif,
- const u8 *ies, size_t ies_len)
+int wfx_hif_update_ie_beacon(struct wfx_vif *wvif, const u8 *ies, size_t ies_len)
{
int ret;
struct wfx_hif_msg *hif;
diff --git a/drivers/staging/wfx/hif_tx.h b/drivers/staging/wfx/hif_tx.h
index 36caffa4d1eb..71817a6571f0 100644
--- a/drivers/staging/wfx/hif_tx.h
+++ b/drivers/staging/wfx/hif_tx.h
@@ -36,17 +36,14 @@ void wfx_init_hif_cmd(struct wfx_hif_cmd *wfx_hif_cmd);
int wfx_cmd_send(struct wfx_dev *wdev, struct wfx_hif_msg *request,
void *reply, size_t reply_len, bool async);

-int wfx_hif_read_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id,
- void *buf, size_t buf_size);
-int wfx_hif_write_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id,
- void *buf, size_t buf_size);
+int wfx_hif_read_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id, void *buf, size_t buf_size);
+int wfx_hif_write_mib(struct wfx_dev *wdev, int vif_id, u16 mib_id, void *buf, size_t buf_size);
int wfx_hif_start(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf,
const struct ieee80211_channel *channel);
int wfx_hif_reset(struct wfx_vif *wvif, bool reset_stat);
int wfx_hif_join(struct wfx_vif *wvif, const struct ieee80211_bss_conf *conf,
struct ieee80211_channel *channel, const u8 *ssid, int ssidlen);
-int wfx_hif_map_link(struct wfx_vif *wvif,
- bool unmap, u8 *mac_addr, int sta_id, bool mfp);
+int wfx_hif_map_link(struct wfx_vif *wvif, bool unmap, u8 *mac_addr, int sta_id, bool mfp);
int wfx_hif_add_key(struct wfx_dev *wdev, const struct wfx_hif_req_add_key *arg);
int wfx_hif_remove_key(struct wfx_dev *wdev, int idx);
int wfx_hif_set_pm(struct wfx_vif *wvif, bool ps, int dynamic_ps_timeout);
diff --git a/drivers/staging/wfx/hif_tx_mib.c b/drivers/staging/wfx/hif_tx_mib.c
index daf966693f67..1c57dd2b697c 100644
--- a/drivers/staging/wfx/hif_tx_mib.c
+++ b/drivers/staging/wfx/hif_tx_mib.c
@@ -20,14 +20,12 @@ int wfx_hif_set_output_power(struct wfx_vif *wvif, int val)
.power_level = cpu_to_le32(val * 10),
};

- return wfx_hif_write_mib(wvif->wdev, wvif->id,
- HIF_MIB_ID_CURRENT_TX_POWER_LEVEL,
+ return wfx_hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_CURRENT_TX_POWER_LEVEL,
&arg, sizeof(arg));
}

int wfx_hif_set_beacon_wakeup_period(struct wfx_vif *wvif,
- unsigned int dtim_interval,
- unsigned int listen_interval)
+ unsigned int dtim_interval, unsigned int listen_interval)
{
struct wfx_hif_mib_beacon_wake_up_period arg = {
.wakeup_period_min = dtim_interval,
@@ -37,13 +35,11 @@ int wfx_hif_set_beacon_wakeup_period(struct wfx_vif *wvif,

if (dtim_interval > 0xFF || listen_interval > 0xFFFF)
return -EINVAL;
- return wfx_hif_write_mib(wvif->wdev, wvif->id,
- HIF_MIB_ID_BEACON_WAKEUP_PERIOD,
+ return wfx_hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_BEACON_WAKEUP_PERIOD,
&arg, sizeof(arg));
}

-int wfx_hif_set_rcpi_rssi_threshold(struct wfx_vif *wvif,
- int rssi_thold, int rssi_hyst)
+int wfx_hif_set_rcpi_rssi_threshold(struct wfx_vif *wvif, int rssi_thold, int rssi_hyst)
{
struct wfx_hif_mib_rcpi_rssi_threshold arg = {
.rolling_average_count = 8,
@@ -60,8 +56,7 @@ int wfx_hif_set_rcpi_rssi_threshold(struct wfx_vif *wvif,
arg.lower_threshold = (arg.lower_threshold + 110) * 2;
}

- return wfx_hif_write_mib(wvif->wdev, wvif->id,
- HIF_MIB_ID_RCPI_RSSI_THRESHOLD,
+ return wfx_hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_RCPI_RSSI_THRESHOLD,
&arg, sizeof(arg));
}

@@ -74,9 +69,8 @@ int wfx_hif_get_counters_table(struct wfx_dev *wdev, int vif_id,
return wfx_hif_read_mib(wdev, vif_id, HIF_MIB_ID_COUNTERS_TABLE,
arg, sizeof(struct wfx_hif_mib_count_table));
} else {
- return wfx_hif_read_mib(wdev, vif_id,
- HIF_MIB_ID_EXTENDED_COUNTERS_TABLE, arg,
- sizeof(struct wfx_hif_mib_extended_count_table));
+ return wfx_hif_read_mib(wdev, vif_id, HIF_MIB_ID_EXTENDED_COUNTERS_TABLE,
+ arg, sizeof(struct wfx_hif_mib_extended_count_table));
}
}

@@ -86,8 +80,7 @@ int wfx_hif_set_macaddr(struct wfx_vif *wvif, u8 *mac)

if (mac)
ether_addr_copy(arg.mac_addr, mac);
- return wfx_hif_write_mib(wvif->wdev, wvif->id,
- HIF_MIB_ID_DOT11_MAC_ADDRESS,
+ return wfx_hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_DOT11_MAC_ADDRESS,
&arg, sizeof(arg));
}

@@ -100,8 +93,7 @@ int wfx_hif_set_rx_filter(struct wfx_vif *wvif,
arg.bssid_filter = 1;
if (!filter_prbreq)
arg.fwd_probe_req = 1;
- return wfx_hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_RX_FILTER,
- &arg, sizeof(arg));
+ return wfx_hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_RX_FILTER, &arg, sizeof(arg));
}

int wfx_hif_set_beacon_filter_table(struct wfx_vif *wvif, int tbl_len,
@@ -116,26 +108,23 @@ int wfx_hif_set_beacon_filter_table(struct wfx_vif *wvif, int tbl_len,
return -ENOMEM;
arg->num_of_info_elmts = cpu_to_le32(tbl_len);
memcpy(arg->ie_table, tbl, flex_array_size(arg, ie_table, tbl_len));
- ret = wfx_hif_write_mib(wvif->wdev, wvif->id,
- HIF_MIB_ID_BEACON_FILTER_TABLE, arg, buf_len);
+ ret = wfx_hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_BEACON_FILTER_TABLE,
+ arg, buf_len);
kfree(arg);
return ret;
}

-int wfx_hif_beacon_filter_control(struct wfx_vif *wvif,
- int enable, int beacon_count)
+int wfx_hif_beacon_filter_control(struct wfx_vif *wvif, int enable, int beacon_count)
{
struct wfx_hif_mib_bcn_filter_enable arg = {
.enable = cpu_to_le32(enable),
.bcn_count = cpu_to_le32(beacon_count),
};
- return wfx_hif_write_mib(wvif->wdev, wvif->id,
- HIF_MIB_ID_BEACON_FILTER_ENABLE,
+ return wfx_hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_BEACON_FILTER_ENABLE,
&arg, sizeof(arg));
}

-int wfx_hif_set_operational_mode(struct wfx_dev *wdev,
- enum wfx_hif_op_power_mode mode)
+int wfx_hif_set_operational_mode(struct wfx_dev *wdev, enum wfx_hif_op_power_mode mode)
{
struct wfx_hif_mib_gl_operational_power_mode arg = {
.power_mode = mode,
@@ -173,21 +162,18 @@ int wfx_hif_set_mfp(struct wfx_vif *wvif, bool capable, bool required)
}
if (!required)
arg.unpmf_allowed = 1;
- return wfx_hif_write_mib(wvif->wdev, wvif->id,
- HIF_MIB_ID_PROTECTED_MGMT_POLICY,
+ return wfx_hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_PROTECTED_MGMT_POLICY,
&arg, sizeof(arg));
}

-int wfx_hif_set_block_ack_policy(struct wfx_vif *wvif,
- u8 tx_tid_policy, u8 rx_tid_policy)
+int wfx_hif_set_block_ack_policy(struct wfx_vif *wvif, u8 tx_tid_policy, u8 rx_tid_policy)
{
struct wfx_hif_mib_block_ack_policy arg = {
.block_ack_tx_tid_policy = tx_tid_policy,
.block_ack_rx_tid_policy = rx_tid_policy,
};

- return wfx_hif_write_mib(wvif->wdev, wvif->id,
- HIF_MIB_ID_BLOCK_ACK_POLICY,
+ return wfx_hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_BLOCK_ACK_POLICY,
&arg, sizeof(arg));
}

@@ -203,13 +189,11 @@ int wfx_hif_set_association_mode(struct wfx_vif *wvif, int ampdu_density,
.mpdu_start_spacing = ampdu_density,
};

- return wfx_hif_write_mib(wvif->wdev, wvif->id,
- HIF_MIB_ID_SET_ASSOCIATION_MODE,
+ return wfx_hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_SET_ASSOCIATION_MODE,
&arg, sizeof(arg));
}

-int wfx_hif_set_tx_rate_retry_policy(struct wfx_vif *wvif,
- int policy_index, u8 *rates)
+int wfx_hif_set_tx_rate_retry_policy(struct wfx_vif *wvif, int policy_index, u8 *rates)
{
struct wfx_hif_mib_set_tx_rate_retry_policy *arg;
size_t size = struct_size(arg, tx_rate_retry_policy, 1);
@@ -227,8 +211,7 @@ int wfx_hif_set_tx_rate_retry_policy(struct wfx_vif *wvif,
arg->tx_rate_retry_policy[0].count_init = 1;
memcpy(&arg->tx_rate_retry_policy[0].rates, rates,
sizeof(arg->tx_rate_retry_policy[0].rates));
- ret = wfx_hif_write_mib(wvif->wdev, wvif->id,
- HIF_MIB_ID_SET_TX_RATE_RETRY_POLICY,
+ ret = wfx_hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_SET_TX_RATE_RETRY_POLICY,
arg, size);
kfree(arg);
return ret;
@@ -240,8 +223,7 @@ int wfx_hif_keep_alive_period(struct wfx_vif *wvif, int period)
.keep_alive_period = cpu_to_le16(period),
};

- return wfx_hif_write_mib(wvif->wdev, wvif->id,
- HIF_MIB_ID_KEEP_ALIVE_PERIOD,
+ return wfx_hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_KEEP_ALIVE_PERIOD,
&arg, sizeof(arg));
};

@@ -257,8 +239,7 @@ int wfx_hif_set_arp_ipv4_filter(struct wfx_vif *wvif, int idx, __be32 *addr)
memcpy(arg.ipv4_address, addr, sizeof(arg.ipv4_address));
arg.arp_enable = HIF_ARP_NS_FILTERING_ENABLE;
}
- return wfx_hif_write_mib(wvif->wdev, wvif->id,
- HIF_MIB_ID_ARP_IP_ADDRESSES_TABLE,
+ return wfx_hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_ARP_IP_ADDRESSES_TABLE,
&arg, sizeof(arg));
}

@@ -268,8 +249,7 @@ int wfx_hif_use_multi_tx_conf(struct wfx_dev *wdev, bool enable)
.enable_multi_tx_conf = enable,
};

- return wfx_hif_write_mib(wdev, -1, HIF_MIB_ID_GL_SET_MULTI_MSG,
- &arg, sizeof(arg));
+ return wfx_hif_write_mib(wdev, -1, HIF_MIB_ID_GL_SET_MULTI_MSG, &arg, sizeof(arg));
}

int wfx_hif_set_uapsd_info(struct wfx_vif *wvif, unsigned long val)
@@ -284,8 +264,7 @@ int wfx_hif_set_uapsd_info(struct wfx_vif *wvif, unsigned long val)
arg.trig_be = 1;
if (val & BIT(IEEE80211_AC_BK))
arg.trig_bckgrnd = 1;
- return wfx_hif_write_mib(wvif->wdev, wvif->id,
- HIF_MIB_ID_SET_UAPSD_INFORMATION,
+ return wfx_hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_SET_UAPSD_INFORMATION,
&arg, sizeof(arg));
}

@@ -295,8 +274,7 @@ int wfx_hif_erp_use_protection(struct wfx_vif *wvif, bool enable)
.use_cts_to_self = enable,
};

- return wfx_hif_write_mib(wvif->wdev, wvif->id,
- HIF_MIB_ID_NON_ERP_PROTECTION,
+ return wfx_hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_NON_ERP_PROTECTION,
&arg, sizeof(arg));
}

@@ -306,8 +284,7 @@ int wfx_hif_slot_time(struct wfx_vif *wvif, int val)
.slot_time = cpu_to_le32(val),
};

- return wfx_hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_SLOT_TIME,
- &arg, sizeof(arg));
+ return wfx_hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_SLOT_TIME, &arg, sizeof(arg));
}

int wfx_hif_wep_default_key_id(struct wfx_vif *wvif, int val)
@@ -316,8 +293,7 @@ int wfx_hif_wep_default_key_id(struct wfx_vif *wvif, int val)
.wep_default_key_id = val,
};

- return wfx_hif_write_mib(wvif->wdev, wvif->id,
- HIF_MIB_ID_DOT11_WEP_DEFAULT_KEY_ID,
+ return wfx_hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_DOT11_WEP_DEFAULT_KEY_ID,
&arg, sizeof(arg));
}

@@ -327,7 +303,6 @@ int wfx_hif_rts_threshold(struct wfx_vif *wvif, int val)
.threshold = cpu_to_le32(val >= 0 ? val : 0xFFFF),
};

- return wfx_hif_write_mib(wvif->wdev, wvif->id,
- HIF_MIB_ID_DOT11_RTS_THRESHOLD,
+ return wfx_hif_write_mib(wvif->wdev, wvif->id, HIF_MIB_ID_DOT11_RTS_THRESHOLD,
&arg, sizeof(arg));
}
diff --git a/drivers/staging/wfx/hif_tx_mib.h b/drivers/staging/wfx/hif_tx_mib.h
index e7e556b05c9a..bcd4ef6a8497 100644
--- a/drivers/staging/wfx/hif_tx_mib.h
+++ b/drivers/staging/wfx/hif_tx_mib.h
@@ -19,30 +19,23 @@ struct wfx_hif_mib_extended_count_table;

int wfx_hif_set_output_power(struct wfx_vif *wvif, int val);
int wfx_hif_set_beacon_wakeup_period(struct wfx_vif *wvif,
- unsigned int dtim_interval,
- unsigned int listen_interval);
-int wfx_hif_set_rcpi_rssi_threshold(struct wfx_vif *wvif,
- int rssi_thold, int rssi_hyst);
+ unsigned int dtim_interval, unsigned int listen_interval);
+int wfx_hif_set_rcpi_rssi_threshold(struct wfx_vif *wvif, int rssi_thold, int rssi_hyst);
int wfx_hif_get_counters_table(struct wfx_dev *wdev, int vif_id,
struct wfx_hif_mib_extended_count_table *arg);
int wfx_hif_set_macaddr(struct wfx_vif *wvif, u8 *mac);
-int wfx_hif_set_rx_filter(struct wfx_vif *wvif,
- bool filter_bssid, bool fwd_probe_req);
+int wfx_hif_set_rx_filter(struct wfx_vif *wvif, bool filter_bssid, bool fwd_probe_req);
int wfx_hif_set_beacon_filter_table(struct wfx_vif *wvif, int tbl_len,
const struct wfx_hif_ie_table_entry *tbl);
-int wfx_hif_beacon_filter_control(struct wfx_vif *wvif,
- int enable, int beacon_count);
-int wfx_hif_set_operational_mode(struct wfx_dev *wdev,
- enum wfx_hif_op_power_mode mode);
+int wfx_hif_beacon_filter_control(struct wfx_vif *wvif, int enable, int beacon_count);
+int wfx_hif_set_operational_mode(struct wfx_dev *wdev, enum wfx_hif_op_power_mode mode);
int wfx_hif_set_template_frame(struct wfx_vif *wvif, struct sk_buff *skb,
u8 frame_type, int init_rate);
int wfx_hif_set_mfp(struct wfx_vif *wvif, bool capable, bool required);
-int wfx_hif_set_block_ack_policy(struct wfx_vif *wvif,
- u8 tx_tid_policy, u8 rx_tid_policy);
+int wfx_hif_set_block_ack_policy(struct wfx_vif *wvif, u8 tx_tid_policy, u8 rx_tid_policy);
int wfx_hif_set_association_mode(struct wfx_vif *wvif, int ampdu_density,
bool greenfield, bool short_preamble);
-int wfx_hif_set_tx_rate_retry_policy(struct wfx_vif *wvif,
- int policy_index, u8 *rates);
+int wfx_hif_set_tx_rate_retry_policy(struct wfx_vif *wvif, int policy_index, u8 *rates);
int wfx_hif_keep_alive_period(struct wfx_vif *wvif, int period);
int wfx_hif_set_arp_ipv4_filter(struct wfx_vif *wvif, int idx, __be32 *addr);
int wfx_hif_use_multi_tx_conf(struct wfx_dev *wdev, bool enable);
diff --git a/drivers/staging/wfx/hwio.c b/drivers/staging/wfx/hwio.c
index c53b36d36687..c15810bdaecb 100644
--- a/drivers/staging/wfx/hwio.c
+++ b/drivers/staging/wfx/hwio.c
@@ -25,14 +25,12 @@ static int wfx_read32(struct wfx_dev *wdev, int reg, u32 *val)
*val = ~0; /* Never return undefined value */
if (!tmp)
return -ENOMEM;
- ret = wdev->hwbus_ops->copy_from_io(wdev->hwbus_priv, reg, tmp,
- sizeof(u32));
+ ret = wdev->hwbus_ops->copy_from_io(wdev->hwbus_priv, reg, tmp, sizeof(u32));
if (ret >= 0)
*val = le32_to_cpu(*tmp);
kfree(tmp);
if (ret)
- dev_err(wdev->dev, "%s: bus communication error: %d\n",
- __func__, ret);
+ dev_err(wdev->dev, "%s: bus communication error: %d\n", __func__, ret);
return ret;
}

@@ -44,12 +42,10 @@ static int wfx_write32(struct wfx_dev *wdev, int reg, u32 val)
if (!tmp)
return -ENOMEM;
*tmp = cpu_to_le32(val);
- ret = wdev->hwbus_ops->copy_to_io(wdev->hwbus_priv, reg, tmp,
- sizeof(u32));
+ ret = wdev->hwbus_ops->copy_to_io(wdev->hwbus_priv, reg, tmp, sizeof(u32));
kfree(tmp);
if (ret)
- dev_err(wdev->dev, "%s: bus communication error: %d\n",
- __func__, ret);
+ dev_err(wdev->dev, "%s: bus communication error: %d\n", __func__, ret);
return ret;
}

@@ -187,8 +183,7 @@ static int wfx_indirect_write_locked(struct wfx_dev *wdev, int reg, u32 addr,
return ret;
}

-static int wfx_indirect_read32_locked(struct wfx_dev *wdev, int reg,
- u32 addr, u32 *val)
+static int wfx_indirect_read32_locked(struct wfx_dev *wdev, int reg, u32 addr, u32 *val)
{
int ret;
__le32 *tmp = kmalloc(sizeof(u32), GFP_KERNEL);
@@ -227,13 +222,11 @@ int wfx_data_read(struct wfx_dev *wdev, void *buf, size_t len)

WARN(!IS_ALIGNED((uintptr_t)buf, 4), "unaligned buffer");
wdev->hwbus_ops->lock(wdev->hwbus_priv);
- ret = wdev->hwbus_ops->copy_from_io(wdev->hwbus_priv,
- WFX_REG_IN_OUT_QUEUE, buf, len);
+ ret = wdev->hwbus_ops->copy_from_io(wdev->hwbus_priv, WFX_REG_IN_OUT_QUEUE, buf, len);
_trace_io_read(WFX_REG_IN_OUT_QUEUE, buf, len);
wdev->hwbus_ops->unlock(wdev->hwbus_priv);
if (ret)
- dev_err(wdev->dev, "%s: bus communication error: %d\n",
- __func__, ret);
+ dev_err(wdev->dev, "%s: bus communication error: %d\n", __func__, ret);
return ret;
}

@@ -243,52 +236,42 @@ int wfx_data_write(struct wfx_dev *wdev, const void *buf, size_t len)

WARN(!IS_ALIGNED((uintptr_t)buf, 4), "unaligned buffer");
wdev->hwbus_ops->lock(wdev->hwbus_priv);
- ret = wdev->hwbus_ops->copy_to_io(wdev->hwbus_priv,
- WFX_REG_IN_OUT_QUEUE, buf, len);
+ ret = wdev->hwbus_ops->copy_to_io(wdev->hwbus_priv, WFX_REG_IN_OUT_QUEUE, buf, len);
_trace_io_write(WFX_REG_IN_OUT_QUEUE, buf, len);
wdev->hwbus_ops->unlock(wdev->hwbus_priv);
if (ret)
- dev_err(wdev->dev, "%s: bus communication error: %d\n",
- __func__, ret);
+ dev_err(wdev->dev, "%s: bus communication error: %d\n", __func__, ret);
return ret;
}

int wfx_sram_buf_read(struct wfx_dev *wdev, u32 addr, void *buf, size_t len)
{
- return wfx_indirect_read_locked(wdev, WFX_REG_SRAM_DPORT,
- addr, buf, len);
+ return wfx_indirect_read_locked(wdev, WFX_REG_SRAM_DPORT, addr, buf, len);
}

int wfx_ahb_buf_read(struct wfx_dev *wdev, u32 addr, void *buf, size_t len)
{
- return wfx_indirect_read_locked(wdev, WFX_REG_AHB_DPORT,
- addr, buf, len);
+ return wfx_indirect_read_locked(wdev, WFX_REG_AHB_DPORT, addr, buf, len);
}

-int wfx_sram_buf_write(struct wfx_dev *wdev, u32 addr,
- const void *buf, size_t len)
+int wfx_sram_buf_write(struct wfx_dev *wdev, u32 addr, const void *buf, size_t len)
{
- return wfx_indirect_write_locked(wdev, WFX_REG_SRAM_DPORT,
- addr, buf, len);
+ return wfx_indirect_write_locked(wdev, WFX_REG_SRAM_DPORT, addr, buf, len);
}

-int wfx_ahb_buf_write(struct wfx_dev *wdev, u32 addr,
- const void *buf, size_t len)
+int wfx_ahb_buf_write(struct wfx_dev *wdev, u32 addr, const void *buf, size_t len)
{
- return wfx_indirect_write_locked(wdev, WFX_REG_AHB_DPORT,
- addr, buf, len);
+ return wfx_indirect_write_locked(wdev, WFX_REG_AHB_DPORT, addr, buf, len);
}

int wfx_sram_reg_read(struct wfx_dev *wdev, u32 addr, u32 *val)
{
- return wfx_indirect_read32_locked(wdev, WFX_REG_SRAM_DPORT,
- addr, val);
+ return wfx_indirect_read32_locked(wdev, WFX_REG_SRAM_DPORT, addr, val);
}

int wfx_ahb_reg_read(struct wfx_dev *wdev, u32 addr, u32 *val)
{
- return wfx_indirect_read32_locked(wdev, WFX_REG_AHB_DPORT,
- addr, val);
+ return wfx_indirect_read32_locked(wdev, WFX_REG_AHB_DPORT, addr, val);
}

int wfx_sram_reg_write(struct wfx_dev *wdev, u32 addr, u32 val)
diff --git a/drivers/staging/wfx/key.c b/drivers/staging/wfx/key.c
index dea8238f9916..8f23e8d42bd4 100644
--- a/drivers/staging/wfx/key.c
+++ b/drivers/staging/wfx/key.c
@@ -55,9 +55,8 @@ static u8 fill_tkip_pair(struct wfx_hif_tkip_pairwise_key *msg,
{
u8 *keybuf = key->key;

- WARN(key->keylen != sizeof(msg->tkip_key_data)
- + sizeof(msg->tx_mic_key)
- + sizeof(msg->rx_mic_key), "inconsistent data");
+ WARN(key->keylen != sizeof(msg->tkip_key_data) + sizeof(msg->tx_mic_key) +
+ sizeof(msg->rx_mic_key), "inconsistent data");
memcpy(msg->tkip_key_data, keybuf, sizeof(msg->tkip_key_data));
keybuf += sizeof(msg->tkip_key_data);
memcpy(msg->tx_mic_key, keybuf, sizeof(msg->tx_mic_key));
@@ -67,20 +66,16 @@ static u8 fill_tkip_pair(struct wfx_hif_tkip_pairwise_key *msg,
return HIF_KEY_TYPE_TKIP_PAIRWISE;
}

-static u8 fill_tkip_group(struct wfx_hif_tkip_group_key *msg,
- struct ieee80211_key_conf *key,
- struct ieee80211_key_seq *seq,
- enum nl80211_iftype iftype)
+static u8 fill_tkip_group(struct wfx_hif_tkip_group_key *msg, struct ieee80211_key_conf *key,
+ struct ieee80211_key_seq *seq, enum nl80211_iftype iftype)
{
u8 *keybuf = key->key;

- WARN(key->keylen != sizeof(msg->tkip_key_data)
- + 2 * sizeof(msg->rx_mic_key), "inconsistent data");
+ WARN(key->keylen != sizeof(msg->tkip_key_data) + 2 * sizeof(msg->rx_mic_key),
+ "inconsistent data");
msg->key_id = key->keyidx;
- memcpy(msg->rx_sequence_counter,
- &seq->tkip.iv16, sizeof(seq->tkip.iv16));
- memcpy(msg->rx_sequence_counter + sizeof(u16),
- &seq->tkip.iv32, sizeof(seq->tkip.iv32));
+ memcpy(msg->rx_sequence_counter, &seq->tkip.iv16, sizeof(seq->tkip.iv16));
+ memcpy(msg->rx_sequence_counter + sizeof(u16), &seq->tkip.iv32, sizeof(seq->tkip.iv32));
memcpy(msg->tkip_key_data, keybuf, sizeof(msg->tkip_key_data));
keybuf += sizeof(msg->tkip_key_data);
if (iftype == NL80211_IFTYPE_AP)
@@ -102,8 +97,7 @@ static u8 fill_ccmp_pair(struct wfx_hif_aes_pairwise_key *msg,
}

static u8 fill_ccmp_group(struct wfx_hif_aes_group_key *msg,
- struct ieee80211_key_conf *key,
- struct ieee80211_key_seq *seq)
+ struct ieee80211_key_conf *key, struct ieee80211_key_seq *seq)
{
WARN(key->keylen != sizeof(msg->aes_key_data), "inconsistent data");
memcpy(msg->aes_key_data, key->key, key->keylen);
@@ -118,8 +112,8 @@ static u8 fill_sms4_pair(struct wfx_hif_wapi_pairwise_key *msg,
{
u8 *keybuf = key->key;

- WARN(key->keylen != sizeof(msg->wapi_key_data)
- + sizeof(msg->mic_key_data), "inconsistent data");
+ WARN(key->keylen != sizeof(msg->wapi_key_data) + sizeof(msg->mic_key_data),
+ "inconsistent data");
ether_addr_copy(msg->peer_address, peer_addr);
memcpy(msg->wapi_key_data, keybuf, sizeof(msg->wapi_key_data));
keybuf += sizeof(msg->wapi_key_data);
@@ -133,8 +127,8 @@ static u8 fill_sms4_group(struct wfx_hif_wapi_group_key *msg,
{
u8 *keybuf = key->key;

- WARN(key->keylen != sizeof(msg->wapi_key_data)
- + sizeof(msg->mic_key_data), "inconsistent data");
+ WARN(key->keylen != sizeof(msg->wapi_key_data) + sizeof(msg->mic_key_data),
+ "inconsistent data");
memcpy(msg->wapi_key_data, keybuf, sizeof(msg->wapi_key_data));
keybuf += sizeof(msg->wapi_key_data);
memcpy(msg->mic_key_data, keybuf, sizeof(msg->mic_key_data));
@@ -143,8 +137,7 @@ static u8 fill_sms4_group(struct wfx_hif_wapi_group_key *msg,
}

static u8 fill_aes_cmac_group(struct wfx_hif_igtk_group_key *msg,
- struct ieee80211_key_conf *key,
- struct ieee80211_key_seq *seq)
+ struct ieee80211_key_conf *key, struct ieee80211_key_seq *seq)
{
WARN(key->keylen != sizeof(msg->igtk_key_data), "inconsistent data");
memcpy(msg->igtk_key_data, key->key, key->keylen);
@@ -173,28 +166,23 @@ static int wfx_add_key(struct wfx_vif *wvif, struct ieee80211_sta *sta,
if (key->cipher == WLAN_CIPHER_SUITE_WEP40 ||
key->cipher == WLAN_CIPHER_SUITE_WEP104) {
if (pairwise)
- k.type = fill_wep_pair(&k.key.wep_pairwise_key, key,
- sta->addr);
+ k.type = fill_wep_pair(&k.key.wep_pairwise_key, key, sta->addr);
else
k.type = fill_wep_group(&k.key.wep_group_key, key);
} else if (key->cipher == WLAN_CIPHER_SUITE_TKIP) {
if (pairwise)
- k.type = fill_tkip_pair(&k.key.tkip_pairwise_key, key,
- sta->addr);
+ k.type = fill_tkip_pair(&k.key.tkip_pairwise_key, key, sta->addr);
else
- k.type = fill_tkip_group(&k.key.tkip_group_key, key,
- &seq, wvif->vif->type);
+ k.type = fill_tkip_group(&k.key.tkip_group_key, key, &seq,
+ wvif->vif->type);
} else if (key->cipher == WLAN_CIPHER_SUITE_CCMP) {
if (pairwise)
- k.type = fill_ccmp_pair(&k.key.aes_pairwise_key, key,
- sta->addr);
+ k.type = fill_ccmp_pair(&k.key.aes_pairwise_key, key, sta->addr);
else
- k.type = fill_ccmp_group(&k.key.aes_group_key, key,
- &seq);
+ k.type = fill_ccmp_group(&k.key.aes_group_key, key, &seq);
} else if (key->cipher == WLAN_CIPHER_SUITE_SMS4) {
if (pairwise)
- k.type = fill_sms4_pair(&k.key.wapi_pairwise_key, key,
- sta->addr);
+ k.type = fill_sms4_pair(&k.key.wapi_pairwise_key, key, sta->addr);
else
k.type = fill_sms4_group(&k.key.wapi_group_key, key);
} else if (key->cipher == WLAN_CIPHER_SUITE_AES_CMAC) {
@@ -210,8 +198,7 @@ static int wfx_add_key(struct wfx_vif *wvif, struct ieee80211_sta *sta,
wfx_free_key(wdev, idx);
return -EOPNOTSUPP;
}
- key->flags |= IEEE80211_KEY_FLAG_PUT_IV_SPACE |
- IEEE80211_KEY_FLAG_RESERVE_TAILROOM;
+ key->flags |= IEEE80211_KEY_FLAG_PUT_IV_SPACE | IEEE80211_KEY_FLAG_RESERVE_TAILROOM;
key->hw_key_idx = idx;
return 0;
}
@@ -223,9 +210,8 @@ static int wfx_remove_key(struct wfx_vif *wvif, struct ieee80211_key_conf *key)
return wfx_hif_remove_key(wvif->wdev, key->hw_key_idx);
}

-int wfx_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
- struct ieee80211_vif *vif, struct ieee80211_sta *sta,
- struct ieee80211_key_conf *key)
+int wfx_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, struct ieee80211_vif *vif,
+ struct ieee80211_sta *sta, struct ieee80211_key_conf *key)
{
int ret = -EOPNOTSUPP;
struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv;
diff --git a/drivers/staging/wfx/key.h b/drivers/staging/wfx/key.h
index 2d135eff7af2..2234e36dbbcd 100644
--- a/drivers/staging/wfx/key.h
+++ b/drivers/staging/wfx/key.h
@@ -13,8 +13,7 @@
struct wfx_dev;
struct wfx_vif;

-int wfx_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
- struct ieee80211_vif *vif, struct ieee80211_sta *sta,
- struct ieee80211_key_conf *key);
+int wfx_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd, struct ieee80211_vif *vif,
+ struct ieee80211_sta *sta, struct ieee80211_key_conf *key);

#endif
diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c
index 7b9d75f219fb..6b9ae67da286 100644
--- a/drivers/staging/wfx/main.c
+++ b/drivers/staging/wfx/main.c
@@ -94,8 +94,7 @@ static const struct ieee80211_supported_band wfx_band_2ghz = {
.ht_cap = {
/* Receive caps */
.cap = IEEE80211_HT_CAP_GRN_FLD | IEEE80211_HT_CAP_SGI_20 |
- IEEE80211_HT_CAP_MAX_AMSDU |
- (1 << IEEE80211_HT_CAP_RX_STBC_SHIFT),
+ IEEE80211_HT_CAP_MAX_AMSDU | (1 << IEEE80211_HT_CAP_RX_STBC_SHIFT),
.ht_supported = 1,
.ampdu_factor = IEEE80211_HT_MAX_AMPDU_16K,
.ampdu_density = IEEE80211_HT_MPDU_DENSITY_NONE,
@@ -260,10 +259,8 @@ static void wfx_free_common(void *data)
ieee80211_free_hw(wdev->hw);
}

-struct wfx_dev *wfx_init_common(struct device *dev,
- const struct wfx_platform_data *pdata,
- const struct wfx_hwbus_ops *hwbus_ops,
- void *hwbus_priv)
+struct wfx_dev *wfx_init_common(struct device *dev, const struct wfx_platform_data *pdata,
+ const struct wfx_hwbus_ops *hwbus_ops, void *hwbus_priv)
{
struct ieee80211_hw *hw;
struct wfx_dev *wdev;
@@ -288,9 +285,8 @@ struct wfx_dev *wfx_init_common(struct device *dev,
hw->queues = 4;
hw->max_rates = 8;
hw->max_rate_tries = 8;
- hw->extra_tx_headroom = sizeof(struct wfx_hif_msg)
- + sizeof(struct wfx_hif_req_tx)
- + 4 /* alignment */ + 8 /* TKIP IV */;
+ hw->extra_tx_headroom = sizeof(struct wfx_hif_msg) + sizeof(struct wfx_hif_req_tx) +
+ 4 /* alignment */ + 8 /* TKIP IV */;
hw->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION) |
BIT(NL80211_IFTYPE_ADHOC) |
BIT(NL80211_IFTYPE_AP);
@@ -308,8 +304,7 @@ struct wfx_dev *wfx_init_common(struct device *dev,
hw->wiphy->iface_combinations = wfx_iface_combinations;
hw->wiphy->bands[NL80211_BAND_2GHZ] = devm_kmalloc(dev, sizeof(wfx_band_2ghz), GFP_KERNEL);
/* FIXME: also copy wfx_rates and wfx_2ghz_chantable */
- memcpy(hw->wiphy->bands[NL80211_BAND_2GHZ], &wfx_band_2ghz,
- sizeof(wfx_band_2ghz));
+ memcpy(hw->wiphy->bands[NL80211_BAND_2GHZ], &wfx_band_2ghz, sizeof(wfx_band_2ghz));

wdev = hw->priv;
wdev->hw = hw;
@@ -317,10 +312,8 @@ struct wfx_dev *wfx_init_common(struct device *dev,
wdev->hwbus_ops = hwbus_ops;
wdev->hwbus_priv = hwbus_priv;
memcpy(&wdev->pdata, pdata, sizeof(*pdata));
- of_property_read_string(dev->of_node, "config-file",
- &wdev->pdata.file_pds);
- wdev->pdata.gpio_wakeup = devm_gpiod_get_optional(dev, "wakeup",
- GPIOD_OUT_LOW);
+ of_property_read_string(dev->of_node, "config-file", &wdev->pdata.file_pds);
+ wdev->pdata.gpio_wakeup = devm_gpiod_get_optional(dev, "wakeup", GPIOD_OUT_LOW);
if (IS_ERR(wdev->pdata.gpio_wakeup))
return NULL;
if (wdev->pdata.gpio_wakeup)
@@ -330,8 +323,7 @@ struct wfx_dev *wfx_init_common(struct device *dev,
mutex_init(&wdev->rx_stats_lock);
mutex_init(&wdev->tx_power_loop_info_lock);
init_completion(&wdev->firmware_ready);
- INIT_DELAYED_WORK(&wdev->cooling_timeout_work,
- wfx_cooling_timeout_work);
+ INIT_DELAYED_WORK(&wdev->cooling_timeout_work, wfx_cooling_timeout_work);
skb_queue_head_init(&wdev->tx_pending);
init_waitqueue_head(&wdev->tx_dequeue);
wfx_init_hif_cmd(&wdev->hif_cmd);
@@ -388,27 +380,27 @@ int wfx_probe(struct wfx_dev *wdev)
wdev->hw_caps.firmware_build);

if (wfx_api_older_than(wdev, 1, 0)) {
- dev_err(wdev->dev,
- "unsupported firmware API version (expect 1 while firmware returns %d)\n",
+ dev_err(wdev->dev, "unsupported firmware API version (expect 1 while firmware returns %d)\n",
wdev->hw_caps.api_version_major);
err = -ENOTSUPP;
goto err0;
}

if (wdev->hw_caps.link_mode == SEC_LINK_ENFORCED) {
- dev_err(wdev->dev,
- "chip require secure_link, but can't negotiate it\n");
+ dev_err(wdev->dev, "chip require secure_link, but can't negotiate it\n");
goto err0;
}

if (wdev->hw_caps.region_sel_mode) {
- wdev->hw->wiphy->bands[NL80211_BAND_2GHZ]->channels[11].flags |= IEEE80211_CHAN_NO_IR;
- wdev->hw->wiphy->bands[NL80211_BAND_2GHZ]->channels[12].flags |= IEEE80211_CHAN_NO_IR;
- wdev->hw->wiphy->bands[NL80211_BAND_2GHZ]->channels[13].flags |= IEEE80211_CHAN_DISABLED;
+ wdev->hw->wiphy->bands[NL80211_BAND_2GHZ]->channels[11].flags |=
+ IEEE80211_CHAN_NO_IR;
+ wdev->hw->wiphy->bands[NL80211_BAND_2GHZ]->channels[12].flags |=
+ IEEE80211_CHAN_NO_IR;
+ wdev->hw->wiphy->bands[NL80211_BAND_2GHZ]->channels[13].flags |=
+ IEEE80211_CHAN_DISABLED;
}

- dev_dbg(wdev->dev, "sending configuration file %s\n",
- wdev->pdata.file_pds);
+ dev_dbg(wdev->dev, "sending configuration file %s\n", wdev->pdata.file_pds);
err = wfx_send_pdata_pds(wdev);
if (err < 0 && err != -ENOENT)
goto err0;
@@ -424,8 +416,7 @@ int wfx_probe(struct wfx_dev *wdev)

wdev->pdata.gpio_wakeup = gpio_saved;
if (wdev->pdata.gpio_wakeup) {
- dev_dbg(wdev->dev,
- "enable 'quiescent' power mode with wakeup GPIO and PDS file %s\n",
+ dev_dbg(wdev->dev, "enable 'quiescent' power mode with wakeup GPIO and PDS file %s\n",
wdev->pdata.file_pds);
gpiod_set_value_cansleep(wdev->pdata.gpio_wakeup, 1);
wfx_control_reg_write(wdev, 0);
@@ -436,19 +427,16 @@ int wfx_probe(struct wfx_dev *wdev)

for (i = 0; i < ARRAY_SIZE(wdev->addresses); i++) {
eth_zero_addr(wdev->addresses[i].addr);
- err = of_get_mac_address(wdev->dev->of_node,
- wdev->addresses[i].addr);
+ err = of_get_mac_address(wdev->dev->of_node, wdev->addresses[i].addr);
if (!err)
wdev->addresses[i].addr[ETH_ALEN - 1] += i;
else
- ether_addr_copy(wdev->addresses[i].addr,
- wdev->hw_caps.mac_addr[i]);
+ ether_addr_copy(wdev->addresses[i].addr, wdev->hw_caps.mac_addr[i]);
if (!is_valid_ether_addr(wdev->addresses[i].addr)) {
dev_warn(wdev->dev, "using random MAC address\n");
eth_random_addr(wdev->addresses[i].addr);
}
- dev_info(wdev->dev, "MAC address %d: %pM\n", i,
- wdev->addresses[i].addr);
+ dev_info(wdev->dev, "MAC address %d: %pM\n", i, wdev->addresses[i].addr);
}
wdev->hw->wiphy->n_addresses = ARRAY_SIZE(wdev->addresses);
wdev->hw->wiphy->addresses = wdev->addresses;
diff --git a/drivers/staging/wfx/main.h b/drivers/staging/wfx/main.h
index 68a7807c5fb6..def6270bf10d 100644
--- a/drivers/staging/wfx/main.h
+++ b/drivers/staging/wfx/main.h
@@ -29,10 +29,8 @@ struct wfx_platform_data {
bool use_rising_clk;
};

-struct wfx_dev *wfx_init_common(struct device *dev,
- const struct wfx_platform_data *pdata,
- const struct wfx_hwbus_ops *hwbus_ops,
- void *hwbus_priv);
+struct wfx_dev *wfx_init_common(struct device *dev, const struct wfx_platform_data *pdata,
+ const struct wfx_hwbus_ops *hwbus_ops, void *hwbus_priv);

int wfx_probe(struct wfx_dev *wdev);
void wfx_release(struct wfx_dev *wdev);
diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c
index 71c6ef94a904..9b49e41f06ce 100644
--- a/drivers/staging/wfx/queue.c
+++ b/drivers/staging/wfx/queue.c
@@ -38,8 +38,7 @@ void wfx_tx_flush(struct wfx_dev *wdev)

wfx_tx_lock(wdev);
mutex_lock(&wdev->hif_cmd.lock);
- ret = wait_event_timeout(wdev->hif.tx_buffers_empty,
- !wdev->hif.tx_buffers_used,
+ ret = wait_event_timeout(wdev->hif.tx_buffers_empty, !wdev->hif.tx_buffers_used,
msecs_to_jiffies(3000));
if (!ret) {
dev_warn(wdev->dev, "cannot flush tx buffers (%d still busy)\n",
@@ -76,8 +75,7 @@ void wfx_tx_queues_init(struct wfx_vif *wvif)

bool wfx_tx_queue_empty(struct wfx_vif *wvif, struct wfx_queue *queue)
{
- return skb_queue_empty_lockless(&queue->normal) &&
- skb_queue_empty_lockless(&queue->cab);
+ return skb_queue_empty_lockless(&queue->normal) && skb_queue_empty_lockless(&queue->cab);
}

void wfx_tx_queues_check_empty(struct wfx_vif *wvif)
@@ -91,8 +89,7 @@ void wfx_tx_queues_check_empty(struct wfx_vif *wvif)
}

static void __wfx_tx_queue_drop(struct wfx_vif *wvif,
- struct sk_buff_head *skb_queue,
- struct sk_buff_head *dropped)
+ struct sk_buff_head *skb_queue, struct sk_buff_head *dropped)
{
struct sk_buff *skb, *tmp;

@@ -130,8 +127,7 @@ void wfx_pending_drop(struct wfx_dev *wdev, struct sk_buff_head *dropped)
struct wfx_hif_msg *hif;
struct sk_buff *skb;

- WARN(!wdev->chip_frozen, "%s should only be used to recover a frozen device",
- __func__);
+ WARN(!wdev->chip_frozen, "%s should only be used to recover a frozen device", __func__);
while ((skb = skb_dequeue(&wdev->tx_pending)) != NULL) {
hif = (struct wfx_hif_msg *)skb->data;
wvif = wdev_to_wvif(wdev, hif->interface);
@@ -187,23 +183,20 @@ void wfx_pending_dump_old_frames(struct wfx_dev *wdev, unsigned int limit_ms)
skb_queue_walk(&wdev->tx_pending, skb) {
tx_priv = wfx_skb_tx_priv(skb);
req = wfx_skb_txreq(skb);
- if (ktime_after(now, ktime_add_ms(tx_priv->xmit_timestamp,
- limit_ms))) {
+ if (ktime_after(now, ktime_add_ms(tx_priv->xmit_timestamp, limit_ms))) {
if (first) {
dev_info(wdev->dev, "frames stuck in firmware since %dms or more:\n",
limit_ms);
first = false;
}
dev_info(wdev->dev, " id %08x sent %lldms ago\n",
- req->packet_id,
- ktime_ms_delta(now, tx_priv->xmit_timestamp));
+ req->packet_id, ktime_ms_delta(now, tx_priv->xmit_timestamp));
}
}
spin_unlock_bh(&wdev->tx_pending.lock);
}

-unsigned int wfx_pending_get_pkt_us_delay(struct wfx_dev *wdev,
- struct sk_buff *skb)
+unsigned int wfx_pending_get_pkt_us_delay(struct wfx_dev *wdev, struct sk_buff *skb)
{
ktime_t now = ktime_get();
struct wfx_tx_priv *tx_priv = wfx_skb_tx_priv(skb);
@@ -267,8 +260,7 @@ static struct sk_buff *wfx_tx_queues_get_skb(struct wfx_dev *wdev)
*/
hif = (struct wfx_hif_msg *)skb->data;
WARN_ON(hif->interface != wvif->id);
- WARN_ON(queues[i] !=
- &wvif->tx_queue[skb_get_queue_mapping(skb)]);
+ WARN_ON(queues[i] != &wvif->tx_queue[skb_get_queue_mapping(skb)]);
atomic_inc(&queues[i]->pending_frames);
trace_queues_stats(wdev, queues[i]);
return skb;
diff --git a/drivers/staging/wfx/queue.h b/drivers/staging/wfx/queue.h
index 66596a9abe30..2860c56fb933 100644
--- a/drivers/staging/wfx/queue.h
+++ b/drivers/staging/wfx/queue.h
@@ -38,8 +38,7 @@ void wfx_tx_queue_drop(struct wfx_vif *wvif, struct wfx_queue *queue,

struct sk_buff *wfx_pending_get(struct wfx_dev *wdev, u32 packet_id);
void wfx_pending_drop(struct wfx_dev *wdev, struct sk_buff_head *dropped);
-unsigned int wfx_pending_get_pkt_us_delay(struct wfx_dev *wdev,
- struct sk_buff *skb);
+unsigned int wfx_pending_get_pkt_us_delay(struct wfx_dev *wdev, struct sk_buff *skb);
void wfx_pending_dump_old_frames(struct wfx_dev *wdev, unsigned int limit_ms);

#endif
diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.c
index f61c6b2db352..ce0ae4c91190 100644
--- a/drivers/staging/wfx/scan.c
+++ b/drivers/staging/wfx/scan.c
@@ -12,8 +12,7 @@
#include "sta.h"
#include "hif_tx_mib.h"

-static void wfx_ieee80211_scan_completed_compat(struct ieee80211_hw *hw,
- bool aborted)
+static void wfx_ieee80211_scan_completed_compat(struct ieee80211_hw *hw, bool aborted)
{
struct cfg80211_scan_info info = {
.aborted = aborted,
@@ -22,13 +21,11 @@ static void wfx_ieee80211_scan_completed_compat(struct ieee80211_hw *hw,
ieee80211_scan_completed(hw, &info);
}

-static int update_probe_tmpl(struct wfx_vif *wvif,
- struct cfg80211_scan_request *req)
+static int update_probe_tmpl(struct wfx_vif *wvif, struct cfg80211_scan_request *req)
{
struct sk_buff *skb;

- skb = ieee80211_probereq_get(wvif->wdev->hw, wvif->vif->addr,
- NULL, 0, req->ie_len);
+ skb = ieee80211_probereq_get(wvif->wdev->hw, wvif->vif->addr, NULL, 0, req->ie_len);
if (!skb)
return -ENOMEM;

@@ -38,8 +35,7 @@ static int update_probe_tmpl(struct wfx_vif *wvif,
return 0;
}

-static int send_scan_req(struct wfx_vif *wvif,
- struct cfg80211_scan_request *req, int start_idx)
+static int send_scan_req(struct wfx_vif *wvif, struct cfg80211_scan_request *req, int start_idx)
{
int i, ret;
struct ieee80211_channel *ch_start, *ch_cur;
diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index 620d8c912f95..07054666fe76 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -40,8 +40,7 @@ u32 wfx_rate_mask_to_hw(struct wfx_dev *wdev, u32 rates)

void wfx_cooling_timeout_work(struct work_struct *work)
{
- struct wfx_dev *wdev = container_of(to_delayed_work(work),
- struct wfx_dev,
+ struct wfx_dev *wdev = container_of(to_delayed_work(work), struct wfx_dev,
cooling_timeout_work);

wdev->chip_frozen = true;
@@ -91,10 +90,8 @@ static void wfx_filter_beacon(struct wfx_vif *wvif, bool filter_beacon)
if (!filter_beacon) {
wfx_hif_beacon_filter_control(wvif, 0, 1);
} else {
- wfx_hif_set_beacon_filter_table(wvif, ARRAY_SIZE(filter_ies),
- filter_ies);
- wfx_hif_beacon_filter_control(wvif,
- HIF_BEACON_FILTER_ENABLE, 0);
+ wfx_hif_set_beacon_filter_table(wvif, ARRAY_SIZE(filter_ies), filter_ies);
+ wfx_hif_beacon_filter_control(wvif, HIF_BEACON_FILTER_ENABLE, 0);
}
}

@@ -135,8 +132,7 @@ void wfx_configure_filter(struct ieee80211_hw *hw, unsigned int changed_flags,
filter_bssid = true;

/* In AP mode, chip can reply to probe request itself */
- if (*total_flags & FIF_PROBE_REQ &&
- wvif->vif->type == NL80211_IFTYPE_AP) {
+ if (*total_flags & FIF_PROBE_REQ && wvif->vif->type == NL80211_IFTYPE_AP) {
dev_dbg(wdev->dev, "do not forward probe request in AP mode\n");
*total_flags &= ~FIF_PROBE_REQ;
}
@@ -208,10 +204,8 @@ int wfx_update_pm(struct wfx_vif *wvif)
if (wvif->uapsd_mask)
ps_timeout = 0;

- if (!wait_for_completion_timeout(&wvif->set_pm_mode_complete,
- TU_TO_JIFFIES(512)))
- dev_warn(wvif->wdev->dev,
- "timeout while waiting of set_pm_mode_complete\n");
+ if (!wait_for_completion_timeout(&wvif->set_pm_mode_complete, TU_TO_JIFFIES(512)))
+ dev_warn(wvif->wdev->dev, "timeout while waiting of set_pm_mode_complete\n");
return wfx_hif_set_pm(wvif, ps, ps_timeout);
}

@@ -227,8 +221,7 @@ int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
mutex_lock(&wdev->conf_mutex);
assign_bit(queue, &wvif->uapsd_mask, params->uapsd);
wfx_hif_set_edca_queue_params(wvif, queue, params);
- if (wvif->vif->type == NL80211_IFTYPE_STATION &&
- old_uapsd != wvif->uapsd_mask) {
+ if (wvif->vif->type == NL80211_IFTYPE_STATION && old_uapsd != wvif->uapsd_mask) {
wfx_hif_set_uapsd_info(wvif, wvif->uapsd_mask);
wfx_update_pm(wvif);
}
@@ -264,17 +257,15 @@ void wfx_event_report_rssi(struct wfx_vif *wvif, u8 raw_rcpi_rssi)

static void wfx_beacon_loss_work(struct work_struct *work)
{
- struct wfx_vif *wvif = container_of(to_delayed_work(work),
- struct wfx_vif, beacon_loss_work);
+ struct wfx_vif *wvif = container_of(to_delayed_work(work), struct wfx_vif,
+ beacon_loss_work);
struct ieee80211_bss_conf *bss_conf = &wvif->vif->bss_conf;

ieee80211_beacon_loss(wvif->vif);
- schedule_delayed_work(to_delayed_work(work),
- msecs_to_jiffies(bss_conf->beacon_int));
+ schedule_delayed_work(to_delayed_work(work), msecs_to_jiffies(bss_conf->beacon_int));
}

-void wfx_set_default_unicast_key(struct ieee80211_hw *hw,
- struct ieee80211_vif *vif, int idx)
+void wfx_set_default_unicast_key(struct ieee80211_hw *hw, struct ieee80211_vif *vif, int idx)
{
struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv;

@@ -298,8 +289,7 @@ void wfx_reset(struct wfx_vif *wvif)
wfx_update_pm(wvif);
}

-int wfx_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
- struct ieee80211_sta *sta)
+int wfx_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_sta *sta)
{
struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv;
struct wfx_sta_priv *sta_priv = (struct wfx_sta_priv *)&sta->drv_priv;
@@ -321,8 +311,7 @@ int wfx_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
return 0;
}

-int wfx_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
- struct ieee80211_sta *sta)
+int wfx_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_sta *sta)
{
struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv;
struct wfx_sta_priv *sta_priv = (struct wfx_sta_priv *)&sta->drv_priv;
@@ -343,15 +332,13 @@ static int wfx_upload_ap_templates(struct wfx_vif *wvif)
skb = ieee80211_beacon_get(wvif->wdev->hw, wvif->vif);
if (!skb)
return -ENOMEM;
- wfx_hif_set_template_frame(wvif, skb, HIF_TMPLT_BCN,
- API_RATE_INDEX_B_1MBPS);
+ wfx_hif_set_template_frame(wvif, skb, HIF_TMPLT_BCN, API_RATE_INDEX_B_1MBPS);
dev_kfree_skb(skb);

skb = ieee80211_proberesp_get(wvif->wdev->hw, wvif->vif);
if (!skb)
return -ENOMEM;
- wfx_hif_set_template_frame(wvif, skb, HIF_TMPLT_PRBRES,
- API_RATE_INDEX_B_1MBPS);
+ wfx_hif_set_template_frame(wvif, skb, HIF_TMPLT_PRBRES, API_RATE_INDEX_B_1MBPS);
dev_kfree_skb(skb);
return 0;
}
@@ -360,8 +347,7 @@ static void wfx_set_mfp_ap(struct wfx_vif *wvif)
{
struct sk_buff *skb = ieee80211_beacon_get(wvif->wdev->hw, wvif->vif);
const int ieoffset = offsetof(struct ieee80211_mgmt, u.beacon.variable);
- const u16 *ptr = (u16 *)cfg80211_find_ie(WLAN_EID_RSN,
- skb->data + ieoffset,
+ const u16 *ptr = (u16 *)cfg80211_find_ie(WLAN_EID_RSN, skb->data + ieoffset,
skb->len - ieoffset);
const int pairwise_cipher_suite_count_offset = 8 / sizeof(u16);
const int pairwise_cipher_suite_size = 4 / sizeof(u16);
@@ -417,8 +403,7 @@ static void wfx_join(struct wfx_vif *wvif)

wfx_tx_lock_flush(wvif->wdev);

- bss = cfg80211_get_bss(wvif->wdev->hw->wiphy, wvif->channel,
- conf->bssid, NULL, 0,
+ bss = cfg80211_get_bss(wvif->wdev->hw->wiphy, wvif->channel, conf->bssid, NULL, 0,
IEEE80211_BSS_TYPE_ANY, IEEE80211_PRIVACY_ANY);
if (!bss && !conf->ibss_joined) {
wfx_tx_unlock(wvif->wdev);
@@ -472,8 +457,7 @@ static void wfx_join_finalize(struct wfx_vif *wvif,
rcu_read_unlock();

wvif->join_in_progress = false;
- wfx_hif_set_association_mode(wvif, ampdu_density, greenfield,
- info->use_short_preamble);
+ wfx_hif_set_association_mode(wvif, ampdu_density, greenfield, info->use_short_preamble);
wfx_hif_keep_alive_period(wvif, 0);
/* beacon_loss_count is defined to 7 in net/mac80211/mlme.c. Let's use
* the same value.
@@ -541,10 +525,8 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,

if (changed & BSS_CHANGED_BEACON_INFO) {
if (vif->type != NL80211_IFTYPE_STATION)
- dev_warn(wdev->dev, "%s: misunderstood change: BEACON_INFO\n",
- __func__);
- wfx_hif_set_beacon_wakeup_period(wvif, info->dtim_period,
- info->dtim_period);
+ dev_warn(wdev->dev, "%s: misunderstood change: BEACON_INFO\n", __func__);
+ wfx_hif_set_beacon_wakeup_period(wvif, info->dtim_period, info->dtim_period);
/* We temporary forwarded beacon for join process. It is now no
* more necessary.
*/
@@ -563,8 +545,7 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
}
}

- if (changed & BSS_CHANGED_AP_PROBE_RESP ||
- changed & BSS_CHANGED_BEACON)
+ if (changed & BSS_CHANGED_AP_PROBE_RESP || changed & BSS_CHANGED_BEACON)
wfx_upload_ap_templates(wvif);

if (changed & BSS_CHANGED_BEACON_ENABLED)
@@ -581,8 +562,7 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
wfx_hif_slot_time(wvif, info->use_short_slot ? 9 : 20);

if (changed & BSS_CHANGED_CQM)
- wfx_hif_set_rcpi_rssi_threshold(wvif, info->cqm_rssi_thold,
- info->cqm_rssi_hyst);
+ wfx_hif_set_rcpi_rssi_threshold(wvif, info->cqm_rssi_thold, info->cqm_rssi_hyst);

if (changed & BSS_CHANGED_TXPOWER)
wfx_hif_set_output_power(wvif, info->txpower);
@@ -599,8 +579,7 @@ static int wfx_update_tim(struct wfx_vif *wvif)
u16 tim_offset, tim_length;
u8 *tim_ptr;

- skb = ieee80211_beacon_get_tim(wvif->wdev->hw, wvif->vif,
- &tim_offset, &tim_length);
+ skb = ieee80211_beacon_get_tim(wvif->wdev->hw, wvif->vif, &tim_offset, &tim_length);
if (!skb)
return -ENOENT;
tim_ptr = skb->data + tim_offset;
@@ -665,8 +644,7 @@ void wfx_suspend_resume_mc(struct wfx_vif *wvif, enum sta_notify_cmd notify_cmd)
wfx_bh_request_tx(wvif->wdev);
}

-int wfx_ampdu_action(struct ieee80211_hw *hw,
- struct ieee80211_vif *vif,
+int wfx_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
struct ieee80211_ampdu_params *params)
{
/* Aggregation is implemented fully in firmware */
@@ -681,20 +659,16 @@ int wfx_ampdu_action(struct ieee80211_hw *hw,
}
}

-int wfx_add_chanctx(struct ieee80211_hw *hw,
- struct ieee80211_chanctx_conf *conf)
+int wfx_add_chanctx(struct ieee80211_hw *hw, struct ieee80211_chanctx_conf *conf)
{
return 0;
}

-void wfx_remove_chanctx(struct ieee80211_hw *hw,
- struct ieee80211_chanctx_conf *conf)
+void wfx_remove_chanctx(struct ieee80211_hw *hw, struct ieee80211_chanctx_conf *conf)
{
}

-void wfx_change_chanctx(struct ieee80211_hw *hw,
- struct ieee80211_chanctx_conf *conf,
- u32 changed)
+void wfx_change_chanctx(struct ieee80211_hw *hw, struct ieee80211_chanctx_conf *conf, u32 changed)
{
}

@@ -710,8 +684,7 @@ int wfx_assign_vif_chanctx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
return 0;
}

-void wfx_unassign_vif_chanctx(struct ieee80211_hw *hw,
- struct ieee80211_vif *vif,
+void wfx_unassign_vif_chanctx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
struct ieee80211_chanctx_conf *conf)
{
struct wfx_vif *wvif = (struct wfx_vif *)vif->drv_priv;
diff --git a/drivers/staging/wfx/sta.h b/drivers/staging/wfx/sta.h
index 4d7e38be4235..082329d7bbcd 100644
--- a/drivers/staging/wfx/sta.h
+++ b/drivers/staging/wfx/sta.h
@@ -23,8 +23,7 @@ int wfx_start(struct ieee80211_hw *hw);
void wfx_stop(struct ieee80211_hw *hw);
int wfx_config(struct ieee80211_hw *hw, u32 changed);
int wfx_set_rts_threshold(struct ieee80211_hw *hw, u32 value);
-void wfx_set_default_unicast_key(struct ieee80211_hw *hw,
- struct ieee80211_vif *vif, int idx);
+void wfx_set_default_unicast_key(struct ieee80211_hw *hw, struct ieee80211_vif *vif, int idx);
void wfx_configure_filter(struct ieee80211_hw *hw, unsigned int changed_flags,
unsigned int *total_flags, u64 unused);

@@ -38,25 +37,20 @@ int wfx_conf_tx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
u16 queue, const struct ieee80211_tx_queue_params *params);
void wfx_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
struct ieee80211_bss_conf *info, u32 changed);
-int wfx_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
- struct ieee80211_sta *sta);
-int wfx_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
- struct ieee80211_sta *sta);
+int wfx_sta_add(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_sta *sta);
+int wfx_sta_remove(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct ieee80211_sta *sta);
void wfx_sta_notify(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
enum sta_notify_cmd cmd, struct ieee80211_sta *sta);
int wfx_set_tim(struct ieee80211_hw *hw, struct ieee80211_sta *sta, bool set);
int wfx_ampdu_action(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
struct ieee80211_ampdu_params *params);
-int wfx_add_chanctx(struct ieee80211_hw *hw,
- struct ieee80211_chanctx_conf *conf);
-void wfx_remove_chanctx(struct ieee80211_hw *hw,
- struct ieee80211_chanctx_conf *conf);
-void wfx_change_chanctx(struct ieee80211_hw *hw,
- struct ieee80211_chanctx_conf *conf, u32 changed);
+int wfx_add_chanctx(struct ieee80211_hw *hw, struct ieee80211_chanctx_conf *conf);
+void wfx_remove_chanctx(struct ieee80211_hw *hw, struct ieee80211_chanctx_conf *conf);
+void wfx_change_chanctx(struct ieee80211_hw *hw, struct ieee80211_chanctx_conf *conf,
+ u32 changed);
int wfx_assign_vif_chanctx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
struct ieee80211_chanctx_conf *conf);
-void wfx_unassign_vif_chanctx(struct ieee80211_hw *hw,
- struct ieee80211_vif *vif,
+void wfx_unassign_vif_chanctx(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
struct ieee80211_chanctx_conf *conf);

/* Hardware API Callbacks */
diff --git a/drivers/staging/wfx/traces.h b/drivers/staging/wfx/traces.h
index 99bd1808111e..9fbf0081dbf7 100644
--- a/drivers/staging/wfx/traces.h
+++ b/drivers/staging/wfx/traces.h
@@ -190,8 +190,7 @@ DECLARE_EVENT_CLASS(hif_data,
__entry->mib = -1;
header_len = 0;
}
- __entry->buf_len = min_t(int, __entry->msg_len,
- sizeof(__entry->buf))
+ __entry->buf_len = min_t(int, __entry->msg_len, sizeof(__entry->buf))
- sizeof(struct wfx_hif_msg) - header_len;
memcpy(__entry->buf, hif->body + header_len, __entry->buf_len);
),
@@ -250,8 +249,7 @@ DECLARE_EVENT_CLASS(io_data,
__entry->reg = reg;
__entry->addr = addr;
__entry->msg_len = len;
- __entry->buf_len = min_t(int, sizeof(__entry->buf),
- __entry->msg_len);
+ __entry->buf_len = min_t(int, sizeof(__entry->buf), __entry->msg_len);
memcpy(__entry->buf, io_buf, __entry->buf_len);
if (addr >= 0)
snprintf(__entry->addr_str, 10, "/%08x", addr);
@@ -379,8 +377,7 @@ TRACE_EVENT(tx_stats,
),
TP_fast_assign(
/* Keep sync with wfx_rates definition in main.c */
- static const int hw_rate[] = { 0, 1, 2, 3, 6, 7, 8, 9,
- 10, 11, 12, 13 };
+ static const int hw_rate[] = { 0, 1, 2, 3, 6, 7, 8, 9, 10, 11, 12, 13 };
const struct ieee80211_tx_info *tx_info =
(const struct ieee80211_tx_info *)skb->cb;
const struct ieee80211_tx_rate *rates = tx_info->driver_rates;
@@ -420,9 +417,8 @@ TRACE_EVENT(tx_stats,
TP_printk("packet ID: %08x, rate policy: %s %d|%d %d|%d %d|%d %d|%d -> %d attempt, Delays media/queue/total: %4dus/%4dus/%4dus",
__entry->pkt_id,
__print_flags(__entry->flags, NULL,
- { 0x01, "M" }, { 0x02, "S" }, { 0x04, "G" },
- { 0x08, "R" }, { 0x10, "D" }, { 0x20, "F" },
- { 0x40, "Q" }),
+ { 0x01, "M" }, { 0x02, "S" }, { 0x04, "G" }, { 0x08, "R" },
+ { 0x10, "D" }, { 0x20, "F" }, { 0x40, "Q" }),
__entry->rate[0],
__entry->tx_count[0],
__entry->rate[1],
diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h
index 189b96cd3d13..565874815aa8 100644
--- a/drivers/staging/wfx/wfx.h
+++ b/drivers/staging/wfx/wfx.h
@@ -104,8 +104,7 @@ static inline struct wfx_vif *wdev_to_wvif(struct wfx_dev *wdev, int vif_id)
return (struct wfx_vif *)wdev->vif[vif_id]->drv_priv;
}

-static inline struct wfx_vif *wvif_iterate(struct wfx_dev *wdev,
- struct wfx_vif *cur)
+static inline struct wfx_vif *wvif_iterate(struct wfx_dev *wdev, struct wfx_vif *cur)
{
int i;
int mark = 0;
--
2.34.1

2022-01-13 08:57:37

by Jérôme Pouiller

[permalink] [raw]
Subject: [PATCH 21/31] staging: wfx: reformat comments on 100 columns

From: Jérôme Pouiller <[email protected]>

Until now, this driver was written in 80 columns style. However, since
all the functions are prefixed with "wfx_", this constraint is no more
respected in the last patches.

From the perspective of kernel Coding Style, it is not a problem since
it is now allowed to write code on 100 columns.

This patch just unify the code to use 100 columns in every comments.

Signed-off-by: Jérôme Pouiller <[email protected]>
---
drivers/staging/wfx/bh.c | 26 ++++++++++-------------
drivers/staging/wfx/bus_spi.c | 14 ++++++-------
drivers/staging/wfx/data_rx.c | 4 ++--
drivers/staging/wfx/data_tx.c | 13 ++++++------
drivers/staging/wfx/debug.c | 10 ++++-----
drivers/staging/wfx/fwio.c | 16 ++++++---------
drivers/staging/wfx/hif_api_cmd.h | 8 ++++----
drivers/staging/wfx/hif_rx.c | 4 +---
drivers/staging/wfx/hif_tx.c | 16 ++++++---------
drivers/staging/wfx/hwio.h | 5 ++---
drivers/staging/wfx/main.c | 22 +++++++++-----------
drivers/staging/wfx/main.h | 4 ++--
drivers/staging/wfx/queue.c | 5 ++---
drivers/staging/wfx/sta.c | 34 ++++++++++++-------------------
drivers/staging/wfx/traces.h | 9 ++++----
15 files changed, 79 insertions(+), 111 deletions(-)

diff --git a/drivers/staging/wfx/bh.c b/drivers/staging/wfx/bh.c
index b9a351913868..1ec4a4951d99 100644
--- a/drivers/staging/wfx/bh.c
+++ b/drivers/staging/wfx/bh.c
@@ -32,18 +32,15 @@ static void device_wakeup(struct wfx_dev *wdev)
}
for (;;) {
gpiod_set_value_cansleep(wdev->pdata.gpio_wakeup, 1);
- /* completion.h does not provide any function to wait
- * completion without consume it (a kind of
- * wait_for_completion_done_timeout()). So we have to emulate
- * it.
+ /* completion.h does not provide any function to wait completion without consume it
+ * (a kind of wait_for_completion_done_timeout()). So we have to emulate it.
*/
if (wait_for_completion_timeout(&wdev->hif.ctrl_ready, msecs_to_jiffies(2))) {
complete(&wdev->hif.ctrl_ready);
return;
} else if (max_retry-- > 0) {
- /* Older firmwares have a race in sleep/wake-up process.
- * Redo the process is sufficient to unfreeze the
- * chip.
+ /* Older firmwares have a race in sleep/wake-up process. Redo the process
+ * is sufficient to unfreeze the chip.
*/
dev_err(wdev->dev, "timeout while wake up chip\n");
gpiod_set_value_cansleep(wdev->pdata.gpio_wakeup, 0);
@@ -219,9 +216,9 @@ static int bh_work_tx(struct wfx_dev *wdev, int max_msg)
return i;
}

-/* In SDIO mode, it is necessary to make an access to a register to acknowledge
- * last received message. It could be possible to restrict this acknowledge to
- * SDIO mode and only if last operation was rx.
+/* In SDIO mode, it is necessary to make an access to a register to acknowledge last received
+ * message. It could be possible to restrict this acknowledge to SDIO mode and only if last
+ * operation was rx.
*/
static void ack_sdio_data(struct wfx_dev *wdev)
{
@@ -287,12 +284,11 @@ void wfx_bh_request_tx(struct wfx_dev *wdev)
queue_work(system_highpri_wq, &wdev->hif.bh);
}

-/* If IRQ is not available, this function allow to manually poll the control
- * register and simulate an IRQ ahen an event happened.
+/* If IRQ is not available, this function allow to manually poll the control register and simulate
+ * an IRQ ahen an event happened.
*
- * Note that the device has a bug: If an IRQ raise while host read control
- * register, the IRQ is lost. So, use this function carefully (only duing
- * device initialisation).
+ * Note that the device has a bug: If an IRQ raise while host read control register, the IRQ is
+ * lost. So, use this function carefully (only duing device initialisation).
*/
void wfx_bh_poll_irq(struct wfx_dev *wdev)
{
diff --git a/drivers/staging/wfx/bus_spi.c b/drivers/staging/wfx/bus_spi.c
index 43bc6e147d5f..fe39b4cb8194 100644
--- a/drivers/staging/wfx/bus_spi.c
+++ b/drivers/staging/wfx/bus_spi.c
@@ -38,13 +38,12 @@ struct wfx_spi_priv {
bool need_swab;
};

-/* The chip reads 16bits of data at time and place them directly into (little
- * endian) CPU register. So, the chip expects bytes order to be "B1 B0 B3 B2"
- * (while LE is "B0 B1 B2 B3" and BE is "B3 B2 B1 B0")
+/* The chip reads 16bits of data at time and place them directly into (little endian) CPU register.
+ * So, the chip expects bytes order to be "B1 B0 B3 B2" (while LE is "B0 B1 B2 B3" and BE is
+ * "B3 B2 B1 B0")
*
- * A little endian host with bits_per_word == 16 should do the right job
- * natively. The code below to support big endian host and commonly used SPI
- * 8bits.
+ * A little endian host with bits_per_word == 16 should do the right job natively. The code below to
+ * support big endian host and commonly used SPI 8bits.
*/
static int wfx_spi_copy_from_io(void *priv, unsigned int addr, void *dst, size_t count)
{
@@ -160,8 +159,7 @@ static int wfx_spi_irq_unsubscribe(void *priv)

static size_t wfx_spi_align_size(void *priv, size_t size)
{
- /* Most of SPI controllers avoid DMA if buffer size is not 32bit aligned
- */
+ /* Most of SPI controllers avoid DMA if buffer size is not 32bit aligned */
return ALIGN(size, 4);
}

diff --git a/drivers/staging/wfx/data_rx.c b/drivers/staging/wfx/data_rx.c
index 4beee2624998..a4b5ffe158e4 100644
--- a/drivers/staging/wfx/data_rx.c
+++ b/drivers/staging/wfx/data_rx.c
@@ -74,8 +74,8 @@ void wfx_rx_cb(struct wfx_vif *wvif, const struct wfx_hif_ind_rx *arg, struct sk
if (arg->encryp)
hdr->flag |= RX_FLAG_DECRYPTED;

- /* Block ack negotiation is offloaded by the firmware. However,
- * re-ordering must be done by the mac80211.
+ /* Block ack negotiation is offloaded by the firmware. However, re-ordering must be done by
+ * the mac80211.
*/
if (ieee80211_is_action(frame->frame_control) &&
mgmt->u.action.category == WLAN_CATEGORY_BACK &&
diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c
index 0bfbf57cc035..ca2f24b92d24 100644
--- a/drivers/staging/wfx/data_tx.c
+++ b/drivers/staging/wfx/data_tx.c
@@ -30,8 +30,8 @@ static int wfx_get_hw_rate(struct wfx_dev *wdev, const struct ieee80211_tx_rate
}
return rate->idx + 14;
}
- /* The device only support 2GHz, else band information should be
- * retrieved from ieee80211_tx_info
+ /* The device only support 2GHz, else band information should be retrieved from
+ * ieee80211_tx_info
*/
band = wdev->hw->wiphy->bands[NL80211_BAND_2GHZ];
if (rate->idx >= band->n_bitrates) {
@@ -356,9 +356,8 @@ static int wfx_tx_inner(struct wfx_vif *wvif, struct ieee80211_sta *sta, struct

/* Fill tx request */
req = (struct wfx_hif_req_tx *)hif_msg->body;
- /* packet_id just need to be unique on device. 32bits are more than
- * necessary for that task, so we tae advantage of it to add some extra
- * data for debug.
+ /* packet_id just need to be unique on device. 32bits are more than necessary for that task,
+ * so we take advantage of it to add some extra data for debug.
*/
req->packet_id = atomic_add_return(1, &wvif->wdev->packet_id) & 0xFFFF;
req->packet_id |= IEEE80211_SEQ_TO_SN(le16_to_cpu(hdr->seq_ctrl)) << 16;
@@ -402,8 +401,8 @@ void wfx_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control, struc
wvif = wvif_iterate(wdev, NULL);
if (WARN_ON(!wvif))
goto drop;
- /* Because of TX_AMPDU_SETUP_IN_HW, mac80211 does not try to send any
- * BlockAck session management frame. The check below exist just in case.
+ /* Because of TX_AMPDU_SETUP_IN_HW, mac80211 does not try to send any BlockAck session
+ * management frame. The check below exist just in case.
*/
if (wfx_is_action_back(hdr)) {
dev_info(wdev->dev, "drop BA action\n");
diff --git a/drivers/staging/wfx/debug.c b/drivers/staging/wfx/debug.c
index 210e2336d43a..c62cb5fea4eb 100644
--- a/drivers/staging/wfx/debug.c
+++ b/drivers/staging/wfx/debug.c
@@ -250,9 +250,9 @@ static ssize_t wfx_send_hif_msg_write(struct file *file, const char __user *user
if (count < sizeof(struct wfx_hif_msg))
return -EINVAL;

- /* wfx_cmd_send() checks that reply buffer is wide enough, but does not
- * return precise length read. User have to know how many bytes should
- * be read. Filling reply buffer with a memory pattern may help user.
+ /* wfx_cmd_send() checks that reply buffer is wide enough, but does not return precise
+ * length read. User have to know how many bytes should be read. Filling reply buffer with a
+ * memory pattern may help user.
*/
memset(context->reply, 0xFF, sizeof(context->reply));
request = memdup_user(user_buf, count);
@@ -282,9 +282,7 @@ static ssize_t wfx_send_hif_msg_read(struct file *file, char __user *user_buf,
return ret;
if (context->ret < 0)
return context->ret;
- /* Be careful, write() is waiting for a full message while read()
- * only returns a payload
- */
+ /* Be careful, write() is waiting for a full message while read() only returns a payload */
if (copy_to_user(user_buf, context->reply, count))
return -EFAULT;

diff --git a/drivers/staging/wfx/fwio.c b/drivers/staging/wfx/fwio.c
index 89a46fb0e789..24c314b10b95 100644
--- a/drivers/staging/wfx/fwio.c
+++ b/drivers/staging/wfx/fwio.c
@@ -69,15 +69,13 @@ static const char * const fwio_errors[] = {
[ERR_MAC_KEY] = "MAC key not initialized",
};

-/* request_firmware() allocate data using vmalloc(). It is not compatible with
- * underlying hardware that use DMA. Function below detect this case and
- * allocate a bounce buffer if necessary.
+/* request_firmware() allocate data using vmalloc(). It is not compatible with underlying hardware
+ * that use DMA. Function below detect this case and allocate a bounce buffer if necessary.
*
- * Notice that, in doubt, you can enable CONFIG_DEBUG_SG to ask kernel to
- * detect this problem at runtime (else, kernel silently fail).
+ * Notice that, in doubt, you can enable CONFIG_DEBUG_SG to ask kernel to detect this problem at
+ * runtime (else, kernel silently fail).
*
- * NOTE: it may also be possible to use 'pages' from struct firmware and avoid
- * bounce buffer
+ * NOTE: it may also be possible to use 'pages' from struct firmware and avoid bounce buffer
*/
static int wfx_sram_write_dma_safe(struct wfx_dev *wdev, u32 addr, const u8 *buf, size_t len)
{
@@ -202,9 +200,7 @@ static int upload_firmware(struct wfx_dev *wdev, const u8 *data, size_t len)
if (ret < 0)
return ret;

- /* The device seems to not support writing 0 in this register
- * during first loop
- */
+ /* The device seems to not support writing 0 in this register during first loop */
offs += DNLD_BLOCK_SIZE;
ret = wfx_sram_reg_write(wdev, WFX_DCA_PUT, offs);
if (ret < 0)
diff --git a/drivers/staging/wfx/hif_api_cmd.h b/drivers/staging/wfx/hif_api_cmd.h
index 463532b25939..444ff7ed882d 100644
--- a/drivers/staging/wfx/hif_api_cmd.h
+++ b/drivers/staging/wfx/hif_api_cmd.h
@@ -174,8 +174,8 @@ enum wfx_hif_frame_format {
};

struct wfx_hif_req_tx {
- /* packet_id is not interpreted by the device, so it is not necessary to
- * declare it little endian
+ /* packet_id is not interpreted by the device, so it is not necessary to declare it little
+ * endian
*/
u32 packet_id;
u8 max_tx_rate;
@@ -212,8 +212,8 @@ enum wfx_hif_qos_ackplcy {

struct wfx_hif_cnf_tx {
__le32 status;
- /* packet_id is copied from struct wfx_hif_req_tx without been interpreted
- * by the device, so it is not necessary to declare it little endian
+ /* packet_id is copied from struct wfx_hif_req_tx without been interpreted by the device, so
+ * it is not necessary to declare it little endian
*/
u32 packet_id;
u8 txed_rate;
diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/staging/wfx/hif_rx.c
index 1ddf8c51c303..5300ef57413f 100644
--- a/drivers/staging/wfx/hif_rx.c
+++ b/drivers/staging/wfx/hif_rx.c
@@ -371,9 +371,7 @@ void wfx_handle_rx(struct wfx_dev *wdev, struct sk_buff *skb)
wfx_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) {
wfx_hif_generic_confirm(wdev, hif, hif->body);
diff --git a/drivers/staging/wfx/hif_tx.c b/drivers/staging/wfx/hif_tx.c
index b88a73077b48..ea2582714bb9 100644
--- a/drivers/staging/wfx/hif_tx.c
+++ b/drivers/staging/wfx/hif_tx.c
@@ -61,8 +61,8 @@ int wfx_cmd_send(struct wfx_dev *wdev, struct wfx_hif_msg *request,
mutex_lock(&wdev->hif_cmd.lock);
WARN(wdev->hif_cmd.buf_send, "data locking error");

- /* Note: call to complete() below has an implicit memory barrier that
- * hopefully protect buf_send
+ /* Note: call to complete() below has an implicit memory barrier that hopefully protect
+ * buf_send
*/
wdev->hif_cmd.buf_send = request;
wdev->hif_cmd.buf_recv = reply;
@@ -72,9 +72,7 @@ int wfx_cmd_send(struct wfx_dev *wdev, struct wfx_hif_msg *request,
wfx_bh_request_tx(wdev);

if (no_reply) {
- /* Chip won't reply. Give enough time to the wq to send the
- * buffer.
- */
+ /* Chip won't reply. Give enough time to the wq to send the buffer. */
msleep(100);
wdev->hif_cmd.buf_send = NULL;
mutex_unlock(&wdev->hif_cmd.lock);
@@ -118,8 +116,8 @@ int wfx_cmd_send(struct wfx_dev *wdev, struct wfx_hif_msg *request,
return ret;
}

-/* This function is special. After HIF_REQ_ID_SHUT_DOWN, chip won't reply to any
- * request anymore. Obviously, only call this function during device unregister.
+/* This function is special. After HIF_REQ_ID_SHUT_DOWN, chip won't reply to any request anymore.
+ * Obviously, only call this function during device unregister.
*/
int wfx_hif_shutdown(struct wfx_dev *wdev)
{
@@ -340,9 +338,7 @@ int wfx_hif_add_key(struct wfx_dev *wdev, const struct wfx_hif_req_add_key *arg)
/* FIXME: swap bytes as necessary in body */
memcpy(body, arg, sizeof(*body));
if (wfx_api_older_than(wdev, 1, 5))
- /* Legacy firmwares expect that add_key to be sent on right
- * interface.
- */
+ /* Legacy firmwares expect that add_key to be sent on right interface. */
wfx_fill_header(hif, arg->int_id, HIF_REQ_ID_ADD_KEY, sizeof(*body));
else
wfx_fill_header(hif, -1, HIF_REQ_ID_ADD_KEY, sizeof(*body));
diff --git a/drivers/staging/wfx/hwio.h b/drivers/staging/wfx/hwio.h
index 8c8fe76871f8..c6e7b065b7ff 100644
--- a/drivers/staging/wfx/hwio.h
+++ b/drivers/staging/wfx/hwio.h
@@ -12,9 +12,8 @@

struct wfx_dev;

-/* Caution: in the functions below, 'buf' will used with a DMA. So, it must be
- * kmalloc'd (do not use stack allocated buffers). In doubt, enable
- * CONFIG_DEBUG_SG to detect badly located buffer.
+/* Caution: in the functions below, 'buf' will used with a DMA. So, it must be kmalloc'd (do not use
+ * stack allocated buffers). In doubt, enable CONFIG_DEBUG_SG to detect badly located buffer.
*/
int wfx_data_read(struct wfx_dev *wdev, void *buf, size_t buf_len);
int wfx_data_write(struct wfx_dev *wdev, const void *buf, size_t buf_len);
diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c
index 6b9ae67da286..028d7e53d66e 100644
--- a/drivers/staging/wfx/main.c
+++ b/drivers/staging/wfx/main.c
@@ -162,19 +162,17 @@ bool wfx_api_older_than(struct wfx_dev *wdev, int major, int minor)
return false;
}

-/* The device needs data about the antenna configuration. This information in
- * provided by PDS (Platform Data Set, this is the wording used in WF200
- * documentation) files. For hardware integrators, the full process to create
- * PDS files is described here:
+/* The device needs data about the antenna configuration. This information in provided by PDS
+ * (Platform Data Set, this is the wording used in WF200 documentation) files. For hardware
+ * integrators, the full process to create PDS files is described here:
* https:github.com/SiliconLabs/wfx-firmware/blob/master/PDS/README.md
*
- * So this function aims to send PDS to the device. However, the PDS file is
- * often bigger than Rx buffers of the chip, so it has to be sent in multiple
- * parts.
+ * So this function aims to send PDS to the device. However, the PDS file is often bigger than Rx
+ * buffers of the chip, so it has to be sent in multiple parts.
*
- * In add, the PDS data cannot be split anywhere. The PDS files contains tree
- * structures. Braces are used to enter/leave a level of the tree (in a JSON
- * fashion). PDS files can only been split between root nodes.
+ * In add, the PDS data cannot be split anywhere. The PDS files contains tree structures. Braces are
+ * used to enter/leave a level of the tree (in a JSON fashion). PDS files can only been split
+ * between root nodes.
*/
int wfx_send_pds(struct wfx_dev *wdev, u8 *buf, size_t len)
{
@@ -341,8 +339,8 @@ int wfx_probe(struct wfx_dev *wdev)
int err;
struct gpio_desc *gpio_saved;

- /* During first part of boot, gpio_wakeup cannot yet been used. So
- * prevent bh() to touch it.
+ /* During first part of boot, gpio_wakeup cannot yet been used. So prevent bh() to touch
+ * it.
*/
gpio_saved = wdev->pdata.gpio_wakeup;
wdev->pdata.gpio_wakeup = NULL;
diff --git a/drivers/staging/wfx/main.h b/drivers/staging/wfx/main.h
index def6270bf10d..68c665307153 100644
--- a/drivers/staging/wfx/main.h
+++ b/drivers/staging/wfx/main.h
@@ -23,8 +23,8 @@ struct wfx_platform_data {
const char *file_fw;
const char *file_pds;
struct gpio_desc *gpio_wakeup;
- /* if true HIF D_out is sampled on the rising edge of the clock
- * (intended to be used in 50Mhz SDIO)
+ /* if true HIF D_out is sampled on the rising edge of the clock (intended to be used in
+ * 50Mhz SDIO)
*/
bool use_rising_clk;
};
diff --git a/drivers/staging/wfx/queue.c b/drivers/staging/wfx/queue.c
index 9b49e41f06ce..9186726ff07f 100644
--- a/drivers/staging/wfx/queue.c
+++ b/drivers/staging/wfx/queue.c
@@ -59,9 +59,8 @@ void wfx_tx_lock_flush(struct wfx_dev *wdev)

void wfx_tx_queues_init(struct wfx_vif *wvif)
{
- /* The device is in charge to respect the details of the QoS parameters.
- * The driver just ensure that it roughtly respect the priorities to
- * avoid any shortage.
+ /* The device is in charge to respect the details of the QoS parameters. The driver just
+ * ensure that it roughtly respect the priorities to avoid any shortage.
*/
const int priorities[IEEE80211_NUM_ACS] = { 1, 2, 64, 128 };
int i;
diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index 07054666fe76..f64adba350eb 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -107,8 +107,8 @@ void wfx_configure_filter(struct ieee80211_hw *hw, unsigned int changed_flags,
* - PS-Poll (FIF_PSPOLL) are never filtered
* - RTS, CTS and Ack (FIF_CONTROL) are always filtered
* - Broken frames (FIF_FCSFAIL and FIF_PLCPFAIL) are always filtered
- * - Firmware does (yet) allow to forward unicast traffic sent to
- * other stations (aka. promiscuous mode)
+ * - Firmware does (yet) allow to forward unicast traffic sent to other stations (aka.
+ * promiscuous mode)
*/
*total_flags &= FIF_BCN_PRBRESP_PROMISC | FIF_ALLMULTI | FIF_OTHER_BSS |
FIF_PROBE_REQ | FIF_PSPOLL;
@@ -168,9 +168,7 @@ static int wfx_get_ps_timeout(struct wfx_vif *wvif, bool *enable_ps)
dev_info(wvif->wdev->dev, "ignoring requested PS mode");
return -1;
}
- /* It is necessary to enable PS if channels
- * are different.
- */
+ /* It is necessary to enable PS if channels are different. */
if (enable_ps)
*enable_ps = true;
if (wvif->wdev->force_ps_timeout > -1)
@@ -429,10 +427,9 @@ static void wfx_join(struct wfx_vif *wvif)
ieee80211_connection_loss(wvif->vif);
wfx_reset(wvif);
} else {
- /* Due to beacon filtering it is possible that the
- * AP's beacon is not known for the mac80211 stack.
- * Disable filtering temporary to make sure the stack
- * receives at least one
+ /* Due to beacon filtering it is possible that the AP's beacon is not known for the
+ * mac80211 stack. Disable filtering temporary to make sure the stack receives at
+ * least one
*/
wfx_filter_beacon(wvif, false);
}
@@ -459,9 +456,7 @@ static void wfx_join_finalize(struct wfx_vif *wvif,
wvif->join_in_progress = false;
wfx_hif_set_association_mode(wvif, ampdu_density, greenfield, info->use_short_preamble);
wfx_hif_keep_alive_period(wvif, 0);
- /* beacon_loss_count is defined to 7 in net/mac80211/mlme.c. Let's use
- * the same value.
- */
+ /* beacon_loss_count is defined to 7 in net/mac80211/mlme.c. Let's use the same value. */
wfx_hif_set_bss_params(wvif, info->aid, 7);
wfx_hif_set_beacon_wakeup_period(wvif, 1, 1);
wfx_update_pm(wvif);
@@ -485,10 +480,9 @@ void wfx_leave_ibss(struct ieee80211_hw *hw, struct ieee80211_vif *vif)

static void wfx_enable_beacon(struct wfx_vif *wvif, bool enable)
{
- /* Driver has Content After DTIM Beacon in queue. Driver is waiting for
- * a signal from the firmware. Since we are going to stop to send
- * beacons, this signal will never happens. See also
- * wfx_suspend_resume_mc()
+ /* Driver has Content After DTIM Beacon in queue. Driver is waiting for a signal from the
+ * firmware. Since we are going to stop to send beacons, this signal will never happens. See
+ * also wfx_suspend_resume_mc()
*/
if (!enable && wfx_tx_queues_has_cab(wvif)) {
wvif->after_dtim_tx_allowed = true;
@@ -527,9 +521,7 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
if (vif->type != NL80211_IFTYPE_STATION)
dev_warn(wdev->dev, "%s: misunderstood change: BEACON_INFO\n", __func__);
wfx_hif_set_beacon_wakeup_period(wvif, info->dtim_period, info->dtim_period);
- /* We temporary forwarded beacon for join process. It is now no
- * more necessary.
- */
+ /* We temporary forwarded beacon for join process. It is now no more necessary. */
wfx_filter_beacon(wvif, true);
}

@@ -629,8 +621,8 @@ void wfx_suspend_resume_mc(struct wfx_vif *wvif, enum sta_notify_cmd notify_cmd)
if (notify_cmd != STA_NOTIFY_AWAKE)
return;

- /* Device won't be able to honor CAB if a scan is in progress on any
- * interface. Prefer to skip this DTIM and wait for the next one.
+ /* Device won't be able to honor CAB if a scan is in progress on any interface. Prefer to
+ * skip this DTIM and wait for the next one.
*/
wvif_it = NULL;
while ((wvif_it = wvif_iterate(wvif->wdev, wvif_it)) != NULL)
diff --git a/drivers/staging/wfx/traces.h b/drivers/staging/wfx/traces.h
index 9fbf0081dbf7..e011e8a46bd5 100644
--- a/drivers/staging/wfx/traces.h
+++ b/drivers/staging/wfx/traces.h
@@ -18,8 +18,8 @@
#include "hif_api_cmd.h"
#include "hif_api_mib.h"

-/* The hell below need some explanations. For each symbolic number, we need to
- * define it with TRACE_DEFINE_ENUM() and in a list for __print_symbolic.
+/* The hell below need some explanations. For each symbolic number, we need to define it with
+ * TRACE_DEFINE_ENUM() and in a list for __print_symbolic.
*
* 1. Define a new macro that call TRACE_DEFINE_ENUM():
*
@@ -41,9 +41,8 @@
* #undef xxx_name
* #define xxx_name(msg) { msg, #msg },
*
- * 5. list_name can now nearly be used with __print_symbolic() but,
- * __print_symbolic() dislike last comma of list. So we define a new list
- * with a dummy element:
+ * 5. list_name can now nearly be used with __print_symbolic() but, __print_symbolic() dislike
+ * last comma of list. So we define a new list with a dummy element:
*
* #define list_for_print_symbolic list_names { -1, NULL }
*/
--
2.34.1

2022-01-13 08:57:47

by Jérôme Pouiller

[permalink] [raw]
Subject: [PATCH 22/31] staging: wfx: fix structs alignments

From: Jérôme Pouiller <[email protected]>

Some structs members were not properly aligned.

Signed-off-by: Jérôme Pouiller <[email protected]>
---
drivers/staging/wfx/bus_sdio.c | 12 ++---
drivers/staging/wfx/bus_spi.c | 12 ++---
drivers/staging/wfx/debug.c | 2 +-
drivers/staging/wfx/fwio.c | 6 +--
drivers/staging/wfx/main.c | 54 +++++++++++------------
drivers/staging/wfx/queue.h | 8 ++--
drivers/staging/wfx/wfx.h | 80 +++++++++++++++++-----------------
7 files changed, 87 insertions(+), 87 deletions(-)

diff --git a/drivers/staging/wfx/bus_sdio.c b/drivers/staging/wfx/bus_sdio.c
index a3da661e355c..4b77df2f463e 100644
--- a/drivers/staging/wfx/bus_sdio.c
+++ b/drivers/staging/wfx/bus_sdio.c
@@ -157,13 +157,13 @@ static size_t wfx_sdio_align_size(void *priv, size_t size)
}

static const struct wfx_hwbus_ops wfx_sdio_hwbus_ops = {
- .copy_from_io = wfx_sdio_copy_from_io,
- .copy_to_io = wfx_sdio_copy_to_io,
- .irq_subscribe = wfx_sdio_irq_subscribe,
+ .copy_from_io = wfx_sdio_copy_from_io,
+ .copy_to_io = wfx_sdio_copy_to_io,
+ .irq_subscribe = wfx_sdio_irq_subscribe,
.irq_unsubscribe = wfx_sdio_irq_unsubscribe,
- .lock = wfx_sdio_lock,
- .unlock = wfx_sdio_unlock,
- .align_size = wfx_sdio_align_size,
+ .lock = wfx_sdio_lock,
+ .unlock = wfx_sdio_unlock,
+ .align_size = wfx_sdio_align_size,
};

static const struct of_device_id wfx_sdio_of_match[] = {
diff --git a/drivers/staging/wfx/bus_spi.c b/drivers/staging/wfx/bus_spi.c
index fe39b4cb8194..417bb74c88b9 100644
--- a/drivers/staging/wfx/bus_spi.c
+++ b/drivers/staging/wfx/bus_spi.c
@@ -164,13 +164,13 @@ static size_t wfx_spi_align_size(void *priv, size_t size)
}

static const struct wfx_hwbus_ops wfx_spi_hwbus_ops = {
- .copy_from_io = wfx_spi_copy_from_io,
- .copy_to_io = wfx_spi_copy_to_io,
- .irq_subscribe = wfx_spi_irq_subscribe,
+ .copy_from_io = wfx_spi_copy_from_io,
+ .copy_to_io = wfx_spi_copy_to_io,
+ .irq_subscribe = wfx_spi_irq_subscribe,
.irq_unsubscribe = wfx_spi_irq_unsubscribe,
- .lock = wfx_spi_lock,
- .unlock = wfx_spi_unlock,
- .align_size = wfx_spi_align_size,
+ .lock = wfx_spi_lock,
+ .unlock = wfx_spi_unlock,
+ .align_size = wfx_spi_align_size,
};

static int wfx_spi_probe(struct spi_device *func)
diff --git a/drivers/staging/wfx/debug.c b/drivers/staging/wfx/debug.c
index c62cb5fea4eb..ae7895ea36d9 100644
--- a/drivers/staging/wfx/debug.c
+++ b/drivers/staging/wfx/debug.c
@@ -75,7 +75,7 @@ static int wfx_counters_show(struct seq_file *seq, void *v)
seq_printf(seq, "%-24s %12s %12s %12s\n", "", "global", "iface 0", "iface 1");

#define PUT_COUNTER(name) \
- seq_printf(seq, "%-24s %12d %12d %12d\n", #name, \
+ seq_printf(seq, "%-24s %12d %12d %12d\n", #name, \
le32_to_cpu(counters[2].count_##name), \
le32_to_cpu(counters[0].count_##name), \
le32_to_cpu(counters[1].count_##name))
diff --git a/drivers/staging/wfx/fwio.c b/drivers/staging/wfx/fwio.c
index 24c314b10b95..9005a6fe48c8 100644
--- a/drivers/staging/wfx/fwio.c
+++ b/drivers/staging/wfx/fwio.c
@@ -64,9 +64,9 @@
static const char * const fwio_errors[] = {
[ERR_INVALID_SEC_TYPE] = "Invalid section type or wrong encryption",
[ERR_SIG_VERIF_FAILED] = "Signature verification failed",
- [ERR_AES_CTRL_KEY] = "AES control key not initialized",
- [ERR_ECC_PUB_KEY] = "ECC public key not initialized",
- [ERR_MAC_KEY] = "MAC key not initialized",
+ [ERR_AES_CTRL_KEY] = "AES control key not initialized",
+ [ERR_ECC_PUB_KEY] = "ECC public key not initialized",
+ [ERR_MAC_KEY] = "MAC key not initialized",
};

/* request_firmware() allocate data using vmalloc(). It is not compatible with underlying hardware
diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c
index 028d7e53d66e..217c0c5c60d1 100644
--- a/drivers/staging/wfx/main.c
+++ b/drivers/staging/wfx/main.c
@@ -121,34 +121,34 @@ static const struct ieee80211_iface_combination wfx_iface_combinations[] = {
};

static const struct ieee80211_ops wfx_ops = {
- .start = wfx_start,
- .stop = wfx_stop,
- .add_interface = wfx_add_interface,
- .remove_interface = wfx_remove_interface,
- .config = wfx_config,
- .tx = wfx_tx,
- .join_ibss = wfx_join_ibss,
- .leave_ibss = wfx_leave_ibss,
- .conf_tx = wfx_conf_tx,
- .hw_scan = wfx_hw_scan,
- .cancel_hw_scan = wfx_cancel_hw_scan,
- .start_ap = wfx_start_ap,
- .stop_ap = wfx_stop_ap,
- .sta_add = wfx_sta_add,
- .sta_remove = wfx_sta_remove,
- .set_tim = wfx_set_tim,
- .set_key = wfx_set_key,
- .set_rts_threshold = wfx_set_rts_threshold,
+ .start = wfx_start,
+ .stop = wfx_stop,
+ .add_interface = wfx_add_interface,
+ .remove_interface = wfx_remove_interface,
+ .config = wfx_config,
+ .tx = wfx_tx,
+ .join_ibss = wfx_join_ibss,
+ .leave_ibss = wfx_leave_ibss,
+ .conf_tx = wfx_conf_tx,
+ .hw_scan = wfx_hw_scan,
+ .cancel_hw_scan = wfx_cancel_hw_scan,
+ .start_ap = wfx_start_ap,
+ .stop_ap = wfx_stop_ap,
+ .sta_add = wfx_sta_add,
+ .sta_remove = wfx_sta_remove,
+ .set_tim = wfx_set_tim,
+ .set_key = wfx_set_key,
+ .set_rts_threshold = wfx_set_rts_threshold,
.set_default_unicast_key = wfx_set_default_unicast_key,
- .bss_info_changed = wfx_bss_info_changed,
- .configure_filter = wfx_configure_filter,
- .ampdu_action = wfx_ampdu_action,
- .flush = wfx_flush,
- .add_chanctx = wfx_add_chanctx,
- .remove_chanctx = wfx_remove_chanctx,
- .change_chanctx = wfx_change_chanctx,
- .assign_vif_chanctx = wfx_assign_vif_chanctx,
- .unassign_vif_chanctx = wfx_unassign_vif_chanctx,
+ .bss_info_changed = wfx_bss_info_changed,
+ .configure_filter = wfx_configure_filter,
+ .ampdu_action = wfx_ampdu_action,
+ .flush = wfx_flush,
+ .add_chanctx = wfx_add_chanctx,
+ .remove_chanctx = wfx_remove_chanctx,
+ .change_chanctx = wfx_change_chanctx,
+ .assign_vif_chanctx = wfx_assign_vif_chanctx,
+ .unassign_vif_chanctx = wfx_unassign_vif_chanctx,
};

bool wfx_api_older_than(struct wfx_dev *wdev, int major, int minor)
diff --git a/drivers/staging/wfx/queue.h b/drivers/staging/wfx/queue.h
index 2860c56fb933..4731debca93d 100644
--- a/drivers/staging/wfx/queue.h
+++ b/drivers/staging/wfx/queue.h
@@ -15,10 +15,10 @@ struct wfx_dev;
struct wfx_vif;

struct wfx_queue {
- struct sk_buff_head normal;
- struct sk_buff_head cab; /* Content After (DTIM) Beacon */
- atomic_t pending_frames;
- int priority;
+ struct sk_buff_head normal;
+ struct sk_buff_head cab; /* Content After (DTIM) Beacon */
+ atomic_t pending_frames;
+ int priority;
};

void wfx_tx_lock(struct wfx_dev *wdev);
diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h
index 565874815aa8..0fc8366d9fb3 100644
--- a/drivers/staging/wfx/wfx.h
+++ b/drivers/staging/wfx/wfx.h
@@ -28,68 +28,68 @@
struct wfx_hwbus_ops;

struct wfx_dev {
- struct wfx_platform_data pdata;
- struct device *dev;
- struct ieee80211_hw *hw;
- struct ieee80211_vif *vif[2];
- struct mac_address addresses[2];
+ struct wfx_platform_data pdata;
+ struct device *dev;
+ struct ieee80211_hw *hw;
+ struct ieee80211_vif *vif[2];
+ struct mac_address addresses[2];
const struct wfx_hwbus_ops *hwbus_ops;
- void *hwbus_priv;
+ void *hwbus_priv;

- u8 keyset;
- struct completion firmware_ready;
+ u8 keyset;
+ struct completion firmware_ready;
struct wfx_hif_ind_startup hw_caps;
- struct wfx_hif hif;
- struct delayed_work cooling_timeout_work;
- bool poll_irq;
- bool chip_frozen;
- struct mutex conf_mutex;
+ struct wfx_hif hif;
+ struct delayed_work cooling_timeout_work;
+ bool poll_irq;
+ bool chip_frozen;
+ struct mutex conf_mutex;

- struct wfx_hif_cmd hif_cmd;
- struct sk_buff_head tx_pending;
- wait_queue_head_t tx_dequeue;
- atomic_t tx_lock;
+ struct wfx_hif_cmd hif_cmd;
+ struct sk_buff_head tx_pending;
+ wait_queue_head_t tx_dequeue;
+ atomic_t tx_lock;

- atomic_t packet_id;
- u32 key_map;
+ atomic_t packet_id;
+ u32 key_map;

- struct wfx_hif_rx_stats rx_stats;
- struct mutex rx_stats_lock;
+ struct wfx_hif_rx_stats rx_stats;
+ struct mutex rx_stats_lock;
struct wfx_hif_tx_power_loop_info tx_power_loop_info;
- struct mutex tx_power_loop_info_lock;
+ struct mutex tx_power_loop_info_lock;
int force_ps_timeout;
};

struct wfx_vif {
- struct wfx_dev *wdev;
- struct ieee80211_vif *vif;
- struct ieee80211_channel *channel;
- int id;
+ struct wfx_dev *wdev;
+ struct ieee80211_vif *vif;
+ struct ieee80211_channel *channel;
+ int id;

- u32 link_id_map;
+ u32 link_id_map;

- bool after_dtim_tx_allowed;
- bool join_in_progress;
+ bool after_dtim_tx_allowed;
+ bool join_in_progress;

- struct delayed_work beacon_loss_work;
+ struct delayed_work beacon_loss_work;

- struct wfx_queue tx_queue[4];
+ struct wfx_queue tx_queue[4];
struct wfx_tx_policy_cache tx_policy_cache;
- struct work_struct tx_policy_upload_work;
+ struct work_struct tx_policy_upload_work;

- struct work_struct update_tim_work;
+ struct work_struct update_tim_work;

- unsigned long uapsd_mask;
+ unsigned long uapsd_mask;

/* avoid some operations in parallel with scan */
- struct mutex scan_lock;
- struct work_struct scan_work;
- struct completion scan_complete;
- int scan_nb_chan_done;
- bool scan_abort;
+ struct mutex scan_lock;
+ struct work_struct scan_work;
+ struct completion scan_complete;
+ int scan_nb_chan_done;
+ bool scan_abort;
struct ieee80211_scan_request *scan_req;

- struct completion set_pm_mode_complete;
+ struct completion set_pm_mode_complete;
};

static inline struct wfx_vif *wdev_to_wvif(struct wfx_dev *wdev, int vif_id)
--
2.34.1

2022-01-13 08:57:52

by Jérôme Pouiller

[permalink] [raw]
Subject: [PATCH 23/31] staging: wfx: use explicit labels for errors

From: Jérôme Pouiller <[email protected]>

Prefer fully named labels to handle errors instead of err0, err1, ...

Signed-off-by: Jérôme Pouiller <[email protected]>
---
drivers/staging/wfx/bus_sdio.c | 9 ++++-----
drivers/staging/wfx/main.c | 31 +++++++++++++++----------------
2 files changed, 19 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/wfx/bus_sdio.c b/drivers/staging/wfx/bus_sdio.c
index 4b77df2f463e..5c45ccd85a7d 100644
--- a/drivers/staging/wfx/bus_sdio.c
+++ b/drivers/staging/wfx/bus_sdio.c
@@ -214,26 +214,25 @@ static int wfx_sdio_probe(struct sdio_func *func, const struct sdio_device_id *i
sdio_set_block_size(func, 64);
sdio_release_host(func);
if (ret)
- goto err0;
+ return ret;

bus->core = wfx_init_common(&func->dev, &wfx_sdio_pdata,
&wfx_sdio_hwbus_ops, bus);
if (!bus->core) {
ret = -EIO;
- goto err1;
+ goto sdio_release;
}

ret = wfx_probe(bus->core);
if (ret)
- goto err1;
+ goto sdio_release;

return 0;

-err1:
+sdio_release:
sdio_claim_host(func);
sdio_disable_func(func);
sdio_release_host(func);
-err0:
return ret;
}

diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c
index 217c0c5c60d1..46fd5702e471 100644
--- a/drivers/staging/wfx/main.c
+++ b/drivers/staging/wfx/main.c
@@ -232,18 +232,17 @@ static int wfx_send_pdata_pds(struct wfx_dev *wdev)
if (ret) {
dev_err(wdev->dev, "can't load antenna parameters (PDS file %s). The device may be unstable.\n",
wdev->pdata.file_pds);
- goto err1;
+ return ret;
}
tmp_buf = kmemdup(pds->data, pds->size, GFP_KERNEL);
if (!tmp_buf) {
ret = -ENOMEM;
- goto err2;
+ goto release_fw;
}
ret = wfx_send_pds(wdev, tmp_buf, pds->size);
kfree(tmp_buf);
-err2:
+release_fw:
release_firmware(pds);
-err1:
return ret;
}

@@ -350,7 +349,7 @@ int wfx_probe(struct wfx_dev *wdev)

err = wfx_init_device(wdev);
if (err)
- goto err0;
+ goto bh_unregister;

wfx_bh_poll_irq(wdev);
err = wait_for_completion_timeout(&wdev->firmware_ready, 1 * HZ);
@@ -361,7 +360,7 @@ int wfx_probe(struct wfx_dev *wdev)
} else if (err == -ERESTARTSYS) {
dev_info(wdev->dev, "probe interrupted by user\n");
}
- goto err0;
+ goto bh_unregister;
}

/* FIXME: fill wiphy::hw_version */
@@ -380,13 +379,13 @@ int wfx_probe(struct wfx_dev *wdev)
if (wfx_api_older_than(wdev, 1, 0)) {
dev_err(wdev->dev, "unsupported firmware API version (expect 1 while firmware returns %d)\n",
wdev->hw_caps.api_version_major);
- err = -ENOTSUPP;
- goto err0;
+ err = -EOPNOTSUPP;
+ goto bh_unregister;
}

if (wdev->hw_caps.link_mode == SEC_LINK_ENFORCED) {
dev_err(wdev->dev, "chip require secure_link, but can't negotiate it\n");
- goto err0;
+ goto bh_unregister;
}

if (wdev->hw_caps.region_sel_mode) {
@@ -401,12 +400,12 @@ int wfx_probe(struct wfx_dev *wdev)
dev_dbg(wdev->dev, "sending configuration file %s\n", wdev->pdata.file_pds);
err = wfx_send_pdata_pds(wdev);
if (err < 0 && err != -ENOENT)
- goto err0;
+ goto bh_unregister;

wdev->poll_irq = false;
err = wdev->hwbus_ops->irq_subscribe(wdev->hwbus_priv);
if (err)
- goto err0;
+ goto bh_unregister;

err = wfx_hif_use_multi_tx_conf(wdev, true);
if (err)
@@ -444,19 +443,19 @@ int wfx_probe(struct wfx_dev *wdev)

err = ieee80211_register_hw(wdev->hw);
if (err)
- goto err1;
+ goto irq_unsubscribe;

err = wfx_debug_init(wdev);
if (err)
- goto err2;
+ goto ieee80211_unregister;

return 0;

-err2:
+ieee80211_unregister:
ieee80211_unregister_hw(wdev->hw);
-err1:
+irq_unsubscribe:
wdev->hwbus_ops->irq_unsubscribe(wdev->hwbus_priv);
-err0:
+bh_unregister:
wfx_bh_unregister(wdev);
return err;
}
--
2.34.1

2022-01-13 08:58:22

by Jérôme Pouiller

[permalink] [raw]
Subject: [PATCH 24/31] staging: wfx: replace compiletime_assert() by BUILD_BUG_ON_MSG()

From: Jérôme Pouiller <[email protected]>

It seems that BUILD_BUG_ON_MSG() is a bit more popular.

Signed-off-by: Jérôme Pouiller <[email protected]>
---
drivers/staging/wfx/data_tx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c
index ca2f24b92d24..bfc3d4412ac6 100644
--- a/drivers/staging/wfx/data_tx.c
+++ b/drivers/staging/wfx/data_tx.c
@@ -391,8 +391,8 @@ void wfx_tx(struct ieee80211_hw *hw, struct ieee80211_tx_control *control, struc
struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
size_t driver_data_room = sizeof_field(struct ieee80211_tx_info, rate_driver_data);

- compiletime_assert(sizeof(struct wfx_tx_priv) <= driver_data_room,
- "struct tx_priv is too large");
+ BUILD_BUG_ON_MSG(sizeof(struct wfx_tx_priv) > driver_data_room,
+ "struct tx_priv is too large");
WARN(skb->next || skb->prev, "skb is already member of a list");
/* control.vif can be NULL for injected frames */
if (tx_info->control.vif)
--
2.34.1

2022-01-13 08:58:32

by Jérôme Pouiller

[permalink] [raw]
Subject: [PATCH 25/31] staging: wfx: do not display functions names in logs

From: Jérôme Pouiller <[email protected]>

It is not necessary to prefix error logs with the function name when an
error message is unique in the code.

Note this patch still prefixes the message 'received event for
non-existent vif' with the function name since it is used several
times.

Signed-off-by: Jérôme Pouiller <[email protected]>
---
drivers/staging/wfx/bh.c | 3 +--
drivers/staging/wfx/data_tx.c | 2 +-
drivers/staging/wfx/hif_rx.c | 3 +--
drivers/staging/wfx/scan.c | 3 +--
drivers/staging/wfx/sta.c | 5 ++---
5 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/wfx/bh.c b/drivers/staging/wfx/bh.c
index 1ec4a4951d99..4c6ba9c342a6 100644
--- a/drivers/staging/wfx/bh.c
+++ b/drivers/staging/wfx/bh.c
@@ -69,8 +69,7 @@ static int rx_helper(struct wfx_dev *wdev, size_t read_len, int *is_cnf)
int release_count;
int piggyback = 0;

- WARN(read_len > round_down(0xFFF, 2) * sizeof(u16),
- "%s: request exceed the chip capability", __func__);
+ WARN(read_len > round_down(0xFFF, 2) * sizeof(u16), "request exceed the chip capability");

/* Add 2 to take into account piggyback size */
alloc_len = wdev->hwbus_ops->align_size(wdev->hwbus_priv, read_len + 2);
diff --git a/drivers/staging/wfx/data_tx.c b/drivers/staging/wfx/data_tx.c
index bfc3d4412ac6..d7bcf3bae08a 100644
--- a/drivers/staging/wfx/data_tx.c
+++ b/drivers/staging/wfx/data_tx.c
@@ -425,7 +425,7 @@ static void wfx_skb_dtor(struct wfx_vif *wvif, struct sk_buff *skb)
req->fc_offset;

if (!wvif) {
- pr_warn("%s: vif associated with the skb does not exist anymore\n", __func__);
+ pr_warn("vif associated with the skb does not exist anymore\n");
return;
}
wfx_tx_policy_put(wvif, req->retry_policy_index);
diff --git a/drivers/staging/wfx/hif_rx.c b/drivers/staging/wfx/hif_rx.c
index 5300ef57413f..302bdb2bf036 100644
--- a/drivers/staging/wfx/hif_rx.c
+++ b/drivers/staging/wfx/hif_rx.c
@@ -101,8 +101,7 @@ static int wfx_hif_receive_indication(struct wfx_dev *wdev, const struct wfx_hif
const struct wfx_hif_ind_rx *body = buf;

if (!wvif) {
- dev_warn(wdev->dev, "%s: ignore rx data for non-existent vif %d\n",
- __func__, hif->interface);
+ dev_warn(wdev->dev, "%s: received event for non-existent vif\n", __func__);
return -EIO;
}
skb_pull(skb, sizeof(struct wfx_hif_msg) + sizeof(struct wfx_hif_ind_rx));
diff --git a/drivers/staging/wfx/scan.c b/drivers/staging/wfx/scan.c
index ce0ae4c91190..7f34f0d322f9 100644
--- a/drivers/staging/wfx/scan.c
+++ b/drivers/staging/wfx/scan.c
@@ -94,8 +94,7 @@ void wfx_hw_scan_work(struct work_struct *work)
mutex_lock(&wvif->wdev->conf_mutex);
mutex_lock(&wvif->scan_lock);
if (wvif->join_in_progress) {
- dev_info(wvif->wdev->dev, "%s: abort in-progress REQ_JOIN",
- __func__);
+ dev_info(wvif->wdev->dev, "abort in-progress REQ_JOIN");
wfx_reset(wvif);
}
update_probe_tmpl(wvif, &hw_req->req);
diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index f64adba350eb..83f1ac87e0f2 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -513,13 +513,12 @@ void wfx_bss_info_changed(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
else if (!info->assoc && vif->type == NL80211_IFTYPE_STATION)
wfx_reset(wvif);
else
- dev_warn(wdev->dev, "%s: misunderstood change: ASSOC\n",
- __func__);
+ dev_warn(wdev->dev, "misunderstood change: ASSOC\n");
}

if (changed & BSS_CHANGED_BEACON_INFO) {
if (vif->type != NL80211_IFTYPE_STATION)
- dev_warn(wdev->dev, "%s: misunderstood change: BEACON_INFO\n", __func__);
+ dev_warn(wdev->dev, "misunderstood change: BEACON_INFO\n");
wfx_hif_set_beacon_wakeup_period(wvif, info->dtim_period, info->dtim_period);
/* We temporary forwarded beacon for join process. It is now no more necessary. */
wfx_filter_beacon(wvif, true);
--
2.34.1

2022-01-13 08:58:36

by Jérôme Pouiller

[permalink] [raw]
Subject: [PATCH 26/31] staging: wfx: remove force_ps_timeout

From: Jérôme Pouiller <[email protected]>

ps_timeout should be in nl80211, not in debugfs. Let's remove it until
the driver is accepted.

Signed-off-by: Jérôme Pouiller <[email protected]>
---
drivers/staging/wfx/debug.c | 23 -----------------------
drivers/staging/wfx/main.c | 1 -
drivers/staging/wfx/sta.c | 8 ++------
drivers/staging/wfx/wfx.h | 1 -
4 files changed, 2 insertions(+), 31 deletions(-)

diff --git a/drivers/staging/wfx/debug.c b/drivers/staging/wfx/debug.c
index ae7895ea36d9..e8265208f9a5 100644
--- a/drivers/staging/wfx/debug.c
+++ b/drivers/staging/wfx/debug.c
@@ -316,28 +316,6 @@ static const struct file_operations wfx_send_hif_msg_fops = {
.read = wfx_send_hif_msg_read,
};

-static int wfx_ps_timeout_set(void *data, u64 val)
-{
- struct wfx_dev *wdev = (struct wfx_dev *)data;
- struct wfx_vif *wvif;
-
- wdev->force_ps_timeout = val;
- wvif = NULL;
- while ((wvif = wvif_iterate(wdev, wvif)) != NULL)
- wfx_update_pm(wvif);
- return 0;
-}
-
-static int wfx_ps_timeout_get(void *data, u64 *val)
-{
- struct wfx_dev *wdev = (struct wfx_dev *)data;
-
- *val = wdev->force_ps_timeout;
- return 0;
-}
-
-DEFINE_DEBUGFS_ATTRIBUTE(wfx_ps_timeout_fops, wfx_ps_timeout_get, wfx_ps_timeout_set, "%lld\n");
-
int wfx_debug_init(struct wfx_dev *wdev)
{
struct dentry *d;
@@ -348,7 +326,6 @@ int wfx_debug_init(struct wfx_dev *wdev)
debugfs_create_file("tx_power_loop", 0444, d, wdev, &wfx_tx_power_loop_fops);
debugfs_create_file("send_pds", 0200, d, wdev, &wfx_send_pds_fops);
debugfs_create_file("send_hif_msg", 0600, d, wdev, &wfx_send_hif_msg_fops);
- debugfs_create_file("ps_timeout", 0600, d, wdev, &wfx_ps_timeout_fops);

return 0;
}
diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c
index 46fd5702e471..a98a261f6d76 100644
--- a/drivers/staging/wfx/main.c
+++ b/drivers/staging/wfx/main.c
@@ -324,7 +324,6 @@ struct wfx_dev *wfx_init_common(struct device *dev, const struct wfx_platform_da
skb_queue_head_init(&wdev->tx_pending);
init_waitqueue_head(&wdev->tx_dequeue);
wfx_init_hif_cmd(&wdev->hif_cmd);
- wdev->force_ps_timeout = -1;

if (devm_add_action_or_reset(dev, wfx_free_common, wdev))
return NULL;
diff --git a/drivers/staging/wfx/sta.c b/drivers/staging/wfx/sta.c
index 83f1ac87e0f2..ba53e4d70c4f 100644
--- a/drivers/staging/wfx/sta.c
+++ b/drivers/staging/wfx/sta.c
@@ -171,18 +171,14 @@ static int wfx_get_ps_timeout(struct wfx_vif *wvif, bool *enable_ps)
/* It is necessary to enable PS if channels are different. */
if (enable_ps)
*enable_ps = true;
- if (wvif->wdev->force_ps_timeout > -1)
- return wvif->wdev->force_ps_timeout;
- else if (wfx_api_older_than(wvif->wdev, 3, 2))
+ if (wfx_api_older_than(wvif->wdev, 3, 2))
return 0;
else
return 30;
}
if (enable_ps)
*enable_ps = wvif->vif->bss_conf.ps;
- if (wvif->wdev->force_ps_timeout > -1)
- return wvif->wdev->force_ps_timeout;
- else if (wvif->vif->bss_conf.assoc && wvif->vif->bss_conf.ps)
+ if (wvif->vif->bss_conf.assoc && wvif->vif->bss_conf.ps)
return conf->dynamic_ps_timeout;
else
return -1;
diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h
index 0fc8366d9fb3..6594cc647c2f 100644
--- a/drivers/staging/wfx/wfx.h
+++ b/drivers/staging/wfx/wfx.h
@@ -57,7 +57,6 @@ struct wfx_dev {
struct mutex rx_stats_lock;
struct wfx_hif_tx_power_loop_info tx_power_loop_info;
struct mutex tx_power_loop_info_lock;
- int force_ps_timeout;
};

struct wfx_vif {
--
2.34.1

2022-01-13 08:58:44

by Jérôme Pouiller

[permalink] [raw]
Subject: [PATCH 27/31] staging: wfx: map 'compatible' attribute with board name

From: Jérôme Pouiller <[email protected]>

"WF200" only designates the chip. To make a WiFi board, the chip must be
associated with an antenna. The antenna configuration is located in
separate files (aka PDS files in Silabs wording). Currently, user has to
write in his DT something like:

compatible = "silabs,wf200";
config = "brd4001a.pds";

It is far better to embed a list of known boards (chip + antenna) in the
driver. So the user just have to declare:

compatible = "silabs,brd4001a";

This patch add the configurations for the evaluation boards sold by
Silabs. To provide a full plug-and-play experience, the associated PDS
files[1] will be available in linux-firmware.

This patch does not break compatibility with existing setups.

Signed-off-by: Jérôme Pouiller <[email protected]>
---
.../bindings/net/wireless/silabs,wfx.yaml | 11 ++--
drivers/staging/wfx/bus_sdio.c | 35 +++++++++++--
drivers/staging/wfx/bus_spi.c | 52 ++++++++++++++++---
drivers/staging/wfx/main.h | 1 +
4 files changed, 83 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/wfx/Documentation/devicetree/bindings/net/wireless/silabs,wfx.yaml b/drivers/staging/wfx/Documentation/devicetree/bindings/net/wireless/silabs,wfx.yaml
index 510edd12ed19..44aeba0f7276 100644
--- a/drivers/staging/wfx/Documentation/devicetree/bindings/net/wireless/silabs,wfx.yaml
+++ b/drivers/staging/wfx/Documentation/devicetree/bindings/net/wireless/silabs,wfx.yaml
@@ -39,7 +39,12 @@ description:

properties:
compatible:
- const: silabs,wf200
+ items:
+ - enum:
+ - silabs,brd4001a # WGM160P Evaluation Board
+ - silabs,brd8022a # WF200 Evaluation Board
+ - silabs,brd8023a # WFM200 Evaluation Board
+ - const: silabs,wf200 # Chip alone without antenna
reg:
description:
When used on SDIO bus, <reg> must be set to 1. When used on SPI bus, it is
@@ -87,7 +92,7 @@ examples:
#size-cells = <0>;

wfx@0 {
- compatible = "silabs,wf200";
+ compatible = "silabs,brd8022a", "silabs,wf200";
pinctrl-names = "default";
pinctrl-0 = <&wfx_irq &wfx_gpios>;
reg = <0>;
@@ -115,7 +120,7 @@ examples:
#size-cells = <0>;

mmc@1 {
- compatible = "silabs,wf200";
+ compatible = "silabs,brd8022a", "silabs,wf200";
pinctrl-names = "default";
pinctrl-0 = <&wfx_wakeup>;
reg = <1>;
diff --git a/drivers/staging/wfx/bus_sdio.c b/drivers/staging/wfx/bus_sdio.c
index 5c45ccd85a7d..361585763f30 100644
--- a/drivers/staging/wfx/bus_sdio.c
+++ b/drivers/staging/wfx/bus_sdio.c
@@ -10,6 +10,7 @@
#include <linux/mmc/sdio_func.h>
#include <linux/mmc/card.h>
#include <linux/interrupt.h>
+#include <linux/of_device.h>
#include <linux/of_irq.h>
#include <linux/irq.h>
#include <linux/align.h>
@@ -20,7 +21,28 @@
#include "main.h"
#include "bh.h"

-static const struct wfx_platform_data wfx_sdio_pdata = {
+static const struct wfx_platform_data pdata_wf200 = {
+ .file_fw = "wfm_wf200",
+ .file_pds = "wf200.pds",
+};
+
+static const struct wfx_platform_data pdata_brd4001a = {
+ .file_fw = "wfm_wf200",
+ .file_pds = "brd4001a.pds",
+};
+
+static const struct wfx_platform_data pdata_brd8022a = {
+ .file_fw = "wfm_wf200",
+ .file_pds = "brd8022a.pds",
+};
+
+static const struct wfx_platform_data pdata_brd8023a = {
+ .file_fw = "wfm_wf200",
+ .file_pds = "brd8023a.pds",
+};
+
+/* Legacy DT don't use it */
+static const struct wfx_platform_data pdata_wfx_sdio = {
.file_fw = "wfm_wf200",
.file_pds = "wf200.pds",
};
@@ -167,14 +189,18 @@ static const struct wfx_hwbus_ops wfx_sdio_hwbus_ops = {
};

static const struct of_device_id wfx_sdio_of_match[] = {
- { .compatible = "silabs,wfx-sdio" },
- { .compatible = "silabs,wf200" },
+ { .compatible = "silabs,wf200", .data = &pdata_wf200 },
+ { .compatible = "silabs,brd4001a", .data = &pdata_brd4001a },
+ { .compatible = "silabs,brd8022a", .data = &pdata_brd8022a },
+ { .compatible = "silabs,brd8023a", .data = &pdata_brd8023a },
+ { .compatible = "silabs,wfx-sdio", .data = &pdata_wfx_sdio },
{ },
};
MODULE_DEVICE_TABLE(of, wfx_sdio_of_match);

static int wfx_sdio_probe(struct sdio_func *func, const struct sdio_device_id *id)
{
+ const struct wfx_platform_data *pdata = of_device_get_match_data(&func->dev);
struct device_node *np = func->dev.of_node;
struct wfx_sdio_priv *bus;
int ret;
@@ -216,8 +242,7 @@ static int wfx_sdio_probe(struct sdio_func *func, const struct sdio_device_id *i
if (ret)
return ret;

- bus->core = wfx_init_common(&func->dev, &wfx_sdio_pdata,
- &wfx_sdio_hwbus_ops, bus);
+ bus->core = wfx_init_common(&func->dev, pdata, &wfx_sdio_hwbus_ops, bus);
if (!bus->core) {
ret = -EIO;
goto sdio_release;
diff --git a/drivers/staging/wfx/bus_spi.c b/drivers/staging/wfx/bus_spi.c
index 417bb74c88b9..9aa52d76cdda 100644
--- a/drivers/staging/wfx/bus_spi.c
+++ b/drivers/staging/wfx/bus_spi.c
@@ -23,12 +23,36 @@
#define SET_WRITE 0x7FFF /* usage: and operation */
#define SET_READ 0x8000 /* usage: or operation */

-#define WFX_RESET_INVERTED 1
+static const struct wfx_platform_data pdata_wf200 = {
+ .file_fw = "wfm_wf200",
+ .file_pds = "wf200.pds",
+ .use_rising_clk = true,
+};
+
+static const struct wfx_platform_data pdata_brd4001a = {
+ .file_fw = "wfm_wf200",
+ .file_pds = "brd4001a.pds",
+ .use_rising_clk = true,
+};
+
+static const struct wfx_platform_data pdata_brd8022a = {
+ .file_fw = "wfm_wf200",
+ .file_pds = "brd8022a.pds",
+ .use_rising_clk = true,
+};
+
+static const struct wfx_platform_data pdata_brd8023a = {
+ .file_fw = "wfm_wf200",
+ .file_pds = "brd8023a.pds",
+ .use_rising_clk = true,
+};

-static const struct wfx_platform_data wfx_spi_pdata = {
+/* Legacy DT don't use it */
+static const struct wfx_platform_data pdata_wfx_spi = {
.file_fw = "wfm_wf200",
.file_pds = "wf200.pds",
.use_rising_clk = true,
+ .reset_inverted = true,
};

struct wfx_spi_priv {
@@ -175,6 +199,7 @@ static const struct wfx_hwbus_ops wfx_spi_hwbus_ops = {

static int wfx_spi_probe(struct spi_device *func)
{
+ struct wfx_platform_data *pdata;
struct wfx_spi_priv *bus;
int ret;

@@ -183,6 +208,12 @@ static int wfx_spi_probe(struct spi_device *func)
ret = spi_setup(func);
if (ret)
return ret;
+ pdata = (struct wfx_platform_data *)spi_get_device_id(func)->driver_data;
+ if (!pdata) {
+ dev_err(&func->dev, "unable to retrieve driver data (please report)\n");
+ return -ENODEV;
+ }
+
/* Trace below is also displayed by spi_setup() if compiled with DEBUG */
dev_dbg(&func->dev, "SPI params: CS=%d, mode=%d bits/word=%d speed=%d\n",
func->chip_select, func->mode, func->bits_per_word, func->max_speed_hz);
@@ -206,7 +237,7 @@ static int wfx_spi_probe(struct spi_device *func)
dev_warn(&func->dev, "gpio reset is not defined, trying to load firmware anyway\n");
} else {
gpiod_set_consumer_name(bus->gpio_reset, "wfx reset");
- if (spi_get_device_id(func)->driver_data & WFX_RESET_INVERTED)
+ if (pdata->reset_inverted)
gpiod_toggle_active_low(bus->gpio_reset);
gpiod_set_value_cansleep(bus->gpio_reset, 1);
usleep_range(100, 150);
@@ -214,8 +245,7 @@ static int wfx_spi_probe(struct spi_device *func)
usleep_range(2000, 2500);
}

- bus->core = wfx_init_common(&func->dev, &wfx_spi_pdata,
- &wfx_spi_hwbus_ops, bus);
+ bus->core = wfx_init_common(&func->dev, pdata, &wfx_spi_hwbus_ops, bus);
if (!bus->core)
return -EIO;

@@ -235,16 +265,22 @@ static int wfx_spi_remove(struct spi_device *func)
* stripped.
*/
static const struct spi_device_id wfx_spi_id[] = {
- { "wfx-spi", WFX_RESET_INVERTED },
- { "wf200", 0 },
+ { "wf200", (kernel_ulong_t)&pdata_wf200 },
+ { "brd4001a", (kernel_ulong_t)&pdata_brd4001a },
+ { "brd8022a", (kernel_ulong_t)&pdata_brd8022a },
+ { "brd8023a", (kernel_ulong_t)&pdata_brd8023a },
+ { "wfx-spi", (kernel_ulong_t)&pdata_wfx_spi },
{ },
};
MODULE_DEVICE_TABLE(spi, wfx_spi_id);

#ifdef CONFIG_OF
static const struct of_device_id wfx_spi_of_match[] = {
- { .compatible = "silabs,wfx-spi", .data = (void *)WFX_RESET_INVERTED },
{ .compatible = "silabs,wf200" },
+ { .compatible = "silabs,brd4001a" },
+ { .compatible = "silabs,brd8022a" },
+ { .compatible = "silabs,brd8023a" },
+ { .compatible = "silabs,wfx-spi" },
{ },
};
MODULE_DEVICE_TABLE(of, wfx_spi_of_match);
diff --git a/drivers/staging/wfx/main.h b/drivers/staging/wfx/main.h
index 68c665307153..fcd26b24519e 100644
--- a/drivers/staging/wfx/main.h
+++ b/drivers/staging/wfx/main.h
@@ -23,6 +23,7 @@ struct wfx_platform_data {
const char *file_fw;
const char *file_pds;
struct gpio_desc *gpio_wakeup;
+ bool reset_inverted;
/* if true HIF D_out is sampled on the rising edge of the clock (intended to be used in
* 50Mhz SDIO)
*/
--
2.34.1

2022-01-13 08:58:57

by Jérôme Pouiller

[permalink] [raw]
Subject: [PATCH 28/31] staging: wfx: fix firmware location

From: Jérôme Pouiller <[email protected]>

There is currently, a mismatch between the location of the firmware in
linux-firmware and the path written in the driver.

We take this opportunity to relocate the WF200 firmware in wfx/ instead
of silabs/.

Signed-off-by: Jérôme Pouiller <[email protected]>
---
drivers/staging/wfx/bus_sdio.c | 16 ++++++++--------
drivers/staging/wfx/bus_spi.c | 16 ++++++++--------
2 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/staging/wfx/bus_sdio.c b/drivers/staging/wfx/bus_sdio.c
index 361585763f30..6ead6957b751 100644
--- a/drivers/staging/wfx/bus_sdio.c
+++ b/drivers/staging/wfx/bus_sdio.c
@@ -22,23 +22,23 @@
#include "bh.h"

static const struct wfx_platform_data pdata_wf200 = {
- .file_fw = "wfm_wf200",
- .file_pds = "wf200.pds",
+ .file_fw = "wfx/wfm_wf200",
+ .file_pds = "wfx/wf200.pds",
};

static const struct wfx_platform_data pdata_brd4001a = {
- .file_fw = "wfm_wf200",
- .file_pds = "brd4001a.pds",
+ .file_fw = "wfx/wfm_wf200",
+ .file_pds = "wfx/brd4001a.pds",
};

static const struct wfx_platform_data pdata_brd8022a = {
- .file_fw = "wfm_wf200",
- .file_pds = "brd8022a.pds",
+ .file_fw = "wfx/wfm_wf200",
+ .file_pds = "wfx/brd8022a.pds",
};

static const struct wfx_platform_data pdata_brd8023a = {
- .file_fw = "wfm_wf200",
- .file_pds = "brd8023a.pds",
+ .file_fw = "wfx/wfm_wf200",
+ .file_pds = "wfx/brd8023a.pds",
};

/* Legacy DT don't use it */
diff --git a/drivers/staging/wfx/bus_spi.c b/drivers/staging/wfx/bus_spi.c
index 9aa52d76cdda..6b4f9fff8b44 100644
--- a/drivers/staging/wfx/bus_spi.c
+++ b/drivers/staging/wfx/bus_spi.c
@@ -24,26 +24,26 @@
#define SET_READ 0x8000 /* usage: or operation */

static const struct wfx_platform_data pdata_wf200 = {
- .file_fw = "wfm_wf200",
- .file_pds = "wf200.pds",
+ .file_fw = "wfx/wfm_wf200",
+ .file_pds = "wfx/wf200.pds",
.use_rising_clk = true,
};

static const struct wfx_platform_data pdata_brd4001a = {
- .file_fw = "wfm_wf200",
- .file_pds = "brd4001a.pds",
+ .file_fw = "wfx/wfm_wf200",
+ .file_pds = "wfx/brd4001a.pds",
.use_rising_clk = true,
};

static const struct wfx_platform_data pdata_brd8022a = {
- .file_fw = "wfm_wf200",
- .file_pds = "brd8022a.pds",
+ .file_fw = "wfx/wfm_wf200",
+ .file_pds = "wfx/brd8022a.pds",
.use_rising_clk = true,
};

static const struct wfx_platform_data pdata_brd8023a = {
- .file_fw = "wfm_wf200",
- .file_pds = "brd8023a.pds",
+ .file_fw = "wfx/wfm_wf200",
+ .file_pds = "wfx/brd8023a.pds",
.use_rising_clk = true,
};

--
2.34.1

2022-01-13 08:58:59

by Jérôme Pouiller

[permalink] [raw]
Subject: [PATCH 29/31] staging: wfx: drop legacy compatible values

From: Jérôme Pouiller <[email protected]>

Values "silabs,wfx-sdio" and "silabs,wfx-spi" are deprecated for a while
now. We take advantage of getting out of the staging tree to drop them
and start from a blank sheet.

Signed-off-by: Jérôme Pouiller <[email protected]>
---
.../devicetree/bindings/net/wireless/silabs,wfx.yaml | 3 +--
drivers/staging/wfx/bus_sdio.c | 7 -------
drivers/staging/wfx/bus_spi.c | 12 ------------
drivers/staging/wfx/main.h | 1 -
4 files changed, 1 insertion(+), 22 deletions(-)

diff --git a/drivers/staging/wfx/Documentation/devicetree/bindings/net/wireless/silabs,wfx.yaml b/drivers/staging/wfx/Documentation/devicetree/bindings/net/wireless/silabs,wfx.yaml
index 44aeba0f7276..c12be18eb6ac 100644
--- a/drivers/staging/wfx/Documentation/devicetree/bindings/net/wireless/silabs,wfx.yaml
+++ b/drivers/staging/wfx/Documentation/devicetree/bindings/net/wireless/silabs,wfx.yaml
@@ -64,8 +64,7 @@ properties:
reset-gpios:
description: (SPI only) Phandle of gpio that will be used to reset chip
during probe. Without this property, you may encounter issues with warm
- boot. (For legacy purpose, the gpio in inverted when compatible ==
- "silabs,wfx-spi")
+ boot.

For SDIO, the reset gpio should declared using a mmc-pwrseq.
maxItems: 1
diff --git a/drivers/staging/wfx/bus_sdio.c b/drivers/staging/wfx/bus_sdio.c
index 6ead6957b751..6ea573221ab1 100644
--- a/drivers/staging/wfx/bus_sdio.c
+++ b/drivers/staging/wfx/bus_sdio.c
@@ -41,12 +41,6 @@ static const struct wfx_platform_data pdata_brd8023a = {
.file_pds = "wfx/brd8023a.pds",
};

-/* Legacy DT don't use it */
-static const struct wfx_platform_data pdata_wfx_sdio = {
- .file_fw = "wfm_wf200",
- .file_pds = "wf200.pds",
-};
-
struct wfx_sdio_priv {
struct sdio_func *func;
struct wfx_dev *core;
@@ -193,7 +187,6 @@ static const struct of_device_id wfx_sdio_of_match[] = {
{ .compatible = "silabs,brd4001a", .data = &pdata_brd4001a },
{ .compatible = "silabs,brd8022a", .data = &pdata_brd8022a },
{ .compatible = "silabs,brd8023a", .data = &pdata_brd8023a },
- { .compatible = "silabs,wfx-sdio", .data = &pdata_wfx_sdio },
{ },
};
MODULE_DEVICE_TABLE(of, wfx_sdio_of_match);
diff --git a/drivers/staging/wfx/bus_spi.c b/drivers/staging/wfx/bus_spi.c
index 6b4f9fff8b44..062826aa7e6c 100644
--- a/drivers/staging/wfx/bus_spi.c
+++ b/drivers/staging/wfx/bus_spi.c
@@ -47,14 +47,6 @@ static const struct wfx_platform_data pdata_brd8023a = {
.use_rising_clk = true,
};

-/* Legacy DT don't use it */
-static const struct wfx_platform_data pdata_wfx_spi = {
- .file_fw = "wfm_wf200",
- .file_pds = "wf200.pds",
- .use_rising_clk = true,
- .reset_inverted = true,
-};
-
struct wfx_spi_priv {
struct spi_device *func;
struct wfx_dev *core;
@@ -237,8 +229,6 @@ static int wfx_spi_probe(struct spi_device *func)
dev_warn(&func->dev, "gpio reset is not defined, trying to load firmware anyway\n");
} else {
gpiod_set_consumer_name(bus->gpio_reset, "wfx reset");
- if (pdata->reset_inverted)
- gpiod_toggle_active_low(bus->gpio_reset);
gpiod_set_value_cansleep(bus->gpio_reset, 1);
usleep_range(100, 150);
gpiod_set_value_cansleep(bus->gpio_reset, 0);
@@ -269,7 +259,6 @@ static const struct spi_device_id wfx_spi_id[] = {
{ "brd4001a", (kernel_ulong_t)&pdata_brd4001a },
{ "brd8022a", (kernel_ulong_t)&pdata_brd8022a },
{ "brd8023a", (kernel_ulong_t)&pdata_brd8023a },
- { "wfx-spi", (kernel_ulong_t)&pdata_wfx_spi },
{ },
};
MODULE_DEVICE_TABLE(spi, wfx_spi_id);
@@ -280,7 +269,6 @@ static const struct of_device_id wfx_spi_of_match[] = {
{ .compatible = "silabs,brd4001a" },
{ .compatible = "silabs,brd8022a" },
{ .compatible = "silabs,brd8023a" },
- { .compatible = "silabs,wfx-spi" },
{ },
};
MODULE_DEVICE_TABLE(of, wfx_spi_of_match);
diff --git a/drivers/staging/wfx/main.h b/drivers/staging/wfx/main.h
index fcd26b24519e..68c665307153 100644
--- a/drivers/staging/wfx/main.h
+++ b/drivers/staging/wfx/main.h
@@ -23,7 +23,6 @@ struct wfx_platform_data {
const char *file_fw;
const char *file_pds;
struct gpio_desc *gpio_wakeup;
- bool reset_inverted;
/* if true HIF D_out is sampled on the rising edge of the clock (intended to be used in
* 50Mhz SDIO)
*/
--
2.34.1

2022-01-13 08:59:06

by Jérôme Pouiller

[permalink] [raw]
Subject: [PATCH 30/31] staging: wfx: rename "config-file" DT attribute

From: Jérôme Pouiller <[email protected]>

"config-file" is too broad. Replace it by "silabs,antenna-config-file"
which is more explicit.

The attribute "config-file" is probably not widely used. This patch
obviously breaks setups that use this attribute.

Signed-off-by: Jérôme Pouiller <[email protected]>
---
.../devicetree/bindings/net/wireless/silabs,wfx.yaml | 9 +++++----
drivers/staging/wfx/main.c | 2 +-
2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/wfx/Documentation/devicetree/bindings/net/wireless/silabs,wfx.yaml b/drivers/staging/wfx/Documentation/devicetree/bindings/net/wireless/silabs,wfx.yaml
index c12be18eb6ac..c49496357180 100644
--- a/drivers/staging/wfx/Documentation/devicetree/bindings/net/wireless/silabs,wfx.yaml
+++ b/drivers/staging/wfx/Documentation/devicetree/bindings/net/wireless/silabs,wfx.yaml
@@ -72,10 +72,11 @@ properties:
description: Phandle of gpio that will be used to wake-up chip. Without this
property, driver will disable most of power saving features.
maxItems: 1
- config-file:
- description: Use an alternative file as PDS. Default is `wf200.pds`. Only
- necessary for development/debug purpose.
- maxItems: 1
+ silabs,antenna-config-file:
+ $ref: /schemas/types.yaml#/definitions/string
+ description: Use an alternative file for antenna configuration (aka
+ "Platform Data Set" in Silabs jargon). Default depends of "compatible"
+ string. For "silabs,wf200", the default is 'wf200.pds'.

required:
- compatible
diff --git a/drivers/staging/wfx/main.c b/drivers/staging/wfx/main.c
index a98a261f6d76..8be9100847a7 100644
--- a/drivers/staging/wfx/main.c
+++ b/drivers/staging/wfx/main.c
@@ -309,7 +309,7 @@ struct wfx_dev *wfx_init_common(struct device *dev, const struct wfx_platform_da
wdev->hwbus_ops = hwbus_ops;
wdev->hwbus_priv = hwbus_priv;
memcpy(&wdev->pdata, pdata, sizeof(*pdata));
- of_property_read_string(dev->of_node, "config-file", &wdev->pdata.file_pds);
+ of_property_read_string(dev->of_node, "silabs,antenna-config-file", &wdev->pdata.file_pds);
wdev->pdata.gpio_wakeup = devm_gpiod_get_optional(dev, "wakeup", GPIOD_OUT_LOW);
if (IS_ERR(wdev->pdata.gpio_wakeup))
return NULL;
--
2.34.1

2022-01-13 09:00:00

by Jérôme Pouiller

[permalink] [raw]
Subject: [PATCH 31/31] staging: wfx: do not probe the device if not in the DT

From: Jérôme Pouiller <[email protected]>

Since the WF200 VID/PID are not reliable, it's recommended to declare it
in the DT. Until now, if the device was not declared, the driver just
printed a warning and continue. But, the risk of a collision is too
high, the driver now returns an error.

Signed-off-by: Jérôme Pouiller <[email protected]>
---
drivers/staging/wfx/Kconfig | 4 ++++
drivers/staging/wfx/bus_sdio.c | 21 ++++++---------------
2 files changed, 10 insertions(+), 15 deletions(-)

diff --git a/drivers/staging/wfx/Kconfig b/drivers/staging/wfx/Kconfig
index 01ea09cb9697..835a855409d8 100644
--- a/drivers/staging/wfx/Kconfig
+++ b/drivers/staging/wfx/Kconfig
@@ -7,3 +7,7 @@ config WFX
help
This is a driver for Silicons Labs WFxxx series (WF200 and further)
chipsets. This chip can be found on SPI or SDIO buses.
+
+ Silabs does not use a reliable SDIO vendor ID. So, to avoid conflicts,
+ the driver won't probe the device if it is not also declared in the
+ Device Tree.
diff --git a/drivers/staging/wfx/bus_sdio.c b/drivers/staging/wfx/bus_sdio.c
index 6ea573221ab1..bc3df85a05b6 100644
--- a/drivers/staging/wfx/bus_sdio.c
+++ b/drivers/staging/wfx/bus_sdio.c
@@ -204,24 +204,17 @@ static int wfx_sdio_probe(struct sdio_func *func, const struct sdio_device_id *i
return -ENODEV;
}

+ if (!pdata) {
+ dev_warn(&func->dev, "no compatible device found in DT\n");
+ return -ENODEV;
+ }
+
bus = devm_kzalloc(&func->dev, sizeof(*bus), GFP_KERNEL);
if (!bus)
return -ENOMEM;

- if (np) {
- if (!of_match_node(wfx_sdio_of_match, np)) {
- dev_warn(&func->dev, "no compatible device found in DT\n");
- return -ENODEV;
- }
- bus->of_irq = irq_of_parse_and_map(np, 0);
- } else {
- dev_warn(&func->dev,
- "device is not declared in DT, features will be limited\n");
- /* FIXME: ignore VID/PID and only rely on device tree */
- // return -ENODEV;
- }
-
bus->func = func;
+ bus->of_irq = irq_of_parse_and_map(np, 0);
sdio_set_drvdata(func, bus);
func->card->quirks |= MMC_QUIRK_LENIENT_FN0 |
MMC_QUIRK_BLKSZ_FOR_BYTE_MODE |
@@ -268,8 +261,6 @@ static void wfx_sdio_remove(struct sdio_func *func)
#define SDIO_DEVICE_ID_SILABS_WF200 0x1000
static const struct sdio_device_id wfx_sdio_ids[] = {
{ SDIO_DEVICE(SDIO_VENDOR_ID_SILABS, SDIO_DEVICE_ID_SILABS_WF200) },
- /* FIXME: ignore VID/PID and only rely on device tree */
- // { SDIO_DEVICE(SDIO_ANY_ID, SDIO_ANY_ID) },
{ },
};
MODULE_DEVICE_TABLE(sdio, wfx_sdio_ids);
--
2.34.1