title: Linux using a driver from inside a driver
body: <p>I am trying to interface to a microcontroller from my linux box via RS232 serial.</p>
  
  <p>I have written the driver and implemented a protocol b/n pc and microcontroller, which uses a tty(/dev/ttyS0) device already present in the kernel as a module(eg via calling open, close, etc..). However, when I try to compile, it says it cannot find reference to open, write, read etc...</p>
  
  <p>How do I just use an existing device driver from within a driver? Is there something else I need to include?</p>
  
  <p>If not, how can I use the serial port easily from within a driver?</p>
  
  <pre><code>#include &lt;linux/module.h&gt;
  #include &lt;linux/kernel.h&gt;
  #include &lt;linux/fs.h&gt;
  #include &lt;linux/uaccess.h&gt;
  #include &lt;linux/init.h&gt;
  #include &lt;linux/slab.h&gt;
  #include &lt;linux/cdev.h&gt;
  #include &lt;linux/spinlock.h&gt;
  #include &lt;linux/termios.h&gt;
  #include &lt;linux/fcntl.h&gt;
  #include &lt;linux/unistd.h&gt;
  </code></pre>