From patchwork Thu Jul 17 14:14:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arik Nemtsov X-Patchwork-Id: 4575841 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 DE785C0514 for ; Thu, 17 Jul 2014 14:15:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 43C52200D5 for ; Thu, 17 Jul 2014 14:15:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 678C520160 for ; Thu, 17 Jul 2014 14:15:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932865AbaGQOO6 (ORCPT ); Thu, 17 Jul 2014 10:14:58 -0400 Received: from mail-we0-f170.google.com ([74.125.82.170]:61778 "EHLO mail-we0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933807AbaGQOO0 (ORCPT ); Thu, 17 Jul 2014 10:14:26 -0400 Received: by mail-we0-f170.google.com with SMTP id w62so3157728wes.15 for ; Thu, 17 Jul 2014 07:14:25 -0700 (PDT) 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=CMi7m2ruH4xEIENKOdTd/KmcvVco+rGQSYOVeO6VE/k=; b=bcIf5BdTISDFJ7O+A3nG9nRmWg8S55rYekpfAXGNJ6OcGYakcZS/7umM6r5hfWukOy suUwauWxNYIOtctPf6t9A1FJOeqJQ0pieCsTZGd/vj/tWp29ngQ1HXY324Xs4KDmBmm0 BXy7EBePcevXImAmZoMmH9Twzd1tkB8XYuy+hA8xCdxw/dxaM8YD2vaEE8EK0VWYnohp QY9JwKPOV6G8gsmW8TaHruJrEDwnv924+8/AuhdeBgceCuijwWFonikA3XoU/UXV2Ern HQePfAyNnarOtECkNX/lnMdlyKDLkyHYT0nmgmxtuiMTPXpfW78SJxLTTb6zNRk6P68r zraw== X-Gm-Message-State: ALoCoQkR0LaLsmTSO50oh1SR8scbulciFPlUhFnItuQo/4CLobbL+YLcyXo7a0F+2e6Vk1yMxnFG X-Received: by 10.194.2.132 with SMTP id 4mr45660309wju.49.1405606465524; Thu, 17 Jul 2014 07:14:25 -0700 (PDT) Received: from athena.amr.corp.intel.com (46-116-100-31.bb.netvision.net.il. [46.116.100.31]) by mx.google.com with ESMTPSA id ft6sm17691865wic.0.2014.07.17.07.14.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 17 Jul 2014 07:14:24 -0700 (PDT) From: Arik Nemtsov To: Cc: Johannes Berg , Liad Kaufman Subject: [PATCH 15/15] mac80211: make sure TDLS teardown packet is sent on time Date: Thu, 17 Jul 2014 17:14:31 +0300 Message-Id: <1405606471-30128-16-git-send-email-arik@wizery.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1405606471-30128-1-git-send-email-arik@wizery.com> References: <1405606471-30128-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.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 From: Liad Kaufman Since the teardown packet is created while the queues are stopped, it isn't sent immediately, but rather is pending. To be sure that when we flush the queues prior to destroying the station we also send this packet - the tasklet handling pending packets is invoked to flush the packets. Signed-off-by: Liad Kaufman Reviewed-by: ArikX Nemtsov Reviewed-by: Johannes Berg --- net/mac80211/tdls.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/net/mac80211/tdls.c b/net/mac80211/tdls.c index 50d0e06..1b21050 100644 --- a/net/mac80211/tdls.c +++ b/net/mac80211/tdls.c @@ -836,6 +836,17 @@ int ieee80211_tdls_oper(struct wiphy *wiphy, struct net_device *dev, ret = 0; break; case NL80211_TDLS_DISABLE_LINK: + /* + * The teardown message in ieee80211_tdls_mgmt_teardown() was + * created while the queues were stopped, so it might still be + * pending. Before flushing the queues we need to be sure the + * message is handled by the tasklet handling pending messages, + * otherwise we might start destroying the station before + * sending the teardown packet. + * Note that this only forces the tasklet to flush pendings - + * not to stop the tasklet from rescheduling itself. + */ + tasklet_kill(&local->tx_pending_tasklet); /* flush a potentially queued teardown packet */ ieee80211_flush_queues(local, sdata);