xref: /titanic_41/usr/src/man/man9e/tran_dmafree.9e (revision a970c705050f9e90c4b6d7982a9b3211719353fb)
te
Copyright (c) 1997, 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]
TRAN_DMAFREE 9E "Aug 30, 1995"
NAME
tran_dmafree - SCSI HBA DMA deallocation entry point
SYNOPSIS

#include <sys/scsi/scsi.h>



 void prefixtran_dmafree(struct scsi_address *ap, struct scsi_pkt *pkt);
INTERFACE LEVEL

Solaris architecture specific (Solaris DDI).

ARGUMENTS
ap

A pointer to a scsi_address structure. See scsi_address(9S).

pkt

A pointer to a scsi_pkt structure. See scsi_pkt(9S).

DESCRIPTION

The tran_dmafree() vector in the scsi_hba_tran structure must be initialized during the HBA driver's attach() to point to an HBA entry point to be called when a target driver calls scsi_dmafree(9F). See attach(9E) and scsi_hba_tran(9S).

tran_dmafree() must deallocate any DMA resources previously allocated to this pkt in a call to tran_init_pkt(9E). tran_dmafree() should not free the structure pointed to by pkt itself. Since tran_destroy_pkt(9E) must also free DMA resources, it is important that the HBA driver keeps accurate note of whether scsi_pkt(9S) structures have DMA resources allocated.

SEE ALSO

attach(9E), tran_destroy_pkt(9E), tran_init_pkt(9E), scsi_dmafree(9F), scsi_dmaget(9F), scsi_hba_attach(9F), scsi_init_pkt(9F), scsi_address(9S), scsi_hba_tran(9S), scsi_pkt(9S)

Writing Device Drivers

NOTES

A target driver may call tran_dmafree() on packets for which no DMA resources were allocated.