netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH]: can: Add documentation for virtual CAN driver usage
@ 2008-09-23 17:28 Oliver Hartkopp
  2008-09-23 21:53 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Oliver Hartkopp @ 2008-09-23 17:28 UTC (permalink / raw)
  To: Linux Netdev List, David Miller; +Cc: Urs Thuermann

[-- Attachment #1: Type: text/plain, Size: 411 bytes --]

From: Oliver Hartkopp <oliver@hartkopp.net>

This patch adds a usage documentation for the virtual CAN driver (vcan).

Signed-off-by: Oliver Hartkopp <oliver@hartkopp.net>
---

Hello Dave,

the virtual CAN netdevices are created via the netlink interface since 
Kerenel 2.6.24.
This patch adds some examples how to create and remove vcans via the 
ip(8) tool.
Please consider for net-next-2.6

Thanks,
Oliver



[-- Attachment #2: vcan-documentation.patch --]
[-- Type: text/x-patch, Size: 2668 bytes --]

diff --git a/Documentation/networking/can.txt b/Documentation/networking/can.txt
index 297ba7b..2035bc4 100644
--- a/Documentation/networking/can.txt
+++ b/Documentation/networking/can.txt
@@ -35,8 +35,9 @@ This file contains
     6.1 general settings
     6.2 local loopback of sent frames
     6.3 CAN controller hardware filters
-    6.4 currently supported CAN hardware
-    6.5 todo
+    6.4 The virtual CAN driver (vcan)
+    6.5 currently supported CAN hardware
+    6.6 todo
 
   7 Credits
 
@@ -584,7 +585,42 @@ solution for a couple of reasons:
   @133MHz with four SJA1000 CAN controllers from 2002 under heavy bus
   load without any problems ...
 
-  6.4 currently supported CAN hardware (September 2007)
+  6.4 The virtual CAN driver (vcan)
+
+  Similar to the network loopback devices, vcan offers a virtual local
+  CAN interface. A full qualified address on CAN consists of
+
+  - a unique CAN Identifier (CAN ID)
+  - the CAN bus this CAN ID is transmitted on (e.g. can0)
+
+  so in common use cases more than one virtual CAN interface is needed.
+
+  The virtual CAN interfaces allow the transmission and reception of CAN
+  frames without real CAN controller hardware. Virtual CAN network
+  devices are usually named 'vcanX', like vcan0 vcan1 vcan2 ...
+  When compiled as a module the virtual CAN driver module is called vcan.ko
+
+  Since Linux Kernel version 2.6.24 the vcan driver supports the Kernel
+  netlink interface to create vcan network devices. The creation and
+  removal of vcan network devices can be managed with the ip(8) tool:
+
+  - Create a virtual CAN network interface:
+       ip link add type vcan
+
+  - Create a virtual CAN network interface with a specific name 'vcan42':
+       ip link add dev vcan42 type vcan
+
+  - Remove a (virtual CAN) network interface 'vcan42':
+       ip link del vcan42
+
+  The tool 'vcan' from the SocketCAN SVN repository on BerliOS is obsolete.
+
+  Virtual CAN network device creation in older Kernels:
+  In Linux Kernel versions < 2.6.24 the vcan driver creates 4 vcan
+  netdevices at module load time by default. This value can be changed
+  with the module parameter 'numdev'. E.g. 'modprobe vcan numdev=8'
+
+  6.5 currently supported CAN hardware
 
   On the project website http://developer.berlios.de/projects/socketcan
   there are different drivers available:
@@ -603,7 +639,7 @@ solution for a couple of reasons:
 
   Please check the Mailing Lists on the berlios OSS project website.
 
-  6.5 todo (September 2007)
+  6.6 todo
 
   The configuration interface for CAN network drivers is still an open
   issue that has not been finalized in the socketcan project. Also the

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH]: can: Add documentation for virtual CAN driver usage
  2008-09-23 17:28 [PATCH]: can: Add documentation for virtual CAN driver usage Oliver Hartkopp
@ 2008-09-23 21:53 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2008-09-23 21:53 UTC (permalink / raw)
  To: oliver; +Cc: netdev, urs

From: Oliver Hartkopp <oliver@hartkopp.net>
Date: Tue, 23 Sep 2008 19:28:42 +0200

> From: Oliver Hartkopp <oliver@hartkopp.net>
> 
> This patch adds a usage documentation for the virtual CAN driver (vcan).
> 
> Signed-off-by: Oliver Hartkopp <oliver@hartkopp.net>
> ---
> 
> Hello Dave,
> 
> the virtual CAN netdevices are created via the netlink interface since Kerenel 2.6.24.
> This patch adds some examples how to create and remove vcans via the ip(8) tool.
> Please consider for net-next-2.6

Applied, thanks Oliver.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-09-23 21:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-23 17:28 [PATCH]: can: Add documentation for virtual CAN driver usage Oliver Hartkopp
2008-09-23 21:53 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).