#ifdef CONFIG_AG71XX_AR8216_SUPPORT
void ag71xx_add_ar8216_header(struct ag71xx *ag, struct sk_buff *skb);
-int ag71xx_remove_ar8216_header(struct ag71xx *ag, struct sk_buff *skb);
+int ag71xx_remove_ar8216_header(struct ag71xx *ag, struct sk_buff *skb,
+ int pktlen);
static inline int ag71xx_has_ar8216(struct ag71xx *ag)
{
return ag71xx_get_pdata(ag)->has_ar8216;
}
static inline int ag71xx_remove_ar8216_header(struct ag71xx *ag,
- struct sk_buff *skb)
+ struct sk_buff *skb,
+ int pktlen)
{
return 0;
}
skb->data[1] = 0x80;
}
-int ag71xx_remove_ar8216_header(struct ag71xx *ag,
- struct sk_buff *skb)
+int ag71xx_remove_ar8216_header(struct ag71xx *ag, struct sk_buff *skb,
+ int pktlen)
{
u8 type;
type = skb->data[1] & AR8216_PACKET_TYPE_MASK;
switch (type) {
case AR8216_PACKET_TYPE_NORMAL:
- skb_pull(skb, AR8216_HEADER_LEN);
break;
+
default:
return -EINVAL;
}
+ skb_put(skb, pktlen);
+ skb_pull(skb, AR8216_HEADER_LEN);
return 0;
}
skb_reserve(copy_skb, NET_IP_ALIGN);
skb_copy_from_linear_data(*pskb, copy_skb->data, pktlen);
+ skb_put(copy_skb, pktlen);
+
dev_kfree_skb_any(*pskb);
*pskb = copy_skb;
dev->stats.rx_bytes += pktlen;
if (ag71xx_has_ar8216(ag))
- err = ag71xx_remove_ar8216_header(ag, skb);
+ err = ag71xx_remove_ar8216_header(ag, skb, pktlen);
else
err = ag71xx_rx_copy_skb(ag, &skb, pktlen);
dev->stats.rx_dropped++;
kfree_skb(skb);
} else {
- skb_put(skb, pktlen);
-
skb->dev = dev;
skb->ip_summed = CHECKSUM_NONE;
skb->protocol = eth_type_trans(skb, dev);