Commit de9cc7a4 authored by Harvey Harrison's avatar Harvey Harrison Committed by John W. Linville
Browse files

libertas: use the common frame control functions


Signed-off-by: default avatarHarvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 15635744
...@@ -477,9 +477,9 @@ int lbtf_rx(struct lbtf_private *priv, struct sk_buff *skb) ...@@ -477,9 +477,9 @@ int lbtf_rx(struct lbtf_private *priv, struct sk_buff *skb)
{ {
struct ieee80211_rx_status stats; struct ieee80211_rx_status stats;
struct rxpd *prxpd; struct rxpd *prxpd;
bool is_qos, is_4addr, is_amsdu, need_padding; int need_padding;
unsigned int flags; unsigned int flags;
u16 fc, fc_le; struct ieee80211_hdr *hdr;
prxpd = (struct rxpd *) skb->data; prxpd = (struct rxpd *) skb->data;
...@@ -497,19 +497,15 @@ int lbtf_rx(struct lbtf_private *priv, struct sk_buff *skb) ...@@ -497,19 +497,15 @@ int lbtf_rx(struct lbtf_private *priv, struct sk_buff *skb)
stats.rate_idx = prxpd->rx_rate; stats.rate_idx = prxpd->rx_rate;
skb_pull(skb, sizeof(struct rxpd)); skb_pull(skb, sizeof(struct rxpd));
fc_le = *((__le16 *) skb->data); hdr = (struct ieee80211_hdr *)skb->data;
fc = le16_to_cpu(fc_le);
flags = le32_to_cpu(*(__le32 *)(skb->data + 4)); flags = le32_to_cpu(*(__le32 *)(skb->data + 4));
is_qos = ((fc & IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_DATA) && need_padding = ieee80211_is_data_qos(hdr->frame_control);
(fc & IEEE80211_STYPE_QOS_DATA); need_padding ^= ieee80211_has_a4(hdr->frame_control);
is_4addr = (fc & (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) == need_padding ^= ieee80211_is_data_qos(hdr->frame_control) &&
(IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS); (*ieee80211_get_qos_ctl(hdr) &
is_amsdu = ((fc & 0x8C) == 0x88) && IEEE80211_QOS_CONTROL_A_MSDU_PRESENT);
(*(skb->data + ieee80211_hdrlen(fc_le) - QOS_CONTROL_LEN)
& IEEE80211_QOS_CONTROL_A_MSDU_PRESENT);
need_padding = is_qos ^ is_4addr ^ is_amsdu;
if (need_padding) { if (need_padding) {
memmove(skb->data + 2, skb->data, skb->len); memmove(skb->data + 2, skb->data, skb->len);
skb_reserve(skb, 2); skb_reserve(skb, 2);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment