Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 215305
b: refs/heads/master
c: c8a16c6
h: refs/heads/master
i:
  215303: b34043f
v: v3
  • Loading branch information
Christian Lamparter authored and John W. Linville committed Oct 11, 2010
1 parent b23e3b9 commit 7e4b4c9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 29 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 12eec2cc0d5eacd8287646585dc88ab558d4866d
refs/heads/master: c8a16c68ef4eb7817e41759c7105678ebc155377
48 changes: 20 additions & 28 deletions trunk/drivers/net/wireless/ath/carl9170/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -598,18 +598,14 @@ static void carl9170_handle_mpdu(struct ar9170 *ar, u8 *buf, int len)
if (!IS_STARTED(ar))
return;

if (unlikely(len < sizeof(*mac))) {
ar->rx_dropped++;
return;
}
if (unlikely(len < sizeof(*mac)))
goto drop;

mpdu_len = len - sizeof(*mac);

mac = (void *)(buf + mpdu_len);
if (unlikely(mac->error & AR9170_RX_ERROR_FATAL)) {
ar->rx_dropped++;
return;
}
if (unlikely(mac->error & AR9170_RX_ERROR_FATAL))
goto drop;

switch (mac->status & AR9170_RX_STATUS_MPDU) {
case AR9170_RX_STATUS_MPDU_FIRST:
Expand Down Expand Up @@ -638,8 +634,7 @@ static void carl9170_handle_mpdu(struct ar9170 *ar, u8 *buf, int len)
"is clipped.\n");
}

ar->rx_dropped++;
return;
goto drop;
}
break;

Expand All @@ -659,8 +654,7 @@ static void carl9170_handle_mpdu(struct ar9170 *ar, u8 *buf, int len)
"is clipped.\n");
}

ar->rx_dropped++;
return;
goto drop;
}

case AR9170_RX_STATUS_MPDU_MIDDLE:
Expand All @@ -672,8 +666,7 @@ static void carl9170_handle_mpdu(struct ar9170 *ar, u8 *buf, int len)
wiphy_err(ar->hw->wiphy, "rx stream does not start "
"with a first_mpdu frame tag.\n");

ar->rx_dropped++;
return;
goto drop;
}

head = &ar->rx_plcp;
Expand All @@ -696,29 +689,28 @@ static void carl9170_handle_mpdu(struct ar9170 *ar, u8 *buf, int len)
}

/* FC + DU + RA + FCS */
if (unlikely(mpdu_len < (2 + 2 + 6 + FCS_LEN))) {
ar->rx_dropped++;
return;
}
if (unlikely(mpdu_len < (2 + 2 + ETH_ALEN + FCS_LEN)))
goto drop;

memset(&status, 0, sizeof(status));
if (unlikely(carl9170_rx_mac_status(ar, head, mac, &status))) {
ar->rx_dropped++;
return;
}
if (unlikely(carl9170_rx_mac_status(ar, head, mac, &status)))
goto drop;

if (phy)
carl9170_rx_phy_status(ar, phy, &status);

carl9170_ps_beacon(ar, buf, mpdu_len);

skb = carl9170_rx_copy_data(buf, mpdu_len);
if (likely(skb)) {
memcpy(IEEE80211_SKB_RXCB(skb), &status, sizeof(status));
ieee80211_rx(ar->hw, skb);
} else {
ar->rx_dropped++;
}
if (!skb)
goto drop;

memcpy(IEEE80211_SKB_RXCB(skb), &status, sizeof(status));
ieee80211_rx(ar->hw, skb);
return;

drop:
ar->rx_dropped++;
}

static void carl9170_rx_untie_cmds(struct ar9170 *ar, const u8 *respbuf,
Expand Down

0 comments on commit 7e4b4c9

Please sign in to comment.