summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2012-05-22 15:13:56 -0400
committerEric S. Raymond <esr@thyrsus.com>2012-05-22 15:13:56 -0400
commit0bd96c695ef2d37245669d57fa949eea5c0c9609 (patch)
tree88e455026fc2ee2ab3e58c6ffa42d053ccb60340
parentb840c0c6a14a2b34b97a1edd4f83504ee661ab08 (diff)
downloadgpsd-0bd96c695ef2d37245669d57fa949eea5c0c9609.tar.gz
Add the cansetup script.
-rwxr-xr-xwww/cansetup27
-rw-r--r--www/faq.html.in34
2 files changed, 31 insertions, 30 deletions
diff --git a/www/cansetup b/www/cansetup
new file mode 100755
index 00000000..e8970ff5
--- /dev/null
+++ b/www/cansetup
@@ -0,0 +1,27 @@
+#!/bin/bash
+#
+# cansetup - initialize kernel-CAN interfaces
+#
+candevice=$1
+
+case $candevice in
+plx_pci)
+ # For the SJA1000 based PCI or PCI-Express CAN interface
+ modprobe plx_pci;
+ ip link set can0 up;
+ ip link set can0 type can tq 250 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1;;
+esd_usb2)
+ # For an esd usb/2 CAN interface
+ modprobe esd_usb2;
+ ip link set can0 up;
+ ip link set can0 type can tq 250 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1;;
+vcan)
+ # With this setup, CAN frames can be injected into vcan0 by a test
+ modprobe vcan;
+ ip link add type vcan;
+ ifconfig vcan0 up;;
+*)
+ echo "cansetup: invalid CAN interface $1"
+ exit 1
+esac
+
diff --git a/www/faq.html.in b/www/faq.html.in
index 2a016d88..207c4737 100644
--- a/www/faq.html.in
+++ b/www/faq.html.in
@@ -885,39 +885,13 @@ improve this FAQ.</p>
<p>This feature requires kernel-level support for CAN (Controller Area
Network) hardware. Presently this is available only under Linux using
-the Socket Can subsystem. The nmea2000 driver of gpsd has been tested
+the Socket CAN subsystem. The nmea2000 driver of gpsd has been tested
with 2.6.38 and newer kernels.</p>
<p>GPSD expects your CAN interface to be configured to receive CAN
-data at the nmea2000 baudrate of 250kBit/s. Here are a few example
-scripts that will set this up:</p>
-
-<dl>
-<dt>For SJA1000 based PCI or PCI-Express CAN interface</dt>
-<dd><code><pre>
-#!/bin/sh
-modprobe plx_pci
-ip link set can0 up
-ip link set can0 type can tq 250 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
-</pre></code></dd>
-<dt>For an esd usb/2 CAN interface</dt>
-<dd><code><pre>
-#! /bin/sh
-modprobe esd_usb2
-ip link set can0 up
-ip link set can0 type can tq 250 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
-</pre></code></dd>
-<dt>For a virtual CAN network:</dt>
-<dd><code><pre>
-#! /bin/sh
-modprobe vcan
-ip link add type vcan
-ifconfig vcan0 up
-</pre></code>
-<p>With this setup, CAN frames can be injected into vcan0 by a test
-framework such as canplayer.</p>
-</dd>
-</dl>
+data at the nmea2000 baudrate of 250kBit/s. Tou can download an
+<a href="cansetup">example script</a> that will set this up for
+some of the more common interface types.</p>
<hr>
<script src="datestamp.js" type='text/javascript'></script>