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

Commit 9ad50182 authored by Michal Kazior's avatar Michal Kazior Committed by Kalle Valo
Browse files

ath10k: change dma beacon cmd prototype



The command logic shouldn't really care about
arvif structure.

Signed-off-by: default avatarMichal Kazior <michal.kazior@tieto.com>
Signed-off-by: default avatarKalle Valo <kvalo@qca.qualcomm.com>
parent 627613f8
Loading
Loading
Loading
Loading
+10 −4
Original line number Original line Diff line number Diff line
@@ -104,7 +104,10 @@ struct wmi_ops {
					 u32 value);
					 u32 value);
	struct sk_buff *(*gen_scan_chan_list)(struct ath10k *ar,
	struct sk_buff *(*gen_scan_chan_list)(struct ath10k *ar,
					      const struct wmi_scan_chan_list_arg *arg);
					      const struct wmi_scan_chan_list_arg *arg);
	struct sk_buff *(*gen_beacon_dma)(struct ath10k_vif *arvif);
	struct sk_buff *(*gen_beacon_dma)(struct ath10k *ar, u32 vdev_id,
					  const void *bcn, size_t bcn_len,
					  u32 bcn_paddr, bool dtim_zero,
					  bool deliver_cab);
	struct sk_buff *(*gen_pdev_set_wmm)(struct ath10k *ar,
	struct sk_buff *(*gen_pdev_set_wmm)(struct ath10k *ar,
					    const struct wmi_wmm_params_all_arg *arg);
					    const struct wmi_wmm_params_all_arg *arg);
	struct sk_buff *(*gen_request_stats)(struct ath10k *ar,
	struct sk_buff *(*gen_request_stats)(struct ath10k *ar,
@@ -768,16 +771,19 @@ ath10k_wmi_peer_assoc(struct ath10k *ar,
}
}


static inline int
static inline int
ath10k_wmi_beacon_send_ref_nowait(struct ath10k_vif *arvif)
ath10k_wmi_beacon_send_ref_nowait(struct ath10k *ar, u32 vdev_id,
				  const void *bcn, size_t bcn_len,
				  u32 bcn_paddr, bool dtim_zero,
				  bool deliver_cab)
{
{
	struct ath10k *ar = arvif->ar;
	struct sk_buff *skb;
	struct sk_buff *skb;
	int ret;
	int ret;


	if (!ar->wmi.ops->gen_beacon_dma)
	if (!ar->wmi.ops->gen_beacon_dma)
		return -EOPNOTSUPP;
		return -EOPNOTSUPP;


	skb = ar->wmi.ops->gen_beacon_dma(arvif);
	skb = ar->wmi.ops->gen_beacon_dma(ar, vdev_id, bcn, bcn_len, bcn_paddr,
					  dtim_zero, deliver_cab);
	if (IS_ERR(skb))
	if (IS_ERR(skb))
		return PTR_ERR(skb);
		return PTR_ERR(skb);


+11 −9
Original line number Original line Diff line number Diff line
@@ -2001,13 +2001,15 @@ ath10k_wmi_tlv_op_gen_scan_chan_list(struct ath10k *ar,
}
}


static struct sk_buff *
static struct sk_buff *
ath10k_wmi_tlv_op_gen_beacon_dma(struct ath10k_vif *arvif)
ath10k_wmi_tlv_op_gen_beacon_dma(struct ath10k *ar, u32 vdev_id,
				 const void *bcn, size_t bcn_len,
				 u32 bcn_paddr, bool dtim_zero,
				 bool deliver_cab)

{
{
	struct ath10k *ar = arvif->ar;
	struct wmi_bcn_tx_ref_cmd *cmd;
	struct wmi_bcn_tx_ref_cmd *cmd;
	struct wmi_tlv *tlv;
	struct wmi_tlv *tlv;
	struct sk_buff *skb;
	struct sk_buff *skb;
	struct sk_buff *beacon = arvif->beacon;
	struct ieee80211_hdr *hdr;
	struct ieee80211_hdr *hdr;
	u16 fc;
	u16 fc;


@@ -2015,24 +2017,24 @@ ath10k_wmi_tlv_op_gen_beacon_dma(struct ath10k_vif *arvif)
	if (!skb)
	if (!skb)
		return ERR_PTR(-ENOMEM);
		return ERR_PTR(-ENOMEM);


	hdr = (struct ieee80211_hdr *)beacon->data;
	hdr = (struct ieee80211_hdr *)bcn;
	fc = le16_to_cpu(hdr->frame_control);
	fc = le16_to_cpu(hdr->frame_control);


	tlv = (void *)skb->data;
	tlv = (void *)skb->data;
	tlv->tag = __cpu_to_le16(WMI_TLV_TAG_STRUCT_BCN_SEND_FROM_HOST_CMD);
	tlv->tag = __cpu_to_le16(WMI_TLV_TAG_STRUCT_BCN_SEND_FROM_HOST_CMD);
	tlv->len = __cpu_to_le16(sizeof(*cmd));
	tlv->len = __cpu_to_le16(sizeof(*cmd));
	cmd = (void *)tlv->value;
	cmd = (void *)tlv->value;
	cmd->vdev_id = __cpu_to_le32(arvif->vdev_id);
	cmd->vdev_id = __cpu_to_le32(vdev_id);
	cmd->data_len = __cpu_to_le32(beacon->len);
	cmd->data_len = __cpu_to_le32(bcn_len);
	cmd->data_ptr = __cpu_to_le32(ATH10K_SKB_CB(beacon)->paddr);
	cmd->data_ptr = __cpu_to_le32(bcn_paddr);
	cmd->msdu_id = 0;
	cmd->msdu_id = 0;
	cmd->frame_control = __cpu_to_le32(fc);
	cmd->frame_control = __cpu_to_le32(fc);
	cmd->flags = 0;
	cmd->flags = 0;


	if (ATH10K_SKB_CB(beacon)->bcn.dtim_zero)
	if (dtim_zero)
		cmd->flags |= __cpu_to_le32(WMI_BCN_TX_REF_FLAG_DTIM_ZERO);
		cmd->flags |= __cpu_to_le32(WMI_BCN_TX_REF_FLAG_DTIM_ZERO);


	if (ATH10K_SKB_CB(beacon)->bcn.deliver_cab)
	if (deliver_cab)
		cmd->flags |= __cpu_to_le32(WMI_BCN_TX_REF_FLAG_DELIVER_CAB);
		cmd->flags |= __cpu_to_le32(WMI_BCN_TX_REF_FLAG_DELIVER_CAB);


	ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi tlv beacon dma\n");
	ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi tlv beacon dma\n");
+17 −10
Original line number Original line Diff line number Diff line
@@ -956,6 +956,8 @@ int ath10k_wmi_cmd_send_nowait(struct ath10k *ar, struct sk_buff *skb,


static void ath10k_wmi_tx_beacon_nowait(struct ath10k_vif *arvif)
static void ath10k_wmi_tx_beacon_nowait(struct ath10k_vif *arvif)
{
{
	struct sk_buff *bcn;
	struct ath10k_skb_cb *cb;
	int ret;
	int ret;


	lockdep_assert_held(&arvif->ar->data_lock);
	lockdep_assert_held(&arvif->ar->data_lock);
@@ -966,7 +968,12 @@ static void ath10k_wmi_tx_beacon_nowait(struct ath10k_vif *arvif)
	if (arvif->beacon_sent)
	if (arvif->beacon_sent)
		return;
		return;


	ret = ath10k_wmi_beacon_send_ref_nowait(arvif);
	bcn = arvif->beacon;
	cb = ATH10K_SKB_CB(bcn);
	ret = ath10k_wmi_beacon_send_ref_nowait(arvif->ar, arvif->vdev_id,
						bcn->data, bcn->len, cb->paddr,
						cb->bcn.dtim_zero,
						cb->bcn.deliver_cab);
	if (ret)
	if (ret)
		return;
		return;


@@ -4856,12 +4863,12 @@ ath10k_wmi_10_2_op_gen_pdev_get_temperature(struct ath10k *ar)


/* This function assumes the beacon is already DMA mapped */
/* This function assumes the beacon is already DMA mapped */
static struct sk_buff *
static struct sk_buff *
ath10k_wmi_op_gen_beacon_dma(struct ath10k_vif *arvif)
ath10k_wmi_op_gen_beacon_dma(struct ath10k *ar, u32 vdev_id, const void *bcn,
			     size_t bcn_len, u32 bcn_paddr, bool dtim_zero,
			     bool deliver_cab)
{
{
	struct ath10k *ar = arvif->ar;
	struct wmi_bcn_tx_ref_cmd *cmd;
	struct wmi_bcn_tx_ref_cmd *cmd;
	struct sk_buff *skb;
	struct sk_buff *skb;
	struct sk_buff *beacon = arvif->beacon;
	struct ieee80211_hdr *hdr;
	struct ieee80211_hdr *hdr;
	u16 fc;
	u16 fc;


@@ -4869,22 +4876,22 @@ ath10k_wmi_op_gen_beacon_dma(struct ath10k_vif *arvif)
	if (!skb)
	if (!skb)
		return ERR_PTR(-ENOMEM);
		return ERR_PTR(-ENOMEM);


	hdr = (struct ieee80211_hdr *)beacon->data;
	hdr = (struct ieee80211_hdr *)bcn;
	fc = le16_to_cpu(hdr->frame_control);
	fc = le16_to_cpu(hdr->frame_control);


	cmd = (struct wmi_bcn_tx_ref_cmd *)skb->data;
	cmd = (struct wmi_bcn_tx_ref_cmd *)skb->data;
	cmd->vdev_id = __cpu_to_le32(arvif->vdev_id);
	cmd->vdev_id = __cpu_to_le32(vdev_id);
	cmd->data_len = __cpu_to_le32(beacon->len);
	cmd->data_len = __cpu_to_le32(bcn_len);
	cmd->data_ptr = __cpu_to_le32(ATH10K_SKB_CB(beacon)->paddr);
	cmd->data_ptr = __cpu_to_le32(bcn_paddr);
	cmd->msdu_id = 0;
	cmd->msdu_id = 0;
	cmd->frame_control = __cpu_to_le32(fc);
	cmd->frame_control = __cpu_to_le32(fc);
	cmd->flags = 0;
	cmd->flags = 0;
	cmd->antenna_mask = __cpu_to_le32(WMI_BCN_TX_REF_DEF_ANTENNA);
	cmd->antenna_mask = __cpu_to_le32(WMI_BCN_TX_REF_DEF_ANTENNA);


	if (ATH10K_SKB_CB(beacon)->bcn.dtim_zero)
	if (dtim_zero)
		cmd->flags |= __cpu_to_le32(WMI_BCN_TX_REF_FLAG_DTIM_ZERO);
		cmd->flags |= __cpu_to_le32(WMI_BCN_TX_REF_FLAG_DTIM_ZERO);


	if (ATH10K_SKB_CB(beacon)->bcn.deliver_cab)
	if (deliver_cab)
		cmd->flags |= __cpu_to_le32(WMI_BCN_TX_REF_FLAG_DELIVER_CAB);
		cmd->flags |= __cpu_to_le32(WMI_BCN_TX_REF_FLAG_DELIVER_CAB);


	return skb;
	return skb;