diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-03-23 12:28:38 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-03-27 20:13:21 -0400 |
commit | 1870cd71e87da1a1afb904f2c84086f487a07135 (patch) | |
tree | 6763dbc0c21f17f38fbfd93e1e0bd84814c9adcd | |
parent | 2a577d98712a284a612dd51d69db5cb989810dc2 (diff) |
mac80211: clean up __ieee80211_tx args
__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@sipsolutions.net>
Reviewed-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | net/mac80211/tx.c | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c index ee1b77f8a804..b909e4090e93 100644 --- a/net/mac80211/tx.c +++ b/net/mac80211/tx.c | |||
@@ -1084,9 +1084,10 @@ static int ieee80211_tx_prepare(struct ieee80211_local *local, | |||
1084 | } | 1084 | } |
1085 | 1085 | ||
1086 | static int __ieee80211_tx(struct ieee80211_local *local, | 1086 | static int __ieee80211_tx(struct ieee80211_local *local, |
1087 | struct ieee80211_tx_data *tx) | 1087 | struct sk_buff **skbp, |
1088 | struct sta_info *sta) | ||
1088 | { | 1089 | { |
1089 | struct sk_buff *skb = tx->skb, *next; | 1090 | struct sk_buff *skb = *skbp, *next; |
1090 | struct ieee80211_tx_info *info; | 1091 | struct ieee80211_tx_info *info; |
1091 | int ret; | 1092 | int ret; |
1092 | bool fragm = false; | 1093 | bool fragm = false; |
@@ -1111,23 +1112,23 @@ static int __ieee80211_tx(struct ieee80211_local *local, | |||
1111 | * We will later move this down into the only driver that | 1112 | * We will later move this down into the only driver that |
1112 | * needs it, iwlwifi. | 1113 | * needs it, iwlwifi. |
1113 | */ | 1114 | */ |
1114 | if (tx->sta && local->hw.ampdu_queues && | 1115 | if (sta && local->hw.ampdu_queues && |
1115 | info->flags & IEEE80211_TX_CTL_AMPDU) { | 1116 | info->flags & IEEE80211_TX_CTL_AMPDU) { |
1116 | unsigned long flags; | 1117 | unsigned long flags; |
1117 | u8 *qc = ieee80211_get_qos_ctl((void *) skb->data); | 1118 | u8 *qc = ieee80211_get_qos_ctl((void *) skb->data); |
1118 | int tid = *qc & IEEE80211_QOS_CTL_TID_MASK; | 1119 | int tid = *qc & IEEE80211_QOS_CTL_TID_MASK; |
1119 | 1120 | ||
1120 | spin_lock_irqsave(&tx->sta->lock, flags); | 1121 | spin_lock_irqsave(&sta->lock, flags); |
1121 | skb_set_queue_mapping(skb, local->hw.queues + | 1122 | skb_set_queue_mapping(skb, local->hw.queues + |
1122 | tx->sta->tid_to_tx_q[tid]); | 1123 | sta->tid_to_tx_q[tid]); |
1123 | spin_unlock_irqrestore(&tx->sta->lock, flags); | 1124 | spin_unlock_irqrestore(&sta->lock, flags); |
1124 | } | 1125 | } |
1125 | 1126 | ||
1126 | next = skb->next; | 1127 | next = skb->next; |
1127 | ret = local->ops->tx(local_to_hw(local), skb); | 1128 | ret = local->ops->tx(local_to_hw(local), skb); |
1128 | if (ret != NETDEV_TX_OK) | 1129 | if (ret != NETDEV_TX_OK) |
1129 | return IEEE80211_TX_AGAIN; | 1130 | return IEEE80211_TX_AGAIN; |
1130 | tx->skb = skb = next; | 1131 | *skbp = skb = next; |
1131 | ieee80211_led_tx(local, 1); | 1132 | ieee80211_led_tx(local, 1); |
1132 | fragm = true; | 1133 | fragm = true; |
1133 | } | 1134 | } |
@@ -1223,7 +1224,7 @@ static int ieee80211_tx(struct net_device *dev, struct sk_buff *skb) | |||
1223 | 1224 | ||
1224 | retries = 0; | 1225 | retries = 0; |
1225 | retry: | 1226 | retry: |
1226 | ret = __ieee80211_tx(local, &tx); | 1227 | ret = __ieee80211_tx(local, &tx.skb, tx.sta); |
1227 | switch (ret) { | 1228 | switch (ret) { |
1228 | case IEEE80211_TX_OK: | 1229 | case IEEE80211_TX_OK: |
1229 | break; | 1230 | break; |
@@ -1831,7 +1832,6 @@ void ieee80211_tx_pending(unsigned long data) | |||
1831 | struct net_device *dev = local->mdev; | 1832 | struct net_device *dev = local->mdev; |
1832 | struct ieee80211_hdr *hdr; | 1833 | struct ieee80211_hdr *hdr; |
1833 | unsigned long flags; | 1834 | unsigned long flags; |
1834 | struct ieee80211_tx_data tx; | ||
1835 | int i, ret; | 1835 | int i, ret; |
1836 | bool next; | 1836 | bool next; |
1837 | 1837 | ||
@@ -1862,14 +1862,15 @@ void ieee80211_tx_pending(unsigned long data) | |||
1862 | netif_start_subqueue(local->mdev, i); | 1862 | netif_start_subqueue(local->mdev, i); |
1863 | 1863 | ||
1864 | while (!skb_queue_empty(&local->pending[i])) { | 1864 | while (!skb_queue_empty(&local->pending[i])) { |
1865 | tx.flags = 0; | 1865 | struct sk_buff *skb = skb_dequeue(&local->pending[i]); |
1866 | tx.skb = skb_dequeue(&local->pending[i]); | 1866 | struct sta_info *sta; |
1867 | hdr = (struct ieee80211_hdr *)tx.skb->data; | 1867 | |
1868 | tx.sta = sta_info_get(local, hdr->addr1); | 1868 | hdr = (struct ieee80211_hdr *)skb->data; |
1869 | sta = sta_info_get(local, hdr->addr1); | ||
1869 | 1870 | ||
1870 | ret = __ieee80211_tx(local, &tx); | 1871 | ret = __ieee80211_tx(local, &skb, sta); |
1871 | if (ret != IEEE80211_TX_OK) { | 1872 | if (ret != IEEE80211_TX_OK) { |
1872 | skb_queue_head(&local->pending[i], tx.skb); | 1873 | skb_queue_head(&local->pending[i], skb); |
1873 | break; | 1874 | break; |
1874 | } | 1875 | } |
1875 | } | 1876 | } |