]> rtime.felk.cvut.cz Git - socketcan-devel.git/commitdiff
reorganized kernel include files:
authorthuermann <thuermann@030b6a49-0b11-0410-94ab-b0dab22257f2>
Tue, 24 Oct 2006 13:49:12 +0000 (13:49 +0000)
committerthuermann <thuermann@030b6a49-0b11-0410-94ab-b0dab22257f2>
Tue, 24 Oct 2006 13:49:12 +0000 (13:49 +0000)
- move code from af_can.h to can.h
- move can.h to include/linux
- rename can_error.h and can_ioctl.h to error.h and ioctl.h
- changed all include directives accordingly

user space programs now include only linux/can.h, and linux/can/{raw,bcm.h}.

git-svn-id: svn://svn.berlios.de//socketcan/trunk@85 030b6a49-0b11-0410-94ab-b0dab22257f2

21 files changed:
kernel/2.6/drivers/net/can/Makefile
kernel/2.6/drivers/net/can/sja1000/isa.c
kernel/2.6/drivers/net/can/sja1000/mem.c
kernel/2.6/drivers/net/can/sja1000/proc.c
kernel/2.6/drivers/net/can/sja1000/sja1000.c
kernel/2.6/drivers/net/can/sja1000/sja1000.h
kernel/2.6/drivers/net/can/sja1000/trajet-gw2.c
kernel/2.6/drivers/net/can/vcan.c
kernel/2.6/include/linux/can.h [moved from kernel/2.6/include/linux/can/af_can.h with 70% similarity]
kernel/2.6/include/linux/can/bcm.h
kernel/2.6/include/linux/can/error.h [moved from kernel/2.6/include/linux/can/can_error.h with 100% similarity]
kernel/2.6/include/linux/can/ioctl.h [moved from kernel/2.6/include/linux/can/can_ioctl.h with 100% similarity]
kernel/2.6/include/linux/can/raw.h
kernel/2.6/include/linux/can/version.h
kernel/2.6/net/can/af_can.c
kernel/2.6/net/can/af_can.h [moved from kernel/2.6/include/linux/can/can.h with 57% similarity]
kernel/2.6/net/can/bcm.c
kernel/2.6/net/can/can_device.c
kernel/2.6/net/can/can_device.h
kernel/2.6/net/can/proc.c
kernel/2.6/net/can/raw.c

index 450b8e85e622bc4115a1645ff4ae07594f431133..ca6497e00ed85c6ea3c48b38a73dd34d35562d7c 100644 (file)
@@ -26,9 +26,9 @@ clean:
 
 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
index ee67cb5e070ef3de394ee465b0f2db6489ace41d..35e2d4637130f4beb5759e8b47415513b3009c7d 100644 (file)
@@ -61,8 +61,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
index 19e961b37745354fa2b926fb2e8bdb1af4f5a407..f7b0909f24605428a03a1f31bc6af9a923939023 100644 (file)
@@ -61,8 +61,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
index 03036312b2d5861b3676e17f5f0c5f2625a56cf3..edb5dac01e785a1240676175efc4a36ae310bb76 100644 (file)
@@ -50,8 +50,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;
index 4e8f4ed5993ff1717af689f83132d955ca49dfb2..fdccf5afbf301b92184058c21f8c2d7d6101e37c 100644 (file)
@@ -55,8 +55,8 @@
 #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
index 7897dfec63722efcd719874ba83415869a4e9cdf..939e75cad23c48aa772715390eb3d75772cf6f78 100644 (file)
@@ -47,8 +47,8 @@
  *
  */
 
-#ifndef __SJA1000_H__
-#define __SJA1000_H__
+#ifndef SJA1000_H
+#define SJA1000_H
 
 #define SJA1000_IO_SIZE_BASIC   0x20
 #define SJA1000_IO_SIZE_PELICAN 0x80
@@ -191,4 +191,4 @@ void sja1000_proc_delete(const char *drv_name);
 
 int set_reset_mode(struct net_device *dev);
 
-#endif /* __SJA1000_H__ */
+#endif /* SJA1000_H */
index 5f541e75269c01e967a3e9720bdeb7a13e6a917b..6d8b933d776bebe55a53b56367bc5f59c93e8faf 100644 (file)
@@ -64,8 +64,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
index 32046149a5f2c8d5fbc811707e655ac2373649ff..d4f7cc67ed46d310c2f3858c8dc75ff3cebeed4d 100644 (file)
@@ -48,7 +48,7 @@
 #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$");
similarity index 70%
rename from kernel/2.6/include/linux/can/af_can.h
rename to kernel/2.6/include/linux/can.h
index 3be9f279b36b7f779bd6b69d4a99171e78434a03..94286b5d201912acfe20a55588ff3ce41ff82c6f 100644 (file)
  *
  */
 
-#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 */
@@ -94,6 +116,8 @@ struct can_filter {
 
 #define CAN_INV_FILTER 0x20000000U /* to be set in can_filter.can_id */
 
+
+
 #ifdef __KERNEL__
 
 #define CAN_PROC_DIR "net/can" /* /proc/... */
@@ -127,70 +151,7 @@ int  can_send(struct sk_buff *skb, int loop);
 
 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 */
index 60d6826edf8f510ca151fc9618ae99f7cec4a4be..f405bf71aa549e34ace92a19a0cf09e6a05e8203 100644 (file)
@@ -42,8 +42,8 @@
  *
  */
 
-#ifndef BCM_H
-#define BCM_H
+#ifndef CAN_BCM_H
+#define CAN_BCM_H
 
 struct bcm_msg_head {
        int opcode;                   /* command */
@@ -75,4 +75,4 @@ enum {
 
 #define CMD_ERROR    0x8000
 
-#endif /* BCM_H */
+#endif /* CAN_BCM_H */
index bed7b136cf2507aaf849b943cf86e5e65108588a..058a2be4aadd70dabab9b128949c587fdf02b188 100644 (file)
  *
  */
 
-#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)
 
index 92b75559d78a0ff6c81ba973759ad9bf5b084fba..ddaab32e4625c2f91d8ff2e9abd411a2a6834c20 100644 (file)
@@ -42,8 +42,8 @@
  *
  */
 
-#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")
@@ -69,4 +69,4 @@ RCSID("$Id$");
        EXTRAVERSION
 #define BANNER(name) KERN_INFO name " v" VERSION "\n"
 
-#endif /* VERSION_H */
+#endif /* CAN_VERSION_H */
index f2cd3d63b98b9c61804e2fd9a4c6422410e80457..fabd39e19930a4ba0948e607477b0ce4bc921d50 100644 (file)
 #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$");
 
similarity index 57%
rename from kernel/2.6/include/linux/can/can.h
rename to kernel/2.6/net/can/af_can.h
index 1f3b87d2019cc783f626680839421269bee074fa..1afe485e3fb6d3c9ae52a2e381314e46daab901d 100644 (file)
  *
  */
 
-#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 */
index 15a64c9d0d530f17459ef5d42bbb3cc3345a1f5e..5fbe8b7a33e02c9426db1b2c96be9fed1727f8b0 100644 (file)
 #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$");
 
index d626e75fb62e7f6dbb10a805bcfe8cbc7e0e2421..a4dd6542b9bb54d3d709a4968ce2a8d14e9e3153 100644 (file)
@@ -21,7 +21,9 @@
 #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"
 
 /*
index 450f74f74f677e891ae45236dded0f874939bdbd..153ec9d776d3640f5993c328cdc4977fcff66235 100644 (file)
  *
  */
 
-#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;
@@ -83,4 +83,4 @@ void free_candev(struct can_device *);
 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 */
index 97468d4b9edc6e057547d6de560e7cd90c056bea..99b4e21ca0ea2cc93b6d895b681f7e40cceef759 100644 (file)
 #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$");
 
index e6d35e4b954e6e7be81d1efc1584e4da0ccf21c3..618026d78cd04e3081a33ee0eb4201fac8ee1b97 100644 (file)
 #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$");