|
@@ -66,8 +66,9 @@ out_free:
|
|
|
return NULL;
|
|
return NULL;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-static int qca_tag_rcv(struct sk_buff *skb, struct net_device *dev,
|
|
|
|
|
- struct packet_type *pt, struct net_device *orig_dev)
|
|
|
|
|
|
|
+static struct sk_buff *qca_tag_rcv(struct sk_buff *skb, struct net_device *dev,
|
|
|
|
|
+ struct packet_type *pt,
|
|
|
|
|
+ struct net_device *orig_dev)
|
|
|
{
|
|
{
|
|
|
struct dsa_switch_tree *dst = dev->dsa_ptr;
|
|
struct dsa_switch_tree *dst = dev->dsa_ptr;
|
|
|
struct dsa_switch *ds;
|
|
struct dsa_switch *ds;
|
|
@@ -75,13 +76,6 @@ static int qca_tag_rcv(struct sk_buff *skb, struct net_device *dev,
|
|
|
int port;
|
|
int port;
|
|
|
__be16 *phdr, hdr;
|
|
__be16 *phdr, hdr;
|
|
|
|
|
|
|
|
- if (unlikely(!dst))
|
|
|
|
|
- goto out_drop;
|
|
|
|
|
-
|
|
|
|
|
- skb = skb_unshare(skb, GFP_ATOMIC);
|
|
|
|
|
- if (!skb)
|
|
|
|
|
- goto out;
|
|
|
|
|
-
|
|
|
|
|
if (unlikely(!pskb_may_pull(skb, QCA_HDR_LEN)))
|
|
if (unlikely(!pskb_may_pull(skb, QCA_HDR_LEN)))
|
|
|
goto out_drop;
|
|
goto out_drop;
|
|
|
|
|
|
|
@@ -115,22 +109,12 @@ static int qca_tag_rcv(struct sk_buff *skb, struct net_device *dev,
|
|
|
goto out_drop;
|
|
goto out_drop;
|
|
|
|
|
|
|
|
/* Update skb & forward the frame accordingly */
|
|
/* Update skb & forward the frame accordingly */
|
|
|
- skb_push(skb, ETH_HLEN);
|
|
|
|
|
- skb->pkt_type = PACKET_HOST;
|
|
|
|
|
skb->dev = ds->ports[port].netdev;
|
|
skb->dev = ds->ports[port].netdev;
|
|
|
- skb->protocol = eth_type_trans(skb, skb->dev);
|
|
|
|
|
-
|
|
|
|
|
- skb->dev->stats.rx_packets++;
|
|
|
|
|
- skb->dev->stats.rx_bytes += skb->len;
|
|
|
|
|
|
|
|
|
|
- netif_receive_skb(skb);
|
|
|
|
|
-
|
|
|
|
|
- return 0;
|
|
|
|
|
|
|
+ return skb;
|
|
|
|
|
|
|
|
out_drop:
|
|
out_drop:
|
|
|
- kfree_skb(skb);
|
|
|
|
|
-out:
|
|
|
|
|
- return 0;
|
|
|
|
|
|
|
+ return NULL;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
const struct dsa_device_ops qca_netdev_ops = {
|
|
const struct dsa_device_ops qca_netdev_ops = {
|