xref: /xnu-8020.140.41/osfmk/man/device_write_async.html (revision 27b03b360a988dfd3dfdf34262bb0042026747cc)
1*27b03b36SApple OSS Distributions<h2>device_write_async</h2>
2*27b03b36SApple OSS Distributions<hr>
3*27b03b36SApple OSS Distributions<p>
4*27b03b36SApple OSS Distributions<strong>System Trap</strong> - Write a sequence of bytes to a device object.
5*27b03b36SApple OSS Distributions<h3>SYNOPSIS</h3>
6*27b03b36SApple OSS Distributions<pre>
7*27b03b36SApple OSS Distributions<strong>kern_return_t   device_write_async</strong>
8*27b03b36SApple OSS Distributions                <strong>(mach_port_t</strong>                             <var>device</var>,
9*27b03b36SApple OSS Distributions                 <strong>mach_port_t</strong>                              <var>queue</var>,
10*27b03b36SApple OSS Distributions                 <strong>mach_port_t</strong>                         <var>request_id</var>,
11*27b03b36SApple OSS Distributions                 <strong>dev_mode_t</strong>                                <var>mode</var>,
12*27b03b36SApple OSS Distributions                 <strong>recnum_t</strong>                                <var>recnum</var>,
13*27b03b36SApple OSS Distributions                 <strong>io_buf_ptr_t</strong>                              <var>data</var>,
14*27b03b36SApple OSS Distributions                 <strong>io_buf_len_t</strong>                      <var>bytes_wanted</var><strong>);</strong>
15*27b03b36SApple OSS Distributions</pre>
16*27b03b36SApple OSS Distributions<h3>PARAMETERS</h3>
17*27b03b36SApple OSS Distributions<dl>
18*27b03b36SApple OSS Distributions<p>
19*27b03b36SApple OSS Distributions<dt> <var>device</var>
20*27b03b36SApple OSS Distributions<dd>
21*27b03b36SApple OSS Distributions[in device send right] A device port to the device to be read.
22*27b03b36SApple OSS Distributions<p>
23*27b03b36SApple OSS Distributions<dt> <var>queue</var>
24*27b03b36SApple OSS Distributions<dd>
25*27b03b36SApple OSS Distributions[in io_done queue send right] The port returned from
26*27b03b36SApple OSS Distributionsio_done_queue_create.
27*27b03b36SApple OSS Distributions<p>
28*27b03b36SApple OSS Distributions<dt> <var>request_id</var>
29*27b03b36SApple OSS Distributions<dd>
30*27b03b36SApple OSS Distributions[in send right] An unique request identifier that will be passed back as
31*27b03b36SApple OSS Distributionspart of the io_done_result structure.
32*27b03b36SApple OSS Distributions<p>
33*27b03b36SApple OSS Distributions<dt> <var>mode</var>
34*27b03b36SApple OSS Distributions<dd>
35*27b03b36SApple OSS Distributions[in scalar] I/O mode value. Meaningful options are:
36*27b03b36SApple OSS Distributions<p>
37*27b03b36SApple OSS Distributions     <dl>
38*27b03b36SApple OSS Distributions<dt> <strong>D_NOWAIT</strong>
39*27b03b36SApple OSS Distributions<dd>
40*27b03b36SApple OSS DistributionsDo not wait if data is unavailable.
41*27b03b36SApple OSS Distributions     </dl>
42*27b03b36SApple OSS Distributions<p>
43*27b03b36SApple OSS Distributions<dt> <var>recnum</var>
44*27b03b36SApple OSS Distributions<dd>
45*27b03b36SApple OSS Distributions[in scalar] Record number to be read.
46*27b03b36SApple OSS Distributions<p>
47*27b03b36SApple OSS Distributions<dt> <var>data</var>
48*27b03b36SApple OSS Distributions<dd>
49*27b03b36SApple OSS Distributions[pointer to in array of bytes] Data bytes to be written.
50*27b03b36SApple OSS Distributions<p>
51*27b03b36SApple OSS Distributions<dt> <var>bytes_wanted</var>
52*27b03b36SApple OSS Distributions<dd>
53*27b03b36SApple OSS Distributions[in scalar] Size of data transfer.
54*27b03b36SApple OSS Distributions</dl>
55*27b03b36SApple OSS Distributions<h3>DESCRIPTION</h3>
56*27b03b36SApple OSS Distributions<p>
57*27b03b36SApple OSS DistributionsThe <strong>device_write_async</strong> function enqueues a write operation for a
58*27b03b36SApple OSS Distributionssequence of bytes to a device object. The meaning of recnum as well as
59*27b03b36SApple OSS Distributionsthe specific operation performed is device dependent.
60*27b03b36SApple OSS Distributions<h3>RETURN VALUES</h3>
61*27b03b36SApple OSS Distributions<p>
62*27b03b36SApple OSS Distributions<strong>device_write_async</strong> returns only invalid parameter errors.
63*27b03b36SApple OSS Distributions<h3>RELATED INFORMATION</h3>
64*27b03b36SApple OSS Distributions<p>
65*27b03b36SApple OSS DistributionsFunctions:
66*27b03b36SApple OSS Distributions<a href="device_read_async_inband.html"><strong>device_read_async_inband</strong></a>,
67*27b03b36SApple OSS Distributions<a href="DR_overwrite_async.html"><strong>device_read_overwrite_async</strong></a>,
68*27b03b36SApple OSS Distributions<a href="device_write_async_inband.html"><strong>device_write_async_inband</strong></a>,
69*27b03b36SApple OSS Distributions<a href="io_done_queue_create.html"><strong>io_done_queue_create</strong></a>.
70