[AIX 진단 서브시스템 11] 진단 라이브러리 (2) ODM·장치 구성·FRU 버킷 함수
https://archive.horanglab.com/posts/aix-diag-lib-2
핵심 정리
- ODM 함수(
diag_open_class,diag_get_list,diag_add_obj,diag_change_obj,diag_rm_obj,diag_free_list,diag_close_class)는odm_*호출을 감싼 것이며, 먼저init_dgodm(DA 시작 때odm_initialize)을 부르고 끝에term_dgodm을 부릅니다. 값을 바꿀 때는diag_get_list로 꺼내 고친 뒤diag_change_obj에 넘깁니다. diag_lock/diag_unlock은 파일 ODM 잠금이며, 잠금을 바로 얻지 못하면 5초 기다립니다.- 장치 구성:
configure_device/initial_state는 장치와 부모를 AVAILABLE로 올렸다가 되돌리고,diagex_cfg_state/diagex_initial_state는 장치(와 필요하면 자식)를 DIAGNOSE 상태로 만들었다가 원래 상태로 돌립니다.get_device_status는 CuDv status 값을 돌려줍니다. - FRU 버킷: SRN 보고는
insert_frub로 이름·소스 번호를 채운 뒤addfrub, FRU가 더 있으면add_more_frus. SRC 보고는fru_bucket_src를 모두 채워addfrub_src(insert_frub 없음). - SRN 형식은
SSS-RRR(sn-rcode)입니다. sn이 0이면 rcode를 10진, -1이면 4자리 16진, -2면 DAVars의Error_code에서 8자리 16진 오류 코드를 씁니다.
| 항목 | 내용 |
|---|---|
| 버전 | AIX 5.3, AIX 6.1 (내용이 같음) |
| 원문 | Understanding the Diagnostic Subsystem for AIX — 5.3판 3장(116130쪽), 6.1판 108122쪽 |
| 라이브러리 | /usr/lib/libdiag.a |
| 헤더 | diag/diagodm.h, diag/DiagODM.h, sys/cfgodm.h, sys/cfgdb.h, diag/diag.h, diag/da.h, diag/tm_input.h |
diag_add_obj
목적
객체 클래스에 새 객체를 더합니다.
구문
#include <diag/diagodm.h>
#include <sys/cfgodm.h>
#include <diag/DiagODM.h>
void diag_add_obj (
void * classp ,
void * p_ob j)
설명
diag_add_obj 서브루틴은 바꿀 객체 클래스를 나타내는 클래스 기호와, 더할 객체가 든 자료 구조의 포인터를 입력으로 받습니다.
참고: 이 서브루틴을 부르기 전에 init_dgodm을 불러야 합니다.
매개변수
| 매개변수 | 설명 |
|---|---|
classp |
diag_open_class 서브루틴이 돌려준 클래스 기호 식별자. diag_open_class를 부르지 않았으면, 보통 diag/diagodm.h, diag/DiagODM.h, sys/cfgodm.h 가운데 한 파일에 정의된 클래스의 구조체 이름입니다. |
p_obj |
classp 매개변수가 가리키는 객체 클래스에 해당하는 구조체 인스턴스의 포인터 |
반환값
성공하면 0, 실패하면 -1을 돌려줍니다.
영어 원문
diag_add_obj
Purpose
Adds a new object into an object class.
Syntax
#include <diag/diagodm.h>
#include <sys/cfgodm.h>
#include <diag/DiagODM.h>
void diag_add_obj (
void * classp ,
void * p_ob j)
Description
The diag_add_obj subroutine takes as input the class symbol that identifies the object class to change and a pointer to the data structure that contains the object to be added.
Note: init_dgodm must be called before starting this subroutine.
Parameters
- classp — A class symbol identifier returned from a
diag_open_classsubroutine. If thediag_open_classsubroutine has not been called, this is the structure name of the class normally defined in either diag/diagodm.h file, diag/DiagODM.h file or sys/cfgodm.h file. p_obj— Pointer to an instance of the structure corresponding to the object class referenced by the classp parameter.
Return Value
Upon successful completion, a value of 0 is returned. If the subroutine fails, a -1 is returned.
diag_change_obj
목적
객체 클래스의 객체를 바꿉니다.
구문
#include <diag/diagodm.h>
#include <sys/cfgodm.h>
#include <diag/DiagODM.h>
void diag_change_obj (
void * classp ,
void * p_obj )
설명
diag_change_obj 서브루틴은 객체 클래스를 나타내는 클래스 기호와, 바꿀 객체가 든 자료 구조의 포인터를 입력으로 받습니다. 응용 프로그램은 먼저 diag_get_list 서브루틴으로 객체를 꺼내고, 돌려받은 구조체의 데이터 값을 고친 다음, 그 구조체를 diag_change_obj 서브루틴에 넘겨야 합니다.
참고: 이 서브루틴을 부르기 전에 init_dgodm을 불러야 합니다.
매개변수
| 매개변수 | 설명 |
|---|---|
classp |
diag_open_class 서브루틴이 돌려준 클래스 기호 식별자. diag_open_class를 부르지 않았으면, 보통 diag/diagodm.h, diag/DiagODM.h, sys/cfgodm.h 가운데 한 파일에 정의된 클래스의 구조체 이름입니다. |
p_obj |
classp 매개변수가 가리키는 객체 클래스에 해당하는 구조체 인스턴스의 포인터 |
반환값
성공하면 0, 실패하면 -1을 돌려줍니다.
영어 원문
diag_change_obj
Purpose
Changes an object in the object class.
Syntax
#include <diag/diagodm.h>
#include <sys/cfgodm.h>
#include <diag/DiagODM.h>
void diag_change_obj (
void * classp ,
void * p_obj )
Description
The diag_change_obj subroutine takes, as input, the class symbol that identifies the object class to add to and a pointer to the data structure that contains the object to be changed. The application must first retrieve the object with a diag_get_list subroutine call, change the data values in the returned structure, and then pass that structure to the diag_change_obj subroutine.
Note: init_dgodm must be called before starting this subroutine.
Parameters
- classp — A class symbol identifier returned from a
diag_open_classsubroutine. If thediag_open_classsubroutine has not been called, then this is the structure name of the class normally defined in either the diag/diagodm.h file, diag/DiagODM.h file, or sys/cfgodm.h file. p_obj— Pointer to an instance of the structure corresponding to the object class referenced by the classp parameter.
Return Value
Upon successful completion, a value of 0 is returned. If the subroutine fails, a -1 is returned.
diag_close_class
목적
객체 클래스를 닫습니다.
구문
#include <diag/diagodm.h>
#include <sys/cfgodm.h>
#include <diag/DiagODM.h>
int diag_close_class (
void * classp )
설명
diag_close_class 서브루틴을 불러 객체 클래스를 닫을 수 있습니다.
참고: 이 서브루틴을 부르기 전에 init_dgodm을 불러야 합니다.
매개변수
| 매개변수 | 설명 |
|---|---|
classp |
diag_open_class 서브루틴이 돌려준 클래스 기호 식별자. diag_open_class를 부르지 않았으면, 보통 diag/diagodm.h, diag/DiagODM.h, sys/cfgodm.h 가운데 한 파일에 정의된 클래스의 구조체 이름입니다. |
반환값
성공하면 0, 실패하면 -1을 돌려줍니다.
영어 원문
diag_close_class
Purpose
Closes an object class.
Syntax
#include <diag/diagodm.h>
#include <sys/cfgodm.h>
#include <diag/DiagODM.h>
int diag_close_class (
void * classp )
Description
The diag_close_class subroutine can be called to close an object class.
Note: init_dgodm must be called before starting this subroutine.
Parameters
- classp — A class symbol identifier returned from a
diag_open_classsubroutine. If thediag_open_classsubroutine has not been called, then this is the structure name of the class normally defined in either the diag/diagodm.h file, diag/DiagODM.h file, or sys/cfgodm.h file.
Return Value
Upon successful completion, a value of 0 is returned. If the subroutine fails, a -1 is returned.
diag_free_list
목적
diag_get_list 서브루틴을 위해 할당했던 메모리를 해제합니다.
구문
#include <diag/diagodm.h>
#include <sys/cfgodm.h>
#include <diag/DiagODM.h>
int diag_free_list (
void * p_obj ,
struct listinfo * info )
설명
diag_free_list 서브루틴은 diag_get_list 서브루틴을 위해 할당한 메모리 객체 목록의 트리를 재귀적으로 해제합니다.
매개변수
| 매개변수 | 설명 |
|---|---|
p_obj |
diag_get_list 서브루틴이 돌려준 구조체 배열을 가리킵니다. |
info |
diag_get_list 서브루틴이 돌려준 listinfo 구조체를 가리킵니다. |
반환값
성공하면 0, 실패하면 -1을 돌려줍니다.
영어 원문
diag_free_list
Purpose
Frees memory previously allocated for a diag_get_list subroutine.
Syntax
#include <diag/diagodm.h>
#include <sys/cfgodm.h>
#include <diag/DiagODM.h>
int diag_free_list (
void * p_obj ,
struct listinfo * info )
Description
The diag_free_list subroutine recursively frees up a tree of memory object lists that were allocated for a diag_get_list subroutine.
Parameters
p_obj— Points to the array of structures returned from thediag_get_listsubroutine.- info — Points to the listinfo structure returned from the
diag_get_listsubroutine.
Return Value
Upon successful completion, a value of 0 is returned. If the subroutine fails, a -1 is returned.
diag_get_list
목적
객체 클래스에서 지정한 조건에 맞는 객체를 모두 꺼냅니다.
구문
#include <diag/diagodm.h>
#include <sys/cfgodm.h>
#include <diag/DiagODM.h>
void * diag_get_list (
void * classp,
char * criteria ,
struct listinfo * info ,
int max_expect ,
int depth )
설명
diag_get_list 서브루틴은 객체 클래스와 조건을 입력으로 받아 조건을 만족하는 객체 목록을 돌려줍니다. 객체 클래스가 열려 있지 않았으면 가져오기 앞뒤로 객체 클래스를 열고 닫습니다. 이미 열려 있었으면 돌아올 때 열린 채로 둡니다.
참고: 이 서브루틴을 부르기 전에 init_dgodm을 불러야 합니다.
매개변수
| 매개변수 | 설명 |
|---|---|
classp |
diag_open_class 서브루틴이 돌려준 클래스 기호 식별자. diag_open_class를 부르지 않았으면, 보통 diag/diagodm.h, diag/DiagODM.h, sys/cfgodm.h 가운데 한 파일에 정의된 클래스의 구조체 이름입니다. |
criteria |
객체를 고르는 조건이 든 문자열 |
info |
객체 가져오기에 관한 정보를 담은 구조체 |
max_expect |
돌려받을 것으로 예상하는 객체 수. 구조체 저장 공간을 할당하는 단위를 정해 realloc 서브루틴의 복사 부담을 줄이는 데 씁니다. |
depth |
연결 서술자(linking descriptor)가 있는 객체를 재귀로 따라갈 단계 수 |
반환값
성공하면 객체가 든 C 구조체 배열의 포인터를 돌려줍니다. 맞는 것이 없으면 NULL, diag_get_list가 실패하면 -1을 돌려줍니다.
영어 원문
diag_get_list
Purpose
Retrieves all objects in an object class that match the specified criteria.
Syntax
#include <diag/diagodm.h>
#include <sys/cfgodm.h>
#include <diag/DiagODM.h>
void * diag_get_list (
void * classp,
char * criteria ,
struct listinfo * info ,
int max_expect ,
int depth )
Description
The diag_get_list subroutine takes an object class and criteria as input, and returns a list of objects that satisfy the input criteria. The subroutine opens and closes the object class around the get if the object class was not previously opened. If the object class was previously opened, the subroutine leaves the object class open when it returns.
Note: init_dgodm must be called before starting this subroutine.
Parameters
- classp — Class symbol identifier returned from a
diag_open_classsubroutine. If thediag_open_classsubroutine has not been called, then this is the structure name of the class normally defined in either the diag/diagodm.h file, diag/DiagODM.h file, or sys/cfgodm.h file. - criteria — String that contains the qualifying criteria for selecting objects.
- info — Structure containing information about the retrieval of the objects.
max_expect— Expected number of objects to be returned. This is used to control the increments in which storage for structures is allocated, to reduce the realloc subroutine copy overhead.- depth — Number of levels to recurse for objects with linking descriptors.
Return Value
Upon successful completion, a pointer to an array of C language structures containing the objects is returned. If no match is found, NULL is returned. If the diag_get_list fails, a value of -1 is returned.
diag_lock
목적
지정한 파일의 ODM 잠금을 얻습니다.
구문
#include <diag/odmi.h>
int diag_lock(char *file)
설명
diag_lock 서브루틴은 지정한 파일에 odm_lock()을 부릅니다. 잠금을 바로 얻지 못하면 5초 기다립니다.
매개변수
| 매개변수 | 설명 |
|---|---|
file |
잠글 파일의 이름 |
반환값
| 값 | 뜻 |
|---|---|
| 0보다 큼 | 성공 |
| 0 | 파일이 이미 잠겨 있음 |
| -1 | 오류 |
영어 원문
diag_lock
Purpose
Obtain an ODM lock for the specified file
Syntax
#include <diag/odmi.h>
int diag_lock(char *file)
Description
The diag_lock subroutine calls odm_lock() for a specified file. It waits 5 seconds if a lock cannot be immediately granted.
Parameters
- file — Name of the file to lock
Return Value
The diag_lock subroutine returns one of the following values:
>0— If successful0— File is already locked-1— Error
diag_open_class
목적
객체 클래스를 엽니다.
구문
#include <diag/diagodm.h>
#include <sys/cfgodm.h>
#include <diag/DiagODM.h>
void *diag_open_class (
void * classp )
설명
diag_open_class 서브루틴을 불러 객체 클래스를 열 수 있습니다.
참고: 이 서브루틴을 부르기 전에 init_dgodm을 불러야 합니다.
매개변수
| 매개변수 | 설명 |
|---|---|
classp |
보통 diag/diagodm.h, diag/DiagODM.h, sys/cfgodm.h 가운데 한 파일에 정의된 클래스의 구조체 이름 |
반환값
성공하면 객체 클래스의 클래스 기호 식별자를, 실패하면 -1을 돌려줍니다.
영어 원문
diag_open_class
Purpose
Opens an object class.
Syntax
#include <diag/diagodm.h>
#include <sys/cfgodm.h>
#include <diag/DiagODM.h>
void *diag_open_class (
void * classp )
Description
The diag_open_class subroutine can be called to open an object class.
Note: init_dgodm must be called before starting this subroutine.
Parameters
- classp — The structure name of the class normally defined in either the diag/diagodm.h file, diag/DiagODM.h file, or sys/cfgodm.h file.
Return Value
Upon successful completion, a class symbol identifier for the object class is returned. If the subroutine fails, a -1 is returned.
diag_rm_obj
목적
객체 클래스에서 객체를 지웁니다.
구문
#include <diag/diagodm.h>
#include <sys/cfgodm.h>
#include <diag/DiagODM.h>
void diag_rm_obj (
void * classp ,
char * criteria )
설명
diag_rm_obj 서브루틴은 객체 클래스에서 객체를 지웁니다.
참고: 이 서브루틴을 부르기 전에 init_dgodm을 불러야 합니다.
매개변수
| 매개변수 | 설명 |
|---|---|
classp |
diag_open_class 서브루틴이 돌려준 클래스 기호 식별자. diag_open_class를 부르지 않았으면, 보통 diag/diagodm.h, diag/DiagODM.h, sys/cfgodm.h 가운데 한 파일에 정의된 클래스의 구조체 이름입니다. |
criteria |
지울 객체를 고르는 조건이 든 문자열 |
반환값
성공하면 지운 객체 수를, 실패하면 -1을 돌려줍니다.
영어 원문
diag_rm_obj
Purpose
Deletes objects from an object class.
Syntax
#include <diag/diagodm.h>
#include <sys/cfgodm.h>
#include <diag/DiagODM.h>
void diag_rm_obj (
void * classp ,
char * criteria )
Description
The diag_rm_obj subroutine deletes objects from an object class.
Note: init_dgodm must be called before starting this subroutine.
Parameters
- classp — Class symbol identifier returned from a
diag_open_classsubroutine. If thediag_open_classsubroutine has not been called, then this is the structure name of the class normally defined in either diag/diagodm.h file, diag/DiagODM.h file or sys/cfgodm.h file. - criteria — String containing the qualifying criteria for selecting objects to delete.
Return Value
Upon successful completion, the number of objects deleted is returned. If the subroutine fails, a -1 is returned.
diag_unlock
목적
ODM 잠금을 풉니다.
구문
#include <odmi.h>
int diag_unlock(int *id)
설명
diag_unlock 서브루틴은 ODM 잠금을 풉니다.
매개변수
| 매개변수 | 설명 |
|---|---|
id |
풀 잠금의 ID |
반환값
| 값 | 뜻 |
|---|---|
| 0 | 성공 |
| -1 | 잠금을 푸는 중 오류가 남 |
영어 원문
diag_unlock
Purpose
Release an ODM lock.
Syntax
#include <odmi.h>
int diag_unlock(int *id)
Description
The diag_unlock subroutine releases an odm lock.
Parameters
- id — Lock id to release
Return Value
The diag_unlock subroutine returns one of the following values:
0— If successful-1— Error occured while trying to unlock a lock
init_dgodm, term_dgodm
목적
ODM(Object Data Manager)을 초기화하거나 끝냅니다.
구문
int init_dgodm ( )
int term_dgodm ( )
설명
init_dgodm 서브루틴은 ODM에 odm_initialize 호출을 냅니다. 진단 응용 프로그램(DA)의 시작 부분에서 해야 합니다.
term_dgodm 서브루틴은 ODM에 odm_terminate 호출을 냅니다. DA의 끝에서 해야 합니다.
매개변수
매개변수가 없습니다.
반환값
늘 0을 돌려줍니다.
영어 원문
init_dgodm, term_dgodm
Purpose
Initializes or stops the Object Data Manager.
Syntax
int init_dgodm ( )
int term_dgodm ( )
Description
The init_dgodm subroutine issues an odm_initialize call to the Object Data Manager. This should be done at the beginning of the Diagnostic Application (DA).
The term_dgodm subroutine issues an odm_terminate call to the Object Data Manager. This should be done at the end of the DA.
Parameters
Takes no parameters.
Return Value
A value of 0 is always returned.
configure_device, initial_state
목적
장치와 그 부모 계통을 AVAILABLE 상태로 만들거나, 구성하기 전의 처음 상태로 되돌립니다.
구문
#include <diag/diagodm.h>
#include <sys/cfgodm.h>
#include <sys/cfgdb.h>
int configure_device ( name )
char * name ;
int initial_state ( state, name )
int state ;
char * name ;
설명
configure_device 서브루틴은 장치가 지금 DEFINED나 STOPPED 상태일 때 (시험을 위해) AVAILABLE 상태로 만듭니다. 장치의 부모 계통도 확인해 필요하면 그 상태도 AVAILABLE로 만듭니다.
initial_state 서브루틴은 (시험 뒤에) 장치와 부모 계통을 처음 상태로 되돌립니다.
매개변수
| 매개변수 | 설명 |
|---|---|
name |
장치를 나타냅니다. |
state |
장치의 이전 상태를 나타냅니다. |
반환값
| 값 | 뜻 |
|---|---|
| DEFINED | 장치가 이전에 DEFINED 상태였음 |
| AVAILABLE | 장치가 이미 AVAILABLE 상태임 |
| STOPPED | 장치가 이전에 STOPPED 상태였음 |
| -1 | 장치를 구성하다 오류가 남 |
영어 원문
configure_device, initial_state
Purpose
Puts a device and parentage into the available state.
Restores a device and parentage to their initial state before configuration.
Syntax
#include <diag/diagodm.h>
#include <sys/cfgodm.h>
#include <sys/cfgdb.h>
int configure_device ( name )
char * name ;
int initial_state ( state, name )
int state ;
char * name ;
Description
The configure_device subroutine is used to put a device into the AVAILABLE state (for testing) if the device is presently DEFINED or STOPPED. Also the parentage of the device is checked, and their states also put into AVAILABLE state if necessary.
The initial_state subroutine is used to restore the device and parentage back to their initial state (after testing).
Parameters
- name — Identifies the device.
- state — Indicates the previous state of the device.
Return Value
The following values are returned:
- DEFINED — Device was previously in the DEFINED state.
- AVAILABLE — Device is already in the AVAILABLE state.
- STOPPED — Device was previously in the STOPPED state.
- -1 — Error configuring the device.
diagex_cfg_state
목적
시험할 장치를 DIAGNOSE 상태로 만듭니다.
구문
#include <diag/diag.h>
int diagex_cfg_state ( device_name )
char * device_name ;
설명
diagex_cfg_state 서브루틴은 장치(와 필요하면 그 자식)의 구성을 풀어 장치를 DIAGNOSE 상태로 만듭니다. 바뀐 모든 장치의 원래 상태를 저장해 둡니다. 바뀐 장치를 원래 상태로 되돌리려면 diagex_initial_state를 씁니다.
전역 변수 diag_cfg_errno에는 장치에 대해 부른 메서드의 반환값이 들어갑니다.
매개변수
| 매개변수 | 설명 |
|---|---|
device_name |
시험할 장치의 이름 |
반환값
| 값 | 뜻 |
|---|---|
| 0 | 성공 |
| -1 | 소프트웨어 오류 |
| 1 | 자식 장치의 구성을 풀 수 없음 |
| 2 | 장치의 구성을 풀 수 없음 |
| 3 | 장치를 DIAGNOSE 상태로 만들 수 없음 |
영어 원문
diagex_cfg_state
Purpose
Puts the device under test in the DIAGNOSE state.
Syntax
#include <diag/diag.h>
int diagex_cfg_state ( device_name )
char * device_name ;
Description
The diagex_cfg_state subroutine unconfigures the device, and its children if necessary, to set the device into the DIAGNOSE state. Original states of all devices changed will be saved. Use diagex_initial_state to put the changed devices back to their original states.
The global variable diag_cfg_errno will be set to the return value of the method invoked for the device.
Parameters
device_name— Name of the device under test.
Return Value
The diagex_cfg_state subroutine returns one of the following values:
- 0 — Successful return.
- -1 — Software error.
- 1 — Child device cannot be unconfigured.
- 2 — Device cannot be unconfigured.
- 3 — Device cannot be put into DIAGNOSE state.
diagex_initial_state
목적
시험한 장치를 원래 상태로 되돌립니다.
구문
#include <diag/diag.h>
int diagex_initial_state ( device_name )
char * device_name ;
설명
diagex_initial_state 서브루틴은 장치(와 필요하면 그 자식)를 diagex_cfg_state 루틴을 부르기 전의 원래 상태로 되돌립니다.
매개변수
| 매개변수 | 설명 |
|---|---|
device_name |
시험할 장치의 이름 |
반환값
| 값 | 뜻 |
|---|---|
| 0 | 성공 |
| -1 | 소프트웨어 오류 |
| 4 | 장치를 DEFINE 상태로 되돌릴 수 없음 |
| 5 | 장치를 AVAILABLE 상태로 되돌릴 수 없음 |
| 6 | 자식 장치를 원래 상태로 되돌릴 수 없음 |
영어 원문
diagex_initial_state
Purpose
Puts the device under test back to its original state.
Syntax
#include <diag/diag.h>
int diagex_initial_state ( device_name )
char * device_name ;
Description
The diagex_initial_state subroutine puts the device, and its children if necessary, back to the original state before the diagex_cfg_state routine was called.
Parameters
device_name— Name of the device under test.
Return Value
The diagex_initial_state subroutine returns one of the following values:
- 0 — Successful return.
- -1 — Software error.
- 4 — Device cannot be restored to DEFINE state.
- 5 — Device cannot be restored to AVAILABLE state.
- 6 — Child device cannot be restored to original state.
get_device_status
목적
장치의 현재 구성 상태를 돌려줍니다.
구문
#include <sys/cfgdb.h>
int get_device_status ( device_name )
char * device_name ;
설명
get_device_status 서브루틴은 장치의 현재 구성 상태를 돌려줍니다. 상태는 장치의 CuDv status 필드 값입니다.
참고: 이 서브루틴을 부르기 전에 init_dgodm을 불러야 합니다.
매개변수
| 매개변수 | 설명 |
|---|---|
device_name |
장치 이름을 가리키는 문자 포인터 |
반환값
| 값 | 뜻 |
|---|---|
| DEFINED | 장치가 DEFINED 상태임 |
| AVAILABLE | 장치가 AVAILABLE 상태임 |
| STOPPED | 장치가 STOPPED 상태임 |
| DIAGNOSE | 장치가 DIAGNOSE 상태임 |
| -1 | 장치 상태를 얻다가 시스템 오류가 남 |
영어 원문
get_device_status
Purpose
Returns the device's current configuration status.
Syntax
#include <sys/cfgdb.h>
int get_device_status ( device_name )
char * device_name ;
Description
The get_device_status subroutine returns the current device configuration status. The status is obtained by returning the value of the CuDv status field of the device.
Note: init_dgodm must be called before starting this subroutine.
Parameters
device_name— Character pointer to the name of the device.
Return Value
The get_device_status subroutine returns one of the following values:
- DEFINED — Device is in the DEFINED state.
- AVAILABLE — Device is in the AVAILABLE state.
- STOPPED — Device is in the STOPPED state.
- DIAGNOSE — Device is in the DIAGNOSE state.
- -1 — System error obtaining device status.
addfrub
목적
FRU(현장 교체 단위) 목표를 마무리합니다.
구문
#include <diag/da.h>
int addfrub ( fptr )
struct fru_bucket * fptr ;
설명
addfrub 서브루틴은 지금 시험 중인 장치에 FRU를 연결합니다. 지금 시험 중인 장치는 TMInput 객체 클래스가 나타냅니다.
fru_bucket 구조체는 다음과 같이 정의되어 있습니다.
struct fru_bucket {
char dname[NAMESIZE];
short ftype;
short sn;
short rcode;
short rmsg;
struct {
int conf;
char fname[NAMESIZE];
char floc[LOCSIZE];
short fmsg;
char fru_flag;
char fru_exempt;
} frus[MAXFRUS];
};
매개변수
| 매개변수 | 설명 |
|---|---|
fptr |
fru_bucket 형 구조체의 포인터(위 정의) |
dname |
시험할 장치의 이름 |
ftype |
시스템에 더할 FRU 버킷의 유형. FRUB1: FRU에 고장 난 자원, 그 부모, 자원을 부모에 붙이는 데 필요한 케이블이 들어갑니다. FRUB2: FRUB1과 비슷하지만 부모 자원은 넣지 않습니다. |
sn |
고장의 소스 번호. 보통 insert_frub 서브루틴이 PdDv 객체 클래스의 led 필드로 설정합니다. insert_frub가 설정한 sn이 원하는 값이 아니면, 호출 서브루틴이 insert_frub 뒤, addfrub 앞에서 원하는 값으로 설정해야 합니다. |
rcode |
고장에 연결된 이유 코드(reason code). 아래 SRN 형식을 봅니다. |
rmsg |
이유 코드를 설명하는 텍스트의 메시지 번호. 텍스트의 세트 번호는 사전 정의 진단 자원(PDiagRes) 객체 클래스의 PSet 필드로 미리 정해집니다. |
conf |
FRU가 올바른지 나타냅니다. 0이면 올바르지 않은 FRU이며, FRU 버킷에서 올바르지 않은 FRU가 나오면 그 뒤의 FRU는 표시하지 않습니다. 다만 fname에 REF-CODE 문자열이 들어 있으면 fmsg와 conf 값으로 8자리 참조 코드를 만듭니다. |
fname |
FRU 이름. fname이 사용자 정의 장치(CuDv) 객체 클래스에 없으면 floc와 fmsg를 지정해야 하고, 있으면 둘 다 0으로 설정합니다. |
floc |
fname의 위치 |
fmsg |
fname을 설명하는 텍스트의 메시지 번호. 세트 번호는 PDiagRes 객체 클래스의 PSet 서술자로 미리 정해집니다. |
fru_flag |
진단 응용 프로그램(DA)이 frus[] 구조체에서 어느 FRU를 쓸지 정하는 플래그(아래 표) |
fru_exempt |
칩·FRU 통합으로 지정한 FRU가 흡수되지 않음을 나타냅니다(아래 표). |
반환값
성공하면 0을, 실패하면 -1을 돌려줍니다.
SRN 형식과 sn 값
서비스 요청 번호(SRN)는 SSS-RRR 형식이며 SSS는 sn, RRR은 rcode입니다. 어떤 장치는 SRN에 다른 명명법을 쓸 수 있는데, 이때는 sn 매개변수가 rcode 값의 형식을 정합니다.
| sn | rcode 해석 |
|---|---|
| 0 | 10진수 |
| -1 | 4자리 16진수 |
| -2 | DAVars 객체 클래스에서 Error_code 속성을 찾아 8자리 16진 오류 코드를 표시합니다. |
sn이 -2일 때는 진단 응용 프로그램이 다음과 비슷한 DAVars 객체를 만들어 둬야 합니다. 자세한 내용은 getdavar/putdavar 서브루틴을 봅니다.
DAVars:
dname: <시험할 장치 이름>
vname: Error_code "Error_code는 ASCII 문자열"
vtype: DIAG_STRING "리터럴 값"
val: <8자리 16진 문자열>
fru_flag 값
| 값 | 뜻 |
|---|---|
NOT_IN_DB |
FRU가 구성 데이터베이스에 없음 |
DA_NAME |
frus[].fname이 시험 중인 장치의 이름이어야 함 |
PARENT_NAME |
frus[].fname이 시험 중인 장치의 부모 이름이어야 함 |
CHILD_NAME |
frus[].fname이 시험 중인 장치의 자식 이름이어야 함 |
NO_FRU_LOCATION |
FRU 이름은 비워 두고, FRU 위치 코드는 시험 중인 장치(dname)의 위치로 설정함 |
fru_exempt 값
| 값 | 뜻 |
|---|---|
EXEMPT |
FRU를 통합할 수 없음(예: 퓨즈, 케이블, 디스플레이 등). 가장 많이 쓰는 값이며 fru_flag 필드와 함께 씁니다. |
NONEXEMPT |
FRU를 통합할 수 있음(대개 특정 칩셋) |
함께 쓰는 예:
| FRU | fru_flag | fru_exempt |
|---|---|---|
| 시험 중인 장치 | DA_NAME |
EXEMPT |
| 장치의 부모 | PARENT_NAME |
EXEMPT |
| 케이블 | NOT_IN_DB |
EXEMPT |
참고: DA가 MAXFRUS개의 FRU를 모두 돌려줄 필요는 없습니다. 진단 컨트롤러는 frus[]를 0부터 MAXFRUS-1까지, conf가 0보다 큰 동안 처리합니다.
영어 원문
addfrub
Purpose
Concludes a field replaceable unit (FRU) goal.
Syntax
#include <diag/da.h>
int addfrub ( fptr )
struct fru_bucket * fptr ;
Description
The addfrub subroutine associates a FRU with the device currently being tested. The TMInput object class identifies the device currently being tested.
Parameters
- fptr — Pointer to a structure of type
fru_bucket, which is defined as follows:struct fru_bucket { char dname[NAMESIZE]; short ftype; short sn; short rcode; short rmsg; struct { int conf; char fname[NAMESIZE]; char floc[LOCSIZE]; short fmsg; char fru_flag; char fru_exempt; } frus[MAXFRUS]; }; - dname — Names the device under test.
- ftype — Indicates the type of FRU Bucket being added to the system. The following values are defined: FRUB1 The FRUs include the resource that failed, its parent, and any cables needed to attach the resource to its parent. FRUB2 This FRU Bucket is similar to FRU Bucket FRUB1, but does not include the parent resource.
- sn — Source number of the failure. The source number is usually set to the led field of the PdDV object class by the
insert_frubsubroutine. If the sn set by theinsert_frubsubroutine is not the desired value, the calling subroutine should set sn to the desired value after theinsert_frubsubroutine and before the addfrub subroutine. - rcode — Reason code associated with the failure. Note: A Service Request Number is formatted as follows:
SSS - RRRwhere SSS is the sn and RRR is the rcode. Some devices may use a different nomenclature for their service request numbers. For this special case, the sn parameter indicates how the rcode value should be formatted. If sn = 0, then rcode is interpreted as decimal. If sn = -1, then rcode is interpreted as a 4-digit hexadecimal number. If sn = -2, then the object class DAVars is searched for an attribute of Errorcode. This allows the displaying of 8 digit hex Error Codes. The diagnostic application is responsible for setting up a DAVars object similar to the following: DAVars:dname: <device name under test> vname: Error_code "Error_code is an ascii string" vtype: DIAG_STRING "Literal value" val: <8 digit hex character string>See the getdavar/putdavar subroutine for more information. - rmsg — Message number of the text describing the reason code. The set number of the text is predefined by the PSet field in the Predefined Diagnostic Resources object class.
- conf — Indicates whether an FRU is valid. A value of 0 indicates an invalid FRU. No other FRUs are displayed once an invalid FRU is found in the FRU bucket. However, if fname contains the string REF-CODE, then the fmsg and conf values are used to make the 8-digit ref code.
- fname — Names the FRU. The parameters floc and fmsg must be specified, if fname is not represented in the Customized Devices object class. Otherwise, they should be set to 0.
- floc — Location of fname.
- fmsg — Message number of the text describing fname. The set number is predefined by the PSet descriptor in the Predefined Diagnostic Resources object class.
fru_flag— Flag used by the Diagnostic Applications (DA) in determining which FRU to use in the frus structure. The following values are defined:NOT_IN_DBThe FRU is not represented in the config database.DA_NAMEfrus.fname should be the name of the device being tested.PARENT_NAMEfrus.fname should be the name of the parent of the device being tested.CHILD_NAMEfrus.fname should be the name of the child of the device being tested.NO_FRU_LOCATIONThe FRU name will be left blank, and the FRU location code will be set to the location of the device under test (dname).fru_exempt— Indicates that the designated FRU will not be absorbed as a result of chip/FRU integration. The following values are defined: EXEMPT FRU cannot be integrated (For example, fuse, cable, displays, etc.) This value should be the most-used value, and should be used in conjunction with thefru_flagfield. Examples are:FRU fru_flag fru_exempt ---- -------- ---------- Device being tested DA_NAME EXEMPT Parent of device PARENT_NAME EXEMPT CABLE NOT_IN_DB EXEMPTNONEXEMPT FRU can be integrated (generally, any specific chip set).- Note: DAs do not have to return MAXFRU frus. The Diagnostic Controller processes frus from
0..MAXFRU-1, while conf>0.
Return Value
Upon successful completion, a value of 0 is returned. If the addfrub subroutine is unsuccessful, then a value of -1 is returned.
addfrub_src
목적
FRU 묶음을 플랫폼별 시스템 참조 코드(SRC)와 함께 마무리합니다.
구문
#include <diag/da.h>
int addfrub_src (fptr)
struct fru_bucket_src *fptr;
설명
addfrub_src 서브루틴은 지금 시험 중인 장치가 감지한 고장에 FRU 묶음을 연결합니다. 지금 시험 중인 장치는 TMInput 객체 클래스가 나타냅니다.
참고: 서비스 요청 번호(SRN)를 보고할 때는 addfrub()를 씁니다. 이때 addfrub() 전에 insert_frub()를 불러 fru_bucket 데이터 일부를 채웁니다. 시스템 참조 코드(SRC)를 보고할 때는 addfrub_src()를 씁니다. 이때는 호출자가 addfrub_src()를 부르기 전에 fru_bucket_src의 내용을 모두 채워야 하므로, fru_bucket_src에 해당하는 insert_frub 호출은 없습니다.
fru_bucket_src 구조체의 정의는 다음과 같습니다. addfrub_src를 부르기 전에 구조체 전체를 채워야 하며, 선택 값이나 모르는 값은 NULL(0)로 설정합니다.
struct fru_bucket_src {
char dname[NAMESIZE]; /* Resource Name */
char src[RPA_SRC_SIZE_NN]; /* Primary reference code */
unsigned int refc2; /* Extended reference code - word 2 */
unsigned int refc3; /* Extended reference code - word 3 */
unsigned int refc4; /* Extended reference code - word 4 */
unsigned int refc5; /* Extended reference code - word 5 */
unsigned int refc6; /* Extended reference code - word 6 */
unsigned int refc7; /* Extended reference code - word 7 */
unsigned int refc8; /* Extended reference code - word 8 */
unsigned int refc9; /* Extended reference code - word 9 */
int rmsg; /* Failure description */
char crid[2]; /* Platform error creator id */
unsigned int plid; /* Platform Log Id */
unsigned int subsysid; /* Subsystem Id */
unsigned int event_sev; /* Event Severity */
int action_flags; /* Error Action Flags */
int errlg_seq; /* Error Log Sequence Number */
frus_src_t *frus; /* Linked list of FRUs for SRC */
};
매개변수
| 매개변수 | 설명 |
|---|---|
fptr |
fru_bucket_src 형 구조체의 포인터(위 정의) |
dname |
시험할 장치의 이름 |
src |
시스템 참조 코드. 32자 문자열의 앞 8자가 1차 참조 코드(Primary Reference Code)입니다. 1차 참조 코드는 필수이고 나머지는 선택입니다. |
refc2 |
확장 참조 코드 워드 2(필수) |
refc3 - refc9 |
선택 사항인 확장 참조 코드 워드 3~9. 없으면 0이어야 합니다. |
rmsg |
고장을 설명하는 텍스트의 메시지 번호. 세트 번호는 PDiagRes 객체 클래스의 PSet 필드로 미리 정해집니다. |
crid |
고장을 보고하는 오류 로그를 만든 하위 시스템을 나타내는 ASCII 문자. 플랫폼 오류 로그 분석에서 나온 고장이 아니면 NULL(0) |
plid |
이 고장의 고유 식별자 |
subsysid |
플랫폼 오류 로그 하위 시스템 ID. 아니면 0 |
event_sev |
플랫폼 오류 로그 심각도. 아니면 0 |
action_flags |
이 고장의 보고 동작을 정하는 플래그. 값을 OR로 묶을 수 있습니다(아래 표). |
errlg_seq |
원래 오류의 오류 로그 순번 |
frus |
선택 사항인 FRU 연결 리스트(아래 frus_src_t 구조체). SRC가 고장과 해결 조치를 완전히 설명하면 필요 없습니다. |
반환값
| 값 | 뜻 |
|---|---|
| 0 | 성공 |
| -1 | addfrub_src 서브루틴이 실패 |
action_flags 값
| 값 | 뜻 |
|---|---|
RPA_REPORT_EXTERNALLY |
서비스 포컬 포인트 같은 외부 프로그램에 이 고장을 보고합니다. |
RPA_CALL_HOME_REQD |
RPA_REPORT_EXTERNALLY와 함께일 때만 유효하며, 이 고장을 IBM 서비스에 자동으로 보고합니다. |
NO_FAULT_INDICATOR |
plid가 0이고 이 비트가 설정되어 있으면 이 고장에 대해 시스템의 고장 표시등을 켜지 않습니다. |
frus_src_t 구조체
#include <diag/da.h>
int addfrub_src (fptr)
struct fru_bucket_src *fptr;
| 필드 | 설명 |
|---|---|
type |
FRU 유형(아래 표) |
priority |
FRU 교체·절차 우선순위(아래 표) |
loc |
위치 코드 |
pn |
FRU 재고 부품 번호(있으면). proc_id와 함께 쓰지 않습니다. |
proc_id |
절차 ID(있으면). pn과 함께 쓰지 않습니다. |
ccin |
CCIN(있고 pn이 있을 때만) |
sn |
FRU 일련 번호(있고 pn이 있을 때만) |
next_fru |
다음 frus_src 구조체의 포인터 |
type 값:
| 값 | 뜻 |
|---|---|
RPA_FRUTYPE_NORMAL |
일반 하드웨어 FRU |
RPA_FRUTYPE_CODE |
절차 ID 필드로 설명하는 코드 FRU |
RPA_FRUTYPE_C_PROC |
구성 절차가 필요함 |
RPA_FRUTYPE_M_PROC |
유지 보수 절차가 필요함 |
RPA_FRUTYPE_EXT |
외부 FRU |
RPA_FRUTYPE_EXT_CODE |
절차 필드로 설명하는 외부 코드 FRU |
RPA_FRUTYPE_TOOL |
목록의 다른 FRU에 필요한 도구 |
RPA_FRUTYPE_SYMBOL |
FRU를 구하거나 다루는 절차 ID |
priority 값:
| 값 | 뜻 |
|---|---|
| H | 높은 우선순위이며 반드시 호출(call-out). FRU 교체나 절차 수행이 필수입니다. H 우선순위 호출이 여럿이면 한 묶음으로 처리합니다. |
| M | 중간 우선순위. M 우선순위 FRU·절차는 주어진 순서대로 하나씩 처리합니다. |
| A | 중간 우선순위 묶음 A. 한 묶음으로 처리합니다. |
| B | 중간 우선순위 묶음 B. 한 묶음으로 처리합니다. |
| C | 중간 우선순위 묶음 C. 한 묶음으로 처리합니다. |
| L | 낮은 우선순위. 다른 우선순위 호출로 문제가 풀리지 않았을 때만 처리합니다. |
영어 원문
addfrub_src
Purpose
Concludes a collection of field replacement units (FRUs) with a platform specific System Reference Code (SRC).
Syntax
#include <diag/da.h>
int addfrub_src (fptr)
struct fru_bucket_src *fptr;
Description
The addfrub_src subroutine associates a collection of FRUs with a failure detected by the device currently being tested. The TMInput object class identifies the device currently being tested.
Note: addfrub() should be used when reporting a Service Request Number (SRN). insert_frub() should be called before addfrub() to fill in some of the fru_bucket data. addfrub_src() should be used when
reporting an System Reference Code (SRC). Then, entire contents of the fru_bucket_src should be filled in by the caller before calling addfrub_src(), thus there is no corresponding call to insert_frub for fru_bucket_src.
Parameters
- fptr — Pointer to a structure of type
fru_bucket_src, which is defined below. The entire structure must be filled out before callingaddfrub_src. Any optional or unknown values should be set to NULL (0).struct fru_bucket_src { char dname[NAMESIZE]; /* Resource Name */ char src[RPA_SRC_SIZE_NN];/* Primary reference code */ unsigned int refc2; /* Extended reference code - word 2 */ unsigned int refc3; /* Extended reference code - word 3 */ unsigned int refc4; /* Extended reference code - word 4 */ unsigned int refc5; /* Extended reference code - word 5 */ unsigned int refc6; /* Extended reference code - word 6 */ unsigned int refc7; /* Extended reference code - word 7 */ unsigned int refc8; /* Extended reference code - word 8 */ unsigned int refc9; /* Extended reference code - word 9 */ int rmsg; /* Failure description */ char crid[2]; /* Platform error creator id */ unsigned int plid; /* Platform Log Id */ unsigned int subsysid; /* Subsystem Id */ unsigned int event_sev;/* Event Severity */ int action_flags; /* Error Action Flags */ int errlg_seq; /* Error Log Sequence Number */ frus_src_t *frus; /* Linked list of FRUs for SRC */ }; - dname — Names the device under test.
- src — System Reference Code. The Primary Reference Code is the 1st 8 characters of this 32 character string. The Primary Reference Code is required, the remainder of the string is optional.
- refc2 — Extended reference code word 2 (required).
- refc3 - refc9 — Optional additional extended reference code words 3 - 9. Should be 0 if not present.
- rmsg — Message number of the text describing the failure. The set number of the text is predefined by the PSet field in the predefined Diagnostic Resources object class.
- crid — ASCII character representing the subsystem creating the error log reporting the failure. Use NULL (0) if this failure is not from platform error log analysis.
- plid — Unique identifier for this failure.
- subsysid — Platform Error Log Subsystem ID, otherwise 0.
event_sev— Platform Error Log Severity, otherwise 0.action_flags— Flags defining reporting action for this failure. The values can be or' ed together.RPA_REPORT_EXTERNALLY— Report this failure to external programs like the Service Focal Point.RPA_CALL_HOME_REQD— Only valid withRPA_REPORT_EXTERNALLY, this failure should be reported automatically to IBM Service.NO_FAULT_INDICATOR— If the plid is zero and this bit is set, the system's fault indicator will not be turned on for this failure.errlg_seqError log sequence number of originating error. frus Optional linked list of FRUs as described in the following structure. This list is not necessary if the SRC completely describes the
failure and resolution actions.
typedef struct frus_src
{
int type; /* RPA FRU type */
char priority; /* RPA FRU/Procedure Priority */
char loc[RPA_LOC_SIZE];/* Physical location code */
char pn[RPA_FRU_PN_SIZE]; /* FRU Stocking p/n */
char proc_id[RPA_PROC_SIZE]; /* Procedure Id */
char ccin[RPA_CCIN_SIZE_NN]; /* CCIN */
char sn[RPA_FRU_SN_SIZE_NN]; /* FRU Serial Number*/
struct frus_src *next_fru;
} frus_src_t;
- type — FRU type. One of the following:
RPA_FRUTYPE_NORMALNormal Hardware FRU.RPA_FRUTYPE_CODECode FRU described by procedure id field.RPA_FRUTYPE_C_PROCConfiguration procedure required.RPA_FRUTYPE_M_PROCMaintainence procedure required.RPA_FRUTYPE_EXTExternal FRU.RPA_FRUTYPE_EXT_CODEExternal code FRU described by procedure field.RPA_FRUTYPE_TOOLA tool required by another FRU in the list.RPA_FRUTYPE_SYMBOLProcedure id for acquiring or working with a FRU. - priority — FRU Replacement/Procedure Priority. One of the following: H High priority and mandatory call-out. Replacing the FRU, or performing the Procedure is mandatory. Multiple call-outs with H priority should be acted on as a group. M Medium priority. Each FRU/Procedure with M priority should be acted on, one at a time, in the order given. A Medium priority group A. Each FRU/Procedure with A priority should be acted on as a group. B Medium priority group B. Each FRU/Procedure with B priority should be acted on as a group. C Medium priority group C. Each FRU/Procedure with C priority should be acted on as a group. L Low priority. Each FRU/Procedure with L priority should be acted on only after all other priority call-outs have failed to resolve the problem.
- loc — Location code
- pn — FRU Stocking Part Number if available, mutually exclusive with
proc_id. proc_id— Procedure Id if available, mutually exclusive with pn.- ccin — CCIN, if available and only if pn is available.
- sn — FRU Serial Number, if available, and only if pn is available.
next_fru— Pointer to the nextfrus_srcstructure.
Return Value
- 0 — Upon successful completion.
- -1 — If the
addfrub_srcsubroutine is unsuccessful.
insert_frub
목적
FRU 버킷을 갱신합니다.
구문
#include <diag/tm_input.h>
#include <diag/da.h>
long insert_frub ( tminput , frub )
struct tm_input * tminput ;
struct fru_bucket * frub ;
설명
insert_frub 서브루틴은 사용자 정의 장치(CuDv) 객체 클래스에서 장치의 FRU 이름과 소스 번호를 가져와 fru_bucket 형 구조체에 넣습니다. 호출 루틴은 FRU 버킷 구조체의 fru_flag 멤버로 FRU 이름이 장치 x의 것인지 x의 FRU 부모의 것인지 지정합니다.
이 함수는 addfrub 전에 불러야 합니다.
매개변수
| 매개변수 | 설명 |
|---|---|
tminput |
장치 x를 나타냅니다(정확히는 tminput.dname). |
frub |
갱신할 FRU 버킷 구조체의 포인터 |
반환값
성공하면 0을, 아니면 -1을 돌려줍니다.
영어 원문
insert_frub
Purpose
Updates FRU Bucket.
Syntax
#include <diag/tm_input.h>
#include <diag/da.h>
long insert_frub ( tminput , frub )
struct tm_input * tminput ;
struct fru_bucket * frub ;
Description
The insert_frub subroutine gets a device's FRU name and source number from the Customized Device object class and places them into a structure of type fru_bucket. The calling routine specifies through the fru_flag member of the FRU Bucket structure whether the FRU name is for device x or the FRU parent of x.
Parameters
- tminput — Identifies the device x (specifically, tminput.dname).
- frub — Pointer to the FRU Bucket structure to be updated.
This function should be called before addfrub.
Return Value
Upon successful completion, a value of 0 is returned. Otherwise, a value of -1 is returned.
add_more_frus
목적
앞서 addfrub() 서브루틴으로 더한 FRU 버킷에 FRU를 더 넣습니다.
구문
#include <diag/da.h>
int add_more_frus(fptr)
struct fru_bucket *fptr);
설명
add_more_frus 서브루틴은 추가 FRU 묶음을 받아, 앞서 addfrub() 서브루틴으로 더한 기존 FRU 버킷에 넣습니다.
한 번 부를 때 MAXFRUS개까지 더할 수 있고, 여러 번 부를 수 있습니다. addfrub()를 부른 뒤에만 부릅니다. 입력 fru_bucket은 FRU 배열만 빼고 addfrub()에 보낸 것과 같은 데이터여야 합니다.
참고: 이 서브루틴을 부르기 전에 init_dgodm을 불러야 합니다.
매개변수
| 매개변수 | 설명 |
|---|---|
fptr |
addfrub() 호출에 쓴 것과 거의 같은 fru_bucket 형 구조체의 포인터. 다른 점은 기존 FRU 버킷에 더할 FRU가 든 FRU 배열뿐이어야 합니다. 자세한 내용은 addfrub()의 fru_bucket 정의를 봅니다. |
반환값
| 값 | 뜻 |
|---|---|
| 0 | 성공 |
| -1 | ODM 오류 |
| -2 | addfrub()가 MAXFRUS개의 FRU를 더하지 않았음(곧 이 함수를 부르지 말았어야 함) |
영어 원문
add_more_frus
Purpose
Adds additional FRUs to an FRU bucket previously added by the addfrub() subroutine.
Syntax
#include <diag/da.h>
int add_more_frus(fptr)
struct fru_bucket *fptr);
Description
The add_more_frus subroutine takes an additional set of FRUs and adds them to an existing FRU bucket that was previously added via the addfrub() subroutine.
This subroutine can add up to MAXFRUS number of FRUs per invocation, but can be called multiple times. This subroutine is called only after calling addfrub(). The input fru_bucket should have the same data as sent to addfrub(), except for the FRUs array.
Note: init_dgodm must be called before starting this subroutine.
Parameters
- fptr — Pointer to a structure of type
fru_bucket, that is almost identical to the structure used in the call to addfrub(). The only difference should be the array of FRUs structure that contains the additional FRUs that should be added to the existing FRU bucket. For more information, refer to thefru_bucketdefinition in the addfrub() subroutine.
Return Value
The add_more_frus subroutine returns one of the following values:
- 0 — On successful completion
- -1 — If ODM error
- -2 — If addfrub() did not add MAXFRUS number of FRUs (i.e. this function should not have been called)
관련 글: 진단 라이브러리 (1), 진단 라이브러리 (3), 진단 커널 확장 (1)