Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ae7bcf3a authored by Rakesh Pillai's avatar Rakesh Pillai Committed by Gerrit - the friendly Code Review server
Browse files

ath10k: Add peer delete resp event processing



Peer delete response event is not parsed for the
params being sent by firmware.
Parse the tlv params and get the peer mac address
which was deleted.

CRs-Fixed: 2079551
Change-Id: I1f603d65784611d5f82babf2d9fa9dca5b1664b7
Signed-off-by: default avatarRakesh Pillai <pillair@codeaurora.org>
parent 347dbf72
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -31,6 +31,8 @@ struct wmi_ops {
			    struct wmi_mgmt_rx_ev_arg *arg);
	int (*pull_ch_info)(struct ath10k *ar, struct sk_buff *skb,
			    struct wmi_ch_info_ev_arg *arg);
	int (*pull_peer_delete_resp)(struct ath10k *ar, struct sk_buff *skb,
				     struct wmi_peer_delete_resp_ev_arg *arg);
	int (*pull_vdev_start)(struct ath10k *ar, struct sk_buff *skb,
			       struct wmi_vdev_start_ev_arg *arg);
	int (*pull_peer_kick)(struct ath10k *ar, struct sk_buff *skb,
@@ -245,6 +247,16 @@ ath10k_wmi_pull_mgmt_rx(struct ath10k *ar, struct sk_buff *skb,
	return ar->wmi.ops->pull_mgmt_rx(ar, skb, arg);
}

static inline int
ath10k_wmi_pull_peer_delete_resp(struct ath10k *ar, struct sk_buff *skb,
				 struct wmi_peer_delete_resp_ev_arg *arg)
{
	if (!ar->wmi.ops->pull_peer_delete_resp)
		return -EOPNOTSUPP;

	return ar->wmi.ops->pull_peer_delete_resp(ar, skb, arg);
}

static inline int
ath10k_wmi_pull_ch_info(struct ath10k *ar, struct sk_buff *skb,
			struct wmi_ch_info_ev_arg *arg)
+29 −9
Original line number Diff line number Diff line
@@ -412,15 +412,6 @@ static int ath10k_wmi_tlv_event_tx_pause(struct ath10k *ar,
	return 0;
}

static int ath10k_wmi_tlv_event_peer_delete_resp(struct ath10k *ar,
						 struct sk_buff *skb)
{
	ath10k_dbg(ar, ATH10K_DBG_WMI, "WMI_TLV_PEER_DELETE_RESP_EVENTID\n");
	complete(&ar->peer_delete_done);

	return 0;
}

/***********/
/* TLV ops */
/***********/
@@ -657,6 +648,34 @@ static int ath10k_wmi_tlv_op_pull_mgmt_rx_ev(struct ath10k *ar,
	return 0;
}

static int ath10k_wmi_tlv_op_pull_peer_delete_ev(
			struct ath10k *ar, struct sk_buff *skb,
			struct wmi_peer_delete_resp_ev_arg *arg)
{
	const void **tb;
	const struct wmi_peer_delete_resp_ev_arg *ev;
	int ret;

	tb = ath10k_wmi_tlv_parse_alloc(ar, skb->data, skb->len, GFP_ATOMIC);
	if (IS_ERR(tb)) {
		ret = PTR_ERR(tb);
		ath10k_warn(ar, "failed to parse tlv: %d\n", ret);
		return ret;
	}

	ev = tb[WMI_TLV_TAG_STRUCT_PEER_DELETE_RESP_EVENT];
	if (!ev) {
		kfree(tb);
		return -EPROTO;
	}

	arg->vdev_id = ev->vdev_id;
	arg->peer_addr = ev->peer_addr;

	kfree(tb);
	return 0;
}

static int ath10k_wmi_tlv_op_pull_ch_info_ev(struct ath10k *ar,
					     struct sk_buff *skb,
					     struct wmi_ch_info_ev_arg *arg)
@@ -3620,6 +3639,7 @@ static const struct wmi_ops wmi_tlv_ops = {
	.pull_scan = ath10k_wmi_tlv_op_pull_scan_ev,
	.pull_mgmt_rx = ath10k_wmi_tlv_op_pull_mgmt_rx_ev,
	.pull_ch_info = ath10k_wmi_tlv_op_pull_ch_info_ev,
	.pull_peer_delete_resp = ath10k_wmi_tlv_op_pull_peer_delete_ev,
	.pull_vdev_start = ath10k_wmi_tlv_op_pull_vdev_start_ev,
	.pull_peer_kick = ath10k_wmi_tlv_op_pull_peer_kick_ev,
	.pull_swba = ath10k_wmi_tlv_op_pull_swba_ev,
+1 −0
Original line number Diff line number Diff line
@@ -898,6 +898,7 @@ enum wmi_tlv_tag {
	WMI_TLV_TAG_STRUCT_HL_1_0_SVC_OFFSET = 176,

	WMI_TLV_TAG_STRUCT_MGMT_TX_CMD = 0x1A6,
	WMI_TLV_TAG_STRUCT_PEER_DELETE_RESP_EVENT = 0x1C3,

	WMI_TLV_TAG_MAX
};
+18 −0
Original line number Diff line number Diff line
@@ -2269,6 +2269,24 @@ static bool ath10k_wmi_rx_is_decrypted(struct ath10k *ar,
	return true;
}

int ath10k_wmi_tlv_event_peer_delete_resp(struct ath10k *ar,
					  struct sk_buff *skb)
{
	int ret;
	struct wmi_peer_delete_resp_ev_arg arg = {};

	ret = ath10k_wmi_pull_peer_delete_resp(ar, skb, &arg);
	if (ret) {
		ath10k_warn(ar, "failed to parse peer delete resp: %d\n", ret);
		dev_kfree_skb(skb);
		return ret;
	}
	ath10k_dbg(ar, ATH10K_DBG_WMI, "WMI_TLV_PEER_DELETE_RESP_EVENTID\n");
	complete(&ar->peer_delete_done);

	return 0;
}

int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb)
{
	struct wmi_mgmt_rx_ev_arg arg = {};
+7 −0
Original line number Diff line number Diff line
@@ -6234,6 +6234,11 @@ struct wmi_scan_ev_arg {
	__le32 vdev_id;
};

struct wmi_peer_delete_resp_ev_arg {
	__le32 vdev_id;
	struct wmi_mac_addr peer_addr;
};

struct wmi_mgmt_rx_ev_arg {
	__le32 channel;
	__le32 snr;
@@ -6603,6 +6608,8 @@ void ath10k_wmi_put_wmi_channel(struct wmi_channel *ch,
int ath10k_wmi_start_scan_verify(const struct wmi_start_scan_arg *arg);

int ath10k_wmi_event_scan(struct ath10k *ar, struct sk_buff *skb);
int ath10k_wmi_tlv_event_peer_delete_resp(struct ath10k *ar,
					  struct sk_buff *skb);
int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb);
void ath10k_wmi_event_chan_info(struct ath10k *ar, struct sk_buff *skb);
void ath10k_wmi_event_echo(struct ath10k *ar, struct sk_buff *skb);