diff options
author | Keith M Wesolowski <wesolows@foobazco.org> | 2014-06-10 16:16:13 +0000 |
---|---|---|
committer | Keith M Wesolowski <wesolows@foobazco.org> | 2014-06-10 16:16:13 +0000 |
commit | 98036ae248b5558dfccb033a375b49e66402a10f (patch) | |
tree | 4aaf9ee019ba1c84eba90ecbbbcd4795dd7a1b1f | |
parent | 54ecac22392ef70038abf47fbaed589d28c22362 (diff) | |
parent | b89e420ae1290e425c29db875ec0c0546006eec7 (diff) | |
download | illumos-joyent-98036ae248b5558dfccb033a375b49e66402a10f.tar.gz |
[illumos-gate merge]
commit b89e420ae1290e425c29db875ec0c0546006eec7
4888 Undocument dma_req(9s)
4884 EOF scsi_hba_attach
4886 EOF ddi_dmae_getlim
4887 EOF ddi_iomin
4634 undocument scsi_hba_attach() and ddi_dma_lim(9s)
4630 clean stale references to ddi_iopb_alloc and ddi_iopb_free
commit 13bb82abd861fb185be572d7ae5710bf0f98a17a
4849 strlcpy(9F) points to the wrong header
34 files changed, 116 insertions, 987 deletions
diff --git a/usr/src/man/man9f/Intro.9f b/usr/src/man/man9f/Intro.9f index e88df92fc2..96957ac4df 100644 --- a/usr/src/man/man9f/Intro.9f +++ b/usr/src/man/man9f/Intro.9f @@ -1,5 +1,5 @@ '\" te -.\" Copyright 2012 Garrett D'Amore <garrett@damore.org>. All rights reserved. +.\" Copyright 2014 Garrett D'Amore <garrett@damore.org> .\" Copyright (c) 2005, Sun Microsystems, Inc., All Rights Reserved .\" 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. @@ -766,7 +766,6 @@ _ \fBscsi_free_consistent_buf\fR Solaris DDI \fBscsi_get_device_type_scsi_options\fR Solaris DDI \fBscsi_get_device_type_string\fR Solaris DDI -\fBscsi_hba_attach\fR Solaris DDI \fBscsi_hba_attach_setup\fR Solaris DDI \fBscsi_hba_detach\fR Solaris DDI \fBscsi_hba_fini\fR Solaris DDI diff --git a/usr/src/man/man9f/Makefile b/usr/src/man/man9f/Makefile index b4023c0ec8..265c50f628 100644 --- a/usr/src/man/man9f/Makefile +++ b/usr/src/man/man9f/Makefile @@ -11,8 +11,8 @@ # # Copyright 2011, Richard Lowe -# Copyright 2012 Garrett D'Amore <garrett@damore>. All rights reserved. # Copyright 2013 Nexenta Systems, Inc. All rights reserved. +# Copyright 2014 Garrett D'Amore <garrett@damore> # include $(SRC)/Makefile.master @@ -201,7 +201,6 @@ MANFILES= ASSERT.9f \ ddi_io_put8.9f \ ddi_io_rep_get8.9f \ ddi_io_rep_put8.9f \ - ddi_iomin.9f \ ddi_log_sysevent.9f \ ddi_map_regs.9f \ ddi_mem_get8.9f \ @@ -692,7 +691,6 @@ MANLINKS= SIZEOF_PTR.9f \ ddi_dmae_enable.9f \ ddi_dmae_getattr.9f \ ddi_dmae_getcnt.9f \ - ddi_dmae_getlim.9f \ ddi_dmae_prog.9f \ ddi_dmae_release.9f \ ddi_dmae_stop.9f \ @@ -1090,7 +1088,6 @@ MANLINKS= SIZEOF_PTR.9f \ samestr.9f \ scsi_dmafree.9f \ scsi_dname.9f \ - scsi_hba_attach.9f \ scsi_hba_detach.9f \ scsi_hba_fini.9f \ scsi_hba_pkt_free.9f \ @@ -1399,7 +1396,6 @@ ddi_dmae_disable.9f := LINKSRC = ddi_dmae.9f ddi_dmae_enable.9f := LINKSRC = ddi_dmae.9f ddi_dmae_getattr.9f := LINKSRC = ddi_dmae.9f ddi_dmae_getcnt.9f := LINKSRC = ddi_dmae.9f -ddi_dmae_getlim.9f := LINKSRC = ddi_dmae.9f ddi_dmae_prog.9f := LINKSRC = ddi_dmae.9f ddi_dmae_release.9f := LINKSRC = ddi_dmae.9f ddi_dmae_stop.9f := LINKSRC = ddi_dmae.9f @@ -1883,7 +1879,6 @@ scsi_dmafree.9f := LINKSRC = scsi_dmaget.9f scsi_sense_cmdspecific_uint64.9f := LINKSRC = scsi_ext_sense_fields.9f scsi_sense_info_uint64.9f := LINKSRC = scsi_ext_sense_fields.9f -scsi_hba_attach.9f := LINKSRC = scsi_hba_attach_setup.9f scsi_hba_detach.9f := LINKSRC = scsi_hba_attach_setup.9f scsi_hba_fini.9f := LINKSRC = scsi_hba_init.9f diff --git a/usr/src/man/man9f/ddi_check_acc_handle.9f b/usr/src/man/man9f/ddi_check_acc_handle.9f index 3c469ad48e..4c049c32ea 100644 --- a/usr/src/man/man9f/ddi_check_acc_handle.9f +++ b/usr/src/man/man9f/ddi_check_acc_handle.9f @@ -1,9 +1,10 @@ '\" te +.\" Copyright 2014 Garrett D'Amore <garrett@damore.org> .\" Copyright (c) 1999, Sun Microsystems, Inc. All Rights Reserved .\" 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_CHECK_ACC_HANDLE 9F "Aug 13, 1999" +.TH DDI_CHECK_ACC_HANDLE 9F "May 24, 2014" .SH NAME ddi_check_acc_handle, ddi_check_dma_handle \- Check data access and DMA handles .SH SYNOPSIS @@ -43,8 +44,7 @@ Data access handle obtained from a previous call to \fB\fIdma_handle\fR \fR .ad .RS 15n -DMA handle obtained from a previous call to \fBddi_dma_setup\fR(9F) or one of -its derivatives. +DMA handle obtained from \fBddi_dma_alloc_handle\fP(9F). .RE .SH DESCRIPTION @@ -131,5 +131,5 @@ be called from user, kernel, or interrupt context. .SH SEE ALSO .sp .LP -\fBddi_regs_map_setup\fR(9F), \fBddi_dma_setup\fR(9F), +\fBddi_regs_map_setup\fR(9F), \fBddi_dma_alloc_handle\fR(9F), \fBddi_dev_report_fault\fR(9F), \fBddi_get8\fR(9F), \fBddi_put8\fR(9F) diff --git a/usr/src/man/man9f/ddi_dma_burstsizes.9f b/usr/src/man/man9f/ddi_dma_burstsizes.9f index 5b7d2fb2ed..2c7c4b2ddb 100644 --- a/usr/src/man/man9f/ddi_dma_burstsizes.9f +++ b/usr/src/man/man9f/ddi_dma_burstsizes.9f @@ -1,9 +1,10 @@ '\" te +.\" Copyright 2014 Garrett D'Amore <garrett@damore.org> .\" Copyright (c) 1994, Sun Microsystems, 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_DMA_BURSTSIZES 9F "Feb 1, 1994" +.TH DDI_DMA_BURSTSIZES 9F "May 24, 2014" .SH NAME ddi_dma_burstsizes \- find out the allowed burst sizes for a DMA mapping .SH SYNOPSIS @@ -29,23 +30,22 @@ Solaris DDI specific (Solaris DDI). \fB\fIhandle\fR \fR .ad .RS 11n -A \fBDMA\fR handle that was filled in by a successful call to -\fBddi_dma_setup\fR(9F). +A \fBDMA\fR handle. .RE .SH DESCRIPTION .sp .LP \fBddi_dma_burstsizes()\fR returns the allowed burst sizes for a \fBDMA\fR -mapping. This value is derived from the \fBdlim_burstsizes\fR member of the -\fBddi_dma_lim_sparc\fR(9S) structure, but it shows the allowable burstsizes +mapping. This value is derived from the \fBdma_attr_burstsizes\fR member of the +\fBddi_dma_attr\fR(9S) structure, but it shows the allowable burstsizes \fBafter\fR imposing on it the limitations of other device layers in addition to device's own limitations. .SH RETURN VALUES .sp .LP \fBddi_dma_burstsizes()\fR returns a binary encoded value of the allowable -\fBDMA\fR burst sizes. See \fBddi_dma_lim_sparc\fR(9S) for a discussion of +\fBDMA\fR burst sizes. See \fBddi_dma_attr\fR(9S) for a discussion of \fBDMA\fR burst sizes. .SH CONTEXT .sp @@ -54,8 +54,7 @@ This function can be called from user or interrupt context. .SH SEE ALSO .sp .LP -\fBddi_dma_devalign\fR(9F), \fBddi_dma_setup\fR(9F), -\fBddi_dma_lim_sparc\fR(9S), \fBddi_dma_req\fR(9S) +\fBddi_dma_alloc_handle\fR(9F), \fBddi_dma_attr\fR(9S) .sp .LP \fIWriting Device Drivers\fR diff --git a/usr/src/man/man9f/ddi_dmae.9f b/usr/src/man/man9f/ddi_dmae.9f index e54621aa15..0f04ec6c0b 100644 --- a/usr/src/man/man9f/ddi_dmae.9f +++ b/usr/src/man/man9f/ddi_dmae.9f @@ -1,14 +1,14 @@ '\" te +.\" Copyright 2014 Garrett D'Amore <garrett@damore.org> .\" Copyright (c) 2006 Sun Microsystems, Inc. All Rights Reserved. -.\" Copyright 2012 Garrett D'Amore <garrett@damore.org>. All rights reserved. .\" 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_DMAE 9F "Feb 02, 2012" +.TH DDI_DMAE 9F "May 24, 2014" .SH NAME ddi_dmae, ddi_dmae_alloc, ddi_dmae_release, ddi_dmae_prog, ddi_dmae_disable, ddi_dmae_enable, ddi_dmae_stop, ddi_dmae_getcnt, ddi_dmae_1stparty, -ddi_dmae_getlim, ddi_dmae_getattr \- system DMA engine functions +ddi_dmae_getattr \- system DMA engine functions .SH SYNOPSIS .LP .nf @@ -54,20 +54,13 @@ ddi_dmae_getlim, ddi_dmae_getattr \- system DMA engine functions .LP .nf -\fBint\fR \fBddi_dmae_getlim\fR(\fBdev_info_t *\fR\fIdip\fR, \fBddi_dma_lim_t *\fR\fIlimitsp\fR); -.fi - -.LP -.nf \fBint\fR \fBddi_dmae_getattr\fR(\fBdev_info_t *\fR\fIdip\fR, \fBddi_dma_attr_t *\fR\fIattrp\fR); .fi .SH INTERFACE LEVEL .sp .LP -Solaris DDI specific (Solaris DDI). The \fBddi_dmae_getlim()\fR interface, -described below, is obsolete. Use \fBddi_dmae_getattr()\fR, also described -below, to replace it. +Solaris DDI specific (Solaris DDI). .SH PARAMETERS .sp .ne 2 @@ -157,15 +150,6 @@ yet transferred upon completion of a \fBDMA\fR operation. .sp .ne 2 .na -\fB\fIlimitsp\fR\fR -.ad -.RS 12n -A pointer to a \fBDMA\fR limit structure. See \fBddi_dma_lim_x86\fR(9S). -.RE - -.sp -.ne 2 -.na \fB\fIattrp\fR\fR .ad .RS 12n @@ -300,29 +284,6 @@ first be allocated using \fBddi_dmae_alloc()\fR and then configured using \fBddi_dmae_1stparty()\fR. The driver then programs the device to perform the I/O, including the necessary \fBDMA\fR address and count values obtained from the \fBddi_dma_cookie\fR(9S). -.SS "\fBddi_dmae_getlim()\fR" -.sp -.LP -This function is obsolete. Use \fBddi_dmae_getattr()\fR, described below, -instead. -.sp -.LP -The \fBddi_dmae_getlim()\fR function fills in the \fBDMA\fR limit structure, -pointed to by \fIlimitsp\fR, with the \fBDMA\fR limits of the system \fBDMA\fR -engine. Drivers for devices that perform their own bus mastering or use -first-party \fBDMA\fR must create and initialize their own \fBDMA\fR limit -structures; they should not use \fBddi_dmae_getlim()\fR. The \fBDMA\fR limit -structure must be passed to the \fBDMA\fR setup routines so that they will know -how to break the \fBDMA\fR request into windows. If the device has any -particular restrictions on transfer size or granularity (such as the size of -disk sector), the driver should further restrict the values in the structure -members before passing them to the \fBDMA\fR setup routines. The driver must -not relax any of the restrictions embodied in the structure after it is filled -in by \fBddi_dmae_getlim()\fR. After calling \fBddi_dmae_getlim()\fR, a driver -must examine, and possibly set, the size of the \fBDMA\fR engine's -scatter/gather list to determine whether \fBDMA\fR chaining will be used. See -\fBddi_dma_lim_x86\fR(9S) and \fBddi_dmae_req\fR(9S) for additional information -on scatter/gather DMA. .SS "\fBddi_dmae_getattr()\fR" .sp .LP @@ -393,5 +354,5 @@ Architecture x86 \fBisa\fR(4), \fBattributes\fR(5), \fBddi_dma_buf_setup\fR(9F), \fBddi_dma_getwin\fR(9F), \fBddi_dma_nextcookie\fR(9F), \fBddi_dma_mem_alloc\fR(9F), \fBddi_dma_addr_bind_handle\fR(9F), \fBddi_dma_attr\fR(9S), -\fBddi_dma_cookie\fR(9S), \fBddi_dma_lim_x86\fR(9S), \fBddi_dma_req\fR(9S), +\fBddi_dma_cookie\fR(9S), \fBddi_dmae_req\fR(9S) diff --git a/usr/src/man/man9f/ddi_iomin.9f b/usr/src/man/man9f/ddi_iomin.9f deleted file mode 100644 index 96e299aeaa..0000000000 --- a/usr/src/man/man9f/ddi_iomin.9f +++ /dev/null @@ -1,99 +0,0 @@ -'\" te -.\" Copyright (c) 2006, Sun Microsystems, 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_IOMIN 9F "Apr 04, 2006" -.SH NAME -ddi_iomin \- find minimum alignment and transfer size for DMA -.SH SYNOPSIS -.LP -.nf -#include <sys/conf.h> -#include <sys/ddi.h> -#include <sys/sunddi.h> - - - -\fBint\fR \fBddi_iomin\fR(\fBdev_info_t *\fR\fIdip\fR, \fBint\fR \fIinitial\fR, \fBint\fR \fIstreaming\fR); -.fi - -.SH INTERFACE LEVEL -.sp -.LP -Solaris DDI specific (Solaris DDI). This interface is obsolete. -.SH PARAMETERS -.sp -.ne 2 -.na -\fB\fIdip\fR\fR -.ad -.RS 13n -A pointer to the device's \fBdev_info\fR structure. -.RE - -.sp -.ne 2 -.na -\fB\fIinitial\fR\fR -.ad -.RS 13n -The initial minimum \fBDMA\fRtransfer size in bytes. This may be zero or an -appropriate \fBdlim_minxfer\fR value for device's \fBddi_dma_lim\fR structure -(see \fBddi_dma_lim_sparc\fR(9S) or \fBddi_dma_lim_x86\fR(9S)). This value must -be a power of two. -.RE - -.sp -.ne 2 -.na -\fB\fIstreaming\fR\fR -.ad -.RS 13n -This argument, if non-zero, indicates that the returned value should be -modified to account for \fIstreaming\fR mode accesses (see -\fBddi_dma_req\fR(9S) for a discussion of streaming versus non-streaming access -mode). -.RE - -.SH DESCRIPTION -.sp -.LP -The \fBddi_iomin()\fR function, finds out the minimum \fBDMA\fRtransfer size -for the device pointed to by \fIdip\fR. This provides a mechanism by which a -driver can determine the effects of underlying caches as well as intervening -bus adapters on the granularity of a DMA transfer. -.SH RETURN VALUES -.sp -.LP -The \fBddi_iomin()\fR function returns the minimum \fBDMA\fRtransfer size for -the calling device, or it returns zero, which means that you cannot get there -from here. -.SH CONTEXT -.sp -.LP -This function can be called from user, interrupt, or kernel context. -.SH ATTRIBUTES -.sp -.LP -See \fBattributes\fR(5) for descriptions of the following attributes: -.sp - -.sp -.TS -box; -c | c -l | l . -ATTRIBUTE TYPE ATTRIBUTE VALUE -_ -Interface Stability Obsolete -.TE - -.SH SEE ALSO -.sp -.LP -\fBddi_dma_devalign\fR(9F), \fBddi_dma_setup\fR(9F), \fBddi_dma_sync\fR(9F), -\fBddi_dma_lim_sparc\fR(9S), \fBddi_dma_lim_x86\fR(9S), \fBddi_dma_req\fR(9S) -.sp -.LP -\fIWriting Device Drivers\fR diff --git a/usr/src/man/man9f/get_pktiopb.9f b/usr/src/man/man9f/get_pktiopb.9f index 7be1a5ec87..b7583d4507 100644 --- a/usr/src/man/man9f/get_pktiopb.9f +++ b/usr/src/man/man9f/get_pktiopb.9f @@ -1,9 +1,10 @@ '\" te +.\" Copyright 2014 Garrett D'Amore <garrett@damore.org> .\" Copyright (c) 2006, Sun Microsystems, Inc., All Rights Reserved .\" 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 GET_PKTIOPB 9F "Jan 16, 2006" +.TH GET_PKTIOPB 9F "May 24, 2014" .SH NAME get_pktiopb, free_pktiopb \- allocate/free a SCSI packet in the iopb map .SH SYNOPSIS @@ -186,7 +187,7 @@ Stability Level Obsolete .SH SEE ALSO .sp .LP -\fBattributes\fR(5), \fBddi_iopb_alloc\fR(9F), +\fBattributes\fR(5), \fBscsi_alloc_consistent_buf\fR(9F), \fBscsi_free_consistent_buf\fR(9F), \fBscsi_pktalloc\fR(9F), \fBscsi_resalloc\fR(9F), \fBscsi_pkt\fR(9S) .sp diff --git a/usr/src/man/man9f/scsi_hba_attach_setup.9f b/usr/src/man/man9f/scsi_hba_attach_setup.9f index 177e0589d0..dd303f3bc4 100644 --- a/usr/src/man/man9f/scsi_hba_attach_setup.9f +++ b/usr/src/man/man9f/scsi_hba_attach_setup.9f @@ -1,11 +1,12 @@ '\" te .\" Copyright (c) 2006 Sun Microsystems, Inc., All Rights Reserved +.\" Copyright 2014 Garrett D'Amore <garrett@damore.org> .\" 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 SCSI_HBA_ATTACH_SETUP 9F "May 30, 2006" +.TH SCSI_HBA_ATTACH_SETUP 9F "May 24, 2014" .SH NAME -scsi_hba_attach_setup, scsi_hba_attach, scsi_hba_detach \- SCSI HBA attach and +scsi_hba_attach_setup, scsi_hba_detach \- SCSI HBA attach and detach routines .SH SYNOPSIS .LP @@ -20,12 +21,6 @@ detach routines .LP .nf -\fBint\fR \fBscsi_hba_attach\fR(\fBdev_info_t *\fR\fIdip\fR, \fBddi_dma_lim_t *\fR\fIhba_lim\fR, - \fBscsi_hba_tran_t *\fR\fIhba_tran\fR, \fBint\fR \fIhba_flags\fR, \fBvoid *\fR\fIhba_options\fR); -.fi - -.LP -.nf \fBint\fR \fBscsi_hba_detach\fR(\fBdev_info_t *\fR\fIdip\fR); .fi @@ -47,15 +42,6 @@ HBA device. .sp .ne 2 .na -\fB\fIhba_lim\fR\fR -.ad -.RS 16n -Pointer to a \fBddi_dma_lim\fR(9S) structure. -.RE - -.sp -.ne 2 -.na \fB\fIhba_tran\fR\fR .ad .RS 16n @@ -93,25 +79,20 @@ Pointer to a \fBddi_dma_attr\fR(9S) structure. .SH DESCRIPTION .sp -.LP -The \fBscsi_hba_attach_setup()\fR function is the recommended interface over -the \fBscsi_hba_attach()\fR function. -.SS "scsi_hba_attach_setup(\|) scsi_hba_attach(\|)" +.SS "scsi_hba_attach_setup(\|)" .sp .LP -The \fBscsi_hba_attach()\fR function registers the \fIhba_lim\fR DMA limits and -the \fIhba_tran\fR transport vectors of each instance of the HBA device defined -by \fIdip\fR. The \fBscsi_hba_attach_setup()\fR function registers the +The \fBscsi_hba_attach_setup()\fR function registers the \fIhba_dma_attr\fR DMA attributes and the \fIhba_tran\fR transport vectors of each instance of the HBA device defined by \fIdip\fR. The HBA driver can pass -different DMA limits or DMA attributes and the transport vectors for each +different DMA attributes and the transport vectors for each instance of the device to support any constraints imposed by the HBA itself. .sp .LP -The \fBscsi_hba_attach()\fR and \fBscsi_hba_attach_setup()\fR functions use the +The \fBscsi_hba_attach_setup()\fR function uses the \fBdev_bus_ops\fR field in the \fBdev_ops\fR(9S) structure. The HBA driver should initialize this field to \fINULL\fR before calling -\fBscsi_hba_attach()\fR or \fBscsi_hba_attach_setup()\fR. +\fBscsi_hba_attach_setup()\fR. .sp .LP If \fBSCSI_HBA_TRAN_CLONE\fR is requested in \fIhba_flags\fR, the @@ -132,7 +113,7 @@ when \fBtran_setup_pkt()\fR is used. See \fBtran_setup_pkt\fR(9E) for information on using these flags. .sp .LP -The \fBscsi_hba_attach()\fR and \fBscsi_hba_attach_setup()\fR functions attach +The \fBscsi_hba_attach_setup()\fR function attaches a number of integer-valued properties to \fIdip\fR, unless properties of the same name are already attached to the node. An HBA driver should retrieve these configuration parameters via \fBddi_prop_get_int\fR(9F), and respect any @@ -278,19 +259,19 @@ individual HBA man pages for any HBA-specific information .SS "scsi_hba_detach(\|)" .sp .LP -The \fBscsi_hba_detach()\fR function removes the reference to the DMA limits or +The \fBscsi_hba_detach()\fR function removes the reference to the DMA attributes structure and the transport vector for the given instance of an HBA driver. .SH RETURN VALUES .sp .LP -The \fBscsi_hba_attach()\fR, \fBscsi_hba_attach_setup()\fR, and +The \fBscsi_hba_attach_setup()\fR and \fBscsi_hba_detach()\fR functions return \fBDDI_SUCCESS\fR if the function call succeeds, and return \fBDDI_FAILURE\fR on failure. .SH CONTEXT .sp .LP -The \fBscsi_hba_attach()\fR and \fBscsi_hba_attach_setup()\fR functions should +The \fBscsi_hba_attach_setup()\fR function should be called from \fBattach\fR(9E). The \fBscsi_hba_detach()\fR function should be called from \fBdetach\fR(9E). .SH SEE ALSO @@ -298,7 +279,7 @@ called from \fBdetach\fR(9E). .LP \fBattach\fR(9E), \fBdetach\fR(9E), \fBtran_setup_pkt\fR(9E), \fBtran_tgt_init\fR(9E), \fBddi_prop_get_int\fR(9F), \fBddi_dma_attr\fR(9S), -\fBddi_dma_lim\fR(9S), \fBdev_ops\fR(9S), \fBscsi_address\fR(9S), +\fBdev_ops\fR(9S), \fBscsi_address\fR(9S), \fBscsi_hba_tran\fR(9S) .sp .LP @@ -309,7 +290,3 @@ called from \fBdetach\fR(9E). It is the HBA driver's responsibility to ensure that no more transport requests will be taken on behalf of any SCSI target device driver after \fBscsi_hba_detach()\fR is called. -.sp -.LP -The \fBscsi_hba_attach()\fR function is obsolete and will be discontinued in a -future release. This function is replaced by \fBscsi_hba_attach_setup()\fR. diff --git a/usr/src/man/man9f/scsi_ifgetcap.9f b/usr/src/man/man9f/scsi_ifgetcap.9f index 15f921e265..758c58baf1 100644 --- a/usr/src/man/man9f/scsi_ifgetcap.9f +++ b/usr/src/man/man9f/scsi_ifgetcap.9f @@ -1,9 +1,10 @@ '\" te .\" Copyright (c) 2007, Sun Microsystems, Inc., All Rights Reserved +.\" Copyright (c) 2014 Garrett D'Amore <garrett@damore.org> .\" 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 SCSI_IFGETCAP 9F "Oct 16, 2007" +.TH SCSI_IFGETCAP 9F "May 24, 2014" .SH NAME scsi_ifgetcap, scsi_ifsetcap \- get/set SCSI transport capability .SH SYNOPSIS @@ -202,9 +203,9 @@ Host adapter capability that supports auto request sense on check conditions: .ad .RS 24n Capability that is set by the target driver to inform the \fBHBA\fR of the -granularity, in bytes, of the \fBDMA\fR breakup. The \fBHBA\fR \fBDMA\fR limit -structure is set to reflect the byte total of this setting. See -\fBddi_dma_lim_sparc\fR(9S) or \fBddi_dma_lim_x86\fR(9S). The \fBsector-size\fR +granularity, in bytes, of the \fBDMA\fR breakup. The \fBHBA\fR \fBDMA\fR +attributes structure is set to reflect the byte total of this setting. See +\fBddi_dma_attr\fR(9S). The \fBsector-size\fR should be set to the size of the physical disk sector. The capability defaults to 512 bytes. .RE @@ -428,8 +429,8 @@ Interface Stability Committed .sp .LP \fBtran_reset\fR(9E), \fBscsi_hba_lookup_capstr\fR(9F), \fBscsi_reset\fR(9F), -\fBscsi_reset_notify\fR(9F), \fBddi_dma_lim_sparc\fR(9S), -\fBddi_dma_lim_x86\fR(9S), \fBscsi_address\fR(9S), \fBscsi_arq_status\fR(9S) +\fBscsi_reset_notify\fR(9F), \fBddi_dma_attr\fR(9S), +\fBscsi_address\fR(9S), \fBscsi_arq_status\fR(9S) .sp .LP \fIWriting Device Drivers\fR diff --git a/usr/src/man/man9f/scsi_init_pkt.9f b/usr/src/man/man9f/scsi_init_pkt.9f index 9809a9561d..28b84b6cd1 100644 --- a/usr/src/man/man9f/scsi_init_pkt.9f +++ b/usr/src/man/man9f/scsi_init_pkt.9f @@ -1,9 +1,10 @@ '\" te +.\" Copyright 2014 Garrett D'Amore <garrett@damore.org> .\" Copyright (c) 2006, Sun Microsystems, Inc., All Rights Reserved .\" 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 SCSI_INIT_PKT 9F "Jan 16, 2006" +.TH SCSI_INIT_PKT 9F "May 24, 2014" .SH NAME scsi_init_pkt \- prepare a complete SCSI packet .SH SYNOPSIS @@ -194,8 +195,8 @@ target driver's command completion callback. .RS 4n This may be set if the driver can accept a partial \fBDMA\fR mapping. If set, \fBscsi_init_pkt()\fR will allocate \fBDMA\fR resources with the -\fBDDI_DMA_PARTIAL\fR bit set in the \fBdmar_flag\fR element of the -\fBddi_dma_req\fR(9S) structure. The \fBpkt_resid\fR field of the +\fBDDI_DMA_PARTIAL\fR bit set in the DMA flags. +The \fBpkt_resid\fR field of the \fBscsi_pkt\fR(9S) structure may be returned with a non-zero value, which indicates the number of bytes for which \fBscsi_init_pkt()\fR was unable to allocate DMA resources. In this case, a subsequent call to @@ -371,7 +372,7 @@ my_pkt = scsi_init_pkt(&devp->sd_address, NULL, bp, CDB_GROUP0, .LP \fBscsi_alloc_consistent_buf\fR(9F), \fBscsi_destroy_pkt\fR(9F), \fBscsi_dmaget\fR(9F), \fBscsi_pktalloc\fR(9F), \fBbuf\fR(9S), -\fBddi_dma_req\fR(9S), \fBscsi_address\fR(9S), \fBscsi_pkt\fR(9S) +\fBscsi_address\fR(9S), \fBscsi_pkt\fR(9S) .sp .LP \fIWriting Device Drivers\fR diff --git a/usr/src/man/man9f/string.9f b/usr/src/man/man9f/string.9f index a07dbe941e..5300eb52d6 100644 --- a/usr/src/man/man9f/string.9f +++ b/usr/src/man/man9f/string.9f @@ -3,7 +3,7 @@ .\" 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 STRING 9F "Feb 27, 2009" +.TH STRING 9F "Jun 4, 2014" .SH NAME string, strcasecmp, strncasecmp, strncat, strlcat, strchr, strrchr, strcmp, strncmp, strcpy, strncpy, strlcpy, strfree, strspn, strdup, ddi_strdup, strlen, @@ -12,6 +12,7 @@ strnlen \- string operations .LP .nf #include <sys/ddi.h> +#include <sys/sunddi.h> \fBint\fR \fBstrcasecmp\fR(\fBconst char *\fR\fIs1\fR, \fBconst char *\fR\fIs2\fR); .fi diff --git a/usr/src/man/man9s/Intro.9s b/usr/src/man/man9s/Intro.9s index 36c9438abe..e2968197f1 100644 --- a/usr/src/man/man9s/Intro.9s +++ b/usr/src/man/man9s/Intro.9s @@ -1,10 +1,11 @@ '\" te +.\" Copyright 2014 Garrett D'Amore <garrett@damore.org> .\" Copyright (c) 2001, Sun Microsystems, Inc., All Rights Reserved. .\" Copyright 1989 AT&T .\" 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 INTRO 9S "May 15, 2001" +.TH INTRO 9S "May 24, 2014" .SH NAME Intro, intro \- introduction to kernel data structures and properties .SH DESCRIPTION @@ -129,12 +130,6 @@ _ _ \fBddi_dma_cookie\fR Solaris DDI _ -\fBddi_dma_lim_sparc\fR Solaris SPARC DDI -_ -\fBddi_dma_lim_x86\fR Solaris x86 DDI -_ -\fBddi_dma_req\fR Solaris DDI -_ \fBddi_dmae_req\fR Solaris x86 DDI _ \fBddi_idevice_cookie\fR Solaris DDI diff --git a/usr/src/man/man9s/Makefile b/usr/src/man/man9s/Makefile index d320debf44..c24521f325 100644 --- a/usr/src/man/man9s/Makefile +++ b/usr/src/man/man9s/Makefile @@ -12,6 +12,7 @@ # # Copyright 2011, Richard Lowe # Copyright 2013 Nexenta Systems, Inc. All rights reserved. +# Copyright 2014 Garrett D'Amore <garrett@damore.org> # include $(SRC)/Makefile.master @@ -28,9 +29,6 @@ MANFILES= Intro.9s \ ddi_device_acc_attr.9s \ ddi_dma_attr.9s \ ddi_dma_cookie.9s \ - ddi_dma_lim_sparc.9s \ - ddi_dma_lim_x86.9s \ - ddi_dma_req.9s \ ddi_dmae_req.9s \ ddi_fm_error.9s \ ddi_idevice_cookie.9s \ @@ -92,7 +90,6 @@ MANFILES= Intro.9s \ usb_string_descr.9s MANLINKS= dblk.9s \ - ddi_dma_lim.9s \ intro.9s \ mblk.9s @@ -100,8 +97,6 @@ intro.9s := LINKSRC = Intro.9s dblk.9s := LINKSRC = datab.9s -ddi_dma_lim.9s := LINKSRC = ddi_dma_lim_sparc.9s - mblk.9s := LINKSRC = msgb.9s .KEEP_STATE: diff --git a/usr/src/man/man9s/ddi_dma_lim_sparc.9s b/usr/src/man/man9s/ddi_dma_lim_sparc.9s deleted file mode 100644 index 045628502f..0000000000 --- a/usr/src/man/man9s/ddi_dma_lim_sparc.9s +++ /dev/null @@ -1,129 +0,0 @@ -'\" te -.\" Copyright (c) 2005, Sun Microsystems, Inc. All Rights Reserved -.\" 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_DMA_LIM_SPARC 9S "Oct 12, 2005" -.SH NAME -ddi_dma_lim_sparc, ddi_dma_lim \- SPARC DMA limits structure -.SH SYNOPSIS -.LP -.nf -#include <sys/ddidmareq.h> -.fi - -.SH INTERFACE LEVEL -.sp -.LP -Solaris SPARC DDI specific (Solaris SPARC DDI). These interfaces are obsolete. -.SH DESCRIPTION -.sp -.LP -This page describes the SPARC version of the \fBddi_dma_lim\fR structure. See -\fBddi_dma_lim_x86\fR(9S) for a description of the x86 version of this -structure. -.sp -.LP -A \fBddi_dma_lim\fR structure describes in a generic fashion the possible -limitations of a device's \fBDMA\fR engine. This information is used by the -system when it attempts to set up \fBDMA\fR resources for a device. -.SH STRUCTURE MEMBERS -.sp -.in +2 -.nf -uint_t dlim_addr_lo; /* low range of 32 bit - addressing capability */ -uint_t dlim_addr_hi; /* inclusive upper bound of address. - capability */ -uint_t dlim_cntr_max; /* inclusive upper bound of - dma engine address limit * / -uint_t dlim_burstsizes; /* binary encoded dma burst sizes */ -uint_t dlim_minxfer; /* minimum effective dma xfer size */ -uint_t dlim_dmaspeed; /* average dma data rate (kb/s) */ -.fi -.in -2 - -.sp -.LP -The \fBdlim_addr_lo\fR and \fBdlim_addr_hi\fR fields specify the address range -the device's \fBDMA\fR engine can access. The \fBdlim_addr_lo\fR field -describes the lower 32-bit boundary of the device's \fBDMA\fR engine, the -\fBdlim_addr_hi\fR describes the inclusive upper 32-bit boundary. The system -allocates \fBDMA\fR resources in a way that the address for programming the -device's \fBDMA\fR engine (see \fBddi_dma_cookie\fR(9S) or -\fBddi_dma_htoc\fR(9F)) is within this range. For example, if your device can -access the whole 32-bit address range, you may use [\fB0\fR,\fB0xFFFFFFFF\fR]. -If your device has just a 16-bit address register but will access the top of -the 32-bit address range, then [\fB0xFFFF0000\fR,\fB0xFFFFFFFF\fR] is the -right limit. -.sp -.LP -The \fBdlim_cntr_max\fR field describes an inclusive upper bound for the -device's \fBDMA\fR engine address register. This handles a fairly common case -where a portion of the address register is only a latch rather than a full -register. For example, the upper 8 bits of a 32-bit address register can be a -latch. This splits the address register into a portion that acts as a true -address register (24 bits) for a 16 Mbyte segment and a latch (8 bits) to hold -a segment number. To describe these limits, specify \fB0xFFFFFF\fR in the -\fBdlim_cntr_max\fR structure. -.sp -.LP -The \fBdlim_burstsizes\fR field describes the possible burst sizes the device's -\fBDMA\fR engine can accept. At the time of a \fBDMA\fR resource request, this -element defines the possible \fBDMA\fR burst cycle sizes that the requester's -\fBDMA\fR engine can handle. The format of the data is binary encoding of burst -sizes assumed to be powers of two. That is, if a \fBDMA\fR engine is capable of -doing 1-, 2-, 4-, and 16-byte transfers, the encoding ix 0x17. If the device is -an SBus device and can take advantage of a 64-bit SBus, the lower 16 bits are -used to specify the burst size for 32-bit transfers and the upper 16 bits are -used to specify the burst size for 64-bit transfers. As the resource request is -handled by the system, the \fBburstsizes\fR value can be modified. Prior to -enabling \fBDMA\fR for the specific device, the driver that owns the \fBDMA\fR -engine should check (using \fBddi_dma_burstsizes\fR(9F)) what the allowed -\fBburstsizes\fR have become and program the \fBDMA\fR engine appropriately. -.sp -.LP -The \fBdlim_minxfer\fR field describes the minimum effective \fBDMA\fR transfer -size (in units of bytes). It must be a power of two. This value specifies the -minimum effective granularity of the \fBDMA\fR engine. It is distinct from -\fBdlim_burstsizes\fR in that it describes the minimum amount of access a -\fBDMA\fR transfer will effect. \fBdlim_burstsizes\fR describes in what -electrical fashion the \fBDMA\fR engine might perform its accesses, while -\fBdlim_minxfer\fR describes the minimum amount of memory that can be touched -by the \fBDMA\fR transfer. As a resource request is handled by the system, the -\fBdlim_minxfer\fR value can be modified contingent upon the presence (and use) -of \fBI/O \fRcaches and \fBDMA\fR write buffers in between the \fBDMA\fR engine -and the object that \fBDMA\fR is being performed on. After \fBDMA\fR resources -have been allocated, the resultant minimum transfer value can be gotten using -\fBddi_dma_devalign\fR(9F). -.sp -.LP -The field \fBdlim_dmaspeed\fR is the expected average data rate for the -\fBDMA\fR engine (in units of kilobytes per second). Note that this should not -be the maximum, or peak, burst data rate, but a reasonable guess as to the -average throughput. This field is entirely optional and can be left as zero. -Its intended use is to provide some hints about how much of the \fBDMA\fR -resource this device might need. -.SH ATTRIBUTES -.sp -.LP -See \fBattributes\fR(5) for descriptions of the following attributes: -.sp - -.sp -.TS -box; -c | c -l | l . -ATTRIBUTE TYPE ATTRIBUTE VALUE -_ -Interface Stability Obsolete -.TE - -.SH SEE ALSO -.sp -.LP -\fBddi_dma_addr_setup\fR(9F), \fBddi_dma_buf_setup\fR(9F), -\fBddi_dma_burstsizes\fR(9F), \fBddi_dma_devalign\fR(9F), -\fBddi_dma_htoc\fR(9F), \fBddi_dma_setup\fR(9F), \fBddi_dma_cookie\fR(9S), -\fBddi_dma_lim_x86\fR(9S), \fBddi_dma_req\fR(9S) diff --git a/usr/src/man/man9s/ddi_dma_lim_x86.9s b/usr/src/man/man9s/ddi_dma_lim_x86.9s deleted file mode 100644 index 8ed46c1e13..0000000000 --- a/usr/src/man/man9s/ddi_dma_lim_x86.9s +++ /dev/null @@ -1,148 +0,0 @@ -'\" te -.\" Copyright (c) 2005, Sun Microsystems, 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_DMA_LIM_X86 9S "Oct 12, 2005" -.SH NAME -ddi_dma_lim_x86 \- x86 DMA limits structure -.SH SYNOPSIS -.LP -.nf -#include <sys/ddidmareq.h> -.fi - -.SH INTERFACE LEVEL -.sp -.LP -Solaris x86 DDI specific (Solaris x86 DDI). This interface is obsolete. -.SH DESCRIPTION -.sp -.LP -A \fBddi_dma_lim\fR structure describes in a generic fashion the possible -limitations of a device or its \fBDMA\fR engine. This information is used by -the system when it attempts to set up \fBDMA\fR resources for a device. When -the system is requested to perform a \fBDMA\fR transfer to or from an object, -the request is broken up, if necessary, into multiple sub-requests. Each -sub-request conforms to the limitations expressed in the \fBddi_dma_lim\fR -structure. -.sp -.LP -This structure should be filled in by calling the routine -\fBddi_dmae_getlim\fR(9F). This routine sets the values of the structure -members appropriately based on the characteristics of the \fBDMA\fR engine on -the driver's parent bus. If the driver has additional limitations, it can -\fIfurther restrict\fR some of the values in the structure members. A driver -should \fInot relax\fR any restrictions imposed by \fBddi_dmae_getlim()\fR. -.SH STRUCTURE MEMBERS -.sp -.in +2 -.nf -uint_t dlim_addr_lo; /* low range of 32 bit - addressing capability */ -uint_t dlim_addr_hi; /* inclusive upper bound of - addressing capability */ -uint_t dlim_minxfer; /* minimum effective dma transfer size */ -uint_t dlim_version; /* version number of structure */ -uint_t dlim_adreg_max; /* inclusive upper bound of - incrementing addr reg */ -uint_t dlim_ctreg_max; /* maximum transfer count minus one */ -uint_t dlim_granular; /* granularity (and min size) of - transfer count */ -short dlim_sgllen; /* length of DMA scatter/gather list */ -uint_t dlim_reqsize; /* maximum transfer size in bytes of - a single I/O */ -.fi -.in -2 - -.sp -.LP -The \fBdlim_addr_lo\fR and \fBdlim_addr_hi\fR fields specify the address range -that the device's \fBDMA\fR engine can access. The \fBdlim_addr_lo\fR field -describes the lower 32-bit boundary of the device's \fBDMA\fR engine. The -\fBdlim_addr_hi\fR member describes the inclusive, upper 32-bit boundary. The -system allocates \fBDMA\fR resources in a way that the address for programming -the device's \fBDMA\fR engine will be within this range. For example, if your -device can access the whole 32-bit address range, you can use -[\fB0,0xFFFFFFFF\fR]. See \fBddi_dma_cookie\fR(9S) or -\fBddi_dma_segtocookie\fR(9F). -.sp -.LP -The \fBdlim_minxfer\fR field describes the minimum effective \fBDMA\fR transfer -size (in units of bytes), which must be a power of two. This value specifies -the minimum effective granularity of the \fBDMA\fR engine and describes the -minimum amount of memory that can be touched by the \fBDMA\fR transfer. As a -resource request is handled by the system, the \fBdlim_minxfer\fR value can be -modified. This modification is contingent upon the presence (and use) of -\fBI/O\fRcaches and \fBDMA\fR write buffers between the \fBDMA\fR engine and -the object that \fBDMA\fR is being performed on. After \fBDMA\fR resources have -been allocated, you can retrieve the resultant minimum transfer value using -\fBddi_dma_devalign\fR(9F). -.sp -.LP -The \fBdlim_version\fR field specifies the version number of this structure. -Set this field to \fBDMALIM_VER0\fR. -.sp -.LP -The \fBdlim_adreg_max\fR field describes an inclusive upper bound for the -device's \fBDMA\fR engine address register. This bound handles a fairly common -case where a portion of the address register is simply a latch rather than a -full register. For example, the upper 16 bits of a 32-bit address register -might be a latch. This splits the address register into a portion that acts as -a true address register (lower 16 bits) for a 64-kilobyte segment and a latch -(upper 16 bits) to hold a segment number. To describe these limits, you specify -\fB0xFFFF\fR in the \fBdlim_adreg_max\fR structure member. -.sp -.LP -The \fBdlim_ctreg_max\fR field specifies the maximum transfer count that the -\fBDMA\fR engine can handle in one segment or cookie. The limit is expressed -as the maximum count minus one. This transfer count limitation is a per-segment -limitation. Because the limitation is used as a bit mask, it must be one less -than a power of two. -.sp -.LP -The \fBdlim_granular\fR field describes the granularity of the device's -\fBDMA\fR transfer ability, in units of bytes. This value is used to specify, -for example, the sector size of a mass storage device. \fBDMA\fR requests are -broken into multiples of this value. If there is no scatter/gather capability, -then the size of each \fBDMA\fR transfer will be a multiple of this value. If -there is scatter/gather capability, then a single segment cannot be smaller -than the minimum transfer value, but can be less than the granularity. However, -the total transfer length of the scatter/gather list is a multiple of the -granularity value. -.sp -.LP -The \fBdlim_sgllen\fR field specifies the maximum number of entries in the -scatter/gather list. This value is the number of segments or cookies that the -\fBDMA\fR engine can consume in one I/O request to the device. If the \fBDMA\fR -engine has no scatter/gather list, set this field to one. -.sp -.LP -The \fBdlim_reqsize\fR field describes the maximum number of bytes that the -\fBDMA\fR engine can transmit or receive in one I/O command. This limitation is -only significant if it is less than ( \fBdlim_ctreg_max\fR +1) * -\fBdlim_sgllen\fR. If the \fBDMA\fR engine has no particular limitation, set -this field to \fB0xFFFFFFFF\fR. -.SH ATTRIBUTES -.sp -.LP -See \fBattributes\fR(5) for descriptions of the following attributes: -.sp - -.sp -.TS -box; -c | c -l | l . -ATTRIBUTE TYPE ATTRIBUTE VALUE -_ -Interface Stability Obsolete -.TE - -.SH SEE ALSO -.sp -.LP -\fBddi_dmae\fR(9F), \fBddi_dma_addr_setup\fR(9F), \fBddi_dma_buf_setup\fR(9F), -\fBddi_dma_devalign\fR(9F), \fBddi_dma_segtocookie\fR(9F), -\fBddi_dma_setup\fR(9F), \fBddi_dma_cookie\fR(9S), \fBddi_dma_lim_sparc\fR(9S), -\fBddi_dma_req\fR(9S) diff --git a/usr/src/man/man9s/ddi_dma_req.9s b/usr/src/man/man9s/ddi_dma_req.9s deleted file mode 100644 index 6bfa49dbcc..0000000000 --- a/usr/src/man/man9s/ddi_dma_req.9s +++ /dev/null @@ -1,222 +0,0 @@ -'\" te -.\" Copyright (c) 2005, Sun Microsystems, Inc., All Rights Reserved -.\" 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_DMA_REQ 9S "Oct 12, 2005" -.SH NAME -ddi_dma_req \- DMA Request structure -.SH SYNOPSIS -.LP -.nf -#include <sys/ddidmareq.h> -.fi - -.SH INTERFACE LEVEL -.sp -.LP -Solaris DDI specific (Solaris DDI). This interface is obsolete. -.SH DESCRIPTION -.sp -.LP -A \fBddi_dma_req\fR structure describes a request for \fBDMA\fR resources. A -driver can use it to describe forms of allocations and ways to allocate -\fBDMA\fR resources for a \fBDMA\fR request. -.SH STRUCTURE MEMBERS -.sp -.in +2 -.nf -ddi_dma_lim_t *dmar_limits; /* Caller's dma engine - constraints */ -uint_t dmar_flags; /* Contains info for - mapping routines */ -int (*dmar_fp)(caddr_t);/* Callback function */ -caddr_t dmar_arg; /* Callback function's argument */ -ddi_dma_obj_t dmar_object; /* Descrip. of object - to be mapped */ -.fi -.in -2 - -.sp -.LP -For the definition of the \fBDMA\fR limits structure, which \fBdmar_limits\fR -points to, see \fBddi_dma_lim_sparc\fR(9S) or \fBddi_dma_lim_x86\fR(9S). -.sp -.LP -Valid values for \fBdmar_flags\fR are: -.sp -.in +2 -.nf -DDI_DMA_WRITE /* Direction memory --> IO */ -DDI_DMA_READ /* Direction IO --> memory */ -DDI_DMA_RDWR /* Both read and write */ -DDI_DMA_REDZONE /* Establish MMU redzone at end of mapping */ -DDI_DMA_PARTIAL /* Partial mapping is allowed */ -DDI_DMA_CONSISTENT /* Byte consistent access wanted */ -DDI_DMA_SBUS_64BIT /* Use 64 bit capability on SBus */ -.fi -.in -2 - -.sp -.LP -\fBDDI_DMA_WRITE\fR, \fBDDI_DMA_READ\fR, and \fBDDI_DMA_RDWR\fR describe the -intended direction of the \fBDMA \fRtransfer. Some implementations might -explicitly disallow \fBDDI_DMA_RDWR\fR. -.sp -.LP -\fBDDI_DMA_REDZONE\fR asks the system to establish a protected \fBred zone\fR -after the object. The \fBDMA\fR resource allocation functions do not guarantee -the success of this request, as some implementations might not have the -hardware ability to support it. -.sp -.LP -\fBDDI_DMA_PARTIAL\fR lets the system know that the caller can accept partial -mapping. That is, if the size of the object exceeds the resources available, -the system allocates only a portion of the object and returns status indicating -this partial allocation. At a later point, the caller can use -\fBddi_dma_curwin\fR(9F) and \fBddi_dma_movwin\fR(9F) to change the valid -portion of the object that has resources allocated. -.sp -.LP -\fBDDI_DMA_CONSISTENT\fR gives a hint to the system that the object should be -mapped for \fBbyte consistent\fR access. Normal data transfers usually use a -\fBstreaming\fR mode of operation. They start at a specific point, transfer a -fairly large amount of data sequentially, and then stop, usually on an aligned -boundary. Control mode data transfers for memory-resident device control blocks -(for example, Ethernet message descriptors) do not access memory in such a -sequential fashion. Instead, they tend to modify a few words or bytes, move -around and maybe modify a few more. -.sp -.LP -Many machine implementations make this non-sequential memory access difficult -to control in a generic and seamless fashion. Therefore, explicit -synchronization steps using \fBddi_dma_sync\fR(9F) or \fBddi_dma_free\fR(9F) -are required to make the view of a memory object shared between a \fBCPU \fRand -a \fBDMA\fR device consistent. However, proper use of the -\fBDDI_DMA_CONSISTENT\fR flag can create a condition in which a system will -pick resources in a way that makes these synchronization steps are as efficient -as possible. -.sp -.LP -\fBDDI_DMA_SBUS_64BIT\fR tells the system that the device can perform 64-bit -transfers on a 64-bit SBus. If the SBus does not support 64-bit data transfers, -data will be transferred in 32-bit mode. -.sp -.LP -The callback function specified by the member \fBdmar_fp\fR indicates how a -caller to one of the \fBDMA\fR resource allocation functions wants to deal with -the possibility of resources not being available. (See -\fBddi_dma_setup\fR(9F).) If \fBdmar_fp\fR is set to \fBDDI_DMA_DONTWAIT\fR, -then the caller does not care if the allocation fails, and can deal with an -allocation failure appropriately. Setting \fBdmar_fp\fR to \fBDDI_DMA_SLEEP\fR -indicates the caller wants to have the allocation routines wait for resources -to become available. If any other value is set, and a \fBDMA\fR resource -allocation fails, this value is assumed to be a function to call later, when -resources become available. When the specified function is called, it is passed -the value set in the structure member \fBdmar_arg\fR. The specified callback -function \fBmust\fR return either: -.sp -.ne 2 -.na -\fB\fB0\fR\fR -.ad -.RS 5n -Indicating that it attempted to allocate a \fBDMA\fR resource but failed to do -so, again, in which case the callback function will be put back on a list to be -called again later. -.RE - -.sp -.ne 2 -.na -\fB\fB1\fR\fR -.ad -.RS 5n -Indicating either success at allocating \fBDMA\fR resources or that it no -longer wants to retry. -.RE - -.sp -.LP -The callback function is called in interrupt context. Therefore, only system -functions and contexts that are accessible from interrupt context are -available. The callback function must take whatever steps necessary to protect -its critical resources, data structures, and queues. -.sp -.LP -It is possible that a call to \fBddi_dma_free\fR(9F), which frees \fBDMA\fR -resources, might cause a callback function to be called and, unless some care -is taken, an undesired recursion can occur. This can cause an undesired -recursive \fBmutex_enter\fR(9F), which makes the system panic. -.SS "dmar_object Structure" -.sp -.LP -The \fBdmar_object\fR member of the \fBddi_dma_req\fR structure is itself a -complex and extensible structure: -.sp -.in +2 -.nf -uint_t dmao_size; /* size, in bytes, of the object */ -ddi_dma_atyp_t dmao_type; /* type of object */ -ddi_dma_aobj_t dmao_obj; /* the object described */ -.fi -.in -2 - -.sp -.LP -The \fBdmao_size\fR element is the size, in bytes, of the object resources -allocated for \fBDMA\fR. -.sp -.LP -The \fBdmao_type\fR element selects the kind of object described by -\fBdmao_obj\fR. It can be set to \fBDMA_OTYP_VADDR\fR, indicating virtual -addresses. -.sp -.LP -The last element, \fBdmao_obj\fR, consists of the virtual address type: -.sp -.in +2 -.nf -struct v_address virt_obj; -.fi -.in -2 - -.sp -.LP -It is specified as: -.sp -.in +2 -.nf -struct v_address { - caddr_t v_addr; /* base virtual address */ - struct as *v_as; /* pointer to address space */ - void *v_priv; /* priv data for shadow I/O */ -}; -.fi -.in -2 - -.SH ATTRIBUTES -.sp -.LP -See \fBattributes\fR(5) for descriptions of the following attributes: -.sp - -.sp -.TS -box; -c | c -l | l . -ATTRIBUTE TYPE ATTRIBUTE VALUE -_ -Interface Stability Obsolete -.TE - -.SH SEE ALSO -.sp -.LP -\fBddi_dma_addr_setup\fR(9F), \fBddi_dma_buf_setup\fR(9F), -\fBddi_dma_curwin\fR(9F), \fBddi_dma_free\fR(9F), \fBddi_dma_movwin\fR(9F), -\fBddi_dma_setup\fR(9F), \fBddi_dma_sync\fR(9F), \fBmutex\fR(9F) -.sp -.LP -\fIWriting Device Drivers\fR diff --git a/usr/src/man/man9s/ddi_dmae_req.9s b/usr/src/man/man9s/ddi_dmae_req.9s index 9969daa83b..e1cba837b3 100644 --- a/usr/src/man/man9s/ddi_dmae_req.9s +++ b/usr/src/man/man9s/ddi_dmae_req.9s @@ -1,10 +1,10 @@ '\" te +.\" Copyright 2014 Garrett D'Amore <garrett@damore.org> .\" Copyright (c) 2004, Sun Microsystems, Inc., All Rights Reserved -.\" Copyright 2012 Garrett D'Amore <garrett@damore.org>. All rights reserved. .\" 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_DMAE_REQ 9S "Feb 06, 2012" +.TH DDI_DMAE_REQ 9S "May 24, 2014" .SH NAME ddi_dmae_req \- DMA engine request structure .SH SYNOPSIS @@ -88,9 +88,9 @@ architecture supports the use of multiple \fBDMA\fR cookies in a single \fBI/O\fR transfer. A bus \fBDMA\fR engine can support this feature either with a fixed-length scatter/gather list, or by an interrupt chaining feature. A driver must determine whether its parent bus nexus supports this feature by -examining the scatter/gather list size returned in the \fBdlim_sgllen\fR member -of the \fBDMA\fR limit structure returned by the driver's call to -\fBddi_dmae_getlim()\fR. (See \fBddi_dma_lim_x86\fR(9S).) If the size of the +examining the scatter/gather list size returned in the \fBdma_attr_sgllen\fR +member of the \fBDMA\fR attributes structure returned by the driver's call to +\fBddi_dmae_getattr()\fR. (See \fBddi_dma_attr\fR(9S).) If the size of the scatter/gather list is 1, then no chaining is available. The driver must not specify the \fBDMAE_BUF_CHAIN\fR flag in the \fBddi_dmae_req\fR structure it passes to \fBddi_dmae_prog()\fR, and the driver need not provide a @@ -155,7 +155,7 @@ recommended. When breaking a \fBDMA\fR window into segments, the system arranges for the end of every segment whose number is an integral multiple of the scatter/gather list size to fall on a device-granularity boundary, as specified in the -\fBdlim_granular\fR field in the \fBddi_dma_lim_x86\fR(9S) structure. +\fBdma_attr_granular\fR field in the \fBddi_dma_attr\fR(9S) structure. .sp If the scatter/gather list size is 1 (either because no chaining is available or because the driver does not want to use the chaining feature), then the @@ -224,4 +224,4 @@ Architecture x86 .sp .LP \fBisa\fR(4), \fBattributes\fR(5), -\fBddi_dmae\fR(9F), \fBddi_dma_lim_x86\fR(9S), \fBddi_dma_req\fR(9S) +\fBddi_dmae\fR(9F), \fBddi_dma_attr\fR(9S) diff --git a/usr/src/pkg/manifests/system-kernel.man9f.inc b/usr/src/pkg/manifests/system-kernel.man9f.inc index 3101ae967d..db3f08a3e2 100644 --- a/usr/src/pkg/manifests/system-kernel.man9f.inc +++ b/usr/src/pkg/manifests/system-kernel.man9f.inc @@ -11,8 +11,8 @@ # # Copyright 2011, Richard Lowe -# Copyright 2012 Garrett D'Amore <garrett@damore.org>. All rights reserved. # Copyright 2012 Nexenta Systems, Inc. All rights reserved. +# Copyright 2014 Garrett D'Amore <garrett@damore.org> # file path=usr/share/man/man9f/ASSERT.9f @@ -197,7 +197,6 @@ file path=usr/share/man/man9f/ddi_io_get8.9f file path=usr/share/man/man9f/ddi_io_put8.9f file path=usr/share/man/man9f/ddi_io_rep_get8.9f file path=usr/share/man/man9f/ddi_io_rep_put8.9f -file path=usr/share/man/man9f/ddi_iomin.9f file path=usr/share/man/man9f/ddi_log_sysevent.9f file path=usr/share/man/man9f/ddi_map_regs.9f file path=usr/share/man/man9f/ddi_mem_get8.9f @@ -673,7 +672,6 @@ link path=usr/share/man/man9f/ddi_dmae_disable.9f target=ddi_dmae.9f link path=usr/share/man/man9f/ddi_dmae_enable.9f target=ddi_dmae.9f link path=usr/share/man/man9f/ddi_dmae_getattr.9f target=ddi_dmae.9f link path=usr/share/man/man9f/ddi_dmae_getcnt.9f target=ddi_dmae.9f -link path=usr/share/man/man9f/ddi_dmae_getlim.9f target=ddi_dmae.9f link path=usr/share/man/man9f/ddi_dmae_prog.9f target=ddi_dmae.9f link path=usr/share/man/man9f/ddi_dmae_release.9f target=ddi_dmae.9f link path=usr/share/man/man9f/ddi_dmae_stop.9f target=ddi_dmae.9f @@ -1181,8 +1179,6 @@ link path=usr/share/man/man9f/rw_tryupgrade.9f target=rwlock.9f link path=usr/share/man/man9f/samestr.9f target=SAMESTR.9f link path=usr/share/man/man9f/scsi_dmafree.9f target=scsi_dmaget.9f link path=usr/share/man/man9f/scsi_dname.9f target=scsi_cname.9f -link path=usr/share/man/man9f/scsi_hba_attach.9f \ - target=scsi_hba_attach_setup.9f link path=usr/share/man/man9f/scsi_hba_detach.9f \ target=scsi_hba_attach_setup.9f link path=usr/share/man/man9f/scsi_hba_fini.9f target=scsi_hba_init.9f diff --git a/usr/src/pkg/manifests/system-kernel.man9s.inc b/usr/src/pkg/manifests/system-kernel.man9s.inc index 88bc1a7747..f502ea2647 100644 --- a/usr/src/pkg/manifests/system-kernel.man9s.inc +++ b/usr/src/pkg/manifests/system-kernel.man9s.inc @@ -12,6 +12,7 @@ # # Copyright 2011, Richard Lowe # Copyright 2012 Nexenta Systems, Inc. All rights reserved. +# Copyright 2014 Garrett D'Amore <garrett@damore.org> # file path=usr/share/man/man9s/Intro.9s @@ -24,9 +25,6 @@ file path=usr/share/man/man9s/datab.9s file path=usr/share/man/man9s/ddi_device_acc_attr.9s file path=usr/share/man/man9s/ddi_dma_attr.9s file path=usr/share/man/man9s/ddi_dma_cookie.9s -file path=usr/share/man/man9s/ddi_dma_lim_sparc.9s -file path=usr/share/man/man9s/ddi_dma_lim_x86.9s -file path=usr/share/man/man9s/ddi_dma_req.9s file path=usr/share/man/man9s/ddi_dmae_req.9s file path=usr/share/man/man9s/ddi_fm_error.9s file path=usr/share/man/man9s/ddi_idevice_cookie.9s @@ -72,6 +70,5 @@ file path=usr/share/man/man9s/stroptions.9s file path=usr/share/man/man9s/tuple.9s file path=usr/share/man/man9s/uio.9s link path=usr/share/man/man9s/dblk.9s target=datab.9s -link path=usr/share/man/man9s/ddi_dma_lim.9s target=ddi_dma_lim_sparc.9s link path=usr/share/man/man9s/intro.9s target=Intro.9s link path=usr/share/man/man9s/mblk.9s target=msgb.9s diff --git a/usr/src/uts/common/io/scsi/impl/scsi_hba.c b/usr/src/uts/common/io/scsi/impl/scsi_hba.c index 252bd5316e..2c7bdb0f2e 100644 --- a/usr/src/uts/common/io/scsi/impl/scsi_hba.c +++ b/usr/src/uts/common/io/scsi/impl/scsi_hba.c @@ -21,7 +21,7 @@ /* * Copyright (c) 1994, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012 Garrett D'Amore <garrett@damore.org>. All rights reserved. + * Copyright 2014 Garrett D'Amore <garrett@damore.org> */ #include <sys/note.h> @@ -967,28 +967,6 @@ scsi_tran_ext_free( } /* - * Obsolete: Called by an HBA to attach an instance of the driver - * Implement this older interface in terms of the new. - */ -/*ARGSUSED*/ -int -scsi_hba_attach( - dev_info_t *self, - ddi_dma_lim_t *hba_lim, - scsi_hba_tran_t *tran, - int flags, - void *hba_options) -{ - ddi_dma_attr_t hba_dma_attr; - - bzero(&hba_dma_attr, sizeof (ddi_dma_attr_t)); - hba_dma_attr.dma_attr_burstsizes = hba_lim->dlim_burstsizes; - hba_dma_attr.dma_attr_minxfer = hba_lim->dlim_minxfer; - - return (scsi_hba_attach_setup(self, &hba_dma_attr, tran, flags)); -} - -/* * Common nexus teardown code: used by both scsi_hba_detach() on SCSA HBA node * and iport_postdetach_tran_scsi_device() on a SCSA HBA iport node (and for * failure cleanup). Undo scsa_nexus_setup in reverse order. diff --git a/usr/src/uts/common/io/scsi/impl/scsi_resource.c b/usr/src/uts/common/io/scsi/impl/scsi_resource.c index 356ffee8eb..cd58cd1981 100644 --- a/usr/src/uts/common/io/scsi/impl/scsi_resource.c +++ b/usr/src/uts/common/io/scsi/impl/scsi_resource.c @@ -78,8 +78,6 @@ scsi_alloc_consistent_buf(struct scsi_address *ap, /* * use i_ddi_mem_alloc() for now until we have an interface to * allocate memory for DMA which doesn't require a DMA handle. - * ddi_iopb_alloc() is obsolete and we want more flexibility in - * controlling the DMA address constraints. */ while (i_ddi_mem_alloc(pdip, &scsi_alloc_attr, datalen, ((callback == SLEEP_FUNC) ? 1 : 0), 0, NULL, diff --git a/usr/src/uts/common/io/scsi/impl/scsi_subr.c b/usr/src/uts/common/io/scsi/impl/scsi_subr.c index f1c7f20f85..48f866ed4a 100644 --- a/usr/src/uts/common/io/scsi/impl/scsi_subr.c +++ b/usr/src/uts/common/io/scsi/impl/scsi_subr.c @@ -343,9 +343,7 @@ get_pktiopb(struct scsi_address *ap, caddr_t *datap, int cdblen, int statuslen, /* * use i_ddi_mem_alloc() for now until we have an interface to allocate - * memory for DMA which doesn't require a DMA handle. ddi_iopb_alloc() - * is obsolete and we want more flexibility in controlling the DMA - * address constraints. + * memory for DMA which doesn't require a DMA handle. */ if (i_ddi_mem_alloc(pdip, &scsi_alloc_attr, datalen, ((func == SLEEP_FUNC) ? 1 : 0), 0, NULL, &local.b_un.b_addr, &rlen, diff --git a/usr/src/uts/common/io/scsi/targets/st.c b/usr/src/uts/common/io/scsi/targets/st.c index 15823ba402..ed376eee55 100644 --- a/usr/src/uts/common/io/scsi/targets/st.c +++ b/usr/src/uts/common/io/scsi/targets/st.c @@ -1690,9 +1690,7 @@ st_doattach(struct scsi_device *devp, int (*canwait)()) /* * use i_ddi_mem_alloc() for now until we have an interface to allocate - * memory for DMA which doesn't require a DMA handle. ddi_iopb_alloc() - * is obsolete and we want more flexibility in controlling the DMA - * address constraints. + * memory for DMA which doesn't require a DMA handle. */ (void) i_ddi_mem_alloc(devp->sd_dev, &st_alloc_attr, sizeof (struct seq_mode), ((km_flags == KM_SLEEP) ? 1 : 0), 0, diff --git a/usr/src/uts/common/io/warlock/ddi_dki_comm.inc b/usr/src/uts/common/io/warlock/ddi_dki_comm.inc index 75e51bdbbb..0562d7ca50 100644 --- a/usr/src/uts/common/io/warlock/ddi_dki_comm.inc +++ b/usr/src/uts/common/io/warlock/ddi_dki_comm.inc @@ -24,7 +24,7 @@ */ /* - * Copyright 2012 Garrett D'Amore <garrett@damore.org>. All rights reserved. + * Copyright 2014 Garrett D'Amore <garrett@damore.org> */ /* @@ -169,27 +169,6 @@ ddi_set_callback( } int -ddi_dma_map( - dev_info_t *a, - dev_info_t *b, - struct ddi_dma_req *c, - ddi_dma_handle_t *d) -{ - struct bus_ops *ops; - (*ops->bus_dma_map)(0, 0, 0, 0); -} - -int -ddi_dma_setup( - dev_info_t *a, - struct ddi_dma_req *b, - ddi_dma_handle_t *c) -{ - struct bus_ops *ops; - (*ops->bus_dma_map)(0, 0, 0, 0); -} - -int ddi_dma_mctl(dev_info_t *a, dev_info_t *b, ddi_dma_handle_t c, enum ddi_dma_ctlops d, off_t *e, size_t *f, caddr_t *g, uint_t h) @@ -199,27 +178,6 @@ ddi_dma_mctl(dev_info_t *a, dev_info_t *b, ddi_dma_handle_t c, } int -ddi_dma_kvaddrp(ddi_dma_handle_t h, off_t off, size_t len, caddr_t *kp) -{ - struct bus_ops *ops; - (*ops->bus_dma_ctl)(0, 0, 0, 0, 0, 0, 0, 0); -} - -int -ddi_dma_htoc(ddi_dma_handle_t h, off_t o, ddi_dma_cookie_t *c) -{ - struct bus_ops *ops; - (*ops->bus_dma_ctl)(0, 0, 0, 0, 0, 0, 0, 0); -} - -int -ddi_dma_coff(ddi_dma_handle_t h, ddi_dma_cookie_t *c, off_t *o) -{ - struct bus_ops *ops; - (*ops->bus_dma_ctl)(0, 0, 0, 0, 0, 0, 0, 0); -} - -int ddi_dma_get_error(ddi_dma_handle_t h, uint_t len, caddr_t errblk) { struct bus_ops *ops; @@ -227,14 +185,6 @@ ddi_dma_get_error(ddi_dma_handle_t h, uint_t len, caddr_t errblk) } int -ddi_dma_segtocookie(ddi_dma_seg_t seg, off_t *o, off_t *l, - ddi_dma_cookie_t *cookiep) -{ - struct bus_ops *ops; - (*ops->bus_dma_ctl)(0, 0, 0, 0, 0, 0, 0, 0); -} - -int ddi_dma_sync(ddi_dma_handle_t h, off_t o, size_t l, uint_t whom) { struct bus_ops *ops; @@ -242,42 +192,6 @@ ddi_dma_sync(ddi_dma_handle_t h, off_t o, size_t l, uint_t whom) } int -ddi_dma_free(ddi_dma_handle_t h) -{ - struct bus_ops *ops; - (*ops->bus_dma_ctl)(0, 0, 0, 0, 0, 0, 0, 0); -} - -int -ddi_iopb_alloc(dev_info_t *dip, ddi_dma_lim_t *limp, uint_t len, caddr_t *iopbp) -{ - struct bus_ops *ops; - (*ops->bus_dma_ctl)(0, 0, 0, 0, 0, 0, 0, 0); -} - -void -ddi_iopb_free(caddr_t iopb) -{ - struct bus_ops *ops; - (*ops->bus_dma_ctl)(0, 0, 0, 0, 0, 0, 0, 0); -} - -int -ddi_mem_alloc(dev_info_t *dip, ddi_dma_lim_t *limits, uint_t length, - uint_t flags, caddr_t *kaddrp, uint_t *real_length) -{ - struct bus_ops *ops; - (*ops->bus_dma_ctl)(0, 0, 0, 0, 0, 0, 0, 0); -} - -void -ddi_mem_free(caddr_t kaddr) -{ - struct bus_ops *ops; - (*ops->bus_dma_ctl)(0, 0, 0, 0, 0, 0, 0, 0); -} - -int ddi_prop_op(dev_t dev, dev_info_t *dip, ddi_prop_op_t prop_op, int mod_flags, char *name, caddr_t valuep, int *lengthp) { diff --git a/usr/src/uts/common/os/sunddi.c b/usr/src/uts/common/os/sunddi.c index d30a9b1c2e..b60db8dcea 100644 --- a/usr/src/uts/common/os/sunddi.c +++ b/usr/src/uts/common/os/sunddi.c @@ -21,7 +21,7 @@ /* * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012 Garrett D'Amore <garrett@damore.org>. All rights reserved. + * Copyright 2014 Garrett D'Amore <garrett@damore.org> */ #include <sys/note.h> @@ -710,33 +710,6 @@ ddi_ctlops(dev_info_t *d, dev_info_t *r, ddi_ctl_enum_t op, void *a, void *v) * DMA/DVMA setup */ -#if defined(__sparc) -static ddi_dma_lim_t standard_limits = { - (uint_t)0, /* addr_t dlim_addr_lo */ - (uint_t)-1, /* addr_t dlim_addr_hi */ - (uint_t)-1, /* uint_t dlim_cntr_max */ - (uint_t)1, /* uint_t dlim_burstsizes */ - (uint_t)1, /* uint_t dlim_minxfer */ - 0 /* uint_t dlim_dmaspeed */ -}; -#elif defined(__x86) -static ddi_dma_lim_t standard_limits = { - (uint_t)0, /* addr_t dlim_addr_lo */ - (uint_t)0xffffff, /* addr_t dlim_addr_hi */ - (uint_t)0, /* uint_t dlim_cntr_max */ - (uint_t)0x00000001, /* uint_t dlim_burstsizes */ - (uint_t)DMA_UNIT_8, /* uint_t dlim_minxfer */ - (uint_t)0, /* uint_t dlim_dmaspeed */ - (uint_t)0x86<<24+0, /* uint_t dlim_version */ - (uint_t)0xffff, /* uint_t dlim_adreg_max */ - (uint_t)0xffff, /* uint_t dlim_ctreg_max */ - (uint_t)512, /* uint_t dlim_granular */ - (int)1, /* int dlim_sgllen */ - (uint_t)0xffffffff /* uint_t dlim_reqsizes */ -}; - -#endif - #if !defined(__sparc) /* * Request bus_dma_ctl parent to fiddle with a dma request. @@ -778,7 +751,7 @@ ddi_dma_mctl(dev_info_t *dip, dev_info_t *rdip, /*ARGSUSED*/ int ddi_dma_map(dev_info_t *dip, dev_info_t *rdip, - struct ddi_dma_req *dmareqp, ddi_dma_handle_t *handlep) + struct ddi_dma_req *dmareqp, ddi_dma_handle_t *handlep) { return (DDI_FAILURE); } @@ -931,26 +904,6 @@ ddi_dma_burstsizes(ddi_dma_handle_t handle) return (dimp->dmai_burstsizes); } -int -ddi_iomin(dev_info_t *a, int i, int stream) -{ - int r; - - /* - * Make sure that the initial value is sane - */ - if (i & (i - 1)) - return (0); - if (i == 0) - i = (stream) ? 4 : 1; - - r = ddi_ctlops(a, a, - DDI_CTLOPS_IOMIN, (void *)(uintptr_t)stream, (void *)&i); - if (r != DDI_SUCCESS || (i & (i - 1))) - return (0); - return (i); -} - /* * Given two DMA attribute structures, apply the attributes * of one to the other, following the rules of attributes diff --git a/usr/src/uts/common/sys/ddi_obsolete.h b/usr/src/uts/common/sys/ddi_obsolete.h index 7123b47af2..c1d63bfc48 100644 --- a/usr/src/uts/common/sys/ddi_obsolete.h +++ b/usr/src/uts/common/sys/ddi_obsolete.h @@ -3,7 +3,7 @@ * Use is subject to license terms. */ /* - * Copyright 2012 Garrett D'Amore <garrett@damore.org>. All rights reserved. + * Copyright 2014 Garrett D'Amore <garrett@damore.org> */ #ifndef _SYS_DDI_OBSOLETE_H @@ -23,23 +23,11 @@ extern "C" { #endif -/* - * The following are intentionally outside of _DDI_STRICT, they are obsolete - * and shouldn't be used by drivers, but are still used in the consolidation. - * e.g. DDI implementation. - */ -int ddi_iomin(dev_info_t *dip, int initial, int streaming); - - #ifndef _DDI_STRICT extern long strtol(const char *, char **, int); extern unsigned long strtoul(const char *, char **, int); -/* we'd really like to remove this; unbundled nexus drivers might have it */ -int ddi_dma_map(dev_info_t *dip, dev_info_t *rdip, - struct ddi_dma_req *dmareqp, ddi_dma_handle_t *handlep); - uint8_t ddi_mem_get8(ddi_acc_handle_t handle, uint8_t *host_addr); uint16_t ddi_mem_get16(ddi_acc_handle_t handle, uint16_t *host_addr); uint32_t ddi_mem_get32(ddi_acc_handle_t handle, uint32_t *host_addr); diff --git a/usr/src/uts/common/sys/ddidmareq.h b/usr/src/uts/common/sys/ddidmareq.h index e7b2b5f30f..56c8de3e34 100644 --- a/usr/src/uts/common/sys/ddidmareq.h +++ b/usr/src/uts/common/sys/ddidmareq.h @@ -22,7 +22,7 @@ * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved. */ /* - * Copyright 2012 Garrett D'Amore <garrett@damore.org>. All rights reserved. + * Copyright 2014 Garrett D'Amore <garrett@damore.org> */ #ifndef _SYS_DDIDMAREQ_H @@ -730,12 +730,12 @@ enum ddi_dma_ctlops { DDI_DMA_RELEASE, /* free preallocated DVMA range */ DDI_DMA_RESETH, /* obsolete - do not use */ DDI_DMA_CKSYNC, /* obsolete - do not use */ - DDI_DMA_IOPB_ALLOC, /* get contiguous DMA-able memory */ - DDI_DMA_IOPB_FREE, /* return contiguous DMA-able memory */ - DDI_DMA_SMEM_ALLOC, /* get contiguous DMA-able memory */ - DDI_DMA_SMEM_FREE, /* return contiguous DMA-able memory */ + DDI_DMA_IOPB_ALLOC, /* obsolete - do not use */ + DDI_DMA_IOPB_FREE, /* obsolete - do not use */ + DDI_DMA_SMEM_ALLOC, /* obsolete - do not use */ + DDI_DMA_SMEM_FREE, /* obsolete - do not use */ DDI_DMA_SET_SBUS64, /* 64 bit SBus support */ - DDI_DMA_REMAP, /* remap DMA buffers after relocation */ + DDI_DMA_REMAP, /* remap DVMA buffers after relocation */ /* * control ops for DMA engine on motherboard @@ -752,7 +752,7 @@ enum ddi_dma_ctlops { DDI_DMA_E_STOP, /* stop a channel of DMA engine */ DDI_DMA_E_DISABLE, /* disable channel of DMA engine */ DDI_DMA_E_GETCNT, /* get remaining xfer count */ - DDI_DMA_E_GETLIM, /* get DMA engine limits */ + DDI_DMA_E_GETLIM, /* obsolete - do not use */ DDI_DMA_E_GETATTR /* get DMA engine attributes */ }; diff --git a/usr/src/uts/common/sys/dma_engine.h b/usr/src/uts/common/sys/dma_engine.h index 80f75ec8ef..1793856079 100644 --- a/usr/src/uts/common/sys/dma_engine.h +++ b/usr/src/uts/common/sys/dma_engine.h @@ -21,7 +21,7 @@ */ /* - * Copyright 2012 Garrett D'Amore <garrett@damore.org>. All rights reserved. + * Copyright 2014 Garrett D'Amore <garrett@damore.org> */ /* @@ -138,16 +138,6 @@ struct dmae_chnl { */ /* - * Get DMA engine limits - * - * The limits of the DMA engine of the parent bus-nexus are copied into the - * provided structure. This should be called at driver attach time, - * rather than for each dma setup (breakup). - */ - -int ddi_dmae_getlim(dev_info_t *dip, ddi_dma_lim_t *limitsp); - -/* * Get DMA engine attributes * * The attributes of the DMA engine of the parent bus-nexus are copied into diff --git a/usr/src/uts/common/sys/scsi/conf/device.h b/usr/src/uts/common/sys/scsi/conf/device.h index 0caa5bda02..44942b7f35 100644 --- a/usr/src/uts/common/sys/scsi/conf/device.h +++ b/usr/src/uts/common/sys/scsi/conf/device.h @@ -22,6 +22,9 @@ * Copyright 2010 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright 2014 Garrett D'Amore <garrett@damore.org> + */ /* * SCSI device structure. @@ -99,9 +102,6 @@ struct scsi_device { * structure will be allocated and an INQUIRY command will be run to * fill it in. * - * The allocation will be done via ddi_iopb_alloc, so any manual - * freeing may be done by ddi_iopb_free. - * * The inquiry data is allocated/refreshed by scsi_probe/scsi_slave * and freed by uninitchild (inquiry data is no longer freed by * scsi_unprobe/scsi_unslave). diff --git a/usr/src/uts/common/sys/scsi/impl/transport.h b/usr/src/uts/common/sys/scsi/impl/transport.h index 044cff514e..58e146c907 100644 --- a/usr/src/uts/common/sys/scsi/impl/transport.h +++ b/usr/src/uts/common/sys/scsi/impl/transport.h @@ -20,6 +20,7 @@ */ /* * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2014 Garrett D'Amore <garrett@damore.org> */ #ifndef _SYS_SCSI_IMPL_TRANSPORT_H @@ -353,13 +354,6 @@ int scsi_hba_init( void scsi_hba_fini( struct modlinkage *modlp); -int scsi_hba_attach( - dev_info_t *hba_dip, - ddi_dma_lim_t *hba_lim, - scsi_hba_tran_t *tran, - int flags, - void *hba_options); - int scsi_hba_attach_setup( dev_info_t *hba_dip, ddi_dma_attr_t *hba_dma_attr, diff --git a/usr/src/uts/i86pc/io/isa.c b/usr/src/uts/i86pc/io/isa.c index 1def172dd6..c8888dded4 100644 --- a/usr/src/uts/i86pc/io/isa.c +++ b/usr/src/uts/i86pc/io/isa.c @@ -19,9 +19,9 @@ * CDDL HEADER END */ /* + * Copyright 2014 Garrett D'Amore <garrett@damore.org> * Copyright (c) 2012 Gary Mills * Copyright (c) 1992, 2010, Oracle and/or its affiliates. All rights reserved. - * Copyright 2012 Garrett D'Amore <garrett@damore.org>. All rights reserved. */ /* @@ -126,20 +126,6 @@ static uchar_t asy_intr_override = 0; /* * Local data */ -static ddi_dma_lim_t ISA_dma_limits = { - 0, /* address low */ - 0x00ffffff, /* address high */ - 0, /* counter max */ - 1, /* burstsize */ - DMA_UNIT_8, /* minimum xfer */ - 0, /* dma speed */ - (uint_t)DMALIM_VER0, /* version */ - 0x0000ffff, /* address register */ - 0x0000ffff, /* counter register */ - 1, /* sector size */ - 0x00000001, /* scatter/gather list length */ - (uint_t)0xffffffff /* request size */ -}; static ddi_dma_attr_t ISA_dma_attr = { DMA_ATTR_V0, @@ -578,7 +564,6 @@ isa_dma_mctl(dev_info_t *dip, dev_info_t *rdip, off_t *offp, size_t *lenp, caddr_t *objp, uint_t flags) { int rval; - ddi_dma_lim_t defalt; int arg = (int)(uintptr_t)objp; switch (request) { @@ -618,10 +603,6 @@ isa_dma_mctl(dev_info_t *dip, dev_info_t *rdip, i_dmae_swstart(rdip, arg); return (DDI_SUCCESS); - case DDI_DMA_E_GETLIM: - bcopy(&ISA_dma_limits, objp, sizeof (ddi_dma_lim_t)); - return (DDI_SUCCESS); - case DDI_DMA_E_GETATTR: bcopy(&ISA_dma_attr, objp, sizeof (ddi_dma_attr_t)); return (DDI_SUCCESS); @@ -639,14 +620,13 @@ isa_dma_mctl(dev_info_t *dip, dev_info_t *rdip, return (i_dmae_prog(rdip, &req1stpty, NULL, arg)); } - case DDI_DMA_IOPB_ALLOC: /* get contiguous DMA-able memory */ - case DDI_DMA_SMEM_ALLOC: - if (!offp) { - defalt = ISA_dma_limits; - offp = (off_t *)&defalt; - } - /*FALLTHROUGH*/ default: + /* + * We pass to rootnex, but it turns out that rootnex will just + * return failure, as we don't use ddi_dma_mctl() except + * for DMA engine (ISA) and DVMA (SPARC). Arguably we could + * just return an error direclty here, instead. + */ rval = ddi_dma_mctl(dip, rdip, handle, request, offp, lenp, objp, flags); } diff --git a/usr/src/uts/intel/ia32/os/ddi_i86.c b/usr/src/uts/intel/ia32/os/ddi_i86.c index d9fb6ca1f7..6fc5dd8788 100644 --- a/usr/src/uts/intel/ia32/os/ddi_i86.c +++ b/usr/src/uts/intel/ia32/os/ddi_i86.c @@ -23,6 +23,9 @@ * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ +/* + * Copyright 2014 Garrett D'Amore <garrett@damore.org> + */ #include <sys/conf.h> #include <sys/kmem.h> @@ -56,13 +59,6 @@ ddi_dmae_release(dev_info_t *dip, int chnl) } int -ddi_dmae_getlim(dev_info_t *dip, ddi_dma_lim_t *limitsp) -{ - return (ddi_dma_mctl(dip, dip, 0, DDI_DMA_E_GETLIM, 0, 0, - (caddr_t *)limitsp, 0)); -} - -int ddi_dmae_getattr(dev_info_t *dip, ddi_dma_attr_t *attrp) { return (ddi_dma_mctl(dip, dip, 0, DDI_DMA_E_GETATTR, 0, 0, diff --git a/usr/src/uts/intel/io/dktp/dcdev/dadk.c b/usr/src/uts/intel/io/dktp/dcdev/dadk.c index a496c3aba7..f74a0d4137 100644 --- a/usr/src/uts/intel/io/dktp/dcdev/dadk.c +++ b/usr/src/uts/intel/io/dktp/dcdev/dadk.c @@ -1053,9 +1053,7 @@ dadk_iob_alloc(opaque_t objp, daddr_t blkno, ssize_t xfer, int kmsflg) bp->b_un.b_addr = 0; /* * use i_ddi_mem_alloc() for now until we have an interface to allocate - * memory for DMA which doesn't require a DMA handle. ddi_iopb_alloc() - * is obsolete and we want more flexibility in controlling the DMA - * address constraints.. + * memory for DMA which doesn't require a DMA handle. */ if (i_ddi_mem_alloc((dadkp->dad_sd)->sd_dev, &dadk_alloc_attr, (size_t)iobp->b_pbytecnt, ((kmsflg == KM_SLEEP) ? 1 : 0), 0, NULL, diff --git a/usr/src/uts/sun4/os/ddi_impl.c b/usr/src/uts/sun4/os/ddi_impl.c index 6769c48b9d..2c64ae3556 100644 --- a/usr/src/uts/sun4/os/ddi_impl.c +++ b/usr/src/uts/sun4/os/ddi_impl.c @@ -24,7 +24,7 @@ * Use is subject to license terms. */ /* - * Copyright 2012 Garrett D'Amore <garrett@damore.org>. All rights reserved. + * Copyright 2014 Garrett D'Amore <garrett@damore.org> */ /* @@ -1131,6 +1131,30 @@ kfreea(void *addr) vmem_free(big_endian_arena, (void *)saddr[-2], saddr[-1]); } +/* + * This used to be ddi_iomin, but we were the only remaining caller, so + * we've made it private and moved it here. + */ +static int +i_ddi_iomin(dev_info_t *a, int i, int stream) +{ + int r; + + /* + * Make sure that the initial value is sane + */ + if (i & (i - 1)) + return (0); + if (i == 0) + i = (stream) ? 4 : 1; + + r = ddi_ctlops(a, a, + DDI_CTLOPS_IOMIN, (void *)(uintptr_t)stream, (void *)&i); + if (r != DDI_SUCCESS || (i & (i - 1))) + return (0); + return (i); +} + int i_ddi_mem_alloc(dev_info_t *dip, ddi_dma_attr_t *attr, size_t length, int cansleep, int flags, @@ -1181,7 +1205,7 @@ i_ddi_mem_alloc(dev_info_t *dip, ddi_dma_attr_t *attr, iomin = 1 << (ddi_fls(iomin) - 1); iomin = maxbit(iomin, attr->dma_attr_minxfer); iomin = maxbit(iomin, attr->dma_attr_align); - iomin = ddi_iomin(dip, iomin, streaming); + iomin = i_ddi_iomin(dip, iomin, streaming); if (iomin == 0) return (DDI_FAILURE); |