]> rtime.felk.cvut.cz Git - socketcan-devel.git/commitdiff
Get rid of ioctl.h for the new CAN drivers
authorwolf <wolf@030b6a49-0b11-0410-94ab-b0dab22257f2>
Thu, 12 Jun 2008 12:41:05 +0000 (12:41 +0000)
committerwolf <wolf@030b6a49-0b11-0410-94ab-b0dab22257f2>
Thu, 12 Jun 2008 12:41:05 +0000 (12:41 +0000)
This patch gets rid of include/linux/can/ioctl.h for the new
CAN device interface and drivers. The definitions have been
moved temporarily to include/linux/can/dev.h. Further cleanup
will follow when the bit timing code is updated. The ioctl.h
file has not been deleted, because it's still used by the old
CAN drivers.

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
git-svn-id: svn://svn.berlios.de//socketcan/trunk@782 030b6a49-0b11-0410-94ab-b0dab22257f2

kernel/2.6/drivers/net/can/sja1000/sja1000.c
kernel/2.6/include/linux/can/dev.h

index d4050ad114adf1aedd04c9cc50a1392a6f1af7a5..d3712b1418d2b3eb161396e9885287ae2d553136 100644 (file)
@@ -65,7 +65,6 @@
 #include <linux/can/dev.h>
 #include <linux/can/error.h>
 #include <linux/can/dev.h>
-#include <linux/can/ioctl.h>   /* for struct can_device_stats */
 
 #include "sja1000.h"
 
index d7ef8b5dcdc42e7ca1e2f036239acc3ddc82112f..aee866d1bfb343981832846e43d0871e646333d1 100644 (file)
 
 #include <linux/version.h>
 #include <linux/can/error.h>
-#include <linux/can/ioctl.h>
 
+/*
+ * CAN bitrate
+ */
+#define CAN_BITRATE_UNCONFIGURED       ((__u32) 0xFFFFFFFFU)
+#define CAN_BITRATE_UNKNOWN            0
+#define CAN_BITRATE_DEFAULT            500000
+
+/*
+ * CAN custom bit time
+ */
+enum can_bittimes {
+       CAN_BITTIME_STD,
+       CAN_BITTIME_BTR
+};
+
+/* TSEG1 of controllers usually is a sum of synch_seg (always 1),
+ * prop_seg and phase_seg1, TSEG2 = phase_seg2 */
+
+struct can_bittime_std {
+       __u32 brp;        /* baud rate prescaler */
+       __u8  prop_seg;   /* from 1 to 8 */
+       __u8  phase_seg1; /* from 1 to 8 */
+       __u8  phase_seg2; /* from 1 to 8 */
+       __u8  sjw:7;      /* from 1 to 4 */
+       __u8  sam:1;      /* 1 - enable triple sampling */
+};
+
+struct can_bittime_btr {
+       __u8  btr0;
+       __u8  btr1;
+};
+
+struct can_bittime {
+       enum can_bittimes type;
+       union {
+               struct can_bittime_std std;
+               struct can_bittime_btr btr;
+       };
+};
+
+/*
+ * CAN mode
+ */
+enum can_mode {
+       CAN_MODE_STOP = 0,
+       CAN_MODE_START,
+       CAN_MODE_SLEEP
+};
+
+/*
+ * CAN controller mode
+ */
+#define CAN_CTRLMODE_LOOPBACK   0x1
+#define CAN_CTRLMODE_LISTENONLY 0x2
+
+/*
+ * CAN operational and error states
+ */
+enum can_state {
+       CAN_STATE_ACTIVE = 0,
+       CAN_STATE_BUS_WARNING,
+       CAN_STATE_BUS_PASSIVE,
+       CAN_STATE_BUS_OFF,
+       CAN_STATE_STOPPED,
+       CAN_STATE_SLEEPING
+};
+
+/*
+ * CAN device statistics
+ */
+struct can_device_stats {
+       int error_warning;
+       int data_overrun;
+       int wakeup;
+       int bus_error;
+       int error_passive;
+       int arbitration_lost;
+       int restarts;
+       int bus_error_at_init;
+};
+
+/*
+ * CAN common private data
+ */
 #define CAN_ECHO_SKB_MAX  4
 
 struct can_priv {