From patchwork Mon Jan 19 08:53:41 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 5655641 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 F41E59F333 for ; Mon, 19 Jan 2015 08:55:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D6EAE2034A for ; Mon, 19 Jan 2015 08:55:10 +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 5C06D20328 for ; Mon, 19 Jan 2015 08:55:09 +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 1YD86r-0005EU-H2; Mon, 19 Jan 2015 08:54:57 +0000 Received: from mail-wg0-x236.google.com ([2a00:1450:400c:c00::236]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YD86m-0004qe-FW for ath10k@lists.infradead.org; Mon, 19 Jan 2015 08:54:55 +0000 Received: by mail-wg0-f54.google.com with SMTP id b13so349634wgh.13 for ; Mon, 19 Jan 2015 00:54:23 -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; bh=H5CJ2B1yfBfSE1eFYptuuVTekxQgk0GTeLP3TIremFs=; b=uyd5LenccKndRtmD17MB0b5o1DZ7+j5/k0xM723Gg+ok4QfdqF+txy9Qs8JE4Dklh5 iZRlNQfKQq+/lR77h7cpOYmxXlD4JMQwz2Z+BflknTOWgGepCDQkk5pBAZUXPTgUgJLD 9rw3LEhAHa9ecjX17aZyWagqUV+oa4eVko8J0= 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; bh=H5CJ2B1yfBfSE1eFYptuuVTekxQgk0GTeLP3TIremFs=; b=GxNlVuYLD8oPJw9ULIULnwLCxeWXk31QkfA9kuNFpRF+6PdHPmBXGBZfS2erXg9kVG D1/NT9q+a+vXbGd5xfueFOA8QMrv9MVKKoanlorhV0a8uO1Bb4farl2aU0Ue9ziy5czG 49zX2ADnh7DzzvjpxOx9qFVnHtL18kxJzcL9jMSQgpqvwKPgTEii5BtEFaaeDN74DWr1 vKPC/3eyii7f0wP/Jo55D8c77Qs6QeEg3scxpXtPzJ53WtITYl8/dQjSW+p2bCAPtJn0 WLF7TWZX5r+JNhnbyru4pa7obtQB8CI+g9GiT00I6Qr0jLhq9IAtsnxgpQ0fQqF++lew v8CQ== X-Gm-Message-State: ALoCoQnIbjtTdWl7QHScFp2Or7c45ZdqCKeenvBv88EK/0lDILDR0x08qrFcZjBb5j1AEb6dR5DJjPcBo5s6wnvrSDnlSdEBaHeKvLSaQcd7fCH3Ycapnt/ApCjvZUWnYCJWiK/BffzEU7weQAtRcvNrenHSgndCI6Qxhbq4AP2FmRgerkjsRzU= X-Received: by 10.194.87.100 with SMTP id w4mr58126076wjz.65.1421657663531; Mon, 19 Jan 2015 00:54:23 -0800 (PST) Received: from bob.homerouter.cpe (apn-46-76-65-212.dynamic.gprs.plus.pl. [46.76.65.212]) by mx.google.com with ESMTPSA id gl1sm8441930wib.13.2015.01.19.00.54.22 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Jan 2015 00:54:22 -0800 (PST) From: Michal Kazior To: ath10k@lists.infradead.org Subject: [PATCH 1/3] ath10k: move wmm param storage to vif Date: Mon, 19 Jan 2015 09:53:41 +0100 Message-Id: <1421657623-11706-1-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 1.8.5.3 X-DomainID: tieto.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150119_005452_881517_B3E2E635 X-CRM114-Status: GOOD ( 12.47 ) 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 mac80211 already requests WMM per vif but firmware wasn't able to handle this until now. However new wmi-tlv firmware for qca6174 is capable of this. This prepares per-vif WMM param setup. Signed-off-by: Michal Kazior --- drivers/net/wireless/ath/ath10k/core.h | 2 +- drivers/net/wireless/ath/ath10k/mac.c | 11 ++++++----- drivers/net/wireless/ath/ath10k/wmi-ops.h | 4 ++-- drivers/net/wireless/ath/ath10k/wmi-tlv.c | 32 +++++++++++++++---------------- drivers/net/wireless/ath/ath10k/wmi.c | 14 +++++++------- drivers/net/wireless/ath/ath10k/wmi.h | 6 +++--- 6 files changed, 35 insertions(+), 34 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h index c5686122..238ec7e 100644 --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h @@ -301,6 +301,7 @@ struct ath10k_vif { bool use_cts_prot; int num_legacy_stations; int txpower; + struct wmi_wmm_params_all_arg wmm_params; }; struct ath10k_vif_iter { @@ -564,7 +565,6 @@ struct ath10k { u8 cfg_tx_chainmask; u8 cfg_rx_chainmask; - struct wmi_pdev_set_wmm_params_arg wmm_params; struct completion install_key_done; struct completion vdev_setup_done; diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 9524bc5..a2a145b 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -4061,6 +4061,7 @@ static int ath10k_conf_tx(struct ieee80211_hw *hw, const struct ieee80211_tx_queue_params *params) { struct ath10k *ar = hw->priv; + struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif); struct wmi_wmm_params_arg *p = NULL; int ret; @@ -4068,16 +4069,16 @@ static int ath10k_conf_tx(struct ieee80211_hw *hw, switch (ac) { case IEEE80211_AC_VO: - p = &ar->wmm_params.ac_vo; + p = &arvif->wmm_params.ac_vo; break; case IEEE80211_AC_VI: - p = &ar->wmm_params.ac_vi; + p = &arvif->wmm_params.ac_vi; break; case IEEE80211_AC_BE: - p = &ar->wmm_params.ac_be; + p = &arvif->wmm_params.ac_be; break; case IEEE80211_AC_BK: - p = &ar->wmm_params.ac_bk; + p = &arvif->wmm_params.ac_bk; break; } @@ -4098,7 +4099,7 @@ static int ath10k_conf_tx(struct ieee80211_hw *hw, p->txop = params->txop * 32; /* FIXME: FW accepts wmm params per hw, not per vif */ - ret = ath10k_wmi_pdev_set_wmm_params(ar, &ar->wmm_params); + ret = ath10k_wmi_pdev_set_wmm_params(ar, &arvif->wmm_params); if (ret) { ath10k_warn(ar, "failed to set wmm params: %d\n", ret); goto exit; diff --git a/drivers/net/wireless/ath/ath10k/wmi-ops.h b/drivers/net/wireless/ath/ath10k/wmi-ops.h index 0dd49a7..4bb8cdd 100644 --- a/drivers/net/wireless/ath/ath10k/wmi-ops.h +++ b/drivers/net/wireless/ath/ath10k/wmi-ops.h @@ -104,7 +104,7 @@ struct wmi_ops { const struct wmi_scan_chan_list_arg *arg); struct sk_buff *(*gen_beacon_dma)(struct ath10k_vif *arvif); struct sk_buff *(*gen_pdev_set_wmm)(struct ath10k *ar, - const struct wmi_pdev_set_wmm_params_arg *arg); + const struct wmi_wmm_params_all_arg *arg); struct sk_buff *(*gen_request_stats)(struct ath10k *ar, enum wmi_stats_id stats_id); struct sk_buff *(*gen_force_fw_hang)(struct ath10k *ar, @@ -749,7 +749,7 @@ ath10k_wmi_beacon_send_ref_nowait(struct ath10k_vif *arvif) static inline int ath10k_wmi_pdev_set_wmm_params(struct ath10k *ar, - const struct wmi_pdev_set_wmm_params_arg *arg) + const struct wmi_wmm_params_all_arg *arg) { struct sk_buff *skb; diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c index 6f34fc7..3e9725b 100644 --- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c +++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c @@ -1406,6 +1406,21 @@ ath10k_wmi_tlv_op_gen_vdev_install_key(struct ath10k *ar, return skb; } +static void *ath10k_wmi_tlv_put_wmm(void *ptr, + const struct wmi_wmm_params_arg *arg) +{ + struct wmi_wmm_params *wmm; + struct wmi_tlv *tlv; + + tlv = ptr; + tlv->tag = __cpu_to_le16(WMI_TLV_TAG_STRUCT_WMM_PARAMS); + tlv->len = __cpu_to_le16(sizeof(*wmm)); + wmm = (void *)tlv->value; + ath10k_wmi_set_wmm_param(wmm, arg); + + return ptr + sizeof(*tlv) + sizeof(*wmm); +} + static struct sk_buff * ath10k_wmi_tlv_op_gen_peer_create(struct ath10k *ar, u32 vdev_id, const u8 peer_addr[ETH_ALEN]) @@ -1766,24 +1781,9 @@ ath10k_wmi_tlv_op_gen_beacon_dma(struct ath10k_vif *arvif) return skb; } -static void *ath10k_wmi_tlv_put_wmm(void *ptr, - const struct wmi_wmm_params_arg *arg) -{ - struct wmi_wmm_params *wmm; - struct wmi_tlv *tlv; - - tlv = ptr; - tlv->tag = __cpu_to_le16(WMI_TLV_TAG_STRUCT_WMM_PARAMS); - tlv->len = __cpu_to_le16(sizeof(*wmm)); - wmm = (void *)tlv->value; - ath10k_wmi_pdev_set_wmm_param(wmm, arg); - - return ptr + sizeof(*tlv) + sizeof(*wmm); -} - static struct sk_buff * ath10k_wmi_tlv_op_gen_pdev_set_wmm(struct ath10k *ar, - const struct wmi_pdev_set_wmm_params_arg *arg) + const struct wmi_wmm_params_all_arg *arg) { struct wmi_tlv_pdev_set_wmm_cmd *cmd; struct wmi_wmm_params *wmm; diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index 5fe17e8..105d561 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -4717,8 +4717,8 @@ ath10k_wmi_op_gen_beacon_dma(struct ath10k_vif *arvif) return skb; } -void ath10k_wmi_pdev_set_wmm_param(struct wmi_wmm_params *params, - const struct wmi_wmm_params_arg *arg) +void ath10k_wmi_set_wmm_param(struct wmi_wmm_params *params, + const struct wmi_wmm_params_arg *arg) { params->cwmin = __cpu_to_le32(arg->cwmin); params->cwmax = __cpu_to_le32(arg->cwmax); @@ -4730,7 +4730,7 @@ void ath10k_wmi_pdev_set_wmm_param(struct wmi_wmm_params *params, static struct sk_buff * ath10k_wmi_op_gen_pdev_set_wmm(struct ath10k *ar, - const struct wmi_pdev_set_wmm_params_arg *arg) + const struct wmi_wmm_params_all_arg *arg) { struct wmi_pdev_set_wmm_params *cmd; struct sk_buff *skb; @@ -4740,10 +4740,10 @@ ath10k_wmi_op_gen_pdev_set_wmm(struct ath10k *ar, return ERR_PTR(-ENOMEM); cmd = (struct wmi_pdev_set_wmm_params *)skb->data; - ath10k_wmi_pdev_set_wmm_param(&cmd->ac_be, &arg->ac_be); - ath10k_wmi_pdev_set_wmm_param(&cmd->ac_bk, &arg->ac_bk); - ath10k_wmi_pdev_set_wmm_param(&cmd->ac_vi, &arg->ac_vi); - ath10k_wmi_pdev_set_wmm_param(&cmd->ac_vo, &arg->ac_vo); + ath10k_wmi_set_wmm_param(&cmd->ac_be, &arg->ac_be); + ath10k_wmi_set_wmm_param(&cmd->ac_bk, &arg->ac_bk); + ath10k_wmi_set_wmm_param(&cmd->ac_vi, &arg->ac_vi); + ath10k_wmi_set_wmm_param(&cmd->ac_vo, &arg->ac_vo); ath10k_dbg(ar, ATH10K_DBG_WMI, "wmi pdev set wmm params\n"); return skb; diff --git a/drivers/net/wireless/ath/ath10k/wmi.h b/drivers/net/wireless/ath/ath10k/wmi.h index bd7f29a..ab89359 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.h +++ b/drivers/net/wireless/ath/ath10k/wmi.h @@ -2939,7 +2939,7 @@ struct wmi_wmm_params_arg { u32 no_ack; }; -struct wmi_pdev_set_wmm_params_arg { +struct wmi_wmm_params_all_arg { struct wmi_wmm_params_arg ac_be; struct wmi_wmm_params_arg ac_bk; struct wmi_wmm_params_arg ac_vi; @@ -4780,8 +4780,8 @@ void ath10k_wmi_put_host_mem_chunks(struct ath10k *ar, struct wmi_host_mem_chunks *chunks); void ath10k_wmi_put_start_scan_common(struct wmi_start_scan_common *cmn, const struct wmi_start_scan_arg *arg); -void ath10k_wmi_pdev_set_wmm_param(struct wmi_wmm_params *params, - const struct wmi_wmm_params_arg *arg); +void ath10k_wmi_set_wmm_param(struct wmi_wmm_params *params, + const struct wmi_wmm_params_arg *arg); void ath10k_wmi_put_wmi_channel(struct wmi_channel *ch, const struct wmi_channel_arg *arg); int ath10k_wmi_start_scan_verify(const struct wmi_start_scan_arg *arg);