From patchwork Tue Jan 5 09:00:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz.Dziedzic@tieto.com X-Patchwork-Id: 7953231 X-Patchwork-Delegate: johannes@sipsolutions.net 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E901ABEEE5 for ; Tue, 5 Jan 2016 09:00:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0AC9D20212 for ; Tue, 5 Jan 2016 09:00:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2ED04202E6 for ; Tue, 5 Jan 2016 09:00:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751452AbcAEJAe (ORCPT ); Tue, 5 Jan 2016 04:00:34 -0500 Received: from mail-lb0-f169.google.com ([209.85.217.169]:35909 "EHLO mail-lb0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751094AbcAEJAc (ORCPT ); Tue, 5 Jan 2016 04:00:32 -0500 Received: by mail-lb0-f169.google.com with SMTP id oh2so171446269lbb.3 for ; Tue, 05 Jan 2016 01:00:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id; bh=jsOQmgym9qVnFzs+lKGaBjMv3l2rT1mY26JNsc97keM=; b=zssKszDiG3901pHCein7U1sevb/sYJfLQfH5S73FLaLAY/Po5VPtb7OiYoki6svdAF lAtFwE3wD6LFFGf8IXQqQhfe8j82OkOf0d4EQ/ZNqrkjbQlZiQH6+BSaUmgHY3xyMFG/ umfgGDf5jaZWeG1tAEwu4e+Y2Vg1LgBHl45BA= 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; bh=jsOQmgym9qVnFzs+lKGaBjMv3l2rT1mY26JNsc97keM=; b=l9tId46bs539RiWQgLFyJfz4olB1ydl0aU1BO6HMW+v2/a3LwcYznJIWC7ftHHWrMB rVdU8mMk1d1GEd44+2xgxAQ219v16Cq3QuvOjooYk6nhokWb2AVUVtXoX937HPYCVAhf i55mSu2qlLB139sjOUT9vlzfS8XjIaVQbYf17Agu3xXNA9CwqrArU6+NvhO5w47gQprw QjPbWjIJgqPqJROUIx+TL6bUMameD3VznPT6XJ6frMHeA3AnApIOLJjUpdyX3a5jRlWI yjTyC2RGkhJsakFLuoRBxXjYYyGQZ5zgW05H+/IqmKG9Ij/VsEA6WGJHFBNaJP+EAAnd 8Tlg== X-Gm-Message-State: ALoCoQnqhmS6PfbPvPDNaVQ3iTbWQHBWgIl/F09LNpLfEGCQM1wFuTgKw+IisUHV5NX0FNbb6XI5JkMahbYbPNBwr5NiEHMYZV6syoQ2CdH/6Yfyjf9n0or3kPimZRxkYH0ijjfNq8ounD9IHngThtXLEu2OlPtVL2VqU2J3rZQi61LFEzQ1I0APFrSIqCI2SgrK8A28ZVwSoSZfPWc9XWuR3y32rea8og== X-Received: by 10.112.12.233 with SMTP id b9mr24579038lbc.63.1451984430788; Tue, 05 Jan 2016 01:00:30 -0800 (PST) Received: from localhost.localdomain ([91.198.246.8]) by smtp.gmail.com with ESMTPSA id 130sm12213214lff.31.2016.01.05.01.00.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 05 Jan 2016 01:00:29 -0800 (PST) From: Janusz Dziedzic To: linux-wireless@vger.kernel.org Cc: johannes@sipsolutions.net, Janusz Dziedzic Subject: [PATCH] mac80211: add use_minrate param to ieee80211_tx_prepare_skb() Date: Tue, 5 Jan 2016 10:00:19 +0100 Message-Id: <1451984419-5727-1-git-send-email-janusz.dziedzic@tieto.com> X-Mailer: git-send-email 1.9.1 X-DomainID: tieto.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,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 Add use_minrate param to ieee80211_tx_prepare_skb() function. This is useful in case we would like to send frames with lowest rates, eg. nullfunc, probe_resp. Signed-off-by: Janusz Dziedzic --- drivers/net/wireless/ath/ath9k/channel.c | 5 +++-- include/net/mac80211.h | 4 +++- net/mac80211/tx.c | 6 +++++- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/channel.c b/drivers/net/wireless/ath/ath9k/channel.c index b81f65c..ccb2d76 100644 --- a/drivers/net/wireless/ath/ath9k/channel.c +++ b/drivers/net/wireless/ath/ath9k/channel.c @@ -1040,7 +1040,7 @@ static void ath_scan_send_probe(struct ath_softc *sc, skb_set_queue_mapping(skb, IEEE80211_AC_VO); - if (!ieee80211_tx_prepare_skb(sc->hw, vif, skb, band, NULL)) + if (!ieee80211_tx_prepare_skb(sc->hw, vif, skb, band, NULL, true)) goto error; txctl.txq = sc->tx.txq_map[IEEE80211_AC_VO]; @@ -1155,7 +1155,8 @@ ath_chanctx_send_vif_ps_frame(struct ath_softc *sc, struct ath_vif *avp, skb->priority = 7; skb_set_queue_mapping(skb, IEEE80211_AC_VO); - if (!ieee80211_tx_prepare_skb(sc->hw, vif, skb, band, &sta)) { + if (!ieee80211_tx_prepare_skb(sc->hw, vif, skb, + band, &sta, true)) { dev_kfree_skb_any(skb); return false; } diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 0ea9b51..7269fca 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -5412,12 +5412,14 @@ void ieee80211_report_wowlan_wakeup(struct ieee80211_vif *vif, * @skb: frame to be sent from within the driver * @band: the band to transmit on * @sta: optional pointer to get the station to send the frame to + * @use_minrate: use lowest rate * * Note: must be called under RCU lock */ bool ieee80211_tx_prepare_skb(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct sk_buff *skb, - int band, struct ieee80211_sta **sta); + int band, struct ieee80211_sta **sta, + bool use_minrate); /** * struct ieee80211_noa_data - holds temporary data for tracking P2P NoA state diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index a512c4b..ebe8268 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c @@ -1526,7 +1526,8 @@ static int invoke_tx_handlers(struct ieee80211_tx_data *tx) bool ieee80211_tx_prepare_skb(struct ieee80211_hw *hw, struct ieee80211_vif *vif, struct sk_buff *skb, - int band, struct ieee80211_sta **sta) + int band, struct ieee80211_sta **sta, + bool use_minrate) { struct ieee80211_sub_if_data *sdata = vif_to_sdata(vif); struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); @@ -1540,6 +1541,9 @@ bool ieee80211_tx_prepare_skb(struct ieee80211_hw *hw, info->control.vif = vif; info->hw_queue = vif->hw_queue[skb_get_queue_mapping(skb)]; + if (use_minrate) + info->flags |= IEEE80211_TX_CTL_USE_MINRATE; + if (invoke_tx_handlers(&tx)) return false;