aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorHelmut Schaa <helmut.schaa@googlemail.com>2011-12-08 07:11:55 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-12-13 15:30:46 -0500
commitadf5ace5d8161b962afe90e77922728a425b6933 (patch)
tree670f672cf55973083d1baaeb6342b9d57933668a /net/mac80211
parent8cb25e14fe80d0fac42412364df573eb3e8e83cc (diff)
mac80211: Make use of ieee80211_is_* functions in tx status path
Use ieee80211_is_data, ieee80211_is_mgmt and ieee80211_is_first_frag in the tx status path. This makes the code easier to read and allows us to remove two local variables: frag and type. Signed-off-by: Helmut Schaa <helmut.schaa@googlemail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/status.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/net/mac80211/status.c b/net/mac80211/status.c
index 46222ce0e5b..30c265c98f7 100644
--- a/net/mac80211/status.c
+++ b/net/mac80211/status.c
@@ -340,7 +340,6 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
340 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; 340 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
341 struct ieee80211_local *local = hw_to_local(hw); 341 struct ieee80211_local *local = hw_to_local(hw);
342 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); 342 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
343 u16 frag, type;
344 __le16 fc; 343 __le16 fc;
345 struct ieee80211_supported_band *sband; 344 struct ieee80211_supported_band *sband;
346 struct ieee80211_sub_if_data *sdata; 345 struct ieee80211_sub_if_data *sdata;
@@ -476,12 +475,8 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
476 * Fragments are passed to low-level drivers as separate skbs, so these 475 * Fragments are passed to low-level drivers as separate skbs, so these
477 * are actually fragments, not frames. Update frame counters only for 476 * are actually fragments, not frames. Update frame counters only for
478 * the first fragment of the frame. */ 477 * the first fragment of the frame. */
479
480 frag = le16_to_cpu(hdr->seq_ctrl) & IEEE80211_SCTL_FRAG;
481 type = le16_to_cpu(hdr->frame_control) & IEEE80211_FCTL_FTYPE;
482
483 if (info->flags & IEEE80211_TX_STAT_ACK) { 478 if (info->flags & IEEE80211_TX_STAT_ACK) {
484 if (frag == 0) { 479 if (ieee80211_is_first_frag(hdr->seq_ctrl)) {
485 local->dot11TransmittedFrameCount++; 480 local->dot11TransmittedFrameCount++;
486 if (is_multicast_ether_addr(hdr->addr1)) 481 if (is_multicast_ether_addr(hdr->addr1))
487 local->dot11MulticastTransmittedFrameCount++; 482 local->dot11MulticastTransmittedFrameCount++;
@@ -496,11 +491,11 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
496 * with a multicast address in the address 1 field of type Data 491 * with a multicast address in the address 1 field of type Data
497 * or Management. */ 492 * or Management. */
498 if (!is_multicast_ether_addr(hdr->addr1) || 493 if (!is_multicast_ether_addr(hdr->addr1) ||
499 type == IEEE80211_FTYPE_DATA || 494 ieee80211_is_data(fc) ||
500 type == IEEE80211_FTYPE_MGMT) 495 ieee80211_is_mgmt(fc))
501 local->dot11TransmittedFragmentCount++; 496 local->dot11TransmittedFragmentCount++;
502 } else { 497 } else {
503 if (frag == 0) 498 if (ieee80211_is_first_frag(hdr->seq_ctrl))
504 local->dot11FailedCount++; 499 local->dot11FailedCount++;
505 } 500 }
506 501
@@ -572,7 +567,7 @@ void ieee80211_tx_status(struct ieee80211_hw *hw, struct sk_buff *skb)
572 567
573 /* Need to make a copy before skb->cb gets cleared */ 568 /* Need to make a copy before skb->cb gets cleared */
574 send_to_cooked = !!(info->flags & IEEE80211_TX_CTL_INJECTED) || 569 send_to_cooked = !!(info->flags & IEEE80211_TX_CTL_INJECTED) ||
575 (type != IEEE80211_FTYPE_DATA); 570 !(ieee80211_is_data(fc));
576 571
577 /* 572 /*
578 * This is a bit racy but we can avoid a lot of work 573 * This is a bit racy but we can avoid a lot of work