Merge commit 'dc97a43d4a70c8773a619f11b95b07a787f6f5b7' into merges
[unleashed.git] / share / man / man9p / size.9p
blob74aa9cff8df91f7fc29769491a5f17ed552a5395
1 '\" te
2 .\" Copyright (c) 2008, Sun Microsystems, Inc. All Rights Reserved.
3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
6 .TH SIZE 9P "Jan 23, 2008"
7 .SH NAME
8 size, Nblock, blksize, device-nblocks, device-blksize \- device size properties
9 .SH DESCRIPTION
10 .sp
11 .LP
12 A driver can communicate size information to the system by the values
13 associated with following properties. Size information falls into two
14 categories: device size associated with a \fBdev_info_t\fR node, and minor node
15 size associated with a \fBddi_create_minor_node\fR(9F) \fBdev_t\fR (partition).
16 .sp
17 .LP
18 device size property names:
19 .sp
20 .ne 2
21 .na
22 \fB\fBdevice-nblocks\fR\fR
23 .ad
24 .RS 18n
25 An \fBint64_t\fR property representing device size in
26 \fBdevice-blksize\fRblocks.
27 .RE
29 .sp
30 .ne 2
31 .na
32 \fB\fBdevice-blksize\fR\fR
33 .ad
34 .RS 18n
35 An integer property representing the size in bytes of a block. If defined, the
36 value must be a power of two. If not defined, \fBDEV_BSIZE\fR is implied.
37 .RE
39 .sp
40 .LP
41 minor size property names:
42 .sp
43 .ne 2
44 .na
45 \fB\fBSize\fR\fR
46 .ad
47 .RS 11n
48 An \fBint64_t\fR property representing the size in bytes of a character minor
49 device (\fBS_IFCHR\fR \fBspec_type\fR in ddi_create_minor_node).
50 .RE
52 .sp
53 .ne 2
54 .na
55 \fB\fBNblocks\fR\fR
56 .ad
57 .RS 11n
58 An \fBint64_t\fR property representing the number blocks, in
59 \fBdevice-blksize\fR units, of a block minor device (\fBS_IFBLK\fR
60 \fBspec_type\fR in ddi_create_minor_node).
61 .RE
63 .sp
64 .ne 2
65 .na
66 \fB\fBblksize\fR\fR
67 .ad
68 .RS 11n
69 An integer property representing the size in bytes of a block. If defined, the
70 value must be a power of two. If not defined, \fBDEV_BSIZE\fR is implied.
71 .RE
73 .sp
74 .LP
75 A driver that implements both block and character minor device nodes should
76 support both "Size" and "Nblocks". Typically, the following is true: Size =
77 \fBNblocks\fR * \fBblksize\fR.
78 .sp
79 .LP
80 A driver where all ddi_create_minor_node(9F) calls for a given instance are
81 associated with the same physical block device should implement
82 "\fBdevice-nblocks\fR". If the device has a fixed block size with a value other
83 than \fBDEV_BSIZE\fR then "\fBdevice-blksize\fR" should be implemented.
84 .sp
85 .LP
86 The driver is responsible for ensuring that property values are updated when
87 device, media, or partition sizes change. For each represented item, if its
88 size is know to be zero, the property value should be zero. If its size is
89 unknown, the property should not be defined.
90 .sp
91 .LP
92 A driver may choose to implement size properties within its prop_op(9E)
93 implementation. This reduces system memory since no space is used to store the
94 properties.
95 .sp
96 .LP
97 The DDI property interfaces deal in signed numbers. All Size(9P) values should
98 be considered unsigned. It is the responsibility of the code dealing with the
99 property value to ensure that an unsigned interpretation occurs.
100 .SH ATTRIBUTES
103 See \fBattributes\fR(5) for descriptions of the following attributes:
108 box;
109 c | c
110 l | l .
111 ATTRIBUTE TYPE  ATTRIBUTE VALUE
113 Interface Stability     Committed
116 .SH SEE ALSO
119 attach(9E), detach(9E), prop_op(9E), ddi_create_minor_node(9F),
120 inquiry-vendor-id(9P)
123 \fIWriting Device Drivers\fR