Search Linux Wireless

[PATCH] mac80211: add use_minrate param to ieee80211_tx_prepare_skb()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <janusz.dziedzic@xxxxxxxxx>
---
 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;
 
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux