/*
* CDDL HEADER START
*
* 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
* 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 © 2003-2011 Emulex. All rights reserved. */
/*
* Source file containing the implementation of Driver buffer management
* and related helper functions
*/
#include <oce_impl.h>
DMA_ATTR_V0, /* version number */
0x0000000000000000ull, /* low address */
0xFFFFFFFFFFFFFFFFull, /* high address */
0x00000000FFFFFFFFull, /* dma counter max */
OCE_DMA_ALIGNMENT, /* alignment */
0x00000FFF, /* burst sizes */
0x00000001, /* minimum transfer size */
0x00000000FFFFFFFFull, /* maximum transfer size */
0xFFFFFFFFFFFFFFFFull, /* maximum segment size */
0x00000001, /* granularity */
0 /* DMA flags */
};
};
/*
* function to allocate a dma buffer for mapping memory va-pa
*
* dev - software handle to device
* size - size of the memory to map
* flags - DDI_DMA_CONSISTENT/DDI_DMA_STREAMING
*
* return pointer to a oce_dma_buf_t structure handling the map
* NULL => failure
*/
{
int ret = 0;
/* if NULL use default */
}
return (NULL);
}
/* allocate dma handle */
if (ret != DDI_SUCCESS) {
"Failed to allocate DMA handle");
goto handle_fail;
}
/* allocate the DMA-able memory */
if (ret != DDI_SUCCESS) {
"Failed to allocate DMA memory");
goto alloc_fail;
}
/* bind handle */
if (ret != DDI_DMA_MAPPED) {
"Failed to bind dma handle");
goto bind_fail;
}
/* usable length */
return (dbuf);
return (NULL);
} /* oce_dma_alloc_buffer */
/*
* function to delete a dma buffer
*
* dev - software handle to device
* dbuf - dma obj to delete
*
* return none
*/
void
{
return;
}
}
}
}
} /* oce_free_dma_buffer */
/*
* function to create a ring buffer
*
* dev - software handle to the device
* num_items - number of items in the ring
* item_size - size of an individual item in the ring
* flags - DDI_DMA_CONSISTENT/DDI_DMA_STREAMING for ring memory
*
* return pointer to a ring_buffer structure, NULL on failure
*/
{
/* allocate the ring buffer */
return (NULL);
}
/* get the dbuf defining the ring */
"Ring buffer allocation failed");
goto dbuf_fail;
}
/* fill the rest of the ring */
return (ring);
return (NULL);
} /* create_ring_buffer */
/*
* function to destroy a ring buffer
*
* dev - software handle to teh device
* ring - the ring buffer to delete
*
* return none
*/
void
{
/* free the dbuf associated with the ring */
/* free the ring itself */
} /* destroy_ring_buffer */
/*
* function to enable the fma flags
* fm_caps - FM capability flags
*
* return none
*/
void
{
if (fm_caps == DDI_FM_NOT_CAPABLE) {
return;
}
if (DDI_FM_DMA_ERR_CAP(fm_caps)) {
} else {
}
} /* oce_set_dma_fma_flags */