npi_espc.c revision 4496171313bed39e96f21bc2f9faf2868e267ae3
/*
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <npi_espc.h>
#include <nxge_espc.h>
{
return (NPI_SUCCESS);
}
{
return (NPI_SUCCESS);
}
{
if ((addr & ~EPC_EEPROM_ADDR_BITS) != 0) {
" npi_espc_eerprom_entry"
" Invalid input addr <0x%x>\n",
addr));
return (NPI_FAILURE | NPI_ESPC_EEPROM_ADDR_INVALID);
}
*data;
if ((val & EPC_WRITE_COMPLETE) == 0) {
" npi_espc_eeprom_entry"
" HW Error: EEPROM_WR <0x%x>\n",
val));
return (NPI_FAILURE | NPI_ESPC_EEPROM_WRITE_FAILED);
}
if ((val & EPC_READ_COMPLETE) == 0) {
" npi_espc_eeprom_entry"
" HW Error: EEPROM_RD <0x%x>",
val));
return (NPI_FAILURE | NPI_ESPC_EEPROM_READ_FAILED);
}
} else {
" npi_espc_eeprom_entry"
" Invalid Input addr <0x%x>\n", addr));
return (NPI_FAILURE | NPI_ESPC_OPCODE_INVALID);
}
return (NPI_SUCCESS);
}
{
return (NPI_SUCCESS);
}
{
val &= NUM_PORTS_MASK;
return (NPI_SUCCESS);
}
{
return (NPI_SUCCESS);
}
{
int i, j;
val &= MOD_STR_LEN_MASK;
if (str_len > MAX_MOD_STR_LEN) {
" npi_espc_model_str_get"
" Model string length %d exceeds max %d\n",
return (NPI_FAILURE | NPI_ESPC_STR_LEN_INVALID);
}
/*
* Might have to reverse the order depending on how the string
* is written.
*/
for (i = 0, j = 0; i < str_len; j++) {
}
return (NPI_SUCCESS);
}
{
int i, j;
if (str_len > MAX_BD_MOD_STR_LEN) {
" npi_espc_model_str_get"
" Board Model string length %d "
"exceeds max %d\n",
return (NPI_FAILURE | NPI_ESPC_STR_LEN_INVALID);
}
/*
* Might have to reverse the order depending on how the string
* is written.
*/
for (i = 0, j = 0; i < str_len; j++) {
}
return (NPI_SUCCESS);
}
{
return (NPI_SUCCESS);
}
{
if (!IS_PORT_NUM_VALID(portn)) {
" npi_espc_port_phy_type_get"
" Invalid Input: portn <%d>",
portn));
return (NPI_FAILURE | NPI_ESPC_PORT_INVALID);
}
switch (portn) {
case 0:
break;
case 1:
break;
case 2:
break;
case 3:
break;
default:
" npi_espc_port_phy_type_get"
" Invalid Input: portn <%d>",
portn));
return (NPI_FAILURE | NPI_ESPC_PORT_INVALID);
}
return (NPI_SUCCESS);
}
{
val &= MAX_FM_SZ_MASK;
return (NPI_SUCCESS);
}
{
val &= VER_NUM_MASK;
return (NPI_SUCCESS);
}
{
val &= IMG_SZ_MASK;
return (NPI_SUCCESS);
}
{
val &= CHKSUM_MASK;
return (NPI_SUCCESS);
}
{
return (NPI_SUCCESS);
}
void
{
int i;
"Dumping SEEPROM registers directly:\n\n"));
for (i = 0; i < 23; i++) {
"reg[%d] 0x%llx\n",
i, val & 0xffffffff));
}
}
{
return (reg_val);
}