/*
* 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.
*/
#include <cmd_mem.h>
#include <cmd_branch.h>
#include <cmd_dimm.h>
#include <cmd.h>
#include <cmd_hc_sun4v.h>
#include <errno.h>
#include <string.h>
#include <strings.h>
#include <fcntl.h>
#include <unistd.h>
/*
* mbd_label: If a DIMM associated with this branch is located on a memory
* expansion board or riser board, return (pointer to) the label of that board;
* otherwise return NULL.
* We assume that there will be at most one such board for any branch.
*/
char *
{
char *p;
size_t s;
*(p + s) = '\0';
return (p);
}
}
return (NULL);
}
void
{
return;
}
void
{
return;
}
}
"Attempt to disconnect dimm from non-parent branch\n");
}
static cmd_dimm_t *
{
return (dimm);
}
}
return (NULL);
}
static int br_dimmcount;
/*ARGSUSED*/
static int
{
char *lbl, *p, *q;
int err;
char **serids;
return (TOPO_WALK_NEXT); /* no label, try next */
return (TOPO_WALK_NEXT);
}
/*
* Massage the unum of the candidate DIMM as follows:
* a) remove any trailing J number. Use result for cmd_dimm_t.
* b) for branch membership purposes only, remove reference to
* a riser card (MR%d) if one exists.
*/
} else {
}
(void) strcpy(p, q);
else
*p = '\0';
}
/*
* For benefit of Batoka-like platforms, start comparison with
* "CMP", so that any leading "MEM" or "CPU" makes no difference.
*/
}
return (TOPO_WALK_NEXT);
}
/*
* The cmd_dimm_t structure created for a DIMM in a branch never has a
* Jxxx in its unum; the cmd_dimm_t structure created for a DIMM containing
* a page, or in a bank (i.e. for ECC errors)-always-has a Jxxx in its
* unum. Therefore the set of cmd_dimm_t's created for a branch is always
* the cmd_dimm_create will never link a 'branch' cmd_dimm_t into bank.
* Faulting a DIMM for ECC will not prevent subsequent faulting of "same"
*/
static int
{
return (0);
== NULL) {
return (0);
}
;
return (dimm_count);
}
/*ARGSUSED*/
static int
{
char *lbl;
int err;
return (TOPO_WALK_NEXT); /* no label, try next */
return (TOPO_WALK_TERMINATE);
}
return (TOPO_WALK_NEXT);
}
static nvlist_t *
{
int err;
br_memb_nvl = NULL;
}
return (br_memb_nvl);
}
static void
{
}
}
}
/*
* For t5440, the memory channel goes like this:
* VF -> cpuboard -> D0 -> motherboard -> memboard -> D[1..3]
* If there is a dimm on the memory board, the memory board,
* motherboard, cpuboard, and dimms are in the suspect list.
* If there is no dimm on the memory board, the cpu board and
* the dimms are in the suspect list
* The board certainty = total board certainty / number of
* the faulty boards in the suspect list.
*/
void
{
int dimm_count = 0;
/* attach the dimms to the branch */
/*
* Batoka with memory expansion. CPU expansion board will
* be added below. Add memory expansion board and motherboard
* FRUs here.
*/
/*
* Maramba or similar platform with mezzanine board.
* Motherboard FRU will be added below. Add the mezzanine
* board here.
*/
} else {
}
/*
* The code which follows adds to the suspect list the FRU which
* contains the ereport 'detector'. This can be either a CPU
* expansion board (Batoka), or motherboard (Huron, Maramba, or
* derivative).
*/
if (dimm_count != 0)
/* create dimm faults */
flt);
}
}
}
{
const char *b_unum;
return (NULL);
}
"branch_%s", b_unum);
b_unum);
(char **)&branch->branch_unum);
return (branch);
}
{
/*
*/
return (NULL);
return (branch);
}
return (NULL);
}
{
const char *unum;
return (NULL);
}
return (branch);
}
return (NULL);
}
static cmd_branch_t *
{
if (psz != sizeof (cmd_branch_pers_t)) {
"version 0 state (%u bytes).\n",
sizeof (cmd_branch_pers_t));
}
return (branch);
}
void *
{
break;
}
"not exist in saved state\n",
} else if (branchsz > CMD_BRANCH_MAXSIZE ||
"branch buffer referenced by case %s "
"is out of bounds (is %u bytes, max %u, min %u)\n",
}
}
switch (branch->branch_version) {
case CMD_BRANCH_VERSION_0:
break;
default:
"for branch state referenced by case %s.\n",
cp));
break;
}
}
switch (ptr->ptr_subtype) {
case CMD_PTR_BRANCH_CASE:
break;
default:
}
return (branch);
}
void
{
sizeof (cmd_branch_pers_t))
/* No need to rewrite the FMRIs in the branch - they don't change */
sizeof (cmd_branch_pers_t));
}
static void
{
}
}
static void
{
if (destroy) {
}
}
}
if (destroy)
}
void
{
}
/*ARGSUSED*/
static int
{
char *lbl, *p, *q;
int err;
return (TOPO_WALK_NEXT); /* no label, try next */
return (TOPO_WALK_NEXT);
}
/*
* for branch membership purposes only, remove reference to
* a riser card (MR%d) if one exists.
*/
(void) strcpy(p, q);
else
*p = '\0';
}
br_dimmcount++;
return (TOPO_WALK_TERMINATE);
}
return (TOPO_WALK_NEXT);
}
static int
{
int err;
return (0);
== NULL) {
return (0);
}
br_dimmcount = 0;
return (br_dimmcount);
}
/*
* If the case has been solved, don't need to check the dimmlist
* If the case has not been solved, the branch is valid if there is least one
* existing dimm in the branch
*/
void
{
continue;
continue;
}
}
void
{
}
void
{
}