2014-03-11 15:15:17

by Thomas Huehn

[permalink] [raw]
Subject: [PATCH v2 0/3] mac80211: move specific tx flags into info->control.flags

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 3 bits freed in enum mac80211_tx_control
that are usable for e.g. upcoming transmit power control (tpc).

Greetings Thomas

-v1: fix compile errors when all drivers are properly selected

-v2: remove 3 out of the 6 initial patches as those flags could not
be moved (thx to Johannes Berg)



2014-03-11 15:15:18

by Thomas Huehn

[permalink] [raw]
Subject: [PATCH v2 1/3] mac80211: move flag IEEE80211_TX_CTL_FIRST_FRAGMENT into info->control.flags

Flag IEEE80211_TX_CTL_FIRST_FRAGMENT 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.

Signed-off-by: Benjamin Vahl <[email protected]>
Signed-off-by: Thomas Huehn <[email protected]>
---
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 | 62 ++++++++++++------------
net/mac80211/tx.c | 10 ++--
11 files changed, 47 insertions(+), 47 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/mac.h b/drivers/net/wireless/ath/ath10k/mac.h
index ba10219..b9110a6 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 a650704..a2312fe 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->flags & IEEE80211_TX_CTL_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 218a0f3..8992749 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->flags & IEEE80211_TX_CTL_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 86588c9..cf41bf0 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->flags & IEEE80211_TX_CTL_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 9417cb5..81a294b 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 5642ccc..1ab263e 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 7980ab1..ed4b180 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->flags & IEEE80211_TX_CTL_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 c981bcf..65feb19 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->flags & IEEE80211_TX_CTL_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 86faa41..33710ee 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -394,7 +394,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.
@@ -476,47 +475,48 @@ enum mac80211_tx_info_flags {
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_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
*
* @IEEE80211_TX_CTRL_PORT_CTRL_PROTO: this frame is a port control
* protocol frame (e.g. EAP)
+ * @IEEE80211_TX_CTRL_FIRST_FRAGMENT: this is a first fragment of the frame
*
* 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_FIRST_FRAGMENT = BIT(1),
};

/*
@@ -524,13 +524,13 @@ 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)

/**
* enum mac80211_rate_control_flags - per-rate flags set by the
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 722151f..de1a7da 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;
}
@@ -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_ASSIGN_SEQ;
+ info->control.flags |= IEEE80211_TX_CTRL_FIRST_FRAGMENT;
out:
rcu_read_unlock();
return skb;
--
1.7.9.5


2014-03-11 15:15:18

by Thomas Huehn

[permalink] [raw]
Subject: [PATCH v2 2/3] mac80211: move flag IEEE80211_TX_CTL_NO_PS_BUFFER into info->control.flags

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 <[email protected]>
Signed-off-by: Thomas Huehn <[email protected]>
---
drivers/net/wireless/ath/carl9170/tx.c | 4 +--
drivers/net/wireless/iwlegacy/4965-mac.c | 2 +-
drivers/net/wireless/iwlwifi/dvm/tx.c | 2 +-
drivers/net/wireless/iwlwifi/mvm/mac80211.c | 2 +-
drivers/net/wireless/p54/txrx.c | 2 +-
include/net/mac80211.h | 47 +++++++++++++--------------
net/mac80211/mesh_ps.c | 6 ++--
net/mac80211/sta_info.c | 13 ++++----
net/mac80211/tx.c | 5 +--
9 files changed, 42 insertions(+), 41 deletions(-)

diff --git a/drivers/net/wireless/ath/carl9170/tx.c b/drivers/net/wireless/ath/carl9170/tx.c
index 4cadfd4..f059546 100644
--- a/drivers/net/wireless/ath/carl9170/tx.c
+++ b/drivers/net/wireless/ath/carl9170/tx.c
@@ -1295,8 +1295,8 @@ static bool carl9170_tx_ps_drop(struct ar9170 *ar, struct sk_buff *skb)
tx_info = IEEE80211_SKB_CB(skb);

if (unlikely(sta_info->sleeping) &&
- !(tx_info->flags & (IEEE80211_TX_CTL_NO_PS_BUFFER |
- IEEE80211_TX_CTL_CLEAR_PS_FILT))) {
+ !(tx_info->flags & IEEE80211_TX_CTL_CLEAR_PS_FILT) &&
+ !(tx_info->control.flags & IEEE80211_TX_CTRL_NO_PS_BUFFER)) {
rcu_read_unlock();

if (tx_info->flags & IEEE80211_TX_CTL_AMPDU)
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 a6839df..97be0a9 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/iwlwifi/mvm/mac80211.c b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
index 7492fc0..2582e3f 100644
--- a/drivers/net/wireless/iwlwifi/mvm/mac80211.c
+++ b/drivers/net/wireless/iwlwifi/mvm/mac80211.c
@@ -439,7 +439,7 @@ static void iwl_mvm_mac_tx(struct ieee80211_hw *hw,
goto drop;

/* treat non-bufferable MMPDUs as broadcast if sta is sleeping */
- if (unlikely(info->flags & IEEE80211_TX_CTL_NO_PS_BUFFER &&
+ if (unlikely(info->control.flags & IEEE80211_TX_CTRL_NO_PS_BUFFER &&
ieee80211_is_mgmt(hdr->frame_control) &&
!ieee80211_is_deauth(hdr->frame_control) &&
!ieee80211_is_disassoc(hdr->frame_control) &&
diff --git a/drivers/net/wireless/p54/txrx.c b/drivers/net/wireless/p54/txrx.c
index 153c615..5d0eaed 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->flags & IEEE80211_TX_CTL_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 33710ee..9ab0d69 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -424,9 +424,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
@@ -487,23 +484,22 @@ enum mac80211_tx_info_flags {
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_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
@@ -511,12 +507,16 @@ 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_FIRST_FRAGMENT: this is a first fragment of the frame
+ * @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.
*
* 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_FIRST_FRAGMENT = BIT(1),
+ IEEE80211_TX_CTRL_NO_PS_BUFFER = BIT(2),
};

/*
@@ -528,9 +528,8 @@ 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)

/**
* enum mac80211_rate_control_flags - per-rate flags set by the
@@ -2058,7 +2057,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
@@ -2067,7 +2066,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
@@ -2675,7 +2674,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 de1a7da..09988fc 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


2014-03-28 08:44:05

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH v2 1/3] mac80211: move flag IEEE80211_TX_CTL_FIRST_FRAGMENT into info->control.flags

On Tue, 2014-03-11 at 16:15 +0100, Thomas Huehn wrote:
> Flag IEEE80211_TX_CTL_FIRST_FRAGMENT 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.

Your commit logs are inadequate. Apart from the formatting problem
(lines too long, should be 72 chars at most) you're not describing why
you're making the changes.

johannes


2014-03-11 15:15:17

by Thomas Huehn

[permalink] [raw]
Subject: [PATCH v2 3/3] mac80211: move flag IEEE80211_TX_CTL_MORE_FRAMES into info->control.flags

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 <[email protected]>
Signed-off-by: Thomas Huehn <[email protected]>
---
drivers/net/wireless/rt2x00/rt2x00queue.c | 2 +-
include/net/mac80211.h | 38 ++++++++++++++---------------
net/mac80211/tx.c | 2 +-
3 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/drivers/net/wireless/rt2x00/rt2x00queue.c b/drivers/net/wireless/rt2x00/rt2x00queue.c
index 1ab263e..7d78395 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 9ab0d69..50bd948 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -424,10 +424,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.)
@@ -484,22 +480,21 @@ enum mac80211_tx_info_flags {
IEEE80211_TX_INTFL_NEED_TXPROCESSING = BIT(13),
IEEE80211_TX_INTFL_RETRIED = BIT(14),
IEEE80211_TX_INTFL_DONT_ENCRYPT = 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_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
@@ -510,6 +505,10 @@ enum mac80211_tx_info_flags {
* @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_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.
*/
@@ -517,6 +516,7 @@ enum mac80211_tx_control_flags {
IEEE80211_TX_CTRL_PORT_CTRL_PROTO = BIT(0),
IEEE80211_TX_CTRL_FIRST_FRAGMENT = BIT(1),
IEEE80211_TX_CTRL_NO_PS_BUFFER = BIT(2),
+ IEEE80211_TX_CTRL_MORE_FRAMES = BIT(3),
};

/*
@@ -529,7 +529,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)

/**
* enum mac80211_rate_control_flags - per-rate flags set by the
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index 09988fc..84b1a15 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