require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_DEV_BLUETOOTH_BTH5_H_)) {
    eval 'sub _DEV_BLUETOOTH_BTH5_H_ () {1;}' unless defined(&_DEV_BLUETOOTH_BTH5_H_);
    if((defined(&BYTE_ORDER) ? &BYTE_ORDER : undef) == (defined(&BIG_ENDIAN) ? &BIG_ENDIAN : undef)) {
    } else {
    }
    eval 'sub BTH5_FLAGS_SEQ_SHIFT () {0;}' unless defined(&BTH5_FLAGS_SEQ_SHIFT);
    eval 'sub BTH5_FLAGS_SEQ_MASK () {0x7;}' unless defined(&BTH5_FLAGS_SEQ_MASK);
    eval 'sub BTH5_FLAGS_SEQ {
        my($n) = @_;
	    eval q(((($n) &  &BTH5_FLAGS_SEQ_MASK) >>  &BTH5_FLAGS_SEQ_SHIFT));
    }' unless defined(&BTH5_FLAGS_SEQ);
    eval 'sub BTH5_FLAGS_ACK_SHIFT () {3;}' unless defined(&BTH5_FLAGS_ACK_SHIFT);
    eval 'sub BTH5_FLAGS_ACK_MASK () {0x38;}' unless defined(&BTH5_FLAGS_ACK_MASK);
    eval 'sub BTH5_FLAGS_ACK {
        my($n) = @_;
	    eval q(((($n) &  &BTH5_FLAGS_ACK_MASK) >>  &BTH5_FLAGS_ACK_SHIFT));
    }' unless defined(&BTH5_FLAGS_ACK);
    eval 'sub BTH5_FLAGS_CRC_PRESENT () {0x40;}' unless defined(&BTH5_FLAGS_CRC_PRESENT);
    eval 'sub BTH5_FLAGS_PROTOCOL_TYPE () {0x80;}' unless defined(&BTH5_FLAGS_PROTOCOL_TYPE);
    eval 'sub BTH5_FLAGS_PROTOCOL_REL () {0x80;}' unless defined(&BTH5_FLAGS_PROTOCOL_REL);
    eval 'sub BTH5_CONFIG_ACK_MASK () {0x7;}' unless defined(&BTH5_CONFIG_ACK_MASK);
    eval 'sub BTH5_CONFIG_FLOW_MASK () {(1<< 7);}' unless defined(&BTH5_CONFIG_FLOW_MASK);
    eval 'sub BTH5_SET_PLEN {
        my($hdrp, $n) = @_;
	    eval q( &do { ($hdrp)-> &plen1 = (($n) & 0xf); ($hdrp)-> &plen2 = (($n) >> 4); }  &while (0));
    }' unless defined(&BTH5_SET_PLEN);
    eval 'sub BTH5_GET_PLEN {
        my($hdrp) = @_;
	    eval q((($hdrp)-> &plen1 | (($hdrp)-> &plen2 << 4)));
    }' unless defined(&BTH5_GET_PLEN);
    eval 'sub BTH5_GET_CSUM {
        my($hdrp) = @_;
	    eval q((0xff - ( &uint8_t)(($hdrp)-> &flags + (($hdrp)-> &plen1 << 4) + ($hdrp)-> &ident + ($hdrp)-> &plen2)));
    }' unless defined(&BTH5_GET_CSUM);
    eval 'sub BTH5_SET_CSUM {
        my($hdrp) = @_;
	    eval q((($hdrp)-> &csum =  &BTH5_GET_CSUM($hdrp)));
    }' unless defined(&BTH5_SET_CSUM);
    eval 'sub BTH5_IDENT_ACKPKT () {0;}' unless defined(&BTH5_IDENT_ACKPKT);
    eval 'sub BTH5_SLIP_PKTSTART () {0xc0;}' unless defined(&BTH5_SLIP_PKTSTART);
    eval 'sub BTH5_SLIP_PKTEND () { &BTH5_SLIP_PKTSTART;}' unless defined(&BTH5_SLIP_PKTEND);
    eval 'sub BTH5_SLIP_XON () {0x11;}' unless defined(&BTH5_SLIP_XON);
    eval 'sub BTH5_SLIP_XOFF () {0x13;}' unless defined(&BTH5_SLIP_XOFF);
    eval 'sub BTH5_SLIP_ESCAPE () {0xdb;}' unless defined(&BTH5_SLIP_ESCAPE);
    eval 'sub BTH5_SLIP_ESCAPE_PKTEND () {0xdc;}' unless defined(&BTH5_SLIP_ESCAPE_PKTEND);
    eval 'sub BTH5_SLIP_ESCAPE_ESCAPE () {0xdd;}' unless defined(&BTH5_SLIP_ESCAPE_ESCAPE);
    eval 'sub BTH5_SLIP_ESCAPE_XON () {0xde;}' unless defined(&BTH5_SLIP_ESCAPE_XON);
    eval 'sub BTH5_SLIP_ESCAPE_XOFF () {0xdf;}' unless defined(&BTH5_SLIP_ESCAPE_XOFF);
    eval 'sub BTH5_SEQ_TX_TIMEOUT () {( &hz / 4);}' unless defined(&BTH5_SEQ_TX_TIMEOUT);
    eval 'sub BTH5_SEQ_TX_WINSIZE () {7;}' unless defined(&BTH5_SEQ_TX_WINSIZE);
    eval 'sub BTH5_SEQ_TX_RETRY_LIMIT () {20;}' unless defined(&BTH5_SEQ_TX_RETRY_LIMIT);
    eval 'sub BTH5_CHANNEL_HCI_CMD () {1;}' unless defined(&BTH5_CHANNEL_HCI_CMD);
    eval 'sub BTH5_CHANNEL_HCI_EVT () {4;}' unless defined(&BTH5_CHANNEL_HCI_EVT);
    eval 'sub BTH5_CHANNEL_HCI_ACL () {2;}' unless defined(&BTH5_CHANNEL_HCI_ACL);
    eval 'sub BTH5_CHANNEL_HCI_SCO () {3;}' unless defined(&BTH5_CHANNEL_HCI_SCO);
    eval 'sub BTH5_CHANNEL_LE () {15;}' unless defined(&BTH5_CHANNEL_LE);
    eval("sub le_state_shy () { 0; }") unless defined(&le_state_shy);
    eval("sub le_state_curious () { 1; }") unless defined(&le_state_curious);
    eval("sub le_state_garrulous () { 2; }") unless defined(&le_state_garrulous);
    eval 'sub BTH5_LE_SYNC () {{ 0x1, 0x7e };;}' unless defined(&BTH5_LE_SYNC);
    eval 'sub BTH5_LE_SYNCRESP () {{ 0x2, 0x7d };;}' unless defined(&BTH5_LE_SYNCRESP);
    eval 'sub BTH5_LE_CONF () {{ 0x3, 0xfc, 0xf };;}' unless defined(&BTH5_LE_CONF);
    eval 'sub BTH5_LE_CONFRESP () {{ 0x4, 0x7b, 0xf };;}' unless defined(&BTH5_LE_CONFRESP);
    eval 'sub BTH5_LE_TSHY_TIMEOUT () { &hz;}' unless defined(&BTH5_LE_TSHY_TIMEOUT);
    eval 'sub BTH5_LE_TCONF_TIMEOUT () { &hz;}' unless defined(&BTH5_LE_TCONF_TIMEOUT);
}
1;
