Search Linux Wireless

[PATCH 4/8] mac80211: clean up __ieee80211_tx args

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

 



__ieee80211_tx takes a struct ieee80211_tx_data argument, but only
uses a few of its members, namely 'skb' and 'sta'. Make that explicit,
so that less internal knowledge is required in ieee80211_tx_pending
and the possibility of introducing errors here is removed.

Signed-off-by: Johannes Berg <johannes@xxxxxxxxxxxxxxxx>
---
 net/mac80211/tx.c |   31 ++++++++++++++++---------------
 1 file changed, 16 insertions(+), 15 deletions(-)

--- wireless-testing.orig/net/mac80211/tx.c	2009-03-23 14:03:45.000000000 +0100
+++ wireless-testing/net/mac80211/tx.c	2009-03-23 14:03:46.000000000 +0100
@@ -1084,9 +1084,10 @@ static int ieee80211_tx_prepare(struct i
 }
 
 static int __ieee80211_tx(struct ieee80211_local *local,
-			  struct ieee80211_tx_data *tx)
+			  struct sk_buff **skbp,
+			  struct sta_info *sta)
 {
-	struct sk_buff *skb = tx->skb, *next;
+	struct sk_buff *skb = *skbp, *next;
 	struct ieee80211_tx_info *info;
 	int ret;
 	bool fragm = false;
@@ -1111,23 +1112,23 @@ static int __ieee80211_tx(struct ieee802
 		 * We will later move this down into the only driver that
 		 * needs it, iwlwifi.
 		 */
-		if (tx->sta && local->hw.ampdu_queues &&
+		if (sta && local->hw.ampdu_queues &&
 		    info->flags & IEEE80211_TX_CTL_AMPDU) {
 			unsigned long flags;
 			u8 *qc = ieee80211_get_qos_ctl((void *) skb->data);
 			int tid = *qc & IEEE80211_QOS_CTL_TID_MASK;
 
-			spin_lock_irqsave(&tx->sta->lock, flags);
+			spin_lock_irqsave(&sta->lock, flags);
 			skb_set_queue_mapping(skb, local->hw.queues +
-						   tx->sta->tid_to_tx_q[tid]);
-			spin_unlock_irqrestore(&tx->sta->lock, flags);
+						   sta->tid_to_tx_q[tid]);
+			spin_unlock_irqrestore(&sta->lock, flags);
 		}
 
 		next = skb->next;
 		ret = local->ops->tx(local_to_hw(local), skb);
 		if (ret != NETDEV_TX_OK)
 			return IEEE80211_TX_AGAIN;
-		tx->skb = skb = next;
+		*skbp = skb = next;
 		ieee80211_led_tx(local, 1);
 		fragm = true;
 	}
@@ -1223,7 +1224,7 @@ static int ieee80211_tx(struct net_devic
 
 	retries = 0;
  retry:
-	ret = __ieee80211_tx(local, &tx);
+	ret = __ieee80211_tx(local, &tx.skb, tx.sta);
 	switch (ret) {
 	case IEEE80211_TX_OK:
 		break;
@@ -1831,7 +1832,6 @@ void ieee80211_tx_pending(unsigned long 
 	struct net_device *dev = local->mdev;
 	struct ieee80211_hdr *hdr;
 	unsigned long flags;
-	struct ieee80211_tx_data tx;
 	int i, ret;
 	bool next;
 
@@ -1862,14 +1862,15 @@ void ieee80211_tx_pending(unsigned long 
 		netif_start_subqueue(local->mdev, i);
 
 		while (!skb_queue_empty(&local->pending[i])) {
-			tx.flags = 0;
-			tx.skb = skb_dequeue(&local->pending[i]);
-			hdr = (struct ieee80211_hdr *)tx.skb->data;
-			tx.sta = sta_info_get(local, hdr->addr1);
+			struct sk_buff *skb = skb_dequeue(&local->pending[i]);
+			struct sta_info *sta;
+
+			hdr = (struct ieee80211_hdr *)skb->data;
+			sta = sta_info_get(local, hdr->addr1);
 
-			ret = __ieee80211_tx(local, &tx);
+			ret = __ieee80211_tx(local, &skb, sta);
 			if (ret != IEEE80211_TX_OK) {
-				skb_queue_head(&local->pending[i], tx.skb);
+				skb_queue_head(&local->pending[i], skb);
 				break;
 			}
 		}

-- 

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

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux