Sophie

Sophie

distrib > CentOS > 6 > i386 > by-pkgid > 2c51d8eb79f8810ada971ee8c30ce1e5 > files > 2087

kernel-doc-2.6.32-71.14.1.el6.noarch.rpm

<?xml version="1.0" encoding="ANSI_X3.4-1968" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=ANSI_X3.4-1968" /><title>__register_chrdev</title><meta name="generator" content="DocBook XSL Stylesheets V1.75.2" /><link rel="home" href="index.html" title="The Linux Kernel API" /><link rel="up" href="ch15.html" title="Chapter&#160;15.&#160;Char devices" /><link rel="prev" href="re606.html" title="alloc_chrdev_region" /><link rel="next" href="re608.html" title="unregister_chrdev_region" /></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"><span>__register_chrdev</span></th></tr><tr><td width="20%" align="left"><a accesskey="p" href="re606.html">Prev</a>&#160;</td><th width="60%" align="center">Chapter&#160;15.&#160;Char devices</th><td width="20%" align="right">&#160;<a accesskey="n" href="re608.html">Next</a></td></tr></table><hr /></div><div class="refentry" title="__register_chrdev"><a id="API---register-chrdev"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>__register_chrdev &#8212; 
     create and register a cdev occupying a range of minors
 </p></div><div class="refsynopsisdiv" title="Synopsis"><h2>Synopsis</h2><div class="funcsynopsis"><table border="0" summary="Function synopsis" cellspacing="0" cellpadding="0" class="funcprototype-table"><tr><td><code class="funcdef">int <b class="fsfunc">__register_chrdev </b>(</code></td><td>unsigned int <var class="pdparam">major</var>, </td></tr><tr><td>&#160;</td><td>unsigned int <var class="pdparam">baseminor</var>, </td></tr><tr><td>&#160;</td><td>unsigned int <var class="pdparam">count</var>, </td></tr><tr><td>&#160;</td><td>const char * <var class="pdparam">name</var>, </td></tr><tr><td>&#160;</td><td>const struct file_operations * <var class="pdparam">fops</var><code>)</code>;</td></tr></table><div class="funcprototype-spacer">&#160;</div></div></div><div class="refsect1" title="Arguments"><a id="id2712500"></a><h2>Arguments</h2><div class="variablelist"><dl><dt><span class="term"><em class="parameter"><code>major</code></em></span></dt><dd><p>
     major device number or 0 for dynamic allocation
    </p></dd><dt><span class="term"><em class="parameter"><code>baseminor</code></em></span></dt><dd><p>
     first of the requested range of minor numbers
    </p></dd><dt><span class="term"><em class="parameter"><code>count</code></em></span></dt><dd><p>
     the number of minor numbers required
    </p></dd><dt><span class="term"><em class="parameter"><code>name</code></em></span></dt><dd><p>
     name of this range of devices
    </p></dd><dt><span class="term"><em class="parameter"><code>fops</code></em></span></dt><dd><p>
     file operations associated with this devices
    </p></dd></dl></div></div><div class="refsect1" title="Description"><a id="id2712597"></a><h2>Description</h2><p>
   If <em class="parameter"><code>major</code></em> == 0 this functions will dynamically allocate a major and return
   its number.
   </p><p>

   If <em class="parameter"><code>major</code></em> &gt; 0 this function will attempt to reserve a device with the given
   major number and will return zero on success.
   </p><p>

   Returns a -ve errno on failure.
   </p><p>

   The name of this device has nothing to do with the name of the device in
   /dev. It only helps to keep track of the different owners of devices. If
   your module name has only one type of devices it's ok to use e.g. the name
   of the module here.
</p></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="re606.html">Prev</a>&#160;</td><td width="20%" align="center"><a accesskey="u" href="ch15.html">Up</a></td><td width="40%" align="right">&#160;<a accesskey="n" href="re608.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"><span>alloc_chrdev_region</span>&#160;</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">&#160;<span>unregister_chrdev_region</span></td></tr></table></div></body></html>