summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Kleine-Budde <mkl@pengutronix.de>2006-02-22 15:14:57 +0000
committerMarc Kleine-Budde <mkl@pengutronix.de>2006-02-22 15:14:57 +0000
commit4e5c20dab63cb97c30ea8279fc145330171131e3 (patch)
tree934786b3000cddc534b4e43616fe592b39dbb877
parentd8f198b0d1209daf3641a904eaf58cf7b8e8d856 (diff)
downloadcanutils-4e5c20dab63cb97c30ea8279fc145330171131e3.tar.gz
* include/socket-can/can.h:
new AF_CAN git-svn-id: https://iocaste.extern.pengutronix.de/svn/canutils/trunks/canutils-1.1-trunk@59 5fd5a299-6ef2-0310-aa18-8b01d7c39d8c
-rw-r--r--configure.ac2
-rw-r--r--include/socket-can/can.h5
-rw-r--r--src/canconfig.c76
3 files changed, 42 insertions, 41 deletions
diff --git a/configure.ac b/configure.ac
index b1328e9..60b2692 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
-AC_INIT([canutils], [1.0.6], [socket-can@pengutronix.de])
+AC_INIT([canutils], [1.1.0], [socket-can@pengutronix.de])
AC_CONFIG_HEADERS([include/can_config.h])
AC_CONFIG_SRCDIR([src/canconfig.c])
AC_CONFIG_MACRO_DIR([config/m4])
diff --git a/include/socket-can/can.h b/include/socket-can/can.h
index 77e309e..507cfd7 100644
--- a/include/socket-can/can.h
+++ b/include/socket-can/can.h
@@ -1,7 +1,7 @@
/*
* can.h (userspace)
*
- * Copyright (C) 2004, 2005
+ * Copyright (C) 2004, 2005, 2006
*
* - Robert Schwebel, Benedikt Spranger, Marc Kleine-Budde, Pengutronix
*
@@ -202,7 +202,7 @@ union can_settings {
};
-#define AF_CAN 30 /* CAN Bus */
+#define AF_CAN 29 /* CAN Bus */
#define PF_CAN AF_CAN
enum CAN_PROTO {
@@ -236,6 +236,7 @@ struct can_filter {
uint32_t can_id;
uint32_t can_mask;
};
+
#define SO_CAN_SET_FILTER 1
#define SO_CAN_UNSET_FILTER 2
diff --git a/src/canconfig.c b/src/canconfig.c
index 9207fe5..d481ce2 100644
--- a/src/canconfig.c
+++ b/src/canconfig.c
@@ -91,18 +91,18 @@ speed_t can_value_to_baud(unsigned long value)
void help(void)
{
- fprintf(stderr, "usage:\n\t"
- "canconfig <dev> baudrate { BR | BTR }\n\t\t"
- "BR := { 10 | 20 | 50 | 100 | 125 | 250 | 500 | 800 | 1000 }\n\t\t"
- "BTR := btr_sja1000 <brp> <sjw> <tseg1> <tseg2> <sam>\n\t\t"
- "BTR := btr_c_can <brp> <sjw> <tseg1> <tseg2>\n\t\t"
- "BTR := btr_nios <prescale> <timea> <timeb>\n\t"
- "canconfig <dev> mode MODE\n\t\t"
- "MODE := { start }\n\t"
- "canconfig <dev> state\n"
- );
-
- exit(EXIT_FAILURE);
+ fprintf(stderr, "usage:\n\t"
+ "canconfig <dev> baudrate { BR | BTR }\n\t\t"
+ "BR := { 10 | 20 | 50 | 100 | 125 | 250 | 500 | 800 | 1000 }\n\t\t"
+ "BTR := btr_sja1000 <brp> <sjw> <tseg1> <tseg2> <sam>\n\t\t"
+ "BTR := btr_c_can <brp> <sjw> <tseg1> <tseg2>\n\t\t"
+ "BTR := btr_nios <prescale> <timea> <timeb>\n\t"
+ "canconfig <dev> mode MODE\n\t\t"
+ "MODE := { start }\n\t"
+ "canconfig <dev> state\n"
+ );
+
+ exit(EXIT_FAILURE);
}
@@ -118,32 +118,32 @@ void do_show_baudrate(int argc, char* argv[])
}
switch (br->baudrate) {
- case CAN_BAUD_BTR_SJA1000:
- fprintf(stdout, "%s: sja1000 brp=%d sjw=%d tseg1=%d tseg2=%d sam=%d\n",
- ifr.ifr_name,
- br->btr.sja1000.brp,
- br->btr.sja1000.sjw,
- br->btr.sja1000.tseg1,
- br->btr.sja1000.tseg2,
- br->btr.sja1000.sam);
- break;
- case CAN_BAUD_BTR_C_CAN:
- fprintf(stdout, "%s: C-Can brp=%d sjw=%d tseg1=%d tseg2=%d\n",
- ifr.ifr_name,
- br->btr.c_can.brp,
- br->btr.c_can.sjw,
- br->btr.c_can.tseg1,
- br->btr.c_can.tseg2);
- break;
- case CAN_BAUD_BTR_NIOS:
- fprintf(stdout, "%s: nios prescale=%d timea=%d timeb=%d\n",
- ifr.ifr_name,
- br->btr.nios.prescale,
- br->btr.nios.timea,
- br->btr.nios.timeb);
- break;
- default:
- value = can_baud_to_value(br->baudrate);
+ case CAN_BAUD_BTR_SJA1000:
+ fprintf(stdout, "%s: sja1000 brp=%d sjw=%d tseg1=%d tseg2=%d sam=%d\n",
+ ifr.ifr_name,
+ br->btr.sja1000.brp,
+ br->btr.sja1000.sjw,
+ br->btr.sja1000.tseg1,
+ br->btr.sja1000.tseg2,
+ br->btr.sja1000.sam);
+ break;
+ case CAN_BAUD_BTR_C_CAN:
+ fprintf(stdout, "%s: C-Can brp=%d sjw=%d tseg1=%d tseg2=%d\n",
+ ifr.ifr_name,
+ br->btr.c_can.brp,
+ br->btr.c_can.sjw,
+ br->btr.c_can.tseg1,
+ br->btr.c_can.tseg2);
+ break;
+ case CAN_BAUD_BTR_NIOS:
+ fprintf(stdout, "%s: nios prescale=%d timea=%d timeb=%d\n",
+ ifr.ifr_name,
+ br->btr.nios.prescale,
+ br->btr.nios.timea,
+ br->btr.nios.timeb);
+ break;
+ default:
+ value = can_baud_to_value(br->baudrate);
if (value != 0)
fprintf(stdout,
"%s: baudrate %d\n", ifr.ifr_name, value);