aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2011-11-16 09:28:57 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-11-21 16:20:43 -0500
commit74e4dbfd57a38c4ec4131cebdbfa3d621d38dd6a (patch)
treebd588ddd978986870d5d7f9710a86fc8d86c9693 /net/mac80211
parenta1a3fcec6fcc36482c1c57bde7ed4078313495cd (diff)
mac80211: make TX LED handling independent of fragmentation
This just prepares for passing the entire fragment list to the driver. No significant changes, but the TX throughput is calculated slightly differently now and we blink only once for each MSDU. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/tx.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
index f521ed4ab930..0cc68d0796a2 100644
--- a/net/mac80211/tx.c
+++ b/net/mac80211/tx.c
@@ -1204,18 +1204,23 @@ ieee80211_tx_prepare(struct ieee80211_sub_if_data *sdata,
1204 * Returns false if the frame couldn't be transmitted but was queued instead. 1204 * Returns false if the frame couldn't be transmitted but was queued instead.
1205 */ 1205 */
1206static bool __ieee80211_tx(struct ieee80211_local *local, 1206static bool __ieee80211_tx(struct ieee80211_local *local,
1207 struct sk_buff_head *skbs, 1207 struct sk_buff_head *skbs, int led_len,
1208 struct sta_info *sta, bool txpending) 1208 struct sta_info *sta, bool txpending)
1209{ 1209{
1210 struct sk_buff *skb, *tmp; 1210 struct sk_buff *skb, *tmp;
1211 struct ieee80211_tx_info *info; 1211 struct ieee80211_tx_info *info;
1212 struct ieee80211_sub_if_data *sdata; 1212 struct ieee80211_sub_if_data *sdata;
1213 unsigned long flags; 1213 unsigned long flags;
1214 int len; 1214 __le16 fc;
1215
1216 if (WARN_ON(skb_queue_empty(skbs)))
1217 return true;
1218
1219 skb = skb_peek(skbs);
1220 fc = ((struct ieee80211_hdr *)skb->data)->frame_control;
1215 1221
1216 skb_queue_walk_safe(skbs, skb, tmp) { 1222 skb_queue_walk_safe(skbs, skb, tmp) {
1217 int q = skb_get_queue_mapping(skb); 1223 int q = skb_get_queue_mapping(skb);
1218 __le16 fc;
1219 1224
1220 spin_lock_irqsave(&local->queue_stop_reason_lock, flags); 1225 spin_lock_irqsave(&local->queue_stop_reason_lock, flags);
1221 if (local->queue_stop_reasons[q] || 1226 if (local->queue_stop_reasons[q] ||
@@ -1238,8 +1243,6 @@ static bool __ieee80211_tx(struct ieee80211_local *local,
1238 1243
1239 info = IEEE80211_SKB_CB(skb); 1244 info = IEEE80211_SKB_CB(skb);
1240 1245
1241 len = skb->len;
1242
1243 sdata = vif_to_sdata(info->control.vif); 1246 sdata = vif_to_sdata(info->control.vif);
1244 1247
1245 switch (sdata->vif.type) { 1248 switch (sdata->vif.type) {
@@ -1260,15 +1263,13 @@ static bool __ieee80211_tx(struct ieee80211_local *local,
1260 else 1263 else
1261 info->control.sta = NULL; 1264 info->control.sta = NULL;
1262 1265
1263 fc = ((struct ieee80211_hdr *)skb->data)->frame_control;
1264
1265 __skb_unlink(skb, skbs); 1266 __skb_unlink(skb, skbs);
1266 drv_tx(local, skb); 1267 drv_tx(local, skb);
1267
1268 ieee80211_tpt_led_trig_tx(local, fc, len);
1269 ieee80211_led_tx(local, 1);
1270 } 1268 }
1271 1269
1270 ieee80211_tpt_led_trig_tx(local, fc, led_len);
1271 ieee80211_led_tx(local, 1);
1272
1272 WARN_ON(!skb_queue_empty(skbs)); 1273 WARN_ON(!skb_queue_empty(skbs));
1273 1274
1274 return true; 1275 return true;
@@ -1338,6 +1339,7 @@ static bool ieee80211_tx(struct ieee80211_sub_if_data *sdata,
1338 ieee80211_tx_result res_prepare; 1339 ieee80211_tx_result res_prepare;
1339 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 1340 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
1340 bool result = true; 1341 bool result = true;
1342 int led_len;
1341 1343
1342 if (unlikely(skb->len < 10)) { 1344 if (unlikely(skb->len < 10)) {
1343 dev_kfree_skb(skb); 1345 dev_kfree_skb(skb);
@@ -1347,6 +1349,7 @@ static bool ieee80211_tx(struct ieee80211_sub_if_data *sdata,
1347 rcu_read_lock(); 1349 rcu_read_lock();
1348 1350
1349 /* initialises tx */ 1351 /* initialises tx */
1352 led_len = skb->len;
1350 res_prepare = ieee80211_tx_prepare(sdata, &tx, skb); 1353 res_prepare = ieee80211_tx_prepare(sdata, &tx, skb);
1351 1354
1352 if (unlikely(res_prepare == TX_DROP)) { 1355 if (unlikely(res_prepare == TX_DROP)) {
@@ -1360,7 +1363,8 @@ static bool ieee80211_tx(struct ieee80211_sub_if_data *sdata,
1360 info->band = tx.channel->band; 1363 info->band = tx.channel->band;
1361 1364
1362 if (!invoke_tx_handlers(&tx)) 1365 if (!invoke_tx_handlers(&tx))
1363 result = __ieee80211_tx(local, &tx.skbs, tx.sta, txpending); 1366 result = __ieee80211_tx(local, &tx.skbs, led_len,
1367 tx.sta, txpending);
1364 out: 1368 out:
1365 rcu_read_unlock(); 1369 rcu_read_unlock();
1366 return result; 1370 return result;
@@ -2116,7 +2120,7 @@ static bool ieee80211_tx_pending_skb(struct ieee80211_local *local,
2116 hdr = (struct ieee80211_hdr *)skb->data; 2120 hdr = (struct ieee80211_hdr *)skb->data;
2117 sta = sta_info_get(sdata, hdr->addr1); 2121 sta = sta_info_get(sdata, hdr->addr1);
2118 2122
2119 result = __ieee80211_tx(local, &skbs, sta, true); 2123 result = __ieee80211_tx(local, &skbs, skb->len, sta, true);
2120 } 2124 }
2121 2125
2122 return result; 2126 return result;