forked from apple/darwin-xnu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdevice_write.html
98 lines (92 loc) · 3.21 KB
/
device_write.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<h2>device_write</h2>
<hr>
<p>
<strong>Function</strong> - Write a sequence of bytes to a specific device.
<h3>SYNOPSIS</h3>
<pre>
<strong>#include<device/device.h></strong>
<strong>kern_return_t device_write</strong>
<strong>(device_t</strong> <var>device</var>,
<strong>mach_port_t</strong> <var>reply_port</var>,
<strong>dev_mode_t</strong> <var>mode</var>,
<strong>recnum_t</strong> <var>recnum</var>,
<strong>io_buf_ptr_t</strong> <var>data</var>,
<strong>mach_msg_type_number_t</strong> <var>data_count</var>,
<strong>io_buf_len_t</strong> <var>io_buf_len_t</var><strong>);</strong>
<strong>#include<device/device_request.h></strong>
<strong>kern_return_t device_write_request</strong>
<strong>(mach_port_t</strong> <var>device</var>,
<strong>mach_port_t</strong> <var>reply_port</var>,
<strong>dev_mode_t</strong> <var>mode</var>,
<strong>recnum_t</strong> <var>recnum</var>,
<strong>io_buf_ptr_t</strong> <var>data</var>,
<strong>mach_msg_type_number_t</strong> <var>data_count</var><strong>);</strong>
<strong>kern_return_t ds_device_write_reply</strong>
<strong>(mach_port_t</strong> <var>reply_port</var>,
<strong>kern_return_t</strong> <var>return_code</var>,
<strong>io_buf_len_t</strong> <var>bytes_written</var><strong>);</strong>
</pre>
<h3>PARAMETERS</h3>
<dl>
<p>
<dt> <var>device</var>
<dd>
[in device send right]
A device port to the device to be written.
<p>
<dt> <var>reply_port</var>
<dd>
[in reply receive (to be converted to send-once) right]
The port to
which the reply message is to be sent.
<p>
<dt> <var>mode</var>
<dd>
[in scalar]
I/O mode value. Meaningful options are:
<dl>
<p>
<dt> <strong>D_NOWAIT</strong>
<dd>
Do not wait for I/O completion.
</dl>
<p>
<dt> <var>recnum</var>
<dd>
[in scalar]
Record number to be written.
<p>
<dt> <var>data</var>
<dd>
[pointer to in array of bytes]
Data bytes to be written.
<p>
<dt> <var>data_count</var>
<dd>
[in scalar]
Number of data bytes to be written.
<p>
<dt> <var>return_code</var>
<dd>
[in scalar]
The return status code from the write.
<p>
<dt> <var>bytes_written</var>
<dd>
[out scalar, in for asynchronous form]
Size of data transfer.
</dl>
<h3>DESCRIPTION</h3>
<p>
The <strong>device_write</strong> function writes a sequence of bytes
to a device object. The
meaning of <var>recnum</var> as well as the specific operation performed is device
dependent.
<h3>RETURN VALUES</h3>
<p>
Only generic errors apply.
<h3>RELATED INFORMATION</h3>
<p>
Functions:
<a href="device_write_inband.html"><strong>device_write_inband</strong></a>,
<a href="device_reply_server.html"><strong>device_reply_server</strong></a>.