From patchwork Wed Nov 18 05:59:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 7644691 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@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 A81229F392 for ; Wed, 18 Nov 2015 05:59:44 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A1E10205B1 for ; Wed, 18 Nov 2015 05:59:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8C2632062B for ; Wed, 18 Nov 2015 05:59:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753606AbbKRF7k (ORCPT ); Wed, 18 Nov 2015 00:59:40 -0500 Received: from mail-lf0-f43.google.com ([209.85.215.43]:32952 "EHLO mail-lf0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753173AbbKRF7i (ORCPT ); Wed, 18 Nov 2015 00:59:38 -0500 Received: by lfaz4 with SMTP id z4so19646910lfa.0 for ; Tue, 17 Nov 2015 21:59:37 -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=8JNJLjkWdUDH0hSwYhWwwNqbACPfyNphBB0FRJvvXE4=; b=KOX9Mk6+FXZXM8QRylU2Zapw2LGy0LlW1xS/GIv92oUwRdeMjZphsHJpFhbetoQjPo knIu+KbXlOeAWOoytZc5X00QShAoYKOXnESWEB45+/MfmQ9zyGnmfHqJ6oxvXrgP1AdP pSEGSdj6BFllkecaZUnh8IbZcajJUy5OwDs18= 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=8JNJLjkWdUDH0hSwYhWwwNqbACPfyNphBB0FRJvvXE4=; b=Qby3DqG1xprNEgI8/aKSkYHJYlw6r7XEXsphVFvGaQkysa0b6ewkp0cmNhhNz7aMRV f3VuGEQqt7mIBXSFOXxhfD0fgqZZlwowTKBFAQAFYTjpI5Q8pYWXOtHUDP/yWwPeUjCp VDM2Ab3+yV/EfOnYIy2kDt+v7whK2iBkgV87MYO1BQlaYq1GlbsPo/93GC7jLDCZmz+n 4cx7SkMnyCR8Zt4iQiPSUMOXYc6m2hpUUvy+LPOYIT4PQHtUsRvYEqTOUKv3PcFjqrGh a9vrF3J3E8iVqbXX0s5ZUdqT2gOLw6fHAUg0LFnB7G5+vWsP+Ct4pkgJxboZApo0Dxn2 eI7Q== X-Gm-Message-State: ALoCoQk/JZtNcqARYKZBGWYy/32UVlGjN0zUZUQEyC1Plla4qrqMPTIkavZh9tWq1xJf/NWxhN81rsjN2LR/Xd/4IxK2nnYW1ON8ogCQNCCjI9YAwzNY/wElSssXmmRcDpr+dVbfDrY1 X-Received: by 10.25.85.78 with SMTP id j75mr8928779lfb.46.1447826376953; Tue, 17 Nov 2015 21:59:36 -0800 (PST) Received: from localhost.localdomain ([91.198.246.10]) by smtp.gmail.com with ESMTPSA id rm5sm165290lbb.20.2015.11.17.21.59.35 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 17 Nov 2015 21:59:35 -0800 (PST) From: Michal Kazior To: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Michal Kazior Subject: [PATCH v3 6/9] ath10k: pack up flags in skb_cb Date: Wed, 18 Nov 2015 06:59:20 +0100 Message-Id: <1447826363-16818-7-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1447826363-16818-1-git-send-email-michal.kazior@tieto.com> References: <87mvuj585b.fsf@kamboji.qca.qualcomm.com> <1447826363-16818-1-git-send-email-michal.kazior@tieto.com> X-DomainID: tieto.com Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,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 It was wasteful to have all the flags as separate bools. Signed-off-by: Michal Kazior --- drivers/net/wireless/ath/ath10k/core.h | 13 +++++++------ drivers/net/wireless/ath/ath10k/htt_tx.c | 4 ++-- drivers/net/wireless/ath/ath10k/mac.c | 10 +++++++--- drivers/net/wireless/ath/ath10k/wmi.c | 12 ++++++++---- 4 files changed, 24 insertions(+), 15 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h index 804fd2e5bc38..6b9b37329621 100644 --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h @@ -81,22 +81,23 @@ static inline const char *ath10k_bus_str(enum ath10k_bus bus) return "unknown"; } +enum ath10k_skb_flags { + ATH10K_SKB_F_NO_HWCRYPT = BIT(0), + ATH10K_SKB_F_DTIM_ZERO = BIT(1), + ATH10K_SKB_F_DELIVER_CAB = BIT(2), +}; + struct ath10k_skb_cb { dma_addr_t paddr; + u8 flags; u8 eid; u8 vdev_id; struct { u8 tid; - bool nohwcrypt; struct ath10k_htt_txbuf *txbuf; u32 txbuf_paddr; } __packed htt; - - struct { - bool dtim_zero; - bool deliver_cab; - } bcn; } __packed; struct ath10k_skb_rxcb { diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c index a7d8798b2f37..c955c6b6ea9d 100644 --- a/drivers/net/wireless/ath/ath10k/htt_tx.c +++ b/drivers/net/wireless/ath/ath10k/htt_tx.c @@ -586,7 +586,7 @@ int ath10k_htt_tx(struct ath10k_htt *htt, enum ath10k_hw_txrx_mode txmode, ieee80211_is_disassoc(hdr->frame_control)) && ieee80211_has_protected(hdr->frame_control)) { skb_put(msdu, IEEE80211_CCMP_MIC_LEN); - } else if (!skb_cb->htt.nohwcrypt && + } else if (!(skb_cb->flags & ATH10K_SKB_F_NO_HWCRYPT) && txmode == ATH10K_HW_TXRX_RAW && ieee80211_has_protected(hdr->frame_control)) { skb_put(msdu, IEEE80211_CCMP_MIC_LEN); @@ -666,7 +666,7 @@ int ath10k_htt_tx(struct ath10k_htt *htt, enum ath10k_hw_txrx_mode txmode, prefetch_len); skb_cb->htt.txbuf->htc_hdr.flags = 0; - if (skb_cb->htt.nohwcrypt) + if (skb_cb->flags & ATH10K_SKB_F_NO_HWCRYPT) flags0 |= HTT_DATA_TX_DESC_FLAGS0_NO_ENCRYPT; flags1 |= SM((u16)vdev_id, HTT_DATA_TX_DESC_FLAGS1_VDEV_ID); diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 0ca5d5bea509..38c241596965 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -3672,6 +3672,7 @@ static void ath10k_tx(struct ieee80211_hw *hw, struct sk_buff *skb) { struct ath10k *ar = hw->priv; + struct ath10k_skb_cb *skb_cb = ATH10K_SKB_CB(skb); struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); struct ieee80211_vif *vif = info->control.vif; struct ieee80211_sta *sta = control->sta; @@ -3684,9 +3685,12 @@ static void ath10k_tx(struct ieee80211_hw *hw, txmode = ath10k_mac_tx_h_get_txmode(ar, vif, sta, skb); - ATH10K_SKB_CB(skb)->htt.tid = ath10k_tx_h_get_tid(hdr); - ATH10K_SKB_CB(skb)->htt.nohwcrypt = !ath10k_tx_h_use_hwcrypto(vif, skb); - ATH10K_SKB_CB(skb)->vdev_id = ath10k_tx_h_get_vdev_id(ar, vif); + skb_cb->flags = 0; + if (!ath10k_tx_h_use_hwcrypto(vif, skb)) + skb_cb->flags |= ATH10K_SKB_F_NO_HWCRYPT; + + skb_cb->htt.tid = ath10k_tx_h_get_tid(hdr); + skb_cb->vdev_id = ath10k_tx_h_get_vdev_id(ar, vif); switch (txmode) { case ATH10K_HW_TXRX_MGMT: diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index 902107934edd..6028a598c199 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -1715,6 +1715,8 @@ static void ath10k_wmi_tx_beacon_nowait(struct ath10k_vif *arvif) struct ath10k *ar = arvif->ar; struct ath10k_skb_cb *cb; struct sk_buff *bcn; + bool dtim_zero; + bool deliver_cab; int ret; spin_lock_bh(&ar->data_lock); @@ -1734,12 +1736,14 @@ static void ath10k_wmi_tx_beacon_nowait(struct ath10k_vif *arvif) arvif->beacon_state = ATH10K_BEACON_SENDING; spin_unlock_bh(&ar->data_lock); + dtim_zero = !!(cb->flags & ATH10K_SKB_F_DTIM_ZERO); + deliver_cab = !!(cb->flags & ATH10K_SKB_F_DELIVER_CAB); 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); + dtim_zero, + deliver_cab); spin_lock_bh(&ar->data_lock); @@ -3157,10 +3161,10 @@ static void ath10k_wmi_update_tim(struct ath10k *ar, memcpy(tim->virtual_map, arvif->u.ap.tim_bitmap, pvm_len); if (tim->dtim_count == 0) { - ATH10K_SKB_CB(bcn)->bcn.dtim_zero = true; + ATH10K_SKB_CB(bcn)->flags |= ATH10K_SKB_F_DTIM_ZERO; if (__le32_to_cpu(tim_info->tim_mcast) == 1) - ATH10K_SKB_CB(bcn)->bcn.deliver_cab = true; + ATH10K_SKB_CB(bcn)->flags |= ATH10K_SKB_F_DELIVER_CAB; } ath10k_dbg(ar, ATH10K_DBG_MGMT, "dtim %d/%d mcast %d pvmlen %d\n",