From patchwork Thu Mar 27 18:50:33 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emmanuel Grumbach X-Patchwork-Id: 3899501 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id ECBB89F334 for ; Thu, 27 Mar 2014 18:50:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0F12320253 for ; Thu, 27 Mar 2014 18:50:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3307820225 for ; Thu, 27 Mar 2014 18:50:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757067AbaC0Sug (ORCPT ); Thu, 27 Mar 2014 14:50:36 -0400 Received: from mail-ee0-f48.google.com ([74.125.83.48]:61766 "EHLO mail-ee0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755473AbaC0Suf (ORCPT ); Thu, 27 Mar 2014 14:50:35 -0400 Received: by mail-ee0-f48.google.com with SMTP id b57so3203419eek.21 for ; Thu, 27 Mar 2014 11:50:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2v3En0uD4IBj4ONRGAVKKXb3axGaGsha7Hf5rTJaFdk=; b=PqHyjwMkCrl7LXChhm71/tlwq9++zvy1IDNGVNVXSR8cS/hufPZCjOPHiQE5PgRYve eR+Gu8TQxpCMzD7eIjAGiA6YSLe9ssH7iSlzng4/p4r5SfXTNTKMuHgzHMQ02lFE6u54 xgVWGuUJrXzPM3gxER+c2c8DTXxH/0pvB0pJsi/INb4xsDOAqXgWckv2xhfz28bwa9t+ 3REwXkFf2Q7YjjtKoPTiVzw5vJfjIdj0AW5U08n3G56XpOK5tw+9qCjscigGGLm4y5/3 fPxvnW6wxKHGAfVcUisVyJ3MlHXEaQtpb0rAaklP1s5VTF46G+XQ8JtS5I89Sq7qqXYN vP2A== X-Received: by 10.15.31.137 with SMTP id y9mr3370369eeu.12.1395946234601; Thu, 27 Mar 2014 11:50:34 -0700 (PDT) Received: from localhost.localdomain (93-172-178-56.bb.netvision.net.il. [93.172.178.56]) by mx.google.com with ESMTPSA id a42sm6157889ees.10.2014.03.27.11.50.33 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 27 Mar 2014 11:50:33 -0700 (PDT) From: Emmanuel Grumbach To: linux-wireless@vger.kernel.org Cc: Emmanuel Grumbach Subject: [PATCH] iwlwifi: mvm: implement mac80211's flush callback Date: Thu, 27 Mar 2014 20:50:33 +0200 Message-Id: <1395946233-8672-1-git-send-email-egrumbach@gmail.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <53346ABB.1060907@broadcom.com> References: <53346ABB.1060907@broadcom.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.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 From: Emmanuel Grumbach This allows mac80211 to flush the Tx queues before it sends critical management frames. Signed-off-by: Emmanuel Grumbach --- drivers/net/wireless/iwlwifi/mvm/mac80211.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/drivers/net/wireless/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c index 3ce7203..c08e02a 100644 --- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c +++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c @@ -2463,6 +2463,34 @@ out_unlock: mutex_unlock(&mvm->mutex); } +static void iwl_mvm_mac_flush(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, u32 queues, bool drop) +{ + struct iwl_mvm *mvm = IWL_MAC80211_GET_MVM(hw); + struct iwl_mvm_vif *mvmvif; + struct iwl_mvm_sta *mvmsta; + + if (!vif || vif->type != NL80211_IFTYPE_STATION) + return; + + mutex_lock(&mvm->mutex); + mvmvif = iwl_mvm_vif_from_mac80211(vif); + mvmsta = iwl_mvm_sta_from_staid_protected(mvm, mvmvif->ap_sta_id); + + if (WARN_ON_ONCE(!mvmsta)) + goto done; + + if (drop) { + if (iwl_mvm_flush_tx_path(mvm, mvmsta->tfd_queue_msk, true)) + IWL_ERR(mvm, "flush request fail\n"); + } else { + iwl_trans_wait_tx_queue_empty(mvm->trans, + mvmsta->tfd_queue_msk); + } +done: + mutex_unlock(&mvm->mutex); +} + const struct ieee80211_ops iwl_mvm_hw_ops = { .tx = iwl_mvm_mac_tx, .ampdu_action = iwl_mvm_mac_ampdu_action, @@ -2486,6 +2514,7 @@ const struct ieee80211_ops iwl_mvm_hw_ops = { .sta_rc_update = iwl_mvm_sta_rc_update, .conf_tx = iwl_mvm_mac_conf_tx, .mgd_prepare_tx = iwl_mvm_mac_mgd_prepare_tx, + .flush = iwl_mvm_mac_flush, .sched_scan_start = iwl_mvm_mac_sched_scan_start, .sched_scan_stop = iwl_mvm_mac_sched_scan_stop, .set_key = iwl_mvm_mac_set_key,