diff options
author | Michal Kazior <michal.kazior@tieto.com> | 2015-01-29 07:29:47 -0500 |
---|---|---|
committer | Kalle Valo <kvalo@qca.qualcomm.com> | 2015-02-04 02:17:00 -0500 |
commit | 9ad501827bd153dc2865dd60a456e3e43283b507 (patch) | |
tree | 25029f08b27b2ae645b4cc08ec2bbe74a9cba687 | |
parent | 627613f8f081928efe2e82100f54c67e17bea72c (diff) |
ath10k: change dma beacon cmd prototype
The command logic shouldn't really care about
arvif structure.
Signed-off-by: Michal Kazior <michal.kazior@tieto.com>
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
-rw-r--r-- | drivers/net/wireless/ath/ath10k/wmi-ops.h | 14 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath10k/wmi-tlv.c | 20 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath10k/wmi.c | 27 |
3 files changed, 38 insertions, 23 deletions
diff --git a/drivers/net/wireless/ath/ath10k/wmi-ops.h b/drivers/net/wireless/ath/ath10k/wmi-ops.h index 058f88b6ff53..de436162a805 100644 --- a/drivers/net/wireless/ath/ath10k/wmi-ops.h +++ b/drivers/net/wireless/ath/ath10k/wmi-ops.h | |||
@@ -104,7 +104,10 @@ struct wmi_ops { | |||
104 | u32 value); | 104 | u32 value); |
105 | struct sk_buff *(*gen_scan_chan_list)(struct ath10k *ar, | 105 | struct sk_buff *(*gen_scan_chan_list)(struct ath10k *ar, |
106 | const struct wmi_scan_chan_list_arg *arg); | 106 | const struct wmi_scan_chan_list_arg *arg); |
107 | struct sk_buff *(*gen_beacon_dma)(struct ath10k_vif *arvif); | 107 | struct sk_buff *(*gen_beacon_dma)(struct ath10k *ar, u32 vdev_id, |
108 | const void *bcn, size_t bcn_len, | ||
109 | u32 bcn_paddr, bool dtim_zero, | ||
110 | bool deliver_cab); | ||
108 | struct sk_buff *(*gen_pdev_set_wmm)(struct ath10k *ar, | 111 | struct sk_buff *(*gen_pdev_set_wmm)(struct ath10k *ar, |
109 | const struct wmi_wmm_params_all_arg *arg); | 112 | const struct wmi_wmm_params_all_arg *arg); |
110 | struct sk_buff *(*gen_request_stats)(struct ath10k *ar, | 113 | struct sk_buff *(*gen_request_stats)(struct ath10k *ar, |
@@ -768,16 +771,19 @@ ath10k_wmi_peer_assoc(struct ath10k *ar, | |||
768 | } | 771 | } |
769 | 772 | ||
770 | static inline int | 773 | static inline int |
771 | ath10k_wmi_beacon_send_ref_nowait(struct ath10k_vif *arvif) | 774 | ath10k_wmi_beacon_send_ref_nowait(struct ath10k *ar, u32 vdev_id, |
775 | const void *bcn, size_t bcn_len, | ||
776 | u32 bcn_paddr, bool dtim_zero, | ||
777 | bool deliver_cab) | ||
772 | { | 778 | { |
773 | struct ath10k *ar = arvif->ar; | ||
774 | struct sk_buff *skb; | 779 | struct sk_buff *skb; |
775 | int ret; | 780 | int ret; |
776 | 781 | ||
777 | if (!ar->wmi.ops->gen_beacon_dma) | 782 | if (!ar->wmi.ops->gen_beacon_dma) |
778 | return -EOPNOTSUPP; | 783 | return -EOPNOTSUPP; |
779 | 784 | ||
780 | skb = ar->wmi.ops->gen_beacon_dma(arvif); | 785 | skb = ar->wmi.ops->gen_beacon_dma(ar, vdev_id, bcn, bcn_len, bcn_paddr, |
786 | dtim_zero, deliver_cab); | ||
781 | if (IS_ERR(skb)) | 787 | if (IS_ERR(skb)) |
782 | return PTR_ERR(skb); | 788 | return PTR_ERR(skb); |
783 | 789 | ||
diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c index be32db96701f..ba78c187976c 100644 --- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c +++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c | |||
@@ -2001,13 +2001,15 @@ ath10k_wmi_tlv_op_gen_scan_chan_list(struct ath10k *ar, | |||
2001 | } | 2001 | } |
2002 | 2002 | ||
2003 | static struct sk_buff * | 2003 | static struct sk_buff * |
2004 | ath10k_wmi_tlv_op_gen_beacon_dma(struct ath10k_vif *arvif) | 2004 | ath10k_wmi_tlv_op_gen_beacon_dma(struct ath10k *ar, u32 vdev_id, |
2005 | const void *bcn, size_t bcn_len, | ||
2006 | u32 bcn_paddr, bool dtim_zero, | ||
2007 | bool deliver_cab) | ||
2008 | |||
2005 | { | 2009 | { |
2006 | struct ath10k *ar = arvif->ar; | ||
2007 | struct wmi_bcn_tx_ref_cmd *cmd; | 2010 | struct wmi_bcn_tx_ref_cmd *cmd; |
2008 | struct wmi_tlv *tlv; | 2011 | struct wmi_tlv *tlv; |
2009 | struct sk_buff *skb; | 2012 | struct sk_buff *skb; |
2010 | struct sk_buff *beacon = arvif->beacon; | ||
2011 | struct ieee80211_hdr *hdr; | 2013 | struct ieee80211_hdr *hdr; |
2012 | u16 fc; | 2014 | u16 fc; |
2013 | 2015 | ||
@@ -2015,24 +2017,24 @@ ath10k_wmi_tlv_op_gen_beacon_dma(struct ath10k_vif *arvif) | |||
2015 | if (!skb) | 2017 | if (!skb) |
2016 | return ERR_PTR(-ENOMEM); | 2018 | return ERR_PTR(-ENOMEM); |
2017 | 2019 | ||
2018 | hdr = (struct ieee80211_hdr *)beacon->data; | 2020 | hdr = (struct ieee80211_hdr *)bcn; |
2019 | fc = le16_to_cpu(hdr->frame_control); | 2021 | fc = le16_to_cpu(hdr->frame_control); |
2020 | 2022 | ||
2021 | tlv = (void *)skb->data; | 2023 | tlv = (void *)skb->data; |
2022 | tlv->tag = __cpu_to_le16(WMI_TLV_TAG_STRUCT_BCN_SEND_FROM_HOST_CMD); | 2024 | tlv->tag = __cpu_to_le16(WMI_TLV_TAG_STRUCT_BCN_SEND_FROM_HOST_CMD); |
2023 | tlv->len = __cpu_to_le16(sizeof(*cmd)); | 2025 | tlv->len = __cpu_to_le16(sizeof(*cmd)); |
2024 | cmd = (void *)tlv->value; | 2026 | cmd = (void *)tlv->value; |
2025 | cmd->vdev_id = __cpu_to_le32(arvif->vdev_id); | 2027 | cmd->vdev_id = __cpu_to_le32(vdev_id); |
2026 | cmd->data_len = __cpu_to_le32(beacon->len); | 2028 | cmd->data_len = __cpu_to_le32(bcn_len); |
2027 | cmd->data_ptr = __cpu_to_le32(ATH10K_SKB_CB(beacon)->paddr); | 2029 | cmd->data_ptr = __cpu_to_le32(bcn_paddr); |
2028 | cmd->msdu_id = 0; | 2030 | cmd->msdu_id = 0; |
2029 | cmd->frame_control = __cpu_to_le32(fc); | 2031 | cmd->frame_control = __cpu_to_le32(fc); |
2030 | cmd->flags = 0; | 2032 | cmd->flags = 0; |
2031 | 2033 | ||
2032 | if (ATH10K_SKB_CB(beacon)->bcn.dtim_zero) | 2034 | if (dtim_zero) |
2033 | cmd->flags |= __cpu_to_le32(WMI_BCN_TX_REF_FLAG_DTIM_ZERO); | 2035 | cmd->flags |= __cpu_to_le32(WMI_BCN_TX_REF_FLAG_DTIM_ZERO); |
2034 | 2036 | ||
2035 | if (ATH10K_SKB_CB(beacon)->bcn.deliver_cab) | 2037 | if (deliver_cab) |
2036 | cmd->flags |= __cpu_to_le32(WMI_BCN_TX_REF_FLAG_DELIVER_CAB); | 2038 | cmd->flags |= __cpu_to_le32(WMI_BCN_TX_REF_FLAG_DELIVER_CAB); |
2037 | 2039 | ||
2038 | ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi tlv beacon dma\n"); | 2040 | ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi tlv beacon dma\n"); |
diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index 81561e4ae308..01c0230cbf9b 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c | |||
@@ -956,6 +956,8 @@ err_pull: | |||
956 | 956 | ||
957 | static void ath10k_wmi_tx_beacon_nowait(struct ath10k_vif *arvif) | 957 | static void ath10k_wmi_tx_beacon_nowait(struct ath10k_vif *arvif) |
958 | { | 958 | { |
959 | struct sk_buff *bcn; | ||
960 | struct ath10k_skb_cb *cb; | ||
959 | int ret; | 961 | int ret; |
960 | 962 | ||
961 | lockdep_assert_held(&arvif->ar->data_lock); | 963 | lockdep_assert_held(&arvif->ar->data_lock); |
@@ -966,7 +968,12 @@ static void ath10k_wmi_tx_beacon_nowait(struct ath10k_vif *arvif) | |||
966 | if (arvif->beacon_sent) | 968 | if (arvif->beacon_sent) |
967 | return; | 969 | return; |
968 | 970 | ||
969 | ret = ath10k_wmi_beacon_send_ref_nowait(arvif); | 971 | bcn = arvif->beacon; |
972 | cb = ATH10K_SKB_CB(bcn); | ||
973 | ret = ath10k_wmi_beacon_send_ref_nowait(arvif->ar, arvif->vdev_id, | ||
974 | bcn->data, bcn->len, cb->paddr, | ||
975 | cb->bcn.dtim_zero, | ||
976 | cb->bcn.deliver_cab); | ||
970 | if (ret) | 977 | if (ret) |
971 | return; | 978 | return; |
972 | 979 | ||
@@ -4856,12 +4863,12 @@ ath10k_wmi_10_2_op_gen_pdev_get_temperature(struct ath10k *ar) | |||
4856 | 4863 | ||
4857 | /* This function assumes the beacon is already DMA mapped */ | 4864 | /* This function assumes the beacon is already DMA mapped */ |
4858 | static struct sk_buff * | 4865 | static struct sk_buff * |
4859 | ath10k_wmi_op_gen_beacon_dma(struct ath10k_vif *arvif) | 4866 | ath10k_wmi_op_gen_beacon_dma(struct ath10k *ar, u32 vdev_id, const void *bcn, |
4867 | size_t bcn_len, u32 bcn_paddr, bool dtim_zero, | ||
4868 | bool deliver_cab) | ||
4860 | { | 4869 | { |
4861 | struct ath10k *ar = arvif->ar; | ||
4862 | struct wmi_bcn_tx_ref_cmd *cmd; | 4870 | struct wmi_bcn_tx_ref_cmd *cmd; |
4863 | struct sk_buff *skb; | 4871 | struct sk_buff *skb; |
4864 | struct sk_buff *beacon = arvif->beacon; | ||
4865 | struct ieee80211_hdr *hdr; | 4872 | struct ieee80211_hdr *hdr; |
4866 | u16 fc; | 4873 | u16 fc; |
4867 | 4874 | ||
@@ -4869,22 +4876,22 @@ ath10k_wmi_op_gen_beacon_dma(struct ath10k_vif *arvif) | |||
4869 | if (!skb) | 4876 | if (!skb) |
4870 | return ERR_PTR(-ENOMEM); | 4877 | return ERR_PTR(-ENOMEM); |
4871 | 4878 | ||
4872 | hdr = (struct ieee80211_hdr *)beacon->data; | 4879 | hdr = (struct ieee80211_hdr *)bcn; |
4873 | fc = le16_to_cpu(hdr->frame_control); | 4880 | fc = le16_to_cpu(hdr->frame_control); |
4874 | 4881 | ||
4875 | cmd = (struct wmi_bcn_tx_ref_cmd *)skb->data; | 4882 | cmd = (struct wmi_bcn_tx_ref_cmd *)skb->data; |
4876 | cmd->vdev_id = __cpu_to_le32(arvif->vdev_id); | 4883 | cmd->vdev_id = __cpu_to_le32(vdev_id); |
4877 | cmd->data_len = __cpu_to_le32(beacon->len); | 4884 | cmd->data_len = __cpu_to_le32(bcn_len); |
4878 | cmd->data_ptr = __cpu_to_le32(ATH10K_SKB_CB(beacon)->paddr); | 4885 | cmd->data_ptr = __cpu_to_le32(bcn_paddr); |
4879 | cmd->msdu_id = 0; | 4886 | cmd->msdu_id = 0; |
4880 | cmd->frame_control = __cpu_to_le32(fc); | 4887 | cmd->frame_control = __cpu_to_le32(fc); |
4881 | cmd->flags = 0; | 4888 | cmd->flags = 0; |
4882 | cmd->antenna_mask = __cpu_to_le32(WMI_BCN_TX_REF_DEF_ANTENNA); | 4889 | cmd->antenna_mask = __cpu_to_le32(WMI_BCN_TX_REF_DEF_ANTENNA); |
4883 | 4890 | ||
4884 | if (ATH10K_SKB_CB(beacon)->bcn.dtim_zero) | 4891 | if (dtim_zero) |
4885 | cmd->flags |= __cpu_to_le32(WMI_BCN_TX_REF_FLAG_DTIM_ZERO); | 4892 | cmd->flags |= __cpu_to_le32(WMI_BCN_TX_REF_FLAG_DTIM_ZERO); |
4886 | 4893 | ||
4887 | if (ATH10K_SKB_CB(beacon)->bcn.deliver_cab) | 4894 | if (deliver_cab) |
4888 | cmd->flags |= __cpu_to_le32(WMI_BCN_TX_REF_FLAG_DELIVER_CAB); | 4895 | cmd->flags |= __cpu_to_le32(WMI_BCN_TX_REF_FLAG_DELIVER_CAB); |
4889 | 4896 | ||
4890 | return skb; | 4897 | return skb; |