[PATCH 3/5] Use different queues and flags for data/management frames.

Max Filippov jcmvbkbc at gmail.com
Fri Jan 9 17:16:14 EET 2009


Use different queues and flags for data/management frames.
Return TX status only for frames that request it.
Indicate FCS mismatch on received frames.

Signed-off-by: Max Filippov <jcmvbkbc at gmail.com>
---
 stlc45xx.c |   32 +++++++++++++++++++++++++++++++-
 1 files changed, 31 insertions(+), 1 deletions(-)

diff --git a/stlc45xx.c b/stlc45xx.c
index 4d96732..f2d9d0a 100644
--- a/stlc45xx.c
+++ b/stlc45xx.c
@@ -1389,6 +1389,8 @@ static int stlc45xx_rx_data(struct stlc45xx *stlc, struct sk_buff *skb)
 
 	memset(&status, 0, sizeof(status));
 
+	if (!(data->flags & LM_IN_FCS_GOOD))
+		status.flag |= RX_FLAG_FAILED_FCS_CRC;
 	/*
 	 * FIXME: mactime wants TSF at the beginning of frame,
 	 * clock is TSF at the end of frame
@@ -2012,6 +2014,32 @@ static void stlc45xx_tx_psm(struct stlc45xx *stlc, bool enable)
 	kfree(control);
 }
 
+static void stlc45xx_tx_set_flags(struct ieee80211_hw *hw, struct ieee80211_hdr *hdr,
+		struct s_lm_data_out *data)
+{
+	struct stlc45xx *stlc = hw->priv;
+
+	stlc45xx_debug(DEBUG_FUNC, "%s", __func__);
+	
+	switch (stlc->mode) {
+	case NL80211_IFTYPE_STATION:
+		break;
+
+	case NL80211_IFTYPE_ADHOC:
+		if (ieee80211_is_mgmt(hdr->frame_control)) {
+			data->queue = LM_QUEUE_MGT;
+			if (ieee80211_is_probe_resp(hdr->frame_control))
+				data->flags |= LM_OUT_TIMESTAMP;
+			if (ieee80211_is_beacon(hdr->frame_control)) {
+				data->queue = LM_QUEUE_BEACON;
+			}
+		} else
+			data->queue = LM_QUEUE_DATA;
+		break;
+	}
+	stlc45xx_debug(DEBUG_TX, "queue: %d, flags: %x",data->queue,data->flags);
+}
+
 static int stlc45xx_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
 {
 	struct stlc45xx *stlc = hw->priv;
@@ -2045,7 +2073,7 @@ static int stlc45xx_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
 	entry->header_len = sizeof(*data) + padding;
 
 	entry->skb = skb;
-	entry->status_needed = true;
+	entry->status_needed = (info->flags & IEEE80211_TX_CTL_REQ_TX_STATUS) != 0;
 	entry->handle = (u32) skb;
 	entry->lifetime = jiffies + msecs_to_jiffies(TX_FRAME_LIFETIME);
 
@@ -2083,6 +2111,8 @@ static int stlc45xx_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
 		data->aloft[i] = rate->hw_value;
 	}
 
+	stlc45xx_tx_set_flags(hw, (struct ieee80211_hdr*)payload, data);
+
 	list_add_tail(&entry->tx_list, &stlc->tx_pending);
 
 	/* check if there's enough space in tx buffer */
-- 
1.5.4.3


More information about the stlc45xx-devel mailing list