]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
Merge tag 'linux-can-next-for-3.15-20140212' of git://gitorious.org/linux-can/linux...
authorDavid S. Miller <davem@davemloft.net>
Thu, 13 Feb 2014 23:16:00 +0000 (18:16 -0500)
committerDavid S. Miller <davem@davemloft.net>
Thu, 13 Feb 2014 23:16:00 +0000 (18:16 -0500)
linux-can-next-for-3.15-20140212

Marc Kleine-Budde says:

====================
this is a pull request of eight patches for net-next/master.

Florian Vaussard contributed a series that merged the sja1000 of_platform
into the platform driver. The of_platform driver is finally removed.
Stephane Grosjean supplied a patch to allocate CANFD skbs. In a patch
by Uwe Kleine-König another missing copyright information was added to
a userspace header. And a patch by Yoann DI RUZZA that adds listen only
mode to the at91_can driver.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
1  2 
drivers/net/can/dev.c

diff --combined drivers/net/can/dev.c
index fc59bc6f040b623fcc57ceb4af0bccad3a38281e,cb584ea003313322913f515338049709e7a0698e..c0563f18372177856783b938408fda260c5be3b1
@@@ -323,10 -323,19 +323,10 @@@ void can_put_echo_skb(struct sk_buff *s
        }
  
        if (!priv->echo_skb[idx]) {
 -              struct sock *srcsk = skb->sk;
  
 -              if (atomic_read(&skb->users) != 1) {
 -                      struct sk_buff *old_skb = skb;
 -
 -                      skb = skb_clone(old_skb, GFP_ATOMIC);
 -                      kfree_skb(old_skb);
 -                      if (!skb)
 -                              return;
 -              } else
 -                      skb_orphan(skb);
 -
 -              skb->sk = srcsk;
 +              skb = can_create_echo_skb(skb);
 +              if (!skb)
 +                      return;
  
                /* make settings for echo to reduce code in irq context */
                skb->protocol = htons(ETH_P_CAN);
@@@ -512,6 -521,30 +512,30 @@@ struct sk_buff *alloc_can_skb(struct ne
  }
  EXPORT_SYMBOL_GPL(alloc_can_skb);
  
+ struct sk_buff *alloc_canfd_skb(struct net_device *dev,
+                               struct canfd_frame **cfd)
+ {
+       struct sk_buff *skb;
+       skb = netdev_alloc_skb(dev, sizeof(struct can_skb_priv) +
+                              sizeof(struct canfd_frame));
+       if (unlikely(!skb))
+               return NULL;
+       skb->protocol = htons(ETH_P_CANFD);
+       skb->pkt_type = PACKET_BROADCAST;
+       skb->ip_summed = CHECKSUM_UNNECESSARY;
+       can_skb_reserve(skb);
+       can_skb_prv(skb)->ifindex = dev->ifindex;
+       *cfd = (struct canfd_frame *)skb_put(skb, sizeof(struct canfd_frame));
+       memset(*cfd, 0, sizeof(struct canfd_frame));
+       return skb;
+ }
+ EXPORT_SYMBOL_GPL(alloc_canfd_skb);
  struct sk_buff *alloc_can_err_skb(struct net_device *dev, struct can_frame **cf)
  {
        struct sk_buff *skb;