/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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
* 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]
*
* CDDL HEADER END
*/
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* These routines handle IO mapped memory. They include routines to alloc and
* free IO mapped memory and a routine to get the adapters default dma
* attributes. These routines are meant to be called from the base context.
* They should not be called from an interrupt handler.
*/
/*
* hci1394_buffer_attr_get()
* returns (in dma_attr) the default DMA attributes for this adapter.
*/
void
{
dma_attr->dma_attr_flags = 0;
/* XXX - Not sure why x86 wants the dma_attr_seg to be 0x7FFF?? */
#endif
}
/*
* hci1394_buf_alloc()
* Allocate an IO mapped buffer. drvinfo is passed in and contains generic
* driver info, like dip, instance, buf_attr, etc. Parms is passed in and
* contains the input parameters for alloc, ow much memory to alloc, how many
* cookies can we handle, and alignment requirements. info is returned with
* all the info about the mapped buffer. handle is returned. It should be
* used when calling hci1394_buf_free().
*/
int
{
int status;
/* alloc the space to keep track of the buffer */
/* setup the return parameter */
/* save away pointer to general info */
/* Get the default DMA attributes and override sgllen and alignment */
if (status != DDI_SUCCESS) {
"");
"");
return (DDI_FAILURE);
}
if (status != DDI_SUCCESS) {
"");
"");
return (DDI_FAILURE);
}
&info->bi_cookie_count);
if (status != DDI_SUCCESS) {
"");
"");
return (DDI_FAILURE);
}
/* setup rest of buffer info returned to caller */
return (DDI_SUCCESS);
}
/*
* hci1394_buf_free()
* Free IO mapped buffer. Notice that a pointer to the handle is used for
* the parameter. free() will set your handle to NULL before returning.
*/
void
{
/* free the space to keep track of the buffer */
/* set the handle to NULL to help catch bugs */
}