All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] mac80211: move specific tx flags into info->control.flags
@ 2014-02-22 20:36 Thomas Huehn
  2014-02-22 20:36 ` [PATCH 1/6] mac80211: move flag IEEE80211_TX_CTL_ASSIGN_SEQ " Thomas Huehn
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Thomas Huehn @ 2014-02-22 20:36 UTC (permalink / raw
  To: linville; +Cc: linux-wireless, johannes, nbd, thomas

All usable  bits in enum mac80211_tx_control_flags are depleted. In
order to allow aditional control flag assigments this patchserie moves
all flags that got only used in the tx-path from info->flags into
info->control.flags. There are now 6 bits freed in enum mac80211_tx_control
that are usable for e.g. upcoming transmit power control (tpc).

Greetings Thomas


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/6] mac80211: move flag IEEE80211_TX_CTL_ASSIGN_SEQ into info->control.flags
  2014-02-22 20:36 [PATCH 0/6] mac80211: move specific tx flags into info->control.flags Thomas Huehn
@ 2014-02-22 20:36 ` Thomas Huehn
  2014-02-22 20:36 ` [PATCH 2/6] mac80211: move flag IEEE80211_TX_CTL_FIRST_FRAGMENT " Thomas Huehn
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Thomas Huehn @ 2014-02-22 20:36 UTC (permalink / raw
  To: linville; +Cc: linux-wireless, johannes, nbd, thomas

Flag IEEE80211_TX_CTL_ASSIGN_SEQ is only used within the tx path while
ieee80211_tx_info->control is valid. Therefore this patch moves this flag
from info->flags structure into the info->control.flags and renames it to
IEEE80211_TX_CTRL_ASSIGN_SEQ.

Signed-off-by: Benjamin Vahl <bvahl@net.t-labs.tu-berlin.de>
Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>
---
 drivers/net/wireless/ath/ath10k/mac.h           |    2 +-
 drivers/net/wireless/ath/ath9k/beacon.c         |    2 +-
 drivers/net/wireless/ath/ath9k/htc_drv_beacon.c |    2 +-
 drivers/net/wireless/ath/ath9k/xmit.c           |    2 +-
 drivers/net/wireless/ath/carl9170/tx.c          |    2 +-
 drivers/net/wireless/b43/xmit.c                 |    2 +-
 drivers/net/wireless/b43legacy/xmit.c           |    2 +-
 drivers/net/wireless/brcm80211/brcmsmac/main.c  |    2 +-
 drivers/net/wireless/iwlwifi/dvm/tx.c           |    2 +-
 drivers/net/wireless/iwlwifi/mvm/tx.c           |    2 +-
 drivers/net/wireless/mwl8k.c                    |    2 +-
 drivers/net/wireless/p54/txrx.c                 |    2 +-
 drivers/net/wireless/rt2x00/rt2x00queue.c       |    2 +-
 drivers/net/wireless/rtl818x/rtl8180/dev.c      |    2 +-
 drivers/net/wireless/rtl818x/rtl8187/dev.c      |    2 +-
 include/net/mac80211.h                          |   85 ++++++++++++-----------
 net/mac80211/tx.c                               |    8 +--
 17 files changed, 62 insertions(+), 61 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.h b/drivers/net/wireless/ath/ath10k/mac.h
index ba10219..c0ad9c6 100644
--- a/drivers/net/wireless/ath/ath10k/mac.h
+++ b/drivers/net/wireless/ath/ath10k/mac.h
@@ -50,7 +50,7 @@ static inline void ath10k_tx_h_seq_no(struct sk_buff *skb)
 	struct ieee80211_vif *vif = info->control.vif;
 	struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif);
 
-	if (info->flags  & IEEE80211_TX_CTL_ASSIGN_SEQ) {
+	if (info->control.flags  & IEEE80211_TX_CTRL_ASSIGN_SEQ) {
 		if (arvif->tx_seq_no == 0)
 			arvif->tx_seq_no = 0x1000;
 
diff --git a/drivers/net/wireless/ath/ath9k/beacon.c b/drivers/net/wireless/ath/ath9k/beacon.c
index 32d00e8..b9ad692 100644
--- a/drivers/net/wireless/ath/ath9k/beacon.c
+++ b/drivers/net/wireless/ath/ath9k/beacon.c
@@ -144,7 +144,7 @@ static struct ath_buf *ath9k_beacon_generate(struct ieee80211_hw *hw,
 	mgmt_hdr->u.beacon.timestamp = avp->tsf_adjust;
 
 	info = IEEE80211_SKB_CB(skb);
-	if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) {
+	if (info->control.flags & IEEE80211_TX_CTRL_ASSIGN_SEQ) {
 		/*
 		 * TODO: make sure the seq# gets assigned properly (vs. other
 		 * TX frames)
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c b/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c
index 8b57577..9817301 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_beacon.c
@@ -371,7 +371,7 @@ static void ath9k_htc_send_beacon(struct ath9k_htc_priv *priv,
 	mgmt->u.beacon.timestamp = avp->tsfadjust;
 
 	info = IEEE80211_SKB_CB(beacon);
-	if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) {
+	if (info->control.flags & IEEE80211_TX_CTRL_ASSIGN_SEQ) {
 		struct ieee80211_hdr *hdr =
 			(struct ieee80211_hdr *) beacon->data;
 		avp->seq_no += 0x10;
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index a650704..6d197a5 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -2121,7 +2121,7 @@ static int ath_tx_prepare(struct ieee80211_hw *hw, struct sk_buff *skb,
 	 * to be cleaned up to work better with Beacon transmission and virtual
 	 * BSSes.
 	 */
-	if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) {
+	if (info->control.flags & IEEE80211_TX_CTRL_ASSIGN_SEQ) {
 		if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT)
 			sc->tx.seq_no += 0x10;
 		hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG);
diff --git a/drivers/net/wireless/ath/carl9170/tx.c b/drivers/net/wireless/ath/carl9170/tx.c
index 4cadfd4..3c70cc0 100644
--- a/drivers/net/wireless/ath/carl9170/tx.c
+++ b/drivers/net/wireless/ath/carl9170/tx.c
@@ -1002,7 +1002,7 @@ static int carl9170_tx_prepare(struct ar9170 *ar,
 	if (unlikely(info->flags & IEEE80211_TX_CTL_SEND_AFTER_DTIM))
 		txc->s.misc |= CARL9170_TX_SUPER_MISC_CAB;
 
-	if (unlikely(info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ))
+	if (unlikely(info->control.flags & IEEE80211_TX_CTRL_ASSIGN_SEQ))
 		txc->s.misc |= CARL9170_TX_SUPER_MISC_ASSIGN_SEQ;
 
 	if (unlikely(ieee80211_is_probe_resp(hdr->frame_control)))
diff --git a/drivers/net/wireless/b43/xmit.c b/drivers/net/wireless/b43/xmit.c
index 218a0f3..42b2556 100644
--- a/drivers/net/wireless/b43/xmit.c
+++ b/drivers/net/wireless/b43/xmit.c
@@ -404,7 +404,7 @@ int b43_generate_txhdr(struct b43_wldev *dev,
 	if (!(info->flags & IEEE80211_TX_CTL_NO_ACK))
 		mac_ctl |= B43_TXH_MAC_ACK;
 	/* use hardware sequence counter as the non-TID counter */
-	if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ)
+	if (info->control.flags & IEEE80211_TX_CTRL_ASSIGN_SEQ)
 		mac_ctl |= B43_TXH_MAC_HWSEQ;
 	if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT)
 		mac_ctl |= B43_TXH_MAC_STMSDU;
diff --git a/drivers/net/wireless/b43legacy/xmit.c b/drivers/net/wireless/b43legacy/xmit.c
index 86588c9..548b456 100644
--- a/drivers/net/wireless/b43legacy/xmit.c
+++ b/drivers/net/wireless/b43legacy/xmit.c
@@ -283,7 +283,7 @@ static int generate_txhdr_fw3(struct b43legacy_wldev *dev,
 	rates = info->control.rates;
 	if (!(info->flags & IEEE80211_TX_CTL_NO_ACK))
 		mac_ctl |= B43legacy_TX4_MAC_ACK;
-	if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ)
+	if (info->control.flags & IEEE80211_TX_CTRL_ASSIGN_SEQ)
 		mac_ctl |= B43legacy_TX4_MAC_HWSEQ;
 	if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT)
 		mac_ctl |= B43legacy_TX4_MAC_STMSDU;
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c b/drivers/net/wireless/brcm80211/brcmsmac/main.c
index 9417cb5..0d48265 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
@@ -6316,7 +6316,7 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw,
 	memset(txh, 0, D11_TXH_LEN);
 
 	/* setup frameid */
-	if (tx_info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) {
+	if (tx_info->control.flags & IEEE80211_TX_CTRL_ASSIGN_SEQ) {
 		/* non-AP STA should never use BCMC queue */
 		if (queue == TX_BCMC_FIFO) {
 			brcms_err(wlc->hw->d11core,
diff --git a/drivers/net/wireless/iwlwifi/dvm/tx.c b/drivers/net/wireless/iwlwifi/dvm/tx.c
index a6839df..dbab1d5 100644
--- a/drivers/net/wireless/iwlwifi/dvm/tx.c
+++ b/drivers/net/wireless/iwlwifi/dvm/tx.c
@@ -100,7 +100,7 @@ static void iwlagn_tx_cmd_build_basic(struct iwl_priv *priv,
 		tx_flags &= ~TX_CMD_FLG_SEQ_CTL_MSK;
 	} else {
 		tx_cmd->tid_tspec = IWL_TID_NON_QOS;
-		if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ)
+		if (info->control.flags & IEEE80211_TX_CTRL_ASSIGN_SEQ)
 			tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK;
 		else
 			tx_flags &= ~TX_CMD_FLG_SEQ_CTL_MSK;
diff --git a/drivers/net/wireless/iwlwifi/mvm/tx.c b/drivers/net/wireless/iwlwifi/mvm/tx.c
index 74d60bf..75e15eb 100644
--- a/drivers/net/wireless/iwlwifi/mvm/tx.c
+++ b/drivers/net/wireless/iwlwifi/mvm/tx.c
@@ -106,7 +106,7 @@ static void iwl_mvm_set_tx_cmd(struct iwl_mvm *mvm, struct sk_buff *skb,
 		tx_flags &= ~TX_CMD_FLG_SEQ_CTL;
 	} else {
 		tx_cmd->tid_tspec = IWL_TID_NON_QOS;
-		if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ)
+		if (info->control.flags & IEEE80211_TX_CTRL_ASSIGN_SEQ)
 			tx_flags |= TX_CMD_FLG_SEQ_CTL;
 		else
 			tx_flags &= ~TX_CMD_FLG_SEQ_CTL;
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c
index 4987c3f..473c4d1 100644
--- a/drivers/net/wireless/mwl8k.c
+++ b/drivers/net/wireless/mwl8k.c
@@ -1920,7 +1920,7 @@ mwl8k_txq_xmit(struct ieee80211_hw *hw,
 	tx_info = IEEE80211_SKB_CB(skb);
 	mwl8k_vif = MWL8K_VIF(tx_info->control.vif);
 
-	if (tx_info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) {
+	if (tx_info->control.flags & IEEE80211_TX_CTRL_ASSIGN_SEQ) {
 		wh->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG);
 		wh->seq_ctrl |= cpu_to_le16(mwl8k_vif->seqno);
 		mwl8k_vif->seqno += 0x10;
diff --git a/drivers/net/wireless/p54/txrx.c b/drivers/net/wireless/p54/txrx.c
index 153c615..1b1f0a2 100644
--- a/drivers/net/wireless/p54/txrx.c
+++ b/drivers/net/wireless/p54/txrx.c
@@ -691,7 +691,7 @@ static void p54_tx_80211_header(struct p54_common *priv, struct sk_buff *skb,
 	else
 		*burst_possible = false;
 
-	if (!(info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ))
+	if (!(info->control.flags & IEEE80211_TX_CTRL_ASSIGN_SEQ))
 		*flags |= P54_HDR_FLAG_DATA_OUT_SEQNR;
 
 	if (info->flags & IEEE80211_TX_CTL_NO_PS_BUFFER)
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index 5642ccc..1c7e4bc 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -219,7 +219,7 @@ static void rt2x00queue_create_tx_descriptor_seq(struct rt2x00_dev *rt2x00dev,
 	struct rt2x00_intf *intf = vif_to_intf(tx_info->control.vif);
 	u16 seqno;
 
-	if (!(tx_info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ))
+	if (!(tx_info->control.flags & IEEE80211_TX_CTRL_ASSIGN_SEQ))
 		return;
 
 	__set_bit(ENTRY_TXD_GENERATE_SEQ, &txdesc->flags);
diff --git a/drivers/net/wireless/rtl818x/rtl8180/dev.c b/drivers/net/wireless/rtl818x/rtl8180/dev.c
index 7980ab1..5b1f77d 100644
--- a/drivers/net/wireless/rtl818x/rtl8180/dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8180/dev.c
@@ -318,7 +318,7 @@ static void rtl8180_tx(struct ieee80211_hw *dev,
 
 	spin_lock_irqsave(&priv->lock, flags);
 
-	if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) {
+	if (info->control.flags & IEEE80211_TX_CTRL_ASSIGN_SEQ) {
 		if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT)
 			priv->seqno += 0x10;
 		hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG);
diff --git a/drivers/net/wireless/rtl818x/rtl8187/dev.c b/drivers/net/wireless/rtl818x/rtl8187/dev.c
index c981bcf..5a2dd71 100644
--- a/drivers/net/wireless/rtl818x/rtl8187/dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8187/dev.c
@@ -263,7 +263,7 @@ static void rtl8187_tx(struct ieee80211_hw *dev,
 		flags |= ieee80211_get_rts_cts_rate(dev, info)->hw_value << 19;
 	}
 
-	if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) {
+	if (info->control.flags & IEEE80211_TX_CTRL_ASSIGN_SEQ) {
 		if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT)
 			priv->seqno += 0x10;
 		tx_hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG);
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 86faa41..24bcf74 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -380,17 +380,6 @@ struct ieee80211_bss_conf {
  * These flags are used with the @flags member of &ieee80211_tx_info.
  *
  * @IEEE80211_TX_CTL_REQ_TX_STATUS: require TX status callback for this frame.
- * @IEEE80211_TX_CTL_ASSIGN_SEQ: The driver has to assign a sequence
- *	number to this frame, taking care of not overwriting the fragment
- *	number and increasing the sequence number only when the
- *	IEEE80211_TX_CTL_FIRST_FRAGMENT flag is set. mac80211 will properly
- *	assign sequence numbers to QoS-data frames but cannot do so correctly
- *	for non-QoS-data and management frames because beacons need them from
- *	that counter as well and mac80211 cannot guarantee proper sequencing.
- *	If this flag is set, the driver should instruct the hardware to
- *	assign a sequence number to the frame or assign one itself. Cf. IEEE
- *	802.11-2007 7.1.3.4.1 paragraph 3. This flag will always be set for
- *	beacons and always be clear for frames without a sequence number field.
  * @IEEE80211_TX_CTL_NO_ACK: tell the low level not to wait for an ack
  * @IEEE80211_TX_CTL_CLEAR_PS_FILT: clear powersave filter for destination
  *	station
@@ -473,39 +462,38 @@ struct ieee80211_bss_conf {
  */
 enum mac80211_tx_info_flags {
 	IEEE80211_TX_CTL_REQ_TX_STATUS		= BIT(0),
-	IEEE80211_TX_CTL_ASSIGN_SEQ		= BIT(1),
-	IEEE80211_TX_CTL_NO_ACK			= BIT(2),
-	IEEE80211_TX_CTL_CLEAR_PS_FILT		= BIT(3),
-	IEEE80211_TX_CTL_FIRST_FRAGMENT		= BIT(4),
-	IEEE80211_TX_CTL_SEND_AFTER_DTIM	= BIT(5),
-	IEEE80211_TX_CTL_AMPDU			= BIT(6),
-	IEEE80211_TX_CTL_INJECTED		= BIT(7),
-	IEEE80211_TX_STAT_TX_FILTERED		= BIT(8),
-	IEEE80211_TX_STAT_ACK			= BIT(9),
-	IEEE80211_TX_STAT_AMPDU			= BIT(10),
-	IEEE80211_TX_STAT_AMPDU_NO_BACK		= BIT(11),
-	IEEE80211_TX_CTL_RATE_CTRL_PROBE	= BIT(12),
-	IEEE80211_TX_INTFL_OFFCHAN_TX_OK	= BIT(13),
-	IEEE80211_TX_INTFL_NEED_TXPROCESSING	= BIT(14),
-	IEEE80211_TX_INTFL_RETRIED		= BIT(15),
-	IEEE80211_TX_INTFL_DONT_ENCRYPT		= BIT(16),
-	IEEE80211_TX_CTL_NO_PS_BUFFER		= BIT(17),
-	IEEE80211_TX_CTL_MORE_FRAMES		= BIT(18),
-	IEEE80211_TX_INTFL_RETRANSMISSION	= BIT(19),
-	IEEE80211_TX_INTFL_MLME_CONN_TX		= BIT(20),
-	IEEE80211_TX_INTFL_NL80211_FRAME_TX	= BIT(21),
-	IEEE80211_TX_CTL_LDPC			= BIT(22),
-	IEEE80211_TX_CTL_STBC			= BIT(23) | BIT(24),
-	IEEE80211_TX_CTL_TX_OFFCHAN		= BIT(25),
-	IEEE80211_TX_INTFL_TKIP_MIC_FAILURE	= BIT(26),
-	IEEE80211_TX_CTL_NO_CCK_RATE		= BIT(27),
-	IEEE80211_TX_STATUS_EOSP		= BIT(28),
-	IEEE80211_TX_CTL_USE_MINRATE		= BIT(29),
-	IEEE80211_TX_CTL_DONTFRAG		= BIT(30),
-	IEEE80211_TX_CTL_PS_RESPONSE		= BIT(31),
+	IEEE80211_TX_CTL_NO_ACK			= BIT(1),
+	IEEE80211_TX_CTL_CLEAR_PS_FILT		= BIT(2),
+	IEEE80211_TX_CTL_FIRST_FRAGMENT		= BIT(3),
+	IEEE80211_TX_CTL_SEND_AFTER_DTIM	= BIT(4),
+	IEEE80211_TX_CTL_AMPDU			= BIT(5),
+	IEEE80211_TX_CTL_INJECTED		= BIT(6),
+	IEEE80211_TX_STAT_TX_FILTERED		= BIT(7),
+	IEEE80211_TX_STAT_ACK			= BIT(8),
+	IEEE80211_TX_STAT_AMPDU			= BIT(9),
+	IEEE80211_TX_STAT_AMPDU_NO_BACK		= BIT(10),
+	IEEE80211_TX_CTL_RATE_CTRL_PROBE	= BIT(11),
+	IEEE80211_TX_INTFL_OFFCHAN_TX_OK	= BIT(12),
+	IEEE80211_TX_INTFL_NEED_TXPROCESSING	= BIT(13),
+	IEEE80211_TX_INTFL_RETRIED		= BIT(14),
+	IEEE80211_TX_INTFL_DONT_ENCRYPT		= BIT(15),
+	IEEE80211_TX_CTL_NO_PS_BUFFER		= BIT(16),
+	IEEE80211_TX_CTL_MORE_FRAMES		= BIT(17),
+	IEEE80211_TX_INTFL_RETRANSMISSION	= BIT(18),
+	IEEE80211_TX_INTFL_MLME_CONN_TX		= BIT(19),
+	IEEE80211_TX_INTFL_NL80211_FRAME_TX	= BIT(20),
+	IEEE80211_TX_CTL_LDPC			= BIT(21),
+	IEEE80211_TX_CTL_STBC			= BIT(22) | BIT(23),
+	IEEE80211_TX_CTL_TX_OFFCHAN		= BIT(24),
+	IEEE80211_TX_INTFL_TKIP_MIC_FAILURE	= BIT(25),
+	IEEE80211_TX_CTL_NO_CCK_RATE		= BIT(26),
+	IEEE80211_TX_STATUS_EOSP		= BIT(27),
+	IEEE80211_TX_CTL_USE_MINRATE		= BIT(28),
+	IEEE80211_TX_CTL_DONTFRAG		= BIT(29),
+	IEEE80211_TX_CTL_PS_RESPONSE		= BIT(30),
 };
 
-#define IEEE80211_TX_CTL_STBC_SHIFT		23
+#define IEEE80211_TX_CTL_STBC_SHIFT		22
 
 /**
  * enum mac80211_tx_control_flags - flags to describe transmit control
@@ -513,10 +501,23 @@ enum mac80211_tx_info_flags {
  * @IEEE80211_TX_CTRL_PORT_CTRL_PROTO: this frame is a port control
  *	protocol frame (e.g. EAP)
  *
+ * @IEEE80211_TX_CTRL_ASSIGN_SEQ: The driver has to assign a sequence
+ *	number to this frame, taking care of not overwriting the fragment
+ *	number and increasing the sequence number only when the
+ *	IEEE80211_TX_CTL_FIRST_FRAGMENT flag is set. mac80211 will properly
+ *	assign sequence numbers to QoS-data frames but cannot do so correctly
+ *	for non-QoS-data and management frames because beacons need them from
+ *	that counter as well and mac80211 cannot guarantee proper sequencing.
+ *	If this flag is set, the driver should instruct the hardware to
+ *	assign a sequence number to the frame or assign one itself. Cf. IEEE
+ *	802.11-2007 7.1.3.4.1 paragraph 3. This flag will always be set for
+ *	beacons and always be clear for frames without a sequence number field.
+ *
  * These flags are used in tx_info->control.flags.
  */
 enum mac80211_tx_control_flags {
 	IEEE80211_TX_CTRL_PORT_CTRL_PROTO	= BIT(0),
+	IEEE80211_TX_CTRL_ASSIGN_SEQ		= BIT(1),
 };
 
 /*
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 722151f..cacd0d6 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -789,7 +789,7 @@ ieee80211_tx_h_sequence(struct ieee80211_tx_data *tx)
 	if (!ieee80211_is_data_qos(hdr->frame_control) ||
 	    is_multicast_ether_addr(hdr->addr1)) {
 		/* driver should assign sequence number */
-		info->flags |= IEEE80211_TX_CTL_ASSIGN_SEQ;
+		info->control.flags |= IEEE80211_TX_CTRL_ASSIGN_SEQ;
 		/* for pure STA mode without beacons, we can do it */
 		hdr->seq_ctrl = cpu_to_le16(tx->sdata->sequence_number);
 		tx->sdata->sequence_number += 0x10;
@@ -798,7 +798,7 @@ ieee80211_tx_h_sequence(struct ieee80211_tx_data *tx)
 
 	/*
 	 * This should be true for injected/management frames only, for
-	 * management frames we have set the IEEE80211_TX_CTL_ASSIGN_SEQ
+	 * management frames we have set the IEEE80211_TX_CTRL_ASSIGN_SEQ
 	 * above since they are not QoS-data frames.
 	 */
 	if (!tx->sta)
@@ -2643,8 +2643,8 @@ struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw,
 	info->control.vif = vif;
 
 	info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT |
-			IEEE80211_TX_CTL_ASSIGN_SEQ |
-			IEEE80211_TX_CTL_FIRST_FRAGMENT;
+		       IEEE80211_TX_CTL_FIRST_FRAGMENT;
+	info->control.flags |= IEEE80211_TX_CTRL_ASSIGN_SEQ;
  out:
 	rcu_read_unlock();
 	return skb;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/6] mac80211: move flag IEEE80211_TX_CTL_FIRST_FRAGMENT into info->control.flags
  2014-02-22 20:36 [PATCH 0/6] mac80211: move specific tx flags into info->control.flags Thomas Huehn
  2014-02-22 20:36 ` [PATCH 1/6] mac80211: move flag IEEE80211_TX_CTL_ASSIGN_SEQ " Thomas Huehn
@ 2014-02-22 20:36 ` Thomas Huehn
  2014-02-22 20:36 ` [PATCH 3/6] mac80211: move flag IEEE80211_TX_CTL_NO_PS_BUFFER " Thomas Huehn
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Thomas Huehn @ 2014-02-22 20:36 UTC (permalink / raw
  To: linville; +Cc: linux-wireless, johannes, nbd, thomas

Flag IEEE80211_TX_CTL_MORE_FRAMES is only used within the tx path while
ieee80211_tx_info->control is valid. Therefore this patch moves this flag
from info->flags structure into the info->control.flags and renames it to
IEEE80211_TX_CTRL_FIRST_FRAGMENT. Define new IEEE80211_TX_TEMPORARY_CTRL_FLAGS
to clear all temporary flags that are shifted to info->control.flags.

Signed-off-by: Benjamin Vahl <bvahl@net.t-labs.tu-berlin.de>
Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>
---
 drivers/net/wireless/ath/ath10k/mac.h          |    2 +-
 drivers/net/wireless/ath/ath9k/xmit.c          |    2 +-
 drivers/net/wireless/b43/xmit.c                |    2 +-
 drivers/net/wireless/b43legacy/xmit.c          |    2 +-
 drivers/net/wireless/brcm80211/brcmsmac/main.c |    2 +-
 drivers/net/wireless/rt2x00/rt2x00queue.c      |    6 +-
 drivers/net/wireless/rtl818x/rtl8180/dev.c     |    2 +-
 drivers/net/wireless/rtl818x/rtl8187/dev.c     |    2 +-
 drivers/net/wireless/zd1211rw/zd_mac.c         |    2 +-
 include/net/mac80211.h                         |   71 +++++++++++++-----------
 net/mac80211/status.c                          |    1 +
 net/mac80211/tx.c                              |   12 ++--
 12 files changed, 57 insertions(+), 49 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.h b/drivers/net/wireless/ath/ath10k/mac.h
index c0ad9c6..7d3b3b7 100644
--- a/drivers/net/wireless/ath/ath10k/mac.h
+++ b/drivers/net/wireless/ath/ath10k/mac.h
@@ -54,7 +54,7 @@ static inline void ath10k_tx_h_seq_no(struct sk_buff *skb)
 		if (arvif->tx_seq_no == 0)
 			arvif->tx_seq_no = 0x1000;
 
-		if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT)
+		if (info->control.flags & IEEE80211_TX_CTRL_FIRST_FRAGMENT)
 			arvif->tx_seq_no += 0x10;
 		hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG);
 		hdr->seq_ctrl |= cpu_to_le16(arvif->tx_seq_no);
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 6d197a5..e4b8dba 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -2122,7 +2122,7 @@ static int ath_tx_prepare(struct ieee80211_hw *hw, struct sk_buff *skb,
 	 * BSSes.
 	 */
 	if (info->control.flags & IEEE80211_TX_CTRL_ASSIGN_SEQ) {
-		if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT)
+		if (info->control.flags & IEEE80211_TX_CTRL_FIRST_FRAGMENT)
 			sc->tx.seq_no += 0x10;
 		hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG);
 		hdr->seq_ctrl |= cpu_to_le16(sc->tx.seq_no);
diff --git a/drivers/net/wireless/b43/xmit.c b/drivers/net/wireless/b43/xmit.c
index 42b2556..35dd486 100644
--- a/drivers/net/wireless/b43/xmit.c
+++ b/drivers/net/wireless/b43/xmit.c
@@ -406,7 +406,7 @@ int b43_generate_txhdr(struct b43_wldev *dev,
 	/* use hardware sequence counter as the non-TID counter */
 	if (info->control.flags & IEEE80211_TX_CTRL_ASSIGN_SEQ)
 		mac_ctl |= B43_TXH_MAC_HWSEQ;
-	if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT)
+	if (info->control.flags & IEEE80211_TX_CTRL_FIRST_FRAGMENT)
 		mac_ctl |= B43_TXH_MAC_STMSDU;
 	if (phy->type == B43_PHYTYPE_A)
 		mac_ctl |= B43_TXH_MAC_5GHZ;
diff --git a/drivers/net/wireless/b43legacy/xmit.c b/drivers/net/wireless/b43legacy/xmit.c
index 548b456..b3b0bc5 100644
--- a/drivers/net/wireless/b43legacy/xmit.c
+++ b/drivers/net/wireless/b43legacy/xmit.c
@@ -285,7 +285,7 @@ static int generate_txhdr_fw3(struct b43legacy_wldev *dev,
 		mac_ctl |= B43legacy_TX4_MAC_ACK;
 	if (info->control.flags & IEEE80211_TX_CTRL_ASSIGN_SEQ)
 		mac_ctl |= B43legacy_TX4_MAC_HWSEQ;
-	if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT)
+	if (info->control.flags & IEEE80211_TX_CTRL_FIRST_FRAGMENT)
 		mac_ctl |= B43legacy_TX4_MAC_STMSDU;
 	if (rate_fb_ofdm)
 		mac_ctl |= B43legacy_TX4_MAC_FALLBACKOFDM;
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c b/drivers/net/wireless/brcm80211/brcmsmac/main.c
index 0d48265..28a501e 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
@@ -6325,7 +6325,7 @@ brcms_c_d11hdrs_mac80211(struct brcms_c_info *wlc, struct ieee80211_hw *hw,
 			frameid = bcmc_fid_generate(wlc, NULL, txh);
 		} else {
 			/* Increment the counter for first fragment */
-			if (tx_info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT)
+			if (tx_info->control.flags & IEEE80211_TX_CTRL_FIRST_FRAGMENT)
 				scb->seqnum[p->priority]++;
 
 			/* extract fragment number from frame first */
diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index 1c7e4bc..bed86cc 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -362,7 +362,7 @@ static void rt2x00queue_create_tx_descriptor_ht(struct rt2x00_dev *rt2x00dev,
 	}
 
 	if (test_bit(CONFIG_HT_DISABLED, &rt2x00dev->flags)) {
-		if (!(tx_info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT))
+		if (!(tx_info->control.flags & IEEE80211_TX_CTRL_FIRST_FRAGMENT))
 			txdesc->u.ht.txop = TXOP_SIFS;
 		else
 			txdesc->u.ht.txop = TXOP_BACKOFF;
@@ -409,7 +409,7 @@ static void rt2x00queue_create_tx_descriptor_ht(struct rt2x00_dev *rt2x00dev,
 	if (ieee80211_is_mgmt(hdr->frame_control) &&
 	    !ieee80211_is_beacon(hdr->frame_control))
 		txdesc->u.ht.txop = TXOP_BACKOFF;
-	else if (!(tx_info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT))
+	else if (!(tx_info->control.flags & IEEE80211_TX_CTRL_FIRST_FRAGMENT))
 		txdesc->u.ht.txop = TXOP_SIFS;
 	else
 		txdesc->u.ht.txop = TXOP_HTTXOP;
@@ -484,7 +484,7 @@ static void rt2x00queue_create_tx_descriptor(struct rt2x00_dev *rt2x00dev,
 	    ieee80211_is_probe_resp(hdr->frame_control))
 		__set_bit(ENTRY_TXD_REQ_TIMESTAMP, &txdesc->flags);
 
-	if ((tx_info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT) &&
+	if ((tx_info->control.flags & IEEE80211_TX_CTRL_FIRST_FRAGMENT) &&
 	    !test_bit(ENTRY_TXD_RTS_FRAME, &txdesc->flags))
 		__set_bit(ENTRY_TXD_FIRST_FRAGMENT, &txdesc->flags);
 
diff --git a/drivers/net/wireless/rtl818x/rtl8180/dev.c b/drivers/net/wireless/rtl818x/rtl8180/dev.c
index 5b1f77d..5712b5c 100644
--- a/drivers/net/wireless/rtl818x/rtl8180/dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8180/dev.c
@@ -319,7 +319,7 @@ static void rtl8180_tx(struct ieee80211_hw *dev,
 	spin_lock_irqsave(&priv->lock, flags);
 
 	if (info->control.flags & IEEE80211_TX_CTRL_ASSIGN_SEQ) {
-		if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT)
+		if (info->control.flags & IEEE80211_TX_CTRL_FIRST_FRAGMENT)
 			priv->seqno += 0x10;
 		hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG);
 		hdr->seq_ctrl |= cpu_to_le16(priv->seqno);
diff --git a/drivers/net/wireless/rtl818x/rtl8187/dev.c b/drivers/net/wireless/rtl818x/rtl8187/dev.c
index 5a2dd71..61af53c 100644
--- a/drivers/net/wireless/rtl818x/rtl8187/dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8187/dev.c
@@ -264,7 +264,7 @@ static void rtl8187_tx(struct ieee80211_hw *dev,
 	}
 
 	if (info->control.flags & IEEE80211_TX_CTRL_ASSIGN_SEQ) {
-		if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT)
+		if (info->control.flags & IEEE80211_TX_CTRL_FIRST_FRAGMENT)
 			priv->seqno += 0x10;
 		tx_hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG);
 		tx_hdr->seq_ctrl |= cpu_to_le16(priv->seqno);
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c
index e7af261..14e2369 100644
--- a/drivers/net/wireless/zd1211rw/zd_mac.c
+++ b/drivers/net/wireless/zd1211rw/zd_mac.c
@@ -666,7 +666,7 @@ static void cs_set_control(struct zd_mac *mac, struct zd_ctrlset *cs,
 	cs->control = 0;
 
 	/* First fragment */
-	if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT)
+	if (info->control.flags & IEEE80211_TX_CTRL_FIRST_FRAGMENT)
 		cs->control |= ZD_CS_NEED_RANDOM_BACKOFF;
 
 	/* No ACK expected (multicast, etc.) */
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 24bcf74..f5b71f2 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -383,7 +383,6 @@ struct ieee80211_bss_conf {
  * @IEEE80211_TX_CTL_NO_ACK: tell the low level not to wait for an ack
  * @IEEE80211_TX_CTL_CLEAR_PS_FILT: clear powersave filter for destination
  *	station
- * @IEEE80211_TX_CTL_FIRST_FRAGMENT: this is a first fragment of the frame
  * @IEEE80211_TX_CTL_SEND_AFTER_DTIM: send this frame after DTIM beacon
  * @IEEE80211_TX_CTL_AMPDU: this frame should be sent as part of an A-MPDU
  * @IEEE80211_TX_CTL_INJECTED: Frame was injected, internal to mac80211.
@@ -464,36 +463,35 @@ enum mac80211_tx_info_flags {
 	IEEE80211_TX_CTL_REQ_TX_STATUS		= BIT(0),
 	IEEE80211_TX_CTL_NO_ACK			= BIT(1),
 	IEEE80211_TX_CTL_CLEAR_PS_FILT		= BIT(2),
-	IEEE80211_TX_CTL_FIRST_FRAGMENT		= BIT(3),
-	IEEE80211_TX_CTL_SEND_AFTER_DTIM	= BIT(4),
-	IEEE80211_TX_CTL_AMPDU			= BIT(5),
-	IEEE80211_TX_CTL_INJECTED		= BIT(6),
-	IEEE80211_TX_STAT_TX_FILTERED		= BIT(7),
-	IEEE80211_TX_STAT_ACK			= BIT(8),
-	IEEE80211_TX_STAT_AMPDU			= BIT(9),
-	IEEE80211_TX_STAT_AMPDU_NO_BACK		= BIT(10),
-	IEEE80211_TX_CTL_RATE_CTRL_PROBE	= BIT(11),
-	IEEE80211_TX_INTFL_OFFCHAN_TX_OK	= BIT(12),
-	IEEE80211_TX_INTFL_NEED_TXPROCESSING	= BIT(13),
-	IEEE80211_TX_INTFL_RETRIED		= BIT(14),
-	IEEE80211_TX_INTFL_DONT_ENCRYPT		= BIT(15),
-	IEEE80211_TX_CTL_NO_PS_BUFFER		= BIT(16),
-	IEEE80211_TX_CTL_MORE_FRAMES		= BIT(17),
-	IEEE80211_TX_INTFL_RETRANSMISSION	= BIT(18),
-	IEEE80211_TX_INTFL_MLME_CONN_TX		= BIT(19),
-	IEEE80211_TX_INTFL_NL80211_FRAME_TX	= BIT(20),
-	IEEE80211_TX_CTL_LDPC			= BIT(21),
-	IEEE80211_TX_CTL_STBC			= BIT(22) | BIT(23),
-	IEEE80211_TX_CTL_TX_OFFCHAN		= BIT(24),
-	IEEE80211_TX_INTFL_TKIP_MIC_FAILURE	= BIT(25),
-	IEEE80211_TX_CTL_NO_CCK_RATE		= BIT(26),
-	IEEE80211_TX_STATUS_EOSP		= BIT(27),
-	IEEE80211_TX_CTL_USE_MINRATE		= BIT(28),
-	IEEE80211_TX_CTL_DONTFRAG		= BIT(29),
-	IEEE80211_TX_CTL_PS_RESPONSE		= BIT(30),
+	IEEE80211_TX_CTL_SEND_AFTER_DTIM	= BIT(3),
+	IEEE80211_TX_CTL_AMPDU			= BIT(4),
+	IEEE80211_TX_CTL_INJECTED		= BIT(5),
+	IEEE80211_TX_STAT_TX_FILTERED		= BIT(6),
+	IEEE80211_TX_STAT_ACK			= BIT(7),
+	IEEE80211_TX_STAT_AMPDU			= BIT(8),
+	IEEE80211_TX_STAT_AMPDU_NO_BACK		= BIT(9),
+	IEEE80211_TX_CTL_RATE_CTRL_PROBE	= BIT(10),
+	IEEE80211_TX_INTFL_OFFCHAN_TX_OK	= BIT(11),
+	IEEE80211_TX_INTFL_NEED_TXPROCESSING	= BIT(12),
+	IEEE80211_TX_INTFL_RETRIED		= BIT(13),
+	IEEE80211_TX_INTFL_DONT_ENCRYPT		= BIT(14),
+	IEEE80211_TX_CTL_NO_PS_BUFFER		= BIT(15),
+	IEEE80211_TX_CTL_MORE_FRAMES		= BIT(16),
+	IEEE80211_TX_INTFL_RETRANSMISSION	= BIT(17),
+	IEEE80211_TX_INTFL_MLME_CONN_TX		= BIT(18),
+	IEEE80211_TX_INTFL_NL80211_FRAME_TX	= BIT(19),
+	IEEE80211_TX_CTL_LDPC			= BIT(20),
+	IEEE80211_TX_CTL_STBC			= BIT(21) | BIT(22),
+	IEEE80211_TX_CTL_TX_OFFCHAN		= BIT(23),
+	IEEE80211_TX_INTFL_TKIP_MIC_FAILURE	= BIT(24),
+	IEEE80211_TX_CTL_NO_CCK_RATE		= BIT(25),
+	IEEE80211_TX_STATUS_EOSP		= BIT(26),
+	IEEE80211_TX_CTL_USE_MINRATE		= BIT(27),
+	IEEE80211_TX_CTL_DONTFRAG		= BIT(28),
+	IEEE80211_TX_CTL_PS_RESPONSE		= BIT(29),
 };
 
-#define IEEE80211_TX_CTL_STBC_SHIFT		22
+#define IEEE80211_TX_CTL_STBC_SHIFT		21
 
 /**
  * enum mac80211_tx_control_flags - flags to describe transmit control
@@ -504,7 +502,7 @@ enum mac80211_tx_info_flags {
  * @IEEE80211_TX_CTRL_ASSIGN_SEQ: The driver has to assign a sequence
  *	number to this frame, taking care of not overwriting the fragment
  *	number and increasing the sequence number only when the
- *	IEEE80211_TX_CTL_FIRST_FRAGMENT flag is set. mac80211 will properly
+ *	IEEE80211_TX_CTRL_FIRST_FRAGMENT flag is set. mac80211 will properly
  *	assign sequence numbers to QoS-data frames but cannot do so correctly
  *	for non-QoS-data and management frames because beacons need them from
  *	that counter as well and mac80211 cannot guarantee proper sequencing.
@@ -518,6 +516,7 @@ enum mac80211_tx_info_flags {
 enum mac80211_tx_control_flags {
 	IEEE80211_TX_CTRL_PORT_CTRL_PROTO	= BIT(0),
 	IEEE80211_TX_CTRL_ASSIGN_SEQ		= BIT(1),
+	IEEE80211_TX_CTRL_FIRST_FRAGMENT        = BIT(3),
 };
 
 /*
@@ -525,13 +524,21 @@ enum mac80211_tx_control_flags {
  * set by the tx handlers for each transmission attempt by the mac80211 stack.
  */
 #define IEEE80211_TX_TEMPORARY_FLAGS (IEEE80211_TX_CTL_NO_ACK |		      \
-	IEEE80211_TX_CTL_CLEAR_PS_FILT | IEEE80211_TX_CTL_FIRST_FRAGMENT |    \
+	IEEE80211_TX_CTL_CLEAR_PS_FILT | IEEE80211_TX_STATUS_EOSP |	      \
 	IEEE80211_TX_CTL_SEND_AFTER_DTIM | IEEE80211_TX_CTL_AMPDU |	      \
 	IEEE80211_TX_STAT_TX_FILTERED |	IEEE80211_TX_STAT_ACK |		      \
 	IEEE80211_TX_STAT_AMPDU | IEEE80211_TX_STAT_AMPDU_NO_BACK |	      \
 	IEEE80211_TX_CTL_RATE_CTRL_PROBE | IEEE80211_TX_CTL_NO_PS_BUFFER |    \
 	IEEE80211_TX_CTL_MORE_FRAMES | IEEE80211_TX_CTL_LDPC |		      \
-	IEEE80211_TX_CTL_STBC | IEEE80211_TX_STATUS_EOSP)
+	IEEE80211_TX_CTL_STBC)
+
+/*
+ * This definition is used to clear all temporary flags, which are only used
+ * within the tx path as long as ieee80211_tx_info control is valid and 
+ * info->control.flags is used.
+ */
+#define IEEE80211_TX_TEMPORARY_CTRL_FLAGS (IEEE80211_TX_CTL_FIRST_FRAGMENT)
+
 
 /**
  * enum mac80211_rate_control_flags - per-rate flags set by the
diff --git a/net/mac80211/status.c b/net/mac80211/status.c
index e6e574a..c9f7fdb 100644
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -66,6 +66,7 @@ static void ieee80211_handle_filtered_frame(struct ieee80211_local *local,
 	info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING |
 		       IEEE80211_TX_INTFL_RETRANSMISSION;
 	info->flags &= ~IEEE80211_TX_TEMPORARY_FLAGS;
+	info->control.flags &= ~IEEE80211_TX_TEMPORARY_CTRL_FLAGS;
 
 	sta->tx_filtered_count++;
 
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index cacd0d6..2309be9 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -856,8 +856,8 @@ static int ieee80211_fragment(struct ieee80211_tx_data *tx,
 		memcpy(tmp->cb, skb->cb, sizeof(tmp->cb));
 
 		info = IEEE80211_SKB_CB(tmp);
-		info->flags &= ~(IEEE80211_TX_CTL_CLEAR_PS_FILT |
-				 IEEE80211_TX_CTL_FIRST_FRAGMENT);
+		info->flags &= ~(IEEE80211_TX_CTL_CLEAR_PS_FILT);
+		info->control.flags &= ~(IEEE80211_TX_CTRL_FIRST_FRAGMENT);
 
 		if (rem)
 			info->flags |= IEEE80211_TX_CTL_MORE_FRAMES;
@@ -1171,7 +1171,7 @@ ieee80211_tx_prepare(struct ieee80211_sub_if_data *sdata,
 	else if (test_and_clear_sta_flag(tx->sta, WLAN_STA_CLEAR_PS_FILT))
 		info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT;
 
-	info->flags |= IEEE80211_TX_CTL_FIRST_FRAGMENT;
+	info->control.flags |= IEEE80211_TX_CTRL_FIRST_FRAGMENT;
 
 	return TX_CONTINUE;
 }
@@ -2642,9 +2642,9 @@ struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw,
 
 	info->control.vif = vif;
 
-	info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT |
-		       IEEE80211_TX_CTL_FIRST_FRAGMENT;
-	info->control.flags |= IEEE80211_TX_CTRL_ASSIGN_SEQ;
+	info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT;
+	info->control.flags |= IEEE80211_TX_CTRL_ASSIGN_SEQ |
+			       IEEE80211_TX_CTL_FIRST_FRAGMENT;
  out:
 	rcu_read_unlock();
 	return skb;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/6] mac80211: move flag IEEE80211_TX_CTL_NO_PS_BUFFER into info->control.flags
  2014-02-22 20:36 [PATCH 0/6] mac80211: move specific tx flags into info->control.flags Thomas Huehn
  2014-02-22 20:36 ` [PATCH 1/6] mac80211: move flag IEEE80211_TX_CTL_ASSIGN_SEQ " Thomas Huehn
  2014-02-22 20:36 ` [PATCH 2/6] mac80211: move flag IEEE80211_TX_CTL_FIRST_FRAGMENT " Thomas Huehn
@ 2014-02-22 20:36 ` Thomas Huehn
  2014-02-22 20:36 ` [PATCH 4/6] mac80211: move flag IEEE80211_TX_CTL_MORE_FRAMES " Thomas Huehn
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: Thomas Huehn @ 2014-02-22 20:36 UTC (permalink / raw
  To: linville; +Cc: linux-wireless, johannes, nbd, thomas

Flag IEEE80211_TX_CTL_NO_PS_BUFFER is only used within the tx path while
ieee80211_tx_info->control is valid. Therefore this patch moves this flag
from info->flags structure into the info->control.flags and renames it to
IEEE80211_TX_CTRL_NO_PS_BUFFER.

Signed-off-by: Benjamin Vahl <bvahl@net.t-labs.tu-berlin.de>
Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>
---
 drivers/net/wireless/iwlegacy/4965-mac.c |    2 +-
 drivers/net/wireless/iwlwifi/dvm/tx.c    |    2 +-
 drivers/net/wireless/p54/txrx.c          |    2 +-
 include/net/mac80211.h                   |   48 ++++++++++++++----------------
 net/mac80211/mesh_ps.c                   |    6 ++--
 net/mac80211/sta_info.c                  |   13 ++++----
 net/mac80211/tx.c                        |    5 ++--
 7 files changed, 38 insertions(+), 40 deletions(-)

diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
index 43f488a..647a678 100644
--- a/drivers/net/wireless/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
@@ -1721,7 +1721,7 @@ il4965_tx_skb(struct il_priv *il,
 		sta_priv = (void *)sta->drv_priv;
 
 	if (sta_priv && sta_priv->asleep &&
-	    (info->flags & IEEE80211_TX_CTL_NO_PS_BUFFER)) {
+	    (info->control.flags & IEEE80211_TX_CTRL_NO_PS_BUFFER)) {
 		/*
 		 * This sends an asynchronous command to the device,
 		 * but we can rely on it being processed before the
diff --git a/drivers/net/wireless/iwlwifi/dvm/tx.c b/drivers/net/wireless/iwlwifi/dvm/tx.c
index dbab1d5..4030f97 100644
--- a/drivers/net/wireless/iwlwifi/dvm/tx.c
+++ b/drivers/net/wireless/iwlwifi/dvm/tx.c
@@ -344,7 +344,7 @@ int iwlagn_tx_skb(struct iwl_priv *priv,
 		sta_priv = (void *)sta->drv_priv;
 
 	if (sta_priv && sta_priv->asleep &&
-	    (info->flags & IEEE80211_TX_CTL_NO_PS_BUFFER)) {
+	    (info->control.flags & IEEE80211_TX_CTRL_NO_PS_BUFFER)) {
 		/*
 		 * This sends an asynchronous command to the device,
 		 * but we can rely on it being processed before the
diff --git a/drivers/net/wireless/p54/txrx.c b/drivers/net/wireless/p54/txrx.c
index 1b1f0a2..dafed1b 100644
--- a/drivers/net/wireless/p54/txrx.c
+++ b/drivers/net/wireless/p54/txrx.c
@@ -694,7 +694,7 @@ static void p54_tx_80211_header(struct p54_common *priv, struct sk_buff *skb,
 	if (!(info->control.flags & IEEE80211_TX_CTRL_ASSIGN_SEQ))
 		*flags |= P54_HDR_FLAG_DATA_OUT_SEQNR;
 
-	if (info->flags & IEEE80211_TX_CTL_NO_PS_BUFFER)
+	if (info->control.flags & IEEE80211_TX_CTRL_NO_PS_BUFFER)
 		*flags |= P54_HDR_FLAG_DATA_OUT_NOCANCEL;
 
 	if (info->flags & IEEE80211_TX_CTL_CLEAR_PS_FILT)
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index f5b71f2..84b9c34 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -413,9 +413,6 @@ struct ieee80211_bss_conf {
  *	used to indicate that a frame was already retried due to PS
  * @IEEE80211_TX_INTFL_DONT_ENCRYPT: completely internal to mac80211,
  *	used to indicate frame should not be encrypted
- * @IEEE80211_TX_CTL_NO_PS_BUFFER: This frame is a response to a poll
- *	frame (PS-Poll or uAPSD) or a non-bufferable MMPDU and must
- *	be sent although the station is in powersave mode.
  * @IEEE80211_TX_CTL_MORE_FRAMES: More frames will be passed to the
  *	transmit function after the current frame, this can be used
  *	by drivers to kick the DMA queue only if unset or when the
@@ -475,23 +472,22 @@ enum mac80211_tx_info_flags {
 	IEEE80211_TX_INTFL_NEED_TXPROCESSING	= BIT(12),
 	IEEE80211_TX_INTFL_RETRIED		= BIT(13),
 	IEEE80211_TX_INTFL_DONT_ENCRYPT		= BIT(14),
-	IEEE80211_TX_CTL_NO_PS_BUFFER		= BIT(15),
-	IEEE80211_TX_CTL_MORE_FRAMES		= BIT(16),
-	IEEE80211_TX_INTFL_RETRANSMISSION	= BIT(17),
-	IEEE80211_TX_INTFL_MLME_CONN_TX		= BIT(18),
-	IEEE80211_TX_INTFL_NL80211_FRAME_TX	= BIT(19),
-	IEEE80211_TX_CTL_LDPC			= BIT(20),
-	IEEE80211_TX_CTL_STBC			= BIT(21) | BIT(22),
-	IEEE80211_TX_CTL_TX_OFFCHAN		= BIT(23),
-	IEEE80211_TX_INTFL_TKIP_MIC_FAILURE	= BIT(24),
-	IEEE80211_TX_CTL_NO_CCK_RATE		= BIT(25),
-	IEEE80211_TX_STATUS_EOSP		= BIT(26),
-	IEEE80211_TX_CTL_USE_MINRATE		= BIT(27),
-	IEEE80211_TX_CTL_DONTFRAG		= BIT(28),
-	IEEE80211_TX_CTL_PS_RESPONSE		= BIT(29),
+	IEEE80211_TX_CTL_MORE_FRAMES		= BIT(15),
+	IEEE80211_TX_INTFL_RETRANSMISSION	= BIT(16),
+	IEEE80211_TX_INTFL_MLME_CONN_TX		= BIT(17),
+	IEEE80211_TX_INTFL_NL80211_FRAME_TX	= BIT(18),
+	IEEE80211_TX_CTL_LDPC			= BIT(19),
+	IEEE80211_TX_CTL_STBC			= BIT(20) | BIT(21),
+	IEEE80211_TX_CTL_TX_OFFCHAN		= BIT(22),
+	IEEE80211_TX_INTFL_TKIP_MIC_FAILURE	= BIT(23),
+	IEEE80211_TX_CTL_NO_CCK_RATE		= BIT(24),
+	IEEE80211_TX_STATUS_EOSP		= BIT(25),
+	IEEE80211_TX_CTL_USE_MINRATE		= BIT(26),
+	IEEE80211_TX_CTL_DONTFRAG		= BIT(27),
+	IEEE80211_TX_CTL_PS_RESPONSE		= BIT(28),
 };
 
-#define IEEE80211_TX_CTL_STBC_SHIFT		21
+#define IEEE80211_TX_CTL_STBC_SHIFT		20
 
 /**
  * enum mac80211_tx_control_flags - flags to describe transmit control
@@ -517,6 +513,7 @@ enum mac80211_tx_control_flags {
 	IEEE80211_TX_CTRL_PORT_CTRL_PROTO	= BIT(0),
 	IEEE80211_TX_CTRL_ASSIGN_SEQ		= BIT(1),
 	IEEE80211_TX_CTRL_FIRST_FRAGMENT        = BIT(3),
+	IEEE80211_TX_CTRL_NO_PS_BUFFER          = BIT(4),
 };
 
 /*
@@ -528,17 +525,16 @@ enum mac80211_tx_control_flags {
 	IEEE80211_TX_CTL_SEND_AFTER_DTIM | IEEE80211_TX_CTL_AMPDU |	      \
 	IEEE80211_TX_STAT_TX_FILTERED |	IEEE80211_TX_STAT_ACK |		      \
 	IEEE80211_TX_STAT_AMPDU | IEEE80211_TX_STAT_AMPDU_NO_BACK |	      \
-	IEEE80211_TX_CTL_RATE_CTRL_PROBE | IEEE80211_TX_CTL_NO_PS_BUFFER |    \
-	IEEE80211_TX_CTL_MORE_FRAMES | IEEE80211_TX_CTL_LDPC |		      \
-	IEEE80211_TX_CTL_STBC)
+	IEEE80211_TX_CTL_RATE_CTRL_PROBE | IEEE80211_TX_CTL_STBC |	      \
+	IEEE80211_TX_CTL_MORE_FRAMES | IEEE80211_TX_CTL_LDPC)
 
 /*
  * This definition is used to clear all temporary flags, which are only used
  * within the tx path as long as ieee80211_tx_info control is valid and 
  * info->control.flags is used.
  */
-#define IEEE80211_TX_TEMPORARY_CTRL_FLAGS (IEEE80211_TX_CTL_FIRST_FRAGMENT)
-
+#define IEEE80211_TX_TEMPORARY_CTRL_FLAGS (IEEE80211_TX_CTL_FIRST_FRAGMENT |  \
+	IEEE80211_TX_CTRL_NO_PS_BUFFER)
 
 /**
  * enum mac80211_rate_control_flags - per-rate flags set by the
@@ -2066,7 +2062,7 @@ void ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb);
  * the station sends a PS-Poll or a uAPSD trigger frame, mac80211
  * will inform the driver of this with the @allow_buffered_frames
  * callback; this callback is optional. mac80211 will then transmit
- * the frames as usual and set the %IEEE80211_TX_CTL_NO_PS_BUFFER
+ * the frames as usual and set the %IEEE80211_TX_CTRL_NO_PS_BUFFER
  * on each frame. The last frame in the service period (or the only
  * response to a PS-Poll) also has %IEEE80211_TX_STATUS_EOSP set to
  * indicate that it ends the service period; as this frame must have
@@ -2075,7 +2071,7 @@ void ieee80211_free_txskb(struct ieee80211_hw *hw, struct sk_buff *skb);
  * marked has having ended and a new one can be started by the peer.
  *
  * Additionally, non-bufferable MMPDUs can also be transmitted by
- * mac80211 with the %IEEE80211_TX_CTL_NO_PS_BUFFER set in them.
+ * mac80211 with the %IEEE80211_TX_CTRL_NO_PS_BUFFER set in them.
  *
  * Another race condition can happen on some devices like iwlwifi
  * when there are frames queued for the station and it wakes up
@@ -2683,7 +2679,7 @@ enum ieee80211_roc_type {
  * @allow_buffered_frames: Prepare device to allow the given number of frames
  *	to go out to the given station. The frames will be sent by mac80211
  *	via the usual TX path after this call. The TX information for frames
- *	released will also have the %IEEE80211_TX_CTL_NO_PS_BUFFER flag set
+ *	released will also have the %IEEE80211_TX_CTRL_NO_PS_BUFFER flag set
  *	and the last one will also have %IEEE80211_TX_STATUS_EOSP set. In case
  *	frames from multiple TIDs are released and the driver might reorder
  *	them between the TIDs, it must set the %IEEE80211_TX_STATUS_EOSP flag
diff --git a/net/mac80211/mesh_ps.c b/net/mac80211/mesh_ps.c
index 2802f9d..6bd9bef 100644
--- a/net/mac80211/mesh_ps.c
+++ b/net/mac80211/mesh_ps.c
@@ -391,8 +391,8 @@ static void mpsp_trigger_send(struct sta_info *sta, bool rspi, bool eosp)
 
 	info = IEEE80211_SKB_CB(skb);
 
-	info->flags |= IEEE80211_TX_CTL_NO_PS_BUFFER |
-		       IEEE80211_TX_CTL_REQ_TX_STATUS;
+	info->flags |= IEEE80211_TX_CTL_REQ_TX_STATUS;
+	info->control.flags |= IEEE80211_TX_CTRL_NO_PS_BUFFER;
 
 	mps_dbg(sdata, "sending MPSP trigger%s%s to %pM\n",
 		rspi ? " RSPI" : "", eosp ? " EOSP" : "", sta->sta.addr);
@@ -499,7 +499,7 @@ static void mps_frame_deliver(struct sta_info *sta, int n_frames)
 		 * STA may still remain is PS mode after this frame
 		 * exchange.
 		 */
-		info->flags |= IEEE80211_TX_CTL_NO_PS_BUFFER;
+		info->control.flags |= IEEE80211_TX_CTRL_NO_PS_BUFFER;
 
 		if (more_data || !skb_queue_is_last(&frames, skb))
 			hdr->frame_control |=
diff --git a/net/mac80211/sta_info.c b/net/mac80211/sta_info.c
index decd30c..ca0ca1b 100644
--- a/net/mac80211/sta_info.c
+++ b/net/mac80211/sta_info.c
@@ -1207,10 +1207,11 @@ static void ieee80211_send_null_response(struct ieee80211_sub_if_data *sdata,
 	 * exchange. Also set EOSP to indicate this packet
 	 * ends the poll/service period.
 	 */
-	info->flags |= IEEE80211_TX_CTL_NO_PS_BUFFER |
-		       IEEE80211_TX_CTL_PS_RESPONSE |
-		       IEEE80211_TX_STATUS_EOSP |
-		       IEEE80211_TX_CTL_REQ_TX_STATUS;
+	info->flags |= IEEE80211_TX_CTL_PS_RESPONSE |
+		IEEE80211_TX_STATUS_EOSP |
+		IEEE80211_TX_CTL_REQ_TX_STATUS;
+	
+	info->control.flags |= IEEE80211_TX_CTRL_NO_PS_BUFFER;
 
 	if (call_driver)
 		drv_allow_buffered_frames(local, sta, BIT(tid), 1,
@@ -1359,8 +1360,8 @@ ieee80211_sta_ps_deliver_response(struct sta_info *sta,
 			 * STA may still remain is PS mode after this frame
 			 * exchange.
 			 */
-			info->flags |= IEEE80211_TX_CTL_NO_PS_BUFFER |
-				       IEEE80211_TX_CTL_PS_RESPONSE;
+			info->flags |= IEEE80211_TX_CTL_PS_RESPONSE;
+			info->control.flags |= IEEE80211_TX_CTRL_NO_PS_BUFFER;
 
 			/*
 			 * Use MoreData flag to indicate whether there are
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 2309be9..316b8d3 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -470,7 +470,8 @@ ieee80211_tx_h_unicast_ps_buf(struct ieee80211_tx_data *tx)
 
 	if (unlikely((test_sta_flag(sta, WLAN_STA_PS_STA) ||
 		      test_sta_flag(sta, WLAN_STA_PS_DRIVER)) &&
-		     !(info->flags & IEEE80211_TX_CTL_NO_PS_BUFFER))) {
+		     !(info->control.flags &
+		       IEEE80211_TX_CTRL_NO_PS_BUFFER))) {
 		int ac = skb_get_queue_mapping(tx->skb);
 
 		ps_dbg(sta->sdata, "STA %pM aid %d: PS buffer for AC %d\n",
@@ -525,7 +526,7 @@ ieee80211_tx_h_ps_buf(struct ieee80211_tx_data *tx)
 	if (ieee80211_is_mgmt(hdr->frame_control) &&
 	    !ieee80211_is_bufferable_mmpdu(hdr->frame_control)) {
 		if (tx->flags & IEEE80211_TX_UNICAST)
-			info->flags |= IEEE80211_TX_CTL_NO_PS_BUFFER;
+			info->control.flags |= IEEE80211_TX_CTRL_NO_PS_BUFFER;
 		return TX_CONTINUE;
 	}
 
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 4/6] mac80211: move flag IEEE80211_TX_CTL_MORE_FRAMES into info->control.flags
  2014-02-22 20:36 [PATCH 0/6] mac80211: move specific tx flags into info->control.flags Thomas Huehn
                   ` (2 preceding siblings ...)
  2014-02-22 20:36 ` [PATCH 3/6] mac80211: move flag IEEE80211_TX_CTL_NO_PS_BUFFER " Thomas Huehn
@ 2014-02-22 20:36 ` Thomas Huehn
  2014-02-22 20:36 ` [PATCH 5/6] mac80211: move flag IEEE80211_TX_CTL_TX_OFFCHAN " Thomas Huehn
  2014-02-22 20:36 ` [PATCH 6/6] mac80211: move flag IEEE80211_TX_CTL_USE_MINRATE " Thomas Huehn
  5 siblings, 0 replies; 7+ messages in thread
From: Thomas Huehn @ 2014-02-22 20:36 UTC (permalink / raw
  To: linville; +Cc: linux-wireless, johannes, nbd, thomas

Flag IEEE80211_TX_CTL_MORE_FRAMES is only used within the tx path while
ieee80211_tx_info->control is valid. Therefore this patch moves this flag
from info->flags structure into the info->control.flags and renames it to
IEEE80211_TX_CTRL_MORE_FRAMES.

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>
---
 drivers/net/wireless/rt2x00/rt2x00queue.c |    2 +-
 include/net/mac80211.h                    |   41 +++++++++++++++--------------
 net/mac80211/tx.c                         |    2 +-
 3 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index bed86cc..076d44a 100644
--- a/drivers/net/wireless/rt2x00/rt2x00queue.c
+++ b/drivers/net/wireless/rt2x00/rt2x00queue.c
@@ -473,7 +473,7 @@ static void rt2x00queue_create_tx_descriptor(struct rt2x00_dev *rt2x00dev,
 	/*
 	 * Check if more frames (!= fragments) are pending
 	 */
-	if (tx_info->flags & IEEE80211_TX_CTL_MORE_FRAMES)
+	if (tx_info->control.flags & IEEE80211_TX_CTRL_MORE_FRAMES)
 		__set_bit(ENTRY_TXD_BURST, &txdesc->flags);
 
 	/*
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 84b9c34..5112a61 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -413,10 +413,6 @@ struct ieee80211_bss_conf {
  *	used to indicate that a frame was already retried due to PS
  * @IEEE80211_TX_INTFL_DONT_ENCRYPT: completely internal to mac80211,
  *	used to indicate frame should not be encrypted
- * @IEEE80211_TX_CTL_MORE_FRAMES: More frames will be passed to the
- *	transmit function after the current frame, this can be used
- *	by drivers to kick the DMA queue only if unset or when the
- *	queue gets full.
  * @IEEE80211_TX_INTFL_RETRANSMISSION: This frame is being retransmitted
  *	after TX status because the destination was asleep, it must not
  *	be modified again (no seqno assignment, crypto, etc.)
@@ -472,22 +468,21 @@ enum mac80211_tx_info_flags {
 	IEEE80211_TX_INTFL_NEED_TXPROCESSING	= BIT(12),
 	IEEE80211_TX_INTFL_RETRIED		= BIT(13),
 	IEEE80211_TX_INTFL_DONT_ENCRYPT		= BIT(14),
-	IEEE80211_TX_CTL_MORE_FRAMES		= BIT(15),
-	IEEE80211_TX_INTFL_RETRANSMISSION	= BIT(16),
-	IEEE80211_TX_INTFL_MLME_CONN_TX		= BIT(17),
-	IEEE80211_TX_INTFL_NL80211_FRAME_TX	= BIT(18),
-	IEEE80211_TX_CTL_LDPC			= BIT(19),
-	IEEE80211_TX_CTL_STBC			= BIT(20) | BIT(21),
-	IEEE80211_TX_CTL_TX_OFFCHAN		= BIT(22),
-	IEEE80211_TX_INTFL_TKIP_MIC_FAILURE	= BIT(23),
-	IEEE80211_TX_CTL_NO_CCK_RATE		= BIT(24),
-	IEEE80211_TX_STATUS_EOSP		= BIT(25),
-	IEEE80211_TX_CTL_USE_MINRATE		= BIT(26),
-	IEEE80211_TX_CTL_DONTFRAG		= BIT(27),
-	IEEE80211_TX_CTL_PS_RESPONSE		= BIT(28),
+	IEEE80211_TX_INTFL_RETRANSMISSION	= BIT(15),
+	IEEE80211_TX_INTFL_MLME_CONN_TX		= BIT(16),
+	IEEE80211_TX_INTFL_NL80211_FRAME_TX	= BIT(17),
+	IEEE80211_TX_CTL_LDPC			= BIT(18),
+	IEEE80211_TX_CTL_STBC			= BIT(19) | BIT(20),
+	IEEE80211_TX_CTL_TX_OFFCHAN		= BIT(21),
+	IEEE80211_TX_INTFL_TKIP_MIC_FAILURE	= BIT(22),
+	IEEE80211_TX_CTL_NO_CCK_RATE		= BIT(23),
+	IEEE80211_TX_STATUS_EOSP		= BIT(24),
+	IEEE80211_TX_CTL_USE_MINRATE		= BIT(25),
+	IEEE80211_TX_CTL_DONTFRAG		= BIT(26),
+	IEEE80211_TX_CTL_PS_RESPONSE		= BIT(27),
 };
 
-#define IEEE80211_TX_CTL_STBC_SHIFT		20
+#define IEEE80211_TX_CTL_STBC_SHIFT		19
 
 /**
  * enum mac80211_tx_control_flags - flags to describe transmit control
@@ -507,6 +502,11 @@ enum mac80211_tx_info_flags {
  *	802.11-2007 7.1.3.4.1 paragraph 3. This flag will always be set for
  *	beacons and always be clear for frames without a sequence number field.
  *
+ * @IEEE80211_TX_CTRL_MORE_FRAMES: More frames will be passed to the
+ *	transmit function after the current frame, this can be used
+ *	by drivers to kick the DMA queue only if unset or when the
+ *	queue gets full.
+ *
  * These flags are used in tx_info->control.flags.
  */
 enum mac80211_tx_control_flags {
@@ -514,6 +514,7 @@ enum mac80211_tx_control_flags {
 	IEEE80211_TX_CTRL_ASSIGN_SEQ		= BIT(1),
 	IEEE80211_TX_CTRL_FIRST_FRAGMENT        = BIT(3),
 	IEEE80211_TX_CTRL_NO_PS_BUFFER          = BIT(4),
+	IEEE80211_TX_CTRL_MORE_FRAMES           = BIT(5),
 };
 
 /*
@@ -526,7 +527,7 @@ enum mac80211_tx_control_flags {
 	IEEE80211_TX_STAT_TX_FILTERED |	IEEE80211_TX_STAT_ACK |		      \
 	IEEE80211_TX_STAT_AMPDU | IEEE80211_TX_STAT_AMPDU_NO_BACK |	      \
 	IEEE80211_TX_CTL_RATE_CTRL_PROBE | IEEE80211_TX_CTL_STBC |	      \
-	IEEE80211_TX_CTL_MORE_FRAMES | IEEE80211_TX_CTL_LDPC)
+	IEEE80211_TX_CTL_LDPC)
 
 /*
  * This definition is used to clear all temporary flags, which are only used
@@ -534,7 +535,7 @@ enum mac80211_tx_control_flags {
  * info->control.flags is used.
  */
 #define IEEE80211_TX_TEMPORARY_CTRL_FLAGS (IEEE80211_TX_CTL_FIRST_FRAGMENT |  \
-	IEEE80211_TX_CTRL_NO_PS_BUFFER)
+	IEEE80211_TX_CTRL_NO_PS_BUFFER | IEEE80211_TX_CTRL_MORE_FRAMES)
 
 /**
  * enum mac80211_rate_control_flags - per-rate flags set by the
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 316b8d3..740eedd 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -861,7 +861,7 @@ static int ieee80211_fragment(struct ieee80211_tx_data *tx,
 		info->control.flags &= ~(IEEE80211_TX_CTRL_FIRST_FRAGMENT);
 
 		if (rem)
-			info->flags |= IEEE80211_TX_CTL_MORE_FRAMES;
+			info->control.flags |= IEEE80211_TX_CTRL_MORE_FRAMES;
 
 		skb_copy_queue_mapping(tmp, skb);
 		tmp->priority = skb->priority;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 5/6] mac80211: move flag IEEE80211_TX_CTL_TX_OFFCHAN into info->control.flags
  2014-02-22 20:36 [PATCH 0/6] mac80211: move specific tx flags into info->control.flags Thomas Huehn
                   ` (3 preceding siblings ...)
  2014-02-22 20:36 ` [PATCH 4/6] mac80211: move flag IEEE80211_TX_CTL_MORE_FRAMES " Thomas Huehn
@ 2014-02-22 20:36 ` Thomas Huehn
  2014-02-22 20:36 ` [PATCH 6/6] mac80211: move flag IEEE80211_TX_CTL_USE_MINRATE " Thomas Huehn
  5 siblings, 0 replies; 7+ messages in thread
From: Thomas Huehn @ 2014-02-22 20:36 UTC (permalink / raw
  To: linville; +Cc: linux-wireless, johannes, nbd, thomas

Flag IEEE80211_TX_CTL_TX_OFFCHAN is only used within the tx path while
ieee80211_tx_info->control is valid. Therefore this patch moves this flag
from info->flags structure into the info->control.flags and renames it to
IEEE80211_TX_CTRL_TX_OFFCHAN.

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>
---
 drivers/net/wireless/ath/ath10k/mac.c |    2 +-
 drivers/net/wireless/ti/wlcore/tx.c   |    2 +-
 include/net/mac80211.h                |   22 +++++++++++-----------
 net/mac80211/cfg.c                    |    5 +++--
 net/mac80211/rx.c                     |    4 ++--
 net/mac80211/tx.c                     |    2 +-
 6 files changed, 19 insertions(+), 18 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c
index 776e364..6ca1202 100644
--- a/drivers/net/wireless/ath/ath10k/mac.c
+++ b/drivers/net/wireless/ath/ath10k/mac.c
@@ -2017,7 +2017,7 @@ static void ath10k_tx(struct ieee80211_hw *hw,
 	ATH10K_SKB_CB(skb)->htt.is_offchan = false;
 	ATH10K_SKB_CB(skb)->htt.tid = tid;
 
-	if (info->flags & IEEE80211_TX_CTL_TX_OFFCHAN) {
+	if (info->control.flags & IEEE80211_TX_CTRL_TX_OFFCHAN) {
 		spin_lock_bh(&ar->data_lock);
 		ATH10K_SKB_CB(skb)->htt.is_offchan = true;
 		ATH10K_SKB_CB(skb)->vdev_id = ar->scan.vdev_id;
diff --git a/drivers/net/wireless/ti/wlcore/tx.c b/drivers/net/wireless/ti/wlcore/tx.c
index 40b4311..39ba78e 100644
--- a/drivers/net/wireless/ti/wlcore/tx.c
+++ b/drivers/net/wireless/ti/wlcore/tx.c
@@ -181,7 +181,7 @@ u8 wl12xx_tx_get_hlid(struct wl1271 *wl, struct wl12xx_vif *wlvif,
 		return wl12xx_tx_get_hlid_ap(wl, wlvif, skb, sta);
 
 	control = IEEE80211_SKB_CB(skb);
-	if (control->flags & IEEE80211_TX_CTL_TX_OFFCHAN) {
+	if (control->control.flags & IEEE80211_TX_CTRL_TX_OFFCHAN) {
 		wl1271_debug(DEBUG_TX, "tx offchannel");
 		return wlvif->dev_hlid;
 	}
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 5112a61..427ef6f 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -425,10 +425,6 @@ struct ieee80211_bss_conf {
  * @IEEE80211_TX_CTL_LDPC: tells the driver to use LDPC for this frame
  * @IEEE80211_TX_CTL_STBC: Enables Space-Time Block Coding (STBC) for this
  *	frame and selects the maximum number of streams that it can use.
- * @IEEE80211_TX_CTL_TX_OFFCHAN: Marks this packet to be transmitted on
- *	the off-channel channel when a remain-on-channel offload is done
- *	in hardware -- normal packets still flow and are expected to be
- *	handled properly by the device.
  * @IEEE80211_TX_INTFL_TKIP_MIC_FAILURE: Marks this packet to be used for TKIP
  *	testing. It will be sent out with incorrect Michael MIC key to allow
  *	TKIP countermeasures to be tested.
@@ -473,13 +469,12 @@ enum mac80211_tx_info_flags {
 	IEEE80211_TX_INTFL_NL80211_FRAME_TX	= BIT(17),
 	IEEE80211_TX_CTL_LDPC			= BIT(18),
 	IEEE80211_TX_CTL_STBC			= BIT(19) | BIT(20),
-	IEEE80211_TX_CTL_TX_OFFCHAN		= BIT(21),
-	IEEE80211_TX_INTFL_TKIP_MIC_FAILURE	= BIT(22),
-	IEEE80211_TX_CTL_NO_CCK_RATE		= BIT(23),
-	IEEE80211_TX_STATUS_EOSP		= BIT(24),
-	IEEE80211_TX_CTL_USE_MINRATE		= BIT(25),
-	IEEE80211_TX_CTL_DONTFRAG		= BIT(26),
-	IEEE80211_TX_CTL_PS_RESPONSE		= BIT(27),
+	IEEE80211_TX_INTFL_TKIP_MIC_FAILURE	= BIT(21),
+	IEEE80211_TX_CTL_NO_CCK_RATE		= BIT(22),
+	IEEE80211_TX_STATUS_EOSP		= BIT(23),
+	IEEE80211_TX_CTL_USE_MINRATE		= BIT(24),
+	IEEE80211_TX_CTL_DONTFRAG		= BIT(25),
+	IEEE80211_TX_CTL_PS_RESPONSE		= BIT(26),
 };
 
 #define IEEE80211_TX_CTL_STBC_SHIFT		19
@@ -506,6 +501,10 @@ enum mac80211_tx_info_flags {
  *	transmit function after the current frame, this can be used
  *	by drivers to kick the DMA queue only if unset or when the
  *	queue gets full.
+ * @IEEE80211_TX_CTRL_TX_OFFCHAN: Marks this packet to be transmitted on
+ *	the off-channel channel when a remain-on-channel offload is done
+ *	in hardware -- normal packets still flow and are expected to be
+ *	handled properly by the device.
  *
  * These flags are used in tx_info->control.flags.
  */
@@ -515,6 +514,7 @@ enum mac80211_tx_control_flags {
 	IEEE80211_TX_CTRL_FIRST_FRAGMENT        = BIT(3),
 	IEEE80211_TX_CTRL_NO_PS_BUFFER          = BIT(4),
 	IEEE80211_TX_CTRL_MORE_FRAMES           = BIT(5),
+	IEEE80211_TX_CTRL_TX_OFFCHAN            = BIT(6),
 };
 
 /*
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 1acb291..afdd1a3 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -3388,8 +3388,9 @@ static int ieee80211_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
 		goto out_unlock;
 	}
 
-	IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_CTL_TX_OFFCHAN |
-					IEEE80211_TX_INTFL_OFFCHAN_TX_OK;
+	IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_OFFCHAN_TX_OK;
+	IEEE80211_SKB_CB(skb)->control.flags |= IEEE80211_TX_CTRL_TX_OFFCHAN;
+
 	if (local->hw.flags & IEEE80211_HW_QUEUE_CONTROL)
 		IEEE80211_SKB_CB(skb)->hw_queue =
 			local->hw.offchannel_tx_hw_queue;
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
index 58e4b70..eb54b51 100644
--- a/net/mac80211/rx.c
+++ b/net/mac80211/rx.c
@@ -2750,9 +2750,9 @@ ieee80211_rx_h_action_return(struct ieee80211_rx_data *rx)
 		if (rx->sdata->vif.type == NL80211_IFTYPE_P2P_DEVICE) {
 			struct ieee80211_tx_info *info = IEEE80211_SKB_CB(nskb);
 
-			info->flags = IEEE80211_TX_CTL_TX_OFFCHAN |
-				      IEEE80211_TX_INTFL_OFFCHAN_TX_OK |
+			info->flags = IEEE80211_TX_INTFL_OFFCHAN_TX_OK |
 				      IEEE80211_TX_CTL_NO_CCK_RATE;
+			info->control.flags |= IEEE80211_TX_CTRL_TX_OFFCHAN;
 			if (local->hw.flags & IEEE80211_HW_QUEUE_CONTROL)
 				info->hw_queue =
 					local->hw.offchannel_tx_hw_queue;
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 740eedd..5a71385 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1434,7 +1434,7 @@ static bool ieee80211_tx(struct ieee80211_sub_if_data *sdata,
 	info->band = band;
 
 	/* set up hw_queue value early */
-	if (!(info->flags & IEEE80211_TX_CTL_TX_OFFCHAN) ||
+	if (!(info->control.flags & IEEE80211_TX_CTRL_TX_OFFCHAN) ||
 	    !(local->hw.flags & IEEE80211_HW_QUEUE_CONTROL))
 		info->hw_queue =
 			sdata->vif.hw_queue[skb_get_queue_mapping(skb)];
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 6/6] mac80211: move flag IEEE80211_TX_CTL_USE_MINRATE into info->control.flags
  2014-02-22 20:36 [PATCH 0/6] mac80211: move specific tx flags into info->control.flags Thomas Huehn
                   ` (4 preceding siblings ...)
  2014-02-22 20:36 ` [PATCH 5/6] mac80211: move flag IEEE80211_TX_CTL_TX_OFFCHAN " Thomas Huehn
@ 2014-02-22 20:36 ` Thomas Huehn
  5 siblings, 0 replies; 7+ messages in thread
From: Thomas Huehn @ 2014-02-22 20:36 UTC (permalink / raw
  To: linville; +Cc: linux-wireless, johannes, nbd, thomas

Flag IEEE80211_TX_CTL_USE_MINRATE is only used within the tx path while
ieee80211_tx_info->control is valid. Therefore this patch moves this flag
from info->flags structure into the info->control.flags and renames it to
IEEE80211_TX_CTRL_USE_MINRATE.

Signed-off-by: Alexander Couzens <lynxis@fe80.eu>
Signed-off-by: Thomas Huehn <thomas@net.t-labs.tu-berlin.de>
---
 drivers/net/wireless/ath/ar5523/ar5523.c |    2 +-
 include/net/mac80211.h                   |    9 +++------
 net/mac80211/mlme.c                      |    2 +-
 net/mac80211/rate.c                      |    4 ++--
 4 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/ath/ar5523/ar5523.c b/drivers/net/wireless/ath/ar5523/ar5523.c
index 507d9a9..b83a08b 100644
--- a/drivers/net/wireless/ath/ar5523/ar5523.c
+++ b/drivers/net/wireless/ath/ar5523/ar5523.c
@@ -849,7 +849,7 @@ static void ar5523_tx_work_locked(struct ar5523 *ar)
 		else
 			desc->connid = cpu_to_be32(AR5523_ID_BROADCAST);
 
-		if (txi->flags & IEEE80211_TX_CTL_USE_MINRATE)
+		if (txi->control.flags & IEEE80211_TX_CTRL_USE_MINRATE)
 			txqid |= UATH_TXQID_MINRATE;
 
 		desc->txqid = cpu_to_be32(txqid);
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index 427ef6f..245e1f2 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -436,9 +436,6 @@ struct ieee80211_bss_conf {
  *	an SP that mac80211 transmits, it is already set; for driver frames
  *	the driver may set this flag. It is also used to do the same for
  *	PS-Poll responses.
- * @IEEE80211_TX_CTL_USE_MINRATE: This frame will be sent at lowest rate.
- *	This flag is used to send nullfunc frame at minimum rate when
- *	the nullfunc is used for connection monitoring purpose.
  * @IEEE80211_TX_CTL_DONTFRAG: Don't fragment this packet even if it
  *	would be fragmented by size (this is optional, only used for
  *	monitor injection).
@@ -472,9 +469,8 @@ enum mac80211_tx_info_flags {
 	IEEE80211_TX_INTFL_TKIP_MIC_FAILURE	= BIT(21),
 	IEEE80211_TX_CTL_NO_CCK_RATE		= BIT(22),
 	IEEE80211_TX_STATUS_EOSP		= BIT(23),
-	IEEE80211_TX_CTL_USE_MINRATE		= BIT(24),
-	IEEE80211_TX_CTL_DONTFRAG		= BIT(25),
-	IEEE80211_TX_CTL_PS_RESPONSE		= BIT(26),
+	IEEE80211_TX_CTL_DONTFRAG		= BIT(24),
+	IEEE80211_TX_CTL_PS_RESPONSE		= BIT(25),
 };
 
 #define IEEE80211_TX_CTL_STBC_SHIFT		19
@@ -515,6 +511,7 @@ enum mac80211_tx_control_flags {
 	IEEE80211_TX_CTRL_NO_PS_BUFFER          = BIT(4),
 	IEEE80211_TX_CTRL_MORE_FRAMES           = BIT(5),
 	IEEE80211_TX_CTRL_TX_OFFCHAN            = BIT(6),
+	IEEE80211_TX_CTRL_USE_MINRATE           = BIT(7),
 };
 
 /*
diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
index 46b62bb..e03d761 100644
--- a/net/mac80211/mlme.c
+++ b/net/mac80211/mlme.c
@@ -875,7 +875,7 @@ void ieee80211_send_nullfunc(struct ieee80211_local *local,
 		IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_CTL_REQ_TX_STATUS;
 
 	if (ifmgd->flags & IEEE80211_STA_CONNECTION_POLL)
-		IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_CTL_USE_MINRATE;
+		IEEE80211_SKB_CB(skb)->control.flags |= IEEE80211_TX_CTRL_USE_MINRATE;
 
 	ieee80211_tx_skb(sdata, skb);
 }
diff --git a/net/mac80211/rate.c b/net/mac80211/rate.c
index 8fdadfd..199e883 100644
--- a/net/mac80211/rate.c
+++ b/net/mac80211/rate.c
@@ -191,8 +191,8 @@ static bool rc_no_data_or_no_ack_use_min(struct ieee80211_tx_rate_control *txrc)
 
 	fc = hdr->frame_control;
 
-	return (info->flags & (IEEE80211_TX_CTL_NO_ACK |
-			       IEEE80211_TX_CTL_USE_MINRATE)) ||
+	return (info->flags & IEEE80211_TX_CTL_NO_ACK) ||
+	       (info->control.flags & IEEE80211_TX_CTRL_USE_MINRATE) ||
 		!ieee80211_is_data(fc);
 }
 
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-02-22 20:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-22 20:36 [PATCH 0/6] mac80211: move specific tx flags into info->control.flags Thomas Huehn
2014-02-22 20:36 ` [PATCH 1/6] mac80211: move flag IEEE80211_TX_CTL_ASSIGN_SEQ " Thomas Huehn
2014-02-22 20:36 ` [PATCH 2/6] mac80211: move flag IEEE80211_TX_CTL_FIRST_FRAGMENT " Thomas Huehn
2014-02-22 20:36 ` [PATCH 3/6] mac80211: move flag IEEE80211_TX_CTL_NO_PS_BUFFER " Thomas Huehn
2014-02-22 20:36 ` [PATCH 4/6] mac80211: move flag IEEE80211_TX_CTL_MORE_FRAMES " Thomas Huehn
2014-02-22 20:36 ` [PATCH 5/6] mac80211: move flag IEEE80211_TX_CTL_TX_OFFCHAN " Thomas Huehn
2014-02-22 20:36 ` [PATCH 6/6] mac80211: move flag IEEE80211_TX_CTL_USE_MINRATE " Thomas Huehn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.