require '_h2ph_pre.ph';

no warnings qw(redefine misc);

unless(defined(&_DEV_BLUETOOTH_BCSP_H_)) {
    eval 'sub _DEV_BLUETOOTH_BCSP_H_ () {1;}' unless defined(&_DEV_BLUETOOTH_BCSP_H_);
    if((defined(&BYTE_ORDER) ? &BYTE_ORDER : undef) == (defined(&BIG_ENDIAN) ? &BIG_ENDIAN : undef)) {
    } else {
    }
    eval 'sub BCSP_FLAGS_SEQ_SHIFT () {0;}' unless defined(&BCSP_FLAGS_SEQ_SHIFT);
    eval 'sub BCSP_FLAGS_SEQ_MASK () {0x7;}' unless defined(&BCSP_FLAGS_SEQ_MASK);
    eval 'sub BCSP_FLAGS_SEQ {
        my($n) = @_;
	    eval q(((($n) &  &BCSP_FLAGS_SEQ_MASK) >>  &BCSP_FLAGS_SEQ_SHIFT));
    }' unless defined(&BCSP_FLAGS_SEQ);
    eval 'sub BCSP_FLAGS_ACK_SHIFT () {3;}' unless defined(&BCSP_FLAGS_ACK_SHIFT);
    eval 'sub BCSP_FLAGS_ACK_MASK () {0x38;}' unless defined(&BCSP_FLAGS_ACK_MASK);
    eval 'sub BCSP_FLAGS_ACK {
        my($n) = @_;
	    eval q(((($n) &  &BCSP_FLAGS_ACK_MASK) >>  &BCSP_FLAGS_ACK_SHIFT));
    }' unless defined(&BCSP_FLAGS_ACK);
    eval 'sub BCSP_FLAGS_CRC_PRESENT () {0x40;}' unless defined(&BCSP_FLAGS_CRC_PRESENT);
    eval 'sub BCSP_FLAGS_PROTOCOL_TYPE () {0x80;}' unless defined(&BCSP_FLAGS_PROTOCOL_TYPE);
    eval 'sub BCSP_FLAGS_PROTOCOL_REL () {0x80;}' unless defined(&BCSP_FLAGS_PROTOCOL_REL);
    eval 'sub BCSP_SET_PLEN {
        my($hdrp, $n) = @_;
	    eval q( &do { ($hdrp)-> &plen1 = (($n) & 0xf); ($hdrp)-> &plen2 = (($n) >> 4); }  &while (0));
    }' unless defined(&BCSP_SET_PLEN);
    eval 'sub BCSP_GET_PLEN {
        my($hdrp) = @_;
	    eval q((($hdrp)-> &plen1 | (($hdrp)-> &plen2 << 4)));
    }' unless defined(&BCSP_GET_PLEN);
    eval 'sub BCSP_GET_CSUM {
        my($hdrp) = @_;
	    eval q((0xff - ( &uint8_t)(($hdrp)-> &flags + (($hdrp)-> &plen1 << 4) + ($hdrp)-> &ident + ($hdrp)-> &plen2)));
    }' unless defined(&BCSP_GET_CSUM);
    eval 'sub BCSP_SET_CSUM {
        my($hdrp) = @_;
	    eval q((($hdrp)-> &csum =  &BCSP_GET_CSUM($hdrp)));
    }' unless defined(&BCSP_SET_CSUM);
    eval 'sub BCSP_IDENT_ACKPKT () {0;}' unless defined(&BCSP_IDENT_ACKPKT);
    eval 'sub BCSP_SLIP_PKTSTART () {0xc0;}' unless defined(&BCSP_SLIP_PKTSTART);
    eval 'sub BCSP_SLIP_PKTEND () { &BCSP_SLIP_PKTSTART;}' unless defined(&BCSP_SLIP_PKTEND);
    eval 'sub BCSP_SLIP_ESCAPE () {0xdb;}' unless defined(&BCSP_SLIP_ESCAPE);
    eval 'sub BCSP_SLIP_ESCAPE_PKTEND () {0xdc;}' unless defined(&BCSP_SLIP_ESCAPE_PKTEND);
    eval 'sub BCSP_SLIP_ESCAPE_ESCAPE () {0xdd;}' unless defined(&BCSP_SLIP_ESCAPE_ESCAPE);
    eval 'sub BCSP_SEQ_TX_TIMEOUT () {( &hz / 4);}' unless defined(&BCSP_SEQ_TX_TIMEOUT);
    eval 'sub BCSP_SEQ_TX_WINSIZE () {4;}' unless defined(&BCSP_SEQ_TX_WINSIZE);
    eval 'sub BCSP_SEQ_TX_RETRY_LIMIT () {20;}' unless defined(&BCSP_SEQ_TX_RETRY_LIMIT);
    eval 'sub BCSP_CHANNEL_LE () {1;}' unless defined(&BCSP_CHANNEL_LE);
    eval 'sub BCSP_CHANNEL_BCCMD () {2;}' unless defined(&BCSP_CHANNEL_BCCMD);
    eval 'sub BCSP_CHANNEL_HQ () {3;}' unless defined(&BCSP_CHANNEL_HQ);
    eval 'sub BCSP_CHANNEL_DEVMGT () {4;}' unless defined(&BCSP_CHANNEL_DEVMGT);
    eval 'sub BCSP_CHANNEL_HCI_CMDEVT () {5;}' unless defined(&BCSP_CHANNEL_HCI_CMDEVT);
    eval 'sub BCSP_CHANNEL_HCI_ACL () {6;}' unless defined(&BCSP_CHANNEL_HCI_ACL);
    eval 'sub BCSP_CHANNEL_HCI_SCO () {7;}' unless defined(&BCSP_CHANNEL_HCI_SCO);
    eval 'sub BCSP_CHANNEL_L2CAP () {8;}' unless defined(&BCSP_CHANNEL_L2CAP);
    eval 'sub BCSP_CHANNEL_RFCOMM () {9;}' unless defined(&BCSP_CHANNEL_RFCOMM);
    eval 'sub BCSP_CHANNEL_SDP () {10;}' unless defined(&BCSP_CHANNEL_SDP);
    eval 'sub BCSP_CHANNEL_DFU () {12;}' unless defined(&BCSP_CHANNEL_DFU);
    eval 'sub BCSP_CHANNEL_VM () {13;}' unless defined(&BCSP_CHANNEL_VM);
    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 BCSP_LE_SYNC () {{ 0xda, 0xdc, 0xed, 0xed };}' unless defined(&BCSP_LE_SYNC);
    eval 'sub BCSP_LE_SYNCRESP () {{ 0xac, 0xaf, 0xef, 0xee };}' unless defined(&BCSP_LE_SYNCRESP);
    eval 'sub BCSP_LE_CONF () {{ 0xad, 0xef, 0xac, 0xed };}' unless defined(&BCSP_LE_CONF);
    eval 'sub BCSP_LE_CONFRESP () {{ 0xde, 0xad, 0xd0, 0xd0 };}' unless defined(&BCSP_LE_CONFRESP);
    eval 'sub BCSP_LE_TSHY_TIMEOUT () { &hz;}' unless defined(&BCSP_LE_TSHY_TIMEOUT);
    eval 'sub BCSP_LE_TCONF_TIMEOUT () { &hz;}' unless defined(&BCSP_LE_TCONF_TIMEOUT);
}
1;
