require '_h2ph_pre.ph';

no warnings 'redefine';

unless(defined(&_NG_UBT_VAR_H_)) {
    eval 'sub _NG_UBT_VAR_H_ () {1;}' unless defined(&_NG_UBT_VAR_H_);
    eval 'sub NG_UBT_NODE_TYPE () {"ubt";}' unless defined(&NG_UBT_NODE_TYPE);
    eval 'sub NG_UBT_HOOK () {"hook";}' unless defined(&NG_UBT_HOOK);
    eval 'sub NGM_UBT_COOKIE () {1021837971;}' unless defined(&NGM_UBT_COOKIE);
    eval 'sub NG_UBT_ALERT_LEVEL () {1;}' unless defined(&NG_UBT_ALERT_LEVEL);
    eval 'sub NG_UBT_ERR_LEVEL () {2;}' unless defined(&NG_UBT_ERR_LEVEL);
    eval 'sub NG_UBT_WARN_LEVEL () {3;}' unless defined(&NG_UBT_WARN_LEVEL);
    eval 'sub NG_UBT_INFO_LEVEL () {4;}' unless defined(&NG_UBT_INFO_LEVEL);
    eval 'sub NGM_UBT_NODE_SET_DEBUG () {1;}' unless defined(&NGM_UBT_NODE_SET_DEBUG);
    eval 'sub NGM_UBT_NODE_GET_DEBUG () {2;}' unless defined(&NGM_UBT_NODE_GET_DEBUG);
    eval 'sub NGM_UBT_NODE_SET_QLEN () {3;}' unless defined(&NGM_UBT_NODE_SET_QLEN);
    eval 'sub NGM_UBT_NODE_GET_QLEN () {4;}' unless defined(&NGM_UBT_NODE_GET_QLEN);
    eval 'sub NGM_UBT_NODE_QUEUE_CMD () {1;}' unless defined(&NGM_UBT_NODE_QUEUE_CMD);
    eval 'sub NGM_UBT_NODE_QUEUE_ACL () {2;}' unless defined(&NGM_UBT_NODE_QUEUE_ACL);
    eval 'sub NGM_UBT_NODE_QUEUE_SCO () {3;}' unless defined(&NGM_UBT_NODE_QUEUE_SCO);
    eval 'sub NGM_UBT_NODE_GET_STAT () {5;}' unless defined(&NGM_UBT_NODE_GET_STAT);
    eval 'sub NGM_UBT_NODE_RESET_STAT () {6;}' unless defined(&NGM_UBT_NODE_RESET_STAT);
    eval 'sub NGM_UBT_NODE_DEV_NODES () {7;}' unless defined(&NGM_UBT_NODE_DEV_NODES);
    eval 'sub NG_UBT_M_PULLUP {
        my($m, $s) = @_;
	    eval q( &do {  &if (($m)-> &m_len < ($s)) ($m) =  &m_pullup(($m), ($s));  &if (($m) ==  &NULL)  &NG_UBT_ALERT(\\"%s: %s - m_pullup(%d) failed\\\\n\\",  &__func__,  &USBDEVNAME( ($sc->{sc_dev})), ($s)); }  &while (0));
    }' unless defined(&NG_UBT_M_PULLUP);
    eval 'sub NG_UBT_ALERT () { &if ( ($sc->{sc_debug}) >=  &NG_UBT_ALERT_LEVEL)  &printf;}' unless defined(&NG_UBT_ALERT);
    eval 'sub NG_UBT_ERR () { &if ( ($sc->{sc_debug}) >=  &NG_UBT_ERR_LEVEL)  &printf;}' unless defined(&NG_UBT_ERR);
    eval 'sub NG_UBT_WARN () { &if ( ($sc->{sc_debug}) >=  &NG_UBT_WARN_LEVEL)  &printf;}' unless defined(&NG_UBT_WARN);
    eval 'sub NG_UBT_INFO () { &if ( ($sc->{sc_debug}) >=  &NG_UBT_INFO_LEVEL)  &printf;}' unless defined(&NG_UBT_INFO);
    eval 'sub UBT_HCI_REQUEST () {0x20;}' unless defined(&UBT_HCI_REQUEST);
    eval 'sub UBT_DEFAULT_QLEN () {12;}' unless defined(&UBT_DEFAULT_QLEN);
    eval 'sub UBT_NEED_FRAME_TYPE () {(1<< 0);}' unless defined(&UBT_NEED_FRAME_TYPE);
    eval 'sub UBT_HAVE_FRAME_TYPE () { &UBT_NEED_FRAME_TYPE;}' unless defined(&UBT_HAVE_FRAME_TYPE);
    eval 'sub UBT_CMD_XMIT () {(1<< 1);}' unless defined(&UBT_CMD_XMIT);
    eval 'sub UBT_ACL_XMIT () {(1<< 2);}' unless defined(&UBT_ACL_XMIT);
    eval 'sub UBT_SCO_XMIT () {(1<< 3);}' unless defined(&UBT_SCO_XMIT);
    eval 'sub UBT_EVT_RECV () {(1<< 4);}' unless defined(&UBT_EVT_RECV);
    eval 'sub UBT_ACL_RECV () {(1<< 5);}' unless defined(&UBT_ACL_RECV);
    eval 'sub UBT_SCO_RECV () {(1<< 6);}' unless defined(&UBT_SCO_RECV);
    eval 'sub UBT_CTRL_DEV () {(1<< 7);}' unless defined(&UBT_CTRL_DEV);
    eval 'sub UBT_INTR_DEV () {(1<< 8);}' unless defined(&UBT_INTR_DEV);
    eval 'sub UBT_BULK_DEV () {(1<< 9);}' unless defined(&UBT_BULK_DEV);
    eval 'sub UBT_ANY_DEV () {( &UBT_CTRL_DEV| &UBT_INTR_DEV| &UBT_BULK_DEV);}' unless defined(&UBT_ANY_DEV);
    eval 'sub NG_UBT_STAT_PCKTS_SENT {
        my($s) = @_;
	    eval q(($s). &pckts_sent ++);
    }' unless defined(&NG_UBT_STAT_PCKTS_SENT);
    eval 'sub NG_UBT_STAT_BYTES_SENT {
        my($s, $n) = @_;
	    eval q(($s). &bytes_sent += ($n));
    }' unless defined(&NG_UBT_STAT_BYTES_SENT);
    eval 'sub NG_UBT_STAT_PCKTS_RECV {
        my($s) = @_;
	    eval q(($s). &pckts_recv ++);
    }' unless defined(&NG_UBT_STAT_PCKTS_RECV);
    eval 'sub NG_UBT_STAT_BYTES_RECV {
        my($s, $n) = @_;
	    eval q(($s). &bytes_recv += ($n));
    }' unless defined(&NG_UBT_STAT_BYTES_RECV);
    eval 'sub NG_UBT_STAT_OERROR {
        my($s) = @_;
	    eval q(($s). &oerrors ++);
    }' unless defined(&NG_UBT_STAT_OERROR);
    eval 'sub NG_UBT_STAT_IERROR {
        my($s) = @_;
	    eval q(($s). &ierrors ++);
    }' unless defined(&NG_UBT_STAT_IERROR);
    eval 'sub NG_UBT_STAT_RESET {
        my($s) = @_;
	    eval q( &bzero(($s), $sizeof{($s)}));
    }' unless defined(&NG_UBT_STAT_RESET);
    eval 'sub UBT_INTR_BUFFER_SIZE () { &MCLBYTES;}' unless defined(&UBT_INTR_BUFFER_SIZE);
    eval 'sub UBT_CTRL_BUFFER_SIZE () {($sizeof{ &ng_hci_cmd_pkt_t} +  &NG_HCI_CMD_PKT_SIZE);}' unless defined(&UBT_CTRL_BUFFER_SIZE);
    eval 'sub UBT_BULK_BUFFER_SIZE () { &MCLBYTES;}' unless defined(&UBT_BULK_BUFFER_SIZE);
    eval 'sub UBT_ISOC_BUFFER_SIZE () {($sizeof{ &ng_hci_scodata_pkt_t} +  &NG_HCI_SCO_PKT_SIZE);}' unless defined(&UBT_ISOC_BUFFER_SIZE);
    if(0) {
    }
}
1;
