else
-CPPFLAGS += -Idrivers/net -Inet
-AFLAGS += -Idrivers/net -Inet
-CFLAGS += -Idrivers/net -Inet
+CPPFLAGS += -Idrivers/net -Inet -I/home/ethuerm/src/socketcan/trunk/kernel/2.6/include
+#AFLAGS += -Idrivers/net -Inet
+#CFLAGS += -Idrivers/net -Inet
ifneq ($(KBUILD_EXTMOD),)
EXTRA_CFLAGS += -I$(KBUILD_EXTMOD)/../../../include
#include <linux/skbuff.h>
#include <asm/io.h>
-#include <linux/can/can.h>
-#include <linux/can/can_ioctl.h> /* for struct can_device_stats */
+#include <linux/can.h>
+#include <linux/can/ioctl.h> /* for struct can_device_stats */
#include "sja1000.h"
#define MAX_CAN 8
#include <linux/skbuff.h>
#include <asm/io.h>
-#include <linux/can/can.h>
-#include <linux/can/can_ioctl.h> /* for struct can_device_stats */
+#include <linux/can.h>
+#include <linux/can/ioctl.h> /* for struct can_device_stats */
#include "sja1000.h"
#define MAX_CAN 8
#include <linux/proc_fs.h>
#include <linux/netdevice.h>
-#include <linux/can/can.h>
-#include <linux/can/can_ioctl.h>
+#include <linux/can.h>
+#include <linux/can/ioctl.h>
#include "sja1000.h"
static struct proc_dir_entry *pde = NULL;
#include <linux/skbuff.h>
#include <asm/io.h>
-#include <linux/can/can.h>
-#include <linux/can/can_ioctl.h>
+#include <linux/can.h>
+#include <linux/can/ioctl.h>
#include "sja1000.h"
#ifdef CONFIG_CAN_DEBUG_DEVICES
*
*/
-#ifndef __SJA1000_H__
-#define __SJA1000_H__
+#ifndef SJA1000_H
+#define SJA1000_H
#define SJA1000_IO_SIZE_BASIC 0x20
#define SJA1000_IO_SIZE_PELICAN 0x80
int set_reset_mode(struct net_device *dev);
-#endif /* __SJA1000_H__ */
+#endif /* SJA1000_H */
#include <linux/skbuff.h>
#include <asm/io.h>
-#include <linux/can/can.h>
-#include <linux/can/can_ioctl.h> /* for struct can_device_stats */
+#include <linux/can.h>
+#include <linux/can/ioctl.h> /* for struct can_device_stats */
#include "sja1000.h"
#define MAX_CAN 8
#include <linux/netdevice.h>
#include <linux/if_arp.h>
-#include <linux/can/af_can.h>
+#include <linux/can.h>
#include <linux/can/version.h>
RCSID("$Id$");
*
*/
-#ifndef AF_CAN_H
-#define AF_CAN_H
+#ifndef CAN_H
+#define CAN_H
-#ifdef __KERNEL__
#include <linux/version.h>
-#include <linux/skbuff.h>
-#include <linux/netdevice.h>
-#include <linux/proc_fs.h>
-#include <linux/if.h>
-#include <linux/list.h>
-#else
-#include <net/if.h>
-#endif
+#include <linux/types.h>
-#include <linux/can/can.h>
+#include <linux/can/error.h>
+#include <linux/can/ioctl.h>
+
+/* controller area network (CAN) kernel definitions */
/* CAN socket protocol family definition */
-/* to be moved to include/linux/socket.h */
-#define PF_CAN 29 /* Controller Area Network */
+#define PF_CAN 29 /* to be moved to include/linux/socket.h */
#define AF_CAN PF_CAN
+/* ethernet protocol identifier */
+#define ETH_P_CAN 0x000C /* to be moved to include/linux/if_ether.h */
+
+/* ARP protocol identifier (dummy type for non ARP hardware) */
+#define ARPHRD_CAN 804 /* to be moved to include/linux/if_arp.h */
+
+
+
+
+/* special address description flags for the CAN_ID */
+#define CAN_EFF_FLAG 0x80000000U /* EFF/SFF is set in the MSB */
+#define CAN_RTR_FLAG 0x40000000U /* remote transmission request */
+#define CAN_ERR_FLAG 0x20000000U /* error frame */
+
+/* valid bits in CAN ID for frame formats */
+#define CAN_SFF_MASK 0x000007FFU /* standard frame format (SFF) */
+#define CAN_EFF_MASK 0x1FFFFFFFU /* extended frame format (EFF) */
+
+typedef __u32 canid_t;
+
+struct can_frame {
+ canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */
+ __u8 can_dlc; /* data length code: 0 .. 8 */
+ __u8 data[8] __attribute__ ((aligned(8)));
+};
+
+
+
/* particular protocols of the protocol family PF_CAN */
#define CAN_RAW 1 /* RAW sockets */
#define CAN_BCM 2 /* Broadcast Manager */
#define CAN_INV_FILTER 0x20000000U /* to be set in can_filter.can_id */
+
+
#ifdef __KERNEL__
#define CAN_PROC_DIR "net/can" /* /proc/... */
unsigned long timeval2jiffies(struct timeval *tv, int round_up);
-void can_debug_skb(struct sk_buff *skb);
-void can_debug_cframe(const char *msg, struct can_frame *cframe, ...);
-
-/* af_can rx dispatcher structures */
-
-struct receiver {
- struct hlist_node list;
- struct rcu_head rcu;
- canid_t can_id;
- canid_t mask;
- unsigned long matches;
- void (*func)(struct sk_buff *, void *);
- void *data;
- char *ident;
-};
-
-struct dev_rcv_lists {
- struct hlist_node list;
- struct rcu_head rcu;
- struct net_device *dev;
- struct hlist_head rx_err;
- struct hlist_head rx_all;
- struct hlist_head rx_fil;
- struct hlist_head rx_inv;
- struct hlist_head rx_sff[0x800];
- struct hlist_head rx_eff;
- int entries;
-};
-
-/* statistic structures */
-
-struct s_stats {
- unsigned long jiffies_init;
-
- unsigned long rx_frames;
- unsigned long tx_frames;
- unsigned long matches;
-
- unsigned long total_rx_rate;
- unsigned long total_tx_rate;
- unsigned long total_rx_match_ratio;
-
- unsigned long current_rx_rate;
- unsigned long current_tx_rate;
- unsigned long current_rx_match_ratio;
-
- unsigned long max_rx_rate;
- unsigned long max_tx_rate;
- unsigned long max_rx_match_ratio;
-
- unsigned long rx_frames_delta;
- unsigned long tx_frames_delta;
- unsigned long matches_delta;
-}; /* can be reset e.g. by can_init_stats() */
-
-struct s_pstats {
- unsigned long stats_reset;
- unsigned long rcv_entries;
- unsigned long rcv_entries_max;
-}; /* persistent statistics */
-
-void can_init_proc(void);
-void can_remove_proc(void);
-
#endif
-#endif /* AF_CAN_H */
+
+#endif /* CAN_H */
*
*/
-#ifndef BCM_H
-#define BCM_H
+#ifndef CAN_BCM_H
+#define CAN_BCM_H
struct bcm_msg_head {
int opcode; /* command */
#define CMD_ERROR 0x8000
-#endif /* BCM_H */
+#endif /* CAN_BCM_H */
*
*/
-#ifndef RAW_H
-#define RAW_H
+#ifndef CAN_RAW_H
+#define CAN_RAW_H
-#include <linux/can/af_can.h>
+#include <linux/can.h>
#define SOL_CAN_RAW (SOL_CAN_BASE + CAN_RAW)
*
*/
-#ifndef VERSION_H
-#define VERSION_H
+#ifndef CAN_VERSION_H
+#define CAN_VERSION_H
#define RCSID(s) asm(".section .rodata.str1.1,\"aMS\",@progbits,1\n\t" \
".string \"" s "\"\n\t.previous\n")
EXTRAVERSION
#define BANNER(name) KERN_INFO name " v" VERSION "\n"
-#endif /* VERSION_H */
+#endif /* CAN_VERSION_H */
#include <net/sock.h>
#include <asm/uaccess.h>
-#include <linux/can/af_can.h>
+#include <linux/can.h>
#include <linux/can/version.h>
+#include "af_can.h"
+
RCSID("$Id$");
*
*/
-#ifndef CAN_H
-#define CAN_H
+#ifndef AF_CAN_H
+#define AF_CAN_H
-#include <linux/types.h>
+#include <linux/skbuff.h>
+#include <linux/netdevice.h>
+#include <linux/list.h>
+#include <linux/rcupdate.h>
-/* controller area network (CAN) kernel definitions */
+#include <linux/can.h>
-/* ethernet protocol identifier */
-#define ETH_P_CAN 0x000C /* to be moved to include/linux/if_ether.h */
+void can_debug_skb(struct sk_buff *skb);
+void can_debug_cframe(const char *msg, struct can_frame *cframe, ...);
-/* ARP protocol identifier (dummy type for non ARP hardware) */
-#define ARPHRD_CAN 804 /* to be moved to include/linux/if_arp.h */
+/* af_can rx dispatcher structures */
+struct receiver {
+ struct hlist_node list;
+ struct rcu_head rcu;
+ canid_t can_id;
+ canid_t mask;
+ unsigned long matches;
+ void (*func)(struct sk_buff *, void *);
+ void *data;
+ char *ident;
+};
-/* special address description flags for the CAN_ID */
-#define CAN_EFF_FLAG 0x80000000U /* EFF/SFF is set in the MSB */
-#define CAN_RTR_FLAG 0x40000000U /* remote transmission request */
-#define CAN_ERR_FLAG 0x20000000U /* error frame */
+struct dev_rcv_lists {
+ struct hlist_node list;
+ struct rcu_head rcu;
+ struct net_device *dev;
+ struct hlist_head rx_err;
+ struct hlist_head rx_all;
+ struct hlist_head rx_fil;
+ struct hlist_head rx_inv;
+ struct hlist_head rx_sff[0x800];
+ struct hlist_head rx_eff;
+ int entries;
+};
-/* valid bits in CAN ID for frame formats */
-#define CAN_SFF_MASK 0x000007FFU /* standard frame format (SFF) */
-#define CAN_EFF_MASK 0x1FFFFFFFU /* extended frame format (EFF) */
+/* statistic structures */
-typedef __u32 canid_t;
+struct s_stats {
+ unsigned long jiffies_init;
-struct can_frame {
- canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */
- __u8 can_dlc; /* data length code: 0 .. 8 */
- __u8 data[8] __attribute__ ((aligned(8)));
-};
+ unsigned long rx_frames;
+ unsigned long tx_frames;
+ unsigned long matches;
+
+ unsigned long total_rx_rate;
+ unsigned long total_tx_rate;
+ unsigned long total_rx_match_ratio;
+
+ unsigned long current_rx_rate;
+ unsigned long current_tx_rate;
+ unsigned long current_rx_match_ratio;
+
+ unsigned long max_rx_rate;
+ unsigned long max_tx_rate;
+ unsigned long max_rx_match_ratio;
+
+ unsigned long rx_frames_delta;
+ unsigned long tx_frames_delta;
+ unsigned long matches_delta;
+}; /* can be reset e.g. by can_init_stats() */
+
+struct s_pstats {
+ unsigned long stats_reset;
+ unsigned long rcv_entries;
+ unsigned long rcv_entries_max;
+}; /* persistent statistics */
+
+void can_init_proc(void);
+void can_remove_proc(void);
-#endif /* CAN_H */
+#endif /* AF_CAN_H */
#include <linux/poll.h>
#include <net/sock.h>
-#include <linux/can/af_can.h>
+#include <linux/can.h>
#include <linux/can/bcm.h>
#include <linux/can/version.h>
+#include "af_can.h"
+
RCSID("$Id$");
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/if_arp.h>
-#include <linux/can/can.h>
+
+#include <linux/can.h>
+
#include "can_device.h"
/*
*
*/
-#ifndef __CAN_DEVICE_H__
-#define __CAN_DEVICE_H__
+#ifndef CAN_DEVICE_H
+#define CAN_DEVICE_H
-#include <linux/can/can_error.h>
-#include <linux/can/can_ioctl.h>
+#include <linux/can/error.h>
+#include <linux/can/ioctl.h>
struct can_device {
struct net_device_stats net_stats;
int can_calc_bit_time(struct can_device *can, u32 baudrate,
struct can_bittime_std *bit_time);
-#endif /* __CAN_DEVICE_H__ */
+#endif /* CAN_DEVICE_H */
#include <linux/list.h>
#include <linux/rcupdate.h>
-#include <linux/can/af_can.h>
#include <linux/can/version.h>
+#include "af_can.h"
+
RCSID("$Id$");
#include <linux/poll.h>
#include <net/sock.h>
-#include <linux/can/af_can.h>
-#include <linux/can/can_error.h>
+#include <linux/can.h>
+#include <linux/can/error.h>
#include <linux/can/raw.h>
#include <linux/can/version.h>
+#include "af_can.h"
+
RCSID("$Id$");