Print this page
7127  remove -Wno-missing-braces from Makefile.uts


  26 #include <sys/types.h>
  27 #include <sys/sunndi.h>
  28 #include <sys/sysmacros.h>
  29 #include <sys/ddifm_impl.h>
  30 #include <sys/fm/util.h>
  31 #include <sys/fm/protocol.h>
  32 #include <sys/fm/io/pci.h>
  33 #include <sys/fm/io/ddi.h>
  34 #include <sys/pci.h>
  35 #include <sys/pci_cap.h>
  36 #include <sys/pci_impl.h>
  37 #include <sys/epm.h>
  38 #include <sys/pcifm.h>
  39 
  40 #define PCIX_ECC_VER_CHECK(x)   (((x) == PCI_PCIX_VER_1) ||\
  41                                 ((x) == PCI_PCIX_VER_2))
  42 
  43 errorq_t *pci_target_queue = NULL;
  44 
  45 pci_fm_err_t pci_err_tbl[] = {
  46         PCI_DET_PERR,   PCI_STAT_PERROR,        NULL,           DDI_FM_UNKNOWN,
  47         PCI_MDPE,       PCI_STAT_S_PERROR,      PCI_TARG_MDPE,  DDI_FM_UNKNOWN,
  48         PCI_SIG_SERR,   PCI_STAT_S_SYSERR,      NULL,           DDI_FM_FATAL,
  49         PCI_MA,         PCI_STAT_R_MAST_AB,     PCI_TARG_MA,    DDI_FM_UNKNOWN,
  50         PCI_REC_TA,     PCI_STAT_R_TARG_AB,     PCI_TARG_REC_TA, DDI_FM_UNKNOWN,
  51         PCI_SIG_TA,     PCI_STAT_S_TARG_AB,     NULL,           DDI_FM_UNKNOWN,
  52         NULL, NULL, NULL, NULL,
  53 };
  54 
  55 pci_fm_err_t pci_bdg_err_tbl[] = {
  56         PCI_DET_PERR,   PCI_STAT_PERROR,        NULL,           DDI_FM_UNKNOWN,
  57         PCI_MDPE,       PCI_STAT_S_PERROR,      PCI_TARG_MDPE,  DDI_FM_UNKNOWN,
  58         PCI_REC_SERR,   PCI_STAT_S_SYSERR,      NULL,           DDI_FM_UNKNOWN,
  59 #if defined(__sparc)
  60         PCI_MA,         PCI_STAT_R_MAST_AB,     PCI_TARG_MA,    DDI_FM_UNKNOWN,
  61 #endif
  62         PCI_REC_TA,     PCI_STAT_R_TARG_AB,     PCI_TARG_REC_TA, DDI_FM_UNKNOWN,
  63         PCI_SIG_TA,     PCI_STAT_S_TARG_AB,     NULL,           DDI_FM_UNKNOWN,
  64         NULL, NULL, NULL, NULL,
  65 };
  66 
  67 static pci_fm_err_t pcix_err_tbl[] = {
  68         PCIX_SPL_DIS,           PCI_PCIX_SPL_DSCD,      NULL,   DDI_FM_UNKNOWN,
  69         PCIX_UNEX_SPL,          PCI_PCIX_UNEX_SPL,      NULL,   DDI_FM_UNKNOWN,
  70         PCIX_RX_SPL_MSG,        PCI_PCIX_RX_SPL_MSG,    NULL,   DDI_FM_UNKNOWN,
  71         NULL, NULL, NULL, NULL,
  72 };
  73 
  74 static pci_fm_err_t pcix_sec_err_tbl[] = {
  75         PCIX_SPL_DIS,           PCI_PCIX_BSS_SPL_DSCD,  NULL,   DDI_FM_UNKNOWN,
  76         PCIX_UNEX_SPL,          PCI_PCIX_BSS_UNEX_SPL,  NULL,   DDI_FM_UNKNOWN,
  77         PCIX_BSS_SPL_OR,        PCI_PCIX_BSS_SPL_OR,    NULL,   DDI_FM_OK,
  78         PCIX_BSS_SPL_DLY,       PCI_PCIX_BSS_SPL_DLY,   NULL,   DDI_FM_OK,
  79         NULL, NULL, NULL, NULL,
  80 };
  81 
  82 static int
  83 pci_config_check(ddi_acc_handle_t handle, int fme_flag)
  84 {
  85         ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
  86         ddi_fm_error_t de;
  87 
  88         if (!(DDI_FM_ACC_ERR_CAP(ddi_fm_capable(hp->ah_dip))))
  89                 return (DDI_FM_OK);
  90 
  91         de.fme_version = DDI_FME_VERSION;
  92 
  93         ddi_fm_acc_err_get(handle, &de, de.fme_version);
  94         if (de.fme_status != DDI_FM_OK) {
  95                 if (fme_flag == DDI_FM_ERR_UNEXPECTED) {
  96                         char buf[FM_MAX_CLASS];
  97 
  98                         (void) snprintf(buf, FM_MAX_CLASS, "%s.%s",
  99                             PCI_ERROR_SUBCLASS, PCI_NR);




  26 #include <sys/types.h>
  27 #include <sys/sunndi.h>
  28 #include <sys/sysmacros.h>
  29 #include <sys/ddifm_impl.h>
  30 #include <sys/fm/util.h>
  31 #include <sys/fm/protocol.h>
  32 #include <sys/fm/io/pci.h>
  33 #include <sys/fm/io/ddi.h>
  34 #include <sys/pci.h>
  35 #include <sys/pci_cap.h>
  36 #include <sys/pci_impl.h>
  37 #include <sys/epm.h>
  38 #include <sys/pcifm.h>
  39 
  40 #define PCIX_ECC_VER_CHECK(x)   (((x) == PCI_PCIX_VER_1) ||\
  41                                 ((x) == PCI_PCIX_VER_2))
  42 
  43 errorq_t *pci_target_queue = NULL;
  44 
  45 pci_fm_err_t pci_err_tbl[] = {
  46         {PCI_DET_PERR,  PCI_STAT_PERROR,        NULL,           DDI_FM_UNKNOWN},
  47         {PCI_MDPE,      PCI_STAT_S_PERROR,      PCI_TARG_MDPE,  DDI_FM_UNKNOWN},
  48         {PCI_SIG_SERR,  PCI_STAT_S_SYSERR,      NULL,           DDI_FM_FATAL},
  49         {PCI_MA,        PCI_STAT_R_MAST_AB,     PCI_TARG_MA,    DDI_FM_UNKNOWN},
  50         {PCI_REC_TA,    PCI_STAT_R_TARG_AB, PCI_TARG_REC_TA, DDI_FM_UNKNOWN},
  51         {PCI_SIG_TA,    PCI_STAT_S_TARG_AB,     NULL,           DDI_FM_UNKNOWN},
  52         {NULL, 0, NULL, 0}
  53 };
  54 
  55 pci_fm_err_t pci_bdg_err_tbl[] = {
  56         {PCI_DET_PERR,  PCI_STAT_PERROR,        NULL,           DDI_FM_UNKNOWN},
  57         {PCI_MDPE,      PCI_STAT_S_PERROR,      PCI_TARG_MDPE,  DDI_FM_UNKNOWN},
  58         {PCI_REC_SERR,  PCI_STAT_S_SYSERR,      NULL,           DDI_FM_UNKNOWN},
  59 #if defined(__sparc)
  60         {PCI_MA,        PCI_STAT_R_MAST_AB,     PCI_TARG_MA,    DDI_FM_UNKNOWN},
  61 #endif
  62         {PCI_REC_TA,    PCI_STAT_R_TARG_AB, PCI_TARG_REC_TA, DDI_FM_UNKNOWN},
  63         {PCI_SIG_TA,    PCI_STAT_S_TARG_AB,     NULL,           DDI_FM_UNKNOWN},
  64         {NULL, 0, NULL, 0}
  65 };
  66 
  67 static pci_fm_err_t pcix_err_tbl[] = {
  68         {PCIX_SPL_DIS,          PCI_PCIX_SPL_DSCD,      NULL,   DDI_FM_UNKNOWN},
  69         {PCIX_UNEX_SPL,         PCI_PCIX_UNEX_SPL,      NULL,   DDI_FM_UNKNOWN},
  70         {PCIX_RX_SPL_MSG,       PCI_PCIX_RX_SPL_MSG,    NULL,   DDI_FM_UNKNOWN},
  71         {NULL, 0, NULL, 0}
  72 };
  73 
  74 static pci_fm_err_t pcix_sec_err_tbl[] = {
  75         {PCIX_SPL_DIS,          PCI_PCIX_BSS_SPL_DSCD,  NULL,   DDI_FM_UNKNOWN},
  76         {PCIX_UNEX_SPL,         PCI_PCIX_BSS_UNEX_SPL,  NULL,   DDI_FM_UNKNOWN},
  77         {PCIX_BSS_SPL_OR,       PCI_PCIX_BSS_SPL_OR,    NULL,   DDI_FM_OK},
  78         {PCIX_BSS_SPL_DLY,      PCI_PCIX_BSS_SPL_DLY,   NULL,   DDI_FM_OK},
  79         {NULL, 0, NULL, 0}
  80 };
  81 
  82 static int
  83 pci_config_check(ddi_acc_handle_t handle, int fme_flag)
  84 {
  85         ddi_acc_hdl_t *hp = impl_acc_hdl_get(handle);
  86         ddi_fm_error_t de;
  87 
  88         if (!(DDI_FM_ACC_ERR_CAP(ddi_fm_capable(hp->ah_dip))))
  89                 return (DDI_FM_OK);
  90 
  91         de.fme_version = DDI_FME_VERSION;
  92 
  93         ddi_fm_acc_err_get(handle, &de, de.fme_version);
  94         if (de.fme_status != DDI_FM_OK) {
  95                 if (fme_flag == DDI_FM_ERR_UNEXPECTED) {
  96                         char buf[FM_MAX_CLASS];
  97 
  98                         (void) snprintf(buf, FM_MAX_CLASS, "%s.%s",
  99                             PCI_ERROR_SUBCLASS, PCI_NR);