title: How do I access(open/read/etc) /dev devices from a kernel module?
body: <p>I have received a driver (PCAN driver for PCI card, using rtdm), that creates /dev/pcan0 and /dev/pcan1 is compiled as a netdev driver.</p>
  
  <p>There are many facilities that come with this driver, but they are all targeted at a user-level program reading CAN messages. What I need however is to read these messages from a kernel module. The PCAN driver doesn't export any variables/functions which means it doesn't provide a kernel-level API for me to use.</p>
  
  <p>I looked briefly at the code and reading from the /dev device and writing to it don't use <code>copy_from_user</code> or <code>copy_to_user</code>. Therefore, I thought it should be safe for me to open the /dev/pcan0 from my kernel module and read from it.</p>
  
  <p>Now my question is, how do I open/read from a /dev device from a kernel module?</p>
  
  <p>P.S. I want to read from the CAN bus from an RTAI real-time thread, do you think that would cause a problem (for example every read passing through linux kernel and thus breaking real-time conditions?)</p>