require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&__IF_SAN_FRONT_END_H_)) {
    eval 'sub __IF_SAN_FRONT_END_H_ () {1;}' unless defined(&__IF_SAN_FRONT_END_H_);
    eval 'sub WAN_MEDIA_NONE () {0x;}' unless defined(&WAN_MEDIA_NONE);
    eval 'sub WAN_MEDIA_T1 () {0x1;}' unless defined(&WAN_MEDIA_T1);
    eval 'sub WAN_MEDIA_E1 () {0x2;}' unless defined(&WAN_MEDIA_E1);
    eval 'sub WAN_MEDIA_56K () {0x3;}' unless defined(&WAN_MEDIA_56K);
    eval 'sub S508_ADPTR () {0x1;}' unless defined(&S508_ADPTR);
    eval 'sub S5141_ADPTR_1_CPU_SERIAL () {0x11;}' unless defined(&S5141_ADPTR_1_CPU_SERIAL);
    eval 'sub S5142_ADPTR_2_CPU_SERIAL () {0x12;}' unless defined(&S5142_ADPTR_2_CPU_SERIAL);
    eval 'sub S5143_ADPTR_1_CPU_FT1 () {0x13;}' unless defined(&S5143_ADPTR_1_CPU_FT1);
    eval 'sub S5144_ADPTR_1_CPU_T1E1 () {0x14;}' unless defined(&S5144_ADPTR_1_CPU_T1E1);
    eval 'sub S5145_ADPTR_1_CPU_56K () {0x15;}' unless defined(&S5145_ADPTR_1_CPU_56K);
    eval 'sub S5147_ADPTR_2_CPU_T1E1 () {0x17;}' unless defined(&S5147_ADPTR_2_CPU_T1E1);
    eval 'sub S5148_ADPTR_1_CPU_T1E1 () {0x18;}' unless defined(&S5148_ADPTR_1_CPU_T1E1);
    eval 'sub S518_ADPTR_1_CPU_ADSL () {0x18;}' unless defined(&S518_ADPTR_1_CPU_ADSL);
    eval 'sub A101_ADPTR_T1E1_MASK () {0x40;}' unless defined(&A101_ADPTR_T1E1_MASK);
    eval 'sub A101_ADPTR_1TE1 () {0x41;}' unless defined(&A101_ADPTR_1TE1);
    eval 'sub A101_ADPTR_2TE1 () {0x42;}' unless defined(&A101_ADPTR_2TE1);
    eval 'sub A100_ADPTR_T3E3_MASK () {0x80;}' unless defined(&A100_ADPTR_T3E3_MASK);
    eval 'sub A100_ADPTR_1_CHN_T3E3 () {0x81;}' unless defined(&A100_ADPTR_1_CHN_T3E3);
    eval 'sub A105_ADPTR_1_CHN_T3E3 () {0x82;}' unless defined(&A105_ADPTR_1_CHN_T3E3);
    eval 'sub OPERATE_T1E1_AS_SERIAL () {0x8000;}' unless defined(&OPERATE_T1E1_AS_SERIAL);
    eval 'sub SDLA_ADPTR_DECODE {
        my($adapter_type) = @_;
	    eval q(($adapter_type ==  &S5141_ADPTR_1_CPU_SERIAL) ? \\"S514-1-PCI\\" : ($adapter_type ==  &S5142_ADPTR_2_CPU_SERIAL) ? \\"S514-2-PCI\\" : ($adapter_type ==  &S5143_ADPTR_1_CPU_FT1) ? \\"S514-3-PCI\\" : ($adapter_type ==  &S5144_ADPTR_1_CPU_T1E1) ? \\"S514-4-PCI\\" : ($adapter_type ==  &S5145_ADPTR_1_CPU_56K) ? \\"S514-5-PCI\\" : ($adapter_type ==  &S5147_ADPTR_2_CPU_T1E1) ? \\"S514-7-PCI\\" : ($adapter_type ==  &S518_ADPTR_1_CPU_ADSL) ? \\"S518-PCI  \\" : ($adapter_type ==  &A101_ADPTR_1TE1) ? \\"AFT-A101  \\" : ($adapter_type ==  &A101_ADPTR_2TE1) ? \\"AFT-A102  \\" : ($adapter_type ==  &A105_ADPTR_1_CHN_T3E3) ? \\"A105-1-PCI\\" : ($adapter_type ==  &A105_ADPTR_1_CHN_T3E3) ? \\"A105-2    \\" : \\"UNKNOWN   \\");
    }' unless defined(&SDLA_ADPTR_DECODE);
    eval 'sub WAN_FE_GET_STAT () {( &WAN_FE_UDP_CMD_START + 0);}' unless defined(&WAN_FE_GET_STAT);
    eval 'sub WAN_FE_SET_LB_MODE () {( &WAN_FE_UDP_CMD_START + 1);}' unless defined(&WAN_FE_SET_LB_MODE);
    eval 'sub WAN_FE_FLUSH_PMON () {( &WAN_FE_UDP_CMD_START + 2);}' unless defined(&WAN_FE_FLUSH_PMON);
    eval 'sub WAN_FE_GET_CFG () {( &WAN_FE_UDP_CMD_START + 3);}' unless defined(&WAN_FE_GET_CFG);
    eval 'sub READ_FRONT_END_REGISTER () {( &WAN_FE_CMD_START+0);}' unless defined(&READ_FRONT_END_REGISTER);
    eval 'sub WRITE_FRONT_END_REGISTER () {( &WAN_FE_CMD_START+1);}' unless defined(&WRITE_FRONT_END_REGISTER);
    eval 'sub READ_FRONT_END_STATISTICS () {( &WAN_FE_CMD_START+2);}' unless defined(&READ_FRONT_END_STATISTICS);
    eval 'sub FLUSH_FRONT_END_STATISTICS () {( &WAN_FE_CMD_START+3);}' unless defined(&FLUSH_FRONT_END_STATISTICS);
    if(defined(&_KERNEL)) {
	eval 'sub SET_ADAPTER_CONFIGURATION () {( &WAN_INTERFACE_CMD_START+0);}' unless defined(&SET_ADAPTER_CONFIGURATION);
	eval 'sub READ_ADAPTER_CONFIGURATION () {( &WAN_INTERFACE_CMD_START+1);}' unless defined(&READ_ADAPTER_CONFIGURATION);
	eval 'sub WAN_FE_GET_STAT () {( &WAN_FE_UDP_CMD_START + 0);}' unless defined(&WAN_FE_GET_STAT);
	eval 'sub WAN_FE_SET_LB_MODE () {( &WAN_FE_UDP_CMD_START + 1);}' unless defined(&WAN_FE_SET_LB_MODE);
	eval 'sub WAN_FE_FLUSH_PMON () {( &WAN_FE_UDP_CMD_START + 2);}' unless defined(&WAN_FE_FLUSH_PMON);
	eval 'sub WAN_FE_GET_CFG () {( &WAN_FE_UDP_CMD_START + 3);}' unless defined(&WAN_FE_GET_CFG);
	eval 'sub LGTH_FE_CFG_DATA_INVALID () {0x91;}' unless defined(&LGTH_FE_CFG_DATA_INVALID);
	eval 'sub LGTH_ADAPTER_CFG_DATA_INVALID () {0x91;}' unless defined(&LGTH_ADAPTER_CFG_DATA_INVALID);
	eval 'sub INVALID_FE_CFG_DATA () {0x92;}' unless defined(&INVALID_FE_CFG_DATA);
	eval 'sub ADPTR_OPERATING_FREQ_INVALID () {0x92;}' unless defined(&ADPTR_OPERATING_FREQ_INVALID);
	eval 'sub PROT_CFG_BEFORE_FE_CFG () {0x93;}' unless defined(&PROT_CFG_BEFORE_FE_CFG);
	eval 'sub SET_FE_RX_DISC_TX_IDLE_CFG () {0x98;}' unless defined(&SET_FE_RX_DISC_TX_IDLE_CFG);
	eval 'sub READ_FE_RX_DISC_TX_IDLE_CFG () {0x99;}' unless defined(&READ_FE_RX_DISC_TX_IDLE_CFG);
	eval 'sub SET_TE1_SIGNALING_CFG () {0x9a;}' unless defined(&SET_TE1_SIGNALING_CFG);
	eval 'sub READ_TE1_SIGNALING_CFG () {0x9b;}' unless defined(&READ_TE1_SIGNALING_CFG);
	eval 'sub COMMAND_INVALID_FOR_ADAPTER () {0x9f;}' unless defined(&COMMAND_INVALID_FOR_ADAPTER);
	eval 'sub NO_ACTIVE_RX_TIME_SLOTS_T1 () {24;}' unless defined(&NO_ACTIVE_RX_TIME_SLOTS_T1);
	eval 'sub NO_ACTIVE_TX_TIME_SLOTS_T1 () {24;}' unless defined(&NO_ACTIVE_TX_TIME_SLOTS_T1);
	eval 'sub NO_ACTIVE_RX_TIME_SLOTS_E1 () {32;}' unless defined(&NO_ACTIVE_RX_TIME_SLOTS_E1);
	eval 'sub NO_ACTIVE_TX_TIME_SLOTS_E1 () {31;}' unless defined(&NO_ACTIVE_TX_TIME_SLOTS_E1);
	eval 'sub READ_REG {
	    my($reg) = @_;
    	    eval q( ($card->{read_front_end_reg})( &card, $reg));
	}' unless defined(&READ_REG);
	eval 'sub WRITE_REG {
	    my($reg, $value) = @_;
    	    eval q( ($card->{write_front_end_reg})( &card, $reg, ($value)));
	}' unless defined(&WRITE_REG);
	eval("sub AFT_LED_ON () { 0; }") unless defined(&AFT_LED_ON);
	eval("sub AFT_LED_OFF () { 1; }") unless defined(&AFT_LED_OFF);
	eval("sub AFT_LED_TOGGLE () { 2; }") unless defined(&AFT_LED_TOGGLE);
    }
}
1;
