From patchwork Tue Dec 23 07:47:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Kondratiev X-Patchwork-Id: 5531081 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 33DA5BEEA8 for ; Tue, 23 Dec 2014 07:48:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 583B220121 for ; Tue, 23 Dec 2014 07:48:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6C7E92010C for ; Tue, 23 Dec 2014 07:48:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755344AbaLWHss (ORCPT ); Tue, 23 Dec 2014 02:48:48 -0500 Received: from wolverine02.qualcomm.com ([199.106.114.251]:21161 "EHLO wolverine02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755182AbaLWHse (ORCPT ); Tue, 23 Dec 2014 02:48:34 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qca.qualcomm.com; i=@qca.qualcomm.com; q=dns/txt; s=qcdkim; t=1419320914; x=1450856914; h=from:cc:to:subject:date:message-id:in-reply-to: references; bh=5jH386E2yhAhXo9BJP0JzMGwy6Q5+LOVPfHXk59wIFM=; b=iNyHGSThehbHYnuGWrAsz7yKT8vkrJLS+d6UCKw0WqSKf+IktuNbr2BQ neB/HKkbVvciwVHSWY4cbeW/lWa4/2k0JcoBLG3suWPr29wFa3XEX+wTG p3V7yrcLikjvvUHOqGptfA8haMFG22mu239GtiOANxg3EHjXgNbvnKJTZ s=; X-IronPort-AV: E=McAfee;i="5600,1067,7660"; a="186726575" Received: from ironmsg03-r.qualcomm.com ([172.30.46.17]) by wolverine02.qualcomm.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 22 Dec 2014 23:48:31 -0800 From: Vladimir Kondratiev Cc: Vladimir Kondratiev , linux-wireless@vger.kernel.org, wil6210@qca.qualcomm.com X-IronPort-AV: E=Sophos;i="5.07,630,1413270000"; d="scan'208";a="817199510" Received: from lx-wigig-72.mea.qualcomm.com ([10.18.164.37]) by Ironmsg03-R.qualcomm.com with ESMTP; 22 Dec 2014 23:48:30 -0800 To: Kalle Valo Subject: [PATCH 19/22] wil6210: fix reordering for MCAST Date: Tue, 23 Dec 2014 09:47:21 +0200 Message-Id: <1419320844-23989-20-git-send-email-qca_vkondrat@qca.qualcomm.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1419320844-23989-1-git-send-email-qca_vkondrat@qca.qualcomm.com> References: <1419320844-23989-1-git-send-email-qca_vkondrat@qca.qualcomm.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=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=unavailable 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 In the reordering block, Ethernet DA was checked for MCAST, this is wrong. Check instead MCAST indication from 802.11 MAC header. Hardware saves this into Rx descriptor. Signed-off-by: Vladimir Kondratiev --- drivers/net/wireless/ath/wil6210/rx_reorder.c | 10 ++++++++-- drivers/net/wireless/ath/wil6210/txrx.c | 8 +------- drivers/net/wireless/ath/wil6210/txrx.h | 5 +++++ 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/drivers/net/wireless/ath/wil6210/rx_reorder.c b/drivers/net/wireless/ath/wil6210/rx_reorder.c index 0865c34..20d65f2 100644 --- a/drivers/net/wireless/ath/wil6210/rx_reorder.c +++ b/drivers/net/wireless/ath/wil6210/rx_reorder.c @@ -97,14 +97,20 @@ void wil_rx_reorder(struct wil6210_priv *wil, struct sk_buff *skb) int cid = wil_rxdesc_cid(d); int mid = wil_rxdesc_mid(d); u16 seq = wil_rxdesc_seq(d); + int mcast = wil_rxdesc_mcast(d); struct wil_sta_info *sta = &wil->sta[cid]; struct wil_tid_ampdu_rx *r; u16 hseq; int index; unsigned long flags; - wil_dbg_txrx(wil, "MID %d CID %d TID %d Seq 0x%03x\n", - mid, cid, tid, seq); + wil_dbg_txrx(wil, "MID %d CID %d TID %d Seq 0x%03x mcast %01x\n", + mid, cid, tid, seq, mcast); + + if (unlikely(mcast)) { + wil_netif_rx_any(skb, ndev); + return; + } spin_lock_irqsave(&sta->tid_rx_lock, flags); diff --git a/drivers/net/wireless/ath/wil6210/txrx.c b/drivers/net/wireless/ath/wil6210/txrx.c index 4c145ee..5fc5f56 100644 --- a/drivers/net/wireless/ath/wil6210/txrx.c +++ b/drivers/net/wireless/ath/wil6210/txrx.c @@ -581,14 +581,8 @@ void wil_rx_handle(struct wil6210_priv *wil, int *quota) skb->protocol = htons(ETH_P_802_2); wil_netif_rx_any(skb, ndev); } else { - struct ethhdr *eth = (void *)skb->data; - skb->protocol = eth_type_trans(skb, ndev); - - if (is_unicast_ether_addr(eth->h_dest)) - wil_rx_reorder(wil, skb); - else - wil_netif_rx_any(skb, ndev); + wil_rx_reorder(wil, skb); } } wil_rx_refill(wil, v->size); diff --git a/drivers/net/wireless/ath/wil6210/txrx.h b/drivers/net/wireless/ath/wil6210/txrx.h index e7db356..c906c5f0 100644 --- a/drivers/net/wireless/ath/wil6210/txrx.h +++ b/drivers/net/wireless/ath/wil6210/txrx.h @@ -423,6 +423,11 @@ static inline int wil_rxdesc_mcs(struct vring_rx_desc *d) return WIL_GET_BITS(d->mac.d1, 21, 24); } +static inline int wil_rxdesc_mcast(struct vring_rx_desc *d) +{ + return WIL_GET_BITS(d->mac.d1, 13, 14); +} + static inline int wil_rxdesc_phy_length(struct vring_rx_desc *d) { return WIL_GET_BITS(d->dma.d0, 16, 29);