changeset 21424:915509b0c716

10945 ddi_regs_map_setup(9F) could clarify rnumber Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com> Reviewed by: Hans Rosenfeld <hans.rosenfeld@joyent.com> Reviewed by: Joshua Clulow <jmc@joyent.com> Reviewed by: Toomas Soome <toomas@me.com> Reviewed by: Gordon Ross <gwr@nexenta.com> Reviewed by: Gergő Doma <domag02@gmail.com> Approved by: Dan McDonald <danmcd@joyent.com>
author Robert Mustacchi <rm@joyent.com>
date Thu, 18 Apr 2019 17:24:11 +0000
parents bf3d3f4f3fdb
children 2520e61c1c15 5e7d7d2fe1ed
files usr/src/man/man9f/ddi_regs_map_setup.9f
diffstat 1 files changed, 27 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/man/man9f/ddi_regs_map_setup.9f	Thu Jan 31 05:09:40 2019 +0000
+++ b/usr/src/man/man9f/ddi_regs_map_setup.9f	Thu Apr 18 17:24:11 2019 +0000
@@ -1,9 +1,10 @@
 '\" te
 .\" Copyright (c) 2004, Sun Microsystems, Inc.
+.\" Copyright 2019, Joyent, Inc.
 .\" 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.
 .\" 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.
 .\" 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]
-.TH DDI_REGS_MAP_SETUP 9F "Nov 18, 2004"
+.TH DDI_REGS_MAP_SETUP 9F "April 18, 2019"
 .SH NAME
 ddi_regs_map_setup \- set up a mapping for a register address space
 .SH SYNOPSIS
@@ -20,11 +21,9 @@
 .fi
 
 .SH INTERFACE LEVEL
-.sp
 .LP
 Solaris \fBDDI\fR specific (Solaris \fBDDI\fR).
 .SH PARAMETERS
-.sp
 .ne 2
 .na
 \fB\fIdip\fR\fR
@@ -39,7 +38,10 @@
 \fB\fIrnumber\fR\fR
 .ad
 .RS 12n
-Index number to the register address space set.
+Index of the desired tuple (0-based) in the register address space set.
+See the
+.B Register Numbers
+section for more information.
 .RE
 
 .sp
@@ -92,7 +94,6 @@
 .RE
 
 .SH DESCRIPTION
-.sp
 .LP
 \fBddi_regs_map_setup()\fR maps in the register set given by \fIrnumber\fR. The
 register number determines which register set is mapped if more than one
@@ -114,8 +115,27 @@
 drivers should not attempt to interpret its value. The handle is used by the
 system to encode information for subsequent data access function calls to
 maintain a consistent view between the host and the device.
+
+.SS Register Numbers
+The \fIreg\fR property is an array of tuples. The size of each tuple
+varies based on the hardware device type. For example, PCI and PCI
+Express devices have one size, while ISA devices have a different size.
+Each tuple describes a register space that indicates a way to
+communicate with the device. The \fIrnumber\fR argument selects which of
+these to use.
+.sp
+.LP
+For example, with PCI and PCI Express devices, the first base address
+register (BAR) with a non-zero value is in \fIrnumber\fR \fB1\fR because
+it is the second tuple in the \fIreg\fR property.  The second BAR with a
+non-zero value is in the third tuple (\fIrnumber\fR \fB2\fR).
+.sp
+.LP
+For a full treatment of the meaning of the \fIreg\fR property for PCI
+devices, see \fBpci\fR(4). For PCI express devices, see \fBpcie\fR(4).
+For ISA devices, see \fBisa\fR(4). For cardbus, see \fBcardbus\fR(4).
+For SBus devices, see \fBsbus\fR(4).
 .SH RETURN VALUES
-.sp
 .LP
 \fBddi_regs_map_setup()\fR returns:
 .sp
@@ -163,11 +183,9 @@
 and \fBDDI_FAILURE\fR. Drivers should check for \fB!=DDI_SUCCESS\fR rather than
 checking for a specific failure value.
 .SH CONTEXT
-.sp
 .LP
 \fBddi_regs_map_setup()\fR must be called from user or kernel context.
 .SH ATTRIBUTES
-.sp
 .LP
 See \fBattributes\fR(5) for descriptions of the following attributes:
 .sp
@@ -183,8 +201,8 @@
 .TE
 
 .SH SEE ALSO
-.sp
 .LP
+\fBcardbus\fR(4), \fBisa\fR(4), \fBpci\fR(4), \fBpcie\fR(4), \fBsbus\fR(4),
 \fBattributes\fR(5), \fBddi_regs_map_free\fR(9F), \fBddi_device_acc_attr\fR(9S)
 .sp
 .LP