px_msiq.c revision d8d130ae150c0b60b854d4f9ddf79224905e8f96
/*
* 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 <sys/ddi_impldefs.h>
#include "px_obj.h"
/*
* px_msiq_attach()
*/
int
{
int i, ret = DDI_SUCCESS;
/*
* Check for all MSIQ related properties and
* save all information.
*
* Avaialble MSIQs and its properties.
*/
/*
* 10% of available MSIQs are reserved for the PCIe messages.
*/
for (i = 0; i < msiq_state_p->msiq_cnt; i++) {
msiq_state_p->msiq_1st_msiq_id + i;
}
return (ret);
}
/*
* px_msiq_detach()
*/
void
{
"px_lib_msiq_fini: failed\n");
}
}
/*
* px_msiq_detach()
*/
void
{
int i;
for (i = 0; i < msiq_state_p->msiq_cnt; i++) {
}
}
/*
* px_msiq_alloc()
*/
int
{
int i;
} else {
}
/* Allocate MSIQs */
break;
}
}
/*
* There are no free MSIQ.
* Use next available MSIQ.
*/
if (i >= (first_msiq_id + msiq_cnt)) {
i = *next_msiq_index;
}
"px_msiq_alloc: msiq_id 0x%x\n", *msiq_id_p);
(*next_msiq_index)++;
return (DDI_SUCCESS);
}
/*
* px_msiq_free()
*/
int
{
"px_msiq_free: Invalid msiq_id 0x%x", msiq_id);
return (DDI_FAILURE);
}
return (DDI_SUCCESS);
}
/*
* px_msiqid_to_devino()
*/
{
return (devino);
}
/*
* px_devino_to_msiqid()
*/
{
return (msiq_id);
}
/*
* px_msiq_get_props()
*/
static void
{
int ret = DDI_SUCCESS;
int length = sizeof (int);
/* #msi-eqs */
/* msi-eq-size */
/* msi-eq-to-devino: msi-eq#, devino# fields */
&length);
if (ret == DDI_PROP_SUCCESS) {
} else {
}
}