require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_SCSI_SES_H_)) {
    eval 'sub _SCSI_SES_H_ () {1;}' unless defined(&_SCSI_SES_H_);
    eval 'sub SES_DIAG_PCV () {(1<<0);}' unless defined(&SES_DIAG_PCV);
    eval 'sub SES_DIAG_PF () {(1<<4);}' unless defined(&SES_DIAG_PF);
    eval 'sub SES_PAGE_CONFIG () {0x1;}' unless defined(&SES_PAGE_CONFIG);
    eval 'sub SES_PAGE_STATUS () {0x2;}' unless defined(&SES_PAGE_STATUS);
    eval 'sub SES_PAGE_EDESC () {0x7;}' unless defined(&SES_PAGE_EDESC);
    eval 'sub SES_T_UNSPEC () {0x;}' unless defined(&SES_T_UNSPEC);
    eval 'sub SES_T_DEVICE () {0x1;}' unless defined(&SES_T_DEVICE);
    eval 'sub SES_T_POWERSUPPLY () {0x2;}' unless defined(&SES_T_POWERSUPPLY);
    eval 'sub SES_T_COOLING () {0x3;}' unless defined(&SES_T_COOLING);
    eval 'sub SES_T_TEMP () {0x4;}' unless defined(&SES_T_TEMP);
    eval 'sub SES_T_DOORLOCK () {0x5;}' unless defined(&SES_T_DOORLOCK);
    eval 'sub SES_T_ALARM () {0x6;}' unless defined(&SES_T_ALARM);
    eval 'sub SES_T_ENC_SRV_CTRL () {0x7;}' unless defined(&SES_T_ENC_SRV_CTRL);
    eval 'sub SES_T_SCC_CTRL () {0x8;}' unless defined(&SES_T_SCC_CTRL);
    eval 'sub SES_T_NONVOL_CACHE () {0x9;}' unless defined(&SES_T_NONVOL_CACHE);
    eval 'sub SES_T_INV_OP_REASON () {0xa;}' unless defined(&SES_T_INV_OP_REASON);
    eval 'sub SES_T_UPS () {0xb;}' unless defined(&SES_T_UPS);
    eval 'sub SES_T_DISPLAY () {0xc;}' unless defined(&SES_T_DISPLAY);
    eval 'sub SES_T_KEYPAD () {0xd;}' unless defined(&SES_T_KEYPAD);
    eval 'sub SES_T_ENCLOSURE () {0xe;}' unless defined(&SES_T_ENCLOSURE);
    eval 'sub SES_T_SCSI_PORT_TRANS () {0xf;}' unless defined(&SES_T_SCSI_PORT_TRANS);
    eval 'sub SES_T_LANGUAGE () {0x10;}' unless defined(&SES_T_LANGUAGE);
    eval 'sub SES_T_COMM_PORT () {0x11;}' unless defined(&SES_T_COMM_PORT);
    eval 'sub SES_T_VOLTAGE () {0x12;}' unless defined(&SES_T_VOLTAGE);
    eval 'sub SES_T_CURRENT () {0x13;}' unless defined(&SES_T_CURRENT);
    eval 'sub SES_T_SCSI_TARGET_PORT () {0x14;}' unless defined(&SES_T_SCSI_TARGET_PORT);
    eval 'sub SES_T_SCSI_INIT_PORT () {0x15;}' unless defined(&SES_T_SCSI_INIT_PORT);
    eval 'sub SES_T_SIMP_SUBENC () {0x16;}' unless defined(&SES_T_SIMP_SUBENC);
    eval 'sub SES_T_ARRAY_DEVICE () {0x17;}' unless defined(&SES_T_ARRAY_DEVICE);
    eval 'sub SES_NUM_TYPES () {256;}' unless defined(&SES_NUM_TYPES);
    eval 'sub SES_CFG_HDRLEN () {$sizeof{\'struct ses_config_hdr\'};}' unless defined(&SES_CFG_HDRLEN);
    eval 'sub SES_ENC_HDRLEN () {$sizeof{\'struct ses_enc_hdr\'};}' unless defined(&SES_ENC_HDRLEN);
    eval 'sub SES_TYPE_DESCLEN () {$sizeof{\'struct ses_type_desc\'};}' unless defined(&SES_TYPE_DESCLEN);
    eval 'sub SES_STAT_UNRECOV () {(1<<0);}' unless defined(&SES_STAT_UNRECOV);
    eval 'sub SES_STAT_CRIT () {(1<<1);}' unless defined(&SES_STAT_CRIT);
    eval 'sub SES_STAT_NONCRIT () {(1<<2);}' unless defined(&SES_STAT_NONCRIT);
    eval 'sub SES_STAT_INFO () {(1<<3);}' unless defined(&SES_STAT_INFO);
    eval 'sub SES_STAT_INVOP () {(1<<4);}' unless defined(&SES_STAT_INVOP);
    eval 'sub SES_STAT_HDRLEN () {$sizeof{\'struct ses_status_hdr\'};}' unless defined(&SES_STAT_HDRLEN);
    eval 'sub SES_STAT_CODE_MASK () {0xf;}' unless defined(&SES_STAT_CODE_MASK);
    eval 'sub SES_STAT_CODE {
        my($x) = @_;
	    eval q((($x) &  &SES_STAT_CODE_MASK));
    }' unless defined(&SES_STAT_CODE);
    eval 'sub SES_STAT_CODE_UNSUP () {0x;}' unless defined(&SES_STAT_CODE_UNSUP);
    eval 'sub SES_STAT_CODE_OK () {0x1;}' unless defined(&SES_STAT_CODE_OK);
    eval 'sub SES_STAT_CODE_CRIT () {0x2;}' unless defined(&SES_STAT_CODE_CRIT);
    eval 'sub SES_STAT_CODE_NONCRIT () {0x3;}' unless defined(&SES_STAT_CODE_NONCRIT);
    eval 'sub SES_STAT_CODE_UNREC () {0x4;}' unless defined(&SES_STAT_CODE_UNREC);
    eval 'sub SES_STAT_CODE_NOTINST () {0x5;}' unless defined(&SES_STAT_CODE_NOTINST);
    eval 'sub SES_STAT_CODE_UNKNOWN () {0x6;}' unless defined(&SES_STAT_CODE_UNKNOWN);
    eval 'sub SES_STAT_CODE_NOTAVAIL () {0x7;}' unless defined(&SES_STAT_CODE_NOTAVAIL);
    eval 'sub SES_STAT_SWAP () {(1<<4);}' unless defined(&SES_STAT_SWAP);
    eval 'sub SES_STAT_DISABLED () {(1<<5);}' unless defined(&SES_STAT_DISABLED);
    eval 'sub SES_STAT_PRDFAIL () {(1<<6);}' unless defined(&SES_STAT_PRDFAIL);
    eval 'sub SES_STAT_SELECT () {(1<<7);}' unless defined(&SES_STAT_SELECT);
    eval 'sub SES_STAT_ELEMLEN () {$sizeof{\'struct ses_status\'};}' unless defined(&SES_STAT_ELEMLEN);
    eval 'sub SES_S_DEV_REPORT () {(1<<0);}' unless defined(&SES_S_DEV_REPORT);
    eval 'sub SES_S_DEV_IDENT () {(1<<1);}' unless defined(&SES_S_DEV_IDENT);
    eval 'sub SES_S_DEV_REMOVE () {(1<<2);}' unless defined(&SES_S_DEV_REMOVE);
    eval 'sub SES_S_DEV_INSERT () {(1<<3);}' unless defined(&SES_S_DEV_INSERT);
    eval 'sub SES_S_DEV_ENCBYPB () {(1<<4);}' unless defined(&SES_S_DEV_ENCBYPB);
    eval 'sub SES_S_DEV_ENCBYPA () {(1<<5);}' unless defined(&SES_S_DEV_ENCBYPA);
    eval 'sub SES_S_DEV_DONOTREM () {(1<<6);}' unless defined(&SES_S_DEV_DONOTREM);
    eval 'sub SES_S_DEV_APPCLBYPA () {(1<<7);}' unless defined(&SES_S_DEV_APPCLBYPA);
    eval 'sub SES_S_DEV_DEVBYPB () {(1<<0);}' unless defined(&SES_S_DEV_DEVBYPB);
    eval 'sub SES_S_DEV_DEVBYPA () {(1<<1);}' unless defined(&SES_S_DEV_DEVBYPA);
    eval 'sub SES_S_DEV_BYPB () {(1<<2);}' unless defined(&SES_S_DEV_BYPB);
    eval 'sub SES_S_DEV_BYPA () {(1<<3);}' unless defined(&SES_S_DEV_BYPA);
    eval 'sub SES_S_DEV_OFF () {(1<<4);}' unless defined(&SES_S_DEV_OFF);
    eval 'sub SES_S_DEV_FAULTRQST () {(1<<5);}' unless defined(&SES_S_DEV_FAULTRQST);
    eval 'sub SES_S_DEV_FAULTSENSE () {(1<<6);}' unless defined(&SES_S_DEV_FAULTSENSE);
    eval 'sub SES_S_DEV_APPCLBYPB () {(1<<7);}' unless defined(&SES_S_DEV_APPCLBYPB);
    eval 'sub SES_C_DEV_IDENT () {(1<<1);}' unless defined(&SES_C_DEV_IDENT);
    eval 'sub SES_C_DEV_REMOVE () {(1<<2);}' unless defined(&SES_C_DEV_REMOVE);
    eval 'sub SES_C_DEV_INSERT () {(1<<3);}' unless defined(&SES_C_DEV_INSERT);
    eval 'sub SES_C_DEV_DONOTREM () {(1<<6);}' unless defined(&SES_C_DEV_DONOTREM);
    eval 'sub SES_C_DEV_ACTIVE () {(1<<7);}' unless defined(&SES_C_DEV_ACTIVE);
    eval 'sub SES_C_DEV_F2MASK () {( &SES_C_DEV_IDENT |  &SES_C_DEV_REMOVE |  &SES_C_DEV_INSERT |  &SES_C_DEV_DONOTREM |  &SES_C_DEV_ACTIVE );}' unless defined(&SES_C_DEV_F2MASK);
    eval 'sub SES_C_DEV_BYPB () {(1<<2);}' unless defined(&SES_C_DEV_BYPB);
    eval 'sub SES_C_DEV_BYPA () {(1<<3);}' unless defined(&SES_C_DEV_BYPA);
    eval 'sub SES_C_DEV_OFF () {(1<<4);}' unless defined(&SES_C_DEV_OFF);
    eval 'sub SES_C_DEV_FAULT () {(1<<5);}' unless defined(&SES_C_DEV_FAULT);
    eval 'sub SES_C_DEV_F3MASK () {( &SES_C_DEV_BYPB |  &SES_C_DEV_BYPA |  &SES_C_DEV_OFF |  &SES_C_DEV_FAULT);}' unless defined(&SES_C_DEV_F3MASK);
    eval 'sub SES_S_PSU_IDENT {
        my($d) = @_;
	    eval q((($d)-> &f1 & (1<<6)));
    }' unless defined(&SES_S_PSU_IDENT);
    eval 'sub SES_S_PSU_DCOC {
        my($d) = @_;
	    eval q((($d)-> &f2 & (1<<1)));
    }' unless defined(&SES_S_PSU_DCOC);
    eval 'sub SES_S_PSU_DCUV {
        my($d) = @_;
	    eval q((($d)-> &f2 & (1<<2)));
    }' unless defined(&SES_S_PSU_DCUV);
    eval 'sub SES_S_PSU_DCOV {
        my($d) = @_;
	    eval q((($d)-> &f2 & (1<<3)));
    }' unless defined(&SES_S_PSU_DCOV);
    eval 'sub SES_S_PSU_DCFAIL {
        my($d) = @_;
	    eval q((($d)-> &f3 & (1<<0)));
    }' unless defined(&SES_S_PSU_DCFAIL);
    eval 'sub SES_S_PSU_ACFAIL {
        my($d) = @_;
	    eval q((($d)-> &f3 & (1<<1)));
    }' unless defined(&SES_S_PSU_ACFAIL);
    eval 'sub SES_S_PSU_TEMPWARN {
        my($d) = @_;
	    eval q((($d)-> &f3 & (1<<2)));
    }' unless defined(&SES_S_PSU_TEMPWARN);
    eval 'sub SES_S_PSU_OVERTEMP {
        my($d) = @_;
	    eval q((($d)-> &f3 & (1<<3)));
    }' unless defined(&SES_S_PSU_OVERTEMP);
    eval 'sub SES_S_PSU_OFF {
        my($d) = @_;
	    eval q((($d)-> &f3 & (1<<4)));
    }' unless defined(&SES_S_PSU_OFF);
    eval 'sub SES_S_PSU_RQSTON {
        my($d) = @_;
	    eval q((($d)-> &f3 & (1<<5)));
    }' unless defined(&SES_S_PSU_RQSTON);
    eval 'sub SES_S_PSU_FAIL {
        my($d) = @_;
	    eval q((($d)-> &f3 & (1<<6)));
    }' unless defined(&SES_S_PSU_FAIL);
    eval 'sub SES_S_COOL_IDENT {
        my($d) = @_;
	    eval q((($d)-> &f1 & (1<<6)));
    }' unless defined(&SES_S_COOL_IDENT);
    eval 'sub SES_S_COOL_SPEED_MASK () {0x3;}' unless defined(&SES_S_COOL_SPEED_MASK);
    eval 'sub SES_S_COOL_SPEED {
        my($d) = @_;
	    eval q((($d)-> &f2 + (( &u_int16_t)(($d)-> &f2 &  &SES_S_COOL_SPEED_MASK) << 8)));
    }' unless defined(&SES_S_COOL_SPEED);
    eval 'sub SES_S_COOL_FACTOR () {10;}' unless defined(&SES_S_COOL_FACTOR);
    eval 'sub SES_S_COOL_CODE {
        my($d) = @_;
	    eval q((($d)-> &f3 & 0x7));
    }' unless defined(&SES_S_COOL_CODE);
    eval 'sub SES_S_COOL_C_STOPPED () {0x;}' unless defined(&SES_S_COOL_C_STOPPED);
    eval 'sub SES_S_COOL_C_LOW1 () {0x1;}' unless defined(&SES_S_COOL_C_LOW1);
    eval 'sub SES_S_COOL_C_LOW2 () {0x2;}' unless defined(&SES_S_COOL_C_LOW2);
    eval 'sub SES_S_COOL_C_LOW3 () {0x3;}' unless defined(&SES_S_COOL_C_LOW3);
    eval 'sub SES_S_COOL_C_INTER () {0x4;}' unless defined(&SES_S_COOL_C_INTER);
    eval 'sub SES_S_COOL_C_HI3 () {0x5;}' unless defined(&SES_S_COOL_C_HI3);
    eval 'sub SES_S_COOL_C_HI2 () {0x6;}' unless defined(&SES_S_COOL_C_HI2);
    eval 'sub SES_S_COOL_C_HI1 () {0x7;}' unless defined(&SES_S_COOL_C_HI1);
    eval 'sub SES_S_COOL_OFF () {(( &d)-> &f3 & (1<<4));}' unless defined(&SES_S_COOL_OFF);
    eval 'sub SES_S_COOL_RQSTON () {(( &d)-> &f3 & (1<<5));}' unless defined(&SES_S_COOL_RQSTON);
    eval 'sub SES_S_COOL_FAIL () {(( &d)-> &f3 & (1<<6));}' unless defined(&SES_S_COOL_FAIL);
    eval 'sub SES_S_TEMP_IDENT {
        my($d) = @_;
	    eval q((($d)-> &f1 & (1<<7)));
    }' unless defined(&SES_S_TEMP_IDENT);
    eval 'sub SES_S_TEMP {
        my($d) = @_;
	    eval q((($d)-> &f2));
    }' unless defined(&SES_S_TEMP);
    eval 'sub SES_S_TEMP_OFFSET () {(-20);}' unless defined(&SES_S_TEMP_OFFSET);
    eval 'sub SES_S_TEMP_UTWARN () {(( &d)-> &f3 & (1<<0));}' unless defined(&SES_S_TEMP_UTWARN);
    eval 'sub SES_S_TEMP_UTFAIL () {(( &d)-> &f3 & (1<<1));}' unless defined(&SES_S_TEMP_UTFAIL);
    eval 'sub SES_S_TEMP_OTWARN () {(( &d)-> &f3 & (1<<2));}' unless defined(&SES_S_TEMP_OTWARN);
    eval 'sub SES_S_TEMP_OTFAIL () {(( &d)-> &f3 & (1<<3));}' unless defined(&SES_S_TEMP_OTFAIL);
    eval 'sub SES_STAT_LEN {
        my($t, $e) = @_;
	    eval q(( &SES_STAT_HDRLEN +  &SES_STAT_ELEMLEN * (($t)+($e))));
    }' unless defined(&SES_STAT_LEN);
}
1;
