remarkable-linux/include/linux/can
Wolfgang Grandegger 7b6856a029 can: provide library functions for skb allocation
This patch makes the private functions alloc_can_skb() and
alloc_can_err_skb() of the at91_can driver public and adapts all
drivers to use these. While making the patch I realized, that
the skb's are *not* setup consistently. It's now done as shown
below:

  skb->protocol = htons(ETH_P_CAN);
  skb->pkt_type = PACKET_BROADCAST;
  skb->ip_summed = CHECKSUM_UNNECESSARY;
  *cf = (struct can_frame *)skb_put(skb, sizeof(struct can_frame));
  memset(*cf, 0, sizeof(struct can_frame));

The frame is zeroed out to avoid uninitialized data to be passed to
user space. Some drivers or library code did not set "pkt_type" or
"ip_summed". Also,  "__constant_htons()" should not be used for
runtime invocations, as pointed out by David Miller.

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-10-20 00:08:01 -07:00
..
platform can: add TI CAN (HECC) driver 2009-10-07 22:02:53 -07:00
bcm.h headers_check fix: can/bcm.h 2009-01-30 19:50:25 +05:30
core.h can: omit unneeded skb_clone() calls 2009-01-06 11:07:54 -08:00
dev.h can: provide library functions for skb allocation 2009-10-20 00:08:01 -07:00
error.h
Kbuild can: CAN Network device driver and Netlink interface 2009-05-18 15:41:41 -07:00
netlink.h can: CAN Network device driver and Netlink interface 2009-05-18 15:41:41 -07:00
raw.h [CAN]: Add raw protocol 2008-01-28 14:54:10 -08:00