aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath10k/wmi-ops.h
diff options
context:
space:
mode:
authorRaja Mani <rmani@qti.qualcomm.com>2015-08-14 11:13:29 +0300
committerKalle Valo <kvalo@qca.qualcomm.com>2015-08-17 17:43:29 +0300
commit991adf71a6cd993c3e6a1a0d8ea9f88b2fa51b95 (patch)
tree69a4b3a9e6b8789c7e7d3970dc4973b0484d9c52 /drivers/net/wireless/ath/ath10k/wmi-ops.h
parentwil6210: match wait_for_completion_timeout return type (diff)
downloadlinux-dev-991adf71a6cd993c3e6a1a0d8ea9f88b2fa51b95.tar.xz
linux-dev-991adf71a6cd993c3e6a1a0d8ea9f88b2fa51b95.zip
ath10k: refactor phyerr event handlers
Existing phyerr event handlers directly uses phyerr header format (ie, struct wmi_phyerr and struct wmi_phyerr_event) in the code exactly on how firmware packs it. This is the problem in 10.4 fw specific phyerr event handling where it uses different phyerror header format. Before adding 10.4 specific handler, little bit of refactor is done in existing phyerr handlers. Two new abstracted structures (struct wmi_phyerr_ev_hdr_arg and struct wmi_phyerr_ev_arg) are introduced to remove dependency of using firmware specific header format in the code. So that firmware specific phyerror handlers can populate values to abstracted structures and the following code can use abstracted struct for further operation. .pull_phyerr_hdr is added newly to pull common phyerr header info like tsf, buf_len, number of phyerr packed. Existing .pull_phyerr handler is changed and called to parse every sub phyerrs in the event. Validated these refactoring on qca988x hw2.0 using fw 10.2.4 version. Signed-off-by: Raja Mani <rmani@qti.qualcomm.com> Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath10k/wmi-ops.h')
-rw-r--r--drivers/net/wireless/ath/ath10k/wmi-ops.h22
1 files changed, 17 insertions, 5 deletions
diff --git a/drivers/net/wireless/ath/ath10k/wmi-ops.h b/drivers/net/wireless/ath/ath10k/wmi-ops.h
index 2591018c4dc5..248ffc3d6620 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-ops.h
+++ b/drivers/net/wireless/ath/ath10k/wmi-ops.h
@@ -37,8 +37,10 @@ struct wmi_ops {
struct wmi_peer_kick_ev_arg *arg);
int (*pull_swba)(struct ath10k *ar, struct sk_buff *skb,
struct wmi_swba_ev_arg *arg);
- int (*pull_phyerr)(struct ath10k *ar, struct sk_buff *skb,
- struct wmi_phyerr_ev_arg *arg);
+ int (*pull_phyerr_hdr)(struct ath10k *ar, struct sk_buff *skb,
+ struct wmi_phyerr_hdr_arg *arg);
+ int (*pull_phyerr)(struct ath10k *ar, const void *phyerr_buf,
+ int left_len, struct wmi_phyerr_ev_arg *arg);
int (*pull_svc_rdy)(struct ath10k *ar, struct sk_buff *skb,
struct wmi_svc_rdy_ev_arg *arg);
int (*pull_rdy)(struct ath10k *ar, struct sk_buff *skb,
@@ -261,13 +263,23 @@ ath10k_wmi_pull_swba(struct ath10k *ar, struct sk_buff *skb,
}
static inline int
-ath10k_wmi_pull_phyerr(struct ath10k *ar, struct sk_buff *skb,
- struct wmi_phyerr_ev_arg *arg)
+ath10k_wmi_pull_phyerr_hdr(struct ath10k *ar, struct sk_buff *skb,
+ struct wmi_phyerr_hdr_arg *arg)
+{
+ if (!ar->wmi.ops->pull_phyerr_hdr)
+ return -EOPNOTSUPP;
+
+ return ar->wmi.ops->pull_phyerr_hdr(ar, skb, arg);
+}
+
+static inline int
+ath10k_wmi_pull_phyerr(struct ath10k *ar, const void *phyerr_buf,
+ int left_len, struct wmi_phyerr_ev_arg *arg)
{
if (!ar->wmi.ops->pull_phyerr)
return -EOPNOTSUPP;
- return ar->wmi.ops->pull_phyerr(ar, skb, arg);
+ return ar->wmi.ops->pull_phyerr(ar, phyerr_buf, left_len, arg);
}
static inline int