From patchwork Wed Jan 28 10:22:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 5727781 Return-Path: X-Original-To: patchwork-ath10k@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BA0BC9F1D6 for ; Wed, 28 Jan 2015 10:23:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A71732026F for ; Wed, 28 Jan 2015 10:23:31 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8CD6C201DD for ; Wed, 28 Jan 2015 10:23:30 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YGPmP-0005cT-7L; Wed, 28 Jan 2015 10:23:25 +0000 Received: from mail-wi0-x22e.google.com ([2a00:1450:400c:c05::22e]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YGPmM-0005TR-JJ for ath10k@lists.infradead.org; Wed, 28 Jan 2015 10:23:23 +0000 Received: by mail-wi0-f174.google.com with SMTP id n3so10776713wiv.1 for ; Wed, 28 Jan 2015 02:23:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=DyWtvdqfArNtwGwhzU8P/xWeeWDG8z7B9FXdUFBkI7s=; b=sV07U9XdRBCQcBOehpe6I8bHxgAv5dVIiaGOFxAdMfDrrBE7tiBJ1MkAwOLH9oqQhV NRE95+oJv0N23N5xhoMikn8Ows/PSBwWnyOI+Na+cFxVSR+CkKSeL213i2VFb5zOubDw q2Viurqdm8KFhxbnGUSN99x86p1PLE+7VfIi4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=DyWtvdqfArNtwGwhzU8P/xWeeWDG8z7B9FXdUFBkI7s=; b=NVEF853TUYbItpNqzYsVdtN88WqO5T1zlJXNHxI4L9SfqL71sjjjBlHzgcfyzJ2+6X kDY0tDkAFIl6w5xBNNakb5kgek7vlP7P5Qu5JKkNeuNWZ1xVzaHeDdNdlbkfZfBk308/ /58TTcVcfmI6Bw3Yttk3g+LsTHOt035lFOHGSsW53nUkSVzAT2hJuc0xEBr1DS+K6hv/ 3eY8A5WlPvF3bXte78lWaljaa86CyzE78N3r7qhGqmMufxA0JZ3+EKKcJeMnYNe3cmHA WcS1Fpq4sUpBI1m7A8BWNppVDXkhcCQ+OuZbfp00spl+FeNtOVS06EMYCi6KW90B/oKZ rybg== X-Gm-Message-State: ALoCoQnAGHFpA8JV12lPTcehzbfOn5FfZlarpFv8nxoSqjEznE9etiwNtrY4076aaWA4GGLSNKor6nvnLgqgbMH6bACpaLtryglj6i+lrrkXCrn9pqMmdWGCU4h2Ut/y5k9jzLgPYAiYN4rdkFODg4pt7HyrHvaBIRvmDDrv7pNujUbeLfWjmcg= X-Received: by 10.180.198.209 with SMTP id je17mr4102078wic.17.1422440580533; Wed, 28 Jan 2015 02:23:00 -0800 (PST) Received: from bob.homerouter.cpe (apn-31-1-134-151.dynamic.gprs.plus.pl. [31.1.134.151]) by mx.google.com with ESMTPSA id x18sm2140166wia.12.2015.01.28.02.22.59 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Jan 2015 02:23:00 -0800 (PST) From: Michal Kazior To: ath10k@lists.infradead.org Subject: [PATCH v2 1/2] ath10k: change dma beacon cmd prototype Date: Wed, 28 Jan 2015 11:22:04 +0100 Message-Id: <1422440525-11115-1-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 1.8.5.3 In-Reply-To: <1421412811-6387-1-git-send-email-michal.kazior@tieto.com> References: <1421412811-6387-1-git-send-email-michal.kazior@tieto.com> X-DomainID: tieto.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150128_022322_921096_8D754B88 X-CRM114-Status: GOOD ( 11.17 ) X-Spam-Score: -0.8 (/) Cc: linux-wireless@vger.kernel.org, Michal Kazior X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The command logic shouldn't really care about arvif structure. Signed-off-by: Michal Kazior --- drivers/net/wireless/ath/ath10k/wmi-ops.h | 14 ++++++++++---- drivers/net/wireless/ath/ath10k/wmi-tlv.c | 20 +++++++++++--------- 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 80bd28a..06062cf 100644 --- a/drivers/net/wireless/ath/ath10k/wmi-ops.h +++ b/drivers/net/wireless/ath/ath10k/wmi-ops.h @@ -102,7 +102,10 @@ struct wmi_ops { u32 value); struct sk_buff *(*gen_scan_chan_list)(struct ath10k *ar, 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, const struct wmi_pdev_set_wmm_params_arg *arg); struct sk_buff *(*gen_request_stats)(struct ath10k *ar, @@ -749,16 +752,19 @@ ath10k_wmi_peer_assoc(struct ath10k *ar, } 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; int ret; if (!ar->wmi.ops->gen_beacon_dma) 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)) return PTR_ERR(skb); diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c index d3cf91dc..c3d077f 100644 --- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c +++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c @@ -1906,13 +1906,15 @@ ath10k_wmi_tlv_op_gen_scan_chan_list(struct ath10k *ar, } 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_tlv *tlv; struct sk_buff *skb; - struct sk_buff *beacon = arvif->beacon; struct ieee80211_hdr *hdr; u16 fc; @@ -1920,24 +1922,24 @@ ath10k_wmi_tlv_op_gen_beacon_dma(struct ath10k_vif *arvif) if (!skb) return ERR_PTR(-ENOMEM); - hdr = (struct ieee80211_hdr *)beacon->data; + hdr = (struct ieee80211_hdr *)bcn; fc = le16_to_cpu(hdr->frame_control); tlv = (void *)skb->data; tlv->tag = __cpu_to_le16(WMI_TLV_TAG_STRUCT_BCN_SEND_FROM_HOST_CMD); tlv->len = __cpu_to_le16(sizeof(*cmd)); cmd = (void *)tlv->value; - cmd->vdev_id = __cpu_to_le32(arvif->vdev_id); - cmd->data_len = __cpu_to_le32(beacon->len); - cmd->data_ptr = __cpu_to_le32(ATH10K_SKB_CB(beacon)->paddr); + cmd->vdev_id = __cpu_to_le32(vdev_id); + cmd->data_len = __cpu_to_le32(bcn_len); + cmd->data_ptr = __cpu_to_le32(bcn_paddr); cmd->msdu_id = 0; cmd->frame_control = __cpu_to_le32(fc); 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); - if (ATH10K_SKB_CB(beacon)->bcn.deliver_cab) + if (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"); diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index d340361..459b203 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -956,6 +956,8 @@ err_pull: static void ath10k_wmi_tx_beacon_nowait(struct ath10k_vif *arvif) { + struct sk_buff *bcn; + struct ath10k_skb_cb *cb; int ret; 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) 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) 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 */ 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 sk_buff *skb; - struct sk_buff *beacon = arvif->beacon; struct ieee80211_hdr *hdr; u16 fc; @@ -4869,22 +4876,22 @@ ath10k_wmi_op_gen_beacon_dma(struct ath10k_vif *arvif) if (!skb) return ERR_PTR(-ENOMEM); - hdr = (struct ieee80211_hdr *)beacon->data; + hdr = (struct ieee80211_hdr *)bcn; fc = le16_to_cpu(hdr->frame_control); cmd = (struct wmi_bcn_tx_ref_cmd *)skb->data; - cmd->vdev_id = __cpu_to_le32(arvif->vdev_id); - cmd->data_len = __cpu_to_le32(beacon->len); - cmd->data_ptr = __cpu_to_le32(ATH10K_SKB_CB(beacon)->paddr); + cmd->vdev_id = __cpu_to_le32(vdev_id); + cmd->data_len = __cpu_to_le32(bcn_len); + cmd->data_ptr = __cpu_to_le32(bcn_paddr); cmd->msdu_id = 0; cmd->frame_control = __cpu_to_le32(fc); cmd->flags = 0; 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); - if (ATH10K_SKB_CB(beacon)->bcn.deliver_cab) + if (deliver_cab) cmd->flags |= __cpu_to_le32(WMI_BCN_TX_REF_FLAG_DELIVER_CAB); return skb;