summaryrefslogtreecommitdiffstats
path: root/drivers/staging/wfx/wfx.h
diff options
context:
space:
mode:
authorJérôme Pouiller <jerome.pouiller@silabs.com>2019-09-19 14:25:44 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-10-04 10:47:35 +0200
commitf4a71ba8753d94cc5c1e73746352274a598a25ee (patch)
tree1029af14dfe077a3894461fcec181d130c8a285f /drivers/staging/wfx/wfx.h
parentc7ff39dd8b5393c55b0a8a5dedb5ba13f4c838a8 (diff)
downloadlinux-f4a71ba8753d94cc5c1e73746352274a598a25ee.tar.bz2
staging: wfx: add debug files and trace debug events
Add traces when debug events happen and allow to ask internal information to chip. These features work independently from mac80211. Signed-off-by: Jérôme Pouiller <jerome.pouiller@silabs.com> Link: https://lore.kernel.org/r/20190919142527.31797-16-Jerome.Pouiller@silabs.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wfx/wfx.h')
-rw-r--r--drivers/staging/wfx/wfx.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/staging/wfx/wfx.h b/drivers/staging/wfx/wfx.h
index 7adb5bf67e90..49b776a07515 100644
--- a/drivers/staging/wfx/wfx.h
+++ b/drivers/staging/wfx/wfx.h
@@ -38,6 +38,9 @@ struct wfx_dev {
int chip_frozen;
struct wfx_hif_cmd hif_cmd;
+
+ struct hif_rx_stats rx_stats;
+ struct mutex rx_stats_lock;
};
struct wfx_vif {
@@ -46,4 +49,17 @@ struct wfx_vif {
int id;
};
+static inline struct wfx_vif *wdev_to_wvif(struct wfx_dev *wdev, int vif_id)
+{
+ if (vif_id >= ARRAY_SIZE(wdev->vif)) {
+ dev_dbg(wdev->dev, "requesting non-existent vif: %d\n", vif_id);
+ return NULL;
+ }
+ if (!wdev->vif[vif_id]) {
+ dev_dbg(wdev->dev, "requesting non-allocated vif: %d\n", vif_id);
+ return NULL;
+ }
+ return (struct wfx_vif *) wdev->vif[vif_id]->drv_priv;
+}
+
#endif /* WFX_H */