mac80211: support paged rx SKBs
Mac80211 drivers can now pass paged SKBs to mac80211 via ieee80211_rx{_irqsafe}. The implementation currently use skb_linearize() in a few places i.e. management frame handling, software decryption, defragmentation and A-MSDU process. We will optimize them one by one later. Signed-off-by: Zhu Yi <yi.zhu@intel.com> Cc: Kalle Valo <kalle.valo@iki.fi> Cc: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
This commit is contained in:
@@ -330,11 +330,18 @@ int ieee80211_data_to_8023(struct sk_buff *skb, const u8 *addr,
|
||||
if (iftype == NL80211_IFTYPE_MESH_POINT) {
|
||||
struct ieee80211s_hdr *meshdr =
|
||||
(struct ieee80211s_hdr *) (skb->data + hdrlen);
|
||||
hdrlen += ieee80211_get_mesh_hdrlen(meshdr);
|
||||
/* make sure meshdr->flags is on the linear part */
|
||||
if (!pskb_may_pull(skb, hdrlen + 1))
|
||||
return -1;
|
||||
if (meshdr->flags & MESH_FLAGS_AE_A5_A6) {
|
||||
memcpy(dst, meshdr->eaddr1, ETH_ALEN);
|
||||
memcpy(src, meshdr->eaddr2, ETH_ALEN);
|
||||
skb_copy_bits(skb, hdrlen +
|
||||
offsetof(struct ieee80211s_hdr, eaddr1),
|
||||
dst, ETH_ALEN);
|
||||
skb_copy_bits(skb, hdrlen +
|
||||
offsetof(struct ieee80211s_hdr, eaddr2),
|
||||
src, ETH_ALEN);
|
||||
}
|
||||
hdrlen += ieee80211_get_mesh_hdrlen(meshdr);
|
||||
}
|
||||
break;
|
||||
case cpu_to_le16(IEEE80211_FCTL_FROMDS):
|
||||
@@ -346,9 +353,14 @@ int ieee80211_data_to_8023(struct sk_buff *skb, const u8 *addr,
|
||||
if (iftype == NL80211_IFTYPE_MESH_POINT) {
|
||||
struct ieee80211s_hdr *meshdr =
|
||||
(struct ieee80211s_hdr *) (skb->data + hdrlen);
|
||||
hdrlen += ieee80211_get_mesh_hdrlen(meshdr);
|
||||
/* make sure meshdr->flags is on the linear part */
|
||||
if (!pskb_may_pull(skb, hdrlen + 1))
|
||||
return -1;
|
||||
if (meshdr->flags & MESH_FLAGS_AE_A4)
|
||||
memcpy(src, meshdr->eaddr1, ETH_ALEN);
|
||||
skb_copy_bits(skb, hdrlen +
|
||||
offsetof(struct ieee80211s_hdr, eaddr1),
|
||||
src, ETH_ALEN);
|
||||
hdrlen += ieee80211_get_mesh_hdrlen(meshdr);
|
||||
}
|
||||
break;
|
||||
case cpu_to_le16(0):
|
||||
@@ -357,7 +369,7 @@ int ieee80211_data_to_8023(struct sk_buff *skb, const u8 *addr,
|
||||
break;
|
||||
}
|
||||
|
||||
if (unlikely(skb->len - hdrlen < 8))
|
||||
if (!pskb_may_pull(skb, hdrlen + 8))
|
||||
return -1;
|
||||
|
||||
payload = skb->data + hdrlen;
|
||||
|
Reference in New Issue
Block a user