aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas_tf
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2008-08-25 17:06:32 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-08-29 16:24:11 -0400
commitde9cc7a4e6f975ca5e91cf8745b3e35a7e780bae (patch)
tree2ccef2639b4b5c1e1ea2f50ac67561eebb2216f9 /drivers/net/wireless/libertas_tf
parent15635744484d4255778fc641261be27179c51f9a (diff)
libertas: use the common frame control functions
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas_tf')
-rw-r--r--drivers/net/wireless/libertas_tf/main.c20
1 files changed, 8 insertions, 12 deletions
diff --git a/drivers/net/wireless/libertas_tf/main.c b/drivers/net/wireless/libertas_tf/main.c
index 2c1d680d2c55..c948021bff6a 100644
--- a/drivers/net/wireless/libertas_tf/main.c
+++ b/drivers/net/wireless/libertas_tf/main.c
@@ -477,9 +477,9 @@ int lbtf_rx(struct lbtf_private *priv, struct sk_buff *skb)
477{ 477{
478 struct ieee80211_rx_status stats; 478 struct ieee80211_rx_status stats;
479 struct rxpd *prxpd; 479 struct rxpd *prxpd;
480 bool is_qos, is_4addr, is_amsdu, need_padding; 480 int need_padding;
481 unsigned int flags; 481 unsigned int flags;
482 u16 fc, fc_le; 482 struct ieee80211_hdr *hdr;
483 483
484 prxpd = (struct rxpd *) skb->data; 484 prxpd = (struct rxpd *) skb->data;
485 485
@@ -497,19 +497,15 @@ int lbtf_rx(struct lbtf_private *priv, struct sk_buff *skb)
497 stats.rate_idx = prxpd->rx_rate; 497 stats.rate_idx = prxpd->rx_rate;
498 skb_pull(skb, sizeof(struct rxpd)); 498 skb_pull(skb, sizeof(struct rxpd));
499 499
500 fc_le = *((__le16 *) skb->data); 500 hdr = (struct ieee80211_hdr *)skb->data;
501 fc = le16_to_cpu(fc_le);
502 flags = le32_to_cpu(*(__le32 *)(skb->data + 4)); 501 flags = le32_to_cpu(*(__le32 *)(skb->data + 4));
503 502
504 is_qos = ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA) && 503 need_padding = ieee80211_is_data_qos(hdr->frame_control);
505 (fc & IEEE80211_STYPE_QOS_DATA); 504 need_padding ^= ieee80211_has_a4(hdr->frame_control);
506 is_4addr = (fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) == 505 need_padding ^= ieee80211_is_data_qos(hdr->frame_control) &&
507 (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS); 506 (*ieee80211_get_qos_ctl(hdr) &
508 is_amsdu = ((fc & 0x8C) == 0x88) && 507 IEEE80211_QOS_CONTROL_A_MSDU_PRESENT);
509 (*(skb->data + ieee80211_hdrlen(fc_le) - QOS_CONTROL_LEN)
510 & IEEE80211_QOS_CONTROL_A_MSDU_PRESENT);
511 508
512 need_padding = is_qos ^ is_4addr ^ is_amsdu;
513 if (need_padding) { 509 if (need_padding) {
514 memmove(skb->data + 2, skb->data, skb->len); 510 memmove(skb->data + 2, skb->data, skb->len);
515 skb_reserve(skb, 2); 511 skb_reserve(skb, 2);