1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993
|
/* -*- linux-c -*-
*
* Copyright (c) 2003 by Intel Corp.
* (C) Copright IBM Corp 2003-2006
*
* 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. This
* file and program are licensed under a BSD style license. See
* the Copying file included with the OpenHPI distribution for
* full licensing terms.
*
* Authors:
* Louis Zhuang <louis.zhuang@linux.intel.com>
* Sean Dague <http://dague.net/sean>
* Renier Morales <renier@openhpi.org>
* Racing Guo <racing.guo@intel.com>
* Anton Pak <anton.pak@pigeonpoint.com>
*/
#ifndef __OH_HANDLER_H
#define __OH_HANDLER_H
#include <glib.h>
#include <SaHpi.h>
#include <oHpi.h>
#include <oh_utils.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* Common OpenHPI implementation specific definitions
* --------------------------------------------------
*
* plugin - software component contained in a shared library that exports
* a function named 'get_interface'. Loading a plugin entails
* performing a dlopen on the library, finding 'get_interface' with
* dl_sym, and calling 'get_interface' to get an interface pointer
* (referred to as the 'abi'.)
*
* abi - pointer to a structure of type oh_abi_XX where XX represents a
* version of the structure. This structure is a bundle of function
* pointers that represents the interface between a given plug-in
* instance (known as a handler), and the OpenHPI infrastructure.
*
* handler - an instance of a plugin represented by a structure of type
* oh_handler which contains an abi and a pointer to an instance
* specific data structure that is private to the plug-in.
*/
/*
* How plugins are instantiated
* ----------------------------
*
* When an HPI application initializes OpenHPI by calling saHpiInitialize(),
* the OpenHPI infrastructure will seek out all configured plug-ins
* (see oh_config.h for details on how a plug-in is configured), and:
* 1. load the plug-in into memory
* 2. extract an abi from the plug-in
* 3. create a new oh_plugin containing the name of the plugin and
* the abi extracted from the plugin
* 4. add the oh_plugin to the global list of plugins
*
* The first time the HPI application creates a new session by calling
* saHpiSessionOpen(), the OpenHPI infrastructure will once again examine
* the implementation configuration and create new plug-in instances
* (i.e. a handler) as the configuration dictates.
*
* Each handler configuration item will specify:
* 1. name of plugin in question
* 2. additional arguments understood by the plug-in
*
* Each new handler is created by:
* 1. finding the oh_plugin containing the same plugin name as the
* configuration item
* 2. using the abi found in the oh_plugin to call abi->open(), passing
* the additional plug-in specific arguments to the open function.
* The open call will return a void* pointer (known as hnd) that is
* required to be passed back to the plug-in for all further abi
* function calls.
* 3. creating a new oh_handler that contains a pointer to the associated
* abi, and the hnd returned by the open function.
*/
/*
* How plugins can have multiple instances open at the same time
* -------------------------------------------------------------
*
* The key to a plugin being able to support multiple instances
* is in the 'void *hnd' passed to all abi functions (except open().)
* The intent is that hnd is used as a private pointer to an instance specific
* data structure.
*
* For example, if a plug-in were created to allow an HPI implementation
* running a remote server to inter-operate with the local OpenHPI
* implementation, then the plug-in could be written such that:
* 1. the plugin defines a new structure containing an event queue and tcp
* socket to the remote machine
* 2. the plugin requires that handler configuration entries for this
* plugin to contain the IP address of the remote machine to connect
* 3. when open() is called, the plugin
* - opens a socket to the new machine
* - allocates a new event queue
* - allocates a new instance structure
* - stores the event queue and socket in the instance structure
* - returns a pointer to the structure as 'hnd'.
* 4. as other abi functions are called, the 'hnd' passed in with those
* functions is cast back to a pointer to the instance data, and then
* communicates over the socket in that structure to service the given
* request.
*
*/
struct oh_handler_state {
unsigned int hid;
oh_evt_queue *eventq;
GHashTable *config;
RPTable *rptcache;
oh_el *elcache;
GThread *thread_handle;
void *data;
};
struct oh_abi_v2 {
/***
* open
* handler_config: instance's configuration data.
* hid: id of this intance.
* eventq: pointer to queue to place events in.
*
* The function creates a pluing instance.
*
* Returns: pointer to the handler of the instance
**/
void *(*open)(GHashTable *handler_config,
unsigned int hid,
oh_evt_queue *eventq);
void (*close)(void *hnd);
/********************************************************************
* PLUGIN HPI ABIs - These plugin functions implement a large part of
* the HPI APIs from the specification.
********************************************************************/
/***
* saHpiEventGet - passed down to plugin
*
* @remark at the start-up, plugins must send out res/rdr event for all
* resources and rdrs so as to OpenHPI can build up RPT/RDR.
* @return >0 if an event is returned; 0 if timeout; otherwise an error
* occur.
**/
SaErrorT (*get_event)(void *hnd);
/***
* saHpiDiscover, passed down to plugin
**/
SaErrorT (*discover_resources)(void *hnd);
/***
* saHpiResourceTagSet, this is passed down so the device has
* a chance to set it in nv storage if it likes
**/
SaErrorT (*set_resource_tag)(void *hnd,
SaHpiResourceIdT id,
SaHpiTextBufferT *tag);
/***
* saHpiResourceSeveritySet is pushed down so the device has
* a chance to set it in nv storage
**/
SaErrorT (*set_resource_severity)(void *hnd,
SaHpiResourceIdT id,
SaHpiSeverityT sev);
/***
* saHpiResourceFailedRemove, passed down to plugin
**/
SaErrorT (*resource_failed_remove)(void *hnd,
SaHpiResourceIdT rid);
/*****************
* EVENT LOG ABIs
*****************/
/***
* saHpiEventLogInfoGet
**/
SaErrorT (*get_el_info)(void *hnd,
SaHpiResourceIdT id,
SaHpiEventLogInfoT *info);
/***
* saHpiEventLogCapabilitiesGet
**/
SaErrorT (*get_el_caps)(void *hnd,
SaHpiResourceIdT id,
SaHpiEventLogCapabilitiesT *caps);
/***
* saHpiEventLogTimeSet
**/
SaErrorT (*set_el_time)(void *hnd,
SaHpiResourceIdT id,
SaHpiTimeT time);
/***
* saHpiEventLogEntryAdd
**/
SaErrorT (*add_el_entry)(void *hnd,
SaHpiResourceIdT id,
const SaHpiEventT *Event);
/***
* saHpiEventLogEntryGet
**/
SaErrorT (*get_el_entry)(void *hnd,
SaHpiResourceIdT id,
SaHpiEventLogEntryIdT current,
SaHpiEventLogEntryIdT *prev,
SaHpiEventLogEntryIdT *next,
SaHpiEventLogEntryT *entry,
SaHpiRdrT *rdr,
SaHpiRptEntryT *rptentry);
/***
* saHpiEventLogClear
**/
SaErrorT (*clear_el)(void *hnd, SaHpiResourceIdT id);
/***
* saHpiEventLogStateSet
**/
SaErrorT (*set_el_state)(void *hnd, SaHpiResourceIdT id, SaHpiBoolT e);
/***
* saHpiEventLogOverflowReset
**/
SaErrorT (*reset_el_overflow)(void *hnd, SaHpiResourceIdT id);
/**************
* SENSOR ABIs
**************/
/***
* saHpiSensorReadingGet
**/
SaErrorT (*get_sensor_reading)(void *hnd,
SaHpiResourceIdT id,
SaHpiSensorNumT num,
SaHpiSensorReadingT *reading,
SaHpiEventStateT *state);
/***
* saHpiSensorThresholdsGet
**/
SaErrorT (*get_sensor_thresholds)(void *hnd,
SaHpiResourceIdT id,
SaHpiSensorNumT num,
SaHpiSensorThresholdsT *thres);
/***
* saHpiSensorThresholdsSet
**/
SaErrorT (*set_sensor_thresholds)(void *hnd,
SaHpiResourceIdT id,
SaHpiSensorNumT num,
const SaHpiSensorThresholdsT *thres);
/***
* saHpiSensorEnableGet
**/
SaErrorT (*get_sensor_enable)(void *hnd,
SaHpiResourceIdT id,
SaHpiSensorNumT num,
SaHpiBoolT *enable);
/***
* saHpiSensorEnableSet
**/
SaErrorT (*set_sensor_enable)(void *hnd,
SaHpiResourceIdT id,
SaHpiSensorNumT num,
SaHpiBoolT enable);
/***
* saHpiSensorEventEnableGet
**/
SaErrorT (*get_sensor_event_enables)(void *hnd,
SaHpiResourceIdT id,
SaHpiSensorNumT num,
SaHpiBoolT *enables);
/***
* saHpiSensorEventEnableSet
**/
SaErrorT (*set_sensor_event_enables)(void *hnd,
SaHpiResourceIdT id,
SaHpiSensorNumT num,
const SaHpiBoolT enables);
/***
* saHpiSensorEventMasksGet
**/
SaErrorT (*get_sensor_event_masks)(void *hnd,
SaHpiResourceIdT id,
SaHpiSensorNumT num,
SaHpiEventStateT *AssertEventMask,
SaHpiEventStateT *DeassertEventMask);
/***
* saHpiSensorEventMasksSet
**/
SaErrorT (*set_sensor_event_masks)(void *hnd, SaHpiResourceIdT id,
SaHpiSensorNumT num,
SaHpiSensorEventMaskActionT act,
SaHpiEventStateT AssertEventMask,
SaHpiEventStateT DeassertEventMask);
/***************
* CONTROL ABIs
***************/
/***
* saHpiControlGet
**/
SaErrorT (*get_control_state)(void *hnd,
SaHpiResourceIdT id,
SaHpiCtrlNumT num,
SaHpiCtrlModeT *mode,
SaHpiCtrlStateT *state);
/***
* saHpiControlSet
**/
SaErrorT (*set_control_state)(void *hnd,
SaHpiResourceIdT id,
SaHpiCtrlNumT num,
SaHpiCtrlModeT mode,
SaHpiCtrlStateT *state);
/*****************
* INVENTORY ABIs
*****************/
/***
* saHpiIdrInfoGet
**/
SaErrorT (*get_idr_info)(void *hnd,
SaHpiResourceIdT rid,
SaHpiIdrIdT idrid,
SaHpiIdrInfoT *idrinfo);
/***
* saHpiIdrAreaHeaderGet
**/
SaErrorT (*get_idr_area_header)(void *hnd,
SaHpiResourceIdT rid,
SaHpiIdrIdT idrid,
SaHpiIdrAreaTypeT areatype,
SaHpiEntryIdT areaid,
SaHpiEntryIdT *nextareaid,
SaHpiIdrAreaHeaderT *header);
/***
* saHpiIdrAreaAdd
**/
SaErrorT (*add_idr_area)(void *hnd,
SaHpiResourceIdT rid,
SaHpiIdrIdT idrid,
SaHpiIdrAreaTypeT areatype,
SaHpiEntryIdT *areaid);
/***
* saHpiIdrAreaAddById
**/
SaErrorT (*add_idr_area_id)(void *,
SaHpiResourceIdT,
SaHpiIdrIdT,
SaHpiIdrAreaTypeT,
SaHpiEntryIdT);
/***
* saHpiIdrAreaDelete
**/
SaErrorT (*del_idr_area)(void *hnd,
SaHpiResourceIdT rid,
SaHpiIdrIdT idrid,
SaHpiEntryIdT areaid);
/***
* saHpiIdrFieldGet
**/
SaErrorT (*get_idr_field)(void *hnd,
SaHpiResourceIdT rid,
SaHpiIdrIdT idrid,
SaHpiEntryIdT areaid,
SaHpiIdrFieldTypeT fieldtype,
SaHpiEntryIdT fieldid,
SaHpiEntryIdT *nextfieldid,
SaHpiIdrFieldT *field);
/***
* saHpiIdrFieldAdd
**/
SaErrorT (*add_idr_field)(void *hnd,
SaHpiResourceIdT rid,
SaHpiIdrIdT idrid,
SaHpiIdrFieldT *field);
/***
* saHpiIdrFieldAddById
**/
SaErrorT (*add_idr_field_id)(void *hnd,
SaHpiResourceIdT rid,
SaHpiIdrIdT idrid,
SaHpiIdrFieldT *field);
/***
* saHpiIdrFieldSet
**/
SaErrorT (*set_idr_field)(void *hnd,
SaHpiResourceIdT rid,
SaHpiIdrIdT idrid,
SaHpiIdrFieldT *field);
/***
* saHpiIdrFieldDelete
**/
SaErrorT (*del_idr_field)(void *hnd,
SaHpiResourceIdT rid,
SaHpiIdrIdT idrid,
SaHpiEntryIdT areaid,
SaHpiEntryIdT fieldid);
/***
* saHpiWatchdogTimerGet
**/
SaErrorT (*get_watchdog_info)(void *hnd,
SaHpiResourceIdT id,
SaHpiWatchdogNumT num,
SaHpiWatchdogT *wdt);
/***
* saHpiWatchdogTimerSet
**/
SaErrorT (*set_watchdog_info)(void *hnd,
SaHpiResourceIdT id,
SaHpiWatchdogNumT num,
SaHpiWatchdogT *wdt);
/***
* saHpiWatchdogTimerReset
**/
SaErrorT (*reset_watchdog)(void *hnd,
SaHpiResourceIdT id,
SaHpiWatchdogNumT num);
/******************
* ANNUCIATOR ABIs
******************/
/* the first 5 Annunciator functions are really operating on
a single Annunciator and doing things to the announcements
that it contains. For this reason the functions are named
_announce */
/***
* saHpiAnnunciatorGetNext
**/
SaErrorT (*get_next_announce)(void *hnd,
SaHpiResourceIdT id,
SaHpiAnnunciatorNumT num,
SaHpiSeverityT sev,
SaHpiBoolT ack,
SaHpiAnnouncementT *ann);
/***
* saHpiAnnunciatorGet
**/
SaErrorT (*get_announce)(void *hnd,
SaHpiResourceIdT id,
SaHpiAnnunciatorNumT num,
SaHpiEntryIdT annid,
SaHpiAnnouncementT *ann);
/***
* saHpiAnnunciatorAcknowledge
**/
SaErrorT (*ack_announce)(void *hnd,
SaHpiResourceIdT id,
SaHpiAnnunciatorNumT num,
SaHpiEntryIdT annid,
SaHpiSeverityT sev);
/***
* saHpiAnnunciatorAdd
**/
SaErrorT (*add_announce)(void *hnd,
SaHpiResourceIdT id,
SaHpiAnnunciatorNumT num,
SaHpiAnnouncementT *ann);
/***
* saHpiAnnunciatorDelete
**/
SaErrorT (*del_announce)(void *hnd,
SaHpiResourceIdT id,
SaHpiAnnunciatorNumT num,
SaHpiEntryIdT annid,
SaHpiSeverityT sev);
/* the last 2 functions deal with Annunciator mode setting */
/***
* saHpiAnnunciatorModeGet
**/
SaErrorT (*get_annunc_mode)(void *hnd,
SaHpiResourceIdT id,
SaHpiAnnunciatorNumT num,
SaHpiAnnunciatorModeT *mode);
/***
* saHpiAnnunciatorModeSet
**/
SaErrorT (*set_annunc_mode)(void *hnd,
SaHpiResourceIdT id,
SaHpiAnnunciatorNumT num,
SaHpiAnnunciatorModeT mode);
/***************
* DIMI ABIs
***************/
/***
* saHpiDimiInfoGet
**/
SaErrorT (*get_dimi_info)(void *hnd,
SaHpiResourceIdT id,
SaHpiDimiNumT num,
SaHpiDimiInfoT *info);
/***
* saHpiDimiTestInfoGet
**/
SaErrorT (*get_dimi_test)(void *hnd,
SaHpiResourceIdT id,
SaHpiDimiNumT num,
SaHpiDimiTestNumT testnum,
SaHpiDimiTestT *test);
/***
* saHpiDimiTestReadinessGet
**/
SaErrorT (*get_dimi_test_ready)(
void *hnd,
SaHpiResourceIdT id,
SaHpiDimiNumT num,
SaHpiDimiTestNumT testnum,
SaHpiDimiReadyT *ready);
/***
* saHpiDimiTestStart
**/
SaErrorT (*start_dimi_test)(
void *hnd,
SaHpiResourceIdT id,
SaHpiDimiNumT num,
SaHpiDimiTestNumT testnum,
SaHpiUint8T numparams,
SaHpiDimiTestVariableParamsT *paramslist);
/***
* saHpiDimiTestCancel
**/
SaErrorT (*cancel_dimi_test)(
void *hnd,
SaHpiResourceIdT id,
SaHpiDimiNumT num,
SaHpiDimiTestNumT testnum);
/***
* saHpiDimiTestStatusGet
**/
SaErrorT (*get_dimi_test_status)(
void *hnd,
SaHpiResourceIdT id,
SaHpiDimiNumT num,
SaHpiDimiTestNumT testnum,
SaHpiDimiTestPercentCompletedT *percentcompleted,
SaHpiDimiTestRunStatusT *runstatus);
/***
* saHpiDimiTestResultsGet
**/
SaErrorT (*get_dimi_test_results)(
void *hnd,
SaHpiResourceIdT id,
SaHpiDimiNumT num,
SaHpiDimiTestNumT testnum,
SaHpiDimiTestResultsT *testresults);
/***************
* FUMI ABIs
***************/
/***
* saHpiFumiSpecInfoGet
**/
SaErrorT (*get_fumi_spec)(
void *hnd,
SaHpiResourceIdT id,
SaHpiFumiNumT num,
SaHpiFumiSpecInfoT *specinfo );
/***
* saHpiFumiServiceImpactGet
**/
SaErrorT (*get_fumi_service_impact)(
void *hnd,
SaHpiResourceIdT id,
SaHpiFumiNumT num,
SaHpiFumiServiceImpactDataT *serviceimpact );
/***
* saHpiFumiSourceSet
**/
SaErrorT (*set_fumi_source)(
void *hnd,
SaHpiResourceIdT id,
SaHpiFumiNumT num,
SaHpiBankNumT banknum,
SaHpiTextBufferT *sourceuri);
/***
* saHpiFumiSourceInfoValidateStart
**/
SaErrorT (*validate_fumi_source)(
void *hnd,
SaHpiResourceIdT id,
SaHpiFumiNumT num,
SaHpiBankNumT banknum);
/***
* saHpiFumiSourceInfoGet
**/
SaErrorT (*get_fumi_source)(
void *hnd,
SaHpiResourceIdT id,
SaHpiFumiNumT num,
SaHpiBankNumT banknum,
SaHpiFumiSourceInfoT *sourceinfo);
/***
* saHpiFumiSourceComponentInfoGet
**/
SaErrorT (*get_fumi_source_component)(
void *hnd,
SaHpiResourceIdT id,
SaHpiFumiNumT num,
SaHpiBankNumT banknum,
SaHpiEntryIdT compid,
SaHpiEntryIdT *nextcompid,
SaHpiFumiComponentInfoT *compinfo);
/***
* saHpiFumiTargetInfoGet
**/
SaErrorT (*get_fumi_target)(
void *hnd,
SaHpiResourceIdT id,
SaHpiFumiNumT num,
SaHpiBankNumT banknum,
SaHpiFumiBankInfoT *bankinfo);
/***
* saHpiFumiTargetComponentInfoGet
**/
SaErrorT (*get_fumi_target_component)(
void *hnd,
SaHpiResourceIdT id,
SaHpiFumiNumT num,
SaHpiBankNumT banknum,
SaHpiEntryIdT compid,
SaHpiEntryIdT *nextcompid,
SaHpiFumiComponentInfoT *compinfo);
/***
* saHpiFumiLogicalTargetInfoGet
**/
SaErrorT (*get_fumi_logical_target)(
void *hnd,
SaHpiResourceIdT id,
SaHpiFumiNumT num,
SaHpiFumiLogicalBankInfoT *bankinfo);
/***
* saHpiFumiLogicalTargetComponentInfoGet
**/
SaErrorT (*get_fumi_logical_target_component)(
void *hnd,
SaHpiResourceIdT id,
SaHpiFumiNumT num,
SaHpiEntryIdT compid,
SaHpiEntryIdT *nextcompid,
SaHpiFumiLogicalComponentInfoT *compinfo);
/***
* saHpiFumiBackupStart
**/
SaErrorT (*start_fumi_backup)(
void *hnd,
SaHpiResourceIdT id,
SaHpiFumiNumT num);
/***
* saHpiFumiBankBootOrderSet
**/
SaErrorT (*set_fumi_bank_order)(
void *hnd,
SaHpiResourceIdT id,
SaHpiFumiNumT num,
SaHpiBankNumT banknum,
SaHpiUint32T position);
/***
* saHpiFumiBankBootOrderSet
**/
SaErrorT (*start_fumi_bank_copy)(
void *hnd,
SaHpiResourceIdT id,
SaHpiFumiNumT num,
SaHpiBankNumT sourcebanknum,
SaHpiBankNumT targetbanknum);
/***
* saHpiFumiInstallStart
**/
SaErrorT (*start_fumi_install)(
void *hnd,
SaHpiResourceIdT id,
SaHpiFumiNumT num,
SaHpiBankNumT banknum);
/***
* saHpiFumiUpgradeStatusGet
**/
SaErrorT (*get_fumi_status)(
void *hnd,
SaHpiResourceIdT id,
SaHpiFumiNumT num,
SaHpiBankNumT banknum,
SaHpiFumiUpgradeStatusT *status);
/***
* saHpiFumiTargetVerifyStart
**/
SaErrorT (*start_fumi_verify)(
void *hnd,
SaHpiResourceIdT id,
SaHpiFumiNumT num,
SaHpiBankNumT banknum);
/***
* saHpiFumiTargetVerifyMainStart
**/
SaErrorT (*start_fumi_verify_main)(
void *hnd,
SaHpiResourceIdT id,
SaHpiFumiNumT num );
/***
* saHpiFumiUpgradeCancel
**/
SaErrorT (*cancel_fumi_upgrade)(
void *hnd,
SaHpiResourceIdT id,
SaHpiFumiNumT num,
SaHpiBankNumT banknum);
/***
* saHpiFumiAutoRollbackDisableGet
**/
SaErrorT (*get_fumi_autorollback_disable)(
void *hnd,
SaHpiResourceIdT id,
SaHpiFumiNumT num,
SaHpiBoolT *disable);
/***
* saHpiFumiAutoRollbackDisableSet
**/
SaErrorT (*set_fumi_autorollback_disable)(
void *hnd,
SaHpiResourceIdT id,
SaHpiFumiNumT num,
SaHpiBoolT disable);
/***
* saHpiFumiRollbackStart
**/
SaErrorT (*start_fumi_rollback)(
void *hnd,
SaHpiResourceIdT id,
SaHpiFumiNumT num);
/***
* saHpiFumiActivate
**/
SaErrorT (*activate_fumi)(
void *hnd,
SaHpiResourceIdT id,
SaHpiFumiNumT num);
/***
* saHpiFumiActivateStart
**/
SaErrorT (*start_fumi_activate)(
void *hnd,
SaHpiResourceIdT id,
SaHpiFumiNumT num,
SaHpiBoolT logical);
/***
* saHpiFumiCleanup
**/
SaErrorT (*cleanup_fumi)(
void *hnd,
SaHpiResourceIdT id,
SaHpiFumiNumT num,
SaHpiBankNumT banknum);
/***************
* HOTSWAP ABIs
***************/
/***
* saHpiHotSwapPolycyCancel
**/
SaErrorT (*hotswap_policy_cancel)(void *hnd,
SaHpiResourceIdT id,
SaHpiTimeoutT timeout);
/***
* saHpiAutoInsertTimeoutSet
**/
SaErrorT (*set_autoinsert_timeout)(void *hnd,
SaHpiTimeoutT timeout);
/***
* saHpiAutoExtractTimeoutGet
**/
SaErrorT (*get_autoextract_timeout)(void *hnd,
SaHpiResourceIdT id,
SaHpiTimeoutT *timeout);
/***
* saHpiAutoExtractTimeoutSet
**/
SaErrorT (*set_autoextract_timeout)(void *hnd,
SaHpiResourceIdT id,
SaHpiTimeoutT timeout);
/***
* saHpiHotSwapStateGet
**/
SaErrorT (*get_hotswap_state)(void *hnd,
SaHpiResourceIdT id,
SaHpiHsStateT *state);
/***
* saHpiHotSwapStateSet
**/
SaErrorT (*set_hotswap_state)(void *hnd,
SaHpiResourceIdT id,
SaHpiHsStateT state);
/***
* saHpiHotSwapActionRequest
**/
SaErrorT (*request_hotswap_action)(void *hnd,
SaHpiResourceIdT id,
SaHpiHsActionT act);
/***
* saHpiHotSwapIndicatorStateGet
**/
SaErrorT (*get_indicator_state)(void *hnd,
SaHpiResourceIdT id,
SaHpiHsIndicatorStateT *state);
/***
* saHpiHotSwapIndicatorStateSet
**/
SaErrorT (*set_indicator_state)(void *hnd,
SaHpiResourceIdT id,
SaHpiHsIndicatorStateT state);
/*************
* POWER ABIs
*************/
/***
* saHpiResourcePowerStateGet
**/
SaErrorT (*get_power_state)(void *hnd,
SaHpiResourceIdT id,
SaHpiPowerStateT *state);
/***
* saHpiResourcePowerStateSet
**/
SaErrorT (*set_power_state)(void *hnd,
SaHpiResourceIdT id,
SaHpiPowerStateT state);
/*****************
* PARAMETER ABIs
*****************/
/***
* saHpiParmControl
**/
SaErrorT (*control_parm)(void *hnd,
SaHpiResourceIdT id,
SaHpiParmActionT act);
/***********************
* Load Management ABIs
***********************/
/***
* saHpiResourceLoadIdGet
**/
SaErrorT (*load_id_get)(void *hnd,
SaHpiResourceIdT rid,
SaHpiLoadIdT *load_id);
/***
* saHpiResourceLoadIdSet
**/
SaErrorT (*load_id_set)(void *hnd,
SaHpiResourceIdT rid,
SaHpiLoadIdT *load_id);
/*************
* RESET ABIs
*************/
/***
* saHpiResourceResetStateGet
**/
SaErrorT (*get_reset_state)(void *hnd,
SaHpiResourceIdT id,
SaHpiResetActionT *act);
/***
* saHpiResourceResetStateSet
**/
SaErrorT (*set_reset_state)(void *hnd,
SaHpiResourceIdT id,
SaHpiResetActionT act);
/**********************************
* INJECTOR ABIs - OpenHPI specific
**********************************/
/***
* oHpiInjectEvent
**/
SaErrorT (*inject_event)(void *hnd,
SaHpiEventT *event,
SaHpiRptEntryT *rpte,
SaHpiRdrT *rdr);
};
#ifdef __cplusplus
}
#endif
/* Macors for use in handlers to walk a single linked list such as
* eventq
*/
#define g_slist_for_each(pos, head) \
for (pos = head; pos != NULL; pos = g_slist_next(pos))
#define g_slist_for_each_safe(pos, pos1, head) \
for (pos = head, pos1 = g_slist_next(pos); pos; pos = pos1, pos1 = g_slist_next(pos1))
#endif/*__OH_HANDLER_H*/
|