/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <hpi_txdma.h>
#include <hxge_impl.h>
{
if (!TXDMA_CHANNEL_VALID(channel)) {
" hpi_txdma_log_page_handle_set"
" Invalid Input: channel <0x%x>", channel));
}
return (status);
}
{
" hpi_txdma_channel_reset" " RESETTING", channel));
}
{
}
{
}
{
}
{
}
{
if (!TXDMA_CHANNEL_VALID(channel)) {
" hpi_txdma_channel_control"
" Invalid Input: channel <0x%x>", channel));
}
switch (control) {
case TXDMA_INIT_RESET:
case TXDMA_INIT_START:
break;
case TXDMA_RESET:
/*
* Sets reset bit only (Hardware will reset all the RW bits but
* leave the RO bits alone.
*/
case TXDMA_START:
/* Enable the DMA channel */
break;
case TXDMA_STOP:
/* Disable the DMA channel */
if (status) {
"Cannot stop channel %d (TXC hung!)", channel));
}
break;
case TXDMA_MBOX_ENABLE:
/*
* Write 1 to MB bit to enable mailbox update (cleared to 0 by
* hardware after update).
*/
break;
default:
" hpi_txdma_channel_control"
" Invalid Input: control <0x%x>", control));
}
return (status);
}
{
if (!TXDMA_CHANNEL_VALID(channel)) {
" hpi_txdma_control_status"
" Invalid Input: channel <0x%x>", channel));
}
switch (op_mode) {
case OP_GET:
break;
case OP_SET:
break;
case OP_UPDATE:
break;
default:
" hpi_txdma_control_status"
" Invalid Input: control <0x%x>", op_mode));
}
return (status);
}
{
if (!TXDMA_CHANNEL_VALID(channel)) {
" hpi_txdma_event_mask Invalid Input: channel <0x%x>",
channel));
}
switch (op_mode) {
case OP_GET:
break;
case OP_SET:
break;
case OP_UPDATE:
break;
default:
" hpi_txdma_event_mask Invalid Input: eventmask <0x%x>",
op_mode));
}
return (status);
}
{
if (!TXDMA_CHANNEL_VALID(channel)) {
" hpi_txdma_ring_config"
" Invalid Input: channel <0x%x>", channel));
}
switch (op_mode) {
case OP_GET:
break;
case OP_SET:
break;
default:
" hpi_txdma_ring_config"
" Invalid Input: ring_config <0x%x>", op_mode));
}
return (status);
}
{
if (!TXDMA_CHANNEL_VALID(channel)) {
" hpi_txdma_mbox_config Invalid Input: channel <0x%x>",
channel));
}
switch (op_mode) {
case OP_GET:
break;
case OP_SET:
break;
default:
" hpi_txdma_mbox_config Invalid Input: mbox <0x%x>",
op_mode));
}
return (status);
}
/*
* This function is called to set up a transmit descriptor entry.
*/
{
int status;
if (status) {
" hpi_txdma_desc_gather_set"
" Invalid Input: gather_index <0x%x>", gather_index));
return (status);
}
if (transfer_len > TX_MAX_TRANSFER_LENGTH) {
" hpi_txdma_desc_gather_set"
" Invalid Input: tr_len <0x%x>", transfer_len));
return (HPI_FAILURE | HPI_TXDMA_XFER_LEN_INVALID);
}
if (gather_index == 0) {
"hpi_txdma_gather_set: SOP len %d (%d)",
}
"hpi_txdma_gather_set: xfer len %d to set (%d)",
return (status);
}
{
int i;
/*
* Assume no wrapped around.
*/
offset = 0;
for (i = 0; i < entries; i++) {
}
return (HPI_SUCCESS);
}
/*
* This function is called to get the transmit ring head index.
*/
{
if (!TXDMA_CHANNEL_VALID(channel)) {
" hpi_txdma_ring_head_get"
" Invalid Input: channel <0x%x>", channel));
}
return (status);
}
/*
* Dumps the contents of transmit descriptors.
*/
/*ARGSUSED*/
void
{
#ifdef HXGE_DEBUG
int xfer_len;
#endif
"\n==> hpi_txdma_dump_desc_one: dump "
#ifdef HXGE_DEBUG
#endif
"\t\tsad $%p\ttr_len %d len %d\tnptrs %d\tmark %d sop %d\n",
"\n<== hpi_txdma_dump_desc_one: Done \n"));
}
/*
* Static functions start here.
*/
static hpi_status_t
{
int loop = 0;
do {
/*
* Reset completes when this bit is set to 1 by hw
*/
return (HPI_SUCCESS);
}
loop++;
} while (loop < TXDMA_WAIT_LOOP);
if (loop == TXDMA_WAIT_LOOP) {
"hpi_txdma_control_reset_wait: RST bit not "
return (HPI_FAILURE | HPI_TXDMA_RESET_FAILED);
}
return (HPI_SUCCESS);
}
{
int loop = 0;
do {
return (HPI_SUCCESS);
}
loop++;
} while (loop < TXDMA_WAIT_LOOP);
if (loop == TXDMA_WAIT_LOOP) {
"hpi_txdma_control_stop_wait: SNG_STATE not "
return (HPI_FAILURE | HPI_TXDMA_STOP_FAILED);
}
return (HPI_SUCCESS);
}