/* * canutils/canconfig.c * * Copyright (C) 2005 Marc Kleine-Budde , Pengutronix * Copyright (C) 2007 Juergen Beisert , Pengutronix * * This program is free software; you can redistribute it and/or modify * it under the terms of the version 2 of the GNU General Public License * as published by the Free Software Foundation * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #ifndef MIN #define MIN(a, b) ((a) < (b) ? (a) : (b)) #endif #define kHz 1000 #define CONFIG_FILE_NAME "/etc/canconfig.conf" #define CONFIG_FILE_NAME_SP "/etc/canconfig-%s.conf" int s; struct ifreq ifr; static void help(void) { fprintf(stderr, "usage:\n\t" "canconfig baudrate { BR }\n\t\t" "BR := \n\t\t" "canconfig mode MODE\n\t\t" "MODE := { start }\n\t" "canconfig setentry [ VALs ]\n\t\t" "VALs := \n\t\t" " bitrate \n\t\t" " tq