From patchwork Sun Nov 9 16:50:21 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arik Nemtsov X-Patchwork-Id: 5261661 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 98F43C11AC for ; Sun, 9 Nov 2014 16:50:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C16C42011D for ; Sun, 9 Nov 2014 16:50:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D26FD20127 for ; Sun, 9 Nov 2014 16:50:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752130AbaKIQuv (ORCPT ); Sun, 9 Nov 2014 11:50:51 -0500 Received: from mail-wg0-f42.google.com ([74.125.82.42]:60822 "EHLO mail-wg0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752108AbaKIQur (ORCPT ); Sun, 9 Nov 2014 11:50:47 -0500 Received: by mail-wg0-f42.google.com with SMTP id k14so7051261wgh.1 for ; Sun, 09 Nov 2014 08:50:46 -0800 (PST) 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=kQIyAhINBYW82fwwGhocfieLNj2dZKSiabdbUb6jPs0=; b=CcxE4noFqypxZ80Si8BbHaW4VS7+GWQ+2nC5A7++Ftt1WR5GX3fiBvoPpDntP+Tciw A3EWN7Hc07YllV0yVzHRhjK+KOAthn83ylnZ7jWc6KQxfEgeQ63Th/jBnWk1+U9mk3bq IX3ePxnh6IMoMYxW01cavNYGr+Mps2FkrcQlDiHDnWYgrWDxSA5hcxkaolrJWGqt/V7h 4cTpPVN4FpeUrZGQIHlw+aXHo+q/8r9Esn1mSutc9DIDq9YQEXy56OQibjfE1F1xdj6S h2fEABdkwCbPDM2lvlo9fPJZbooMdjtJ5V5DPVZ9BFyNNo2BbErGOxgBu7RCZkPBmyFC ykSg== X-Gm-Message-State: ALoCoQmT5dq1Ps9nO1HLGus7tdWtaTXRocJvr6cKsIBLbzWqZXCueMutSvgCiH6q+7/nQ6vnSOVD X-Received: by 10.180.36.205 with SMTP id s13mr22779425wij.11.1415551846271; Sun, 09 Nov 2014 08:50:46 -0800 (PST) Received: from athena.amr.corp.intel.com (93-172-126-236.bb.netvision.net.il. [93.172.126.236]) by mx.google.com with ESMTPSA id r2sm9994037wif.23.2014.11.09.08.50.44 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 09 Nov 2014 08:50:45 -0800 (PST) From: Arik Nemtsov To: Cc: Johannes Berg , Liad Kaufman , Arik Nemtsov Subject: [PATCH 15/16] mac80211: add specific-queue flushing support Date: Sun, 9 Nov 2014 18:50:21 +0200 Message-Id: <1415551822-20121-15-git-send-email-arik@wizery.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1415551822-20121-1-git-send-email-arik@wizery.com> References: <1415551822-20121-1-git-send-email-arik@wizery.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.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY, URIBL_RHS_DOB 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 From: Liad Kaufman If the HW supports IEEE80211_HW_QUEUE_CONTROL, allow flushing only specific queues rather than all of them. Signed-off-by: Liad Kaufman Reviewed-by: Johannes Berg Signed-off-by: Arik Nemtsov --- net/mac80211/ieee80211_i.h | 3 +++ net/mac80211/util.c | 20 +++++++++++++++----- 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 5de2e5f..a30d408 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h @@ -1881,6 +1881,9 @@ void ieee80211_add_pending_skbs(struct ieee80211_local *local, struct sk_buff_head *skbs); void ieee80211_flush_queues(struct ieee80211_local *local, struct ieee80211_sub_if_data *sdata); +void __ieee80211_flush_queues(struct ieee80211_local *local, + struct ieee80211_sub_if_data *sdata, + unsigned int queues); void ieee80211_send_auth(struct ieee80211_sub_if_data *sdata, u16 transaction, u16 auth_alg, u16 status, diff --git a/net/mac80211/util.c b/net/mac80211/util.c index 9e5bfd6..745a8a9 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -576,15 +576,19 @@ ieee80211_get_vif_queues(struct ieee80211_local *local, return queues; } -void ieee80211_flush_queues(struct ieee80211_local *local, - struct ieee80211_sub_if_data *sdata) +void __ieee80211_flush_queues(struct ieee80211_local *local, + struct ieee80211_sub_if_data *sdata, + unsigned int queues) { - unsigned int queues; - if (!local->ops->flush) return; - queues = ieee80211_get_vif_queues(local, sdata); + /* + * If no queue was set, or if the HW doesn't support + * IEEE80211_HW_QUEUE_CONTROL - flush all queues + */ + if (!queues || !(local->hw.flags & IEEE80211_HW_QUEUE_CONTROL)) + queues = ieee80211_get_vif_queues(local, sdata); ieee80211_stop_queues_by_reason(&local->hw, queues, IEEE80211_QUEUE_STOP_REASON_FLUSH, @@ -597,6 +601,12 @@ void ieee80211_flush_queues(struct ieee80211_local *local, false); } +void ieee80211_flush_queues(struct ieee80211_local *local, + struct ieee80211_sub_if_data *sdata) +{ + __ieee80211_flush_queues(local, sdata, 0); +} + void ieee80211_stop_vif_queues(struct ieee80211_local *local, struct ieee80211_sub_if_data *sdata, enum queue_stop_reason reason)