From patchwork Wed Jul 14 01:27:23 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Rodriguez X-Patchwork-Id: 111884 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o6E1RVlr022473 for ; Wed, 14 Jul 2010 01:27:31 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754226Ab0GNB12 (ORCPT ); Tue, 13 Jul 2010 21:27:28 -0400 Received: from bombadil.infradead.org ([18.85.46.34]:36897 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754110Ab0GNB10 (ORCPT ); Tue, 13 Jul 2010 21:27:26 -0400 Received: from mcgrof by bombadil.infradead.org with local (Exim 4.72 #1 (Red Hat Linux)) id 1OYqkv-0007fR-Ik; Wed, 14 Jul 2010 01:27:25 +0000 From: "Luis R. Rodriguez" To: linville@tuxdriver.com Cc: linux-wireless@vger.kernel.org, "Luis R. Rodriguez" Subject: [PATCH 1/3] ath9k: implement mac80211 flush op Date: Tue, 13 Jul 2010 21:27:23 -0400 Message-Id: <1279070845-29442-2-git-send-email-lrodriguez@atheros.com> X-Mailer: git-send-email 1.6.2.rc1.3.g81d3f In-Reply-To: <1279070845-29442-1-git-send-email-lrodriguez@atheros.com> References: <1279070845-29442-1-git-send-email-lrodriguez@atheros.com> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Wed, 14 Jul 2010 01:27:32 +0000 (UTC) diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index 4c0831f..46a6543 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c @@ -2031,6 +2031,24 @@ static void ath9k_set_coverage_class(struct ieee80211_hw *hw, u8 coverage_class) mutex_unlock(&sc->mutex); } +static void ath9k_flush(struct ieee80211_hw *hw, bool drop) +{ + struct ath_wiphy *aphy = hw->priv; + struct ath_softc *sc = aphy->sc; + + mutex_lock(&sc->mutex); + + if ((sc->sc_flags & SC_OP_INVALID)) + goto out; + + ath9k_ps_wakeup(sc); + ath_drain_all_txq(sc, !drop); + ath9k_ps_restore(sc); + +out: + mutex_unlock(&sc->mutex); +} + struct ieee80211_ops ath9k_ops = { .tx = ath9k_tx, .start = ath9k_start, @@ -2053,4 +2071,5 @@ struct ieee80211_ops ath9k_ops = { .sw_scan_complete = ath9k_sw_scan_complete, .rfkill_poll = ath9k_rfkill_poll_state, .set_coverage_class = ath9k_set_coverage_class, + .flush = ath9k_flush, };