ppc64-diag
Macros | Functions | Variables
diag_support.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>
#include <errno.h>
#include <ctype.h>
#include <librtas.h>
#include <sys/types.h>
#include <sys/wait.h>
#include "utils.h"
#include "rtas_errd.h"

Macros

#define CMD_LSVPD   "/usr/sbin/lsvpd"
 

Functions

void free_diag_vpd (struct event *event)
 
static int lsvpd_init (FILE **fp, pid_t *cpid)
 
static int lsvpd_term (FILE *fp, pid_t *cpid)
 
static int lsvpd_read (struct event *event, FILE *fp)
 
int get_diag_vpd (struct event *event, char *phyloc)
 
char * get_dt_status (char *dev)
 
int is_integrated (char *phy_loc)
 This function determines if the device is an integrated device or not. More...
 
void get_base_loc (char *phyloc, char *base)
 
char * diag_get_fru_pn (struct event *event, char *phyloc)
 

Variables

char target_status [80]
 

Detailed Description

Copyright (C) 2005, 2008 IBM Corporation

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Macro Definition Documentation

◆ CMD_LSVPD

#define CMD_LSVPD   "/usr/sbin/lsvpd"

Referenced by lsvpd_init().

Function Documentation

◆ diag_get_fru_pn()

char* diag_get_fru_pn ( struct event event,
char *  phyloc 
)

diag_fru_pn_by_ploc

Returns the FRU part number from VPD, as defined by the "FN" vpd keyword, for the FRU given by the physical location code

RETURNS: 0 if not found information. 1 if found information. -1 if error found during search

References event::diag_vpd, diag_vpd::fn, get_base_loc(), get_diag_vpd(), and is_integrated().

Referenced by add_more_descrs(), and set_srn_and_callouts().

◆ free_diag_vpd()

void free_diag_vpd ( struct event event)

◆ get_base_loc()

void get_base_loc ( char *  phyloc,
char *  base 
)

get_base_loc

FUNCTION: Reduce the given location code to the base physical FRU, thus removing the extended functional location information. Currently this works for CHRP physical location codes, but will need to updated for converged location codes.

Referenced by diag_get_fru_pn().

◆ get_diag_vpd()

int get_diag_vpd ( struct event event,
char *  phyloc 
)

◆ get_dt_status()

char* get_dt_status ( char *  dev)

References dbg, log_msg(), and target_status.

Referenced by process_pre_v6().

◆ is_integrated()

int is_integrated ( char *  phy_loc)

is_integrated RETURNS: 0 - Not integrated 1 - Is integrated -1 - System error obtaining data

References dbg.

Referenced by diag_get_fru_pn().

◆ lsvpd_init()

static int lsvpd_init ( FILE **  fp,
pid_t *  cpid 
)
static

References CMD_LSVPD, and dbg.

Referenced by get_diag_vpd().

◆ lsvpd_read()

static int lsvpd_read ( struct event event,
FILE *  fp 
)
static

◆ lsvpd_term()

static int lsvpd_term ( FILE *  fp,
pid_t *  cpid 
)
static

Referenced by get_diag_vpd().

Variable Documentation

◆ target_status

char target_status[80]

Referenced by get_dt_status().