px_msiq.c revision d17daf0b0e859a92357ab542e9070251d02dfa1f
/*
* 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 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
*/
#include <sys/sysmacros.h>
#include <sys/ddi_impldefs.h>
#include "px_obj.h"
/*
* px_msiq_attach()
*/
int
{
/*
* Check for all MSIQ related properties and
* save all information.
*
* Avaialble MSIQs and its properties.
*/
return (DDI_FAILURE);
/*
* 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_resume()
*/
void
{
int i;
for (i = 0; i < msiq_state_p->msiq_cnt; i++) {
}
}
/*
* px_msiq_alloc()
*/
int
{
int i;
/*
* The first MSG EQ is dedicated to PCIE_MSG_CODE_ERR_COR
* messages. All other messages will be spread across
* the remaining MSG EQs.
*/
if (msg_code == PCIE_MSG_CODE_ERR_COR) {
*msiq_id_p =
"px_msiq_alloc: msiq_id 0x%x\n", *msiq_id_p);
return (DDI_SUCCESS);
}
} else {
}
/* Allocate MSIQs */
break;
}
}
}
"px_msiq_alloc: msiq_id 0x%x\n", *msiq_id_p);
return (DDI_SUCCESS);
}
/*
* px_msiq_alloc_based_on_cpuid()
*/
int
{
int i;
"cpuid 0x%x\n", cpuid);
} else {
}
/* Allocate MSIQs */
}
}
if (*msiq_id_p == -1) {
if (free_msiq_id == -1) {
"px_msiq_alloc_based_on_cpuid: No EQ is available "
"for CPU 0x%x\n", cpuid);
return (DDI_EINVAL);
}
}
}
"px_msiq_alloc_based_on_cpuid: msiq_id 0x%x\n", *msiq_id_p);
return (DDI_SUCCESS);
}
/*
* px_msiq_free()
*/
int
{
"px_msiq_free: Invalid msiq_id 0x%x", msiq_id);
return (DDI_FAILURE);
}
return (DDI_SUCCESS);
}
/*
* px_msiq_redist()
*/
void
{
int i;
return;
for (i = 0; i < msiq_state_p->msiq_cnt; i++) {
if (ino_p) {
"sysino 0x%llx current cpuid 0x%x "
}
}
}
/*
* px_msiqid_to_devino()
*/
{
return (devino);
}
/*
* px_devino_to_msiqid()
*/
{
return (msiq_id);
}
/*
* px_msiq_get_props()
*/
static int
{
int length = sizeof (int);
int ret;
/* #msi-eqs */
DDI_PROP_DONTPASS, "#msi-eqs", 0);
/* msi-eq-size */
DDI_PROP_DONTPASS, "msi-eq-size", 0);
return (DDI_FAILURE);
/* msi-eq-to-devino: msi-eq#, devino# fields */
/*
* NOTE:
* On sun4u PCIe systems, the msi-eq-to-devino property is broken and
* these systems defines this property as msi-eq-devino.
*/
if (ret == DDI_PROP_NOT_FOUND) {
}
if (ret != DDI_PROP_SUCCESS) {
return (DDI_FAILURE);
}
return (DDI_SUCCESS);
}