]> git.saurik.com Git - apple/xnu.git/blobdiff - osfmk/man/device_open.html
xnu-1228.tar.gz
[apple/xnu.git] / osfmk / man / device_open.html
index 3fd4c350ea735b7246deb6695a2702f00093e363..43bb366d7e9c8cfcbcf7cbe746559f0691bbbcd8 100755 (executable)
@@ -1 +1,112 @@
-<h2>device_open</h2>\r<hr>\r<p>\r<strong>Function</strong> - Establish a connection to a device.\r<h3>SYNOPSIS</h3>\r<pre>\r<strong>#include&ltdevice/device.h&gt</strong>\r\r<strong>kern_return_t   device_open</strong>\r                <strong>(mach_port_t</strong>                        <var>master_port</var>,\r                 <strong>mach_port_t</strong>                             <var>ledger</var>,\r                 <strong>dev_mode_t</strong>                                <var>mode</var>,\r                 <strong>security_token_t</strong>                   <var>security_id</var>,\r                 <strong>dev_name_t</strong>                                <var>name</var>,\r                 <strong>mach_port_t</strong>                             <var>device</var><strong>);</strong>\r\r\r<strong>#include&ltdevice/device_request.h&gt</strong>\r\r<strong>kern_return_t   device_open_request</strong>\r                <strong>(mach_port_t</strong>                        <var>master_port</var>,\r                 <strong>mach_port_t</strong>                         <var>reply_port</var>,\r                 <strong>mach_port_t</strong>                             <var>ledger</var>,\r                 <strong>dev_mode_t</strong>                                <var>mode</var>,\r                 <strong>security_token_t</strong>                   <var>security_id</var>,\r                 <strong>dev_name_t</strong>                                <var>name</var><strong>);</strong>\r\r\r<strong>kern_return_t   ds_device_open_reply</strong>\r                <strong>(mach_port_t</strong>                         <var>reply_port</var>,\r                 <strong>kern_return_t</strong>                      <var>return_code</var>,\r                 <strong>mach_port_t</strong>                             <var>device</var><strong>);</strong>\r</pre>\r<h3>PARAMETERS</h3>\r<dl>\r<p>\r<dt> <var>master_port</var> \r<dd>\r[in device-master send right]\rThe master device port.  This port is\rprovided to the bootstrap task.\r<p>\r<dt> <var>reply_port</var> \r<dd>\r[in reply receive (to be converted to send-once) right]\rThe port to \rwhich a reply is to be sent when the device is open.\r<p>\r<dt> <var>ledger</var> \r<dd>\r[pointer to a ledger send right]\rResource ledger from which the device will draw its resources.\r<p>\r<dt> <var>mode</var> \r<dd>\r[in scalar]\rOpening mode.  This is the bit-wise <strong>OR</strong> of the following\rvalues:\r<dl>\r<p>\r<dt> <strong>D_READ</strong>\r<dd>\rRead access\r<p>\r<dt> <strong>D_WRITE</strong>\r<dd>\rWrite access\r<p>\r<dt> <strong>D_NODELAY</strong>\r<dd>\rDo not delay on open\r</dl>\r<p>\r<dt> <var>security_id</var> \r<dd>\r[in scalar]\rThe security ID that tasks attempting to use this device port \rmust have.  A zero value indicates all identities.\r<p>\r<dt> <var>name</var> \r<dd>\r[pointer to in array of <var>char</var>]\rName of the device to open.\r<p>\r<dt> <var>return_code</var> \r<dd>\r[in scalar]\rStatus of the open.\r<p>\r<dt> <var>device</var> \r<dd>\r[out device send right, in for asynchronous form]\rThe returned device \rport.\r</dl>\r<h3>DESCRIPTION</h3>\r<p>\rThe <strong>device_open</strong> function opens a device object.  The\ropen operation of the\rdevice is invoked, if the device is not already open.  The open\rcount for the device \ris incremented.  Each open for a device returns a port, the allowed\roperations upon which being governed by <var>mode</var>.  The port is not\rdistinct.\r<h3>RETURN VALUES</h3>\r<p>\rOnly generic errors apply.\r<h3>RELATED INFORMATION</h3>\r<p>\rFunctions:\r<a href="device_close.html"><strong>device_close</strong></a>,\r<a href="device_reply_server.html"><strong>device_reply_server</strong></a>.\r
\ No newline at end of file
+<h2>device_open</h2>
+<hr>
+<p>
+<strong>Function</strong> - Establish a connection to a device.
+<h3>SYNOPSIS</h3>
+<pre>
+<strong>#include&ltdevice/device.h&gt</strong>
+
+<strong>kern_return_t   device_open</strong>
+                <strong>(mach_port_t</strong>                        <var>master_port</var>,
+                 <strong>mach_port_t</strong>                             <var>ledger</var>,
+                 <strong>dev_mode_t</strong>                                <var>mode</var>,
+                 <strong>security_token_t</strong>                   <var>security_id</var>,
+                 <strong>dev_name_t</strong>                                <var>name</var>,
+                 <strong>mach_port_t</strong>                             <var>device</var><strong>);</strong>
+
+
+<strong>#include&ltdevice/device_request.h&gt</strong>
+
+<strong>kern_return_t   device_open_request</strong>
+                <strong>(mach_port_t</strong>                        <var>master_port</var>,
+                 <strong>mach_port_t</strong>                         <var>reply_port</var>,
+                 <strong>mach_port_t</strong>                             <var>ledger</var>,
+                 <strong>dev_mode_t</strong>                                <var>mode</var>,
+                 <strong>security_token_t</strong>                   <var>security_id</var>,
+                 <strong>dev_name_t</strong>                                <var>name</var><strong>);</strong>
+
+
+<strong>kern_return_t   ds_device_open_reply</strong>
+                <strong>(mach_port_t</strong>                         <var>reply_port</var>,
+                 <strong>kern_return_t</strong>                      <var>return_code</var>,
+                 <strong>mach_port_t</strong>                             <var>device</var><strong>);</strong>
+</pre>
+<h3>PARAMETERS</h3>
+<dl>
+<p>
+<dt> <var>master_port</var> 
+<dd>
+[in device-master send right]
+The master device port.  This port is
+provided to the bootstrap task.
+<p>
+<dt> <var>reply_port</var> 
+<dd>
+[in reply receive (to be converted to send-once) right]
+The port to 
+which a reply is to be sent when the device is open.
+<p>
+<dt> <var>ledger</var> 
+<dd>
+[pointer to a ledger send right]
+Resource ledger from which the device will draw its resources.
+<p>
+<dt> <var>mode</var> 
+<dd>
+[in scalar]
+Opening mode.  This is the bit-wise <strong>OR</strong> of the following
+values:
+<dl>
+<p>
+<dt> <strong>D_READ</strong>
+<dd>
+Read access
+<p>
+<dt> <strong>D_WRITE</strong>
+<dd>
+Write access
+<p>
+<dt> <strong>D_NODELAY</strong>
+<dd>
+Do not delay on open
+</dl>
+<p>
+<dt> <var>security_id</var> 
+<dd>
+[in scalar]
+The security ID that tasks attempting to use this device port 
+must have.  A zero value indicates all identities.
+<p>
+<dt> <var>name</var> 
+<dd>
+[pointer to in array of <var>char</var>]
+Name of the device to open.
+<p>
+<dt> <var>return_code</var> 
+<dd>
+[in scalar]
+Status of the open.
+<p>
+<dt> <var>device</var> 
+<dd>
+[out device send right, in for asynchronous form]
+The returned device 
+port.
+</dl>
+<h3>DESCRIPTION</h3>
+<p>
+The <strong>device_open</strong> function opens a device object.  The
+open operation of the
+device is invoked, if the device is not already open.  The open
+count for the device 
+is incremented.  Each open for a device returns a port, the allowed
+operations upon which being governed by <var>mode</var>.  The port is not
+distinct.
+<h3>RETURN VALUES</h3>
+<p>
+Only generic errors apply.
+<h3>RELATED INFORMATION</h3>
+<p>
+Functions:
+<a href="device_close.html"><strong>device_close</strong></a>,
+<a href="device_reply_server.html"><strong>device_reply_server</strong></a>.